Package org.apache.cocoon.portal.layout

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


//                                               parameters.getParameterAsBoolean("use-content-deliverer", true));
       
        PortalService service = null;
        try {
            service = (PortalService)this.manager.lookup(PortalService.ROLE);
            Layout 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


           
            if ( null == layoutKey ) {
                layoutKey = this.getDefaultLayoutKey();
            }
            // FIXME actually this is a hack for full screen
            Layout l = (Layout) service.getTemporaryAttribute("DEFAULT_LAYOUT:" + layoutKey);
            if ( null != l) {
                return l;
            }
           
            final String layoutAttributeKey = "Layout:" + layoutKey;
            final String layoutObjectsAttributeKey = "Layout-Map:" + layoutKey;
           
            Layout layout = (Layout)service.getAttribute(layoutAttributeKey);
            if (layout == null) {
                layout = this.loadProfile(layoutKey, service, copletFactory, factory, adapterSelector);
            }
           
            if ( layoutID != null ) {
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 = e.getLayout();
        if ( null != startingLayout ) {
            PortalService portalService = null;
            try {
                portalService = (PortalService) this.manager.lookup(PortalService.ROLE);
                portalService.getComponentManager().getProfileManager().setEntryLayout( startingLayout );
View Full Code Here

     * This method gets the layout object from the first two
     * values and invokes {@link #publish(Publisher, Layout, String[])}.
     * @param values The values contained in the request
     */
    protected void publish( PortalService service, Publisher 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

        {
            service = (PortalService) this.manager.lookup(PortalService.ROLE);

            if (layoutKey == null)
            {
                Layout l = getEntryLayout();
                if (null != l)
                {
                    return l;
                }
                layoutKey = getDefaultLayoutKey();
            }

            String serviceKey = LAYOUTKEY_PREFIX + layoutKey;
            Object[] objects = (Object[]) service.getAttribute(serviceKey);

            // check if the layout is already cached and still valid
            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 SequencedHashMap();
            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

        service.setAttribute("CopletInstanceData:" + layoutKey, copletInstanceDataManager);
               
        // load layout
        parameters.put("profiletype", "layout");
        parameters.put("objectmap", copletInstanceDataManager.getCopletInstanceData());
        Layout layout = (Layout)this.getOrCreateProfile(layoutKey, parameters, service, layoutFactory);
        service.setAttribute("Layout:" + layoutKey, layout);
               
        // now invoke login on each instance
        Iterator iter =  copletInstanceDataManager.getCopletInstanceData().values().iterator();
        while ( iter.hasNext() ) {
View Full Code Here

        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() ) {
            // TODO - set unique id
            id = layoutName + '-' + System.currentTimeMillis();
        }
        layout.initialize( layoutName, id );
        layout.setDescription( layoutDescription );
        layout.setAspectDataHandler((AspectDataHandler)o[1]);

        PortalService service = null;
        try {
            service = (PortalService)this.manager.lookup(PortalService.ROLE);
            service.getComponentManager().getProfileManager().register(layout);
View Full Code Here

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

                        }
                       
                        ProfileManager profileManager = null;
                        try {
                            profileManager = (ProfileManager)this.manager.lookup(ProfileManager.ROLE);
                            Layout layout = profileManager.getPortalLayout( id );
                            if ( layout != null ) {
                                e = new ChangeAspectDataEvent(layout, "frame", uri);
                                publisher.publish(e);
                            }
                        } catch (ComponentException ignore) {
View Full Code Here

                    ContentHandler handler)
  throws SAXException {
       
        CopletInstanceData cid = ((CopletLayout)layout).getCopletInstanceData();

        Layout fullScreenLayout = (Layout)service.getTemporaryAttribute("DEFAULT_LAYOUT");
        if ( fullScreenLayout != null && fullScreenLayout.equals( layout )) {
            FullScreenCopletEvent event = new FullScreenCopletEvent( cid, null );
            XMLUtils.createElement(handler, "fullscreen-uri", service.getLinkService().getRefreshLinkURI());
        } else {
            FullScreenCopletEvent event = new FullScreenCopletEvent( cid, layout );
            XMLUtils.createElement(handler, "fullscreen-uri", service.getLinkService().getLinkURI(event));
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.