Package org.apache.cocoon.portal.layout

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


         if(obj instanceof Item) {
           Item item = (Item) obj;
           item.setLayout(lay);
           lay.setParent(item);
         } else if(obj instanceof CompositeLayout) {
           CompositeLayout cl = (CompositeLayout) obj;
           Item item = new Item();
           item.setLayout(lay);
           lay.setParent(item);
           cl.addItem(item);
         }
        
      } catch (ProcessingException e) {}
    }
    return copletDatas;
View Full Code Here


        if (event instanceof ChangeAspectDataEvent &&
            ((ChangeAspectDataEvent) event).getTarget() instanceof CompositeLayout) {

            ChangeAspectDataEvent e = (ChangeAspectDataEvent)event;
            CompositeLayout layout = (CompositeLayout)e.getTarget();
            int i = ((Integer)e.getData()).intValue();

            Item item = layout.getItem(i);
            if (item instanceof NamedItem) {
                StringBuffer key = new StringBuffer("");
                getKey(item, key);

                if (this.labelManager.getPageLabelEvents(key.toString()) != null) {
View Full Code Here

            if (event instanceof ChangeAspectDataEvent &&
                ((ChangeAspectDataEvent) event).getTarget() instanceof CompositeLayout) {

                ChangeAspectDataEvent e = (ChangeAspectDataEvent) event;
                CompositeLayout layout = (CompositeLayout) e.getTarget();
                int i = ((Integer) e.getData()).intValue();

                Item item = layout.getItem(i);
                if (value.length() > 0) {
                    value.append('.');
                }
                if (item instanceof NamedItem) {
                    value.append(((NamedItem)item).getName());
View Full Code Here

     * Generates the page label.
     * @param item An Item.
     * @param key The StringBuffer in which to create the page label.
     */
    private void getKey(Item item, StringBuffer key) {
        CompositeLayout parentLayout = item.getParent();
        Item parentItem = parentLayout.getParent();

        if (parentItem != null) {
            getKey(parentItem, key);
        }

        if (key.length() > 0) {
            key.append('.');
        }
        if (item instanceof NamedItem) {
            key.append(((NamedItem) item).getName());
        }
        else {
            key.append(parentLayout.getItems().indexOf(item));
        }
    }
View Full Code Here

            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);
        } catch (Exception e) {
View Full Code Here

            layout.setDescription( layoutDescription );
            layout.setAspectDataHandler((AspectDataHandler)o[1]);

            // recursive
            if ( layout instanceof CompositeLayout ) {
                CompositeLayout composite = (CompositeLayout)layout;
                composite.setItemClassName(layoutDescription.getItemClassName());
               
                Iterator items = composite.getItems().iterator();
                while ( items.hasNext() ) {
                    this.prepareLayout( ((Item)items.next()).getLayout() );
                }
            }
        }
View Full Code Here

        layout.initialize( layoutName, id );
        layout.setDescription( layoutDescription );
        layout.setAspectDataHandler((AspectDataHandler)o[1]);

        if ( layout instanceof CompositeLayout ) {
            CompositeLayout composite = (CompositeLayout)layout;
            composite.setItemClassName(layoutDescription.getItemClassName());
        }
       
        PortalService service = null;
        try {
            service = (PortalService)this.manager.lookup(PortalService.ROLE);
View Full Code Here

    public void remove(Layout layout)
    throws ProcessingException {
        if ( layout != null ) {
            this.init();
            if ( layout instanceof CompositeLayout ) {
                final CompositeLayout cl = (CompositeLayout)layout;
                while ( cl.getItems().size() > 0 ) {
                    final Item i = cl.getItem(0);
                    this.remove( i.getLayout() );
                }
            }
            Item parent = layout.getParent();
            if ( parent != null && parent.getParent() != null) {
View Full Code Here

            if ( config.rootTag ) {
                XMLUtils.startElement(handler, config.tagName);
            }

            AttributesImpl attributes = new AttributesImpl();
            CompositeLayout tabLayout = (CompositeLayout) layout;

            // selected tab
            Integer data = (Integer) layout.getAspectData(config.aspectName);
            int selected = data.intValue();
           
            // loop over all tabs
            for (int j = 0; j < tabLayout.getSize(); j++) {
                Item tab = tabLayout.getItem(j);
                ChangeAspectDataEvent event = null;

                // open named-item tag
                attributes.clear();
                if ( tab instanceof NamedItem ) {
View Full Code Here

                            PortalService service,
                            ContentHandler handler,
                            List parentEvents)
        throws SAXException {
        if (layout instanceof CompositeLayout) {
            CompositeLayout tabLayout = (CompositeLayout)layout;

            if (tabLayout.getSize() == 0) {
                return;
            }
            TabPreparedConfiguration config =
                (TabPreparedConfiguration) context.getAspectConfiguration();
            AttributesImpl attributes = new AttributesImpl();
            boolean subNav = false;

            // loop over all tabs
            for (int j = 0; j < tabLayout.getSize(); j++) {
                Item tab = tabLayout.getItem(j);

                // open named-item tag
                attributes.clear();
                if (tab instanceof NamedItem) {
                    if (!subNav && !config.childTagName.equals("")) {
View Full Code Here

TOP

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

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.