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.
roothome.childByNamePath("Company Home/Clients");
String query = "+PATH:\"/app:company_home/cm:Clients/*\""; List<Node> nodes = searchService.query(ticket, new StoreRef(spacesStore), SearchService.QueryLanguage.lucene, query, properties, true, true, true, true, requiredPermissions, 100, sortDefinitions); if (nodes != null) { // file found System.out.println("Content in Clients folder"); for (Node node: nodes) { System.out.println("node: " + node.getProperties().get(ContentModel.PROP_NAME)); } }
String query = "+PATH:\"/app:company_home/cm:Clients/*\" + "AND +TYPE:\"cm:folder\"";
ContentData contentData = (ContentData) node.getProperties.get(ContentModel.PROP_CONTENT); long size = 0L; if (contentData != null) { size = contentData.getSize(); }
java.util.Set<org.alfresco.service.cmr.security.AccessPermission> getAllSetPermissions(Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef) throws InvalidTicketException, CmaRuntimeException
try { Set<AccessPermission> accessPerms = securityService().getAllSetPermissions(ticket, nodeRef); } catch (CmaRuntimeException e) { if (e.getCause() instanceof AccessDeniedException) { // This means you are a Consumer on this node }
ContentData contentData = (ContentData) getNodeService().getProperty(ticket,nodeRef,ContentModel.PROP_CONTENT); if (contentData != null && contentData.getSize() > 0) { System.out.println("Content data is not null"); } else { System.out.println("Content data is null"); }
The node's content is missing: node: workspace://SpacesStore/49ad5b5e-fbe3-40a3-bfcd-43b847130b10 reader: null Please contact your system administrator.
org.alfresco.service.cmr.repository.ContentData private final String contentUrl; private final String mimetype; private final long size; private final String encoding; private final Locale locale;
if (contentData == null) { PropertyDefinition contentPropDef = dictionaryService.getProperty(propertyQName); // if no value or a value other content, and a property definition has been provided, ensure that it's CONTENT or ANY if (contentPropDef != null && (!(contentPropDef.getDataType().getName().equals(DataTypeDefinition.CONTENT) || contentPropDef.getDataType().getName().equals(DataTypeDefinition.ANY)))) { throw new InvalidTypeException("The node property must be of type content: \n" + " node: " + nodeRef + "\n" + " property name: " + propertyQName + "\n" + " property type: " + ((contentPropDef == null) ? "unknown" : contentPropDef.getDataType()), propertyQName); } // check that the URL is available if (contentData == null || contentData.getContentUrl() == null) { // there is no URL - the interface specifies that this is not an error condition return null; }