Package org.apache.cocoon.portal.layout

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


            return true;
          }
        }
      } else if(lay.getParent() instanceof NamedItem) {
        // FIXME: Causes that only the contents inside a tab are deleted instead of the tab
          NamedItem par = (NamedItem) lay.getParent();
          par.setLayout(null);
      } else {
        lf.remove(lay);
      }
     
    } catch (ProcessingException e) {
View Full Code Here


     
      if (lay != null)
        ((CompositeLayout) lay).addItem(e);
      else
      {
        NamedItem ni = (NamedItem)layoutObj;
        nObj.setParent(ni);
        ni.setLayout(nObj);
      }
     
    } catch (ProcessingException e) {
      e.printStackTrace();
    }
View Full Code Here

      lay = (Layout) layoutObj;
   
    // add tab:
    if(lay != null && lay.getName().equals("tab")) {
     
      NamedItem tab = new NamedItem();
      tab.setName(name);
      ((CompositeLayout) lay).addItem(tab);
     
    } else {
     
      try {
       
        Layout tab = lf.newInstance("tab");
        pm.register(tab);
       
        NamedItem e = new NamedItem();
        e.setName(name);
       
        ((CompositeLayout) tab).addItem(e);
       
        if (lay == null) {
         
          ((NamedItem)layoutObj).setLayout(tab);
        }
        else {
          Item m = new Item();
          m.setParent((CompositeLayout) lay);
          ((CompositeLayout) lay).addItem(m);
          m.setLayout(tab);
        }
       
      } catch (ProcessingException e) {
        e.printStackTrace();
      }
    }
    }
View Full Code Here

            CopletInstanceData newCoplet = cfac.newInstance(copletData);

            copletLayout.setCopletInstanceData(newCoplet);
            profileManager.register(copletLayout);

            NamedItem newItem = new NamedItem();
            newItem.setLayout(copletLayout);

            CompositeLayout tabLayout =
                (CompositeLayout) profileManager.getPortalLayout(
                    "portalApplications", null);

            newItem.setName(getNewInstanceTabName(tabLayout));
            tabLayout.addItem(newItem);
        } catch (ServiceException ce) {
            throw new ProcessingException(
                "Unable to lookup profile manager.",
                ce);
View Full Code Here

            CopletInstanceData newCoplet = cfac.newInstance(copletData);

            copletLayout.setCopletInstanceData(newCoplet);
            profileManager.register(copletLayout);

            NamedItem newItem = new NamedItem();
            newItem.setLayout(copletLayout);

            CompositeLayout tabLayout =
                (CompositeLayout) profileManager.getPortalLayout(
                    "portalApplications", null);

            newItem.setName(getNewInstanceTabName(tabLayout));
            tabLayout.addItem(newItem);
        } catch (ServiceException ce) {
            throw new ProcessingException(
                "Unable to lookup profile manager.",
                ce);
View Full Code Here

                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);
                    }
                    // close named-item tag
                    XMLUtils.endElement(handler, "named-item");
                }
            } catch (ComponentException ce) {
View Full Code Here

            CopletInstanceData newCoplet = cfac.newInstance(copletData);

            copletLayout.setCopletInstanceData(newCoplet);
            profileManager.register(copletLayout);

            NamedItem newItem = new NamedItem();
            newItem.setLayout(copletLayout);

            CompositeLayout tabLayout =
                (CompositeLayout) profileManager.getPortalLayout(
                    "portalApplications", null);

            newItem.setName(getNewInstanceTabName(tabLayout));
            tabLayout.addItem(newItem);
        } catch (ServiceException ce) {
            throw new ProcessingException(
                "Unable to lookup profile manager.",
                ce);
View Full Code Here

            CopletInstanceData newCoplet = cfac.newInstance(copletData);

            copletLayout.setCopletInstanceData(newCoplet);
            profileManager.register(copletLayout);

            NamedItem newItem = new NamedItem();
            newItem.setLayout(copletLayout);

            CompositeLayout tabLayout =
                (CompositeLayout) profileManager.getPortalLayout(
                    "portalApplications", null);

            newItem.setName(getNewInstanceTabName(tabLayout));
            tabLayout.addItem(newItem);
        } catch (ServiceException ce) {
            throw new ProcessingException(
                "Unable to lookup profile manager.",
                ce);
View Full Code Here

                Integer data = (Integer) layout.getAspectData(config.aspectName);
                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 {
                        ChangeAspectDataEvent event = new ChangeAspectDataEvent(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);
                    }
                    // close named-item tag
                    XMLUtils.endElement(handler, "named-item");
                }
            } catch (ComponentException ce) {
View Full Code Here

                Integer data = (Integer) layout.getAspectData(config.aspectName);
                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 {
                        ChangeAspectDataEvent event = new ChangeAspectDataEvent(tabLayout, "tab", new Integer(j));
                        attributes.addCDATAAttribute("parameter", portalService.getComponentManager().getLinkService().getLinkURI(event));
                    }
                    XMLUtils.startElement(handler, "named-item", attributes);
                    if (j == selected) {
                        this.processLayout(tab.getLayout(), service, handler);
                    }
                    // close named-item tag
                    XMLUtils.endElement(handler, "named-item");
                }
            } catch (ComponentException ce) {
View Full Code Here

TOP

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

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.