Package org.apache.cocoon.portal.profile

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


    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


        CopletData data = (CopletData) ((CopletDataEvent)e).getTarget();
        PortalService service = null;
        List instances = null;
        try {
            service = (PortalService) this.manager.lookup(PortalService.ROLE);
            ProfileManager profileManager = service.getComponentManager().getProfileManager();
            instances = profileManager.getCopletInstanceData(data);
        } catch (Exception ignore) {
            // ignore exception
        } finally {
            this.manager.release(service);
        }
View Full Code Here

     * @param   coplet  the coplet instance data
     * @trows  ProcessingException if something fails in the creation process
     */
    private void createNewInstance(CopletInstanceData coplet)
    throws ProcessingException {
        ProfileManager profileManager = null;
        try {
            profileManager =
                (ProfileManager) this.manager.lookup(ProfileManager.ROLE);

            CopletData copletData = coplet.getCopletData();

            LayoutFactory lfac =
                (LayoutFactory) this.manager.lookup(LayoutFactory.ROLE);

            CopletLayout copletLayout =
                (CopletLayout) lfac.newInstance("coplet");

            CopletFactory cfac =
                (CopletFactory) manager.lookup(CopletFactory.ROLE);

            CopletInstanceData newCoplet = cfac.newInstance(copletData);

            copletLayout.setCopletInstanceData(newCoplet);
            profileManager.register(copletLayout);

            NamedItem newItem = new NamedItem();
            newItem.setLayout(copletLayout);

            CompositeLayout tabLayout =
                (CompositeLayout) profileManager.getPortalLayout(
                    "portalApplications", null);

            newItem.setName(getNewInstanceTabName(tabLayout));
            tabLayout.addItem(newItem);
        } catch (ServiceException ce) {
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.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

     * @param   coplet  the coplet instance data
     * @trows  ProcessingException if something fails in the creation process
     */
    private void createNewInstance(CopletInstanceData coplet)
        throws ProcessingException {
        ProfileManager profileManager = null;
        try {
            profileManager =
                (ProfileManager) this.manager.lookup(ProfileManager.ROLE);

            CopletData copletData = coplet.getCopletData();

            LayoutFactory lfac =
                (LayoutFactory) this.manager.lookup(LayoutFactory.ROLE);

            CopletLayout copletLayout =
                (CopletLayout) lfac.newInstance("coplet");

            CopletFactory cfac =
                (CopletFactory) manager.lookup(CopletFactory.ROLE);

            CopletInstanceData newCoplet = cfac.newInstance(copletData);

            copletLayout.setCopletInstanceData(newCoplet);
            profileManager.register(copletLayout);

            NamedItem newItem = new NamedItem();
            newItem.setLayout(copletLayout);

            CompositeLayout tabLayout =
                (CompositeLayout) profileManager.getPortalLayout(
                    "portalApplications", null);

            newItem.setName(getNewInstanceTabName(tabLayout));
            tabLayout.addItem(newItem);
        } catch (ServiceException ce) {
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

        FullScreenCopletEvent e = (FullScreenCopletEvent) event;
        final Layout startingLayout = (CopletLayout)e.getLayout();
        PortalService portalService = null;
        try {
            portalService = (PortalService) this.manager.lookup(PortalService.ROLE);
            ProfileManager pm = portalService.getComponentManager().getProfileManager();
            final Layout old = pm.getEntryLayout();
            if ( old != null && old instanceof CopletLayout) {
                ((CopletLayout)old).getCopletInstanceData().setAspectData("fullScreen", Boolean.FALSE);
            }
            pm.setEntryLayout( startingLayout );
            if ( startingLayout != null && startingLayout instanceof CopletLayout) {
                ((CopletLayout)startingLayout).getCopletInstanceData().setAspectData("fullScreen", Boolean.TRUE);
            }
        } catch (ServiceException ce) {
            // ignore
View Full Code Here

        PortalService portalService = null;
        try {
            portalService = (PortalService) manager.lookup(PortalService.ROLE);
            portalService.setPortalName(portalName);
               
            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

        CopletData data = (CopletData) ((CopletDataEvent)e).getTarget();
        PortalService service = null;
        List instances = null;
        try {
            service = (PortalService) this.manager.lookup(PortalService.ROLE);
            ProfileManager profileManager = service.getComponentManager().getProfileManager();
            instances = profileManager.getCopletInstanceData(data);
        } catch (Exception ignore) {
        } finally {
            this.manager.release(service);
        }
        if ( instances != null ) {
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(profileManager.getEntryLayout()) ) {
                        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

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.