As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
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; }