cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r328710 - in /cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal: coplet/adapter/impl/ApplicationCopletAdapter.java reading/ProxyReader.java transformation/LinkTransformer.java transformation/ProxyTransformer.java
Date Wed, 26 Oct 2005 19:11:01 GMT
Author: cziegeler
Date: Wed Oct 26 12:10:46 2005
New Revision: 328710

URL: http://svn.apache.org/viewcvs?rev=328710&view=rev
Log:
Clean up application coplet and proxy components.

Modified:
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/impl/ApplicationCopletAdapter.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/reading/ProxyReader.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/transformation/LinkTransformer.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/transformation/ProxyTransformer.java

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/impl/ApplicationCopletAdapter.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/impl/ApplicationCopletAdapter.java?rev=328710&r1=328709&r2=328710&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/impl/ApplicationCopletAdapter.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/impl/ApplicationCopletAdapter.java
Wed Oct 26 12:10:46 2005
@@ -19,22 +19,13 @@
 import java.util.Enumeration;
 import java.util.Map;
 
-import org.apache.avalon.framework.service.ServiceException;
-import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.components.ContextHelper;
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.Request;
-import org.apache.cocoon.portal.coplet.CopletData;
-import org.apache.cocoon.portal.coplet.CopletFactory;
+import org.apache.cocoon.portal.LinkService;
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
 import org.apache.cocoon.portal.event.CopletInstanceEvent;
 import org.apache.cocoon.portal.event.impl.CopletLinkEvent;
-import org.apache.cocoon.portal.layout.CompositeLayout;
-import org.apache.cocoon.portal.layout.Item;
-import org.apache.cocoon.portal.layout.LayoutFactory;
-import org.apache.cocoon.portal.layout.NamedItem;
-import org.apache.cocoon.portal.layout.impl.CopletLayout;
-import org.apache.cocoon.portal.profile.ProfileManager;
 import org.apache.cocoon.portal.transformation.ProxyTransformer;
 import org.apache.cocoon.util.NetUtils;
 import org.apache.cocoon.xml.XMLUtils;
