Package org.apache.cocoon.portal

Examples of org.apache.cocoon.portal.PortalService


            Item parent = layout.getParent();
            if ( parent != null && parent.getParent() != null) {
                parent.getParent().removeItem( parent );
            }
           
            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);
View Full Code Here


            }
            this.configuration = null;
        }
        DefaultEventAspectContext context = new DefaultEventAspectContext(this.chain);
        EventConverter converter = null;
        PortalService service = null;
        try {
            service = (PortalService)this.manager.lookup(PortalService.ROLE);
            converter = (EventConverter) this.manager.lookup(EventConverter.ROLE);
            Publisher publisher = this.getPublisher();
View Full Code Here

        int position = location.indexOf(':') + 1;
        if (position != 0) {
            protocol = location.substring(0, position);
            location = location.substring(position+2);
        }
        PortalService service = null;
        try {
            service = (PortalService)this.manager.lookup(PortalService.ROLE);
            CopletInstanceData coplet = service.getComponentManager().getProfileManager().getCopletInstanceData(location);
            if ( coplet == null ) {
                throw new IOException("Unable to get coplet for " + location);
            }
            CopletSource copletSource =
                new CopletSource(uri, protocol,
View Full Code Here

    /**
     * @see org.apache.cocoon.portal.profile.ProfileManager#getPortalLayout(Object)
     */
    public Layout getPortalLayout(String key) {
        PortalService service = null;
        LayoutFactory factory = null;
       
        try {
            service = (PortalService) this.manager.lookup(PortalService.ROLE);
            factory = (LayoutFactory) this.manager.lookup(LayoutFactory.ROLE);
           
            if ( null == key ) {
                Layout l = (Layout) service.getTemporaryAttribute("DEFAULT_LAYOUT");
                if ( null != l) {
                    return l;
                }
            }
           
            String portalPrefix = "/"+service.getPortalName();

      // TODO Change to KeyManager usage
      UserHandler handler = RequestState.getState().getHandler();
      HashMap map = new HashMap();
      map.put("portalname", service.getPortalName());
      map.put("user", handler.getUserId());
      map.put("role", handler.getContext().getContextInfo().get("role"));

      // load coplet base data
      map.put("profile", "copletbasedata");
View Full Code Here

    return new Object[]{Boolean.FALSE, newValidity};
  }
 
    public CopletInstanceData getCopletInstanceData(String copletID) {
        PortalService service = null;
        String attribute = null;
        try {
            service = (PortalService) this.manager.lookup(PortalService.ROLE);

      // TODO Change to KeyManager usage
      UserHandler handler = RequestState.getState().getHandler();
      attribute = SimpleProfileManager.class.getName()+"/"+service.getPortalName()+"/CopletInstanceData-user-"+handler.getUserId();

/*       TODO Must be changed for dynamic coplet creation.          
       if (null == coplets) {
                coplets = new HashMap();
                service.setAttribute(attribute, coplets);
            }*/
      CopletInstanceDataManager copletInstanceDataManager = (CopletInstanceDataManager)((Object[])service.getAttribute(attribute))[0];

            CopletInstanceData cid = copletInstanceDataManager.getCopletInstanceData(copletID);
            if (null == cid) {
/*         TODO Must be changed for dynamic coplet creation.

View Full Code Here

            this.manager.release(service);
        }
    }

    public void setDefaultLayout(Layout object) {
        PortalService service = null;
        try {
            service = (PortalService) this.manager.lookup(PortalService.ROLE);
            service.setTemporaryAttribute("DEFAULT_LAYOUT", object);
        } catch (ComponentException e) {
            throw new CascadingRuntimeException("Unable to lookup service manager.", e);
        } finally {
            this.manager.release(service);
        }
View Full Code Here

  /* (non-Javadoc)
   * @see org.apache.cocoon.portal.profile.ProfileManager#getLayoutStatus(java.lang.String)
   */
  public AspectStatus getAspectStatus(Class type, String mode, String key) {
        if ( ProfileManager.REQUEST_STATUS.equals( mode )) {
            PortalService service = null;
            try {
                service = (PortalService) this.manager.lookup(PortalService.ROLE);
                return (AspectStatus)service.getTemporaryAttribute(type.getName()+"."+key);
            } catch (ComponentException ce) {
                // ignore
                return null;
            } finally {
                this.manager.release( service );
View Full Code Here

  /* (non-Javadoc)
   * @see org.apache.cocoon.portal.profile.ProfileManager#setLayoutStatus(java.lang.String, org.apache.cocoon.portal.layout.LayoutStatus)
   */
  public void setAspectStatus( String mode, String key, AspectStatus status) {
        if ( ProfileManager.REQUEST_STATUS.equals( mode )) {
            PortalService service = null;
            try {
                service = (PortalService) this.manager.lookup(PortalService.ROLE);
                final String attribute = status.getClass().getName() + "." + key;
                if (null == status) {
                    service.removeTemporaryAttribute(attribute);
                } else {
                    service.setTemporaryAttribute(attribute, status);
                }
            } catch (ComponentException ce) {
                // ignore
            } finally {
                this.manager.release( service );
View Full Code Here

                       String src,
                       Parameters par)
    throws ProcessingException, SAXException, IOException {
        super.setup(resolver, objectModel, src, par);
       
        PortalService service = null;
        try {
            service = (PortalService)this.manager.lookup(PortalService.ROLE);
            service.setPortalName(par.getParameter("portal-name"));
        } catch (ParameterException pe) {
            throw new ProcessingException("Parameter portal-name is required.");
        } catch (ComponentException ce) {
            throw new ProcessingException("Unable to lookup portal service.", ce);
        } finally {
View Full Code Here

                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);
                }
            }
           
View Full Code Here

TOP

Related Classes of org.apache.cocoon.portal.PortalService

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.