Package org.nuxeo.ecm.core.api

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


     * Computes and returns the URL for the given {@code doc}, using the
     * document link builder sets in the
     * {@link org.nuxeo.ecm.webengine.model.WebContext}.
     */
    public String computeDocumentURL(DocumentModel doc) {
        DocumentLocation docLoc = new DocumentLocationImpl(
                doc.getRepositoryName(), new IdRef(doc.getId()));
        DocumentView docView = new DocumentViewImpl(docLoc, doc.getAdapter(
                TypeInfo.class).getDefaultView());
        DocumentViewCodecManager documentViewCodecManager = Framework.getLocalService(DocumentViewCodecManager.class);
        String documentLinkBuilder = (String) ctx.getProperty("documentLinkBuilder");
View Full Code Here


        if (!TransactionHelper.isTransactionActive()) {
            TransactionHelper.startTransaction();
            transactionStarted = true;
        }
        try {
            final DocumentLocation docLoc = docView.getDocumentLocation();
            new UnrestrictedSessionRunner(docLoc.getServerName()) {
                @Override
                public void run() throws ClientException {
                    computeDocumentView(session, docView);
                }
            }.runUnrestricted();
View Full Code Here

        return docView;
    }

    @Override
    public String getUrlFromDocumentView(DocumentView docView) {
        DocumentLocation documentLocation = docView.getDocumentLocation();
        if (documentLocation.getPathRef() != null) {
            DocumentPathCodec pathCodec = new DocumentPathCodec();
            pathCodec.setPrefix(getPrefix());
            docView.setViewId("view_social_document");
            return pathCodec.getUrlFromDocumentView(docView);
        } else {
View Full Code Here

public class CollaborationActivityLinkBuilder extends
        DefaultActivityLinkBuilder {

    @Override
    public String getDocumentURL(String repositoryName, String documentId) {
        DocumentLocation docLoc = new DocumentLocationImpl(repositoryName,
                new IdRef(documentId));
        DocumentView docView = new DocumentViewImpl(docLoc,
                "view_social_document");
        URLPolicyService urlPolicyService = Framework.getLocalService(URLPolicyService.class);
        return VirtualHostHelper.getContextPathProperty()
View Full Code Here

TOP

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

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.