Package org.apache.cocoon.portal.profile

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


        } finally {
            this.manager.release(service);
        }

        // login
        ProfileManager profileManager = null;
        try {
            profileManager = (ProfileManager) this.manager.lookup(ProfileManager.ROLE);
            profileManager.login();
        } finally {
            this.manager.release( (Component)profileManager );
        }

        if (this.getLogger().isDebugEnabled() ) {
View Full Code Here


        } finally {
            this.manager.release(service);
        }

        // logout
        ProfileManager profileManager = null;
        try {
            profileManager = (ProfileManager) this.manager.lookup(ProfileManager.ROLE);
            profileManager.logout();
        } finally {
            this.manager.release( (Component)profileManager );
        }

        if (this.getLogger().isDebugEnabled() ) {
View Full Code Here

        }
        layout.initialize( layoutName, id );
        layout.setDescription( layoutDescription );
        layout.setAspectDataHandler((AspectDataHandler)o[1]);

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

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

    /**
     * Overridden from superclass.
     */
  public Object getAttribute(String name, Configuration modeConf, Map objectModel)
    throws ConfigurationException {
        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 {
                copletId = (String)objectModel.get(Constants.COPLET_ID_KEY);
               
                // set portal name
                PortalService portalService = null;
                try {
                    portalService = (PortalService)this.manager.lookup(PortalService.ROLE);
                    portalService.setPortalName((String)objectModel.get(Constants.PORTAL_NAME_KEY));
                } finally {
                    this.manager.release(portalService);
                }
            }
           
            if (copletId == null) {
                throw new ConfigurationException("copletId must be passed in the object model either directly (e.g. by using ObjectModelAction) or within the parent context.");
            }
           
            JXPathContext jxpathContext = JXPathContext.newContext(profileManager.getCopletInstanceData(copletId));
            Object value = jxpathContext.getValue(name);
               
            if (value == null) {
                throw new ConfigurationException("Could not find value for expression "+name);
            }
View Full Code Here

        int position = location.indexOf(':') + 1;
        if (position != 0) {
            protocol = location.substring(0, position);
            location = location.substring(position+2);
        }
        ProfileManager profileManager = null;
        CopletInstanceData coplet = null;
        try {
            profileManager = (ProfileManager)this.manager.lookup(ProfileManager.ROLE);
            coplet = profileManager.getCopletInstanceData(location);
            CopletSource copletSource =
                new CopletSource(uri, protocol,
                                 coplet);
            copletSource.compose(this.manager);
            return copletSource;
View Full Code Here

  public void showPortal(ContentHandler contentHandler, Parameters parameters)
    throws SAXException {
//        final boolean useContentDeliverer = (parameters == null ? true :
//                                               parameters.getParameterAsBoolean("use-content-deliverer", true));
       
        ProfileManager profileManager = null;
        ComponentSelector rendererSelector = null;
        Renderer portalLayoutRenderer = null;
        PortalService service = null;
        try {
            service = (PortalService)this.componentManager.lookup(PortalService.ROLE);
            profileManager = (ProfileManager)this.componentManager.lookup(ProfileManager.ROLE);
            Layout portalLayout = profileManager.getPortalLayout(null);

            rendererSelector = (ComponentSelector)this.componentManager.lookup(Renderer.ROLE+"Selector");
            portalLayoutRenderer = (Renderer)rendererSelector.select(portalLayout.getRendererName());      

            contentHandler.startDocument();
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

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

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

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.