Package org.apache.cocoon.portal.profile

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


   
    /**
     * Get the layout status
     */
    protected AspectStatus getLayoutStatus(Layout layout) {
        ProfileManager profileManager = null;
        try {
            profileManager = (ProfileManager) this.componentManager.lookup(ProfileManager.ROLE);
            return profileManager.getAspectStatus(null, null, layout.getId());
        } catch (ComponentException ce) {
            // ignore
        } finally {
            this.componentManager.release(profileManager);
        }
View Full Code Here


public class DefaultLinkRenderer extends AbstractRenderer {

    public void process(Layout layout, PortalService service, ContentHandler handler)
    throws SAXException {
        if (layout instanceof LinkLayout) {
            ProfileManager profileManager = null;
            try {
                profileManager = (ProfileManager)this.componentManager.lookup(ProfileManager.ROLE);
                final String layoutId = ((LinkLayout)layout).getLayoutId();
                this.processLayout(profileManager.getPortalLayout(layoutId), service, handler);
            } catch (ComponentException ce) {
                throw new SAXException("Unable to lookup profile manager.", ce);
            } finally {
                this.componentManager.release(profileManager);
            }
View Full Code Here

        // remove the protocol
        int position = location.indexOf(':') + 1;
        if (position != 0) {
            location = location.substring(position+2);
        }
        ProfileManager profileManager = null;
        CopletInstanceData coplet = null;
        try {
            profileManager = (ProfileManager)this.componentManager.lookup(ProfileManager.ROLE);
            coplet = profileManager.getCopletInstanceData(location);
            CopletSource copletSource =
                new CopletSource(coplet.getCopletData().getCopletBaseData().getCopletAdapterName(),
                                 coplet);
            copletSource.compose(this.componentManager);
            return copletSource;
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

            String expression = attr.getValue(SELECT_ATTR);
            if (expression == null) {
                throw new ProcessingException("Attribute "+SELECT_ATTR+" must be spcified.");
            }
               
            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);
                    if (copletId == null) {
                        throw new ProcessingException("copletId must be passed as parameter or in the object model within the parent context.");
                    }
                } 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 ProcessingException("copletId and portalName must be passed as parameter or in the object model within the parent context.");
          }
                }

                JXPathContext jxpathContext = JXPathContext.newContext(profileManager.getCopletInstanceData(copletId));
                Object object = jxpathContext.getValue(expression);
               
                if (object == null) {
                    throw new ProcessingException("Could not find value for expression "+expression);
                }
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

     */
    public void inform(Event event) {
        FullScreenCopletEvent e = (FullScreenCopletEvent) event;
        final Layout startingLayout = e.getLayout();
        if ( null != startingLayout ) {
            ProfileManager profileManager = null;
            try {
                profileManager = (ProfileManager) this.manager.lookup(ProfileManager.ROLE);
                profileManager.setDefaultLayout( startingLayout );
            } catch (ComponentException ce) {
                // ignore
            } finally {
                this.manager.release(profileManager);
            }
View Full Code Here

     * @see org.apache.cocoon.portal.event.Subscriber#inform(org.apache.cocoon.portal.event.Event)
     */
    public void inform(Event event) {
        SizingStatusEvent statusEvent = (SizingStatusEvent) event;
        SizingStatus target = statusEvent.getStatus();
        ProfileManager profileManager = null;
        try {
            profileManager = (ProfileManager) this.componentManager.lookup(ProfileManager.ROLE);
            target = new SizingStatus();
            profileManager.setAspectStatus(ProfileManager.SESSION_STATUS,
                                           statusEvent.getCopletInstanceData().getCopletId(),
                                           target);
        } catch (ComponentException ce) {
            // ignore
        } finally {
View Full Code Here

     * @see org.apache.cocoon.portal.event.Subscriber#inform(org.apache.cocoon.portal.event.Event)
     */
    public void inform(Event event) {
        FrameSourceEvent statusEvent = (FrameSourceEvent) event;
        final String layoutID = statusEvent.getLayoutId();
        ProfileManager profileManager = null;
        try {
            profileManager = (ProfileManager) this.manager.lookup(ProfileManager.ROLE);
            FrameStatus status =
                (FrameStatus) profileManager.getAspectStatus(
                    FrameStatus.class,
                    ProfileManager.REQUEST_STATUS,
                    layoutID);
            String link = statusEvent.getLink();
            if (status == null) {
                if (link != null) {
                    status = new FrameStatus();
                    status.setLink(link);
                    profileManager.setAspectStatus(ProfileManager.REQUEST_STATUS, layoutID, status);
                }
            } else if (link != null) {
                status.setLink(link);
            } else {
                // remove status if link == null
                profileManager.setAspectStatus(ProfileManager.REQUEST_STATUS, layoutID, null);
            }
        } catch (ComponentException ce) {
            // ignore
        } finally {
            this.manager.release(profileManager);
View Full Code Here

    /**
     * Get the layout status
     */
    protected AspectStatus getStatus(Class type, String mode, String key) {
        ProfileManager profileManager = null;
        try {
            profileManager = (ProfileManager) this.manager.lookup(ProfileManager.ROLE);
            return profileManager.getAspectStatus(type, mode, key);
        } catch (ComponentException ce) {
            // ignore
        } finally {
            this.manager.release(profileManager);
        }
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.