<build>
<finalName>collectionspace-services-collectionobject</finalName>
- <plugins>
- <plugin>
- <groupId>com.qmino</groupId>
- <artifactId>miredot-plugin</artifactId>
- <version>2.0.3</version>
- <executions>
- <execution>
- <goals>
- <goal>restdoc</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <organizationId>5427820b-5465-4a49-98fb-cb39ff772f23</organizationId>
- <restModel>
- <restFramework>
- <name>jax-rs</name>
- </restFramework>
- </restModel>
- <output>
- <html>
- <jsonDoc>Hidden</jsonDoc>
- </html>
- </output>
- <!-- insert other configuration here (optional) -->
- </configuration>
- </plugin>
- </plugins>
- <pluginManagement>
- <plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>com.qmino</groupId>
- <artifactId>miredot-plugin</artifactId>
- <versionRange>[2.0.3,)</versionRange>
- <goals>
- <goal>restdoc</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore></ignore>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
</build>
-
- <pluginRepositories>
- <pluginRepository>
- <id>miredot</id>
- <name>MireDot Releases</name>
- <url>http://nexus.qmino.com/content/repositories/miredot</url>
- </pluginRepository>
- </pluginRepositories>
-
</project>
* @param queryParams
* @return
*/
- private static String buildWorkflowWhereClause(MultivaluedMap<String, String> queryParams) {
- String result = null;
-
- String includeDeleted = queryParams.getFirst(WorkflowClient.WORKFLOW_QUERY_NONDELETED);
- String includeOnlyDeleted = queryParams.getFirst(WorkflowClient.WORKFLOW_QUERY_ONLY_DELETED);
-
- if (includeDeleted != null && includeDeleted.equalsIgnoreCase(Boolean.FALSE.toString())) {
- result = String.format("(ecm:currentLifeCycleState <> '%s' AND ecm:currentLifeCycleState <> '%s' AND ecm:currentLifeCycleState <> '%s')",
- WorkflowClient.WORKFLOWSTATE_DELETED, WorkflowClient.WORKFLOWSTATE_LOCKED_DELETED, WorkflowClient.WORKFLOWSTATE_REPLICATED_DELETED);
- } else if (includeOnlyDeleted != null && includeOnlyDeleted.equalsIgnoreCase(Boolean.TRUE.toString())) {
- result = String.format("(ecm:currentLifeCycleState <> '%s' AND ecm:currentLifeCycleState <> '%s' AND ecm:currentLifeCycleState <> '%s')",
- WorkflowClient.WORKFLOWSTATE_PROJECT, WorkflowClient.WORKFLOWSTATE_LOCKED, WorkflowClient.WORKFLOWSTATE_REPLICATED);
- }
-
- return result;
- }
+ private static String buildWorkflowWhereClause(MultivaluedMap<String, String> queryParams) {
+ String result = null;
+
+ String includeDeleted = queryParams.getFirst(WorkflowClient.WORKFLOW_QUERY_NONDELETED);
+ String includeOnlyDeleted = queryParams.getFirst(WorkflowClient.WORKFLOW_QUERY_ONLY_DELETED); // if set to true, it doesn't matter what the value is for 'includeDeleted'
+
+ if (includeOnlyDeleted != null) {
+ if (Tools.isTrue(includeOnlyDeleted)) {
+ //
+ // A value of 'true' for 'includeOnlyDeleted' means we're looking *only* for soft-deleted records/documents.
+ //
+ result = String.format("(ecm:currentLifeCycleState = '%s' OR ecm:currentLifeCycleState = '%s' OR ecm:currentLifeCycleState = '%s')",
+ WorkflowClient.WORKFLOWSTATE_DELETED, WorkflowClient.WORKFLOWSTATE_LOCKED_DELETED,
+ WorkflowClient.WORKFLOWSTATE_REPLICATED_DELETED);
+ }
+ } else if (!Tools.isTrue(includeDeleted)) {
+ //
+ // We can only get here if the 'includeOnlyDeleted' query param is missing altogether.
+ // Ensure we don't return soft-deleted records
+ //
+ result = String.format("(ecm:currentLifeCycleState <> '%s' AND ecm:currentLifeCycleState <> '%s' AND ecm:currentLifeCycleState <> '%s')",
+ WorkflowClient.WORKFLOWSTATE_DELETED, WorkflowClient.WORKFLOWSTATE_LOCKED_DELETED,
+ WorkflowClient.WORKFLOWSTATE_REPLICATED_DELETED);
+ }
+
+ return result;
+ }
/**
* Creates the document handler instance.