Please do not have the framework reference higher-level applications. Put party-related artifacts in the Party component.

-Adrian

On 10/30/2012 9:19 PM, er...@apache.org wrote:
Modified: 
ofbiz/branches/20120329_portletWidget/framework/common/config/CommonPortalEntityLabels.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/config/CommonPortalEntityLabels.xml?rev=1403874&r1=1403873&r2=1403874&view=diff
==============================================================================
--- 
ofbiz/branches/20120329_portletWidget/framework/common/config/CommonPortalEntityLabels.xml
 (original)
+++ 
ofbiz/branches/20120329_portletWidget/framework/common/config/CommonPortalEntityLabels.xml
 Tue Oct 30 21:19:31 2012
@@ -73,6 +73,35 @@
          <value xml:lang="en">Short description</value>
          <value xml:lang="fr">Description courte</value>
      </property>
+    <property key="FieldDescription.PortletAttribute.roleTypeGroupId">
+        <value xml:lang="en">RoleType Group which will be used in add screen to show 
only roleType included in this roleTypeGroup. If this field is empty all role type will be 
.</value>
+        <value xml:lang="fr">Groupe de rôle parmi lequel l'utisateur choisira dans 
l'écran d'ajout. Si ce champ est vide tous les rôles apparaitront</value>
+    </property>
+    <property key="FieldDescription.PortletAttribute.partyRelationshipTypeId">
+        <value xml:lang="en">Show only Party Relationship with this 
partyRelationshipTypeId, or left empty if you want to show field</value>
+        <value xml:lang="fr">indiquer le type de relation à utiliser pour filtrer 
les relations à afficher, ou laisser le champ vide pour les afficher toutes et donc montrer ce 
champ</value>
+    </property>
+    <property key="FieldDescription.PortletAttribute.roleTypeGroupIdFrom">
+        <value xml:lang="en">If attribute roleType is empty, give roleTypeGroup 
which will be used in edit screen (add - update) to show only roleType included in this 
roleTypeGroup. In this case roleTypeId will be show in the list.</value>
+        <value xml:lang="fr">Si le champ Role est vide, indique le groupe de rôle 
parmi lequel l'utisateur choisira dans l'écran d'édition (ajout - modification). Le champ rôle 
d'origine sera alors affiché dans la liste.</value>
+    </property>
+    <property key="FieldDescription.PortletAttribute.roleTypeGroupIdTo"><!-- Copy 
from previous label (xxxxFrom) without change -->
+        <value xml:lang="en">If attribute roleType is empty, give roleTypeGroup 
which will be used in edit screen (add - update) to show only roleType included in this 
roleTypeGroup. In this case roleTypeId will be show in the list.</value>
+        <value xml:lang="fr">Si le champ Role est vide, indique le groupe de rôle 
parmi lequel l'utisateur choisira dans l'écran d'édition (ajout - modification). Le champ rôle de 
destination sera alors affiché dans la liste.</value>
+    </property>
+    <property key="FieldDescription.PortletAttribute.roleTypeIdFrom">
+        <value xml:lang="en">If this field is fielded, its value will used to filter 
list, will use on edit screen (add or update), the field roleType will not be show.</value>
+        <value xml:lang="fr">Si ce champ est renseigné, cela permet de filtrer la 
liste affiché et dans l'écran d'édition (ajout ou modification) ce sera la valeur utilisé, le 
champ role ne sera pas affiché à l'utilisateur.</value>
+    </property>
+    <property key="FieldDescription.PortletAttribute.roleTypeIdTo"><!-- Copy from 
previous label (xxxxFrom) without change -->
+        <value xml:lang="en">If this field is fielded, its value will used to filter 
list, will use on edit screen (add or update), the field roleType will not be show.</value>
+        <value xml:lang="fr">Si ce champ est renseigné, cela permet de filtrer la 
liste affiché et dans l'écran d'édition (ajout ou modification) ce sera la valeur utilisé, le 
champ role ne sera pas affiché à l'utilisateur.</value>
+    </property>
+    <property key="FieldDescription.PortletAttribute.titleLabel">
+        <value xml:lang="en">Label to use on the screenLet Title</value>
+        <value xml:lang="fr">Label à utiliser en tant que titre de la 
screenlet</value>
+    </property>
+
      <property key="FieldDescription.portletTypeId">
          <value xml:lang="en">Can be empty, define a portlet template name 
