Package org.apache.cocoon.portal.layout

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


        if ( layout != null ) {
            if ( layout.getId() != null ) {
                layoutMap.put( layout.getId(), layout );
            }
            if ( layout instanceof CompositeLayout ) {
                CompositeLayout cl = (CompositeLayout)layout;
                Iterator i = cl.getItems().iterator();
                while ( i.hasNext() ) {
                    Item current = (Item)i.next();
                    this.cacheLayouts( layoutMap, current.getLayout() );
                }
            }
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

        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) {
                    if(value.length()>0) {
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

            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

     * @param tab
     */
    private Layout getNextLayout(PortalService service, Item tab) {
        Layout tabLayout = tab.getLayout();
        if (tabLayout instanceof CompositeLayout) {
            CompositeLayout layout = (CompositeLayout)tabLayout;
            List list = layout.getItems();
            int size = list.size();
            for (int i = 0; i < size; i++) {
                if (list.get(i) instanceof NamedItem) {
                    return tabLayout;
                }
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.