Package org.nuxeo.ecm.core.api

Examples of org.nuxeo.ecm.core.api.DocumentModel


        }
        return navigationContext.getChangeableDocument();
    }

    protected DocumentRef getParentDocumentRef(String type) {
        DocumentModel currentDoc = navigationContext.getCurrentDocument();
        if (isSocialWorkspaceContainer(currentDoc)) {
            return currentDoc.getRef();
        }

        SocialWorkspace socialWorkspace = socialWorkspaceActions.getSocialWorkspace();
        if (NEWS_ITEM_TYPE.equals(type)) {
            return new PathRef(socialWorkspace.getNewsItemsRootPath());
View Full Code Here


    public void deleteSocialDocument(DocumentModel document)
            throws ClientException {
        document.followTransition(DELETE_TRANSITION);
        documentManager.saveDocument(document);
        DocumentModel parentDoc = documentManager.getDocument(document.getParentRef());
        Events.instance().raiseEvent(DOCUMENT_CHILDREN_CHANGED, parentDoc);
    }
View Full Code Here

    public String navigateToNewsItems() throws ClientException {
        return navigateToListing(NEWS_ITEMS_VIEW);
    }

    public String editSocialDocument() throws ClientException {
        DocumentModel currentDocument = navigationContext.getCurrentDocument();
        return editSocialDocument(currentDocument);
    }
View Full Code Here

            throws ClientException {
        if (isSocialDocument(document)) {
            return navigationContext.navigateToDocument(document,
                    EDIT_SOCIAL_DOCUMENT_VIEW);
        } else {
            DocumentModel currentDocument = navigationContext.getCurrentDocument();
            return navigationContext.navigateToDocument(currentDocument);
        }

    }
View Full Code Here

        }

    }

    public String goBack() throws ClientException {
        DocumentModel currentDocument = navigationContext.getCurrentDocument();
        if (currentDocument != null) {
            navigationContext.setChangeableDocument(null);
        } else {
            navigationContext.resetCurrentContext();
            EventManager.raiseEventsOnGoingHome();
View Full Code Here

        return backToDashboard();
    }

    public String saveOncreate() throws ClientException {
        documentActions.saveDocument();
        DocumentModel currentDoc = navigationContext.getCurrentDocument();
        return navigationContext.navigateToDocument(currentDoc,
                AFTER_SOCIAL_COLLABORATION_CREATION_VIEW);
    }
View Full Code Here

                AFTER_SOCIAL_COLLABORATION_CREATION_VIEW);
    }

    public String updateCurrentDocument() throws ClientException {
        documentActions.updateCurrentDocument();
        DocumentModel currentDocument = navigationContext.getCurrentDocument();
        return navigationContext.navigateToDocument(currentDocument,
                AFTER_SOCIAL_COLLABORATION_EDITION_VIEW);
    }
View Full Code Here

        return FacesContext.getCurrentInstance().getViewRoot().getViewId();
    }

    public boolean canCreateSocialWorkspace() {
        try {
            DocumentModel parent = socialWorkspaceService.getSocialWorkspaceContainer(documentManager);
            if (parent != null) {
                return (documentManager.hasPermission(parent.getRef(),
                        ADD_CHILDREN));
            }
        } catch (Exception e) {
            log.debug(e, e);
            // do nothing, user cannot create SW
View Full Code Here

    private static void fireEventMembersManagement(
            SocialWorkspace socialWorkspace, List<Principal> usernames,
            String eventName) {
        if (socialWorkspace.isMembersNotificationEnabled()) {
            DocumentModel doc = socialWorkspace.getDocument();
            EventContext ctx = new DocumentEventContext(doc.getCoreSession(),
                    doc.getCoreSession().getPrincipal(), doc);
            ctx.setProperty(CTX_PRINCIPALS_PROPERTY, (Serializable) usernames);

            try {
                Framework.getLocalService(EventService.class).fireEvent(
                        ctx.newEvent(eventName));
View Full Code Here

    protected SocialWorkspaceGroupComputer computer = new SocialWorkspaceGroupComputer();

    public List<String> getAdministrators() throws Exception {
        if (administrators == null) {
            DocumentModel currentDocument = navigationContext.getCurrentDocument();
            if (currentDocument != null) {
                administrators = ActivityHelper.getUsernames(computer.getGroupMembers(getSocialWorkspaceAdministratorsGroupName(currentDocument)));
                originalAdministrators = administrators;
            }
        }
View Full Code Here

TOP

Related Classes of org.nuxeo.ecm.core.api.DocumentModel

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.