(enumCode): a screen in PortletTypeScreens.xml in common</value>
          <value xml:lang="fr">Peux être vide, défini le modèle de portlet, le nom 
(enumCode) correspond à un screen dans PortletTypeScreens.xml dans common</value>
@@ -306,6 +335,15 @@
          <value xml:lang="fr">Mes paiements</value>
          <value xml:lang="vi">Thanh toán Riêng</value>
      </property>
+    <property key="PortalPage.portalPageName.PartyMgmt">
+        <value xml:lang="en">Party Management</value>
+        <value xml:lang="fr">Gestion des acteurs</value>
+    </property>
+    <property key="PortalPage.portalPageName.PartyRecap">
+        <value xml:lang="en">Party Profile Overview</value>
+        <value xml:lang="fr">Détail d'un acteur</value>
+    </property>
+
      <property key="PortalPage.portalPageName.ProductStoreFacility">
          <value xml:lang="de">Lager</value>
          <value xml:lang="en">Facility</value>
@@ -328,4 +366,61 @@
          <value xml:lang="fr">Liste des icônes utilisables dans les 
portlets</value>
      </property>
      <!--#Eam# icons-purpose -->
+    <property key="PortalPortlet.portletName.SelectParty">
+        <value xml:lang="en">Select one Party</value>
+        <value xml:lang="fr">Sélection d'un acteur</value>
+    </property>
+    <property key="PortalPortlet.description.SelectParty">
+        <value xml:lang="en">Choose Party to show Details Portal Page</value>
+        <value xml:lang="fr">Sélection de l'acteur pour lequel on souhaite 
l'affichage de la page portail détail</value>
+    </property>
+    <property key="PortalPortlet.portletName.PartyInfo">
+        <value xml:lang="en">Party Info</value>
+        <value xml:lang="fr">Descriptif d'un acteur</value>
+    </property>
+    <property key="PortalPortlet.description.PartyInfo">
+        <value xml:lang="en">General information about a party, person or party 
group. Show and edit</value>
+        <value xml:lang="fr">Informations générales d'un acteur, une personne ou 
un groupe, affiche et édite</value>
+    </property>
+    <property key="PortalPortlet.portletName.PartyUserLogins">
+        <value xml:lang="en">Party user login list</value>
+        <value xml:lang="fr">Liste des logins d'un acteur</value>
+    </property>
+    <property key="PortalPortlet.description.PartyUserLogins">
+        <value xml:lang="en">List and manage User Logins of a party. Show and edit 
security informations (password, ...)</value>
+        <value xml:lang="fr">Liste et gestion des utilisateurs de connexion d'un 
acteur. Permet les modifications des informations de sécurités (mot de passe, groupe de sécurité, 
...)</value>
+    </property>
+    <property key="PortalPortlet.portletName.ContactMechMgmt">
+        <value xml:lang="en">Contact information management</value>
+        <value xml:lang="fr">Coordonnées de l'acteur</value>
+    </property>
+    <property key="PortalPortlet.description.ContactMechMgmt">
+        <value xml:lang="en">List all Contacts information for the party. Show and 
edit</value>
+        <value xml:lang="fr">Liste les coordonnées de l'acteur, affichage  et 
édition</value>
+    </property>
+    <property key="PortalPortlet.portletName.PartyRelationFroms">
+        <value xml:lang="en">Parties associated to the Party</value>
+        <value xml:lang="fr">Liste des acteurs associés à l'acteur</value>
+    </property>
+    <property key="PortalPortlet.description.PartyRelationFroms">
+        <value xml:lang="en">List Parties associated with Party, relation type and 
role type from and to are configurable. Show and edit association</value>
+        <value xml:lang="fr">Liste des acteurs associés à l'acteur, le type de 
relation et les roles associés sont configurable. Affichage  et édition</value>
+    </property>
+    <property key="PortalPortlet.portletName.PartyRelationTos">
+        <value xml:lang="en">Party Lists to which it is associated</value>
+        <value xml:lang="fr">Liste des acteurs auxquels il est 
associés</value>
+    </property>
+    <property key="PortalPortlet.description.PartyRelationTos">
+        <value xml:lang="en">Party Lists to which it is associated, relation type 
and role type from and to are configurable. Show and edit association</value>
+        <value xml:lang="fr">Liste des acteurs auxquels il est associés, le type de 
relation et les roles associés sont configurable. Affichage  et édition</value>
+    </property>
+    <property key="PortalPortlet.portletName.PartyRoles">
+        <value xml:lang="en">Party Roles List</value>
+        <value xml:lang="fr">Liste des rôles de l'acteur</value>
+    </property>
+    <property key="PortalPortlet.description.PartyRoles">
+        <value xml:lang="en">Lists all (or only for a role group) roles for Party. 
Show and edit</value>
+        <value xml:lang="fr">Liste tous (ou uniquement ceux d'un groupe de rôle) 
les rôle de l'acteur. Affichage  et édition</value>
+    </property>
+
  </resource>
\ No newline at end of file

Modified: 
ofbiz/branches/20120329_portletWidget/framework/common/config/CommonUiLabels.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/config/CommonUiLabels.xml?rev=1403874&r1=1403873&r2=1403874&view=diff
==============================================================================
--- 
ofbiz/branches/20120329_portletWidget/framework/common/config/CommonUiLabels.xml
 (original)
+++ 
ofbiz/branches/20120329_portletWidget/framework/common/config/CommonUiLabels.xml
 Tue Oct 30 21:19:31 2012
@@ -847,6 +847,13 @@
          <value xml:lang="zh-CN">关联</value>
          <value xml:lang="zh-TW">關連</value>
      </property>
+    <!--#Bam# : CommonPortlet -->
+    <property key="CommonAssociateExistingNote">
+        <value xml:lang="en">Associate an already existing note</value>
+        <value xml:lang="fr">Associer une note déjà existante</value>
+    </property>
+    <!--#Eam# : CommonPortlet -->
+
      <property key="CommonAssocs">
          <value xml:lang="ar">شركاء</value>
          <value xml:lang="de">Assoziationen</value>
@@ -5050,6 +5057,13 @@
          <value xml:lang="fr">Recherche langue</value>
          <value xml:lang="vi">Chọn Đất nước</value>
      </property>
+    <!--#Bam# : CommonPortlet -->
+    <property key="CommonLookupNote">
+        <value xml:lang="en">Lookup Note</value>
+        <value xml:lang="fr">rechercher note</value>
+    </property>
+    <!--#Eam# : CommonPortlet -->
+
      <property key="CommonLookupWhitepages">
          <value xml:lang="en">Look up White pages</value>
          <value xml:lang="es">Páginas Blancas</value>
@@ -6107,6 +6121,13 @@
          <value xml:lang="zh-CN">å½“å‰æ²¡æœ‰ä»»åŠ¡ï¼Œéœ€è¦ä½ 
的关注。</value>
          <value xml:lang="zh-TW">現在沒有任務需要處理。</value>
      </property>
+    <!--#Bam# : CommonPortlet -->
+    <property key="CommonNoteNameOptional">
+        <value xml:lang="en">Optional, only used in loookup search.</value>
+        <value xml:lang="fr">Optionnel, utilisé uniquement lors de 
recherche.</value>
+    </property>
+    <!--#Eam# : CommonPortlet -->
+
      <property key="CommonNoUomConversionFound">
          <value xml:lang="ar">علاقة تحويل وحدات القياس غير 
موجودة</value>
          <value xml:lang="de">Die Beziehung der Einheit für die Konversion wurde 
nicht gefunden</value>
@@ -7595,6 +7616,13 @@
          <value xml:lang="zh-CN">费用</value>
          <value xml:lang="zh-TW">評等</value>
      </property>
+    <!--#Bam# : ContactMechMgmtPortlet -->
+    <property key="CommonReactivate">
+        <value xml:lang="en">Reactivate</value>
+        <value xml:lang="fr">Réactiver</value>
+    </property>
+    <!--#Eam# : ContactMechMgmtPortlet -->
+
      <property key="CommonReady">
          <value xml:lang="ar">جاهز</value>
          <value xml:lang="de">Fertig</value>
@@ -12447,6 +12475,83 @@
          <value xml:lang="zh">销售管理</value>
          <value xml:lang="zh-TW">銷售</value>
      </property>
+    <!--#Bam# : ContactMechMgmtPortlet -->
+    <property key="Tooltips_useCountryCode">
+        <value xml:lang="en">Use separate countryCode field on telecom 
number</value>
+        <value xml:lang="fr">Utiliser le champs de numéro de pays séparer du 
numéro de téléphone</value>
+    </property>
+
+    <property key="Tooltips_useAreaCode">
+        <value xml:lang="en">Use separate areaCode field on telecom 
number</value>
+        <value xml:lang="fr">Utiliser le champs de numéros de région séparer du 
numéro de téléphone</value>
+    </property>
+
+    <property key="Tooltips_useExtCode">
+        <value xml:lang="en">Use separate extCode field on telecom 
number</value>
+        <value xml:lang="fr">Utiliser le champs code externe séparer du numéro de 
téléphone</value>
+    </property>
+
+    <property key="Tooltips_showMenuAddTelecomNumber">
+        <value xml:lang="en">show menu add telecomNumber</value>
+        <value xml:lang="fr">Voir le menu d'ajout d'un numéro de 
téléphone</value>
+    </property>
+
+    <property key="Tooltips_showMenuAddMobileNumber">
+        <value xml:lang="en">show menu add MobileNumber</value>
+        <value xml:lang="fr">Voir le menu d'ajout d'un mobile</value>
+    </property>
+
+    <property key="Tooltips_showMenuAddFax">
+        <value xml:lang="en">show menu add Fax Number</value>
+        <value xml:lang="fr">Voir le menu d'ajout d'un fax</value>
+    </property>
+
+    <property key="Tooltips_showMenuAddPostalAddress">
+        <value xml:lang="en">show menu add PostalAddress</value>
+        <value xml:lang="fr">Voir le menu d'ajout d'une adresse postale</value>
+    </property>
+
+    <property key="Tooltips_showMenuAddEmail">
+        <value xml:lang="en">show menu add Email</value>
+        <value xml:lang="fr">Voir le menu d'ajout d'un couriel</value>
+    </property>
+
+    <property key="Tooltips_showMenuAddOther">
+        <value xml:lang="en">show menu add other contact</value>
+        <value xml:lang="fr">Voir le menu d'ajout d'autres coordonnées</value>
+    </property>
+
+    <property key="Tooltips_enableGeolocation">
+        <value xml:lang="en">Enable Gelocation icon</value>
+        <value xml:lang="fr">Activer l'îcone de Géolocalisation sur les adresses 
postales</value>
+    </property>
+
+    <property key="Tooltips_defaultTelecomNumberPurposeId">
+        <value xml:lang="en">When create a telecomNumber use this purpose by 
default</value>
+        <value xml:lang="fr">Lors de la création d'un téléphone fixe, on utilise 
ce but par défaut</value>
+    </property>
+
+    <property key="Tooltips_defaultMobilePurposeId">
+        <value xml:lang="en">When create a mobile Number use this purpose by 
default</value>
+        <value xml:lang="fr">Lors de la création d'un mobile, on utilise ce but par 
défaut</value>
+    </property>
+
+    <property key="Tooltips_defaultFaxPurposeId">
+        <value xml:lang="en">When create a fax number use this purpose by 
default</value>
+        <value xml:lang="fr">Lors de la création d'un fax, on utilise ce but par 
défaut</value>
+    </property>
+
+    <property key="Tooltips_defaultPostalAddressPurposeId">
+        <value xml:lang="en">When create a postalAddress use this purpose by 
default</value>
+        <value xml:lang="fr">Lors de la création d'une adresse postale, on utilise 
ce but par défaut</value>
+    </property>
+
+    <property key="Tooltips_defaultEmailAddressPurposeId">
+        <value xml:lang="en">When create a email use this purpose by 
default</value>
+        <value xml:lang="fr">Lors de la création d'un courriel, on utilise ce but 
par défaut</value>
+    </property>
+    <!--#Eam# : ContactMechMgmtPortlet -->
+
      <property key="Web Pos">
          <value xml:lang="en">Web Pos</value>
          <value xml:lang="es">POS web</value>

Modified: 
ofbiz/branches/20120329_portletWidget/framework/common/script/org/ofbiz/common/PortalPageMethods.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/script/org/ofbiz/common/PortalPageMethods.xml?rev=1403874&r1=1403873&r2=1403874&view=diff
==============================================================================
--- 
ofbiz/branches/20120329_portletWidget/framework/common/script/org/ofbiz/common/PortalPageMethods.xml
 (original)
+++ 
ofbiz/branches/20120329_portletWidget/framework/common/script/org/ofbiz/common/PortalPageMethods.xml
 Tue Oct 30 21:19:31 2012
@@ -156,4 +156,14 @@ under the License.
          <call-simple-method method-name="duplicatePortalPageDetails"/>
</simple-method>
+
+
+    <simple-method method-name="hasPortalAdminSecurity" short-description="test if 
user login as PORTAL_ADMIN and put adminSecurity in widget">
+      <if-has-permission permission="PORTALPAGE" action="_ADMIN">
+        <set field="widget.hasPortalAdminSecurity" value="true" 
type="Boolean"/>
+      <else>
+        <set field="widget.hasPortalAdminSecurity" value="false" 
type="Boolean"/>
+        </else>
+      </if-has-permission>
+    </simple-method>
  </simple-methods>

Modified: 
ofbiz/branches/20120329_portletWidget/framework/common/script/org/ofbiz/common/test/UserLoginTests.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/script/org/ofbiz/common/test/UserLoginTests.xml?rev=1403874&r1=1403873&r2=1403874&view=diff
==============================================================================
--- 
ofbiz/branches/20120329_portletWidget/framework/common/script/org/ofbiz/common/test/UserLoginTests.xml
 (original)
+++ 
ofbiz/branches/20120329_portletWidget/framework/common/script/org/ofbiz/common/test/UserLoginTests.xml
 Tue Oct 30 21:19:31 2012
@@ -35,4 +35,50 @@
          </assert>
          <check-errors/>
      </simple-method>
+
+    <simple-method method-name="testCreateUserLoginAndSecurityGroup" short-description="Test 
case for service createUserLoginAndSecurityGroup" login-required="false">
+      <!-- this service is call from portlet, it uses portletAttribute to find 
the securityGroupId, so start by created one  -->
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set field="serviceCtx.userLogin" from-field="userLogin"/>
+        <set field="serviceCtx.portalPageId" value="MYPORTAL_EMPLOYEE1"/>
+        <set field="serviceCtx.portalPortletId" value="PartyUserLogins"/>
+        <set field="serviceCtx.portletSeqId" value="00001"/>
+        <set field="serviceCtx.attrName" value="securityGroupId"/>
+        <set field="serviceCtx.attrValue" value="MYPORTAL_EMPLOYEE"/>
+        <call-service service-name="createPortletAttribute" 
in-map-name="serviceCtx"/>
+
+        <set field="service2Ctx.userLogin" from-field="userLogin"/>
+        <set field="userLoginId" value="demo.person1"/>
+        <set field="service2Ctx.userLoginId" from-field="userLoginId"/>
+        <set field="service2Ctx.enabled" value="Y"/>
+        <set field="service2Ctx.currentPassword" value="ofbiz"/>
+        <set field="service2Ctx.currentPasswordVerify" value="ofbiz"/>
+        <set field="service2Ctx.portalPageId" value="MYPORTAL_EMPLOYEE1"/>
+        <set field="service2Ctx.portalPortletId" value="PartyUserLogins"/>
+        <set field="service2Ctx.portletSeqId" value="00001"/>
+        <call-service service-name="createUserLoginAndSecurityGroup" 
in-map-name="service2Ctx"/>
+        <entity-one entity-name="UserLogin" value-field="userLogin"/>
+        <assert>
+            <not><if-empty field="userLogin"/></not>
+            <if-compare field="userLogin.enabled" operator="equals" value="Y"/>
+        </assert>
+        <check-errors/>
+        <entity-count count-field="groupCount" 
entity-name="UserLoginSecurityGroup">
+          <condition-expr field-name="userLoginId" value="demo.person1"/>
+        </entity-count>
+        <assert>
+          <if-compare operator="equals" value="1" field="groupCount"/>
+        </assert>
+        <check-errors/>
+        <entity-and list="securityGroups" entity-name="UserLoginSecurityGroup">
+          <field-map field-name="userLoginId" value="demo.person1"/>
+        </entity-and>
+        <first-from-list entry="securityGroup" list="securityGroups"/>
+        <assert>
+          <if-compare operator="equals" value="MYPORTAL_EMPLOYEE" 
field="securityGroup.groupId"/>
+        </assert>
+        <check-errors/>
+    </simple-method>
  </simple-methods>

Modified: 
ofbiz/branches/20120329_portletWidget/framework/common/servicedef/services_security.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/servicedef/services_security.xml?rev=1403874&r1=1403873&r2=1403874&view=diff
==============================================================================
--- 
ofbiz/branches/20120329_portletWidget/framework/common/servicedef/services_security.xml
 (original)
+++ 
ofbiz/branches/20120329_portletWidget/framework/common/servicedef/services_security.xml
 Tue Oct 30 21:19:31 2012
@@ -92,6 +92,18 @@ under the License.
      </service>
<!-- ProtectedView to SecurityGroup services -->
+    <service name="createUserLoginAndSecurityGroup" engine="java"
+        location="org.ofbiz.common.login.LoginServices" 
invoke="createUserLoginAndSecurityGroup" auth="true">
+        <description>Create UserLogin and add a SecurityGroupId to the 
userLogin.
+                     securityGroupId is read directly as a portletAttribute 
"securityGroupId".
+                     Tested by a JunitTest</description>
+        <implements service="createUserLogin"/>
+<!--        <attribute name="securityGroupId" mode="IN" type="String" 
optional="false"/> to avoid user modification on client side, so read portlet attribute-->
+        <attribute name="portalPageId" type="String" mode="IN" 
optional="false"/>
+        <attribute name="portalPortletId" type="String" mode="IN" 
optional="false"/>
+        <attribute name="portletSeqId" type="String" mode="IN" 
optional="false"/>
+    </service>
+
      <service name="addProtectedViewToSecurityGroup" engine="entity-auto" invoke="create" 
default-entity-name="ProtectedView" auth="true">
          <description>Add a Protected View to a SecurityGroup</description>
          <permission-service service-name="securityPermissionCheck" 
main-action="CREATE"/>

Modified: 
ofbiz/branches/20120329_portletWidget/framework/common/src/org/ofbiz/common/login/LoginServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/src/org/ofbiz/common/login/LoginServices.java?rev=1403874&r1=1403873&r2=1403874&view=diff
==============================================================================
--- 
ofbiz/branches/20120329_portletWidget/framework/common/src/org/ofbiz/common/login/LoginServices.java
 (original)
+++ 
ofbiz/branches/20120329_portletWidget/framework/common/src/org/ofbiz/common/login/LoginServices.java
 Tue Oct 30 21:19:31 2012
@@ -50,6 +50,7 @@ import org.ofbiz.entity.util.EntityFindO
  import org.ofbiz.entity.util.EntityListIterator;
  import org.ofbiz.security.Security;
  import org.ofbiz.service.DispatchContext;
+import org.ofbiz.service.GenericServiceException;
  import org.ofbiz.service.LocalDispatcher;
  import org.ofbiz.service.ModelService;
  import org.ofbiz.service.ServiceUtil;
@@ -995,4 +996,37 @@ public class LoginServices {
          }
          return passwordMatches;
      }
