Package org.apache.cocoon.portal.profile

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


        ComponentManager 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 (ComponentException e) {
            throw new ProcessingException("Error getting profile manager.", e);
        }
        finally {
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

        ComponentManager 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 (ComponentException 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);
        }
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

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.