Package org.apache.cocoon.portal.coplet

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


        service.setAttribute("Layout:" + layoutKey, layout);
               
        // now invoke login on each instance
        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.login( cid );
            } finally {
                adapterSelector.release( adapter );
            }
        }
View Full Code Here


                    int index = attr.getIndex(this.attributeName);
                    String link = attr.getValue(index);

                    // if attribute found that contains a link
                    if (link != null) {
                        CopletInstanceData cid = this.getCopletInstanceData();                      
                        LinkService linkService = this.getPortalService().getComponentManager().getLinkService();
       
                        // create event link
                        CopletLinkEvent event = new CopletLinkEvent(cid, link);
                        String eventLink = linkService.getLinkURI(event);
   
                        // insert event link
                        attr.setValue(index, eventLink);
                    }
                }
               
                String eventLink = null;
                DocumentFragment fragment = null;
                               
                // process element that contains link
                if (this.elementName != null && name.equals(this.elementName)) {
                    String link = this.endTextRecording();

                    CopletInstanceData cid = this.getCopletInstanceData();                      
                    LinkService linkService = this.getPortalService().getComponentManager().getLinkService();

                    // create event link
                    CopletLinkEvent event = new CopletLinkEvent(cid, link);
                    eventLink = linkService.getLinkURI(event);
View Full Code Here

        AttributesImpl newAttributes = new AttributesImpl(attributes);
        newAttributes.removeAttribute("href");
        newAttributes.removeAttribute("external");
        String link = attributes.getValue("href");

        CopletInstanceData cid = this.getCopletInstanceData();
        link = this.getLink((String)cid.getTemporaryAttribute(this.attributeName), link);

        newAttributes.addCDATAAttribute("path", this.jxPath);
        newAttributes.addCDATAAttribute("value", link);
        newAttributes.addCDATAAttribute("coplet", cid.getId());
        newAttributes.addCDATAAttribute("format", "html-link");
        this.xmlConsumer.startPrefixMapping("coplet", CopletTransformer.NAMESPACE_URI);
        this.xmlConsumer.startElement(CopletTransformer.NAMESPACE_URI,
                                      CopletTransformer.LINK_ELEM,
                                      "coplet:" + CopletTransformer.LINK_ELEM,
View Full Code Here

    throws SAXException {
        AttributesImpl newAttributes = new AttributesImpl(attributes);
        newAttributes.removeAttribute("action");
        String link = attributes.getValue("action");

        CopletInstanceData cid = this.getCopletInstanceData();
        link = this.getLink((String)cid.getTemporaryAttribute(this.attributeName), link);

        newAttributes.addCDATAAttribute("path", this.jxPath);
        newAttributes.addCDATAAttribute("value", link);
        newAttributes.addCDATAAttribute("coplet", cid.getId());
        newAttributes.addCDATAAttribute("format", "html-form");
        if ( newAttributes.getIndex("method") == -1 ) {
            newAttributes.addCDATAAttribute("method", "POST");
        }
View Full Code Here

        String portalAction = null;
        String portalEvent = null;

        // if attribute found that contains a link
        if (link != null) {
            CopletInstanceData cid = this.getCopletInstanceData();
            // create event link
            CopletLinkEvent event = new CopletLinkEvent(cid, link);
            String eventLink = this.getPortalService().getComponentManager().getLinkService().getLinkURI(event);

            //form elements need hidden inputs to change request parameters
View Full Code Here

                      Layout layout,
                      PortalService service,
                      ContentHandler contenthandler)
    throws SAXException {
        final PreparedConfiguration config = (PreparedConfiguration)context.getAspectConfiguration();
        final CopletInstanceData copletInstanceData = ((CopletLayout)layout).getCopletInstanceData();

        if ( config.rootTag ) {
            XMLUtils.startElement(contenthandler, config.tagName);
        }
        final PortletWindow window = (PortletWindow)copletInstanceData.getAttribute("window");
        if ( window == null ) {
            // no portlet window, so use a default behaviour
            XMLUtils.createElement(contenthandler, "title", copletInstanceData.getCopletData().getTitle());
        } else {
            if ( ((PortletWindowImpl)window).getLayout() == null ) {
                ((PortletWindowImpl)window).setLayout((CopletLayout)layout);
            }
           
            String title = (String) copletInstanceData.getAttribute("dynamic-title");
            if ( title == null ) {
                final PortletDefinition def = window.getPortletEntity().getPortletDefinition();
                try {
                    title = def.getDisplayName(def.getLanguageSet().getDefaultLocale()).getDisplayName();
                } catch (Exception ignore)  {
                    title = copletInstanceData.getCopletData().getTitle();
                }
            }
            XMLUtils.createElement(contenthandler, "title", title);           
       

            if ( this.environment != null ) {
                InformationProviderService ips = (InformationProviderService) this.environment.getContainerService(InformationProviderService.class);
                DynamicInformationProvider dip = ips.getDynamicProvider((HttpServletRequest) context.getObjectModel().get("portlet-request"));
               
                // Sizing
                WindowState ws = (WindowState)copletInstanceData.getAttribute("window-state");
                if ( ws == null ) {
                    ws = WindowState.NORMAL;
                }
               
                if ( !ws.equals(WindowState.MINIMIZED) && !ws.equals(WindowState.MAXIMIZED)) {
                    PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
                    url.clearParameters();
                    url.setWindowState(WindowState.MINIMIZED);
                   
                    XMLUtils.createElement(contenthandler, "minimize-uri", url.toString());
                }

                if ( !ws.equals(WindowState.NORMAL)) {
                    PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
                    url.clearParameters();
                    url.setWindowState(WindowState.NORMAL);
                    XMLUtils.createElement(contenthandler, "maximize-uri", url.toString());
                }

                if ( !ws.equals(WindowState.MAXIMIZED)) {
                    PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
                    url.clearParameters();
                    url.setWindowState(WindowState.MAXIMIZED);
                    XMLUtils.createElement(contenthandler, "fullscreen-uri", url.toString());
                }

                // portlet modes
                PortletMode pm = (PortletMode)copletInstanceData.getAttribute("portlet-mode");
                if ( pm == null ) {
                    pm = PortletMode.VIEW;
                }
                if ( !pm.equals(PortletMode.EDIT) ) {
                    PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
View Full Code Here

            location = location.substring(position+2);
        }
        PortalService service = null;
        try {
            service = (PortalService)this.manager.lookup(PortalService.ROLE);
            CopletInstanceData coplet = service.getComponentManager().getProfileManager().getCopletInstanceData(location);
            if ( coplet == null ) {
                throw new IOException("Unable to get coplet for " + location);
            }
            CopletSource copletSource =
                new CopletSource(uri, protocol,
View Full Code Here

                coplets = new HashMap();
                service.setAttribute(attribute, coplets);
            }*/
      CopletInstanceDataManager copletInstanceDataManager = (CopletInstanceDataManager)((Object[])service.getAttribute(attribute))[0];

            CopletInstanceData cid = copletInstanceDataManager.getCopletInstanceData(copletID);
            if (null == cid) {
/*         TODO Must be changed for dynamic coplet creation.

                CopletBaseData base = new CopletBaseData();
                base.setName("URICoplet");
View Full Code Here

  public void checkValidity(Object object) {
  }

  public Object getValue(Object object) {
    CopletInstanceData copletInstanceData = ((CopletLayout)object).getCopletInstanceData();
    if (copletInstanceData != null) {
      return copletInstanceData.getCopletId();
    } else {
      return null;
    }
  }
View Full Code Here

      return null;
    }
  }

  public Object newInstance(Object parent) {
    return new CopletInstanceData();
  }
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.