+
+    /** Create UserLogin and add a SecurityGroupId to the userLogin. securityGroupId is 
read directly as a portletAttribute "securityGroupId"
+     *@param ctx The DispatchContext that this service is operating in
+     *@param context Map containing the input parameters
+     *@return Map with the result of the service, the output parameters
+     * @throws GenericServiceException
+     * @throws GenericEntityException
+     */
+    public static Map<String, Object> 
createUserLoginAndSecurityGroup(DispatchContext ctx, Map<String, ?> context) throws 
GenericServiceException, GenericEntityException {
+        Map<String, Object> result = FastMap.newInstance();
+        Delegator delegator = ctx.getDelegator();
+        GenericValue loggedInUserLogin = (GenericValue) 
context.get("userLogin");
+        Locale locale = (Locale) context.get("locale");
+        LocalDispatcher dispatcher = ctx.getDispatcher();
+        Map<String, Object> createUserLoginContext = 
ctx.makeValidContext("createUserLogin", "IN", context);
+        Map<String, Object> resultMap = dispatcher.runSync("createUserLogin", 
createUserLoginContext);
+        if ( ServiceUtil.isError(resultMap) ) return resultMap;
+
+        // now search securityGroupId by reading portletAttribute
+        GenericValue portletAttribute = delegator.findOne("PortletAttribute", 
true,
+                "portalPageId",    context.get("portalPageId"),
+                "portalPortletId", context.get("portalPortletId"),
+                "portletSeqId",    context.get("portletSeqId"),
+                "attrName",        "securityGroupId" );
+        if (UtilValidate.isNotEmpty(portletAttribute)) {
+            Map<String, Object> addToGroupContext = 
UtilMisc.toMap("userLogin",loggedInUserLogin,"locale",locale);
+            addToGroupContext.put("userLoginId", context.get("userLoginId"));
+            addToGroupContext.put("groupId", 
portletAttribute.get("attrValue"));
+            addToGroupContext.put("fromDate", UtilDateTime.nowTimestamp());
+            return dispatcher.runSync("addUserLoginToSecurityGroup", 
addToGroupContext);
+        }
+        return result;
+    }
  }

