portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jf...@apache.org
Subject svn commit: r506161 - in /portals/jetspeed-2/trunk/applications/j2-admin/src: java/org/apache/jetspeed/portlets/pam/ java/org/apache/jetspeed/portlets/pam/resources/ webapp/WEB-INF/view/
Date Sun, 11 Feb 2007 22:57:01 GMT
Author: jford
Date: Sun Feb 11 14:57:00 2007
New Revision: 506161

URL: http://svn.apache.org/viewvc?view=rev&rev=506161
Log:
Added ability to modify security constraint reference

Modified:
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationDetail.java
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources.properties
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ca.properties
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_en.properties
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_es.properties
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_hu.properties
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_it.properties
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ja.properties
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ko.properties
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ua.properties
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_zh.properties
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_zh_TW.properties
    portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/portlet-detail.jsp

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationDetail.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationDetail.java?view=diff&rev=506161&r1=506160&r2=506161
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationDetail.java
(original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationDetail.java
Sun Feb 11 14:57:00 2007
@@ -19,6 +19,7 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
+import java.util.List;
 import java.util.Locale;
 import java.util.StringTokenizer;
 
@@ -47,6 +48,7 @@
 import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
 import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
 import org.apache.jetspeed.om.common.preference.PreferenceComposite;
+import org.apache.jetspeed.page.PageManager;
 import org.apache.jetspeed.portlets.pam.beans.PortletApplicationBean;
 import org.apache.jetspeed.search.SearchEngine;
 import org.apache.pluto.om.common.DescriptionSet;
@@ -74,6 +76,7 @@
 
     private PortletContext context;
     private PortletRegistry registry;
+    private PageManager pageManager;
     private SearchEngine searchEngine;
     private LinkedHashMap paTabMap = new LinkedHashMap();
     private LinkedHashMap pdTabMap = new LinkedHashMap();
@@ -85,6 +88,7 @@
         context = getPortletContext();
         registry = (PortletRegistry)context.getAttribute(CommonPortletServices.CPS_REGISTRY_COMPONENT);
         searchEngine = (SearchEngine) context.getAttribute(CommonPortletServices.CPS_SEARCH_COMPONENT);
+        pageManager = (PageManager) context.getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT);
         if (null == registry)
         {
             throw new PortletException("Failed to find the Portlet Registry on portlet initialization");
@@ -117,9 +121,7 @@
         pdTabMap.put(tb_7.getId(), tb_7);
     }
     
-    public void doView(RenderRequest request, RenderResponse response)
-
-    throws PortletException, IOException
+    public void doView(RenderRequest request, RenderResponse response) throws PortletException,
IOException
 
     {
         response.setContentType("text/html");
@@ -156,6 +158,19 @@
                 {
                     selectedPortletTab = (TabBean) pdTabMap.values().iterator().next();
                 }
+                if(selectedPortletTab.getId().equals("pd_security")) {
+                    try
+                    {
+                        List securityContraintRefList = pageManager.getPageSecurity().getSecurityConstraintsDefs();
+                        request.setAttribute("securityContraintRefList", securityContraintRefList);
+                        request.setAttribute("currentSecurityConstraintRef", pdef.getJetspeedSecurityConstraint());
+                    }
+                    catch (Exception e)
+                    {
+                        throw new PortletException("Failed to retrieve security constraint
references.");
+                    }
+                    
+                }
                 request.setAttribute("selected_portlet_tab", selectedPortletTab);
             }
             
@@ -246,6 +261,9 @@
                     {
                         processContentType(actionRequest, actionResponse, pa, pdef, action);
                     }
+                    else if(action.endsWith("edit_security_constraint")) {
+                        processSecurityRef(actionRequest, actionResponse, pa, pdef, action);
+                    }
                     searchEngine.update(pdef);
                 }
                 catch (RegistryException e)
@@ -255,7 +273,7 @@
             }
         }
     }
-    
+
     private boolean isAppAction(String action)
     {
         return action.startsWith(PORTLET_APP_ACTION_PREFIX);
@@ -883,6 +901,29 @@
             }
         }
         registry.savePortletDefinition(portlet);
