Package org.apache.cocoon.portal.layout

Examples of org.apache.cocoon.portal.layout.LayoutFactory


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


        PortalService service = null;
        ServiceSelector adapterSelector = null;
       
        try {
            service = (PortalService) this.manager.lookup(PortalService.ROLE);
            LayoutFactory factory = service.getComponentManager().getLayoutFactory();
            CopletFactory copletFactory = service.getComponentManager().getCopletFactory();
           
            adapterSelector = (ServiceSelector)this.manager.lookup(CopletAdapter.ROLE+"Selector");
           
            if ( null == layoutKey ) {
View Full Code Here

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

            Map layouts = new HashMap();

            layouts.put(null, layout); //save root with null as key
            cacheLayouts(layouts, layout);

            LayoutFactory factory = service.getComponentManager().getLayoutFactory();
            factory.prepareLayout(layout);

            // store the new values in the service
            if (newValidity != null) {
                objects = new Object[] { layouts, newValidity };
                service.setAttribute(serviceKey, objects);
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");
      map.put("objectmap", null);
      Object[] result = this.getProfile(map, portalPrefix+"/CopletBaseData", service);
      if (result[0] == null) {
        throw new SourceNotFoundException("Could not find coplet base data profile.");
      }
      CopletBaseDataManager copletBaseDataManager = (CopletBaseDataManager)result[0];
      boolean lastLoaded = ((Boolean)result[1]).booleanValue();

      // load coplet data
      map.put("profile", "copletdata");
      map.put("objectmap", copletBaseDataManager.getCopletBaseData());
      result = this.getDeltaProfile(map, portalPrefix+"/CopletData", service);
      if (result[0] == null) {
        throw new SourceNotFoundException("Could not find coplet data profile.");
      }
      CopletDataManager copletDataManager = (CopletDataManager)result[0];
      boolean loaded = ((Boolean)result[1]).booleanValue();
      if (lastLoaded && !loaded) {
        copletDataManager.update(copletBaseDataManager);
      }
      lastLoaded = loaded;

      // load coplet instance data
      map.put("profile", "copletinstancedata");
      map.put("objectmap", copletDataManager.getCopletData());
      result = this.getOrCreateProfile(map, portalPrefix+"/CopletInstanceData", service);
      CopletInstanceDataManager copletInstanceDataManager = (CopletInstanceDataManager)result[0];
      loaded = ((Boolean)result[1]).booleanValue();
      if (lastLoaded && !loaded) {
        copletInstanceDataManager.update(copletDataManager);
      }
      lastLoaded = loaded;

      // load layout
      map.put("profile", "layout");
      map.put("objectmap", ((CopletInstanceDataManager)result[0]).getCopletInstanceData());
      result = this.getOrCreateProfile(map, portalPrefix+"/Layout", service);
      Layout layout = (Layout)result[0];
      loaded = ((Boolean)result[1]).booleanValue();
      if (lastLoaded && !loaded) {
        resolveParents(layout, null, copletInstanceDataManager);
      } else {
        resolveParents(layout, null, null);
      }
            factory.prepareLayout( layout );
            
            return layout;
        } catch (Exception ce) {
            // TODO
            throw new CascadingRuntimeException("Arg", ce);
View Full Code Here

        PortalService service = null;
        ServiceSelector adapterSelector = null;
       
        try {
            service = (PortalService) this.manager.lookup(PortalService.ROLE);
            LayoutFactory factory = service.getComponentManager().getLayoutFactory();
            CopletFactory copletFactory = service.getComponentManager().getCopletFactory();
           
            adapterSelector = (ServiceSelector)this.manager.lookup(CopletAdapter.ROLE+"Selector");
           
            if ( null == layoutKey ) {
View Full Code Here

            Map layouts = new HashMap();

            layouts.put(null, layout); //save root with null as key
            cacheLayouts(layouts, layout);

            LayoutFactory factory = service.getComponentManager().getLayoutFactory();
            factory.prepareLayout(layout);

            // store the new values in the service
            if (newValidity != null) {
                objects = new Object[] { layouts, newValidity };
                service.setAttribute(serviceKey, objects);
View Full Code Here

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

        PortalService service = null;
        ServiceSelector adapterSelector = null;
       
        try {
            service = (PortalService) this.manager.lookup(PortalService.ROLE);
            LayoutFactory factory = service.getComponentManager().getLayoutFactory();
            CopletFactory copletFactory = service.getComponentManager().getCopletFactory();
           
            adapterSelector = (ServiceSelector)this.manager.lookup(CopletAdapter.ROLE+"Selector");
           
            if ( null == layoutKey ) {
View Full Code Here

            Map layouts = new HashMap();

            layouts.put(null, layout); //save root with null as key
            cacheLayouts(layouts, layout);

            LayoutFactory factory = service.getComponentManager().getLayoutFactory();
            factory.prepareLayout(layout);

            // store the new values in the service
            if (newValidity != null)
            {
                objects = new Object[] { layouts, newValidity };
View Full Code Here

TOP

Related Classes of org.apache.cocoon.portal.layout.LayoutFactory

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.