Modified: 
ofbiz/branches/20120329_portletWidget/framework/common/webcommon/WEB-INF/common-controller.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/webcommon/WEB-INF/common-controller.xml?rev=1403874&r1=1403873&r2=1403874&view=diff
==============================================================================
--- 
ofbiz/branches/20120329_portletWidget/framework/common/webcommon/WEB-INF/common-controller.xml
 (original)
+++ 
ofbiz/branches/20120329_portletWidget/framework/common/webcommon/WEB-INF/common-controller.xml
 Tue Oct 30 21:19:31 2012
@@ -210,6 +210,8 @@ under the License.
<!--========================== AJAX events =====================-->
      <!-- Get states related to a country -->
+    <request-map uri="LookupNote"><security https="true" auth="true"/><response name="success" 
type="view" value="LookupNote"/></request-map><!--#Eam# portlet-common -->
+
      <request-map uri="getAssociatedStateList">
          <security https="true" auth="false"/>
          <event type="service" invoke="getAssociatedStateList"/>
@@ -280,4 +282,6 @@ under the License.
      <view-map name="LookupGeo" type="screen" 
page="component://common/widget/LookupScreens.xml#LookupGeo"/>
      <view-map name="LookupGeoName" type="screen" 
page="component://common/widget/LookupScreens.xml#LookupGeoName"/>
      <view-map name="LookupLocale" type="screen" 
