The first thing that you need to make sure is that your servicedef implements uploadFileInterface, add following line to your servicedef:
<implements service="uploadFileInterface"/> The next thing you will need to do is to pass in the following input parameters (comes from uploadFileInterface) to addAdditionalViewForProduct service: <set field="addAdditionalViewForProduct.uploadedFile" from-field="parameters.uploadedFile"/> (you already have this one) <set field="addAdditionalViewForProduct._uploadedFile_fileName" from-field="parameters._uploadedFile_fileName"/> <set field="addAdditionalViewForProduct._uploadedFile_contentType" from-field="parameters._uploadedFile_contentType"/> Once this is done your service should work. -- Thanks & Regards Mridul Pathak Hotwax Media http://www.hotwaxmedia.com [email protected] ------------------------------------------------- direct: +91 - 942.592.6892 On Thu, Jan 28, 2010 at 1:37 PM, Alexander1893 < [email protected]> wrote: > > Hi all, > > I'm trying to use the service "addAdditionalViewForProduct" and I'm havin > some problems. > > I have the following form in the front-end: > > <form type="upload" name="singleFileUpload" > target="performSingleFileUpload"> > <field name="uploadedFile" title="chose file"> > <file/> > </field> > <field name="submitButton" title="${uiLabelMap.CommonAdd}" > widget-style="smallSubmit"> > <submit button-type="button" /> > </field> > </form> > > After submitting I do some other things necessary (calling some services > etc.). > > Than I prepare the Input-Map for the service "addAdditionalViewForProduct": > > <set field="addAdditionalViewForProduct.userLogin" > from-field="userLogin.userLogin"/> > <set field="addAdditionalViewForProduct.productId" > from-field="productRoleAttributes.productId"/> > > <set > field="addAdditionalViewForProduct.productContentTypeId" > value="DIGITAL_DOWNLOAD"/> > <set field="addAdditionalViewForProduct.uploadedFile" > from-field="parameters.uploadedFile"/> > > And then I call the service: > > <call-service service-name="addAdditionalViewForProduct" > in-map-name="addAdditionalViewForProduct"/> > > When I do that, I don't get any errors in the log - but nothing really > happens (the file is not associated with the product...) > I debugged the "ProductServices.java" in Eclipse - and obviously "the > imageData" ist "Null" in after this Line: > > ByteBuffer imageData = (ByteBuffer) context.get("uploadedFile"); > > Can anyone help? > > Thanks a lot! > Alexander > > > > > > -- > View this message in context: > http://n4.nabble.com/Problems-calling-addAdditionalViewForProduct-tp1397293p1397293.html > Sent from the OFBiz - User mailing list archive at Nabble.com. >
