[jira] [Comment Edited] (OFBIZ-7139) Product Name

2016-06-06 Thread Jacques Le Roux (JIRA)

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

Jacques Le Roux edited comment on OFBIZ-7139 at 6/6/16 7:30 PM:


We will address remaining classes under - OFBIZ-7169


was (Author: rishisolankii):
We will address remaining classes under - 
https://issues.apache.org/jira/browse/OFBIZ-7169

> Product Name
> 
>
> Key: OFBIZ-7139
> URL: https://issues.apache.org/jira/browse/OFBIZ-7139
> Project: OFBiz
>  Issue Type: Improvement
>  Components: product
>Affects Versions: Trunk
>Reporter: Rishi Solanki
>Assignee: Arun Patidar
> Fix For: Upcoming Branch
>
> Attachments: OFBIZ-7139-Updated.patch, OFBIZ-7139.patch
>
>
> As per the discussion over user list (subject: "Product Name"), user should 
> be able to add product name in product creation process.
> On Catalog >> Products >> New Product section, user won't see any input field 
> to add product name. Same applies to Edit product screen.
> - Add field on the create and edit form.
> - Check for the support in the services used, if not then add support for it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (OFBIZ-7139) Product Name

2016-06-03 Thread Julien NICOLAS (JIRA)

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

Julien NICOLAS edited comment on OFBIZ-7139 at 6/3/16 12:26 PM:


  Ideally it should look for content first if found then return and if not 
found then go for Product.productName.

I agree, it seems good like that. It's a easier way if you don't need 
translation on your product.

Julien.


was (Author: julien.nicolas):
 Ideally it should look for content first if found then return and if not found 
then go for Product.productName.

I agree, it seems good like that. It's a easier way if you don't need 
translation on your product.

Julien.

> Product Name
> 
>
> Key: OFBIZ-7139
> URL: https://issues.apache.org/jira/browse/OFBIZ-7139
> Project: OFBiz
>  Issue Type: Improvement
>  Components: product
>Affects Versions: Trunk
>Reporter: Rishi Solanki
>Assignee: Rishi Solanki
>Priority: Minor
>
> As per the discussion over user list (subject: "Product Name"), user should 
> be able to add product name in product creation process.
> On Catalog >> Products >> New Product section, user won't see any input field 
> to add product name. Same applies to Edit product screen.
> - Add field on the create and edit form.
> - Check for the support in the services used, if not then add support for it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (OFBIZ-7139) Product Name

2016-06-03 Thread Rishi Solanki (JIRA)

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

Rishi Solanki edited comment on OFBIZ-7139 at 6/3/16 11:34 AM:
---

[~jacques.le.roux] [~pfm.smits]:

We have further look into the issue and found that 
ProductContentWrapper.getProductContentAsText() line 173-205 is responsible for 
showing productName instead of Product Content of type Product Name. You can 
see that after getting value from Product.productName it return from the 
method. Ideally it should look for content first if found then return and if 
not found then go for Product.productName.

I would say, add productName on edit product and fix this method will solve all 
purpose. If no objection then we would provide patch for the same. Content will 
override the field value in this case.

Here is code for quick reference;

{code}
if (productModel.isField(candidateFieldName)) {
String candidateValue = product.getString(candidateFieldName);
if (UtilValidate.isNotEmpty(candidateValue)) {
outWriter.write(candidateValue);
return;
} else if ("Y".equals(product.getString("isVariant"))) {
// look up the virtual product
GenericValue parent = 
ProductWorker.getParentProduct(productId, delegator);
if (parent != null) {
candidateValue = parent.getString(candidateFieldName);
if (UtilValidate.isNotEmpty(candidateValue)) {
outWriter.write(candidateValue);
return;
}
}
}
}

List productContentList = 
EntityQuery.use(delegator).from("ProductContent").where("productId", productId, 
"productContentTypeId", 
productContentTypeId).orderBy("-fromDate").cache(cache).filterByDate().queryList();
if (UtilValidate.isEmpty(productContentList) && 
("Y".equals(product.getString("isVariant" {
GenericValue parent = ProductWorker.getParentProduct(productId, 
delegator);
if (UtilValidate.isNotEmpty(parent)) {
productContentList = 
EntityQuery.use(delegator).from("ProductContent").where("productId", 
parent.get("productId"), "productContentTypeId", 
productContentTypeId).orderBy("-fromDate").cache(cache).filterByDate().queryList();
}
}
GenericValue productContent = EntityUtil.getFirst(productContentList);
if (productContent != null) {
// when rendering the product content, always include the Product 
and ProductContent records that this comes from
Map inContext = new HashMap();
inContext.put("product", product);
inContext.put("productContent", productContent);
ContentWorker.renderContentAsText(dispatcher, delegator, 
productContent.getString("contentId"), outWriter, inContext, locale, 
mimeTypeId, partyId, roleTypeId, cache);
}

{code}


was (Author: rishisolankii):
[~jacques.le.roux] [~pfm.smits]:

We have further look into the issue and found that 
ProductContentWrapper.getProductContentAsText() line 173-205 is responsible for 
showing productName instead of Product Content of type Product Name. You can 
see that after getting value from Product.productName it return from the 
method. Ideally it should look for content first if found then return and if 
not found then go for Product.productName.

I would say, add productName on edit product and fix this method will solve all 
purpose. If no objection then we would provide patch for the same.

Here is code for quick reference;

{code}
if (productModel.isField(candidateFieldName)) {
String candidateValue = product.getString(candidateFieldName);
if (UtilValidate.isNotEmpty(candidateValue)) {
outWriter.write(candidateValue);
return;
} else if ("Y".equals(product.getString("isVariant"))) {
// look up the virtual product
GenericValue parent = 
ProductWorker.getParentProduct(productId, delegator);
if (parent != null) {
candidateValue = parent.getString(candidateFieldName);
if (UtilValidate.isNotEmpty(candidateValue)) {
outWriter.write(candidateValue);
return;
}
}
}
}

List productContentList = 
EntityQuery.use(delegator).from("ProductContent").where("productId", productId, 
"productContentTypeId", 
productContentTypeId).orderBy("-fromDate").cache(cache).filterByDate().queryList();
if (UtilValidate.isEmpty(productContentList) && 
("Y"