Package org.apache.lenya.cms.repository

Examples of org.apache.lenya.cms.repository.Session


     * @return A publication.
     * @throws PublicationException if there was a problem creating the publication.
     */
    public static Publication getPublication(ServiceManager manager, Request request)
            throws PublicationException {
        Session session;
        try {
            session = RepositoryUtil.getSession(manager, request);
        } catch (RepositoryException e) {
            throw new PublicationException(e);
        }
View Full Code Here


        if (name.equals(NEW_MESSAGE_COUNT)) {
            InboxManager inboxManager = null;
            try {
                inboxManager = (InboxManager) this.manager.lookup(InboxManager.ROLE);
                Request request = ObjectModelHelper.getRequest(objectModel);
                Session session = RepositoryUtil.getSession(manager, request);
                User user = session.getIdentity().getUser();
                if (user == null) {
                    return "0";
                } else {
                    Inbox inbox = inboxManager.getInbox(user);
                    int count = 0;
View Full Code Here

        return value;
    }

    protected String rewrite(Request request, String url) throws RepositoryException,
            ConfigurationException {
        Session session = RepositoryUtil.getSession(this.manager, request);
        LinkRewriter rewriter = new OutgoingLinkRewriter(this.manager, session, request
                .getRequestURI(), request.isSecure(), false, this.relativeUrls);
        if (!rewriter.matches(url)) {
            throw new ConfigurationException("The URL [" + url + "] can't be rewritten!");
        }
View Full Code Here

        if (uriAndQuery.length > 1) {
            Query query = new Query(uriAndQuery[1]);
            sessionName = query.getValue("session");
        }

        Session session;
        try {
            session = getSession(sessionName);
        } catch (RepositoryException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

    }

    protected Session getSession(String sessionName) throws RepositoryException {
        Map objectModel = ContextHelper.getObjectModel(this.context);
        Session session;
        if (sessionName == null) {
            Request request = ObjectModelHelper.getRequest(objectModel);
            session = RepositoryUtil.getSession(this.manager, request);
        } else if (sessionName.equals("usecase")) {
            session = getUsecaseSession(objectModel);
View Full Code Here

        try {
            PageEnvelope envelope = getEnvelope(objectModel, name);
            Document document = envelope.getDocument();
            if (document != null && document.exists()) {
                wfManager = (WorkflowManager) this.manager.lookup(WorkflowManager.ROLE);
                Session session = RepositoryUtil.getSession(this.manager,
                        ObjectModelHelper.getRequest(objectModel));
                Workflowable workflowable = WorkflowUtil.getWorkflowable(this.manager,
                        session,
                        getLogger(),
                        document);
View Full Code Here

            Logger logger) throws PageEnvelopeException {
        super();
        setContext("");

        try {
            Session session = RepositoryUtil.createSession(manager, null, false);
            DocumentFactory map = DocumentUtil.createDocumentFactory(manager, session);
            setDocument(map.getFromURL(url));
        } catch (Exception e) {
            throw new PageEnvelopeException(e);
        }
View Full Code Here

    /**
     * Tests the meta data.
     * @throws Exception
     */
    public void testDocumentFactory() throws Exception {
        Session session = RepositoryUtil.getSession(getManager(), getRequest());
        DocumentFactory factoryA = DocumentUtil.createDocumentFactory(getManager(), session);

        Publication publication = getPublication("test");
       
        Document docA1 = factoryA.get(publication, Publication.AUTHORING_AREA, "/index", "en");
View Full Code Here

     * @param manager The service manager.
     * @param request The request.
     * @return A document factory.
     */
    public static DocumentFactory getDocumentFactory(ServiceManager manager, Request request) {
        Session session;
        try {
            session = RepositoryUtil.getSession(manager, request);
        } catch (RepositoryException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

     * @throws RepositoryException if an error occurs.
     * @throws DocumentBuildException if an error occurs.
     */
    public static Document getCurrentDocument(ServiceManager manager, Request request)
            throws RepositoryException, DocumentBuildException {
        Session session = RepositoryUtil.getSession(manager, request);
        DocumentFactory factory = DocumentUtil.createDocumentFactory(manager, session);
        String url = ServletHelper.getWebappURI(request);
        Document doc = null;
        if (factory.isDocument(url)) {
            doc = factory.getFromURL(url);
View Full Code Here

TOP

Related Classes of org.apache.lenya.cms.repository.Session

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.