Package org.nuxeo.ecm.social.workspace.service

Examples of org.nuxeo.ecm.social.workspace.service.SocialWorkspaceContainerDescriptor


    @Override
    public void execute(CoreSession session) {
        try {
            SocialWorkspaceService socialWorkspaceService = Framework.getLocalService(SocialWorkspaceService.class);
            SocialWorkspaceContainerDescriptor socialWorkspaceContainer = socialWorkspaceService.getSocialWorkspaceContainerDescriptor();
            DocumentRef docRef = new PathRef(socialWorkspaceContainer.getPath());
            if (!session.exists(docRef)) {
                Path path = new Path(socialWorkspaceContainer.getPath());
                String parentPath = path.removeLastSegments(1).toString();
                String name = path.lastSegment();

                DocumentModel container = session.createDocumentModel(
                        parentPath, name, SOCIAL_WORKSPACE_CONTAINER_TYPE);
                container.setPropertyValue(DC_TITLE,
                        socialWorkspaceContainer.getTitle());
                container.setPropertyValue(DC_DESCRIPTION,
                        socialWorkspaceContainer.getDescription());
                session.createDocument(container);
            }
        } catch (ClientException e) {
            throw new ClientRuntimeException(e);
        }
View Full Code Here

TOP

Related Classes of org.nuxeo.ecm.social.workspace.service.SocialWorkspaceContainerDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.