Package org.apache.cocoon.portal.layout

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


      adapter.saveProfile(key, parameters, profileManager);

      // save coplet instance data
      parameters.put("profiletype", "layout");
            key = this.buildKey(service, parameters, layoutKey, false);
      Layout layout = (Layout)service.getAttribute("Layout:" + layoutKey);
      adapter.saveProfile(key, parameters, layout);
           
    } catch (Exception e) {
      // TODO
      throw new CascadingRuntimeException("Exception during save profile", e);
View Full Code Here


        if ( o == null ) {
            throw new ProcessingException("LayoutDescription with name '" + layoutName + "' not found.");
        }
        DefaultLayoutDescription layoutDescription = (DefaultLayoutDescription)o[0];
       
        Layout layout = null;
        try {
            Class clazz = ClassUtils.loadClass( layoutDescription.getClassName() );
            layout = (Layout)clazz.newInstance();
           
        } catch (Exception e) {
            throw new ProcessingException("Unable to create new instance", e );
        }
       
        String id = null;
        if ( layoutDescription.createId() ) {
            // TODO - set unique id
            id = layoutName + '-' + System.currentTimeMillis();
        }
        layout.initialize( layoutName, id );
        layout.setDescription( layoutDescription );
        layout.setAspectDataHandler((AspectDataHandler)o[1]);

        PortalService service = null;
        try {
            service = (PortalService)this.manager.lookup(PortalService.ROLE);
            service.getComponentManager().getProfileManager().register(layout);
View Full Code Here

     */
    public void inform(Event e) {
        // event dispatching
        if ( e instanceof LayoutRemoveEvent ) {
            LayoutRemoveEvent event = (LayoutRemoveEvent)e;
            Layout layout = (Layout)event.getTarget();
            try {
                this.remove( layout );
            } catch (ProcessingException pe) {
                throw new CascadingRuntimeException("Exception during removal.", pe);
            }
View Full Code Here

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

    /* (non-Javadoc)
     * @see org.apache.cocoon.portal.event.Subscriber#inform(org.apache.cocoon.portal.event.Event)
     */
    public void inform(Event e) {
        final LayoutAspectDataEvent event = (LayoutAspectDataEvent)e;
        final Layout layout = event.getTarget();
        layout.setAspectData(event.getAspectName(), event.getData());
    }
View Full Code Here

     * @see org.apache.cocoon.portal.event.Subscriber#inform(org.apache.cocoon.portal.event.Event)
     */
    public void inform(Event event) {
        if (event instanceof LayoutRemoveEvent) {
            LayoutRemoveEvent removeEvent = (LayoutRemoveEvent)event;
            Layout layout = (Layout)removeEvent.getTarget();
            layout.getParent().getParent().removeItem(layout.getParent());
        }
    }
View Full Code Here

        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();
            portalLayoutRenderer.toSAX(portalLayout, service, contentHandler);
            contentHandler.endDocument();
        } catch (ComponentException ce) {
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.cocoon.portal.event.Subscriber#inform(org.apache.cocoon.portal.event.Event)
     */
    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 );
View Full Code Here

   */
  protected void processItem(Item item,
                             ContentHandler handler,
                             PortalService service)
    throws SAXException {
        Layout layout = item.getLayout();

        Map parameters = item.getParameters();
        if (parameters.size() == 0) {
            XMLUtils.startElement(handler, ITEM_STRING);
        } else {
View Full Code Here

     */
    public void inform(final Event e) {
        final MaximizeEvent event = (MaximizeEvent)e;
        // now we have to search the first parent that has static childs
        boolean found = false;
        Layout layout = event.getLayout();
        while (!found) {
            if ( layout.getParent() != null) {
                CompositeLayout parent = (CompositeLayout)layout.getParent().getLayout();
                Iterator iter = parent.getItems().iterator();
                while ( iter.hasNext() && !found) {
                    Layout current = ((Item)iter.next()).getLayout();
                    found = current.isStatic();
                }
                if ( !found ) layout = parent;
            } else {
                found = true;
            }
View Full Code Here

TOP

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

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.