10-20-2009 01:15 PM
RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();
Query query = new Query( Constants.QUERY_LANG_LUCENE, "TEXT:'"+queryStr+"'");
QueryResult queryResult = repositoryService.query(STORE, query, true);
ResultSet resultSet = queryResult.getResultSet();
ResultSetRow[] rows = resultSet.getRows();
if (rows == null) {
System.out.println("No query results found.");
} else {
System.out.println("Results from query:");
List<ContentResult> results = null;
if (rows != null && rows.length > 0) {
results = new ArrayList<ContentResult>();
for(ResultSetRow row : rows) {
String nodeId = row.getNode().getId();
ContentResult contentResult = new ContentResult(nodeId);
NamedValue [] namedValues = row.getColumns();
for (int i=0;i<namedValues.length;i++) {
NamedValue namedValue = namedValues[i];
if (!namedValue.getIsMultiValue()) {
System.out.println(" name="+namedValue.getName()+" value="+namedValue.getValue());
} else {
String valores[] = namedValue.getValues();
for (int j=0;j<valores.length;j++) {
System.out.print(valores[j]+", ");
}
}
}
results.add(contentResult);
}
}
}
name={http://www.alfresco.org/model/content/1.0}path value=/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/site/1.0}s...
name={http://www.alfresco.org/model/content/1.0}path value=/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/site/1.0}s...
10-21-2009 03:28 AM
AuthenticationUtils.startSession("admin", "admin");
Store store = new Store("workspace", "SpacesStore");
String path = "/app_company_home";
RepositoryServiceSoapBindingStub repositoryService =
WebServiceFactory.getRepositoryService();
ContentServiceSoapBindingStub contentService = WebServiceFactory.getContentService();
Reference reference = new Reference(store, null, path);
Predicate predicate = new Predicate();
predicate.setNodes(new Reference[] { reference });
Node[] nodes = repositoryService.get(predicate);
NamedValue[] namedvalues = nodes[0].getProperties();
for (int j = 0; j < namedvalues.length; j++)
if (namedvalues[j].getName() != null && namedvalues[j].getValue() != null)
System.out.println(namedvalues[j].getName() + "=" + namedvalues[j].getValue());
AuthenticationUtils.endSession();
10-21-2009 04:04 AM
10-21-2009 04:20 AM
NamedValue[] namedvalues = nodes[0].getProperties();
for (int j = 0; j < namedvalues.length; j++)
if (namedvalues[j].getName() != null && namedvalues[j].getValue() != null)
System.out.println(namedvalues[j].getName() + "=" + namedvalues[j].getValue());
10-21-2009 04:40 AM
10-21-2009 04:53 AM
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.