String whereClause =
authorityItemCommonSchemaName+
":"+AuthorityJAXBSchema.SHORT_IDENTIFIER+
- "='"+itemspecifier+"'";
+ "='"+itemspecifier+"' AND "
+ + authorityItemCommonSchemaName + ":"
+ + AuthorityItemJAXBSchema.IN_AUTHORITY + "="
+ + "'" + parentcsid + "'";
if (logger.isDebugEnabled()) {
logger.debug("getAuthorityItemByName with parentcsid=" + parentcsid + " and itemspecifier=" + itemspecifier);
"text/plain").build();
throw new WebApplicationException(response);
}
- // TODO REWRITE to get the CSID for the parent by name, and then call getAuthorityItemByName
- String whereClause =
- authorityItemCommonSchemaName+
- ":"+AuthorityJAXBSchema.SHORT_IDENTIFIER+
- "='"+itemspecifier+"'";
+ String authWhereClause =
+ authorityCommonSchemaName+
+ ":"+AuthorityJAXBSchema.SHORT_IDENTIFIER+
+ "='"+parentspecifier+"'";
if (logger.isDebugEnabled()) {
logger.debug("getAuthorityItemByNameInNamedAuthority with parentspecifier="
+ parentspecifier + " and itemspecifier=" + itemspecifier);
}
MultipartOutput result = null;
try {
- // Note that we have to create the service context for the Items, not the main service
- ServiceContext<MultipartInput, MultipartOutput> ctx = createServiceContext(getItemServiceName());
- // HACK HACK Since we do not use the parent CSID yet this should work.
- DocumentHandler handler = createItemDocumentHandler(ctx, parentspecifier);
- DocumentFilter myFilter = new DocumentFilter(whereClause, 0, 1);
+ ServiceContext<MultipartInput, MultipartOutput> ctx = createServiceContext(getServiceName());
+ String parentcsid = getRepositoryClient(ctx).findDocCSID(ctx, authWhereClause);
+ String itemWhereClause =
+ authorityItemCommonSchemaName+
+ ":"+AuthorityJAXBSchema.SHORT_IDENTIFIER+
+ "='"+itemspecifier+"' AND "
+ + authorityItemCommonSchemaName + ":"
+ + AuthorityItemJAXBSchema.IN_AUTHORITY + "="
+ + "'" + parentcsid + "'";
+ // Now that we have to create the service context for the Items, not the main service
+ ctx = createServiceContext(getItemServiceName());
+ DocumentHandler handler = createItemDocumentHandler(ctx, parentcsid);
+ DocumentFilter myFilter = new DocumentFilter(itemWhereClause, 0, 1);
handler.setDocumentFilter(myFilter);
getRepositoryClient(ctx).get(ctx, handler);
// TODO should we assert that the item is in the passed personAuthority?
final String testName = "createItemInAuthority";
if(logger.isDebugEnabled()){
- logger.debug(testName + ":...");
+ logger.debug(testName + ":"+vcsid+"...");
}
// Submit the request to the service and store the response.
logger.debug(testName + ": knownItemResourceId=" + knownItemResourceId);
}
}
+ if(logger.isDebugEnabled()){
+ logger.debug(testName + " (created):"+vcsid+"/("+newID+","+shortId+")");
+ }
// Store the IDs from any item resources created
// by tests, along with the IDs of their parents, so these items
if (logger.isDebugEnabled()) {
logger.debug(testBanner(testName, CLASS_NAME));
+ logger.debug("Reading:"+((authCSID!=null)?authCSID:authShortId)+"/"+
+ ((itemCSID!=null)?authCSID:itemShortId));
}
// Perform setup.
setupRead();