import org.collectionspace.services.common.query.QueryManager;
import org.collectionspace.services.jaxb.AbstractCommonList;
+import java.util.List;
+
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
@Produces({"application/xml"})
@Consumes({"application/xml"})
public class BatchResource extends NuxeoBasedResource {
-
+
protected final String COMMON_SCHEMA = "batch_common";
@Override
public Class getCommonPartClass() {
return BatchCommon.class;
}
-
+
// other resource methods and use the getRepositoryClient() methods.
@Override
protected AbstractCommonList getCommonList(UriInfo ui) {
MultivaluedMap<String, String> queryParams = ctx.getQueryParams();
DocumentHandler handler = createDocumentHandler(ctx);
String docType = queryParams.getFirst(IQueryManager.SEARCH_TYPE_DOCTYPE);
- String mode = queryParams.getFirst(IQueryManager.SEARCH_TYPE_INVOCATION_MODE);
+ List<String> modes = queryParams.get(IQueryManager.SEARCH_TYPE_INVOCATION_MODE);
String whereClause = null;
DocumentFilter documentFilter = null;
String common_part = ctx.getCommonPartLabel();
-
+
if (docType != null && !docType.isEmpty()) {
whereClause = QueryManager.createWhereClauseForInvocableByDocType(
common_part, docType);
documentFilter = handler.getDocumentFilter();
documentFilter.appendWhereClause(whereClause, IQueryManager.SEARCH_QUALIFIER_AND);
}
-
- if (mode != null && !mode.isEmpty()) {
+
+ if (modes != null && !modes.isEmpty()) {
whereClause = QueryManager.createWhereClauseForInvocableByMode(
- common_part, mode);
+ common_part, modes);
documentFilter = handler.getDocumentFilter();
documentFilter.appendWhereClause(whereClause, IQueryManager.SEARCH_QUALIFIER_AND);
}
-
+
if (whereClause !=null && logger.isDebugEnabled()) {
logger.debug("The WHERE clause is: " + documentFilter.getWhereClause());
}
-
+
getRepositoryClient(ctx).getFiltered(ctx, handler);
AbstractCommonList list = (AbstractCommonList) handler.getCommonPartList();
return list;
throw bigReThrow(e, ServiceMessages.LIST_FAILED);
}
}
-
+
/**
* Gets the authorityItem list for the specified authority
* If partialPerm is specified, keywords will be ignored.
- *
+ *
* @param specifier either a CSID or one of the urn forms
* @param partialTerm if non-null, matches partial terms
* @param keywords if non-null, matches terms in the keyword index for items
* @param ui passed to include additional parameters, like pagination controls
- *
+ *
* @return the authorityItem list
*/
@GET
throw bigReThrow(e, ServiceMessages.SEARCH_FAILED);
}
}
-
+
private String createWhereClauseForDocType(String docType) {
- String trimmed = (docType == null)?"":docType.trim();
+ String trimmed = (docType == null)?"":docType.trim();
if (trimmed.isEmpty()) {
throw new RuntimeException("No docType specified.");
}
}
private String createWhereClauseForMode(String mode) throws BadRequestException {
- String trimmed = (mode == null)?"":mode.trim();
+ String trimmed = (mode == null)?"":mode.trim();
if (trimmed.isEmpty()) {
throw new RuntimeException("No mode specified.");
}
}
return ptClause;
}
-
+
private BatchCommon getBatchCommon(String csid) throws Exception {
BatchCommon result = null;
-
+
ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext();
PoxPayloadOut ppo = get(csid, ctx);
PayloadPart batchCommonPart = ppo.getPart(BatchClient.SERVICE_COMMON_PART_NAME);
result = (BatchCommon)batchCommonPart.getBody();
-
+
return result;
}
-
+
@POST
@Path("{csid}")
public InvocationResults invokeBatchJob(
BatchDocumentModelHandler handler = (BatchDocumentModelHandler)createDocumentHandler(ctx);
return handler.invokeBatchJob(ctx, csid, resourceMap, invContext, getBatchCommon(csid));
} catch (Exception e) {
- String msg = String.format("%s Could not invoke batch job with CSID='%s'.",
+ String msg = String.format("%s Could not invoke batch job with CSID='%s'.",
ServiceMessages.POST_FAILED, csid);
throw bigReThrow(e, msg);
}
-/**
+/**
* IQueryManager.java
*
* {Purpose of This Class}
*/
package org.collectionspace.services.client;
+import java.util.List;
+
public interface IQueryManager {
-
+
final static String SEARCH_GROUP_OPEN = "(";
final static String SEARCH_GROUP_CLOSE = ")";
final static String SEARCH_TERM_SEPARATOR = " ";
final static String SEARCH_QUALIFIER_OR = SEARCH_TERM_SEPARATOR + "OR" + SEARCH_TERM_SEPARATOR;
final static String DEFAULT_SELECT_CLAUSE = "SELECT * FROM ";
final static String CSID_QUERY_PARAM = "csid";
-
+
//
// Nuxeo pseudo-values (and filters) for special document properties.
// In the CMIS context, the prefix is nuxeo, not ecm
final static String NUXEO_CMIS_IS_VERSION = "nuxeo:isVersion";
final static String NUXEO_CMIS_IS_VERSION_FILTER = NUXEO_CMIS_IS_VERSION + " = false";
-
+
//
// Query params for CMIS queries on the relationship (Relation) table.
//
final static String SEARCH_RELATED_TO_CSID_AS_EITHER = "rtSbjOrObj";
final static String SEARCH_RELATED_MATCH_OBJ_DOCTYPES = "rtObjDocTypes";
final static String SELECT_DOC_TYPE_FIELD = "selectDocType";
-
+
final static String MARK_RELATED_TO_CSID_AS_SUBJECT = "mkRtSbj";
final static String MARK_RELATED_TO_CSID_AS_EITHER = "mkRtSbjOrObj";
-
+
//
// Generic CMIS property mapping constants
//
final static String CMIS_NUXEO_TITLE = "dc:title";
final static String CMIS_CS_UPDATED_AT = CollectionSpaceClient.COLLECTIONSPACE_CORE_SCHEMA + ":" +
CollectionSpaceClient.COLLECTIONSPACE_CORE_UPDATED_AT;
-
+
// CollectionSpace CMIS property mapping constants
final static String CMIS_TARGET_PREFIX = "DOC";
final static String CMIS_CORESCHEMA_PREFIX = "CORE";
// Relations CMIS property mapping constants
final static String CMIS_RELATIONS_PREFIX = "REL";
-
- final static String CMIS_JOIN_NUXEO_IS_VERSION_FILTER =
+
+ final static String CMIS_JOIN_NUXEO_IS_VERSION_FILTER =
IQueryManager.CMIS_TARGET_PREFIX + "." + IQueryManager.NUXEO_CMIS_IS_VERSION_FILTER;
final static String CMIS_JOIN_TENANT_ID_FILTER =
IQueryManager.CMIS_RELATIONS_PREFIX + "." + CollectionSpaceClient.CORE_TENANTID;
final static String CMIS_TARGET_TITLE = CMIS_TARGET_PREFIX + "." + CMIS_NUXEO_TITLE;
final static String CMIS_TARGET_NAME = CMIS_TARGET_PREFIX + "." + CMIS_NUXEO_NAME;
final static String CMIS_TARGET_UPDATED_AT = CMIS_TARGET_PREFIX + "." + CMIS_CS_UPDATED_AT;
-
+
final static String TENANT_USES_STARTING_WILDCARD_FOR_PARTIAL_TERM = "ptStartingWildcard";
final static String MAX_LIST_ITEMS_RETURNED_LIMIT_ON_JDBC_QUERIES = "maxListItemsReturnedLimitOnJdbcQueries";
final static String JDBC_QUERIES_ARE_TENANT_ID_RESTRICTED = "jdbcQueriesAreTenantIdRestricted";
public void execQuery(String queryString);
-
+
public String getDatasourceName();
-
+
/**
* Creates the where clause from keywords.
- *
+ *
* @param keywords the keywords
- *
+ *
* @return the string
*/
public String createWhereClauseFromKeywords(String keywords);
-
+
public String createWhereClauseFromAdvancedSearch(String advancedSearch);
final static boolean FILTER_EXCLUDE = true;
final static boolean FILTER_INCLUDE = false;
-
+
/**
- * Creates a query to filter a qualified (string) field according to a list of string values.
+ * Creates a query to filter a qualified (string) field according to a list of string values.
* @param qualifiedField The schema-qualified field to filter on
* @param filterTerms the list of one or more strings to filter on
* @param fExclude If true, will require qualifiedField NOT match the filters strings.
* @return queryString
*/
public String createWhereClauseToFilterFromStringList(String qualifiedField, String[] filterTerms, boolean fExclude);
-
+
/**
* Creates the where clause for partial term match.
- *
+ *
* @param field the qualified field to match on
* @param partialTerm the term to match against
- *
+ *
* @return the string
*/
public String createWhereClauseForPartialMatch(String dataSourceName,
/**
* Creates a filtering where clause from docType, for invocables.
- *
+ *
* @param schema the schema name for this invocable type
* @param docType the docType
- *
+ *
* @return the string
*/
public String createWhereClauseForInvocableByDocType(String schema, String docType);
-
+
/**
* Creates a filtering where clause from invocation mode, for invocables.
- *
+ *
* @param schema the schema name for this invocable type
* @param mode the mode
- *
+ *
* @return the string
*/
public String createWhereClauseForInvocableByMode(String schema, String mode);
+ public String createWhereClauseForInvocableByMode(String schema, List<String> modes);
+
/*
- *
+ *
*/
public String createWhereClauseFromCsid(String csid);
-
+
}
-/**
+/**
* QueryManager.java
*
* {Purpose of This Class}
*/
package org.collectionspace.services.common.query;
+import java.util.List;
+
import org.collectionspace.services.client.IQueryManager;
import org.collectionspace.services.common.ServiceMain;
import org.collectionspace.services.common.config.TenantBindingConfigReaderImpl;
public class QueryManager {
static private final IQueryManager queryManager = new QueryManagerNuxeoImpl();
-
+
/**
* Creates the where clause from keywords.
- *
+ *
* @param keywords the keywords
- *
+ *
* @return the string
*/
static public String createWhereClauseFromKeywords(String keywords) {
return queryManager.createWhereClauseFromKeywords(keywords);
}
-
+
static public String createWhereClauseFromAdvancedSearch(String keywords) {
return queryManager.createWhereClauseFromAdvancedSearch(keywords);
}
-
+
static public String createWhereClauseFromCsid(String csid) {
return queryManager.createWhereClauseFromCsid(csid);
- }
-
+ }
+
/**
* Creates the where clause for partial term match.
- *
+ *
* @param field the qualified field to match on
* @param partialTerm the term to match against
- *
+ *
* @return the string
*/
static public String createWhereClauseForPartialMatch(ServiceContext ctx,
TenantBindingType tenantBinding = tReader.getTenantBinding(ctx.getTenantId());
String ptStartingWildcardValue = TenantBindingUtils.getPropertyValue(tenantBinding,
IQueryManager.TENANT_USES_STARTING_WILDCARD_FOR_PARTIAL_TERM);
- boolean ptStartingWildcard = (ptStartingWildcardValue==null)
+ boolean ptStartingWildcard = (ptStartingWildcardValue==null)
|| Boolean.parseBoolean(ptStartingWildcardValue);
return queryManager.createWhereClauseForPartialMatch(queryManager.getDatasourceName(),
repositoryName, cspaceInstanceId, field, ptStartingWildcard, partialTerm);
}
-
+
/**
- * Creates a query to filter a qualified (string) field according to a list of string values.
+ * Creates a query to filter a qualified (string) field according to a list of string values.
* @param qualifiedField The schema-qualified field to filter on
* @param filterTerms the list of one or more strings to filter on
* @param fExclude If true, will require qualifiedField NOT match the filters strings.
return queryManager.createWhereClauseToFilterFromStringList(qualifiedField, filterTerms, fExclude);
}
-
+
/**
* Creates a filtering where clause from docType, for invocables.
- *
+ *
* @param schema the schema name for this invocable type
* @param docType the docType
- *
+ *
* @return the string
*/
static public String createWhereClauseForInvocableByDocType(String schema, String docType) {
return queryManager.createWhereClauseForInvocableByDocType(schema, docType);
}
-
+
/**
* Creates a filtering where clause from invocation mode, for invocables.
- *
+ *
* @param schema the schema name for this invocable type
* @param mode the mode
- *
+ *
* @return the string
*/
static public String createWhereClauseForInvocableByMode(String schema, String mode) {
return queryManager.createWhereClauseForInvocableByMode(schema, mode);
}
-
+
+ static public String createWhereClauseForInvocableByMode(String schema, List<String> modes) {
+ return queryManager.createWhereClauseForInvocableByMode(schema, modes);
+ }
}
-/**
+/**
* QueryManagerNuxeoImpl.java
*
* {Purpose of This Class}
*/
package org.collectionspace.services.common.query.nuxeo;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-//import org.nuxeo.ecm.core.client.NuxeoClient;
-
-
-
+import org.apache.commons.lang3.StringUtils;
import org.collectionspace.services.jaxb.InvocableJAXBSchema;
-//import org.collectionspace.services.nuxeo.client.java.NuxeoConnector;
-//import org.collectionspace.services.nuxeo.client.java.NxConnect;
-
import org.collectionspace.services.nuxeo.util.NuxeoUtils;
import org.collectionspace.services.client.IQueryManager;
import org.collectionspace.services.common.invocable.InvocableUtils;
import org.collectionspace.services.common.storage.DatabaseProductType;
import org.collectionspace.services.common.storage.JDBCTools;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
public class QueryManagerNuxeoImpl implements IQueryManager {
private static String ECM_FULLTEXT_LIKE = "ecm:fulltext"
private static Pattern unescapedDblQuotes = Pattern.compile("(?<!\\\\)\"");
private static Pattern unescapedSingleQuote = Pattern.compile("(?<!\\\\)'");
//private static Pattern kwdSearchProblemChars = Pattern.compile("[\\:\\(\\)\\*\\%]");
- // HACK to work around Nuxeo regression that tokenizes on '.'.
+ // HACK to work around Nuxeo regression that tokenizes on '.'.
private static Pattern kwdSearchProblemChars = Pattern.compile("[\\:\\(\\)\\*\\%\\.]");
private static Pattern kwdSearchHyphen = Pattern.compile(" - ");
private static Pattern advSearchSqlWildcard = Pattern.compile(".*?[I]*LIKE\\s*\\\"\\%\\\".*?");
public String getDatasourceName() {
return JDBCTools.NUXEO_DATASOURCE_NAME;
}
-
+
// TODO: This is currently just an example fixed query. This should
// eventually be
// removed or replaced with a more generic method.
/*
* (non-Javadoc)
- *
+ *
* @see
* org.collectionspace.services.common.query.IQueryManager#execQuery(java
* .lang.String)
advancedSearch);
result = advancedSearchWhereClause.toString();
}
-
+
return result;
}
/*
* (non-Javadoc)
- *
+ *
* @see org.collectionspace.services.common.query.IQueryManager#
* createWhereClauseFromKeywords(java.lang.String)
*/
boolean newWordSet = true;
while (regexMatcher.find()) {
String phrase = regexMatcher.group();
- // Not needed - already trimmed by split:
+ // Not needed - already trimmed by split:
// String trimmed = phrase.trim();
// Ignore empty strings from match, or goofy input
if (phrase.isEmpty())
continue;
}
// Next comment block of questionable value...
-
+
// ignore the special chars except single quote here - can't hurt
// TODO this should become a special function that strips things the
// fulltext will ignore, including non-word chars and too-short
addNOT = false;
}
fullTextWhereClause.append(escapedAndTrimmed);
-
+
if (logger.isTraceEnabled() == true) {
logger.trace("Current built whereClause is: "
+ fullTextWhereClause.toString());
/*
* (non-Javadoc)
- *
+ *
* @see org.collectionspace.services.common.query.IQueryManager#
* createWhereClauseFromKeywords(java.lang.String)
*/
if (field == null || field.isEmpty()) {
throw new RuntimeException("No match field specified.");
}
-
+
StringBuilder ptClause = new StringBuilder(trimmed.length()+field.length()+20);
ptClause.append(field);
ptClause.append(getLikeForm(dataSourceName, repositoryName, cspaceInstanceId));
/**
* Creates a filtering where clause from docType, for invocables.
- *
+ *
* @param docType
* the docType
- *
+ *
* @return the string
*/
@Override
/**
* Creates a filtering where clause from invocation mode, for invocables.
- *
+ *
* @param mode
* the mode
- *
+ *
* @return the string
*/
@Override
public String createWhereClauseForInvocableByMode(String schema, String mode) {
- String trimmed = (mode == null) ? "" : mode.trim();
- if (trimmed.isEmpty()) {
- throw new RuntimeException("No docType specified.");
- }
+ return createWhereClauseForInvocableByMode(schema, Arrays.asList(mode));
+ }
+
+ @Override
+ public String createWhereClauseForInvocableByMode(String schema, List<String> modes) {
if (schema == null || schema.isEmpty()) {
throw new RuntimeException("No match schema specified.");
}
- String wClause = InvocableUtils.getPropertyNameForInvocationMode(
- schema, trimmed) + " != 0";
- return wClause;
+
+ if (modes == null || modes.isEmpty()) {
+ throw new RuntimeException("No mode specified.");
+ }
+
+ List<String> whereClauses = new ArrayList<String>();
+
+ for (String mode : modes) {
+ String propName = InvocableUtils.getPropertyNameForInvocationMode(schema, mode.trim());
+
+ if (propName != null && !propName.isEmpty()) {
+ whereClauses.add(propName + " != 0");
+ }
+ }
+
+ if (whereClauses.size() > 1) {
+ return ("(" + StringUtils.join(whereClauses, " OR ") + ")");
+ }
+
+ if (whereClauses.size() > 0) {
+ return whereClauses.get(0);
+ }
+
+ return "";
}
/**
return fFilteredChars;
}
-
+
/**
- * Creates a query to filter a qualified (string) field according to a list of string values.
+ * Creates a query to filter a qualified (string) field according to a list of string values.
* @param qualifiedField The schema-qualified field to filter on
* @param filterTerms the list of one or more strings to filter on
* @param fExclude If true, will require qualifiedField NOT match the filters strings.
if (filterTerms.length == 1) {
filterClause.append(fExclude?" <> '":" = '");
filterClause.append(filterTerms[0]);
- filterClause.append('\'');
+ filterClause.append('\'');
} else {
filterClause.append(fExclude?" NOT IN (":" IN (");
for(int i=0; i<filterTerms.length; i++) {
if(i>0) {
filterClause.append(',');
}
- filterClause.append('\'');
+ filterClause.append('\'');
filterClause.append(filterTerms[i]);
- filterClause.append('\'');
+ filterClause.append('\'');
}
- filterClause.append(')');
+ filterClause.append(')');
}
return filterClause.toString();
}
package org.collectionspace.services.report;
import java.io.InputStream;
+import java.util.List;
import org.collectionspace.services.jaxb.AbstractCommonList;
import org.collectionspace.services.report.nuxeo.ReportDocumentModelHandler;
private static String REPORTS_FOLDER = "reports";
private static String CSID_LIST_SEPARATOR = ",";
final Logger logger = LoggerFactory.getLogger(ReportResource.class);
-
+
private static String REPORTS_STD_CSID_PARAM = "csid";
private static String REPORTS_STD_GROUPCSID_PARAM = "groupcsid";
private static String REPORTS_STD_CSIDLIST_PARAM = "csidlist";
final String lastChangeRevision = "$LastChangedRevision: 1982 $";
return lastChangeRevision;
}
-
+
@Override
public String getServiceName() {
return ReportClient.SERVICE_NAME;
public Class<ReportsCommon> getCommonPartClass() {
return ReportsCommon.class;
}
-
+
@Override
protected AbstractCommonList getCommonList(UriInfo ui) {
try {
MultivaluedMap<String, String> queryParams = ctx.getQueryParams();
DocumentHandler handler = createDocumentHandler(ctx);
String docType = queryParams.getFirst(IQueryManager.SEARCH_TYPE_DOCTYPE);
- String mode = queryParams.getFirst(IQueryManager.SEARCH_TYPE_INVOCATION_MODE);
+ List<String> modes = queryParams.get(IQueryManager.SEARCH_TYPE_INVOCATION_MODE);
String whereClause = null;
DocumentFilter documentFilter = null;
- String common_part =ctx.getCommonPartLabel();
+ String common_part =ctx.getCommonPartLabel();
if (docType != null && !docType.isEmpty()) {
whereClause = QueryManager.createWhereClauseForInvocableByDocType(
common_part, docType);
documentFilter = handler.getDocumentFilter();
documentFilter.appendWhereClause(whereClause, IQueryManager.SEARCH_QUALIFIER_AND);
}
- if (mode != null && !mode.isEmpty()) {
+ if (modes != null && !modes.isEmpty()) {
whereClause = QueryManager.createWhereClauseForInvocableByMode(
- common_part, mode);
+ common_part, modes);
documentFilter = handler.getDocumentFilter();
documentFilter.appendWhereClause(whereClause, IQueryManager.SEARCH_QUALIFIER_AND);
}
* for information about the properties, and return that information.
* See: http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/JasperManager.html#loadReport%28java.lang.String%29
* to get the report from the file.
- * Use: http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/base/JRBaseReport.html#getParameters%28%29
+ * Use: http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/base/JRBaseReport.html#getParameters%28%29
* to get an array of http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/JRParameter.html
- * Cast each to JRBaseParameter and use isSystemDefined to filter out
+ * Cast each to JRBaseParameter and use isSystemDefined to filter out
* the system defined parameters.
*/
@Path("{csid}/output")
@Produces("application/pdf")
public Response invokeReport(
- @Context UriInfo ui,
+ @Context UriInfo ui,
@PathParam("csid") String csid) {
InvocationContext invContext = new InvocationContext();
invContext.setMode(Invocable.INVOCATION_MODE_NO_CONTEXT);
return invokeReport(ui, csid, invContext);
}
-
+
/*
* Publishes the report to the PublicItem service. The response is a URI to the corresponding PublicItem resource instance in
* the form of /publicitems/{csid}.
@POST
@Path("{csid}/publish")
public Response invokeReportAndPublish(
- @Context ResourceMap resourceMap,
+ @Context ResourceMap resourceMap,
@Context UriInfo uriInfo,
@PathParam("csid") String csid,
InvocationContext invContext) {
Response response = null;
-
+
try {
StringBuffer outMimeType = new StringBuffer();
StringBuffer outReportFileName = new StringBuffer();
ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext();
- InputStream reportInputStream = invokeReport(ctx, csid, invContext, outMimeType, outReportFileName);
+ InputStream reportInputStream = invokeReport(ctx, csid, invContext, outMimeType, outReportFileName);
response = PublicItemUtil.publishToRepository(
- (PublicitemsCommon)null,
- resourceMap,
- uriInfo,
- getRepositoryClient(ctx),
- ctx,
- reportInputStream,
+ (PublicitemsCommon)null,
+ resourceMap,
+ uriInfo,
+ getRepositoryClient(ctx),
+ ctx,
+ reportInputStream,
outReportFileName.toString());
} catch (Exception e) {
throw bigReThrow(e, ServiceMessages.POST_FAILED);
}
-
+
return response;
}
-
+
@POST
@Path("{csid}")
public Response invokeReport(
@PathParam("csid") String csid,
InvocationContext invContext) {
Response response = null;
-
+
try {
StringBuffer outMimeType = new StringBuffer();
StringBuffer outFileName = new StringBuffer();
ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext();
InputStream reportInputStream = invokeReport(ctx, csid, invContext, outMimeType, outFileName);
-
+
// Need to set response type for what is requested...
ResponseBuilder builder = Response.ok(reportInputStream, outMimeType.toString());
builder = builder.header("Content-Disposition","inline;filename=\""+ outFileName.toString() +"\"");
- response = builder.build();
+ response = builder.build();
} catch (Exception e) {
throw bigReThrow(e, ServiceMessages.POST_FAILED);
}
-
+
return response;
}
-
+
/*
* Does the actual report generation and returns an InputStream with the results.
*/
StringBuffer outMimeType,
StringBuffer outReportFileName) throws Exception {
InputStream result = null;
-
+
if (csid == null || "".equals(csid)) {
logger.error("invokeReport: missing csid!");
Response response = Response.status(Response.Status.BAD_REQUEST).entity(
"text/plain").build();
throw new CSWebApplicationException(response);
}
-
+
if (logger.isTraceEnabled()) {
logger.trace("invokeReport with csid=" + csid);
}
-
+
ReportDocumentModelHandler handler = (ReportDocumentModelHandler)createDocumentHandler(ctx);
result = handler.invokeReport(ctx, csid, invContext, outMimeType, outReportFileName);
-
+
return result;
}
-
+
}