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...
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();
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());
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.