protected static final Store STORE = {http://www.alfresco.org/model/system/1.0}store-identifier
protected static final Store PATH = {http://www.alfresco.org/model/content/1.0}path
protected static final Store WORKSPACE = {http://www.alfresco.org/model/system/1.0}store-protocol
protected static final Store CONSTANTE_URL = /alfresco/d/d/
public Object obtenerDoc(Query query){
try {
HttpServletRequest req = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
AuthenticationDetails details = (AuthenticationDetails)req.getSession().getAttribute("authenticationDetails");
RepositoryServiceSoapBindingStub repositoryService = WebServiceClient.getRepositoryService(details);
QueryResult queryResult = repositoryService.query(new Store(Constants.WORKSPACE_STORE, "SpacesStore"), query, false);
ResultSet rs = queryResult.getResultSet();
ResultSetRow[] rows = rs.getRows();
if (rows != null && rows.length > 0){
// Get the infomation from the result set
for(ResultSetRow row : rows)
{
String nodeId = row.getNode().getId();
Doc doc = new Doc();
doc.setId(nodeId);
boolean haEntrado = false;
for (NamedValue namedValue : row.getColumns())
{
if (namedValue.getName().endsWith(Constants.PROP_NAME) == true)
{
doc.setName(namedValue.getValue());
}
else if (namedValue.getName().equals(PATH) == true)
{
doc.setPath(namedValue.getValue());
}
else if (namedValue.getName().equals(WORKSPACE) == true)
{
doc.setWorkspace(namedValue.getValue());
}
else if (namedValue.getName().equals(STORE) == true)
{
doc.setStore(namedValue.getValue());
}
if(!haEntrado && doc.getWorkspace() != null && doc.getStore() != null && doc.getId() != null && doc.getName()!= null){
doc.setUrl(CONSTANTE_URL + doc.getWorkspace() + "/" + doc.getStore() + "/" + doc.getId() + "/" + doc.getName());
haEntrado = true;
}
}
}
}
} catch (RepositoryFault e) {
logger.error(Utils.getStackTrace(e));
} catch (RemoteException e) {
logger.error(Utils.getStackTrace(e));
} catch (Exception e){
logger.error(Utils.getStackTrace(e));
}
return Object;
}
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.