for (String resourceFilename : resourceFilenames) {
File resourceFile = new File(resourceDirName + resourceFilename);
if (resourceFile.isFile()) {
String resource = FileUtils.readFileToString(resourceFile, "UTF-8");
TemplatedResourceIterator tri = new TemplatedResourceIterator(resource, "src/test/resources/APIM2/valuesplain");
while (tri.hasNext()) {
byte[] foxml = tri.next().getBytes("UTF-8");
apim.ingest(foxml, FOXML1_1.uri,"ingesting new foxml object");
}
}
}
String[] resultFields = {"pid", "title"};
java.math.BigInteger maxResults = new java.math.BigInteger("100");
String termsTemplate = "$value$";
TemplatedResourceIterator tri = new TemplatedResourceIterator(termsTemplate, "src/test/resources/APIM2/searchvalues");
while (tri.hasNext()) {
FieldSearchQuery query;
// using conditions
FieldSearchQuery.Conditions conds = new FieldSearchQuery.Conditions();
Condition c = new Condition();
c.setProperty("pid");
c.setOperator(ComparisonOperator.fromValue("eq"));
c.setValue(tri.getAttributeValue("value"));
conds.getCondition().add(c);
query = new FieldSearchQuery();
ObjectFactory factory = new ObjectFactory();
query.setConditions(factory.createFieldSearchQueryConditions(conds));
apia.findObjects(TypeUtility.convertStringtoAOS(resultFields), maxResults, query);
String terms = tri.next();
query = new FieldSearchQuery();
query.setTerms(factory.createFieldSearchQueryTerms(terms));
apia.findObjects(TypeUtility.convertStringtoAOS(resultFields), maxResults, query);
}
purgeDemoObjects(s_client);
for (String resourceFilename : resourceFilenames) {
File resourceFile = new File(resourceDirName + resourceFilename);
if (resourceFile.isFile()) {
String resource = FileUtils.readFileToString(resourceFile, "UTF-8");
tri = new TemplatedResourceIterator(resource, "src/test/resources/APIM2/valuesplain");
while (tri.hasNext()) {
byte[] foxml = tri.next().getBytes("UTF-8");
apim.ingest(foxml, FOXML1_1.uri,"ingesting new foxml object");
}
}
}