You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ra...@apache.org on 2001/07/22 21:04:32 UTC
cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/services/rundata DefaultJetspeedRunData.java JetspeedRunData.java
raphael 01/07/22 12:04:32
Modified: src/java/org/apache/jetspeed/services/rundata
DefaultJetspeedRunData.java JetspeedRunData.java
Log:
- add new Jetspeed specific methods to rundata object
Revision Changes Path
1.3 +108 -1 jakarta-jetspeed/src/java/org/apache/jetspeed/services/rundata/DefaultJetspeedRunData.java
Index: DefaultJetspeedRunData.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/rundata/DefaultJetspeedRunData.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DefaultJetspeedRunData.java 2001/06/16 09:40:01 1.2
+++ DefaultJetspeedRunData.java 2001/07/22 19:04:32 1.3
@@ -54,11 +54,14 @@
package org.apache.jetspeed.services.rundata;
+import org.apache.jetspeed.portal.Portlet;
import org.apache.jetspeed.om.profile.Profile;
import org.apache.jetspeed.capability.CapabilityMap;
import org.apache.jetspeed.capability.CapabilityMapFactory;
import org.apache.turbine.services.rundata.DefaultTurbineRunData;
+import java.util.Stack;
+
/**
* This interface extends the RunData interface with methods
* specific to the needs of a Jetspeed like portal implementation.
@@ -67,7 +70,7 @@
* interface in future releases of Turbine</note>
*
* @author <a href="mailto:raphael@apache.org">Rapha�l Luta</a>
- * @version $Id: DefaultJetspeedRunData.java,v 1.2 2001/06/16 09:40:01 raphael Exp $
+ * @version $Id: DefaultJetspeedRunData.java,v 1.3 2001/07/22 19:04:32 raphael Exp $
*/
public class DefaultJetspeedRunData extends DefaultTurbineRunData
implements JetspeedRunData
@@ -76,6 +79,8 @@
private Profile profile = null;
private CapabilityMap map = null;
private String pid = null;
+ private int mode = NORMAL;
+ private String template = null;
/**
* Returns the portlet id referenced in this request
@@ -98,6 +103,106 @@
}
/**
+ * Returns the portlet id which should be customized for this request
+ *
+ * @return the portlet id being customized or null
+ */
+ public Portlet getCustomized()
+ {
+ Stack stack = (Stack)getSession().getAttribute("customize");
+ Portlet p = null;
+
+ if ((stack!=null)&&(!stack.empty()))
+ {
+ p = (Portlet)stack.peek();
+ }
+
+ return (Portlet)p;
+ }
+
+ /**
+ * Sets the portlet id to customize
+ *
+ * @param id the portlet id to customize or null;
+ */
+ public void setCustomized(Portlet p)
+ {
+ Stack stack = (Stack)getSession().getAttribute("customize");
+ if (stack == null)
+ {
+ stack = new Stack();
+ getSession().setAttribute("customize",stack);
+ }
+
+ if (p==null)
+ {
+ if (!stack.empty()) stack.pop();
+ }
+ else
+ {
+ stack.push(p);
+ }
+ }
+
+ /**
+ * Returns the portlet id which should be maximized for this request
+ *
+ * @return the portlet id being maximized or null
+ */
+ public int getMode()
+ {
+ return this.mode;
+ }
+
+ /**
+ * Sets the portlet id to maximize
+ *
+ * @param id the portlet id to maximize or null;
+ */
+ public void setMode(int mode)
+ {
+ this.mode=mode;
+ }
+
+ /**
+ * Sets the portlet id to maximize
+ *
+ * @param id the portlet id to maximize or null;
+ */
+ public void setMode(String mode)
+ {
+ if ("customize".equals(mode))
+ {
+ setMode(CUSTOMIZE);
+ }
+ else if ("maximize".equals(mode))
+ {
+ setMode(MAXIMIZE);
+ }
+ else
+ {
+ setMode(NORMAL);
+ setCustomized(null);
+ }
+ }
+
+ /**
+ * Returns the template path as requested from the parameters
+ */
+ public String getRequestedTemplate()
+ {
+ return this.template;
+ }
+
+ /**
+ * Sets the template path as requested from the parameters
+ */
+ public void setRequestedTemplate(String id)
+ {
+ this.template=id;
+ }
+
+ /**
* Returns the capability map for the user agent issuing this request
*
* @return a capability map objet
@@ -138,6 +243,8 @@
profile = null;
map = null;
pid = null;
+ mode=0;
+ template=null;
super.dispose();
}
1.3 +51 -1 jakarta-jetspeed/src/java/org/apache/jetspeed/services/rundata/JetspeedRunData.java
Index: JetspeedRunData.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/rundata/JetspeedRunData.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JetspeedRunData.java 2001/06/16 09:40:01 1.2
+++ JetspeedRunData.java 2001/07/22 19:04:32 1.3
@@ -54,6 +54,7 @@
package org.apache.jetspeed.services.rundata;
+import org.apache.jetspeed.portal.Portlet;
import org.apache.jetspeed.om.profile.Profile;
import org.apache.jetspeed.capability.CapabilityMap;
import org.apache.turbine.services.rundata.TurbineRunData;
@@ -66,11 +67,15 @@
* interface in future releases of Turbine</note>
*
* @author <a href="mailto:raphael@apache.org">Rapha�l Luta</a>
- * @version $Id: JetspeedRunData.java,v 1.2 2001/06/16 09:40:01 raphael Exp $
+ * @version $Id: JetspeedRunData.java,v 1.3 2001/07/22 19:04:32 raphael Exp $
*/
public interface JetspeedRunData extends TurbineRunData
{
+ public int NORMAL = 0;
+ public int CUSTOMIZE = 1;
+ public int MAXIMIZE = 2;
+
/**
* Returns the portlet id referenced in this request
*
@@ -84,6 +89,51 @@
* @param id the portlet id referenced in this request
*/
public void setPortlet(String id);
+
+ /**
+ * Returns the portlet id which should be customized for this request
+ *
+ * @return the portlet id being customized or null
+ */
+ public Portlet getCustomized();
+
+ /**
+ * Sets the portlet id to customize
+ *
+ * @param id the portlet id to customize or null;
+ */
+ public void setCustomized(Portlet p);
+
+ /**
+ * Returns the portlet id which should be maximized for this request
+ *
+ * @return the portlet id being maximized or null
+ */
+ public int getMode();
+
+ /**
+ * Sets the portlet id to maximize
+ *
+ * @param id the portlet id to maximize or null;
+ */
+ public void setMode(int mode);
+
+ /**
+ * Sets the portlet id to maximize
+ *
+ * @param id the portlet id to maximize or null;
+ */
+ public void setMode(String mode);
+
+ /**
+ * Returns the template path as requested from the parameters
+ */
+ public String getRequestedTemplate();
+
+ /**
+ * Sets the template path as requested from the parameters
+ */
+ public void setRequestedTemplate(String id);
/**
* Returns the capability map for the user agent issuing this request
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org