page="component://common/widget/LookupScreens.xml#LookupLocale"/>
+
+    <view-map name="LookupNote" type="screen" 
page="component://common/widget/LookupScreens.xml#LookupNote"/><!--#Eam: portlet-common -->
  </site-conf>

Modified: 
ofbiz/branches/20120329_portletWidget/framework/common/widget/LookupForms.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/widget/LookupForms.xml?rev=1403874&r1=1403873&r2=1403874&view=diff
==============================================================================
--- 
ofbiz/branches/20120329_portletWidget/framework/common/widget/LookupForms.xml 
(original)
+++ 
ofbiz/branches/20120329_portletWidget/framework/common/widget/LookupForms.xml 
Tue Oct 30 21:19:31 2012
@@ -128,4 +128,29 @@ under the License.
          </field>
          <field name="localeName" 
title="${uiLabelMap.CommonLanguageTitle}"><display/></field>
      </form>
+
+<!--#Bam# portlet-common -->
+    <form name="LookupNote" type="single" target="LookupNote">
+        <field name="noteId" 
title="${uiLabelMap.CommonId}"><text-find/></field>
+        <field name="noteName" 
title="${uiLabelMap.CommonName}"><text-find/></field>
+        <field name="noConditionFind"><hidden value="Y"/><!-- if this isn't there then 
with all fields empty no query will be done --></field>
+        <field name="submitButton" title="${uiLabelMap.CommonFind}"><submit 
button-type="button"/></field>
+    </form>
+    <form name="listLoookupNote" list-name="listIt" target="" title="" type="list" 
paginate-target="LookupNote"
+        odd-row-style="alternate-row" default-table-style="basic-table 
hover-bar">
+        <actions>
+            <service service-name="performFind" result-map="result" 
result-map-list="listIt">
+                <field-map field-name="inputFields" from-field="parameters"/>
+                <field-map field-name="entityName" value="NoteData"/>
+                <field-map field-name="orderBy" value="noteName"/>
+                <field-map field-name="viewIndex" from-field="viewIndex"/>
+                <field-map field-name="viewSize" from-field="viewSize"/>
+            </service>
+        </actions>
+        <field name="noteId" title="${uiLabelMap.CommonId}" 
widget-style="buttontext">
+            <hyperlink also-hidden="false" target-type="plain" description="${noteId}" 
target="javascript:set_value('${noteId}')"/>
+        </field>
+        <field name="noteName" 
title="${uiLabelMap.CommonName}"><display/></field>
+    </form>
+<!--#Eam# portlet-common -->
  </forms>

