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.
<aspect name="cm:localizable"> <title>Localizable</title> <properties> <property name="cm:locale"> <title>Locale</title> <!– need to have means to identify root instance of appropriate category –> <type>d:category</type> </property> </properties> </aspect>
NodeRef categoryRef = (NodeRef)this.nodeService.getProperty(nodeRef, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "locale"));
this.nodeService.getProperty(this.nodeRef, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "locale"));
protected NodeService nodeService;
FacesContext context = FacesContext.getCurrentInstance(); NodeService nodeService = Repository.getServiceRegistry(context).getNodeService();
I have declared nodeService: protected NodeService nodeService;but i think that nodeService is Null !
javax.servlet.ServletContext
<managed-bean-name>BrowseBean</managed-bean-name>
NodeRef categoryRef = (NodeRef)this.nodeService.getProperty(nodeRef, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "locale"));
workspace://SpacesStore/9472c578-c478-11da-8be5-db2bb273e6f3
this.categoryRef = (NodeRef)nodeService.getProperty(this.nodeRef, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "locale"));
String Documentlanguage = Repository.getNameForNode(nodeService, this.categoryRef);
ApplicationContext context = new ClassPathXmlApplicationContext("classpath:alfresco/application-context.xml"); Repository repository = (Repository)context.getBean("JCR.Repository"); Session session = repository.login(new SimpleCredentials("admin", "admin".toCharArray())); try { ServiceRegistry serviceRegistry = (ServiceRegistry) context.getBean(ServiceRegistry.SERVICE_REGISTRY); NodeService nodeService = serviceRegistry.getNodeService(); StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore"); NodeRef nodeRef = nodeService.getRootNode(storeRef); NodeRef nameProp = (NodeRef)nodeService.getProperty(nodeRef, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "locale")); String name = null; if (nameProp != null) { name = nameProp.toString(); } System.out.println(name); session.save(); } finally { session.logout(); System.exit(0); }
this.nodeRef = ref.getNodeRef(); this.categoryRef = (NodeRef)nodeService.getProperty(this.nodeRef, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "locale"));