[jira] Created: (OFBIZ-1930) Added support for uploading additional Product Views (images)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (OFBIZ-1930) Added support for uploading additional Product Views (images)

Nicolas Malin (Jira)
Added support for uploading additional Product Views (images)
-------------------------------------------------------------

                 Key: OFBIZ-1930
                 URL: https://issues.apache.org/jira/browse/OFBIZ-1930
             Project: OFBiz
          Issue Type: New Feature
          Components: product
    Affects Versions: SVN trunk
            Reporter: Mridul Pathak
             Fix For: SVN trunk


Defined four ProductContentType's to support four additional views (images) to a Product.  Extended EditProductContent screen to support uploading these additional images.  New service for the same.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-1930) Added support for uploading additional Product Views (images)

Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-1930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mridul Pathak updated OFBIZ-1930:
---------------------------------

    Attachment: ProductAdditionalViews.patch

Here is the patch.

> Added support for uploading additional Product Views (images)
> -------------------------------------------------------------
>
>                 Key: OFBIZ-1930
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1930
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Mridul Pathak
>             Fix For: SVN trunk
>
>         Attachments: ProductAdditionalViews.patch
>
>
> Defined four ProductContentType's to support four additional views (images) to a Product.  Extended EditProductContent screen to support uploading these additional images.  New service for the same.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Assigned: (OFBIZ-1930) Added support for uploading additional Product Views (images)

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-1930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashish Vijaywargiya reassigned OFBIZ-1930:
------------------------------------------

    Assignee: Ashish Vijaywargiya

> Added support for uploading additional Product Views (images)
> -------------------------------------------------------------
>
>                 Key: OFBIZ-1930
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1930
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Mridul Pathak
>            Assignee: Ashish Vijaywargiya
>             Fix For: SVN trunk
>
>         Attachments: ProductAdditionalViews.patch
>
>
> Defined four ProductContentType's to support four additional views (images) to a Product.  Extended EditProductContent screen to support uploading these additional images.  New service for the same.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Assigned: (OFBIZ-1930) Added support for uploading additional Product Views (images)

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-1930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashish Vijaywargiya reassigned OFBIZ-1930:
------------------------------------------

    Assignee:     (was: Ashish Vijaywargiya)

Mridul is shortly adding the framework related changes in this patch.
So it will be good if someone having access of framework picks up and commit the code in the trunk.

--
Ashish

> Added support for uploading additional Product Views (images)
> -------------------------------------------------------------
>
>                 Key: OFBIZ-1930
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1930
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Mridul Pathak
>             Fix For: SVN trunk
>
>         Attachments: ProductAdditionalViews.patch
>
>
> Defined four ProductContentType's to support four additional views (images) to a Product.  Extended EditProductContent screen to support uploading these additional images.  New service for the same.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Assigned: (OFBIZ-1930) Added support for uploading additional Product Views (images)

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-1930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux reassigned OFBIZ-1930:
--------------------------------------

    Assignee: Jacques Le Roux

> Added support for uploading additional Product Views (images)
> -------------------------------------------------------------
>
>                 Key: OFBIZ-1930
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1930
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Mridul Pathak
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: ProductAdditionalViews.patch
>
>
> Defined four ProductContentType's to support four additional views (images) to a Product.  Extended EditProductContent screen to support uploading these additional images.  New service for the same.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1930) Added support for uploading additional Product Views (images)

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625772#action_12625772 ]

Mridul Pathak commented on OFBIZ-1930:
--------------------------------------

Sorry, I was busy today so wasn't able to upload the updated patch.  I'll try to upload the updated patch for improvements tomorrow.

> Added support for uploading additional Product Views (images)
> -------------------------------------------------------------
>
>                 Key: OFBIZ-1930
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1930
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Mridul Pathak
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: ProductAdditionalViews.patch
>
>
> Defined four ProductContentType's to support four additional views (images) to a Product.  Extended EditProductContent screen to support uploading these additional images.  New service for the same.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-1930) Added support for uploading additional Product Views (images)

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-1930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mridul Pathak updated OFBIZ-1930:
---------------------------------

    Attachment: ProductAdditionalViews.patch

