Author: jaz
Date: Thu Jan 4 18:20:15 2007 New Revision: 492853 URL: http://svn.apache.org/viewvc?view=rev&rev=492853 Log: refactored content implementations; added ability to upload documents to a user's profile Modified: ofbiz/trunk/applications/party/config/PartyUiLabels.properties ofbiz/trunk/applications/party/data/PartyTypeData.xml ofbiz/trunk/applications/party/servicedef/secas.xml ofbiz/trunk/applications/party/servicedef/services.xml ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/viewprofile.bsh ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml ofbiz/trunk/applications/party/webapp/partymgr/party/viewprofile.ftl ofbiz/trunk/applications/party/widget/partymgr/CommonScreens.xml Modified: ofbiz/trunk/applications/party/config/PartyUiLabels.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/config/PartyUiLabels.properties?view=diff&rev=492853&r1=492852&r2=492853 ============================================================================== --- ofbiz/trunk/applications/party/config/PartyUiLabels.properties (original) +++ ofbiz/trunk/applications/party/config/PartyUiLabels.properties Thu Jan 4 18:20:15 2007 @@ -146,6 +146,7 @@ PartyAddUserLoginToSecurityGroup=Add UserLogin to Security Group PartyAvsString=AVS String PartyAreaCode=Area Code +PartyAttachContent=Attach Content PartyAttentionName=Attention Name PartyAttribute=Party Attribute PartyAttributes=Party Attribute(s) @@ -347,6 +348,7 @@ PartyNickname=Nickname PartyNoCommunicationFound=No Communication Events PartyNoContactInformation=No contact information on file. +PartyNoContent=No Content PartyNoMatch=No records match. PartyNoNameGroup=No name (group) PartyNoNotesForParty=No notes for this party. Modified: ofbiz/trunk/applications/party/data/PartyTypeData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/data/PartyTypeData.xml?view=diff&rev=492853&r1=492852&r2=492853 ============================================================================== --- ofbiz/trunk/applications/party/data/PartyTypeData.xml (original) +++ ofbiz/trunk/applications/party/data/PartyTypeData.xml Thu Jan 4 18:20:15 2007 @@ -107,7 +107,9 @@ <ContactMechTypePurpose contactMechPurposeTypeId="PRIMARY_WEB_URL" contactMechTypeId="WEB_ADDRESS"/> <EnumerationType description="Party Content Purpose" enumTypeId="PTYCNT_PRP" hasTable="N" parentTypeId=""/> - <Enumeration description="Logo Image URL" enumCode="LGOIMGURL" enumId="PCPRP_LGOIMGURL" sequenceId="01" enumTypeId="PTYCNT_PRP"/> + <Enumeration description="Internal Content" enumCode="INTERNAL" enumId="PCPRP_INTERNAL" sequenceId="01" enumTypeId="PTYCNT_PRP"/> + <Enumeration description="User Definied Content" enumCode="USERDEF" enumId="PCPRP_USERDEF" sequenceId="02" enumTypeId="PTYCNT_PRP"/> + <Enumeration description="Logo Image URL" enumCode="LGOIMGURL" enumId="PCPRP_LGOIMGURL" sequenceId="03" enumTypeId="PTYCNT_PRP"/> <EnumerationType description="Employment Status" enumTypeId="EMPLOY_STTS" hasTable="N" parentTypeId=""/> <Enumeration description="Full-time Employed" enumCode="FULLTIME" enumId="EMPS_FULLTIME" sequenceId="01" enumTypeId="EMPLOY_STTS"/> Modified: ofbiz/trunk/applications/party/servicedef/secas.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/secas.xml?view=diff&rev=492853&r1=492852&r2=492853 ============================================================================== --- ofbiz/trunk/applications/party/servicedef/secas.xml (original) +++ ofbiz/trunk/applications/party/servicedef/secas.xml Thu Jan 4 18:20:15 2007 @@ -77,4 +77,14 @@ <eca service="sendCommEventAsEmail" event="commit"> <action service="setCommEventComplete" mode="sync"/> </eca> + + <!-- party content services --> + <eca service="createPartyTextContent" event="invoke"> + <action service="createTextContent" mode="sync"/> + <action service="createPartyContent" mode="sync"/> + </eca> + <eca service="uploadPartyContentFile" event="invoke"> + <action service="createLocalFileContentFromStream" mode="sync"/> + <action service="createPartyContent" mode="sync"/> + </eca> </service-eca> Modified: ofbiz/trunk/applications/party/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/services.xml?view=diff&rev=492853&r1=492852&r2=492853 ============================================================================== --- ofbiz/trunk/applications/party/servicedef/services.xml (original) +++ ofbiz/trunk/applications/party/servicedef/services.xml Thu Jan 4 18:20:15 2007 @@ -665,6 +665,8 @@ <attribute name="communicationEventId" type="String" mode="IN" optional="false"/> </service> + <!-- party content services --> + <!-- old services <service name="createPartyContent" engine="simple" default-entity-name="Content" location="org/ofbiz/party/party/PartyServices.xml" invoke="createPartyContent" auth="false"> <description>Create Party Associated Content</description> @@ -689,6 +691,41 @@ <attribute mode="IN" name="partyId" optional="true" type="String"/> <attribute mode="IN" name="dataCategoryId" optional="true" type="String"/> </service> + --> + <service name="createPartyContent" engine="simple" default-entity-name="PartyContent" + location="org/ofbiz/party/content/PartyContentServices.xml" invoke="createPartyContent" auth="true"> + <description>Create a PartyContent record</description> + <auto-attributes mode="INOUT" include="pk" optional="false"/> + <auto-attributes mode="IN" include="nonpk" optional="false"/> + </service> + + <service name="updatePartyContent" engine="simple" default-entity-name="PartyContent" + location="org/ofbiz/party/content/PartyContentServices.xml" invoke="updatePartyContent" auth="true"> + <description>Update a PartyContent record</description> + <auto-attributes mode="INOUT" include="pk" optional="false"/> + <auto-attributes mode="IN" include="nonpk" optional="false"/> + </service> + + <service name="removePartyContent" engine="simple" default-entity-name="PartyContent" + location="org/ofbiz/party/content/PartyContentServices.xml" invoke="removePartyContent" auth="true"> + <description>Remove a PartyContent record</description> + <auto-attributes mode="IN" include="pk" optional="false"/> + </service> + + <service name="createPartyTextContent" engine="route" transaction-timeout="300" auth="true"> + <description>Creates a Text Document DataResource and Content Records</description> + <implements service="createTextContent" optional="false"/> + <implements service="createPartyContent" optional="false"/> + <override name="contentId" optional="true"/> + </service> + + <service name="uploadPartyContentFile" engine="route" transaction-timeout="300"> + <description>Upload and attach a file to a party</description> + <implements service="createLocalFileContentFromStream" optional="false"/> + <implements service="createPartyContent" optional="true"/> + <override name="contentId" optional="true"/> + </service> + <service name="getPartyEmail" engine="simple" location="org/ofbiz/party/party/PartyServices.xml" invoke="getPartyEmail" auth="false"> <description>Get the main party Email address</description> Modified: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/viewprofile.bsh URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/viewprofile.bsh?view=diff&rev=492853&r1=492852&r2=492853 ============================================================================== --- ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/viewprofile.bsh (original) +++ ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/viewprofile.bsh Thu Jan 4 18:20:15 2007 @@ -39,6 +39,9 @@ } } +content = delegator.findByAnd("PartyContent", UtilMisc.toMap("partyId", partyId)); +context.put("partyContent", content); + attributes = delegator.findByAnd("PartyAttribute", UtilMisc.toMap("partyId", partyId)); context.put("attributes", attributes); @@ -98,11 +101,16 @@ context.put("custRequestTypes", delegator.findAllCache("CustRequestType")); +// content purposes +contentPurposes = delegator.findByAnd("Enumeration", UtilMisc.toMap("enumTypeId", "PTYCNT_PRP"), UtilMisc.toList("sequenceId")); +context.put("contentPurposes", contentPurposes); // call the getOrderedSummaryInformation service to get the sub-total of valid orders in last X months -monthsToInclude = new Integer(12); -Map serviceIn = UtilMisc.toMap("partyId", partyId, "roleTypeId", "PLACING_CUSTOMER", "orderTypeId", "SALES_ORDER", "statusId", "ORDER_COMPLETED", "monthsToInclude", monthsToInclude, "userLogin", userLogin); -Map result = dispatcher.runSync("getOrderedSummaryInformation", serviceIn); -context.put("monthsToInclude", monthsToInclude); -context.put("totalSubRemainingAmount", result.get("totalSubRemainingAmount")); -context.put("totalOrders", result.get("totalOrders")); +if (partyId != null) { + monthsToInclude = new Integer(12); + Map serviceIn = UtilMisc.toMap("partyId", partyId, "roleTypeId", "PLACING_CUSTOMER", "orderTypeId", "SALES_ORDER", "statusId", "ORDER_COMPLETED", "monthsToInclude", monthsToInclude, "userLogin", userLogin); + Map result = dispatcher.runSync("getOrderedSummaryInformation", serviceIn); + context.put("monthsToInclude", monthsToInclude); + context.put("totalSubRemainingAmount", result.get("totalSubRemainingAmount")); + context.put("totalOrders", result.get("totalOrders")); +} Modified: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml?view=diff&rev=492853&r1=492852&r2=492853 ============================================================================== --- ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml Thu Jan 4 18:20:15 2007 @@ -847,7 +847,20 @@ <event type="simple" path="org/ofbiz/party/party/PartySimpleEvents.xml" invoke="updatePartyContent"/> <response name="success" type="view" value="EditPartyContents"/> </request-map> - + + <request-map uri="removePartyContent"> + <security auth="true" https="true"/> + <event type="service" invoke="removePartyContent"/> + <response name="success" type="view" value="EditPartyContents"/> + </request-map> + + <request-map uri="uploadPartyContent"> + <security auth="true" https="true"/> + <event type="service" invoke="uploadPartyContentFile"/> + <response name="success" type="view" value="viewprofile"/> + <response name="error" type="view" value="viewprofile"/> + </request-map> + <!-- Lookup request mappings --> <request-map uri="LookupPartyName"><security https="true" auth="true"/><response name="success" type="view" value="LookupPartyName"/></request-map> <request-map uri="LookupPerson"><security https="true" auth="true"/><response name="success" type="view" value="LookupPerson"/></request-map> Modified: ofbiz/trunk/applications/party/webapp/partymgr/party/viewprofile.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/party/viewprofile.ftl?view=diff&rev=492853&r1=492852&r2=492853 ============================================================================== --- ofbiz/trunk/applications/party/webapp/partymgr/party/viewprofile.ftl (original) +++ ofbiz/trunk/applications/party/webapp/partymgr/party/viewprofile.ftl Thu Jan 4 18:20:15 2007 @@ -603,6 +603,58 @@ </div> </#if> +<#-- Party Content --> +<div class="screenlet"> + <div class="screenlet-header"> + <div class="boxhead"> ${uiLabelMap.PartyContent}</div> + </div> + <div class="screenlet-body"> + <table width="100%" border="0" cellpadding="1"> + <#if partyContent?has_content> + <#list partyContent as pContent> + <#assign content = pContent.getRelatedOne("Content")> + <#assign contentType = content.getRelatedOneCache("ContentType")> + <#assign mimeType = content.getRelatedOneCache("MimeType")?if_exists> + <#assign status = content.getRelatedOneCache("StatusItem")> + <#assign pcPurpose = pContent.getRelatedOne("Enumeration")> + <tr> + <td><a href="<@ofbizUrl>img/${content.contentName}?imgId=${content.dataResourceId}</@ofbizUrl>" class="buttontext">${content.contentId}</a> + <td><div class="tabletext">${pcPurpose.description?if_exists}</div></td> + <td><div class="tabletext">${content.contentName?if_exists}</div></td> + <td><div class="tabletext">${(contentType.get("description",locale))?if_exists}</div></td> + <td><div class="tabletext">${(mimeType.description)?if_exists}</div></td> + <td><div class="tabletext">${(status.get("description",locale))?if_exists}</div></td> + <#-- <td><div class="tabletext">${contentRole.fromDate?if_exists}</div></td> --> + <td align="right"> + <a href="<@ofbizUrl>img/${content.contentName}?imgId=${content.dataResourceId}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonView}</a> + <a href="<@ofbizUrl>removePartyContent/viewprofile?contentId=${pContent.contentId}&partyId=${pContent.partyId}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonRemove}</a> + </td> + </tr> + </#list> + <#else> + <div class="tabletext">${uiLabelMap.PartyNoContent}</div> + </#if> + </table> + <div> </div> + <hr class="sepbar"/> + <div align="left" class="head3"><b><u>${uiLabelMap.PartyAttachContent}</u></b> + <div> </div> + <form method="post" enctype="multipart/form-data" action="<@ofbizUrl>uploadPartyContent</@ofbizUrl>" style="margin: 0;"> + <input type="hidden" name="dataCategoryId" value="PERSONAL"/> + <input type="hidden" name="contentTypeId" value="DOCUMENT"/> + <input type="hidden" name="statusId" value="CTNT_PUBLISHED"/> + <input type="hidden" name="partyId" value="${partyId}"/> + <input type="file" name="uploadedFile" size="20" class="inputBox"/> + <select name="contentPurposeEnumId" class="selectBox"> + <#list contentPurposes as contentPurpose> + <option value="${contentPurpose.enumId}">${contentPurpose.description?default(contentPurpose.enumId)}</option> + </#list> + <input type="submit" value="${uiLabelMap.CommonUpload}" class="smallSubmit"/> + </form> + </div> + </div> +</div> + <#-- Party Notes --> <div class="screenlet"> <div class="screenlet-header"> Modified: ofbiz/trunk/applications/party/widget/partymgr/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/CommonScreens.xml?view=diff&rev=492853&r1=492852&r2=492853 ============================================================================== --- ofbiz/trunk/applications/party/widget/partymgr/CommonScreens.xml (original) +++ ofbiz/trunk/applications/party/widget/partymgr/CommonScreens.xml Thu Jan 4 18:20:15 2007 @@ -103,6 +103,7 @@ </or> </condition> <widgets> + <label text="&nbsp;<br/>"/> <label style="head1" text="${uiLabelMap.PartyTheProfileOf} ${lookupPerson.personalTitle} ${lookupPerson.firstName} ${lookupPerson.middleName} ${lookupPerson.lastName} ${lookupPerson.suffix} ${lookupGroup.groupName}"/> </widgets> <fail-widgets> |
Free forum by Nabble | Edit this page |