Package org.apache.cocoon.portal

Examples of org.apache.cocoon.portal.PortalService


   
    public void toSAX(CopletInstanceData coplet, ContentHandler contentHandler)
    throws SAXException {
    String uri = (String)coplet.getCopletData().getAttribute("uri");
    Source copletSource = null;
    PortalService portalService = null;
    try {
      if (uri.startsWith("cocoon:")) {
        portalService = (PortalService)this.manager.lookup(PortalService.ROLE);
        HashMap par = new HashMap();
        par.put(Constants.PORTAL_NAME_KEY, portalService.getPortalName());
        par.put(Constants.COPLET_ID_KEY, coplet.getCopletId());
           
        copletSource = this.resolver.resolveURI(uri, null, par);
      } else {
        copletSource = this.resolver.resolveURI(uri);
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

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

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

                Parameter param = (Parameter) iter.next();
                attributes.addCDATAAttribute(param.getName(), param.getValue());
            }
            XMLUtils.startElement(handler, this.getTagName(context), attributes);

            PortalService portalService = null;
            try {
                portalService = (PortalService) this.manager.lookup(PortalService.ROLE);
                attributes = new AttributesImpl();
                CompositeLayout tabLayout = (CompositeLayout) layout;

                // selected tab
                Integer data = (Integer) layout.getAspectData("tab");
                int selected = data.intValue();
               
                // loop over all tabs
                for (int j = 0; j < tabLayout.getSize(); j++) {
                    NamedItem tab = (NamedItem) tabLayout.getItem(j);

                    // open named-item tag
                    attributes.clear();
                    attributes.addCDATAAttribute("name", String.valueOf(tab.getName()));
                    if (j == selected) {
                        attributes.addCDATAAttribute("selected", "true");
                    } else {
                        LayoutAspectDataEvent event = new LayoutAspectDataEvent(tabLayout, "tab", new Integer(j));
                        attributes.addCDATAAttribute("parameter", portalService.getLinkService().getLinkURI(event));
                    }
                    XMLUtils.startElement(handler, "named-item", attributes);
                    if (j == selected) {
                        this.processLayout(tab.getLayout(), service, handler);
                    }
View Full Code Here

   
    /* (non-Javadoc)
     * @see org.apache.cocoon.portal.profile.ProfileManager#storeProfile(org.apache.cocoon.portal.layout.Layout, java.lang.String)
     */
    public void storeProfile(Layout rootLayout, String layoutKey) {
        PortalService service = null;
       
        try {
            service = (PortalService) this.manager.lookup(PortalService.ROLE);
            if ( null == layoutKey ) {
                layoutKey = service.getDefaultLayoutKey();
            }

            final String layoutAttributeKey = "Layout:" + layoutKey;
           
            service.setAttribute(layoutAttributeKey, rootLayout);
        } catch (Exception ce) {
            throw new CascadingRuntimeException("Exception during loading of profile.", ce);
        } finally {
            this.manager.release(service);
        }
View Full Code Here

        this.provider = null;
        this.manager = null;
    }
   
    protected UserProfile getUserProfile(String layoutKey) {
        PortalService service = null;
        try {
            service = (PortalService)this.manager.lookup(PortalService.ROLE);
            if ( layoutKey == null ) {
                layoutKey = service.getDefaultLayoutKey();
            }

            return (UserProfile)service.getAttribute(KEY_PREFIX + layoutKey);
        } catch (ServiceException e) {
            // this should never happen
            throw new CascadingRuntimeException("Unable to lookup portal service.", e);
        } finally {
            this.manager.release(service);
View Full Code Here

        }
    }
   
    protected void removeUserProfiles() {
        // TODO: remove all profiles - we have to rememember all used layout keys
        PortalService service = null;
        try {
            service = (PortalService)this.manager.lookup(PortalService.ROLE);
            final String layoutKey = service.getDefaultLayoutKey();

            service.removeAttribute(KEY_PREFIX + layoutKey);
        } catch (ServiceException e) {
            // this should never happen
            throw new CascadingRuntimeException("Unable to lookup portal service.", e);
        } finally {
            this.manager.release(service);
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.cocoon.portal.profile.ProfileManager#getPortalLayout(java.lang.String, java.lang.String)
     */
    public Layout getPortalLayout(String layoutKey, String layoutId) {
        PortalService service = null;

        try {
            service = (PortalService) this.manager.lookup(PortalService.ROLE);
            if ( null == layoutKey ) {
                layoutKey = service.getDefaultLayoutKey();
            }
           
            UserProfile profile = this.getUserProfile(layoutKey);
            if ( profile == null ) {
                profile = this.loadProfile(layoutKey, service);
View Full Code Here

   
    /* (non-Javadoc)
     * @see org.apache.cocoon.portal.profile.ProfileManager#storeProfile(org.apache.cocoon.portal.layout.Layout, java.lang.String)
     */
    public void storeProfile(Layout rootLayout, String layoutKey) {
        PortalService service = null;

        try {
            UserProfile oldProfile = this.getUserProfile(null);
            service = (PortalService) this.manager.lookup(PortalService.ROLE);
            if ( null == layoutKey ) {
                layoutKey = service.getDefaultLayoutKey();
            }
            // FIXME for now we just copy the root profile, except the root layout
            UserProfile newProfile = new UserProfile();
            newProfile.setCopletBaseDatas(oldProfile.getCopletBaseDatas());
            newProfile.setCopletDatas(oldProfile.getCopletDatas());
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.