Here is the updated patch with improvements in the code.  It will be needed to create an empty directory named "additional" at following location: "/framework/images/webapp/images/products/" and commit it into the trunk.  A new empty directory does not get included in the patch so it will be needed to add it explicitly before doing the commit.

> Added support for uploading additional Product Views (images)
> -------------------------------------------------------------
>
>                 Key: OFBIZ-1930
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1930
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Mridul Pathak
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: ProductAdditionalViews.patch, ProductAdditionalViews.patch
>
>
> Defined four ProductContentType's to support four additional views (images) to a Product.  Extended EditProductContent screen to support uploading these additional images.  New service for the same.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1930) Added support for uploading additional Product Views (images)

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625981#action_12625981 ]

Vikas Mayur commented on OFBIZ-1930:
------------------------------------


+                Map dataResourceCtx = FastMap.newInstance();
+                dataResourceCtx.put("objectInfo", imageUrl);
+                dataResourceCtx.put("dataResourceName", (String) context.get("_imageFile_fileName"));
+                dataResourceCtx.put("userLogin", userLogin);
+                
+                Map productContentCtx = FastMap.newInstance();
+                productContentCtx.put("productId", productId);
+                productContentCtx.put("productContentTypeId", productContentTypeId);
+                productContentCtx.put("fromDate", (Timestamp) context.get("fromDate"));
+                productContentCtx.put("thruDate", (Timestamp) context.get("thruDate"));
+                productContentCtx.put("userLogin", userLogin);


+                            Map contentCtx = FastMap.newInstance();
+                            contentCtx.put("contentId", contentId);
+                            contentCtx.put("dataResourceId", dataResourceResult.get("dataResourceId"));
+                            contentCtx.put("userLogin", userLogin);

Though not so important but it could have been better to use some thing like
Map dataResourceCtx = UtilMisc.toMap("objectInfo", imageUrl, .......) and same applies to Map productContentCtx and other places as well.

- Vikas

> Added support for uploading additional Product Views (images)
> -------------------------------------------------------------
>
>                 Key: OFBIZ-1930
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1930
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Mridul Pathak
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: ProductAdditionalViews.patch, ProductAdditionalViews.patch
>
>
> Defined four ProductContentType's to support four additional views (images) to a Product.  Extended EditProductContent screen to support uploading these additional images.  New service for the same.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1930) Added support for uploading additional Product Views (images)

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625983#action_12625983 ]

Vikas Mayur commented on OFBIZ-1930:
------------------------------------

I think we can use uploadFileInterface interface in service definition "addAdditionalViewForProduct"

- Vikas

> Added support for uploading additional Product Views (images)
> -------------------------------------------------------------
>
>                 Key: OFBIZ-1930
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1930
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Mridul Pathak
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: ProductAdditionalViews.patch, ProductAdditionalViews.patch
>
>
> Defined four ProductContentType's to support four additional views (images) to a Product.  Extended EditProductContent screen to support uploading these additional images.  New service for the same.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1930) Added support for uploading additional Product Views (images)

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626103#action_12626103 ]

Jacques Le Roux commented on OFBIZ-1930:
----------------------------------------

Thanks for review and comments Vikas,

I think that using map.put is fine when you deal with at least one long parameter. I believe using UtilMisc.toMap in such cases does not clarify the code