Modified: 
ofbiz/branches/20120329_portletWidget/framework/common/widget/LookupScreens.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/common/widget/LookupScreens.xml?rev=1403874&r1=1403873&r2=1403874&view=diff
==============================================================================
--- 
ofbiz/branches/20120329_portletWidget/framework/common/widget/LookupScreens.xml 
(original)
+++ 
ofbiz/branches/20120329_portletWidget/framework/common/widget/LookupScreens.xml 
Tue Oct 30 21:19:31 2012
@@ -249,4 +249,30 @@ under the License.
              </widgets>
          </section>
      </screen>
+
+    <!--#Bam# portlet-common -->
+    <screen name="LookupNote">
+        <section>
+            <actions>
+                <property-map resource="CommonUiLabels" map-name="uiLabelMap" 
global="true"/>
+                <set field="title" value="${uiLabelMap.CommonLookupNote}"/>
+                <set field="queryString" from-field="result.queryString"/>
+                <set field="viewIndex" from-field="parameters.VIEW_INDEX" 
type="Integer"/>
+                <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" 
default-value="20"/>
+                <set field="entityName" value="NoteData"/>
+                <set field="searchFields" value="[noteId, noteName]"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="LookupDecorator" 
location="component://common/widget/CommonScreens.xml">
+                    <decorator-section name="search-options">
+                        <include-form name="LookupNote" 
location="component://common/widget/LookupForms.xml"/>
+                    </decorator-section>
+                    <decorator-section name="search-results">
+                        <include-form name="listLoookupNote" 
location="component://common/widget/LookupForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <!--#Eam# portlet-common -->
  </screens>

