Package org.apache.lenya.cms.publication

Examples of org.apache.lenya.cms.publication.ResourceType


        return resourceType;
    }

    private void validateDoc(SourceResolver resolver, org.w3c.dom.Document xmlDoc, Document doc)
            throws Exception {
        ResourceType resourceType = doc.getResourceType();
        Schema schema = resourceType.getSchema();
        ValidationUtil.validate(this.manager, xmlDoc, schema, new UsecaseErrorHandler(this));
    }
View Full Code Here


    protected boolean getVisibleInNav() {
        return true;
    }

    protected String getDocumentTypeName() {
        ResourceType resourceType = null;
        ServiceSelector selector = null;
        String docType = "";
        try {
            selector = (ServiceSelector) this.manager.lookup(ResourceType.ROLE + "Selector");
            resourceType = lookUpExtension(getSourceExtension(), selector);
            docType = resourceType.getName();
        } catch (ServiceException e) {
            throw new RuntimeException(e);
        } finally {
            if (selector != null) {
                this.manager.release(selector);
View Full Code Here

                        value = StringUtils.join(document.getLanguages(), ',');
                    } else if (name.equals(PageEnvelope.DOCUMENT_LASTMODIFIED)) {
                        Date date = new Date(document.getLastModified());
                        value = new SimpleDateFormat(DATE_FORMAT).format(date);
                    } else if (name.equals(PageEnvelope.DOCUMENT_TYPE)) {
                        ResourceType resourceType = document.getResourceType();
                        if (resourceType == null) {
                            value = null;
                        } else {
                            value = resourceType.getName();
                        }
                    }
                }
            }
        } catch (final Exception e) {
View Full Code Here

        String contentUri = baseUri + path + "/index_" + language;
        String metaUri = contentUri + ".meta";

        DocumentManager docManager = null;
        ServiceSelector selector = null;
        ResourceType resourceType = null;
        SourceResolver resolver = null;
        try {

            org.w3c.dom.Document xml = SourceUtil.readDOM(metaUri, this.manager);
            NamespaceHelper helper = new NamespaceHelper(
View Full Code Here

        boolean linksRewritten = false;
        try {

            String prefix = useContextPath ? getContextPath() : "";

            ResourceType type = examinedDocument.getResourceType();
            String[] xPaths = type.getLinkAttributeXPaths();

            if (xPaths.length == 0) {
                if (getLogger().isDebugEnabled()) {
                    getLogger().debug(
                            "Convert links: No XPaths for resource type [" + type.getName() + "]");
                }
            } else {
                Publication pub = examinedDocument.getPublication();
                LinkRewriter incomingRewriter = new IncomingLinkRewriter(pub);
                LinkRewriter urlToUuidRewriter = new UrlToUuidRewriter(examinedDocument.area());
View Full Code Here

     * @return The name of the workflow schema.
     */
    protected String getWorkflowSchema() {
        String workflowName = null;
        try {
            ResourceType doctype = document.getResourceType();
            if (doctype != null) {
                workflowName = document.getPublication().getWorkflowSchema(doctype);
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
View Full Code Here

            validate(xml);
        }
    }

    protected void validate(Document xml) throws Exception {
        ResourceType resourceType = getSourceDocument().getResourceType();
        Schema schema = resourceType.getSchema();
        ValidationUtil.validate(this.manager, xml, schema, new UsecaseErrorHandler(this));
    }
View Full Code Here

            // create new doc from PUT input
            if (!doc.exists()) {
                DocumentManager documentManager = null;
                ServiceSelector selector = null;
                ResourceType resourceType = null;
                try {
                    selector = (ServiceSelector) this.manager
                            .lookup(ResourceType.ROLE + "Selector");

                    documentManager = (DocumentManager) this.manager.lookup(DocumentManager.ROLE);

                    DocumentFactory map = getDocumentFactory();
                    String path = doc.getPath();
                    // lookupResourceType(extension)
                    resourceType = lookUpExtension(extension, selector);
                    ResourceType.Sample sample = resourceType.getSample(resourceType.getSampleNames()[0]);
                    doc = documentManager.add(map, resourceType, sample.getUri(), getPublication(), doc
                            .getArea(), path, doc.getLanguage(), extension, doc.getName(), true);
                    doc.setMimeType(sample.getMimeType());
                    setMetaData(doc);
                } finally {
View Full Code Here

        }
    }

    private ResourceType lookUpExtension(String extension, ServiceSelector selector)
            throws ServiceException {
        ResourceType resourceType;
        String resourceTypeName = (String) registeredExtensions.get(extension);
        if (resourceTypeName == null || resourceTypeName.equals("")) {
            resourceTypeName = (String) registeredExtensions.get(this.EXTENSION);
            this.fallback = true;
        }
View Full Code Here

        return resourceType;
    }

    private void validateDoc(SourceResolver resolver, org.w3c.dom.Document xmlDoc, Document doc)
            throws Exception {
        ResourceType resourceType = doc.getResourceType();
        Schema schema = resourceType.getSchema();
        ValidationUtil.validate(this.manager, xmlDoc, schema, new UsecaseErrorHandler(this));
    }
View Full Code Here

TOP

Related Classes of org.apache.lenya.cms.publication.ResourceType

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.