Hi guys,
I have followed the following guide https://angelborroy.wordpress.com/2017/12/28/how-to-create-a-site-for-alfresco-using-java-api/
In doing so i got an empty dashboard after setting some user permissions.
private void createDefaultDashboard(SiteInfo siteInfo) { behaviourFilter.disableBehaviour(ContentModel.TYPE_CONTENT); NodeService nodeService = serviceRegistry.getNodeService(); NodeService nodeService = serviceRegistry.getNodeService(); FileFolderService fileFolderService = serviceRegistry.getFileFolderService(); ContentService contentService = serviceRegistry.getContentService(); FileInfo surfConfig = fileFolderService.create(siteInfo.getNodeRef(), "surf-config", ContentModel.TYPE_FOLDER); Map<QName, Serializable> properties = new HashMap<QName, Serializable>(); properties.put(ContentModel.PROP_CASCADE_HIDDEN, Boolean.TRUE); properties.put(ContentModel.PROP_CASCADE_INDEX_CONTROL, Boolean.TRUE); nodeService.addAspect(surfConfig.getNodeRef(), ContentModel.ASPECT_HIDDEN, properties); // Hint from Bertrand Forest properties = new HashMap<QName, Serializable>(); properties.put(ContentModel.PROP_IS_INDEXED, Boolean.FALSE); properties.put(ContentModel.PROP_IS_CONTENT_INDEXED, Boolean.FALSE); nodeService.addAspect(surfConfig.getNodeRef(), ContentModel.ASPECT_INDEX_CONTROL, properties); FileInfo pages = fileFolderService.create(surfConfig.getNodeRef(), "pages", ContentModel.TYPE_FOLDER); FileInfo site = fileFolderService.create(pages.getNodeRef(), "site", ContentModel.TYPE_FOLDER); FileInfo siteName = fileFolderService.create(site.getNodeRef(), siteInfo.getShortName(), ContentModel.TYPE_FOLDER); Map<QName, Serializable> props = new HashMap<QName, Serializable>(1); props.put(ContentModel.PROP_NAME, "dashboard.xml"); NodeRef node = nodeService.createNode( siteName.getNodeRef(), ContentModel.ASSOC_CONTAINS, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "dashboard.xml"), ContentModel.TYPE_CONTENT, props).getChildRef(); ContentWriter writer = contentService.getWriter(node, ContentModel.PROP_CONTENT, true); writer.setMimetype(MimetypeMap.MIMETYPE_XML); writer.setEncoding("UTF-8"); // TODO Create dashboard.xml file by using an external file resource instead of a hand-coded String writer.putContent("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<page>\n" + " <title>Collaboration Site Dashboard</title>\n" + " <title-id>page.siteDashboard.title</title-id>\n" + " <description>Collaboration site's dashboard page</description>\n" + " <description-id>page.siteDashboard.description</description-id>\n" + " <authentication>user</authentication>\n" + " <template-instance>dashboard-2-columns-wide-left</template-instance>\n" + " <properties>\n" + " <sitePages>[{\"pageId\":\"dashboard\"},{\"pageId\": \"documentlibrary\"}]</sitePages>\n" + " <theme/><dashboardSitePage>true</dashboardSitePage></properties>\n" + " <page-type-id>generic</page-type-id></page>"); }Now i want to add Dashlets to the created site-dashboard.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
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.