Package org.apache.cocoon.portal.profile

Examples of org.apache.cocoon.portal.profile.ProfileManager


           
            PortalService service = null;
            EventManager eventManager = null;
            try {
                service = (PortalService)this.manager.lookup(PortalService.ROLE);               
                ProfileManager profileManager = service.getComponentManager().getProfileManager();
                if ( layout instanceof CopletLayout ) {
                    // full screen?
                    if ( layout.equals(service.getEntryLayout(null)) ) {
                        Event event = new FullScreenCopletEvent(((CopletLayout)layout).getCopletInstanceData(), null);
                        eventManager = (EventManager)this.manager.lookup(EventManager.ROLE);
                        eventManager.getPublisher().publish(event);
                        service.getComponentManager().getLinkService().addEventToLink(event);
                    }
                    CopletFactory factory = service.getComponentManager().getCopletFactory();
                    factory.remove( ((CopletLayout)layout).getCopletInstanceData());
                }
                profileManager.unregister(layout);
            } catch (ServiceException ce) {
                throw new ProcessingException("Unable to lookup portal service.", ce);
            } finally {
                this.manager.release( service );
                this.manager.release(eventManager);
View Full Code Here


                final Event saveEvent = new SaveBasketEvent();
                XMLUtils.data(this.xmlConsumer, linkService.getLinkURI(saveEvent));
                XMLUtils.endElement(this.xmlConsumer, "persist-url");
               
                if ( basket.size() > 0 ) {
                    ProfileManager profileManager = service.getComponentManager().getProfileManager();
                   
                    XMLUtils.startElement(this.xmlConsumer, "items");
                    for(int i=0; i<basket.size();i++) {
                        Object item = basket.getItem(i);
                        XMLUtils.startElement(this.xmlConsumer, "item");
                        XMLUtils.startElement(this.xmlConsumer, "id");
                        XMLUtils.data(this.xmlConsumer, item.toString());
                        XMLUtils.endElement(this.xmlConsumer, "id");
                        if ( item instanceof ContentItem ) {
                            ContentItem ci = (ContentItem)item;
                            Event e = new ShowItemEvent(item, profileManager.getPortalLayout(null, this.showLayoutId), this.showCopletId);
                            XMLUtils.startElement(this.xmlConsumer, "show-url");
                            XMLUtils.data(this.xmlConsumer, linkService.getLinkURI(e));
                            XMLUtils.endElement(this.xmlConsumer, "show-url");
                            if (ci.size() != -1 ) {
                                XMLUtils.startElement(this.xmlConsumer, "size");
View Full Code Here

           
            PortalService service = null;
            EventManager eventManager = null;
            try {
                service = (PortalService)this.manager.lookup(PortalService.ROLE);               
                ProfileManager profileManager = service.getComponentManager().getProfileManager();
                if ( layout instanceof CopletLayout ) {
                    // full screen?
                    if ( layout.equals(service.getEntryLayout(null)) ) {
                        Event event = new FullScreenCopletEvent(((CopletLayout)layout).getCopletInstanceData(), null);
                        eventManager = (EventManager)this.manager.lookup(EventManager.ROLE);
                        eventManager.send(event);
                        service.getComponentManager().getLinkService().addEventToLink(event);
                    }
                    CopletFactory factory = service.getComponentManager().getCopletFactory();
                    factory.remove( ((CopletLayout)layout).getCopletInstanceData());
                }
                profileManager.unregister(layout);
            } catch (ServiceException ce) {
                throw new ProcessingException("Unable to lookup portal service.", ce);
            } finally {
                this.manager.release( service );
                this.manager.release(eventManager);
View Full Code Here

     */
    public void inform(CopletDataEvent e, PortalService service) {
        CopletData data = (CopletData)e.getTarget();
        List instances = null;

        ProfileManager profileManager = service.getComponentManager().getProfileManager();
        instances = profileManager.getCopletInstanceData(data);

        if ( instances != null && e instanceof ChangeCopletsJXPathEvent ) {
            EventManager eventManager = service.getComponentManager().getEventManager();
            final String path = ((ChangeCopletsJXPathEvent)e).getPath();
            final Object value = ((ChangeCopletsJXPathEvent)e).getValue();
View Full Code Here

    throws ProcessingException {
        PortalService portalService = null;
        try {
            portalService = (PortalService) manager.lookup(PortalService.ROLE);
               
            ProfileManager profileManager = portalService.getComponentManager().getProfileManager();
            CopletInstanceData data = profileManager.getCopletInstanceData(copletID);
            return data;
        } catch (ServiceException e) {
            throw new ProcessingException("Error getting portal service.", e);
        } finally {
            manager.release(portalService);
View Full Code Here

               
                XMLUtils.startElement(this.xmlConsumer, "basket-content");
   
                this.toSAX(uc);
               
                final ProfileManager profileManager = service.getComponentManager().getProfileManager();
                   
                    XMLUtils.startElement(this.xmlConsumer, "items");
               
                int itemCount = 0;
                long itemSize = 0;
View Full Code Here

                                        PortalService service) {
        final Request req = ObjectModelHelper.getRequest(objectModel);
        final Session session = req.getSession();
        UserConfiguration uc = (UserConfiguration)session.getAttribute(ATTR_NAME);
        if ( uc == null ) {
            final ProfileManager pm = service.getComponentManager().getProfileManager();
            final CopletInstanceData cid = pm.getCopletInstanceData("basket");
            if ( cid != null ) {
                uc = new UserConfiguration(cid.getAttributes());
                session.setAttribute(ATTR_NAME, uc);
            }
        }
View Full Code Here

    /**
     * @see org.apache.pluto.om.entity.PortletEntityCtrl#store()
     */
    public void store() throws IOException {
        final ProfileManager manager = this.service.getComponentManager().getProfileManager();
        manager.saveUserCopletInstanceDatas(null);
    }
View Full Code Here

public class FullScreenMapping extends Mapping {
    public String copletId;
    public String layoutId;
   
    public Event getEvent(PortalService service, Object data) {
        final ProfileManager manager = service.getComponentManager().getProfileManager();
        final CopletInstanceData cid = manager.getCopletInstanceData(this.copletId);
        final Layout layout = manager.getPortalLayout(null, layoutId) ;
       
        Event e = new FullScreenCopletEvent(cid, layout);
        return e;
    }
View Full Code Here

        ComponentManager manager,
        Map objectModel,
        String copletID,
        String portalName)
        throws ProcessingException, IOException, SAXException {
        ProfileManager profileManager = null;
        try {
            profileManager =
                (ProfileManager) manager.lookup(ProfileManager.ROLE);

            // set portal name
            PortalService portalService = null;
            try {
                portalService =
                    (PortalService) manager.lookup(PortalService.ROLE);
                portalService.setPortalName(portalName);
            }
            finally {
                manager.release(portalService);
            }

            CopletInstanceData data =
                profileManager.getCopletInstanceData(copletID);
            return data;
        }
        catch (ComponentException e) {
            throw new ProcessingException("Error getting profile manager.", e);
        }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.portal.profile.ProfileManager

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.