Package org.apache.cocoon.portal.coplet

Examples of org.apache.cocoon.portal.coplet.CopletInstanceData


  public void resetValue(Object object) {
    ((CopletLayout)object).setCopletInstanceData(null);
  }

  public void setValue(Object object, Object value) {
    CopletInstanceData copletInstanceData = (CopletInstanceData)getObjectMap().get(value);
    ((CopletLayout)object).setCopletInstanceData(copletInstanceData);
  }
View Full Code Here


  /**
   * Updates the references to the coplet data to the ones stored in the manager.
   */
  public void update(CopletDataManager manager) {
    Iterator iterator = this.copletInstanceData.values().iterator();
    CopletInstanceData data;
    while (iterator.hasNext()) {
      data = (CopletInstanceData)iterator.next();
      data.setCopletData(manager.getCopletData(data.getCopletData().getName()));
    }
  }
View Full Code Here

        int position = location.indexOf(':') + 1;
        if (position != 0) {
            location = location.substring(position+2);
        }
        ProfileManager profileManager = null;
        CopletInstanceData coplet = null;
        try {
            profileManager = (ProfileManager)this.componentManager.lookup(ProfileManager.ROLE);
            coplet = profileManager.getCopletInstanceData(location);
            CopletSource copletSource =
                new CopletSource(coplet.getCopletData().getCopletBaseData().getCopletAdapterName(),
                                 coplet);
            copletSource.compose(this.componentManager);
            return copletSource;
        } catch (ComponentException ce) {
            throw new SourceException("Unable to lookup profile manager.", ce);
View Full Code Here

                    Layout layout,
                    PortalService service,
                    ContentHandler handler)
  throws SAXException {

        CopletInstanceData cid = ((CopletLayout)layout).getCopletInstanceData();
       
        XMLUtils.startElement(handler, "content");

        this.createCInclude("coplet://" + cid.getCopletId(), handler);

        XMLUtils.endElement(handler, "content");
       
        context.invokeNext(layout, service, handler);
  }
View Full Code Here

                    Layout layout,
                    PortalService service,
                    ContentHandler handler)
  throws SAXException {
       
        CopletInstanceData cid = ((CopletLayout)layout).getCopletInstanceData();

        if (cid.getCopletData().isRemovable()) {
        }

        MandatoryStatus mandatory = (MandatoryStatus) this.getStatus(MandatoryStatus.class, ProfileManager.SESSION_STATUS, cid.getCopletData().getName());
        if ( mandatory == null || !mandatory.isMandatory()) {
            LayoutRemoveEvent lre = new LayoutRemoveEvent(layout, 0);
            XMLUtils.createElement(handler, "remove-uri", service.getLinkService().getLinkURI(lre));
        }
        context.invokeNext(layout, service, handler);
View Full Code Here

                    Layout layout,
                    PortalService service,
                    ContentHandler handler)
  throws SAXException {
       
        CopletInstanceData cid = ((CopletLayout)layout).getCopletInstanceData();

        SizeableStatus sizeable = (SizeableStatus) this.getStatus(SizeableStatus.class, ProfileManager.SESSION_STATUS, cid.getCopletData().getName());
        if ( sizeable != null ) {
            SizingStatus sizingstatus = (SizingStatus)this.getStatus(SizingStatus.class, ProfileManager.SESSION_STATUS, cid.getCopletId());
            int status = (sizingstatus == null ? SizingStatus.STATUS_MAXIMIZED : sizingstatus.getStatus());

            SizingStatusEvent event;   

            if (sizeable.isMinimizable() && status != SizingStatus.STATUS_MINIMIZED) {
View Full Code Here

    public void toSAX(RendererAspectContext context,
                        Layout layout,
                        PortalService service,
                        ContentHandler contenthandler)
    throws SAXException {
        final CopletInstanceData copletInstanceData = ((CopletLayout)layout).getCopletInstanceData();
        AttributesImpl attributes = new AttributesImpl();
        Map parameter = layout.getParameters();
        for (Iterator iter = parameter.values().iterator(); iter.hasNext();) {
            Parameter param = (Parameter) iter.next();
            attributes.addCDATAAttribute(param.getName(), param.getValue());
        }
        XMLUtils.startElement(contenthandler, this.getTagName(context), attributes);
        int status = copletInstanceData.getStatus();
        XMLUtils.createElement(contenthandler, "title", copletInstanceData.getCopletData().getTitle());
        XMLUtils.createElement(contenthandler, "status", "" + status);

        context.invokeNext( layout, service, contenthandler );

        XMLUtils.endElement(contenthandler, this.getTagName(context));
View Full Code Here

                    Layout layout,
                    PortalService service,
                    ContentHandler handler)
  throws SAXException {
       
        CopletInstanceData cid = ((CopletLayout)layout).getCopletInstanceData();

        Layout fullScreenLayout = (Layout)service.getTemporaryAttribute("DEFAULT_LAYOUT");
        if ( fullScreenLayout != null && fullScreenLayout.getId().equals( layout.getId() )) {
            FullScreenCopletEvent event = new FullScreenCopletEvent( cid, null );
            XMLUtils.createElement(handler, "fullscreen-uri", service.getLinkService().getRefreshLinkURI());
View Full Code Here

            CopletInstanceDataManager copletInstanceDataManager = (CopletInstanceDataManager)service.getAttribute("CopletInstanceData:"+layoutKey);
            if ( copletInstanceDataManager != null ) {
                Iterator iter = copletInstanceDataManager.getCopletInstanceData().values().iterator();
                while ( iter.hasNext() ) {
                    CopletInstanceData cid = (CopletInstanceData) iter.next();
                    CopletAdapter adapter = null;
                    try {
                        adapter = (CopletAdapter)adapterSelector.select(cid.getCopletData().getCopletBaseData().getCopletAdapterName());
                        adapter.logout( cid );
                    } finally {
                        adapterSelector.release( adapter );
                    }
                }
View Full Code Here

        }
      } else if (object instanceof CopletInstanceDataManager) {
        CopletFactory copletFactory = (CopletFactory)factory;
        Iterator iterator = ((CopletInstanceDataManager)object).getCopletInstanceData().values().iterator();
        while (iterator.hasNext()) {
          CopletInstanceData cid = (CopletInstanceData)iterator.next();
          copletFactory.prepare(cid);
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.portal.coplet.CopletInstanceData

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.