Package org.apache.lenya.cms.repository

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


           
            selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE + "Selector");
            _manager = (TreeSiteManager) selector.select(publication.getSiteManagerHint());
           
            Request request = ObjectModelHelper.getRequest(objectModel);
            Session session = RepositoryUtil.getSession(this.manager, request);
            DocumentFactory map = DocumentUtil.createDocumentFactory(this.manager, session);

            if (name.equals(AUTHORING_NODE)) {
                SiteTree authoringTree = _manager.getTree(map,
                        publication,
View Full Code Here


     */
    void handleError(String msg) throws SAXException {
        closeIndexer();

        try {
            Session session = RepositoryUtil.getSession(this.manager, this.request);
            User sender = session.getIdentity().getUser();
            UserManager userManager = (UserManager) sender.getItemManager();
            User recipient = userManager.getUser(this.notificationRecipient);
            Identifiable[] recipients = { recipient };

            String subject = "indexing-failed-subject";
View Full Code Here

     */
    public void testNotification() throws Exception {

        login("lenya");

        Session session = getFactory().getSession();

        User lenya = getAccreditableManager().getUserManager().getUser("lenya");
        User alice = getAccreditableManager().getUserManager().getUser("alice");

        Identifiable[] recipients = { alice };

        Message message = new Message(SUBJECT, new String[0], "body", new String[0], lenya,
                recipients);
        NotificationEventDescriptor descr = new NotificationEventDescriptor(message);
        RepositoryEvent event = RepositoryEventFactory.createEvent(getManager(), session,
                getLogger(), descr);
        event.setNodeUri(getFactory().getPublication("test").getArea("authoring").getSite()
                .getNode("/index").getLink("en").getDocument().getRepositoryNode().getSourceURI());

        session.enqueueEvent(event);

        Inbox inbox = getInbox(alice);
        cleanUp(inbox, SUBJECT);

        assertFalse(containsMessage(inbox, SUBJECT));
        session.commit();
        Thread.sleep(100);
        assertTrue(containsMessage(inbox, SUBJECT));

        cleanUp(inbox, SUBJECT);

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.