+    }
+    
+    private void processSecurityRef(ActionRequest actionRequest, ActionResponse actionResponse,
MutablePortletApplication pa, PortletDefinitionComposite pdef, String action) throws PortletException
+    {
+        String ref = actionRequest.getParameter("security-constraint-ref");
+        String currentRef = pdef.getJetspeedSecurityConstraint();
+        if(currentRef == null) {
+            currentRef = "";
+        }
+        if(!currentRef.equals(ref)) {
+            if(ref.length() == 0) {
+                ref = null;
+            }
+            pdef.setJetspeedSecurityConstraint(ref);
+            try
+            {
+                registry.savePortletDefinition(pdef);
+            }
+            catch (FailedToStorePortletDefinitionException e)
+            {
+                throw new PortletException("Failed to update portlet " + pdef.getName());
+            }
+        }
     }
     
     /**

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources.properties?view=diff&rev=506161&r1=506160&r2=506161
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources.properties
(original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources.properties
Sun Feb 11 14:57:00 2007
@@ -38,7 +38,7 @@
 pam.details.edit=Update Selected
 pam.details.remove=Remove Selected
 pam.details.add_user_attribute=Add User Attribute
-
+pam.details.update=Update
 ##Metadata view
 pam.details.add_metadata=Add MetaData
 
@@ -75,6 +75,8 @@
 pam.details.role_link.description=The id of the role link
 
 pam.details.add_security=Add Security
+
+pam.security_constraint=Security Constraint
 
 ##Content Type View
 pam.details.content_type=Content Type

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ca.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ca.properties?view=diff&rev=506161&r1=506160&r2=506161
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ca.properties
(original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ca.properties
Sun Feb 11 14:57:00 2007
@@ -40,6 +40,7 @@
 pam.details.edit=Actualitzar seleccionat
 pam.details.remove=Esborrar seleccionat
 pam.details.add_user_attribute=Afegir atribut d'usuari
+pam.details.update=Update
 
 ## Metadata view
 pam.details.add_metadata=Afegir metadades

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_en.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_en.properties?view=diff&rev=506161&r1=506160&r2=506161
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_en.properties
(original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_en.properties
Sun Feb 11 14:57:00 2007
@@ -40,7 +40,7 @@
 pam.details.edit=Update Selected
 pam.details.remove=Remove Selected
 pam.details.add_user_attribute=Add User Attribute
-
+pam.details.update=Update
 ##Metadata view
 pam.details.add_metadata=Add MetaData
 

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_es.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_es.properties?view=diff&rev=506161&r1=506160&r2=506161
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_es.properties
(original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_es.properties
Sun Feb 11 14:57:00 2007
@@ -40,7 +40,7 @@
 pam.details.edit=Actualizar seleccionado
 pam.details.remove=Borrar seleccionado
 pam.details.add_user_attribute=A\u00f1adir atributo de usuario
-
+pam.details.update=Update
 ##Metadata view
 pam.details.add_metadata=A\u00f1adir metadatos
 

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_hu.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_hu.properties?view=diff&rev=506161&r1=506160&r2=506161
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_hu.properties
(original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_hu.properties
Sun Feb 11 14:57:00 2007
@@ -40,7 +40,7 @@
 pam.details.edit=Kiv\u00e1lasztot m\u00f3dos\u00edt\u00e1sa
 pam.details.remove=Kiv\u00e1lasztott t\u00f6rl\u00e9se
 pam.details.add_user_attribute=Felhaszn\u00e1l\u00f3i tulajdons\u00e1g hozz\u00e1ad\u00e1sa
-
+pam.details.update=Update
 ##Metadata view
 pam.details.add_metadata=Metaadat hozz\u00e1ad\u00e1sa
 

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_it.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_it.properties?view=diff&rev=506161&r1=506160&r2=506161
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_it.properties
(original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_it.properties
Sun Feb 11 14:57:00 2007
@@ -40,7 +40,7 @@
 pam.details.edit=Aggiorna selezione
 pam.details.remove=Rimuovi Selezioni
 pam.details.add_user_attribute=Aggiungi attributi utente
-
+pam.details.update=Update
 ##Metadata view
 pam.details.add_metadata=Aggiungi MetaDati
 

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ja.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ja.properties?view=diff&rev=506161&r1=506160&r2=506161
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ja.properties
(original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ja.properties
Sun Feb 11 14:57:00 2007
@@ -38,7 +38,7 @@
 pam.details.edit=\u7DE8\u96C6
 pam.details.remove=\u9078\u629E\u3057\u305F\u3082\u306E\u3092\u524A\u9664
 pam.details.add_user_attribute=\u30E6\u30FC\u30B6\u30FC\u5C5E\u6027\u306E\u8FFD\u52A0
-
+pam.details.update=Update
 ##Metadata view
 pam.details.add_metadata=\u30E1\u30BF\u30C7\u30FC\u30BF\u306E\u8FFD\u52A0
 

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ko.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ko.properties?view=diff&rev=506161&r1=506160&r2=506161
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ko.properties
(original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ko.properties
Sun Feb 11 14:57:00 2007
@@ -40,7 +40,7 @@
 pam.details.edit=\uc120\ud0dd\ub41c \ud56d\ubaa9\ub4e4 \ubcc0\uacbd
 pam.details.remove=\uc120\ud0dd\ub41c \ud56d\ubaa9\ub4e4 \uc81c\uac70
 pam.details.add_user_attribute=\uc0ac\uc6a9\uc790 \uc18d\uc131 \ucd94\uac00
-
+pam.details.update=Update
 ##Metadata view
 pam.details.add_metadata=\uba54\ud0c0\ub370\uc774\ud130 \ucd94\uac00
 

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ua.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ua.properties?view=diff&rev=506161&r1=506160&r2=506161
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ua.properties
(original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ua.properties
Sun Feb 11 14:57:00 2007
@@ -40,7 +40,7 @@
 pam.details.edit=\u041e\u043d\u043e\u0432\u0438\u0442\u0438 \u0432\u0438\u0431\u0440\u0430\u043d\u0435
 pam.details.remove=\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u0432\u0438\u0431\u0440\u0430\u043d\u0435
 pam.details.add_user_attribute=\u0414\u043e\u0434\u0430\u0442\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442
\u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447\u0430
-
+pam.details.update=Update
 ##Metadata view
 pam.details.add_metadata=\u0414\u043e\u0434\u0430\u0442\u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u0456
 

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_zh.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_zh.properties?view=diff&rev=506161&r1=506160&r2=506161
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_zh.properties
(original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_zh.properties
Sun Feb 11 14:57:00 2007
@@ -40,7 +40,7 @@
 pam.details.edit=\u66f4\u65b0\u9009\u4e2d\u6761\u76ee
 pam.details.remove=\u5220\u9664\u9009\u4e2d\u6761\u76ee
 pam.details.add_user_attribute=\u6dfb\u52a0\u7528\u6237\u5c5e\u6027
-
+pam.details.update=Update
 ##Metadata view
 pam.details.add_metadata=\u6dfb\u52a0\u5143\u6570\u636e
 

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_zh_TW.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_zh_TW.properties?view=diff&rev=506161&r1=506160&r2=506161
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_zh_TW.properties
(original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_zh_TW.properties
Sun Feb 11 14:57:00 2007
@@ -40,7 +40,7 @@
 pam.details.edit=\u66f4\u65b0\u9078\u4e2d\u689d\u76ee
 pam.details.remove=\u522a\u9664\u9078\u4e2d\u689d\u76ee
 pam.details.add_user_attribute=\u6dfb\u52a0\u7528\u6236\u5c6c\u6027
-
+pam.details.update=Update
 ##Metadata view
 pam.details.add_metadata=\u6dfb\u52a0\u5143\u6578\u64da
 

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/portlet-detail.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/portlet-detail.jsp?view=diff&rev=506161&r1=506160&r2=506161
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/portlet-detail.jsp
(original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/portlet-detail.jsp
Sun Feb 11 14:57:00 2007
@@ -560,6 +560,29 @@
         </table>
         <input type="submit" value="<fmt:message key="pam.details.add_security"/>"
 class="portlet-form-button"/>
     </form>
+    
+    <br />
+    <portlet:actionURL var="edit_security_constraint" >
+    </portlet:actionURL>
+    <form action="<c:out value="${edit_security_constraint}"/>" method="post">
+      <input type="hidden" name="portlet_action" value="portlet.edit_security_constraint"/>
+      <table>
+        <tr>
+          <td class="portlet-section-alternate"><fmt:message key="pam.security_constraint"/></td>
+          <td>
+		    <select name="security-constraint-ref">
+			  <option value="" <c:if test="${empty currentSecurityConstraintRef}">selected</c:if>
>No Constraint</option>
+			  <c:forEach var="secRef" items="${securityContraintRefList}">
+			    <option value="<c:out value="${secRef.name}"/>"  <c:if test="${secRef.name
== currentSecurityConstraintRef}">selected</c:if>  ><c:out value="${secRef.name}"/></option>
+			  </c:forEach>
+			</select>
+		  </td>
+		  <td>
+		    <input type="submit" value="<fmt:message key="pam.details.update"/>" class="portlet-form-button"/>
+  	      </td>
+	    </tr>
+	  </table>
+    </form>
 
 </c:if>
 



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message