@@ -79,116 +70,45 @@
         if ( e instanceof CopletLinkEvent ) {
             CopletLinkEvent event = (CopletLinkEvent) e;
             CopletInstanceData coplet = (CopletInstanceData) event.getTarget();
-            String link = event.getLink();
 
-            if ("createNewCopletInstance".equals(link)) {
-                try {
-                    createNewInstance(coplet);
-                } catch (ProcessingException ex) {
-                    getLogger().error("Could not create new coplet instance", ex);
-                }
-            } else {
-                // this is a normal link event, so save the url in the instance data
-                // for ProxyTransformer
-                String linkValue = event.getLink();
-                Boolean addParams = (Boolean)this.getConfiguration(coplet, "appendParameters",
Boolean.FALSE);
-                if ( addParams.booleanValue() ) {
-                    final StringBuffer uri = new StringBuffer(event.getLink());
-                    boolean hasParams = (uri.toString().indexOf("?") != -1);
-                    
-                    // append parameters - if any
-                    final Map objectModel = ContextHelper.getObjectModel(this.context);
-                    final Request r = ObjectModelHelper.getRequest(objectModel);
-                    final Enumeration params = r.getParameterNames();
-                    while (params.hasMoreElements()) {
-                        final String name = (String)params.nextElement();
-                        if (!name.startsWith("cocoon-portal-")) {
-                            final String[] values = r.getParameterValues(name);
-                            for(int i = 0; i < values.length; i++) {
-                                if ( hasParams ) {
-                                    uri.append('&');
-                                } else {
-                                    uri.append('?');
-                                    hasParams = true;
-                                }
-                                uri.append(name);
-                                uri.append('=');
-                                try {
-                                    uri.append(NetUtils.decode(values[i], "utf-8"));
-                                } catch (UnsupportedEncodingException uee) {
-                                    // ignore this
-                                }
+            // this is a normal link event, so save the url in the instance data
+            // for ProxyTransformer
+            String linkValue = event.getLink();
+            Boolean addParams = (Boolean)this.getConfiguration(coplet, "appendParameters",
Boolean.FALSE);
+            if ( addParams.booleanValue() ) {
+                final StringBuffer uri = new StringBuffer(event.getLink());
+                boolean hasParams = (uri.toString().indexOf("?") != -1);
+                
+                // append parameters - if any
+                LinkService linkService = this.portalService.getComponentManager().getLinkService();
+                final Map objectModel = ContextHelper.getObjectModel(this.context);
+                final Request r = ObjectModelHelper.getRequest(objectModel);
+                final Enumeration params = r.getParameterNames();
+                while (params.hasMoreElements()) {
+                    final String name = (String)params.nextElement();
+                    if (!linkService.isInternalParameterName(name)) {
+                        final String[] values = r.getParameterValues(name);
+                        for(int i = 0; i < values.length; i++) {
+                            if ( hasParams ) {
+                                uri.append('&');
+                            } else {
+                                uri.append('?');
+                                hasParams = true;
+                            }
+                            uri.append(name);
+                            uri.append('=');
+                            try {
+                                uri.append(NetUtils.decode(values[i], "utf-8"));
+                            } catch (UnsupportedEncodingException uee) {
+                                // ignore this
                             }
                         }
                     }
-                    linkValue = uri.toString();
                 }
-                coplet.setTemporaryAttribute(ProxyTransformer.LINK, linkValue);
+                linkValue = uri.toString();
             }
+            coplet.setTemporaryAttribute(ProxyTransformer.LINK, linkValue);
         }
-    }
-
-    /**
-     * Creates a new instance of the given coplet. Also a new named item in the tab layout
is
-     * created to show the data of the new coplet instance in the portal.
-     * @param 	coplet	the coplet instance data
-     * @trows	ProcessingException if something fails in the creation process
-     */
-    private void createNewInstance(CopletInstanceData coplet)
-    throws ProcessingException {
-        ProfileManager profileManager = null;
-        try {
-            profileManager =
-                (ProfileManager) this.manager.lookup(ProfileManager.ROLE);
-
-            CopletData copletData = coplet.getCopletData();
-
-            LayoutFactory lfac =
-                (LayoutFactory) this.manager.lookup(LayoutFactory.ROLE);
-
-            CopletLayout copletLayout =
-                (CopletLayout) lfac.newInstance("coplet");
-
-            CopletFactory cfac =
-                (CopletFactory) manager.lookup(CopletFactory.ROLE);
-
-            CopletInstanceData newCoplet = cfac.newInstance(copletData);
-
-            copletLayout.setCopletInstanceData(newCoplet);
-            profileManager.register(copletLayout);
-
-            NamedItem newItem = new NamedItem();
-            newItem.setLayout(copletLayout);
-
-            CompositeLayout tabLayout =
-                (CompositeLayout) profileManager.getPortalLayout(
-                    "portalApplications", null);
-
-            newItem.setName(getNewInstanceTabName(tabLayout));
-            tabLayout.addItem(newItem);
-        } catch (ServiceException ce) {
-            throw new ProcessingException(
-                "Unable to lookup profile manager.",
-                ce);
-        } catch (Exception e) {
-            throw new ProcessingException(e);
-        } finally {
-            this.manager.release(profileManager);
-        }
-    }
-
-    /**
-     * Returns the name of the new named item in the tab layout
-     * @return String the name of the new item
-     */
-    private String getNewInstanceTabName(CompositeLayout layout) {
-        Integer data = Integer.valueOf(layout.getTemporaryParameter("tab"));
-        Item selectedItem = (NamedItem) layout.getItem(data.intValue());
-
-        if (selectedItem instanceof NamedItem) {
-            return ((NamedItem) selectedItem).getName();
-        }
-        return ("New");
     }
 
     /**

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/reading/ProxyReader.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/reading/ProxyReader.java?rev=328710&r1=328709&r2=328710&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/reading/ProxyReader.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/reading/ProxyReader.java Wed
Oct 26 12:10:46 2005
@@ -22,12 +22,17 @@
 import java.util.Enumeration;
 import java.util.Map;
 
+import org.apache.avalon.framework.activity.Disposable;
 import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.Request;
 import org.apache.cocoon.environment.Response;
 import org.apache.cocoon.environment.SourceResolver;
+import org.apache.cocoon.portal.LinkService;
+import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
 import org.apache.cocoon.portal.transformation.ProxyTransformer;
 import org.apache.cocoon.reading.ServiceableReader;
@@ -44,26 +49,41 @@
  *
  * @version $Id$
  */
-public class ProxyReader extends ServiceableReader {
+public class ProxyReader extends ServiceableReader implements Disposable {
 
-    /**
-     * The coplet instance data
-     */
+    /** The coplet instance data. */
     protected CopletInstanceData copletInstanceData;
 
+    /** The HTTP response. */
+    protected Response response;
+
+    /** The origninal HTTP request. */
+    protected Request request;
+
+    /** The prefix. */
+    protected String prefix;
+
+    /** The portal service. */
+    protected PortalService portalService;
+
     /**
-     * The HTTP response
+     * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
      */
-    protected Response response;
+    public void service(ServiceManager manager) throws ServiceException {
+        super.service(manager);
+        this.portalService = (PortalService)this.manager.lookup(PortalService.ROLE);
+    }
 
     /**
-     * The origninal HTTP request
+     * @see org.apache.avalon.framework.activity.Disposable#dispose()
      */
-    protected Request request;
+    public void dispose() {
+        if ( this.manager != null ) {
+            this.manager.release(this.portalService);
+            this.portalService = null;
+        }
+    }
 
-    /** The prefix */
-    protected String prefix;
-    
     /**
      * @see org.apache.cocoon.sitemap.SitemapModelComponent#setup(SourceResolver, Map, String,
Parameters)
      */
@@ -74,17 +94,13 @@
     throws ProcessingException, SAXException, IOException {
         super.setup(resolver, objectModel, src, par);
 
-        request = ObjectModelHelper.getRequest(objectModel);
-        response = ObjectModelHelper.getResponse(objectModel);
+        this.request = ObjectModelHelper.getRequest(objectModel);
+        this.response = ObjectModelHelper.getResponse(objectModel);
 
         String copletID = request.getParameter(ProxyTransformer.COPLETID);
-        String portalName = request.getParameter(ProxyTransformer.PORTALNAME);
 
-        copletInstanceData =
-            ProxyTransformer.getInstanceData(
-                this.manager,
-                copletID,
-                portalName);
+        this.copletInstanceData = this.portalService.getComponentManager()
+                                      .getProfileManager().getCopletInstanceData(copletID);
         this.prefix = par.getParameter("prefix", ProxyTransformer.PROXY_PREFIX);
     }
 
@@ -94,6 +110,8 @@
     public void recycle() {
         this.response = null;
         this.request = null;
+        this.copletInstanceData = null;
+        this.prefix = null;
         super.recycle();
     }
 
@@ -144,17 +162,18 @@
     protected HttpURLConnection connect(Request request, String uri)
         throws IOException {
         String cookie =
-            (String) copletInstanceData.getAttribute(ProxyTransformer.COOKIE);
+            (String) copletInstanceData.getTemporaryAttribute(ProxyTransformer.COOKIE);
 
         Enumeration enumeration = request.getParameterNames();
 
         boolean firstattribute = true;
         StringBuffer query = new StringBuffer();
 
+        final LinkService linkService = this.portalService.getComponentManager().getLinkService();
         while (enumeration.hasMoreElements()) {
             String paramName = (String) enumeration.nextElement();
 
-            if (!paramName.startsWith("cocoon-portal-")) {
+            if (!linkService.isInternalParameterName(paramName)) {
 
                 String[] paramValues = request.getParameterValues(paramName);
 
@@ -187,7 +206,7 @@
 
         connection.connect();
 
-        copletInstanceData.setAttribute(
+        this.copletInstanceData.setTemporaryAttribute(
             ProxyTransformer.COOKIE,
             connection.getHeaderField(ProxyTransformer.COOKIE));
 

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/transformation/LinkTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/transformation/LinkTransformer.java?rev=328710&r1=328709&r2=328710&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/transformation/LinkTransformer.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/transformation/LinkTransformer.java
Wed Oct 26 12:10:46 2005
@@ -25,9 +25,7 @@
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
 import org.apache.cocoon.ProcessingException;
-import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.SourceResolver;
-import org.apache.cocoon.portal.Constants;
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
 import org.apache.cocoon.transformation.AbstractTransformer;
 import org.apache.cocoon.xml.AttributesImpl;
@@ -68,11 +66,6 @@
     protected String copletIdParamString;
 
     /**
-     * Used for appending a request parameter containing the portal name
-     */
-    protected String portalNameParamString;
-
-    /**
      * The coplet instance data
      */
     protected CopletInstanceData copletInstanceData;
@@ -87,12 +80,10 @@
      */
     protected Stack elementStack = new Stack();
 
-    /**
-     * The avalon service manager
-     */
+    /** The avalon service manager. */
     protected ServiceManager manager;
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
      */
     public void service(ServiceManager manager) throws ServiceException {
@@ -123,11 +114,6 @@
         this.copletIdParamString =
             ProxyTransformer.COPLETID + "=" + copletInstanceData.getId();
 
-        Map context = (Map) objectModel.get(ObjectModelHelper.PARENT_CONTEXT);
-        this.portalNameParamString =
-            ProxyTransformer.PORTALNAME
-                + "="
-                + (String) context.get(Constants.PORTAL_NAME_KEY);
         this.prefix = par.getParameter("prefix", ProxyTransformer.PROXY_PREFIX);
     }
 
@@ -140,7 +126,6 @@
         this.copletInstanceData = null;
         this.elementStack.clear();
         this.copletIdParamString = null;
-        this.portalNameParamString = null;
     }
 
     /**
@@ -380,7 +365,7 @@
                 uri.substring(
                     index_semikolon + 1,
                     (index_question == -1 ? uri.length() : index_question));
-            copletInstanceData.setAttribute(
+            copletInstanceData.setTemporaryAttribute(
                 ProxyTransformer.SESSIONTOKEN,
                 sessionToken);
         }
@@ -390,13 +375,6 @@
         }
 
         uriBuffer.append(uri);
-
-        if (applyPrefixAndPortalParams) {
-            uriBuffer.append((index_question == -1 ? '?' : '&'));
-            uriBuffer.append(this.copletIdParamString);
-            uriBuffer.append('&');
-            uriBuffer.append(this.portalNameParamString);
-        }
 
         return uriBuffer.toString();
     }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/transformation/ProxyTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/transformation/ProxyTransformer.java?rev=328710&r1=328709&r2=328710&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/transformation/ProxyTransformer.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/transformation/ProxyTransformer.java
Wed Oct 26 12:10:46 2005
@@ -24,6 +24,7 @@
 import java.util.Enumeration;
 import java.util.Map;
 
+import org.apache.avalon.framework.activity.Disposable;
 import org.apache.avalon.framework.parameters.ParameterException;
 import org.apache.avalon.framework.parameters.Parameterizable;
 import org.apache.avalon.framework.parameters.Parameters;
@@ -35,10 +36,10 @@
 import org.apache.cocoon.environment.Request;
 import org.apache.cocoon.environment.SourceResolver;
 import org.apache.cocoon.portal.Constants;
+import org.apache.cocoon.portal.LinkService;
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.coplet.CopletData;
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
-import org.apache.cocoon.portal.profile.ProfileManager;
 import org.apache.cocoon.portal.util.HtmlDomParser;
 import org.apache.cocoon.transformation.AbstractTransformer;
 import org.apache.cocoon.util.NetUtils;
@@ -61,19 +62,17 @@
  */
 public class ProxyTransformer
     extends AbstractTransformer
-    implements Serviceable, Parameterizable {
+    implements Serviceable, Parameterizable, Disposable {
 
     /**
      * Parameter for specifying the envelope tag
      */
     public static final String ENVELOPE_TAG_PARAMETER = "envelope-tag";
 
-    public static final String PORTALNAME = "cocoon-portal-portalname";
     public static final String COPLETID = "cocoon-portal-copletid";
     public static final String PROXY_PREFIX = "proxy-";
 
     public static final String COPLET_ID_PARAM = "copletId";
-    public static final String PORTAL_NAME_PARAM = "portalName";
 
     // Coplet instance data keys
     public static final String SESSIONTOKEN = "sessiontoken";
@@ -82,65 +81,56 @@
     public static final String LINK = "link";
     public static final String DOCUMENT_BASE = "documentbase";
 
-    /**
-     * Parameter for specifying the java protocol handler (used for https)
-     */
-    public static final String PROTOCOL_HANDLER_PARAMETER = "protocol-handler";
-
-    /**
-     * The document base uri
-     */
+    /** The document base uri. */
     protected String documentBase;
 
-    /**
-     * The current link to the external application
-     */
+    /** The current link to the external application. */
     protected String link;
 
-    /**
-     * The default value for the envelope Tag 
-     */
+    /** The default value for the envelope Tag. */
     protected String defaultEnvelopeTag;
     
-    /** 
-     * This tag will include the external XHMTL 
-     */
+    /** This tag will include the external XHMTL. */
     protected String envelopeTag;
 
-    /**
-     * The Avalon component manager
-     */
+    /** The Avalon service manager. */
     protected ServiceManager manager;
 
-    /**
-     * The coplet instance data
-     */
+    /** The coplet instance data. */
     protected CopletInstanceData copletInstanceData;
 
-    /**
-     * The original request to the portal
-     */
+    /** The original request to the portal. */
     protected Request request;
 
-    /**
-     * The encoding if configured
-     */
+    /** The encoding if configured. */
     protected String configuredEncoding;
 
-    /**
-     * The user agent identification string if confiugured
-     */
+    /** The user agent identification string if confiugured. */
     protected String userAgent;
 
-    /** The sitemap parameters */
+    /** The sitemap parameters. */
     protected Parameters parameters;
 
-    /* (non-Javadoc)
+    /** The portal service. */
+    protected PortalService portalService;
+
+    /**
      * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
      */
     public void service(ServiceManager manager) throws ServiceException {
         this.manager = manager;
+        this.portalService = (PortalService)this.manager.lookup(PortalService.ROLE);
+    }
 
+    /**
+     * @see org.apache.avalon.framework.activity.Disposable#dispose()
+     */
+    public void dispose() {
+        if ( this.manager != null ) {
+            this.manager.release(this.portalService);
+            this.portalService = null;
+            this.manager = null;
+        }
     }
 
     /**
@@ -190,7 +180,7 @@
         }
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.avalon.excalibur.pool.Recyclable#recycle()
      */
     public void recycle() {
@@ -201,6 +191,7 @@
         this.link = null;
         this.request = null;
         this.parameters = null;
+        this.copletInstanceData = null;
     }
 
     /**
@@ -245,20 +236,20 @@
                 remoteURI = remoteURI.substring(0, pos);
             }
 
-            // append all parameters of the current request, except those where
-            // the name of the request parameter starts with "cocoon-portal-"
+            // append all parameters of the current request, except internal ones
             final Enumeration enumeration = request.getParameterNames();
+            final LinkService linkService = this.portalService.getComponentManager().getLinkService();
             while (enumeration.hasMoreElements()) {
                 String paramName = (String) enumeration.nextElement();
 
-                if (!paramName.startsWith("cocoon-portal-")) {
+                if (!linkService.isInternalParameterName(paramName)) {
                     String[] paramValues = request.getParameterValues(paramName);
                     for (int i = 0; i < paramValues.length; i++) {
                         firstparameter = this.appendParameter(query, firstparameter, post,
paramName, paramValues[i]);
                     }
                 }
             }
-            
+
             // now append parameters from the sitemap - if any
             final String[] names = this.parameters.getNames();
             for(int i=0; i<names.length; i++) {
@@ -287,8 +278,7 @@
                         remoteURI = checkForRedirect(result, documentBase);
                     }
 
-                }
-                while (remoteURI != null);
+                } while (remoteURI != null);
             } catch (IOException ex) {
                 throw new SAXException(
                     "Failed to retrieve remoteURI " + remoteURI,
@@ -328,6 +318,7 @@
 
         return firstparameter;
     }
+
     /**
      * Check the http status code of the http response to detect any redirects.
      * @param connection The HttpURLConnection
@@ -335,10 +326,9 @@
      * @return the redirected URL or null if no redirects are detected.
      * @throws IOException if exceptions occure while analysing the response
      */
-    protected String checkForRedirect(
-        HttpURLConnection connection,
-        String documentBase)
-        throws IOException {
+    protected String checkForRedirect(HttpURLConnection connection,
+                                      String documentBase)
+    throws IOException {
 
         if (connection.getResponseCode() == HttpURLConnection.HTTP_MOVED_PERM
             || connection.getResponseCode() == HttpURLConnection.HTTP_MOVED_TEMP) {
@@ -355,7 +345,7 @@
                         (index_question == -1
                             ? newURI.length()
                             : index_question));
-                this.copletInstanceData.setAttribute(
+                this.copletInstanceData.setTemporaryAttribute(
                     SESSIONTOKEN,
                     sessionToken);
             }
@@ -419,7 +409,7 @@
                                 (index_question == -1
                                     ? newURI.length()
                                     : index_question));
-                        this.copletInstanceData.setAttribute(
+                        this.copletInstanceData.setTemporaryAttribute(
                             SESSIONTOKEN,
                             sessionToken);
                     }
@@ -478,7 +468,7 @@
         boolean post)
         throws IOException {
 
-        String cookie = (String) copletInstanceData.getAttribute(COOKIE);
+        String cookie = (String) copletInstanceData.getTemporaryAttribute(COOKIE);
 
         if (!post) {
             uri = uri + query;
@@ -521,7 +511,7 @@
             out.close();
         }
 
-        copletInstanceData.setAttribute(
+        copletInstanceData.setTemporaryAttribute(
             COOKIE,
             connection.getHeaderField(COOKIE));
         documentBase = uri.substring(0, uri.lastIndexOf('/') + 1);
@@ -566,24 +556,6 @@
                 + uri;
         }
         return documentBaseURL.toExternalForm() + uri;
-    }
-
-    public static CopletInstanceData getInstanceData(ServiceManager manager,
-                                                     String copletID,
-                                                     String portalName)
-    throws ProcessingException {
-        PortalService portalService = null;
-        try {
-            portalService = (PortalService) manager.lookup(PortalService.ROLE);
-                
-            ProfileManager profileManager = portalService.getComponentManager().getProfileManager();
-            CopletInstanceData data = profileManager.getCopletInstanceData(copletID);
-            return data;
-        } catch (ServiceException e) {
-            throw new ProcessingException("Error getting portal service.", e);
-        } finally {
-            manager.release(portalService);
-        }
     }
 
     /**



Mime
View raw message