03-24-2013 10:16 AM
…
Reference parentReference = null;
// Get a reference to the respository web service
RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();
// Create a query object, looking for all items with alfresco in the name of text
Query query = new Query(Constants.QUERY_LANG_LUCENE, "TEXT:'test'");
// Execute the query
QueryResult queryResult = repositoryService.query(
new Store(Constants.WORKSPACE_STORE, "SpacesStore"),
query, false);
…
04-11-2013 09:20 AM
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"
"http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="webscript.com.alfeo.alfresco.stock.analyse.stockage.get"
class="com.alfeo.alfresco.stock.analyse.StockageTestV2" parent="webscript">
<property name="serviceRegistry"><ref bean="ServiceRegistry"/></property>
<property name="searchService"><ref bean="SearchService"/></property>
</bean>
</beans>
import java.util.HashMap;
import java.util.Map;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.cmr.search.ResultSet;
import org.alfresco.service.cmr.search.SearchParameters;
import org.alfresco.service.cmr.search.SearchService;
import org.springframework.extensions.webscripts.Cache;
import org.springframework.extensions.webscripts.DeclarativeWebScript;
import org.springframework.extensions.webscripts.Status;
import org.springframework.extensions.webscripts.WebScriptRequest;
public class StockageTestV2 extends DeclarativeWebScript
{
private ResultSet results = null;
private StoreRef stRef=null;
private String query=null;
private ServiceRegistry serviceRegistry;
private SearchService searchService;
public void setServiceRegistry(ServiceRegistry serviceRegistry)
{
this.serviceRegistry=serviceRegistry;
}
public ServiceRegistry getServiceRegistry()
{
return this.serviceRegistry;
}
public void setSearchService(SearchService searchService)
{
this.searchService=searchService;
}
public SearchService getSearchService()
{
return this.searchService;
}
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
{
stRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE,"SpacesStore");
query = "PATH:\"/app:company_home\"";
//System.out.println("—->this.searchService ="+getSearchService());
SearchParameters searchParameters = new SearchParameters();
searchParameters.addStore(stRef);
searchParameters.setQuery(query);
searchParameters.setLanguage(SearchService.LANGUAGE_LUCENE);
results = getServiceRegistry().getSearchService().query(searchParameters);
Map<String, Object> model = new HashMap<String, Object>();
model.put("mess", "slt");
return model;
}
}
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.