evalStruct.jexl = jexl;
for (Node testgroup : testgroupNodes) {
- String testGroupID = testgroup.valueOf("@autoDeletePOSTS");
+ String testGroupID = testgroup.valueOf("@ID");
XmlReplayEval.MapContextWKeys jc = new XmlReplayEval.MapContextWKeys();//MapContext(); //Get a new JexlContext for each test group.
evalStruct.jc = jc;
autoDeletePOSTS = testgroup.valueOf("@autoDeletePOSTS");
--- /dev/null
+<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+ <pageNum>0</pageNum>
+ <itemsInPage>${itemsInPage}</itemsInPage>
+ <totalItems>${totalItems}</totalItems>
+ <list-item>
+ <csid>${csid}</csid>
+ <uri>/vocabularies/${csid}</uri>
+ <refName>
+ urn:cspace:core.collectionspace.org:vocabularies:name(SearchItemsVocab)'SearchItems Vocabulary'
+ </refName>
+ <workflowState>project</workflowState>
+ <rev>0</rev>
+ <shortIdentifier>SearchItemsVocab</shortIdentifier>
+ <displayName>SearchItems Vocabulary</displayName>
+ </list-item>
+</ns2:abstract-common-list>
\ No newline at end of file
--- /dev/null
+<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+ <pageNum>0</pageNum>
+ <itemsInPage>${itemsInPage}</itemsInPage>
+ <totalItems>${totalItems}</totalItems>
+ <list-item>
+ <csid>${createItem2}</csid>
+ <uri>
+ /vocabularies/${csid}/items/${createItem2}
+ </uri>
+ <refName>
+ urn:cspace:core.collectionspace.org:vocabularies:name(ShowItemsVocab):item:name(ShowItemsItem2)'ShowsItems item ShowItemsItem2'
+ </refName>
+ <workflowState>project</workflowState>
+ <rev>0</rev>
+ <sourcePage>The page should match the order:2</sourcePage>
+ <sas>false</sas>
+ <proposed>true</proposed>
+ <description>This is a test vocabulary item</description>
+ <source>Some mythical book</source>
+ <order>2</order>
+ <displayName>ShowsItems item ShowItemsItem2</displayName>
+ <shortIdentifier>ShowItemsItem2</shortIdentifier>
+ </list-item>
+</ns2:abstract-common-list>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="vocabularies">
+ <ns3:vocabularies_common xmlns:ns3="http://collectionspace.org/services/vocabulary"
+ xmlns:ns2="http://collectionspace.org/services/jaxb">
+ <displayName>SearchItems Vocabulary</displayName>
+ <shortIdentifier>SearchItemsVocab</shortIdentifier>
+ <description>This is a test vocabulary for the ShowItems XMLReplay test group.</description>
+ <source>XML Replay SearchItems test group.</source>
+ </ns3:vocabularies_common>
+</document>
+
<uri>/cspace-services/vocabularies/</uri>
<filename>vocabulary/ShowItems/showItems-vocab.xml</filename>
</test>
+ <test ID="searchShowItemsVocab">
+ <method>POST</method>
+ <uri>/cspace-services/vocabularies/</uri>
+ <filename>vocabulary/ShowItems/searchItems-vocab.xml</filename>
+ </test>
<test ID="createItem1">
<method>POST</method>
<uri>/cspace-services/vocabularies/${createShowItemsVocab.CSID}/items/</uri>
<filename>vocabulary/ShowItems/responses/showVocabWithLastPage.res.xml</filename>
</response>
</test>
+ <test ID="SearchVocabulariesAdvancedSearch">
+ <method>GET</method>
+ <uri>/cspace-services/vocabularies?as=(vocabularies_common:displayName+ILIKE+%22%25SearchItems%25%22)</uri>
+ <response>
+ <vars>
+ <var ID="itemsInPage">1</var>
+ <var ID="totalItems">1</var>
+ <var ID="csid">${searchShowItemsVocab.CSID}</var>
+ </vars>
+ <expected level="ADDOK" />
+ <filename>vocabulary/ShowItems/responses/searchVocabularyAdvancedSearch.res.xml</filename>
+ </response>
+ </test>
+ <test ID="SearchVocabularyItemsAdvancedSearch">
+ <method>GET</method>
+ <uri>/cspace-services/vocabularies/${createShowItemsVocab.CSID}/items?as=(vocabularyitems_common:displayName+ILIKE+%22%ShowItemsItem2%25%22)</uri>
+ <response>
+ <vars>
+ <var ID="itemsInPage">1</var>
+ <var ID="totalItems">1</var>
+ <var ID="csid">${createShowItemsVocab.CSID}</var>
+ <var ID="createItem2">${createItem2.CSID}</var>
+ </vars>
+ <expected level="ADDOK" />
+ <filename>vocabulary/ShowItems/responses/searchVocabularyItemsAdvancedSearch.res.xml</filename>
+ </response>
+ </test>
</testGroup>
<!--
try {
MultivaluedMap<String, String> queryParams = uriInfo.getQueryParameters();
ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(uriInfo);
-
+
DocumentHandler<?, AbstractCommonList, DocumentModel, DocumentModelList> handler = createDocumentHandler(ctx);
DocumentFilter myFilter = handler.getDocumentFilter();
// Need to make the default sort order for authority items
// be on the displayName field
- String sortBy = queryParams.getFirst(IClientQueryParams.ORDER_BY_PARAM);
- if (sortBy == null || sortBy.isEmpty()) {
+ String orderBy = queryParams.getFirst(IClientQueryParams.ORDER_BY_PARAM);
+ if (orderBy == null || orderBy.isEmpty()) {
String qualifiedDisplayNameField = authorityCommonSchemaName + ":"
+ AuthorityItemJAXBSchema.DISPLAY_NAME;
myFilter.setOrderByClause(qualifiedDisplayNameField);
if (nameQ != null) {
myFilter.setWhereClause(authorityCommonSchemaName + ":refName='" + nameQ + "'");
}
- getRepositoryClient(ctx).getFiltered(ctx, handler);
+ //getRepositoryClient(ctx).getFiltered(ctx, handler); # Something here?
+ String advancedSearch = queryParams.getFirst(IQueryManager.SEARCH_TYPE_KEYWORDS_AS);
+ result = search(ctx, handler, uriInfo, orderBy, null, advancedSearch, null);
result = handler.getCommonPartList();
} catch (Exception e) {
throw bigReThrow(e, ServiceMessages.GET_FAILED);
import org.collectionspace.services.common.document.DocumentHandler;
import org.collectionspace.services.common.document.DocumentNotFoundException;
import org.collectionspace.services.common.repository.RepositoryClient;
+import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
import org.collectionspace.services.common.vocabulary.AuthorityResource;
import org.collectionspace.services.common.vocabulary.AuthorityServiceUtils;
import org.collectionspace.services.common.vocabulary.RefNameServiceUtils;
protected String getOrderByField(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) {
String result = null;
- result = authorityItemCommonSchemaName + ":" + VocabularyItemJAXBSchema.DISPLAY_NAME;
+ result = ctx.getCommonPartLabel() + ":" + AuthorityItemJAXBSchema.DISPLAY_NAME;
return result;
}