Package org.apache.cocoon.portal.layout

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


    /**
     * @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


    /**
     * @see Receiver
     */
    public void inform(FullScreenCopletEvent event, PortalService service) {
        final Layout startingLayout = 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

            if (portletMode != null) {
                windowSession.setMode(portletMode);
            }
            if (windowState != null) {
                if ( !windowState.equals(windowSession.getWindowState()) ) {
                    final Layout layout = (Layout)coplet.getTemporaryAttribute(ATTRIBUTE_NAME_LAYOUT);
                    final Layout fullScreenLayout = service.getEntryLayout(null);
                    if ( fullScreenLayout != null
                         && fullScreenLayout.equals( layout )
                         && !windowState.equals(WindowStates._maximized) ) {
                        FullScreenCopletEvent e = new FullScreenCopletEvent( coplet, null );
                        service.getComponentManager().getEventManager().send(e);
                    }
                    if ( windowState.equals(WindowStates._minimized) ) {
View Full Code Here

            String skinName = null;
            // get the current skin
            // the skin is stored as a parameter on the root layout
            // if not, the global module is used
            // fallback is: common
            final Layout rootLayout = portalService.getComponentManager().getProfileManager().getPortalLayout(null, null);
            if ( rootLayout != null ) {
                skinName = (String)rootLayout.getParameters().get("skin");
            }
            // use the global module
            if ( skinName == null ) {
                skinName = (String)this.globalModule.getAttribute("skin", modeConf, objectModel);
                if ( skinName == null ) {
View Full Code Here

     * @see org.apache.cocoon.portal.PortalManagerAspect#render(org.apache.cocoon.portal.PortalManagerAspectRenderContext, org.apache.cocoon.portal.PortalService, org.xml.sax.ContentHandler, org.apache.avalon.framework.parameters.Parameters)
     */
    public void render(PortalManagerAspectRenderContext context, PortalService service, ContentHandler ch, Parameters parameters) throws SAXException {
        // first check for a full screen layout

        Layout portalLayout = null;
        Boolean renderable = (service.getEntryLayout(null) == null) ?
                Boolean.TRUE : Boolean.FALSE;
        if (!this.fullScreenNav) {
            // If fullscreen mode - otherwise the aspects will deal with the layout
            portalLayout = service.getEntryLayout(null);
            renderable = Boolean.TRUE;
        }
        if ( portalLayout == null ) {
            portalLayout = service.getComponentManager().getProfileManager().getPortalLayout(null, null);
        }
        service.setRenderable(renderable);

        Renderer portalLayoutRenderer = this.portalService.getComponentManager().getRenderer( portalLayout.getRendererName());      

        ch.startDocument();
        portalLayoutRenderer.toSAX(portalLayout, this.portalService, ch);
        ch.endDocument();
        service.setRenderable(null);
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

            int valid = SourceValidity.INVALID;
            SourceValidity sourceValidity = null;
            if (objects != null) {
                sourceValidity = (SourceValidity) objects[1];
                valid = sourceValidity.isValid();
                Layout layout = null;
                if (valid == SourceValidity.VALID)
                    layout = (Layout) ((Map) objects[0]).get(layoutID);
                if (layout != null)
                    return layout;
            }

            CopletInstanceDataManager copletInstanceDataManager = getCopletInstanceDataManager(service);

            Map parameters = new HashMap();
            parameters.put("profiletype", "layout");
            parameters.put("objectmap", copletInstanceDataManager.getCopletInstanceData());

            Map map = new LinkedMap();
            map.put("base", this.profilesPath);
            map.put("portalname", service.getPortalName());
            map.put("profile", "layout");
            map.put("groupKey", layoutKey);

            adapter = (ProfileLS) this.manager.lookup(ProfileLS.ROLE);
            SourceValidity newValidity = adapter.getValidity(map, parameters);
            if (valid == SourceValidity.UNKNOWN) {
                if (sourceValidity.isValid(newValidity) == SourceValidity.VALID) {
                    return (Layout) ((Map) objects[0]).get(layoutID);
                }
            }

            // get Layout specified in the map
            Layout layout = (Layout) adapter.loadProfile(map, parameters);
            Map layouts = new HashMap();

            layouts.put(null, layout); //save root with null as key
            cacheLayouts(layouts, layout);
View Full Code Here

        parameters.put(ProfileLS.PARAMETER_PROFILETYPE,
                       ProfileLS.PROFILETYPE_LAYOUT);       
        parameters.put(ProfileLS.PARAMETER_OBJECTMAP,
                       profile.getCopletInstanceDatas());
        try {
            Layout l = (Layout)loader.loadProfile(key, parameters);
            this.prepareObject(l, service);
            profile.setRootLayout(l);

            return true;
        } catch (Exception e) {
View Full Code Here

     * @return The page label map.
     */
    private Map initializeLabels(PortalService service) {
        Map map = new HashMap();

        Layout portalLayout = service.getEntryLayout(null);
        if (portalLayout == null) {
            portalLayout =
                service.getComponentManager().getProfileManager().getPortalLayout(null, null);
        }

View Full Code Here

            }
            label.append((tab instanceof NamedItem) ? ((NamedItem) tab).getName() :
                Integer.toString(j));
            List events = new ArrayList(parentEvents);
            events.add(event);
            Layout child = tab.getLayout();
            List allEvents = null;
            if (child != null && child instanceof CompositeLayout) {
                allEvents = populate((CompositeLayout) child, map, label.toString(), events);
            }
            if (this.nonStickyTabs) {
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.