</service:uriPath> -->
<service:repositoryDomain xmlns:service="http://collectionspace.org/services/common/service">default-domain</service:repositoryDomain>
<service:documentHandler xmlns:service="http://collectionspace.org/services/common/service">org.collectionspace.services.intake.nuxeo.IntakeDocumentModelHandler</service:documentHandler>
+ <service:DocHandlerParams xmlns:service="http://collectionspace.org/services/common/service">
+ <service:classname>org.collectionspace.services.group.nuxeo.IntakeDocumentModelHandler</service:classname>
+ <service:params>
+ <service:SchemaName>intakes</service:SchemaName>
+ <service:DublinCoreTitle>intakes</service:DublinCoreTitle>
+ <service:SummaryFields> entryNumber|depositor|currentOwner|uri|csid</service:SummaryFields>
+ <service:AbstractCommonListClassname />
+ <service:CommonListItemClassname />
+ <service:ListResultsItemMethodName>getIntakeListItem</service:ListResultsItemMethodName>
+ <service:ListResultsFields>
+ <service:ListResultField>
+ <service:element>entryNumber</service:element>
+ <service:xpath>entryNumber</service:xpath>
+ </service:ListResultField>
+ <service:ListResultField>
+ <service:element>depositor</service:element>
+ <service:xpath>depositor</service:xpath>
+ </service:ListResultField><service:ListResultField>
+ <service:element>currentOwner</service:element>
+ <service:xpath>currentOwner</service:xpath>
+ </service:ListResultField>
+ </service:ListResultsFields>
+ </service:params>
+ </service:DocHandlerParams>
<service:validatorHandler xmlns:service="http://collectionspace.org/services/common/service">org.collectionspace.services.intake.nuxeo.IntakeValidatorHandler</service:validatorHandler>
<service:properties xmlns:service="http://collectionspace.org/services/common/service">
<!-- What to use for name???
package org.collectionspace.services.client;
import org.jboss.resteasy.client.ClientResponse;
-import org.collectionspace.services.intake.IntakesCommonList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
/**
* A IntakeClient.
* @version $Revision:$
* FIXME: http://issues.collectionspace.org/browse/CSPACE-1684
*/
-public class IntakeClient extends AbstractPoxServiceClientImpl<IntakesCommonList, IntakeProxy> {
+public class IntakeClient extends AbstractPoxServiceClientImpl<AbstractCommonList, IntakeProxy> {
public static final String SERVICE_NAME = "intakes";
public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
* @return
* @see org.collectionspace.services.client.IntakeProxy#getIntake()
*/
- public ClientResponse<IntakesCommonList> readList() {
+ public ClientResponse<AbstractCommonList> readList() {
return getProxy().readList();
}
}
import javax.ws.rs.QueryParam;
import org.collectionspace.services.client.workflow.WorkflowClient;
-import org.collectionspace.services.intake.IntakesCommonList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
/**
* @version $Revision:$
@Path(IntakeClient.SERVICE_PATH_PROXY)
@Produces({"application/xml"})
@Consumes({"application/xml"})
-public interface IntakeProxy extends CollectionSpacePoxProxy<IntakesCommonList> {
+public interface IntakeProxy extends CollectionSpacePoxProxy<AbstractCommonList> {
/**
* Read list.
*
*/
@GET
@Produces({"application/xml"})
- ClientResponse<IntakesCommonList> readList();
+ ClientResponse<AbstractCommonList> readList();
@Override
@GET
@Produces({"application/xml"})
- ClientResponse<IntakesCommonList> readIncludeDeleted(
+ ClientResponse<AbstractCommonList> readIncludeDeleted(
@QueryParam(WorkflowClient.WORKFLOW_QUERY_NONDELETED) String includeDeleted);
@Override
@GET
@Produces({"application/xml"})
- ClientResponse<IntakesCommonList> keywordSearchIncludeDeleted(
+ ClientResponse<AbstractCommonList> keywordSearchIncludeDeleted(
@QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
@QueryParam(WorkflowClient.WORKFLOW_QUERY_NONDELETED) String includeDeleted);
}
import org.collectionspace.services.intake.CurrentLocationGroup;
import org.collectionspace.services.intake.CurrentLocationGroupList;
import org.collectionspace.services.intake.IntakesCommon;
-import org.collectionspace.services.intake.IntakesCommonList;
import org.collectionspace.services.jaxb.AbstractCommonList;
import org.jboss.resteasy.client.ClientResponse;
@Override
protected AbstractCommonList getAbstractCommonList(
ClientResponse<AbstractCommonList> response) {
- return response.getEntity(IntakesCommonList.class);
+ return response.getEntity(AbstractCommonList.class);
}
// ---------------------------------------------------------------
// Submit the request to the service and store the response.
IntakeClient client = new IntakeClient();
- ClientResponse<IntakesCommonList> res = client.readList();
- IntakesCommonList list = res.getEntity();
+ ClientResponse<AbstractCommonList> res = client.readList();
+ AbstractCommonList list = res.getEntity();
int statusCode = res.getStatus();
// Check the status code of the response: does it match
// Optionally output additional data about list members for debugging.
boolean iterateThroughList = false;
if(iterateThroughList && logger.isDebugEnabled()){
- List<IntakesCommonList.IntakeListItem> items =
- list.getIntakeListItem();
+ List<AbstractCommonList.ListItem> items =
+ list.getListItem();
int i = 0;
- for(IntakesCommonList.IntakeListItem item : items){
- logger.debug(testName + ": list-item[" + i + "] csid=" +
- item.getCsid());
- logger.debug(testName + ": list-item[" + i + "] objectNumber=" +
- item.getEntryNumber());
- logger.debug(testName + ": list-item[" + i + "] URI=" +
- item.getUri());
+ for(AbstractCommonList.ListItem item : items){
+ logger.debug(testName + ": list-item[" + i + "] " +
+ item.toString());
i++;
}
}
*/
package org.collectionspace.services.intake.nuxeo;
-import java.util.Iterator;
-import java.util.List;
-
-import org.collectionspace.services.IntakeJAXBSchema;
-import org.collectionspace.services.common.document.DocumentWrapper;
import org.collectionspace.services.intake.IntakesCommon;
-import org.collectionspace.services.intake.IntakesCommonList;
-import org.collectionspace.services.intake.IntakesCommonList.IntakeListItem;
-import org.collectionspace.services.jaxb.AbstractCommonList;
-import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl;
-import org.collectionspace.services.nuxeo.util.NuxeoUtils;
-import org.nuxeo.ecm.core.api.DocumentModel;
-import org.nuxeo.ecm.core.api.DocumentModelList;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.collectionspace.services.nuxeo.client.java.DocHandlerBase;
/**
* IntakeDocumentModelHandler
* $LastChangedDate: $
*/
public class IntakeDocumentModelHandler
- extends RemoteDocumentModelHandlerImpl<IntakesCommon, IntakesCommonList> {
-
- /** The logger. */
- private final Logger logger = LoggerFactory.getLogger(IntakeDocumentModelHandler.class);
- /**
- * intake is used to stash JAXB object to use when handle is called
- * for Action.CREATE, Action.UPDATE or Action.GET
- */
- private IntakesCommon intake;
- /**
- * intakeList is stashed when handle is called
- * for ACTION.GET_ALL
- */
- private IntakesCommonList intakeList;
-
-
- /**
- * getCommonPart get associated intake
- * @return
- */
- @Override
- public IntakesCommon getCommonPart() {
- return intake;
- }
-
- /**
- * setCommonPart set associated intake
- * @param intake
- */
- @Override
- public void setCommonPart(IntakesCommon intake) {
- this.intake = intake;
- }
-
- /**
- * getCommonPartList get associated intake (for index/GET_ALL)
- * @return
- */
- @Override
- public IntakesCommonList getCommonPartList() {
- return intakeList;
- }
-
- /* (non-Javadoc)
- * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#setCommonPartList(java.lang.Object)
- */
- @Override
- public void setCommonPartList(IntakesCommonList intakeList) {
- this.intakeList = intakeList;
- }
-
- /* (non-Javadoc)
- * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#extractCommonPart(org.collectionspace.services.common.document.DocumentWrapper)
- */
- @Override
- public IntakesCommon extractCommonPart(DocumentWrapper<DocumentModel> wrapDoc)
- throws Exception {
- throw new UnsupportedOperationException();
- }
-
- /* (non-Javadoc)
- * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#fillCommonPart(java.lang.Object, org.collectionspace.services.common.document.DocumentWrapper)
- */
- @Override
- public void fillCommonPart(IntakesCommon intakeObject, DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
- throw new UnsupportedOperationException();
- }
-
- /* (non-Javadoc)
- * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#extractCommonPartList(org.collectionspace.services.common.document.DocumentWrapper)
- */
- @Override
- public IntakesCommonList extractCommonPartList(DocumentWrapper<DocumentModelList> wrapDoc) throws Exception {
- IntakesCommonList coList = this.extractPagingInfo(new IntakesCommonList(), wrapDoc);
- AbstractCommonList commonList = (AbstractCommonList) coList;
- commonList.setFieldsReturned("entryNumber|depositor|currentOwner|uri|csid");
- List<IntakesCommonList.IntakeListItem> list = coList.getIntakeListItem();
- Iterator<DocumentModel> iter = wrapDoc.getWrappedObject().iterator();
- String label = getServiceContext().getCommonPartLabel();
- while(iter.hasNext()){
- DocumentModel docModel = iter.next();
- IntakeListItem ilistItem = new IntakeListItem();
- ilistItem.setEntryNumber((String) docModel.getProperty(label,
- IntakeJAXBSchema.ENTRY_NUMBER));
- ilistItem.setDepositor((String) docModel.getProperty(label,
- IntakeJAXBSchema.DEPOSITOR));
- ilistItem.setCurrentOwner((String) docModel.getProperty(label,
- IntakeJAXBSchema.CURRENT_OWNER));
- String id = getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString());
- ilistItem.setUri(getServiceContextPath() + id);
- ilistItem.setCsid(id);
- list.add(ilistItem);
- }
-
- return coList;
- }
-
- /**
- * getQProperty converts the given property to qualified schema property
- * @param prop
- * @return
- */
- @Override
- public String getQProperty(String prop) {
- return IntakeConstants.NUXEO_SCHEMA_NAME + ":" + prop;
- }
-
+ extends DocHandlerBase<IntakesCommon> {
}