/ Published in: Java
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
package sample; import java.rmi.RemoteException; import org.alfresco.webservice.repository.QueryResult; import org.alfresco.webservice.repository.RepositoryFault; import org.alfresco.webservice.repository.RepositoryServiceSoapBindingStub; import org.alfresco.webservice.types.*; import org.alfresco.webservice.util.*; public class TestQuery { public static final Store STORE = new Store(Constants.WORKSPACE_STORE, "SpacesStore"); AuthenticationUtils.startSession("admin","admin1234"); RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService("http://localhost:8080/alfresco/api"); Query query = new Query(Constants.QUERY_LANG_LUCENE, "@cm\\:name:'hsqlprefs.dat'"); QueryResult queryResult = repositoryService.query(STORE, query, false); // Display the results ResultSetRow[] rows = resultSet.getRows(); if (rows == null) else { for (ResultSetRow row : rows) { } } Node[] a = repositoryService.get(new Predicate( for (int i = 0; i < a[0].getProperties().length; i++) { if (a[0].getProperties(i).getName().equalsIgnoreCase( "{http://www.alfresco.org/model/content/1.0}content")) } } } }