Author: truong.le
Date: 2009-11-06 03:59:08 -0500 (Fri, 06 Nov 2009)
New Revision: 512
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserACL.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListMembershipType.java
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_ar.xml
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_de.properties
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.xml
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_fr.properties
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_nl.properties
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_ru.properties
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_uk.properties
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_vi.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
Log:
GTNPORTAL-203: A membership type should be configurable as a mandatory resource in portal
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserACL.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserACL.java 2009-11-06
08:02:38 UTC (rev 511)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserACL.java 2009-11-06
08:59:08 UTC (rev 512)
@@ -61,6 +61,8 @@
private String navigationCreatorMembershipType_;
private List<String> mandatoryGroups_;
+
+ private List<String> mandatoryMSTypes_;
private PortalACLPlugin portalACLPlugin;
@@ -89,6 +91,12 @@
mandatoryGroups_ = mandatoryGroupsParam.getValues();
else
mandatoryGroups_ = new ArrayList<String>();
+
+ ValuesParam mandatoryMSTypesParam =
params.getValuesParam("mandatory.mstypes");
+ if (mandatoryMSTypesParam != null)
+ mandatoryMSTypes_ = mandatoryMSTypesParam.getValues();
+ else
+ mandatoryMSTypes_ = new ArrayList<String>();
// tam.nguyen get admin group value
ValueParam adminGroupsParam =
params.getValueParam("portal.administrator.groups");
@@ -177,6 +185,11 @@
{
return mandatoryGroups_;
}
+
+ public List<String> getMandatoryMSTypes()
+ {
+ return mandatoryMSTypes_;
+ }
public void setAdminGroups(String adminGroups)
{
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListMembershipType.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListMembershipType.java 2009-11-06
08:02:38 UTC (rev 511)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListMembershipType.java 2009-11-06
08:59:08 UTC (rev 512)
@@ -21,6 +21,7 @@
import org.exoplatform.commons.utils.ObjectPageList;
import org.exoplatform.commons.utils.PageList;
+import org.exoplatform.portal.config.UserACL;
import org.exoplatform.services.organization.MembershipType;
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.web.application.ApplicationMessage;
@@ -115,6 +116,15 @@
uiApp.addMessage(new
ApplicationMessage("UIMembershipList.msg.InUse", null));
return;
}
+
+ // Check to see whether given membershiptype is mandatory or not
+ UserACL acl = uiMembership.getApplicationComponent(UserACL.class);
+ List<String> mandatories = acl.getMandatoryMSTypes();
+ if(!mandatories.isEmpty() && mandatories.contains(name)){
+ UIApplication uiApp = event.getRequestContext().getUIApplication();
+ uiApp.addMessage(new
ApplicationMessage("UIMembershipList.msg.DeleteMandatory", null));
+ return;
+ }
OrganizationService service =
uiMembership.getApplicationComponent(OrganizationService.class);
MembershipType membershipType =
service.getMembershipTypeHandler().findMembershipType(name);
Modified:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_ar.xml
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_ar.xml 2009-11-06
08:02:38 UTC (rev 511)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_ar.xml 2009-11-06
08:59:08 UTC (rev 512)
@@ -317,6 +317,7 @@
</action>
<msg>
<InUse>لا يمكنك حذف هذه العضوية لأنها في الاستخدام</InUse>
+ <DeleteMandatory>لا يمكنك حذف هذه العضوية لأنه
إلزامية</DeleteMandatory>
</msg>
</UIMembershipList>
<!--
Modified:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_de.properties
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_de.properties 2009-11-06
08:02:38 UTC (rev 511)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_de.properties 2009-11-06
08:59:08 UTC (rev 512)
@@ -162,7 +162,8 @@
UIMembershipList.header.description=#{word.description}
UIMembershipList.action.title.EditMembership=Mitgliedschaft ändern
UIMembershipList.action.title.DeleteMembership=Mitgliedschaft löschen
-UIMembershipList.msg.InUse=Sie können die Mitgliedschaft nicht löschen,
da es benutzt wird
+UIMembershipList.msg.InUse=Sie können die Mitgliedschaft nicht löschen,
da es benutzt wird
+UIMembershipList.msg.DeleteMandatory=Sie k\u00F6nnen nicht gel\u00F6scht werden, weil sie
die Mitgliedschaft ist obligatorisch
##org.exoplatform.organization.webui.component.UIGroupMembershipForm
UIGroupMembershipForm.title=Mitglied hinzufügen
Modified:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties 2009-11-06
08:02:38 UTC (rev 511)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties 2009-11-06
08:59:08 UTC (rev 512)
@@ -171,7 +171,8 @@
UIMembershipList.header.description=#{word.description}
UIMembershipList.action.title.EditMembership=Edit Membership
UIMembershipList.action.title.DeleteMembership=Delete Membership
-UIMembershipList.msg.InUse=You can not delete this membership because it is in use
+UIMembershipList.msg.InUse=You can not delete this membership because it is in use
+UIMembershipList.msg.DeleteMandatory=You can not delete this membership because it is
mandatory
##org.exoplatform.organization.webui.component.UIGroupMembershipForm
UIGroupMembershipForm.title=Add member
Modified:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.xml
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.xml 2009-11-06
08:02:38 UTC (rev 511)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.xml 2009-11-06
08:59:08 UTC (rev 512)
@@ -317,6 +317,7 @@
</action>
<msg>
<InUse>You can not delete this membership because it is in use</InUse>
+ <DeleteMandatory>You can not delete this membership because it is
mandatory</DeleteMandatory>
</msg>
</UIMembershipList>
<!--
Modified:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_fr.properties
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_fr.properties 2009-11-06
08:02:38 UTC (rev 511)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_fr.properties 2009-11-06
08:59:08 UTC (rev 512)
@@ -172,6 +172,7 @@
UIMembershipList.action.title.EditMembership=Editer le r\u00f4le
UIMembershipList.action.title.DeleteMembership=Supprimer le r\u00f4le
UIMembershipList.msg.InUse=Vous ne pouvez pas supprimer ce r\u00f4le car il est
utilis\u00e9
+UIMembershipList.msg.DeleteMandatory=Vous ne pouvez pas supprimer cette adh\u00E9sion
parce qu'il est obligatoire
##org.exoplatform.organization.webui.component.UIGroupMembershipForm
UIGroupMembershipForm.title=Ajouter un utilisateur dans le groupe
Modified:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_nl.properties
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_nl.properties 2009-11-06
08:02:38 UTC (rev 511)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_nl.properties 2009-11-06
08:59:08 UTC (rev 512)
@@ -162,7 +162,8 @@
UIMembershipList.header.description=#{word.description}
UIMembershipList.action.title.EditMembership=lidmaatschap wijzigen
UIMembershipList.action.title.DeleteMembership=lidmaatschap verwijderen
-UIMembershipList.msg.InUse=Lidmaatschap kan verwijderd worden omdat het in gebruik is
+UIMembershipList.msg.InUse=Lidmaatschap kan verwijderd worden omdat het in gebruik is
+UIMembershipList.msg.DeleteMandatory=U kunt dit lidmaatschap niet verwijderen omdat het
verplicht is
##org.exoplatform.organization.webui.component.UIGroupMembershipForm
UIGroupMembershipForm.title=Lid toevoegen
Modified:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_ru.properties
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_ru.properties 2009-11-06
08:02:38 UTC (rev 511)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_ru.properties 2009-11-06
08:59:08 UTC (rev 512)
@@ -162,7 +162,8 @@
UIMembershipList.header.description=#{word.description}
UIMembershipList.action.title.EditMembership=Изменить участие
UIMembershipList.action.title.DeleteMembership=Отменить участие
-UIMembershipList.msg.InUse=Невозможно отменить участие.
+UIMembershipList.msg.InUse=Невозможно отменить участие.
+UIMembershipList.msg.DeleteMandatory=\u0412\u044B \u043D\u0435
\u043C\u043E\u0436\u0435\u0442\u0435 \u0443\u0434\u0430\u043B\u0438\u0442\u044C
\u044D\u0442\u043E \u0447\u043B\u0435\u043D\u0441\u0442\u0432\u043E,
\u043F\u043E\u0441\u043A\u043E\u043B\u044C\u043A\u0443 \u043E\u043D\u043E
\u044F\u0432\u043B\u044F\u0435\u0442\u0441\u044F
\u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u044B\u043C
##org.exoplatform.organization.webui.component.UIGroupMembershipForm
UIGroupMembershipForm.title=Добавить участника
Modified:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_uk.properties
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_uk.properties 2009-11-06
08:02:38 UTC (rev 511)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_uk.properties 2009-11-06
08:59:08 UTC (rev 512)
@@ -161,7 +161,8 @@
UIMembershipList.header.description=#{word.description}
UIMembershipList.action.title.EditMembership=Редагувати клас
UIMembershipList.action.title.DeleteMembership=Видалити клас
-UIMembershipList.msg.InUse=Ви не можете видалити цей клас, бо він використовується.
+UIMembershipList.msg.InUse=Ви не можете видалити цей клас, бо він використовується.
+UIMembershipList.msg.DeleteMandatory=\u0412\u0456\u0434 \u0442\u0430\u043A\u0438\u0445
\u043C\u043E\u0436\u043D\u0430 \u043D\u0456
\u0432\u0438\u043B\u0443\u0447\u0456\u0442\u044C \u0446\u0435
\u043F\u0440\u0438\u043D\u0430\u043B\u0435\u0436\u043D\u0456\u0441\u0442\u044C
\u043E\u0441\u043A\u0456\u043B\u044C\u043A\u0438 \u0432\u0456\u043D
\u043E\u0434\u0438\u043D
\u043E\u0431\u043E\u0432'\u044F\u0437\u043A\u043E\u0432\u0438\u0439
##org.exoplatform.organization.webui.component.UIGroupMembershipForm
UIGroupMembershipForm.title=Додати учасника
Modified:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_vi.xml
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_vi.xml 2009-11-06
08:02:38 UTC (rev 511)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_vi.xml 2009-11-06
08:59:08 UTC (rev 512)
@@ -317,6 +317,7 @@
</action>
<msg>
<InUse>Bạn không thể xóa thành viên này vì nó đang sử dụng</InUse>
+ <DeleteMandatory>Bạn không thể xóa membership này vì nó là
mandatory</DeleteMandatory>
</msg>
</UIMembershipList>
<!--
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2009-11-06
08:02:38 UTC (rev 511)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2009-11-06
08:59:08 UTC (rev 512)
@@ -78,13 +78,18 @@
<description>guests group</description>
<value>/platform/guests</value>
</value-param>
- <values-param>
- <name>mandatory.groups</name>
- <description>Groups that can not be deleted.</description>
- <value>/platform/administrators</value>
- <value>/platform/users</value>
- <value>/platform/guests</value>
- </values-param>
+ <values-param>
+ <name>mandatory.groups</name>
+ <description>Groups that can not be deleted.</description>
+ <value>/platform/administrators</value>
+ <value>/platform/users</value>
+ <value>/platform/guests</value>
+ </values-param>
+ <values-param>
+ <name>mandatory.mstypes</name>
+ <description>Membership type that can not be deleted.</description>
+ <value>member</value>
+ </values-param>
</init-params>
</component>