Added: 
ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlets/ContactMechMgmt.png
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlets/ContactMechMgmt.png?rev=1403874&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlets/ContactMechMgmt.png
------------------------------------------------------------------------------
     svn:mime-type = image/png

Added: 
ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlets/FindParties.png
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlets/FindParties.png?rev=1403874&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlets/FindParties.png
------------------------------------------------------------------------------
     svn:mime-type = image/png

Added: 
ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlets/PartyIdentification.png
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlets/PartyIdentification.png?rev=1403874&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlets/PartyIdentification.png
------------------------------------------------------------------------------
     svn:mime-type = image/png

Added: 
ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlets/PartyPaymentMethods.png
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlets/PartyPaymentMethods.png?rev=1403874&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlets/PartyPaymentMethods.png
------------------------------------------------------------------------------
     svn:mime-type = image/png

Added: 
ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlets/PartyRoles.png
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlets/PartyRoles.png?rev=1403874&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlets/PartyRoles.png
------------------------------------------------------------------------------
     svn:mime-type = image/png

Added: 
ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlets/SelectParty.png
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlets/SelectParty.png?rev=1403874&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
ofbiz/branches/20120329_portletWidget/framework/images/webapp/images/portlets/SelectParty.png
------------------------------------------------------------------------------
     svn:mime-type = image/png



Reply via email to