portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r348854 [4/16] - in /portals/jetspeed-2/trunk/applications/j2-admin: ./ src/java/org/apache/jetspeed/portlets/entityeditor/ src/java/org/apache/jetspeed/portlets/localeselector/ src/java/org/apache/jetspeed/portlets/localeselector/resources...
Date Fri, 25 Nov 2005 02:25:20 GMT
Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_it.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_it.properties?rev=348854&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_it.properties (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_it.properties Thu Nov 24 18:24:19 2005
@@ -0,0 +1,110 @@
+# Copyright 2004 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#    Please contact me if you have any questions or suggestion : desmax74@yahoo.it
+#
+#    Italian version by Dessì Massimiliano  <a href="desmax74@yahoo.it.it">desmax74@yahoo.it</a>.
+#    Vers 0.1 jetspeed 2.0   03/04/2005
+
+pam.details.name=Nome
+pam.details.name.description=Il nome di questo item
+
+pam.details.description=Descrizione
+pam.details.description.description=Una frase descrittiva per questo item
+
+pam.details.value=Valore
+pam.details.value.description=Il valore per questo item
+
+pam.details.locale=Locale
+pam.details.locale.description=Un country code valido di due lettere 
+
+pam.details.version=Versione
+pam.details.type=Tipo
+pam.details.type.webapp=WEBAPP
+pam.details.type.local=Local
+pam.details.id=ID
+pam.details.services=Servizi
+
+pam.details.choose_portlet=Scegli una Portlet
+pam.details.edit=Aggiorna selezione
+pam.details.remove=Rimuovi Selezioni
+pam.details.add_user_attribute=Aggiungi attributi utente
+
+##Metadata view
+pam.details.add_metadata=Aggiungi MetaDati
+
+##Portlet view
+pam.details.expiration_cache=Scadenza Cache
+pam.details.unique_name=Nome unico
+pam.details.preference_validator=Preferenze Validatore
+pam.details.class_name=Class Name
+pam.details.display_name=Nome visualizzato
+pam.details.display_name.description=Nome da visualizzare per questa Portlet
+pam.details.edit_display_name=Aggiorna il/i nomi visualizzati
+pam.details.add_display_name=Aggiungi Nome Visualizzato
+
+##Preference view
+pam.details.add_preference=Aggiungi Preferenza
+
+##Language view
+pam.details.title=Titolo
+pam.details.short_title=Titolo breve
+pam.details.keyword=Keyword
+pam.details.title.description=Titolo da mostrare sulla barra del titolo
+pam.details.short_title.description=Un breve titolo descrittivo
+pam.details.keyword.description=Lista di keywords delimitati da virgola
+pam.details.add_language=aggiungi Lingua
+
+##Parameter View
+pam.details.add_parameter=Aggiungi Parametro
+
+##Security View
+pam.details.role_name=Nome Ruolo
+pam.details.role_name.description=Il nome del ruolo
+
+pam.details.role_link=Link ruolo
+pam.details.role_link.description=Id del link ruolo
+
+pam.details.add_security=Aggiungi Security
+
+##Content Type View
+pam.details.content_type=Content Type
+pam.details.content_type.description=MimeType come text/html.  I caratteri jolly sono permessi.
+
+pam.details.modes=Modalita'
+pam.details.portlet_mode=Modalita' delle Portlet 
+pam.details.portlet_mode.view=View
+pam.details.portlet_mode.edit=Edit
+pam.details.portlet_mode.help=Help
+pam.details.portlet_mode.description=Modalita' Standard supportate dalle portlet
+
+pam.details.custom_mode=Modalita' Custom
+pam.details.custom_modes.description=Modalita' Custom supportate dalle portlet
+
+pam.details.add_content_type=Aggiungi Content Type
+
+##Portlet Application Tabs
+pam.details.tabs.pa_details=Dettagli
+pam.details.tabs.pa_metadata=MetaDati
+pam.details.tabs.pa_portlets=Portlet
+pam.details.tabs.pa_user_attribtues=Attributi utente
+
+##Portlet Definition Tabs
+pam.details.tabs.pd_details=Dettagli
+pam.details.tabs.pd_metadata=MetaDati
+pam.details.tabs.pd_preferences=Preferenze
+pam.details.tabs.pd_languages=Lingue
+pam.details.tabs.pd_parameters=Parametri
+pam.details.tabs.pd_security=Security
+pam.details.tabs.pd_content_type=Content Type
\ No newline at end of file

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ja.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ja.properties?rev=348854&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ja.properties (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_ja.properties Thu Nov 24 18:24:19 2005
@@ -0,0 +1,111 @@
+# Copyright 2004 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# $Id: PAMResources_ja.properties 348264 2005-11-22 22:06:45Z taylor $
+#
+
+pam.details.name=\u540D\u524D
+pam.details.name.description=\u3053\u306E\u9805\u76EE\u306E\u540D\u524D
+
+pam.details.description=\u8AAC\u660E
+pam.details.description.description=\u3053\u306E\u9805\u76EE\u306B\u95A2\u3059\u308B\u8AAC\u660E\u306E\u8A9E\u53E5
+
+pam.details.value=\u5024
+pam.details.value.description=\u3053\u306E\u9805\u76EE\u306E\u5024
+
+pam.details.locale=\u30ED\u30B1\u30FC\u30EB
+pam.details.locale.description=\u6709\u52B9\u306A\uFF12\u6587\u5B57\u306E\u56FD\u30B3\u30FC\u30C9
+
+pam.details.version=\u30D0\u30FC\u30B8\u30E7\u30F3
+pam.details.type=\u30BF\u30A4\u30D7
+pam.details.type.webapp=WEBAPP
+pam.details.type.local=\u30ED\u30FC\u30AB\u30EB
+pam.details.id=ID
+pam.details.services=\u30B5\u30FC\u30D3\u30B9
+
+pam.details.choose_portlet=\u30DD\u30FC\u30C8\u30EC\u30C3\u30C8\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002
+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
+
+##Metadata view
+pam.details.add_metadata=\u30E1\u30BF\u30C7\u30FC\u30BF\u306E\u8FFD\u52A0
+
+##Portlet view
+pam.details.expiration_cache=\u30AD\u30E3\u30C3\u30B7\u30E5\u306E\u671F\u9650
+pam.details.unique_name=\u4E00\u610F\u306A\u540D\u524D
+pam.details.preference_validator=\u30D7\u30EA\u30D5\u30A1\u30EC\u30F3\u30B9\u30D0\u30EA\u30C7\u30FC\u30BF
+pam.details.class_name=\u30AF\u30E9\u30B9\u540D
+
+pam.details.display_name=Display Name
+pam.details.display_name.description=Name that will Display for this Portlet
+pam.details.edit_display_name=Edit Display Name(s)
+pam.details.add_display_name=Add Display Name
+
+##Preference view
+pam.details.add_preference=\u30D7\u30EA\u30D5\u30A1\u30EC\u30F3\u30B9\u306E\u8FFD\u52A0
+
+##Language view
+pam.details.title=\u30BF\u30A4\u30C8\u30EB
+pam.details.short_title=\u77ED\u3044\u30BF\u30A4\u30C8\u30EB
+pam.details.keyword=\u30AD\u30FC\u30EF\u30FC\u30C9
+pam.details.title.description=\u30BF\u30A4\u30C8\u30EB\u30D0\u30FC\u306B\u8868\u793A\u3055\u308C\u308B\u30BF\u30A4\u30C8\u30EB
+pam.details.short_title.description=\u77ED\u3044\u8AAC\u660E\u7684\u306A\u30BF\u30A4\u30C8\u30EB
+pam.details.keyword.description=\u30AD\u30FC\u30EF\u30FC\u30C9\u306E\u30B3\u30F3\u30DE\u533A\u5207\u308A\u306E\u30EA\u30B9\u30C8
+pam.details.add_language=\u8A00\u8A9E\u306E\u8FFD\u52A0
+
+##Parameter View
+pam.details.add_parameter=\u30D1\u30E9\u30E1\u30FC\u30BF\u306E\u8FFD\u52A0
+
+##Security View
+pam.details.role_name=\u30ED\u30FC\u30EB\u540D
+pam.details.role_name.description=\u30ED\u30FC\u30EB\u306E\u540D\u524D
+
+pam.details.role_link=\u30ED\u30FC\u30EB\u30EA\u30F3\u30AF
+pam.details.role_link.description=\u30ED\u30FC\u30EB\u30EA\u30F3\u30AF\u306EID
+
+pam.details.add_security=\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u8FFD\u52A0
+
+##Content Type View
+pam.details.content_type=\u30B3\u30F3\u30C6\u30F3\u30C4\u30BF\u30A4\u30D7
+pam.details.content_type.description=text/html\u306A\u3069\u306EMIMETYPE(\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u304C\u5229\u7528\u53EF)
+
+pam.details.modes=\u30E2\u30FC\u30C9
+pam.details.portlet_mode=\u30DD\u30FC\u30C8\u30EC\u30C3\u30C8\u30E2\u30FC\u30C9
+pam.details.portlet_mode.view=\u8868\u793A
+pam.details.portlet_mode.edit=\u7DE8\u96C6
+pam.details.portlet_mode.help=\u30D8\u30EB\u30D7
+pam.details.portlet_mode.description=\u30DD\u30FC\u30C8\u30EC\u30C3\u30C8\u304C\u30B5\u30DD\u30FC\u30C8\u3059\u308B\u6A19\u6E96\u306E\u30DD\u30FC\u30C8\u30EC\u30C3\u30C8\u30E2\u30FC\u30C9
+
+pam.details.custom_mode=\u30AB\u30B9\u30BF\u30E0\u30E2\u30FC\u30C9
+pam.details.custom_modes.description=\u30DD\u30FC\u30C8\u30EC\u30C3\u30C8\u304C\u30B5\u30DD\u30FC\u30C8\u3059\u308B\u30AB\u30B9\u30BF\u30E0\u30E2\u30FC\u30C9
+
+pam.details.add_content_type=\u30B3\u30F3\u30C6\u30F3\u30C4\u30BF\u30A4\u30D7\u306E\u8FFD\u52A0
+
+##Portlet Application Tabs
+pam.details.tabs.pa_details=\u8A73\u7D30
+pam.details.tabs.pa_metadata=\u30E1\u30BF\u30C7\u30FC\u30BF
+pam.details.tabs.pa_portlets=\u30DD\u30FC\u30C8\u30EC\u30C3\u30C8
+pam.details.tabs.pa_user_attribtues=\u30E6\u30FC\u30B6\u30FC\u5C5E\u6027
+
+##Portlet Definition Tabs
+pam.details.tabs.pd_details=\u8A73\u7D30
+pam.details.tabs.pd_metadata=\u30E1\u30BF\u30C7\u30FC\u30BF
+pam.details.tabs.pd_preferences=\u30D7\u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
+pam.details.tabs.pd_languages=\u8A00\u8A9E
+pam.details.tabs.pd_parameters=\u30D1\u30E9\u30E1\u30FC\u30BF
+pam.details.tabs.pd_security=\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3
+pam.details.tabs.pd_content_type=\u30B3\u30F3\u30C6\u30F3\u30C4\u30BF\u30A4\u30D7
+
+

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_zh.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_zh.properties?rev=348854&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_zh.properties (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/pam/resources/PAMResources_zh.properties Thu Nov 24 18:24:19 2005
@@ -0,0 +1,110 @@
+# Copyright 2004 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# $Id: PAMResources_en.properties 188342 2005-02-20 23:00:25Z shinsuke $
+#
+#  LOCALIZATION MAINTAINER:
+#  Jian Liao <jian.liao@gmail.com>
+
+pam.details.name=\u540d\u79f0
+pam.details.name.description=\u6761\u76ee\u7684\u540d\u79f0
+
+pam.details.description=\u63cf\u8ff0
+pam.details.description.description=\u6761\u76ee\u7b80\u5355\u63cf\u8ff0
+
+pam.details.value=\u503c
+pam.details.value.description=\u6761\u76ee\u7684\u503c
+
+pam.details.locale=\u533a\u57df
+pam.details.locale.description=\u4e24\u4e2a\u5b57\u6bcd\u7684\u56fd\u522b\u4ee3\u53f7
+
+pam.details.version=\u7248\u672c
+pam.details.type=\u7c7b\u578b
+pam.details.type.webapp=WEBAPP
+pam.details.type.local=\u672c\u5730
+pam.details.id=ID
+pam.details.services=\u670d\u52a1
+
+pam.details.choose_portlet=\u8bf7\u9009\u62e9\u4e00\u4e2aPortlet
+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
+
+##Metadata view
+pam.details.add_metadata=\u6dfb\u52a0\u5143\u6570\u636e
+
+##Portlet view
+pam.details.expiration_cache=\u7f13\u5b58\u8fc7\u671f
+pam.details.unique_name=\u552f\u4e00\u540d\u79f0
+pam.details.preference_validator=\u5c5e\u6027\u8bbe\u7f6e\u6821\u9a8c\u5668
+pam.details.class_name=\u7c7b\u540d
+pam.details.display_name=\u663e\u793a\u540d
+pam.details.display_name.description=Portlet\u5728\u663e\u793a\u65f6\u7684\u540d\u79f0
+pam.details.edit_display_name=\u66f4\u65b0\u663e\u793a\u540d
+pam.details.add_display_name=\u6dfb\u52a0\u663e\u793a\u540d
+
+##Preference view
+pam.details.add_preference=\u6dfb\u52a0\u5c5e\u6027\u504f\u597d
+
+##Language view
+pam.details.title=\u6807\u9898
+pam.details.short_title=\u77ed\u6807\u9898
+pam.details.keyword=\u5173\u952e\u5b57
+pam.details.title.description=\u663e\u793a\u5728\u6807\u9898\u680f\u7684\u6807\u9898
+pam.details.short_title.description=\u77ed\u63cf\u8ff0\u6807\u9898
+pam.details.keyword.description=\u7528\u9017\u53f7\u5206\u9694\u5173\u952e\u5b57
+pam.details.add_language=\u6dfb\u52a0\u8bed\u8a00
+
+##Parameter View
+pam.details.add_parameter=\u6dfb\u52a0\u53c2\u6570
+
+##Security View
+pam.details.role_name=\u89d2\u8272\u540d
+pam.details.role_name.description=\u89d2\u8272\u7684\u540d\u79f0
+
+pam.details.role_link=\u89d2\u8272\u94fe\u63a5
+pam.details.role_link.description=\u89d2\u8272\u94fe\u63a5\u7684\u6807\u8bc6
+
+pam.details.add_security=\u6dfb\u52a0\u5b89\u5168\u5c5e\u6027
+
+##Content Type View
+pam.details.content_type=\u5185\u5bb9\u7c7b\u578b
+pam.details.content_type.description=\u5982text/html\u8fd9\u6837\u7684MimeType. \u53ef\u4ee5\u4f7f\u7528\u901a\u914d\u7b26.
+
+pam.details.modes=\u6a21\u5f0f
+pam.details.portlet_mode=Portlet \u6a21\u5f0f
+pam.details.portlet_mode.view=\u6d4f\u89c8
+pam.details.portlet_mode.edit=\u7f16\u8f91
+pam.details.portlet_mode.help=\u5e2e\u52a9
+pam.details.portlet_mode.description=Portlet\u6240\u652f\u6301\u7684\u6807\u51c6Portlet\u6a21\u5f0f
+
+pam.details.custom_mode=\u81ea\u5b9a\u4e49\u6a21\u5f0f
+pam.details.custom_modes.description=Portlet\u6240\u652f\u6301\u7684\u81ea\u5b9a\u4e49\u6a21\u5f0f
+
+pam.details.add_content_type=\u6dfb\u52a0\u5185\u5bb9\u7c7b\u578b
+
+##Portlet Application Tabs
+pam.details.tabs.pa_details=\u8be6\u7ec6
+pam.details.tabs.pa_metadata=\u5143\u6570\u636e
+pam.details.tabs.pa_portlets=Portlets
+pam.details.tabs.pa_user_attribtues=\u7528\u6237\u5c5e\u6027
+
+##Portlet Definition Tabs
+pam.details.tabs.pd_details=\u8be6\u7ec6
+pam.details.tabs.pd_metadata=\u5143\u6570\u636e
+pam.details.tabs.pd_preferences=\u5c5e\u6027\u504f\u597d
+pam.details.tabs.pd_languages=\u8bed\u8a00
+pam.details.tabs.pd_parameters=\u53c2\u6570
+pam.details.tabs.pd_security=\u5b89\u5168\u5c5e\u6027
+pam.details.tabs.pd_content_type=\u5185\u5bb9\u7c7b\u578b

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/ProfileCriterionForm.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/ProfileCriterionForm.java?rev=348854&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/ProfileCriterionForm.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/ProfileCriterionForm.java Thu Nov 24 18:24:19 2005
@@ -0,0 +1,288 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.portlets.profiler;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import javax.faces.model.SelectItem;
+
+import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.profiler.Profiler;
+import org.apache.jetspeed.profiler.rules.ProfilingRule;
+import org.apache.jetspeed.profiler.rules.RuleCriterion;
+
+
+/**
+ * Criterion state.
+ *
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: ProfileCriterionForm.java 348264 2005-11-22 22:06:45Z taylor $
+ */
+public class ProfileCriterionForm implements Serializable
+{
+    private boolean isNew = false;
+    private transient Profiler profiler = null;
+    private transient RuleCriterion criterion = null;
+    private transient ProfilingRule rule = null;
+    
+    private static final String FALLBACK_CONTINUE = "Continue";
+    private static final String FALLBACK_STOP = "Stop";
+    private static final String FALLBACK_LOOP = "Loop";
+    
+    private transient SelectItem[] resolvers =
+    {
+            new SelectItem("request"),
+            new SelectItem("session"),
+            new SelectItem("request.session"),
+            new SelectItem("hard.coded"),
+            new SelectItem("group.role.user"),
+            new SelectItem("user"),
+            new SelectItem("group"),
+            new SelectItem("role"),
+            new SelectItem("mediatype"),
+            new SelectItem("country"),
+            new SelectItem("language"),
+            new SelectItem("roles"),
+            new SelectItem("path"),
+            new SelectItem("page"),
+            new SelectItem("path.session"),
+            new SelectItem("user.attribute"),
+            new SelectItem("navigation")
+    };
+
+    private transient SelectItem[] fallbackTypes =
+    {
+            new SelectItem(FALLBACK_CONTINUE),
+            new SelectItem(FALLBACK_LOOP),
+            new SelectItem(FALLBACK_STOP)
+    };
+    
+    public ProfileCriterionForm()
+    {
+    }
+    
+    public boolean getUpdating()
+    {
+        return !isNew;
+    }
+
+    public SelectItem[] getResolvers()
+    {
+        return resolvers;
+    }
+
+    public SelectItem[] getFallbackTypes()
+    {
+        return fallbackTypes;
+    }
+    
+    public void listen(ActionEvent event)
+    {        
+        Map appMap = (Map)FacesContext.getCurrentInstance().getExternalContext().getApplicationMap();
+        profiler = (Profiler)appMap.get(CommonPortletServices.CPS_PROFILER_COMPONENT);
+        Map params = (Map)FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+        String selectedRule = (String)params.get("selectedRule");
+        
+        if (selectedRule != null && profiler != null)
+        {
+            rule = profiler.getRule(selectedRule);
+            if (rule != null)
+            {
+                String selected = (String)params.get("selectedCriterion");
+                if (selected == null || selected.length() == 0)
+                {
+                    isNew = true;
+                    try
+                    {
+                        Class defaultClass = profiler.getClass().getClassLoader().loadClass("org.apache.jetspeed.profiler.rules.impl.RuleCriterionImpl");
+                        this.criterion = (RuleCriterion)defaultClass.newInstance();
+                    }
+                    catch (Exception e)
+                    {
+                        System.out.println("Failed to CREATE NEW: rule = " + rule.getId());
+                        // TODO: forward to an error page            
+                    }
+                }
+                else
+                {
+                    Iterator it = rule.getRuleCriteria().iterator();
+                    while (it.hasNext())
+                    {
+                        RuleCriterion c = (RuleCriterion)it.next();
+                        if (c.getName().equals(selected))
+                        {
+                            criterion = c;
+                            isNew = false;
+                            break;
+                        }                    
+                    }
+                }                
+            }            
+        }
+    }
+
+    public String getName()
+    {        
+        if (criterion == null)
+        {
+            return "{empty}";
+        }
+        return criterion.getName();
+    }
+
+    public void setName(String name)
+    {
+        if (criterion != null)
+        {
+            this.criterion.setName(name);
+        }        
+    }
+
+    public String getValue()
+    {        
+        if (criterion == null)
+        {
+            return "{empty}";
+        }
+        return criterion.getValue();
+    }
+
+    public void setValue(String value)
+    {
+        if (criterion != null)
+        {
+            this.criterion.setValue(value);
+        }        
+    }
+    
+    public String getResolver()
+    {        
+        if (criterion == null)
+        {
+            return "{empty}";
+        }
+        return criterion.getType();
+    }
+
+    public void setResolver(String resolver)
+    {
+        if (criterion != null)
+        {
+            this.criterion.setType(resolver);
+        }        
+    }
+
+    public int getFallbackOrder()
+    {        
+        if (criterion == null)
+        {
+            return 0;
+        }
+        return criterion.getFallbackOrder();
+    }
+
+    public void setFallbackOrder(int order)
+    {
+        if (criterion != null)
+        {
+            this.criterion.setFallbackOrder(order);
+        }        
+    }
+
+    public String getFallbackType()
+    {        
+        if (criterion == null)
+        {
+            return FALLBACK_CONTINUE;
+        }
+        int type = criterion.getFallbackType();
+        switch (type)
+        {
+        case RuleCriterion.FALLBACK_CONTINUE:
+            return FALLBACK_CONTINUE;
+        case RuleCriterion.FALLBACK_LOOP:
+            return FALLBACK_LOOP;
+        default:
+            return FALLBACK_STOP;
+        }
+    }
+    
+    public void setFallbackType(String type)
+    {
+        if (criterion != null)
+        {
+            if (type.equals(FALLBACK_CONTINUE))
+            {
+                this.criterion.setFallbackType(RuleCriterion.FALLBACK_CONTINUE);                    
+            }
+            else if (type.equals(FALLBACK_LOOP))
+            {
+                this.criterion.setFallbackType(RuleCriterion.FALLBACK_LOOP);                    
+            }
+            else
+            {
+                this.criterion.setFallbackType(RuleCriterion.FALLBACK_STOP);                                    
+            }            
+        }        
+    }
+    
+    // actions
+    public String saveCriterion()
+    {
+        try
+        {
+            if (isNew)
+            {                
+                criterion.setRuleId(rule.getId());
+                rule.getRuleCriteria().add(criterion);
+            }
+           profiler.storeProfilingRule(rule);
+           isNew = false;
+        }
+        catch (Exception e)
+        {
+            // TODO: handle errors better
+            System.out.println("Failed to UPDATE: rule = " + rule.getId());
+            return "gotoCriterionForm";
+        }
+        return "returnFromCriterion";        
+    }
+
+    public String removeCriterion()
+    {
+        try
+        {
+            if (!isNew)
+            {                
+                rule.getRuleCriteria().remove(criterion);
+                profiler.storeProfilingRule(rule);
+                isNew = true;
+            }
+        }
+        catch (Exception e)
+        {
+            // TODO: handle errors better
+            System.out.println("Failed to UPDATE: rule = " + rule.getId());
+            return "gotoCriterionForm";
+        }
+        return "returnFromCriterion";        
+    }
+    
+}

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/ProfileRuleForm.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/ProfileRuleForm.java?rev=348854&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/ProfileRuleForm.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/ProfileRuleForm.java Thu Nov 24 18:24:19 2005
@@ -0,0 +1,181 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.portlets.profiler;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import javax.faces.model.SelectItem;
+
+import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.profiler.Profiler;
+import org.apache.jetspeed.profiler.ProfilerException;
+import org.apache.jetspeed.profiler.rules.ProfilingRule;
+
+/**
+ * Profile state.
+ *
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: ProfileRuleForm.java 348264 2005-11-22 22:06:45Z taylor $
+ */
+public class ProfileRuleForm
+       implements Serializable
+{
+    private boolean isNew = false;
+    private transient Profiler profiler = null;
+    private transient ProfilingRule rule = null;
+    private transient SelectItem[] classnames =
+    {
+            new SelectItem("org.apache.jetspeed.profiler.rules.impl.StandardProfilingRule"),
+            new SelectItem("org.apache.jetspeed.profiler.rules.impl.RoleFallbackProfilingRule")            
+    };
+    
+    public ProfileRuleForm()
+    {
+    }
+    
+    public boolean getUpdating()
+    {
+        return !isNew;
+    }
+    
+    public void listen(ActionEvent event)
+    {        
+        Map appMap = (Map)FacesContext.getCurrentInstance().getExternalContext().getApplicationMap();
+        profiler = (Profiler)appMap.get(CommonPortletServices.CPS_PROFILER_COMPONENT);
+        Map params = (Map)FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+        String selected = (String)params.get("selectedRule");
+        if (selected != null && profiler != null)
+        {
+            rule = profiler.getRule(selected);
+            isNew = false;
+        }
+    }
+    
+    public SelectItem[] getClassnames()
+    {
+        return classnames;
+    }
+    
+    public String getTitle()
+    {        
+        if (rule == null)
+        {
+            return "{empty}";
+        }
+        return rule.getTitle();
+    }
+
+    public void setTitle(String title)
+    {
+        if (rule != null)
+        {
+            this.rule.setTitle(title);
+        }        
+    }
+    
+    public String getClassname()
+    {        
+        if (rule == null)
+        {
+            return "{empty}";
+        }
+        return rule.getClassname();
+    }
+
+    public void setClassname(String classname)
+    {
+        if (rule != null)
+        {
+            this.rule.setClassname(classname);
+        }        
+    }
+    
+    public String getId()
+    {
+        if (rule == null)
+        {
+            return "{empty}";
+        }        
+        return rule.getId();
+    }
+    
+    public void setId(String id)
+    {
+        if (rule != null)
+        {
+            this.rule.setId(id);
+        }        
+    }
+    
+    // actions
+    
+    public String saveProfile()
+    {
+        try
+        {
+            profiler.storeProfilingRule(this.rule);
+            isNew = false;
+        }
+        catch (ProfilerException e)
+        {
+            System.out.println("Failed to UPDATE: rule = " + rule.getId());
+            // TODO: forward to an error page
+        }
+        return null;
+    }
+
+    public String removeProfile()
+    {
+        try
+        {
+            profiler.deleteProfilingRule(rule);
+        }
+        catch (ProfilerException e)
+        {
+            System.out.println("Failed to REMOVE: rule = " + rule.getId());
+            // TODO: forward to an error page
+        }
+        return null;
+    }
+
+    public String createNewProfile()
+    {
+        try
+        {
+            Class defaultClass = profiler.getClass().getClassLoader().loadClass("org.apache.jetspeed.profiler.rules.impl.StandardProfilingRule");
+            this.rule = (ProfilingRule)defaultClass.newInstance();
+        }
+        catch (Exception e)
+        {
+            System.out.println("Failed to CREATE NEW: rule = " + rule.getId());
+            // TODO: forward to an error page            
+        }
+        this.setId("");
+        this.setTitle("");
+        this.setClassname("org.apache.jetspeed.profiler.rules.impl.StandardProfilingRule");
+        isNew = true;
+        return null;
+    }
+    
+    public Collection getCriteria()
+    {
+        return rule.getRuleCriteria();        
+    }
+}
\ No newline at end of file

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/ProfileRulesExtent.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/ProfileRulesExtent.java?rev=348854&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/ProfileRulesExtent.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/ProfileRulesExtent.java Thu Nov 24 18:24:19 2005
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.portlets.profiler;
+
+// import java.io.Serializable;
+import java.util.Collection;
+//import java.util.LinkedList;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
+import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.profiler.Profiler;
+
+/**
+ * Profile Rules Extent
+ *
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: ProfileRulesExtent.java 348264 2005-11-22 22:06:45Z taylor $
+ */
+public class ProfileRulesExtent // implements Serializable
+{
+    
+    public Collection getExtent()
+    {
+        Map appMap = (Map)FacesContext.getCurrentInstance().getExternalContext().getApplicationMap();
+        Profiler profiler = (Profiler)appMap.get(CommonPortletServices.CPS_PROFILER_COMPONENT);
+        return profiler.getRules(); // TODO: optimize with cache
+    }
+}

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/ProfilerAdminPortlet.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/ProfilerAdminPortlet.java?rev=348854&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/ProfilerAdminPortlet.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/ProfilerAdminPortlet.java Thu Nov 24 18:24:19 2005
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.portlets.profiler;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+
+import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.profiler.Profiler;
+import org.apache.portals.bridges.jsf.FacesPortlet;
+
+
+/**
+ * This portlet is a browser over all folders and documents in the system.
+ *
+ * @author <a href="mailto:jford@apache.com">Jeremy Ford</a>
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: ProfilerAdminPortlet.java 348264 2005-11-22 22:06:45Z taylor $
+ */
+public class ProfilerAdminPortlet extends FacesPortlet
+{
+    Profiler profiler;
+    
+    public void init(PortletConfig config) throws PortletException
+    {
+        super.init(config);
+        profiler = (Profiler) getPortletContext().getAttribute(
+                CommonPortletServices.CPS_PROFILER_COMPONENT);
+        if (null == profiler)
+        {
+            throw new PortletException("Failed to find the Profiler on portlet initialization");
+        }
+    }        
+    
+}

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources.properties?rev=348854&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources.properties (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources.properties Thu Nov 24 18:24:19 2005
@@ -0,0 +1,32 @@
+# Copyright 2004 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# $Id: ProfilerResources.properties 348264 2005-11-22 22:06:45Z taylor $
+#
+profiler.title.rules=Rules
+profiler.rule.title=Rule Title
+profiler.rule.id=Rule Id
+profiler.rule.class=Rule Class
+profiler.rule.save=Save
+profiler.rule.new=New
+profiler.rule.cancel=Cancel
+profiler.rule.remove=Remove
+criteria.title=Rule Criteria
+criteria.new=New Criteria
+criteria.remove=Remove Criteria
+criterion.name=Name
+criterion.value=Value
+criterion.fallback.order=Order
+criterion.resolver=Resolver Type
+criterion.fallback.type=Fallback
\ No newline at end of file

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_en.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_en.properties?rev=348854&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_en.properties (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_en.properties Thu Nov 24 18:24:19 2005
@@ -0,0 +1,32 @@
+# Copyright 2004 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# $Id: ProfilerResources.properties 187783 2004-10-21 01:45:50Z taylor $
+#
+profiler.title.rules=Rules
+profiler.rule.title=Rule Title
+profiler.rule.id=Rule Id
+profiler.rule.class=Rule Class
+profiler.rule.save=Save
+profiler.rule.new=New
+profiler.rule.cancel=Cancel
+profiler.rule.remove=Remove
+criteria.title=Rule Criteria
+criteria.new=New Criteria
+criteria.remove=Remove Criteria
+criterion.name=Name
+criterion.value=Value
+criterion.fallback.order=Order
+criterion.resolver=Resolver Type
+criterion.fallback.type=Fallback
\ No newline at end of file

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_hu.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_hu.properties?rev=348854&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_hu.properties (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_hu.properties Thu Nov 24 18:24:19 2005
@@ -0,0 +1,32 @@
+# Copyright 2004 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# $Id: ProfilerResources.properties 187783 2004-10-21 01:45:50Z taylor $
+#
+profiler.title.rules=Szab\u00e1ly
+profiler.rule.title=Szab\u00e1ly c\u00edm
+profiler.rule.id=Szab\u00e1ly azonos\u00edt\u00f3
+profiler.rule.class=Szab\u00e1ly oszt\u00e1ly
+profiler.rule.save=Ment\u00e9s
+profiler.rule.new=\u00daj
+profiler.rule.cancel=M\u00e9gse
+profiler.rule.remove=Elt\u00e1vol\u00edt\u00e1s
+criteria.title=Szab\u00e1ly ism\u00e9rv
+criteria.new=\u00daj ism\u00e9rv
+criteria.remove=Ism\u00e9rv elt\u00e1vol\u00edt\u00e1sa
+criterion.name=N\u00e9v
+criterion.value=\u00c9rt\u00e9k
+criterion.fallback.order=Sorrend
+criterion.resolver=D\u00f6nt\u00e9s tipusa
+criterion.fallback.type=Visszaes\u00e9s
\ No newline at end of file

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_ja.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_ja.properties?rev=348854&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_ja.properties (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_ja.properties Thu Nov 24 18:24:19 2005
@@ -0,0 +1,32 @@
+# Copyright 2004 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# $Id: ProfilerResources.properties 187783 2004-10-21 01:45:50Z taylor $
+#
+profiler.title.rules=\u30eb\u30fc\u30eb
+profiler.rule.title=\u30eb\u30fc\u30eb\u306e\u30bf\u30a4\u30c8\u30eb
+profiler.rule.id=\u30eb\u30fc\u30ebID
+profiler.rule.class=\u30eb\u30fc\u30eb\u306e\u30af\u30e9\u30b9
+profiler.rule.save=\u4fdd\u5b58
+profiler.rule.new=\u65b0\u898f
+profiler.rule.cancel=\u53d6\u308a\u6d88\u3057
+profiler.rule.remove=\u524a\u9664
+criteria.title=\u30eb\u30fc\u30eb\u306e\u57fa\u6e96
+criteria.new=\u57fa\u6e96\u306e\u65b0\u898f\u4f5c\u6210
+criteria.remove=\u57fa\u6e96\u306e\u524a\u9664
+criterion.name=\u540d\u524d
+criterion.value=\u5024
+criterion.fallback.order=\u9806\u756a
+criterion.resolver=\u30ea\u30be\u30eb\u30d0\u30bf\u30a4\u30d7
+criterion.fallback.type=\u30d5\u30a9\u30fc\u30eb\u30d0\u30c3\u30af

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_zh.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_zh.properties?rev=348854&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_zh.properties (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_zh.properties Thu Nov 24 18:24:19 2005
@@ -0,0 +1,33 @@
+# Copyright 2004 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#  LOCALIZATION MAINTAINER:
+#  Jian Liao <jian.liao@gmail.com>
+
+profiler.title.rules=\u89c4\u5219
+profiler.rule.title=\u89c4\u5219\u540d\u79f0
+profiler.rule.id=\u89c4\u5219\u6807\u8bc6
+profiler.rule.class=\u89c4\u5219\u7c7b
+profiler.rule.save=\u4fdd\u5b58
+profiler.rule.new=\u65b0\u5efa
+profiler.rule.cancel=\u53d6\u6d88
+profiler.rule.remove=\u5220\u9664
+criteria.title=\u89c4\u5219\u6761\u4ef6
+criteria.new=\u65b0\u5efa\u6761\u4ef6
+criteria.remove=\u5220\u9664\u6761\u4ef6
+criterion.name=\u540d\u79f0
+criterion.value=\u503c
+criterion.fallback.order=\u987a\u5e8f
+criterion.resolver=\u89e3\u6790\u5668\u7c7b\u578b
+criterion.fallback.type=Fallback

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/ForgottenPasswordPortlet.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/ForgottenPasswordPortlet.java?rev=348854&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/ForgottenPasswordPortlet.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/ForgottenPasswordPortlet.java Thu Nov 24 18:24:19 2005
@@ -0,0 +1,253 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.portlets.registration;
+
+import java.io.IOException;
+import java.security.Principal;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.ResourceBundle;
+import java.util.Set;
+import java.util.prefs.Preferences;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.administration.AdministrationEmailException;
+import org.apache.jetspeed.administration.PortalAdministration;
+import org.apache.jetspeed.security.PasswordCredential;
+import org.apache.jetspeed.security.User;
+import org.apache.jetspeed.security.UserManager;
+import org.apache.jetspeed.security.UserPrincipal;
+import org.apache.portals.bridges.velocity.AbstractVelocityMessagingPortlet;
+import org.apache.velocity.context.Context;
+import org.apache.portals.gems.util.ValidationHelper;
+
+/**
+ * This portlet allows a logged on user to change its password.
+ *
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class ForgottenPasswordPortlet extends AbstractVelocityMessagingPortlet
+{
+    private PortalAdministration admin;
+    private UserManager userManager;    
+    
+    // Request Params 
+    private static final String RP_EMAIL_ADDRESS = "email";
+
+    // Messages 
+    private static final String MSG_MESSAGE = "MSG";
+    
+    // Context Variables
+    private static final String CTX_EMAIL_ADDRESS = "email";    
+    private static final String CTX_RETURN_URL = "returnURL";
+    private static final String CTX_NEW_PASSWORD = "password";
+    private static final String CTX_USER_NAME = "username";
+    private static final String CTX_MESSAGE = "MSG";
+
+    // Init Parameter Constants
+    private static final String IP_REDIRECT_PATH = "redirectPath";    
+    private static final String IP_RETURN_URL = "returnURL";
+    private static final String IP_TEMPLATE = "template";
+    
+    // Resource Bundle
+    private static final String RB_EMAIL_SUBJECT = "email.subject.forgotten.password";
+    
+    /** email template to use for merging */
+    private String template;
+    /** servlet path of the return url to be printed and href'd in email template */
+    private String returnUrlPath;
+    /** path where to redirect to after pressing submit on the form */
+    private String redirectPath;
+
+    /** localized emailSubject */
+    private String emailSubject = null;
+    
+    public void init(PortletConfig config) throws PortletException
+    {
+        super.init(config);
+        admin = (PortalAdministration) 
+                    getPortletContext().getAttribute(CommonPortletServices.CPS_PORTAL_ADMINISTRATION);
+        if (null == admin)
+        {
+            throw new PortletException("Failed to find the Portal Administration on portlet initialization");
+        }
+        userManager = (UserManager) 
+            getPortletContext().getAttribute(CommonPortletServices.CPS_USER_MANAGER_COMPONENT);
+        if (null == userManager)
+        {
+            throw new PortletException("Failed to find the User Manager on portlet initialization");
+        }        
+        
+        this.returnUrlPath = config.getInitParameter(IP_RETURN_URL);
+        this.redirectPath = config.getInitParameter(IP_REDIRECT_PATH);
+        this.template = config.getInitParameter(IP_TEMPLATE);
+    }
+    
+    public void doView(RenderRequest request, RenderResponse response) 
+    throws PortletException, IOException
+    {
+        response.setContentType("text/html");                
+        Context context = getContext(request);        
+        String email = request.getParameter(RP_EMAIL_ADDRESS);        
+        context.put(CTX_EMAIL_ADDRESS, email);
+        context.put(CTX_MESSAGE, consumeRenderMessage(request, MSG_MESSAGE));        
+        super.doView(request, response);
+    }
+
+    public void processAction(ActionRequest request, ActionResponse response) 
+        throws PortletException, IOException
+    {
+        List errors = new LinkedList();
+                            
+        String email = request.getParameter(RP_EMAIL_ADDRESS);
+        
+        // validation
+        if (!ValidationHelper.isEmailAddress(email, true, 80))
+        {
+            // TODO: get error message from localized resource
+            errors.add("Please enter a valid Email address.");  
+        }
+        
+        
+        if (errors.size() > 0)
+        {
+            publishRenderMessage(request, MSG_MESSAGE, errors);
+            return;
+        }
+        
+        User user = null;
+        try
+        {
+            user = admin.lookupUserFromEmail(email);
+        } 
+        catch (Exception e) 
+        {
+            // TODO: get message from localized messages
+            publishRenderMessage(request, MSG_MESSAGE, 
+                    makeMessage("Sorry but we could not find this email address on file. Are you sure you typed it in correctly?"));
+            return;
+        }
+
+        try 
+        {
+            String userName = getUserName(user);
+            String oldPassword = getPassword(user);
+            String newPassword = admin.generatePassword();             
+            userManager.setPassword(userName, oldPassword, newPassword);
+            userManager.setPasswordUpdateRequired(userName, true);
+            Preferences pref = user.getUserAttributes();
+            String[] keys = pref.keys();
+            Map userAttributes = new HashMap();
+            if (keys != null)
+            {
+                for (int ix = 0; ix < keys.length; ix++)
+                {
+                    // TODO: how the hell do i tell the pref type
+                    // ASSuming they are all strings (sigh)
+                    userAttributes.put(keys[ix], pref.get(keys[ix], ""));
+                }
+            }
+            // special attributes
+            userAttributes.put(CTX_RETURN_URL, generateReturnURL(request, response));
+            userAttributes.put(CTX_NEW_PASSWORD, newPassword);
+            userAttributes.put(CTX_USER_NAME, userName);
+            
+            admin.sendEmail(email, getEmailSubject(request), this.template, userAttributes);
+            
+            response.sendRedirect(this.redirectPath);
+        }
+        catch (AdministrationEmailException e)
+        {
+            publishRenderMessage(request, CTX_MESSAGE, 
+                    makeMessage(e.getMessage()));
+        }
+        catch (Exception e) 
+        {
+            publishRenderMessage(request, CTX_MESSAGE, makeMessage("Failed to send password: " + e.toString()));
+        }
+        
+    }
+
+    protected String getEmailSubject(PortletRequest request)
+    {
+        ResourceBundle resource = getPortletConfig().getResourceBundle(request.getLocale());
+        this.emailSubject = resource.getString(RB_EMAIL_SUBJECT);
+        if (this.emailSubject == null)
+            this.emailSubject = "Password Notification";
+        return this.emailSubject;
+    }
+    
+    protected String generateReturnURL(ActionRequest request, ActionResponse response)
+    {
+        // TODO: get the FULL PORTAL URL return address to login from init param        
+        return "http://TODO-FIXME" + this.returnUrlPath; 
+    }
+    
+    protected String getUserName(User user)
+    {
+        Principal principal = null;
+        Iterator principals = user.getSubject().getPrincipals().iterator();
+        while (principals.hasNext())
+        {      
+            Object o = principals.next();
+            if (o instanceof UserPrincipal)
+            {
+                principal = (Principal)o;
+                return principal.toString();
+            }
+                
+        }
+        return null;        
+    }
+
+    protected String getPassword(User user)
+    {
+        PasswordCredential credential = null;
+        
+        Set credentials = user.getSubject().getPrivateCredentials();
+        Iterator iter = credentials.iterator();
+        while (iter.hasNext())
+        {
+            Object o = iter.next();
+            if (o instanceof PasswordCredential)
+            {
+                credential = (PasswordCredential)o;
+                return credential.toString();
+            }
+        }
+        return null;                
+    }
+    
+    protected List makeMessage(String msg)
+    {
+        List errors = new LinkedList();
+        errors.add(msg);
+        return errors;
+    }
+
+}

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java?rev=348854&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java Thu Nov 24 18:24:19 2005
@@ -0,0 +1,254 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.portlets.registration;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.ResourceBundle;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.administration.PortalAdministration;
+import org.apache.jetspeed.security.SecurityException;
+import org.apache.jetspeed.security.User;
+import org.apache.jetspeed.security.UserManager;
+import org.apache.portals.bridges.velocity.AbstractVelocityMessagingPortlet;
+import org.apache.velocity.context.Context;
+
+/**
+ * This portlet allows a logged on user to change its password.
+ *
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class UserRegistrationPortlet extends AbstractVelocityMessagingPortlet
+{
+    private PortalAdministration admin;
+    private UserManager userManager;
+ 
+
+    // Messages 
+    private static final String MSG_MESSAGE = "MSG";    
+    private static final String MSG_USERINFO = "user";
+    
+    // Init Parameters
+    private static final String IP_ROLES = "roles"; // comma separated    
+    private static final String IP_GROUPS = "groups"; // comma separated
+    private static final String IP_TEMPLATE = "template";
+    private static final String IP_RULES_NAMES = "rulesNames";
+    private static final String IP_RULES_VALUES = "rulesValues";
+    private static final String IP_REDIRECT_PATH = "redirectPath";    
+    private static final String IP_RETURN_URL = "returnURL";
+    
+    // Context Variables
+    private static final String CTX_RETURN_URL = "returnURL";
+    private static final String CTX_MESSAGE = "MSG";
+    private static final String CTX_USERINFO = "user";    
+    
+    // Resource Bundle
+    private static final String RB_EMAIL_SUBJECT = "email.subject.registration";
+    
+    /** email template to use for merging */
+    private String template;
+
+    /** localized emailSubject */
+    private String emailSubject = null;
+    
+    /** path where to redirect to after pressing submit on the form */
+    private String redirectPath;
+
+    /** servlet path of the return url to be printed and href'd in email template */
+    private String returnUrlPath;
+    
+    /** roles */
+    private List roles;
+    
+    /** groups */
+    private List groups;
+    
+    /** profile rules */
+    private Map rules;
+    
+    public void init(PortletConfig config) throws PortletException
+    {
+        super.init(config);
+        admin = (PortalAdministration) 
+                    getPortletContext().getAttribute(CommonPortletServices.CPS_PORTAL_ADMINISTRATION);
+        if (null == admin)
+        {
+            throw new PortletException("Failed to find the Portal Administration on portlet initialization");
+        }
+        userManager = (UserManager)  
+        getPortletContext().getAttribute(CommonPortletServices.CPS_USER_MANAGER_COMPONENT);
+        if (null == userManager)
+        { 
+            throw new PortletException("Failed to find the User Manager on portlet initialization");
+        } 
+        
+        // roles
+        this.roles = getInitParameterList(config, IP_ROLES);
+        
+        // groups
+        this.groups = getInitParameterList(config, IP_GROUPS);
+        
+        // rules (name,value pairs)
+        List names = getInitParameterList(config, IP_RULES_NAMES);
+        List values = getInitParameterList(config, IP_RULES_VALUES);
+        rules = new HashMap();
+        for (int ix = 0; ix < ((names.size() < values.size()) ? names.size() : values.size()); ix++)
+        {
+            rules.put(names.get(ix), values.get(ix));
+        }
+   
+        // user attributes ? 
+        
+        this.template = config.getInitParameter(IP_TEMPLATE);
+        this.redirectPath = config.getInitParameter(IP_REDIRECT_PATH);
+        this.returnUrlPath = config.getInitParameter(IP_RETURN_URL);        
+    }
+    
+    public void doView(RenderRequest request,
+                       RenderResponse response) 
+        throws PortletException, IOException 
+    {
+        response.setContentType("text/html");                
+        Context context = getContext(request);        
+        context.put(CTX_USERINFO, this.receiveRenderMessage(request, MSG_USERINFO));
+        context.put(CTX_MESSAGE, consumeRenderMessage(request, MSG_MESSAGE));        
+        super.doView(request, response);                
+    }
+    
+    public void processAction(ActionRequest actionRequest,
+            ActionResponse actionResponse) throws PortletException, IOException 
+    {
+        List errors = new LinkedList();
+        
+        // TODO: determine which PLT.D Information to register with
+        String familyName = actionRequest.getParameter("user.name.family");
+        String givenName = actionRequest.getParameter("user.name.given");     
+        String email = actionRequest.getParameter("user.email");
+        
+        String userName = actionRequest.getParameter("user.name");
+        String password = actionRequest.getParameter("password");
+        String verifyPassword = actionRequest.getParameter("verifyPassword");
+
+        // TODO: Validation
+        
+        // Could have two modes (init param or pref) of user name creation:
+        //  1. use email address
+        //  2. request user id
+        // Could have two modes (init param or pref) of password creation
+        //  1. generate new password automatically
+        //  2. enter a new password and verify
+        
+        // TODO: add select user attributes to map
+        Map userInfo = new HashMap();
+        
+        boolean requestUserId = true;
+        if (requestUserId)
+        {
+            boolean userIdExistsFlag = true;
+            try
+            {
+                User user = userManager.getUser(userName);
+            } 
+            catch (SecurityException e) 
+            {
+                userIdExistsFlag = false;
+            }
+    //
+            if (userIdExistsFlag) 
+            {
+                // TODO: localize messages
+                errors.add("Requested User ID already exists.  Please select another User Id.");
+                publishRenderMessage(actionRequest, MSG_MESSAGE, errors);
+                return;
+            }
+        }
+        
+        try 
+        {
+            boolean generatePasswordOption = true;
+            if (generatePasswordOption)
+            {
+                password = admin.generatePassword();
+            }
+            
+            admin.registerUser(userName, 
+                               password, 
+                               this.roles, 
+                               this.groups, 
+                               userInfo, 
+                               rules, 
+                               template);
+          
+            // special attributes
+            userInfo.put(CTX_RETURN_URL, generateReturnURL(actionRequest, actionResponse));
+            
+            admin.sendEmail(email, getEmailSubject(actionRequest), this.template, userInfo);
+            
+            actionResponse.sendRedirect(this.redirectPath);
+
+        } 
+        catch (Exception e) 
+        {
+            // TODO: localize messages
+            errors.add("Failed to add user. " + e.toString());
+            publishRenderMessage(actionRequest, MSG_MESSAGE, errors);            
+        }
+    }
+    
+    protected String getEmailSubject(PortletRequest request)
+    {
+        ResourceBundle resource = getPortletConfig().getResourceBundle(request.getLocale());
+        this.emailSubject = resource.getString(RB_EMAIL_SUBJECT);
+        if (this.emailSubject == null)
+            this.emailSubject = "Registration Confirmation";
+        return this.emailSubject;
+    }
+
+    protected List getInitParameterList(PortletConfig config, String ipName)
+    {
+        String temp = config.getInitParameter(ipName);
+        if (temp == null)
+            return new ArrayList();
+        
+        String[] temps = temp.split("\\,");
+        for (int ix = 0; ix < temps.length; ix++)
+            temps[ix] = temps[ix].trim();        
+        
+        return Arrays.asList(temps);        
+    }
+    
+    protected String generateReturnURL(ActionRequest request, ActionResponse response)
+    {
+        // TODO: get the FULL PORTAL URL return address to login from init param        
+        return "http://TODO-FIXME" + this.returnUrlPath; 
+    }
+    
+}

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/ChangePasswordPortlet.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/ChangePasswordPortlet.java?rev=348854&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/ChangePasswordPortlet.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/ChangePasswordPortlet.java Thu Nov 24 18:24:19 2005
@@ -0,0 +1,198 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.portlets.security;
+
+import java.io.IOException;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.ResourceBundle;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.PortalReservedParameters;
+import javax.security.auth.Subject;
+
+import org.apache.jetspeed.request.RequestContext;
+import org.apache.jetspeed.security.InvalidNewPasswordException;
+import org.apache.jetspeed.security.InvalidPasswordException;
+import org.apache.jetspeed.security.PasswordAlreadyUsedException;
+import org.apache.jetspeed.security.PasswordCredential;
+import org.apache.jetspeed.security.SecurityException;
+import org.apache.jetspeed.security.UserManager;
+import org.apache.portals.bridges.common.GenericServletPortlet;
+
+/**
+ * This portlet allows a logged on user to change its password.
+ *
+ * @author <a href="mailto:ate@apache.org">Ate Douma</a>
+ * @version $Id: ChangePasswordPortlet.java 348264 2005-11-22 22:06:45Z taylor $
+ */
+public class ChangePasswordPortlet extends GenericServletPortlet
+{
+    private UserManager manager;
+    
+    public static final String CURRENT_PASSWORD = "currentPassword";
+    public static final String NEW_PASSWORD = "newPassword";
+    public static final String NEW_PASSWORD_AGAIN = "newPasswordAgain";
+    public static final String ERROR_MESSAGES = "errorMessages";
+    public static final String PASSWORD_CHANGED = "passwordChanged";
+    public static final String WHY = "why";
+    public static final String REQUIRED = "required";
+    public static final String CANCELLED = "cancelled";
+    
+    public void init(PortletConfig config)
+    throws PortletException 
+    {
+        super.init(config);
+        manager = (UserManager) getPortletContext().getAttribute(CommonPortletServices.CPS_USER_MANAGER_COMPONENT);
+        if (null == manager)
+        {
+            throw new PortletException("Failed to find the User Manager on portlet initialization");
+        }
+    }
+    
+    public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException
+    {
+        response.setContentType("text/html");
+
+        if ( request.getUserPrincipal() != null )
+        {
+            RequestContext requestContext = (RequestContext)request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
+            Integer passwordDaysValid = (Integer)requestContext.getAttribute(PasswordCredential.PASSWORD_CREDENTIAL_DAYS_VALID_REQUEST_ATTR_KEY);
+            
+            if ( passwordDaysValid != null )
+            {
+                ResourceBundle bundle = ResourceBundle.getBundle("org.apache.jetspeed.portlets.security.resources.ChgPwdResources",request.getLocale());
+                if ( passwordDaysValid.intValue() < 1 )
+                {
+                    request.setAttribute(WHY,bundle.getString("chgpwd.message.change.required"));
+                    request.setAttribute(REQUIRED,Boolean.TRUE);
+                }
+                else if ( passwordDaysValid.intValue() == 1 )
+                {
+                    request.setAttribute(WHY,bundle.getString("chgpwd.message.expires.today"));
+                    request.setAttribute(REQUIRED,Boolean.TRUE);
+                }
+                else
+                {
+                    MessageFormat mf = new MessageFormat(bundle.getString("chgpwd.message.expires.in.days"));
+                    request.setAttribute(WHY,mf.format(new Integer[]{passwordDaysValid}));
+                }
+            }
+            
+            ArrayList errorMessages = (ArrayList)request.getPortletSession().getAttribute(ERROR_MESSAGES);
+            if (errorMessages != null )
+            {
+                request.getPortletSession().removeAttribute(ERROR_MESSAGES);
+                request.setAttribute(ERROR_MESSAGES,errorMessages);
+            }
+            else
+            {
+                Boolean password_changed = (Boolean)request.getPortletSession().getAttribute(PASSWORD_CHANGED);
+                if ( password_changed != null )
+                {
+                    request.getPortletSession().removeAttribute(PASSWORD_CHANGED);
+                    request.setAttribute(PASSWORD_CHANGED,password_changed);
+                }
+            }        
+        }
+        super.doView(request, response);
+    }
+    
+    public void processAction(ActionRequest actionRequest, ActionResponse actionResponse) throws PortletException,
+    IOException
+    {
+        if ( actionRequest.getUserPrincipal() != null )
+        {
+            ResourceBundle bundle = ResourceBundle.getBundle("org.apache.jetspeed.portlets.security.resources.ChgPwdResources",actionRequest.getLocale());
+
+            ArrayList errorMessages = new ArrayList();
+            
+            String cancelled = actionRequest.getParameter(CANCELLED);
+            if ( cancelled == null )
+            {
+                String currPassword = actionRequest.getParameter(CURRENT_PASSWORD);
+                String newPassword = actionRequest.getParameter(NEW_PASSWORD);
+                String newPasswordAgain = actionRequest.getParameter(NEW_PASSWORD_AGAIN);
+            
+                if (currPassword == null || currPassword.length() == 0)
+                {
+                    errorMessages.add(bundle.getString("chgpwd.error.currentPasswordNull"));
+                    currPassword = null;
+                }
+                if (newPassword == null || newPassword.length() == 0)
+                {
+                    errorMessages.add(bundle.getString("chgpwd.error.newPasswordNull"));
+                    newPassword = null;
+                }
+                if (newPassword != null && newPassword.length() == 0)
+                {
+                    newPassword = null;
+                }
+                
+                if (newPassword != null && 
+                        (newPasswordAgain == null || (newPasswordAgain != null && !newPassword.equals(newPasswordAgain))))
+                {
+                    errorMessages.add(bundle.getString("chgpwd.error.newPasswordsDoNotMatch"));
+                }
+                if ( errorMessages.size() == 0 )
+                {
+                    try
+                    {
+                        String userName = actionRequest.getUserPrincipal().getName();
+                        manager.setPassword(userName, currPassword, newPassword);
+
+                        // refresh/update Subject in session to reflect the changed PasswordCredential
+                        Subject subject = manager.getUser(userName).getSubject();
+                        RequestContext requestContext = (RequestContext)actionRequest.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);                  
+                        requestContext.setSessionAttribute(PortalReservedParameters.SESSION_KEY_SUBJECT, subject);
+                    }
+                    catch ( InvalidPasswordException ipe )
+                    {
+                        errorMessages.add(bundle.getString("chgpwd.error.invalidPassword"));
+                    }
+                    catch ( InvalidNewPasswordException inpe )
+                    {
+                        errorMessages.add(bundle.getString("chgpwd.error.invalidNewPassword"));
+                    }
+                    catch ( PasswordAlreadyUsedException paue )
+                    {
+                        errorMessages.add(bundle.getString("chgpwd.error.passwordAlreadyUsed"));
+                    }
+                    catch ( SecurityException e)
+                    {
+                        // todo: localization of all exception messages
+                        errorMessages.add(e.getMessage());
+                    }
+                }
+                if ( errorMessages.size() > 0 )
+                {
+                    actionRequest.getPortletSession().setAttribute(ERROR_MESSAGES,errorMessages);
+                }
+                else
+                {
+                    actionRequest.getPortletSession().setAttribute(PASSWORD_CHANGED,Boolean.TRUE);
+                }
+            }
+        }
+    }
+}

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/SecurityApplicationResources.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/SecurityApplicationResources.java?rev=348854&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/SecurityApplicationResources.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/SecurityApplicationResources.java Thu Nov 24 18:24:19 2005
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.portlets.security;
+
+/**
+ * <p>
+ * Common resources used by the security applications.
+ * </p>
+ * 
+ * @author <a href="dlestrat@apache.org">David Le Strat</a>
+ */
+public class SecurityApplicationResources
+{    
+    /** Role tree table binding variable. */
+    public static final String ROLE_TREE_TABLE = "roleTreeTable";
+
+}

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/SecurityResources.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/SecurityResources.java?rev=348854&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/SecurityResources.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/SecurityResources.java Thu Nov 24 18:24:19 2005
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.portlets.security;
+
+/**
+ * Common resources used by Security Portlets
+ *
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: SecurityResources.java 348264 2005-11-22 22:06:45Z taylor $
+ */
+public interface SecurityResources
+{
+    public final static String CURRENT_USER = "current_user";
+    public final static String PAM_CURRENT_USER = "org.apache.jetspeed.pam.user";
+    public final static String REQUEST_SELECT_USER = "select_user";    
+
+    public final static String PORTLET_URL = "portlet_url";
+    public final static String REQUEST_SELECT_PORTLET = "select_portlet";
+    public final static String REQUEST_SELECT_TAB = "selected_tab";
+    public final static String PORTLET_ACTION = "portlet_action";
+    
+    // Message Topics
+    public final static String TOPIC_USERS = "users";
+    public final static String TOPIC_GROUPS = "groups";
+    public final static String TOPIC_GROUPS_USERS = "groups.users";
+    public final static String TOPIC_ROLES = "roles";
+    public final static String TOPIC_ROLES_USERS = "roles.users";    
+    public final static String TOPIC_PROFILES = "profiles";
+
+    /** Messages **/
+    public static final String MESSAGE_SELECTED = "selected";
+    public static final String MESSAGE_CHANGED = "changed";
+    public static final String MESSAGE_STATUS = "status";
+    public static final String MESSAGE_REFRESH = "refresh";
+    public static final String MESSAGE_FILTERED = "filtered";    
+    public static final String MESSAGE_REFRESH_PROFILES = "refresh.profiles";
+    public static final String MESSAGE_REFRESH_ROLES = "refresh.roles";
+    public static final String MESSAGE_REFRESH_GROUPS = "refresh.groups";
+    
+    
+    /** the selected non-leaf node in the tree view */
+    public final static String REQUEST_NODE = "node";
+    /** the selected leaf node in the tree view */
+    public final static String REQUEST_SELECT_NODE = "select_node";
+       
+    /** The Error Messages KEY */
+    public static final String ERROR_MESSAGES = "errorMessages";
+    
+}

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/SecurityUtil.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/SecurityUtil.java?rev=348854&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/SecurityUtil.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/SecurityUtil.java Thu Nov 24 18:24:19 2005
@@ -0,0 +1,96 @@
+/* Copyright 2004 Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.apache.jetspeed.portlets.security;
+
+import java.io.NotSerializableException;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.portlet.PortletRequest;
+import javax.portlet.RenderRequest;
+import javax.security.auth.Subject;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.jetspeed.PortalReservedParameters;
+import org.apache.jetspeed.request.RequestContext;
+import org.apache.portals.gems.browser.BrowserPortlet;
+import org.apache.portals.messaging.PortletMessaging;
+
+
+/**
+ * Abstract Security Browser - factored out common functionality for security browsers 
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: SecurityUtil.java 348264 2005-11-22 22:06:45Z taylor $
+ */
+public abstract class SecurityUtil extends BrowserPortlet
+{    
+        
+    public static Principal getPrincipal(Subject subject, Class classe)
+    {
+        Principal principal = null;
+        Iterator principals = subject.getPrincipals().iterator();
+        while (principals.hasNext())
+        {
+            Principal p = (Principal) principals.next();
+            if (classe.isInstance(p))
+            {
+                principal = p;
+                break;
+            }
+        }
+        return principal;
+    }
+
+    public static boolean isEmpty(String s)
+    {
+        if (s == null) return true;
+        
+        if (s.trim().equals("")) return true;
+        
+        return false;
+    }
+
+    public static String getAbsoluteUrl(RenderRequest renderRequest, String relativePath)
+    {
+        RequestContext requestContext = (RequestContext) renderRequest.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
+        HttpServletRequest request = requestContext.getRequest();
+        StringBuffer path = new StringBuffer();
+        return requestContext.getResponse().encodeURL(path.append(request.getScheme()).append("://").append(request.getServerName()).append(":").append(
+                request.getServerPort()).append(request.getContextPath()).append(request.getServletPath()).append(
+                relativePath).toString());
+    }
+    
+    public static void publishErrorMessage(PortletRequest request, String message)
+    {
+        try
+        {
+            ArrayList errors = (ArrayList)PortletMessaging.receive(request,SecurityResources.ERROR_MESSAGES);
+            if ( errors == null )
+            {
+                errors = new ArrayList();
+            }
+            errors.add(message);
+            PortletMessaging.publish(request, SecurityResources.ERROR_MESSAGES, errors);
+        }
+        catch (NotSerializableException e)
+        {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }                
+    }
+    
+}



---------------------------------------------------------------------
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