Package org.nuxeo.ecm.core.api

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


        return buildDocumentList(ref, pageSize, page, queryText);
    }

    Template buildDocumentList(String ref, int pageSize, int page,
            String queryText) throws Exception {
        DocumentRef docRef = getDocumentRef(ref);
        return buildDocumentList(docRef, pageSize, page, queryText);
    }
View Full Code Here


    @Path("publishDocument")
    public Object publishDocument(@Context HttpServletRequest request)
            throws Exception {
        FormData formData = new FormData(request);
        CoreSession session = ctx.getCoreSession();
        DocumentRef docRef = getDocumentRef(formData.getString("targetRef"));

        DocumentModel target = session.getDocument(docRef);
        SocialDocument socialDocument = toSocialDocument(target);

        if (socialDocument == null) {
View Full Code Here

    @Path("deleteDocument")
    public Object deleteDocument(@Context HttpServletRequest request)
            throws Exception {
        FormData formData = new FormData(request);
        String target = formData.getString("targetRef");
        DocumentRef docRef = getDocumentRef(target);
        CoreSession session = ctx.getCoreSession();

        if (session.getAllowedStateTransitions(docRef).contains(
                DELETE_TRANSITION)) {
            session.followTransition(docRef, DELETE_TRANSITION);
View Full Code Here

    @Path("createDocumentForm")
    public Object createDocumentForm(@QueryParam("docRef") String ref,
            @QueryParam("doctype") String docTypeId,
            @QueryParam("lang") String lang) throws Exception {
        setLanguage(lang);
        DocumentRef docRef = getDocumentRef(ref);
        CoreSession session = ctx.getCoreSession();
        DocumentModel currentDoc = session.getDocument(docRef);

        DocumentType coreType = TypeService.getSchemaManager().getDocumentType(
                docTypeId);
View Full Code Here

    @GET
    @Path("selectDocTypeToCreate")
    public Object selectDocTypeToCreate(@QueryParam("docRef") String ref,
            @QueryParam("lang") String lang) throws ClientException {
        setLanguage(lang);
        DocumentRef docRef = getDocumentRef(ref);
        CoreSession session = ctx.getCoreSession();
        DocumentModel currentDoc = session.getDocument(docRef);
        TypeManager typeService = getTypeService();
        Map<String, List<Type>> types = typeService.getTypeMapForDocumentType(
                currentDoc.getType(), currentDoc);
View Full Code Here

            throws Exception {
        CoreSession session = ctx.getCoreSession();
        FormData formData = new FormData(request);
        String type = formData.getDocumentType();
        String title = formData.getDocumentTitle();
        DocumentRef docRef = getDocumentRef(formData.getString("docRef"));
        DocumentModel parent = session.getDocument(docRef);
        DocumentModel newDoc = session.createDocumentModel(
                parent.getPathAsString(), title, type);
        formData.fillDocument(newDoc);
        newDoc = session.createDocument(newDoc);
View Full Code Here

    protected static boolean isSocialWorkspace(DocumentModel doc) {
        return doc != null && doc.hasFacet(SOCIAL_WORKSPACE_FACET);
    }

    protected static DocumentRef getDocumentRef(String ref) {
        DocumentRef docRef;
        if (ref != null && ref.startsWith("/")) { // doc identified by absolute
            // path
            docRef = new PathRef(ref);
        } else { // // doc identified by id
            docRef = new IdRef(ref);
View Full Code Here

    @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();
View Full Code Here

    public void addDocumentContextToMap(
            Map<DocumentRef, List<Event>> socialDocuments, Event event) {
        DocumentEventContext docCtx = (DocumentEventContext) event.getContext();

        DocumentRef docRef = docCtx.getSourceDocument().getRef();
        if (socialDocuments.containsKey(docRef)) {
            socialDocuments.get(docRef).add(event);
        } else {
            List<Event> docContextes = new ArrayList<Event>();
            docContextes.add(event);
View Full Code Here

                    "Given document is not into a social workspace");
        }
    }

    protected DocumentModel getPrivateSection() throws ClientException {
        DocumentRef pathRef = new PathRef(
                socialWorkspace.getPrivateSectionPath());
        if (privateSocialSection == null) {
            privateSocialSection = getSession().getDocument(pathRef);
        }
        return privateSocialSection;
View Full Code Here

TOP

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

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.