Package org.apache.cocoon.portal.profile

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


     * @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


        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

        ServiceManager 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 (ServiceException e) {
            throw new ProcessingException("Error getting profile manager.", e);
        }
View Full Code Here

        ServiceManager manager,
        Map objectModel,
        Parameters parameters)
        throws ProcessingException, IOException, SAXException {

        ProfileManager profileManager = null;
        try {
            profileManager =
                (ProfileManager) manager.lookup(ProfileManager.ROLE);
            // determine coplet id
            String copletId = null;
            Map context =
                (Map) objectModel.get(ObjectModelHelper.PARENT_CONTEXT);
            if (context != null) {
                copletId = (String) context.get(Constants.COPLET_ID_KEY);
                if (copletId == null) {
                    throw new ProcessingException("copletId must be passed as parameter or in the object model within the parent context.");
                }
            }
            else {
                try {
                    copletId = parameters.getParameter(COPLET_ID_PARAM);

                    // set portal name
                    PortalService portalService = null;
                    try {
                        portalService =
                            (PortalService) manager.lookup(PortalService.ROLE);
                        portalService.setPortalName(
                            parameters.getParameter(PORTAL_NAME_PARAM));
                    }
                    finally {
                        manager.release(portalService);
                    }
                }
                catch (ParameterException e) {
                    throw new ProcessingException("copletId and portalName must be passed as parameter or in the object model within the parent context.");
                }
            }
            return profileManager.getCopletInstanceData(copletId);
        }
        catch (ServiceException e) {
            throw new ProcessingException("Error getting profile manager.", e);
        }
        finally {
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

                adapterSelector.release( adapter );
            }
            this.manager.release( adapterSelector );
        }
       
        ProfileManager profileManager = null;
        try {
            profileManager = (ProfileManager)this.manager.lookup(ProfileManager.ROLE);
            profileManager.register(instance);
        } catch (ComponentException ce) {
            throw new ProcessingException("Unable to lookup profile manager.", ce);
        } finally {
            this.manager.release( profileManager );
        }
View Full Code Here

                    adapterSelector.release( adapter );
                }
                this.manager.release( adapterSelector );
            }
           
            ProfileManager profileManager = null;
            try {
                profileManager = (ProfileManager)this.manager.lookup(ProfileManager.ROLE);
                profileManager.unregister(copletInstanceData);
            } catch (ComponentException ce) {
                throw new ProcessingException("Unable to lookup profile manager.", ce);
            } finally {
                this.manager.release( profileManager );
            }
View Full Code Here

     */
    public static final String PORTAL_NAME_PARAM = "portalName";

    protected CopletInstanceData getCopletInstanceData()
    throws SAXException {
        ProfileManager profileManager = null;
        try {
            profileManager = (ProfileManager)this.manager.lookup(ProfileManager.ROLE);

            // determine coplet id
            String copletId = null;           
            Map context = (Map)objectModel.get(ObjectModelHelper.PARENT_CONTEXT);
            if (context != null) {
                copletId = (String)context.get(Constants.COPLET_ID_KEY);
            } else {
                try {
                    copletId = this.parameters.getParameter(COPLET_ID_PARAM);
                       
                    // set portal name
                    PortalService portalService = null;
                    try {
                        portalService = (PortalService)this.manager.lookup(PortalService.ROLE);
                        portalService.setPortalName(this.parameters.getParameter(PORTAL_NAME_PARAM));
                    } finally {
                        this.manager.release(portalService);
                    }
                } catch (ParameterException e) {
                    throw new SAXException("copletId and portalName must be passed as parameter or in the object model within the parent context.");
                }
            }
            if (copletId == null) {
                throw new SAXException("copletId must be passed as parameter or in the object model within the parent context.");
            }


            CopletInstanceData object = profileManager.getCopletInstanceData( copletId );
               
            if (object == null) {
                throw new SAXException("Could not find coplet instance data for " + copletId);
            }
               
View Full Code Here

                        String uri = null;
                        if (index != (value.length() - 1)) {
                            uri = value.substring(index + 1);
                        }
                       
                        ProfileManager profileManager = null;
                        try {
                            profileManager = (ProfileManager)this.manager.lookup(ProfileManager.ROLE);
                            Layout layout = profileManager.getPortalLayout( id );
                            if ( layout != null ) {
                                e = new ChangeAspectDataEvent(layout, "frame", uri);
                                publisher.publish(e);
                            }
                        } catch (ComponentException ignore) {
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.