05-06-2009 07:14 AM
05-06-2009 09:31 AM
Query query = new Query(Constants.QUERY_LANG_LUCENE, "PATH:\"/app:company_home/cm:UCLtest/cm:" + ISO9075.encode(filename) + "\"" );
ResultSet rs = WebServiceFactory.getRepositoryService().query(storeRef, query, false).getResultSet();
ResultSetRow[] rsRows = rs.getRows();
if(rs.getTotalRowCount() > 0)
{
System.out.println("will update the file " + rsRows[0].getColumns(1).getValue());
Reference reference = new Reference(storeRef, rsRows[0].getNode().getId(), null);
Predicate predicate = new Predicate(new Reference[]{reference}, null, null);
CMLUpdate update = new CMLUpdate( titledProps, predicate, "1");
cml.setUpdate(new CMLUpdate[] {update});
cml.setAddAspect(new CMLAddAspect[] {addAspect});
}
else {
System.out.println("will create the file ");
CMLCreate create = new CMLCreate("1", companyHomeParent, null, null, null, Constants.TYPE_CONTENT, contentProps);
cml.setCreate(new CMLCreate[] {create});
cml.setAddAspect(new CMLAddAspect[] {addAspect});
}
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.