Author: hansbak
Date: Wed Jun 3 07:00:09 2009 New Revision: 781280 URL: http://svn.apache.org/viewvc?rev=781280&view=rev Log: cleaned-up the commevent upload process, in create dataresource: create mime type when not provided Removed: ofbiz/trunk/applications/party/webapp/partymgr/communication/addAttachFile.ftl ofbiz/trunk/applications/party/webapp/partymgr/communication/attachFileList.ftl Modified: ofbiz/trunk/applications/content/script/org/ofbiz/content/data/DataServices.xml ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml Modified: ofbiz/trunk/applications/content/script/org/ofbiz/content/data/DataServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/script/org/ofbiz/content/data/DataServices.xml?rev=781280&r1=781279&r2=781280&view=diff ============================================================================== --- ofbiz/trunk/applications/content/script/org/ofbiz/content/data/DataServices.xml (original) +++ ofbiz/trunk/applications/content/script/org/ofbiz/content/data/DataServices.xml Wed Jun 3 07:00:09 2009 @@ -50,6 +50,12 @@ <set field="newEntity.statusId" from-field="statusItem.statusId"/> </if-empty> + <if-empty field="newEntity.mimeTypeId"> + <call-class-method class-name="org.ofbiz.content.data.DataResourceWorker" method-name="getMimeType" ret-field="newEntity.mimeTypeId"> + <field field="newEntity" type="GenericValue"/> + </call-class-method> + </if-empty> + <create-value value-field="newEntity"/> <field-to-result field="newEntity.dataResourceId" result-name="dataResourceId"/> </simple-method> Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml?rev=781280&r1=781279&r2=781280&view=diff ============================================================================== --- ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml (original) +++ ofbiz/trunk/applications/party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml Wed Jun 3 07:00:09 2009 @@ -102,18 +102,6 @@ </call-class-method> <set field="parameters.imageFileName" from-field="formInput.imageFileName"/> - <!-- Call bsh get file type --> - <call-bsh><![CDATA[ - String fileName = parameters.get("imageFileName"); - String mimeTypeId = fileName.substring(fileName.indexOf(".")+1,fileName.length()); - parameters.put("mimeType",mimeTypeId); - ]]> - </call-bsh> - - <!-- Get mime type from FileExtention --> - <set field="fileMap.fileExtensionId" value="${parameters.mimeType}"/> - <find-by-primary-key map="fileMap" value-field="mimeType" entity-name="FileExtension"/> - <!-- Create Data Resource --> <set-service-fields service-name="createContentFromUploadedFile" map="formInput.formInput" to-map="data"/> @@ -174,12 +162,9 @@ </call-service> <!-- Return to request --> - <set field="communicationEventTypeId" - from-field="formInput.formInput.communicationEventTypeId"/> - <set field="communicationEventId" from-field="formInput.formInput.communicationEventId"/> - <field-to-request field="communicationEventId" request-name="communicationEventId"/> - <field-to-request field="communicationEventTypeId" - request-name="communicationEventTypeId"/> + <field-to-request field="formInput.formInput.communicationEventId" request-name="communicationEventId"/> + <set field="my" value="My"/> + <field-to-request field="my"/> </simple-method> </simple-methods> 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?rev=781280&r1=781279&r2=781280&view=diff ============================================================================== --- ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml Wed Jun 3 07:00:09 2009 @@ -734,8 +734,8 @@ <request-map uri="uploadAttachFiletoEmail"> <security https="true" auth="true"/> <event type="simple" invoke="createCommunicationContent" path="component://party/script/org/ofbiz/party/communication/CommunicationEventEvents.xml"/> - <response name="success" type="view-last"/> - <response name="error" type="view" value="addAttachmentEmail"/> + <response name="success" type="view" value="EditCommunicationEvent"/> + <response name="error" type="view" value="EditCommunicationEvent"/> </request-map> <request-map uri="removeAttachFile"> <security https="true" auth="true"/> Modified: ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml?rev=781280&r1=781279&r2=781280&view=diff ============================================================================== --- ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml (original) +++ ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml Wed Jun 3 07:00:09 2009 @@ -760,6 +760,21 @@ <field name="imageData" map-name="empty"><file/></field> <field name="submitButton" title="${uiLabelMap.CommonUpload}"><submit/></field> </form> + + <form name="uploadContent" type="upload" target="uploadAttachFiletoEmail"> + <field name="dataCategoryId"><hidden value="PERSONAL"/></field> + <field name="contentTypeId"><hidden value="DOCUMENT"/></field> + <field name="statusId"><hidden value="CTNT_PUBLISHED"/></field> + <field name="partyId"><hidden value="${parameters.partyId}"/></field> + <field name="partyContentTypeId" ><hidden value="USERDEF"/></field> + <field name="roleTypeId"><hidden value="CONTENT"/></field> + <field name="communicationEventId"><hidden value="${parameters.communicationEventId}"/></field> + <field name="communicationEventTypeId"><hidden value="${communicationEventTypeId}"/></field> + <field name="parentCommEventId"><hidden value="${parameters.parentCommEventId}"/></field> + <field name="originalCommEventId"><hidden value="${parameters.originalCommEventId}"/></field> + <field name="uploadedFile"><file/></field> + <field name="upLoad" title="${uiLabelMap.CommonUpload}"><submit/></field> + </form> <form name="editCommTextContent" type="single" target="uploadCommEventContent" default-map-name="commEventContentDataResource" header-row-style="header-row" default-table-style="basic-table"> Modified: ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml?rev=781280&r1=781279&r2=781280&view=diff ============================================================================== --- ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml (original) +++ ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml Wed Jun 3 07:00:09 2009 @@ -419,8 +419,10 @@ <include-form name="ListCommRoles" location="component://party/webapp/partymgr/communication/CommForms.xml"/> <include-form name="AddEventRole" location="component://party/webapp/partymgr/communication/CommForms.xml"/> </screenlet> - <include-screen name="AttachFileList"/> - <include-screen name="addAttachmentEmail"/> + <screenlet title="${uiLabelMap.PartyCommContent}"> + <include-form name="listCommContent" location="component://party/webapp/partymgr/communication/CommForms.xml"/> + <include-form name="uploadContent" location="component://party/webapp/partymgr/communication/CommForms.xml"/> + </screenlet> </container> </fail-widgets> </section> |
Free forum by Nabble | Edit this page |