return o.getPid() != null ? o.getPid().getValue() : ""; return o.getLabel() != null ? o.getLabel().getValue() : ""; return o.getState() != null ? o.getState().getValue() : ""; return o.getOwnerId() != null ? o.getOwnerId().getValue() : ""; return o.getCDate() != null ? o.getCDate().getValue() : ""; return o.getMDate() != null ? o.getMDate().getValue() : ""; return o.getDcmDate() != null ? o.getDcmDate().getValue() : ""; return getList(o.getTitle()); return getList(o.getCreator()); return getList(o.getSubject()); return getList(o.getDescription()); return getList(o.getPublisher()); return getList(o.getContributor()); return getList(o.getDate()); return getList(o.getType());
/** * Create an instance of {@link ObjectFields } * */ public ObjectFields createObjectFields() { return new ObjectFields(); }
for (int i = 0; i < sfList.size(); i++) { org.fcrepo.server.types.gen.ObjectFields gf = new org.fcrepo.server.types.gen.ObjectFields(); org.fcrepo.server.search.ObjectFields sf = sfList.get(i); org.fcrepo.server.types.gen.ObjectFactory factory = gf.setPid(factory.createObjectFieldsPid(sf.getPid())); gf.setLabel(factory.createObjectFieldsLabel(sf.getLabel())); gf.setState(factory.createObjectFieldsState(sf.getState())); gf.setOwnerId(factory.createObjectFieldsOwnerId(sf.getOwnerId())); gf.setCDate(factory.createObjectFieldsCDate(DateUtility .convertDateToString(sf.getCDate()))); gf.setMDate(factory.createObjectFieldsMDate(DateUtility .convertDateToString(sf.getMDate()))); gf.setDcmDate(factory.createObjectFieldsDcmDate(DateUtility .convertDateToString(sf.getDCMDate()))); gf.getTitle().addAll(toStringList(sf.titles())); gf.getCreator().addAll(toStringList(sf.creators())); gf.getSubject().addAll(toStringList(sf.subjects()));
@Test public void testFindObjects() throws Exception { // Test that a search for pid=demo:5 returns one result; demo:5 String[] resultFields = {"pid"}; java.math.BigInteger maxResults = new java.math.BigInteger("" + 100); FieldSearchQuery query = new FieldSearchQuery(); Conditions conds = new Conditions(); Condition cond = new Condition(); cond.setOperator(ComparisonOperator.EQ); cond.setProperty("pid"); cond.setValue("demo:5"); conds.getCondition().add(cond); ObjectFactory factory = new ObjectFactory(); query.setConditions(factory.createFieldSearchQueryConditions(conds)); FieldSearchResult result = apia.findObjects(TypeUtility.convertStringtoAOS(resultFields), maxResults, query); ResultList resultList = result.getResultList(); List<ObjectFields> fields = resultList.getObjectFields(); assertEquals(1, fields.size()); assertEquals("demo:5", fields.get(0).getPid().getValue()); }
for (int i = 0; i < sfList.size(); i++) { org.fcrepo.server.types.gen.ObjectFields gf = new org.fcrepo.server.types.gen.ObjectFields(); org.fcrepo.server.search.ObjectFields sf = sfList.get(i); org.fcrepo.server.types.gen.ObjectFactory factory = gf.setPid(factory.createObjectFieldsPid(sf.getPid())); gf.setLabel(factory.createObjectFieldsLabel(sf.getLabel())); gf.setState(factory.createObjectFieldsState(sf.getState())); gf.setOwnerId(factory.createObjectFieldsOwnerId(sf.getOwnerId())); gf.setCDate(factory.createObjectFieldsCDate(DateUtility .convertDateToString(sf.getCDate()))); gf.setMDate(factory.createObjectFieldsMDate(DateUtility .convertDateToString(sf.getMDate()))); gf.setDcmDate(factory.createObjectFieldsDcmDate(DateUtility .convertDateToString(sf.getDCMDate()))); gf.getTitle().addAll(toStringList(sf.titles())); gf.getCreator().addAll(toStringList(sf.creators())); gf.getSubject().addAll(toStringList(sf.subjects()));
result.setPid(source.getPid() != null ? source.getPid().getValue() : null); result.setLabel(source.getLabel() != null ? source.getLabel().getValue() : null); result.setState(source.getState() != null ? source.getState().getValue() : null); result.setOwnerId(source.getOwnerId() != null ? source.getOwnerId().getValue() : null); result.setCDate(source.getCDate() != null ? DateUtility.convertStringToDate(source.getCDate().getValue()) : null); result.setMDate(source.getMDate() != null ? DateUtility.convertStringToDate(source.getMDate().getValue()) : null); result.setDCMDate(source.getDcmDate() != null ? DateUtility.convertStringToDate(source.getDcmDate().getValue()) : null); result.titles().addAll(convertStringArray(source.getTitle())); result.subjects().addAll(convertStringArray(source.getSubject())); result.descriptions() .addAll(convertStringArray(source.getDescription())); result.publishers().addAll(convertStringArray(source.getPublisher())); result.contributors() .addAll(convertStringArray(source.getContributor())); result.dates().addAll(convertStringArray(source.getDate())); result.types().addAll(convertStringArray(source.getType())); result.formats().addAll(convertStringArray(source.getFormat())); result.identifiers().addAll(convertStringArray(source.getIdentifier())); result.sources().addAll(convertStringArray(source.getSource())); result.languages().addAll(convertStringArray(source.getLanguage())); result.relations().addAll(convertStringArray(source.getRelation())); result.coverages().addAll(convertStringArray(source.getCoverage())); result.rights().addAll(convertStringArray(source.getRights())); return result;
List<ObjectFields> fields = result.getResultList().getObjectFields(); for (ObjectFields objectFields : fields) { String pid = objectFields.getPid().getValue(); System.out.println("Validating object '" + pid + "'"); Validation validation = apim.validate(pid, null);
/** * Create an instance of {@link ObjectFields } * */ public ObjectFields createObjectFields() { return new ObjectFields(); }
matchNum++; System.out.println("#" + matchNum); AutoFinder.printValue("pid ", o.getPid() != null ? o.getPid().getValue() : null); AutoFinder.printValue("state ", o.getState() != null ? o.getState().getValue() : null); AutoFinder.printValue("ownerId ", o.getOwnerId() != null ? o.getOwnerId().getValue() : null); AutoFinder.printValue("cDate ", o.getCDate() != null ? o.getCDate().getValue() : null); AutoFinder.printValue("mDate ", o.getMDate() != null ? o.getMDate().getValue() : null); AutoFinder.printValue("dcmDate ", o.getDcmDate() != null ? o.getDcmDate().getValue() : null); AutoFinder.printValue("title ", o.getTitle() != null ? o.getTitle().toString() : null); AutoFinder.printValue("creator ", o.getCreator() != null ? o.getCreator().toString() : null); AutoFinder.printValue("subject ", o.getSubject() != null ? o.getSubject().toString() : null); AutoFinder.printValue("description ", o.getDescription() != null ? o.getDescription().toString() : null); AutoFinder.printValue("publisher ", o.getPublisher() != null ? o.getPublisher().toString() : null); AutoFinder.printValue("contributor ", o.getContributor() != null ? o.getContributor().toString() : null); AutoFinder.printValue("date ", o.getDate() != null ? o.getDate().toString() : null); AutoFinder.printValue("type ", o.getType() != null ? o.getType().toString() : null); AutoFinder.printValue("format ", o.getFormat() != null ? o.getFormat().toString() : null); AutoFinder.printValue("identifier ", o.getIdentifier() != null ? o.getIdentifier().toString() : null); AutoFinder.printValue("source ", o.getSource() != null ? o.getSource().toString() : null); AutoFinder.printValue("language ", o.getLanguage() != null ? o.getLanguage().toString() : null); AutoFinder.printValue("relation ", o.getRelation() != null ? o.getRelation().toString() : null); AutoFinder.printValue("coverage ", o.getCoverage() != null ? o.getCoverage().toString() : null); AutoFinder.printValue("rights ", o.getRights() != null ? o.getRights().toString() : null); System.out.println("");
for (int i = 0; i < ofs.getObjectFields().size(); i++) { ObjectFields o = ofs.getObjectFields().get(i); m_rowPids[i] = o.getPid().getValue(); for (int j = 0; j < displayFields.length; j++) { data[i][j] = getValue(o, displayFields[j]);
String pid = element.getPid().getValue(); one(apia, apim, pid, format, exportContext, dir); count++;
String pid = element.getPid().getValue(); try { String newPID =