I other words UtilMisc.toMap is good if all parameters are kind of << "productId", productId>> or if there are few parameters.
But less when it comes to "dataResourceName", (String) context.get("_imageFile_fileName" and more than say 2/3 parameters.
Then I prefer to use map.put style. IMO having them on more lines help to read the code, and it's not too hard to duplicate.

uploadFileInterface is a nice catch !
attachUploadToDataResource and createContentFromUploadedFile are good examples I think. I did not look further yet...

> Added support for uploading additional Product Views (images)
> -------------------------------------------------------------
>
>                 Key: OFBIZ-1930
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1930
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Mridul Pathak
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: ProductAdditionalViews.patch, ProductAdditionalViews.patch
>
>
> Defined four ProductContentType's to support four additional views (images) to a Product.  Extended EditProductContent screen to support uploading these additional images.  New service for the same.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1930) Added support for uploading additional Product Views (images)

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626117#action_12626117 ]

Mridul Pathak commented on OFBIZ-1930:
--------------------------------------

Thanks for your comments.
I knew about the uploadFileInterface.  But what I thought was that, in this case we will always upload a image file, so I named the file input box as "imageFile" and introduced related IN parameters.  While naming it as "uploadedFile" and using uploadFileInterface gives an expression that any type of file is allowed to be uploaded.  Just from developers point of view :).
I can change it if you want me to and upload the updated patch.  Just let me know.



> Added support for uploading additional Product Views (images)
> -------------------------------------------------------------
>
>                 Key: OFBIZ-1930
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1930
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Mridul Pathak
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: ProductAdditionalViews.patch, ProductAdditionalViews.patch
>
>
> Defined four ProductContentType's to support four additional views (images) to a Product.  Extended EditProductContent screen to support uploading these additional images.  New service for the same.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1930) Added support for uploading additional Product Views (images)

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626214#action_12626214 ]

Jacques Le Roux commented on OFBIZ-1930:
----------------------------------------

Mridul,

I'm ready to commit your patch, but yes please could you use uploadFileInterface. I think it's a best practise to use interfaces as much as possible.
Even if in the case of service definition it has not the same implications than in Java, for instance.

Thanks

> Added support for uploading additional Product Views (images)
> -------------------------------------------------------------
>
>                 Key: OFBIZ-1930
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1930
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Mridul Pathak
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: ProductAdditionalViews.patch, ProductAdditionalViews.patch
>
>
> Defined four ProductContentType's to support four additional views (images) to a Product.  Extended EditProductContent screen to support uploading these additional images.  New service for the same.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-1930) Added support for uploading additional Product Views (images)

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-1930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mridul Pathak updated OFBIZ-1930:
---------------------------------

    Attachment: ProductAdditionalViews.patch

Here is the updated patch.  Used uploadFileInterface now.

> Added support for uploading additional Product Views (images)
> -------------------------------------------------------------
>
>                 Key: OFBIZ-1930
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1930
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Mridul Pathak
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: ProductAdditionalViews.patch, ProductAdditionalViews.patch, ProductAdditionalViews.patch
>
>
> Defined four ProductContentType's to support four additional views (images) to a Product.  Extended EditProductContent screen to support uploading these additional images.  New service for the same.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (OFBIZ-1930) Added support for uploading additional Product Views (images)

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-1930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux closed OFBIZ-1930.
----------------------------------

    Resolution: Fixed

Thanks Mridul,

Your patch is in trunk revision: 689772  

Thanks Ashish and Vikas for review and comments

I fixed an unrelated problem in EditProductContentContent.groovy. This is not the 1st time I cross this type of issue. I checked it does not appear on demo server and I guess it was not appearing with bsh  before. I'm not sure of its origin but it seems related to my configuration. I use, from my machine default, "Central European Summer Time" and demo server uses "Central Daylight Time". But I can't see why it affects my machine and not the demo server : there is no origin here (maybe GMT, but obviously it's not the case)
The lines I added are (+ import)
} else {
    fromDate = ObjectType.simpleTypeConvert(fromDate, "Timestamp", null, null, false)    
}
(I intentionnaly let the line without semi-colon as it's not mandatory in Groovy)


> Added support for uploading additional Product Views (images)
> -------------------------------------------------------------
>
>                 Key: OFBIZ-1930
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1930
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Mridul Pathak
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: ProductAdditionalViews.patch, ProductAdditionalViews.patch, ProductAdditionalViews.patch
>
>
> Defined four ProductContentType's to support four additional views (images) to a Product.  Extended EditProductContent screen to support uploading these additional images.  New service for the same.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.