Package org.apache.cocoon.portal.layout

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


      adapter.saveProfile(key, parameters, profileManager);

      // save coplet instance data
      parameters.put("profiletype", "layout");
            key = this.buildKey(service, parameters, layoutKey, false);
      Layout layout = (Layout)service.getAttribute("Layout:" + layoutKey);
      adapter.saveProfile(key, parameters, layout);
           
    } catch (Exception e) {
      // TODO
      throw new CascadingRuntimeException("Exception during save profile", e);
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);
            ProfileManager pm = portalService.getComponentManager().getProfileManager();
            final Layout old = pm.getEntryLayout();
            if ( old != null && old instanceof CopletLayout) {
                ((CopletLayout)old).getCopletInstanceData().setAspectData("fullScreen", Boolean.FALSE);
            }
            pm.setEntryLayout( startingLayout );
            if ( startingLayout != null && startingLayout instanceof CopletLayout) {
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 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

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

        return map;
    }

    protected Map getLabelMap() {
        final Layout rootLayout = portalService.getComponentManager().getProfileManager().getPortalLayout(null, null);
        Map map = (Map) rootLayout.getAspectData(LABEL_MAP);
        if (null == map) {
            map = this.initializeLabels();
            rootLayout.setAspectData(LABEL_MAP, map);
        }
        return map;
    }
View Full Code Here

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

        final Layout portalLayout =
            portalService.getComponentManager().getProfileManager().getPortalLayout(null, null);

        if (portalLayout instanceof CompositeLayout) {
            this.populate((CompositeLayout) portalLayout, map, "", new ArrayList());
        }
View Full Code Here

        return map;
    }

    private String getRoot() {
        final Layout portalLayout =
            portalService.getComponentManager().getProfileManager().getPortalLayout(null, null);

        if (portalLayout instanceof CompositeLayout) {
            return getRoot((CompositeLayout)portalLayout, new StringBuffer(""));
        }
View Full Code Here

            if (tab instanceof NamedItem) {
                if (root.length() > 0) {
                    root.append(".");
                }
                root.append(((NamedItem)tab).getName());
                Layout child = tab.getLayout();
                if (child != null && child instanceof CompositeLayout) {
                    getRoot((CompositeLayout)child, root);
                }
                break;
            }
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

            try {
                // update parameters
                layoutParameters.put(ProfileLS.PARAMETER_OBJECTMAP,
                                     profile.getCopletInstanceDatas());
                layoutValidity = loader.getValidity(layoutKey, layoutParameters);
                final Layout l = (Layout)loader.loadProfile(layoutKey, layoutParameters);
                this.prepareObject(l, service);
                profile.setRootLayout(l);

            } catch (Exception e) {
                if (!this.isSourceNotFoundException(e)) {
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.