Package org.apache.cocoon.portal.layout

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


        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() ) {
            synchronized (this) {
                id = layoutName + '-' + idCounter;
                idCounter += 1;
            }
        }
        layout.initialize( layoutName, id );
        layout.setDescription( layoutDescription );
        layout.setAspectDataHandler((AspectDataHandler)o[1]);

        if ( layout instanceof CompositeLayout ) {
            CompositeLayout composite = (CompositeLayout)layout;
            composite.setItemClassName(layoutDescription.getItemClassName());
        }
View Full Code Here


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

       
        CopletInstanceData cid = ((CopletLayout)layout).getCopletInstanceData();

        Boolean supportsFullScreen = (Boolean)cid.getCopletData().getAspectData("full-screen");
        if ( supportsFullScreen == null || supportsFullScreen.equals(Boolean.TRUE) ) {
            final Layout fullScreenLayout = service.getEntryLayout(null);
            if ( fullScreenLayout != null && fullScreenLayout.equals( layout )) {
                FullScreenCopletEvent event = new FullScreenCopletEvent( cid, null );
                XMLUtils.createElement(handler, "maximize-uri", service.getComponentManager().getLinkService().getLinkURI(event));
            } else {
                FullScreenCopletEvent event = new FullScreenCopletEvent( cid, layout );
                XMLUtils.createElement(handler, "fullscreen-uri", service.getComponentManager().getLinkService().getLinkURI(event));
View Full Code Here

public class LayoutMapping extends Mapping {
    public String layoutId;
    public String path;
   
    public Event getEvent(PortalService service, Object data) {
        Layout layout = service.getComponentManager().getProfileManager().getPortalLayout(null, this.layoutId);
        Event e = new JXPathEvent(layout, this.path, data);
        return e;
    }
View Full Code Here

    public String layoutId;
   
    public Event getEvent(PortalService service, Object data) {
        final ProfileManager manager = service.getComponentManager().getProfileManager();
        final CopletInstanceData cid = manager.getCopletInstanceData(this.copletId);
        final Layout layout = manager.getPortalLayout(null, layoutId) ;
       
        Event e = new FullScreenCopletEvent(cid, layout);
        return e;
    }
View Full Code Here

     *
     * @param service
     * @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;
                }
            }
        }
        Layout nextLayout = service.getEntryLayout(null);
        if (nextLayout == null) {
            nextLayout = tab.getLayout();
        }
        return nextLayout;
    }
View Full Code Here

    /**
     * @see Receiver
     */
    public void inform(FullScreenCopletEvent event, PortalService service) {
        final Layout startingLayout = (CopletLayout)event.getLayout();
        PortalService portalService = null;
        try {
            portalService = (PortalService) this.manager.lookup(PortalService.ROLE);
            final Layout old = portalService.getEntryLayout(null);
            if ( old != null && old instanceof CopletLayout) {
                ((CopletLayout)old).getCopletInstanceData().setAspectData("fullScreen", Boolean.FALSE);
            }
            portalService.setEntryLayout( null, startingLayout );
            if ( startingLayout != null && startingLayout instanceof CopletLayout) {
View Full Code Here

     * This method gets the layout object from the first two
     * values and invokes {@link #publish(EventManager, Layout, String[])}.
     * @param values The values contained in the request
     */
    protected void publish( PortalService service, EventManager publisher, String[] values) {
        Layout layout = service.getComponentManager().getProfileManager().getPortalLayout(values[0], values[1] );
        if ( layout != null ) {
            this.publish( publisher, layout, values);
        }
    }
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 = (CopletLayout)e.getLayout();
        PortalService portalService = null;
        try {
            portalService = (PortalService) this.manager.lookup(PortalService.ROLE);
            final Layout old = portalService.getEntryLayout(null);
            if ( old != null && old instanceof CopletLayout) {
                ((CopletLayout)old).getCopletInstanceData().setAspectData("fullScreen", Boolean.FALSE);
            }
            portalService.setEntryLayout( null, startingLayout );
            if ( startingLayout != null && startingLayout instanceof CopletLayout) {
View Full Code Here

    throws SAXException {
        PortalService service = null;
        try {
            service = (PortalService)this.manager.lookup(PortalService.ROLE);
            // first check for a full screen layout
            Layout portalLayout = service.getEntryLayout(null);
            if ( portalLayout == null ) {
                portalLayout = service.getComponentManager().getProfileManager().getPortalLayout(null, null);
            }

            Renderer portalLayoutRenderer = service.getComponentManager().getRenderer( portalLayout.getRendererName());      

            contentHandler.startDocument();
            portalLayoutRenderer.toSAX(portalLayout, service, contentHandler);
            contentHandler.endDocument();
        } catch (ServiceException ce) {
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.