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 vk...@apache.org on 2008/11/10 10:58:05 UTC
svn commit: r712638 - in
/portals/jetspeed-2/applications/j2-admin/branches/JS2-871-refactoring/src/main/java/org/apache/jetspeed/portlets/entityeditor:
PortletEntityBrowserPortlet.java PortletEntityEditorPortlet.java
Author: vkumar
Date: Mon Nov 10 01:58:04 2008
New Revision: 712638
URL: http://svn.apache.org/viewvc?rev=712638&view=rev
Log:
Commenting functionality of PortletEntityEditor
Modified:
portals/jetspeed-2/applications/j2-admin/branches/JS2-871-refactoring/src/main/java/org/apache/jetspeed/portlets/entityeditor/PortletEntityBrowserPortlet.java
portals/jetspeed-2/applications/j2-admin/branches/JS2-871-refactoring/src/main/java/org/apache/jetspeed/portlets/entityeditor/PortletEntityEditorPortlet.java
Modified: portals/jetspeed-2/applications/j2-admin/branches/JS2-871-refactoring/src/main/java/org/apache/jetspeed/portlets/entityeditor/PortletEntityBrowserPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/branches/JS2-871-refactoring/src/main/java/org/apache/jetspeed/portlets/entityeditor/PortletEntityBrowserPortlet.java?rev=712638&r1=712637&r2=712638&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/branches/JS2-871-refactoring/src/main/java/org/apache/jetspeed/portlets/entityeditor/PortletEntityBrowserPortlet.java (original)
+++ portals/jetspeed-2/applications/j2-admin/branches/JS2-871-refactoring/src/main/java/org/apache/jetspeed/portlets/entityeditor/PortletEntityBrowserPortlet.java Mon Nov 10 01:58:04 2008
@@ -33,7 +33,6 @@
import org.apache.jetspeed.components.portletentity.PortletEntityNotStoredException;
import org.apache.jetspeed.components.portletregistry.PortletRegistry;
import org.apache.jetspeed.request.RequestContext;
-import org.apache.pluto.om.entity.PortletEntity;
import org.apache.pluto.om.portlet.PortletDefinition;
import org.apache.portals.bridges.velocity.GenericVelocityPortlet;
import org.apache.velocity.context.Context;
@@ -69,23 +68,23 @@
}
protected final void doCreate(ActionRequest request, ActionResponse response) throws PortletException
- {
+ {/*
try
{
PortletDefinition pd = getPortletDefintion(request);
String newId = request.getParameter("newEntityId");
- PortletEntity entity = null;
+ //PortletEntity entity = null;
if(newId != null)
{
- entity = entityAccess.newPortletEntityInstance(pd, newId);
+ // entity = entityAccess.newPortletEntityInstance(pd, newId);
}
else
{
- entity = entityAccess.newPortletEntityInstance(pd);
+ // entity = entityAccess.newPortletEntityInstance(pd);
}
- entityAccess.storePortletEntity(entity);
+ //entityAccess.storePortletEntity(entity);
}
catch (PortletEntityNotStoredException e)
{
@@ -94,7 +93,7 @@
catch (PortletException e)
{
throw new PortletException(e.getMessage(), e);
- }
+ }*/
}
protected final PortletDefinition getPortletDefintion(ActionRequest request) throws PortletException
Modified: portals/jetspeed-2/applications/j2-admin/branches/JS2-871-refactoring/src/main/java/org/apache/jetspeed/portlets/entityeditor/PortletEntityEditorPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/branches/JS2-871-refactoring/src/main/java/org/apache/jetspeed/portlets/entityeditor/PortletEntityEditorPortlet.java?rev=712638&r1=712637&r2=712638&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/branches/JS2-871-refactoring/src/main/java/org/apache/jetspeed/portlets/entityeditor/PortletEntityEditorPortlet.java (original)
+++ portals/jetspeed-2/applications/j2-admin/branches/JS2-871-refactoring/src/main/java/org/apache/jetspeed/portlets/entityeditor/PortletEntityEditorPortlet.java Mon Nov 10 01:58:04 2008
@@ -16,23 +16,22 @@
*/
package org.apache.jetspeed.portlets.entityeditor;
-import java.io.IOException;
-import java.util.Arrays;
+import java.io.IOException;
+import java.util.Arrays;
import java.util.List;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletException;
-
-import org.apache.jetspeed.CommonPortletServices;
-import org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent;
-import org.apache.jetspeed.components.portletentity.PortletEntityNotStoredException;
-import org.apache.jetspeed.om.common.preference.PreferenceComposite;
-import org.apache.jetspeed.om.common.preference.PreferenceSetComposite;
-import org.apache.pluto.om.entity.PortletEntity;
-import org.apache.portals.bridges.velocity.GenericVelocityPortlet;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+
+import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent;
+import org.apache.jetspeed.components.portletentity.PortletEntityNotStoredException;
+import org.apache.jetspeed.container.PortletEntity;
+import org.apache.jetspeed.om.portlet.Preference;
+import org.apache.portals.bridges.velocity.GenericVelocityPortlet;
public class PortletEntityEditorPortlet extends GenericVelocityPortlet
{
@@ -100,8 +99,8 @@
throw new PortletException("You must specfiy a value for the new preference "+newName);
}
- PreferenceSetComposite prefSet = (PreferenceSetComposite) entity.getPreferenceSet();
- prefSet.add(newName, Arrays.asList(newValues));
+ List<Preference> prefList = entity.getFragment().getPreferences();
+ //prefLis.add(newName, Arrays.asList(newValues));
try
{
entityAccess.storePortletEntity(entity);
@@ -118,8 +117,8 @@
String prefString= request.getParameter("selectedPref");
String newValue = request.getParameter("newPrefValue");
String prefName = prefString.split("::")[1];
- PreferenceComposite pref = (PreferenceComposite) entity.getPreferenceSet().get(prefName);
- pref.addValue(newValue);
+ //Preference pref = (Preference) entity.getPreferenceSet().get(prefName);
+ //pref.addValue(newValue);
}
protected final void doRemovePref(ActionRequest request, ActionResponse response) throws PortletException
@@ -127,7 +126,7 @@
PortletEntity entity = getPortletEntity(request);
String prefString= request.getParameter("selectedPref");
String prefName = prefString.split("::")[1];
- ((PreferenceSetComposite)entity.getPreferenceSet()).remove(prefName);
+ //((PreferenceSet)entity.getPreferenceSet()).remove(prefName);
}
@@ -143,10 +142,10 @@
String[] info = prefString.split("::");
String prefName = info[1];
int valueIndex = Integer.parseInt(info[2]);
- PreferenceComposite pref = (PreferenceComposite) entity.getPreferenceSet().get(prefName);
- List<String> values = pref.getValuesList();
- values.set(valueIndex, updatedValue);
- pref.setValues(values);
+ // Preference pref = (Preference) entity.getPreferenceSet().get(prefName);
+ //<String> values = pref.getValuesList();
+ // values.set(valueIndex, updatedValue);
+ //pref.setValues(values);
}
protected final void doRemoveValue(ActionRequest request, ActionResponse response) throws PortletException
@@ -156,10 +155,10 @@
String[] info = prefString.split("::");
String prefName = info[1];
int valueIndex = Integer.parseInt(info[2]);
- PreferenceComposite pref = (PreferenceComposite) entity.getPreferenceSet().get(prefName);
- List<String> values = pref.getValuesList();
- values.remove(valueIndex);
- pref.setValues(values);
+ //Preference pref = (Preference) entity.getPreferenceSet().get(prefName);
+ //List<String> values = pref.getValuesList();
+ // values.remove(valueIndex);
+ //pref.setValues(values);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org