[jira] [Commented] (OFBIZ-6504) how to Create PDF with password Protected in Ofbiz

2015-07-28 Thread Jacques Le Roux (JIRA)

[ 
https://issues.apache.org/jira/browse/OFBIZ-6504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14644187#comment-14644187
 ] 

Jacques Le Roux commented on OFBIZ-6504:


OK by percent encoding  (ie %27) the ' char (single-quote or apostrophe)
 {code}
 (indeed html entity encoding (ie #39;) did not work)
 {code}
I could bypass the issue due to this call to renderDropDownField macro, where 
having ' inside *'Annuler l'exemple (En projet)'* could not work
{code}
@renderDropDownField [...] 
options=[{'key':'EXST_DEFINED','description':'Définition complète (En 
projet)'},{'key':'EXST_CANCELLED','description':'Annuler l%27exemple (En 
projet)'}] [...]  /
{code}

Since there are many (200+) single quotes used in CommonErrorUiLabels.xml (not 
only in French) I looked for a more general option to percent encode the 
description when creating the options in 
MacroFormRenderer.renderDropDownField(). Actually there the private encode() 
method, which relies on the simpleEncoder or String encoder, is already used. 
In this case, so far and I guess ever, we only need to encode the the ' char. 
So It's easier to simply force it using a String.replaceAll(', %27). This 
workd, but has an annoying side-effect: then the localised labels containing a 
single quote are rendered in drop-downs with %27 instead of '. I thought I 
could try to change that inside renderDropDownField macro in 
htmlFormMacroLibrary.ftl. But I was unable to replace %27 by ' with 
Freemarker by using
{code}
item.description?replace(%27, ')
{code}
I tried many solutions using regexps rather, like
{code}
replace([%]27, ', r)
{code}
none worked.

So this would be my patch if I could replace % in Freemarker. BTW I'm not even 
sure it will not reintroduce the issue I'm fighting :/

{code}
Index: 
framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java
===
--- framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java 
(revision 1692606)
+++ framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java 
(working copy)
@@ -849,7 +849,7 @@
 if (textSize  0  description.length()  textSize) {
 description = description.substring(0, textSize - 8) + ... + 
description.substring(description.length() - 5);
 }
-options.append(encode(description, modelFormField, context));
+options.append(encode(description.replaceAll(', %27), 
modelFormField, context));

 if (UtilValidate.isNotEmpty(currentValueList)) {
 options.append(');
Index: framework/widget/templates/htmlFormMacroLibrary.ftl
===
--- framework/widget/templates/htmlFormMacroLibrary.ftl (revision 1692606)
+++ framework/widget/templates/htmlFormMacroLibrary.ftl (working copy)
@@ -231,7 +231,7 @@
   span class=ui-widget
 select name=${name?default()}#rt/ @renderClass className alert 
/#if id?has_content id=${id}/#if#if multiple?has_content 
multiple=multiple/#if#if otherFieldSize gt 0 
onchange=process_choice(this,document.${formName}.${otherFieldName})/#if#if
 event?has_content ${event}=${action}/#if#if size?has_content 
size=${size}/#if#if tabindex?has_content 
tabindex=${tabindex}/#if#rt/
   #if firstInList?has_content  currentValue?has_content  
!multiple?has_content
-option selected=selected 
value=${currentValue}${explicitDescription}/option#rt/
+option selected=selected 
value=${currentValue}${explicitDescription?replace(%27, 
')}/option#rt/
 option value=${currentValue}---/option#rt/
   /#if
   #if allowEmpty?has_content || !options?has_content
@@ -239,9 +239,9 @@
   /#if
   #list options as item
 #if multiple?has_content
-  option#if currentValue?has_content  item.selected?has_content 
selected=${item.selected} #elseif !currentValue?has_content  
noCurrentSelectedKey?has_content  noCurrentSelectedKey == item.key 
selected=selected /#if 
value=${item.key}${item.description}/option#rt/
+  option#if currentValue?has_content  item.selected?has_content 
selected=${item.selected} #elseif !currentValue?has_content  
noCurrentSelectedKey?has_content  noCurrentSelectedKey == item.key 
selected=selected /#if 
value=${item.key}${item.description?replace(%27, ')}/option#rt/
 #else
-  option#if currentValue?has_content  currentValue == item.key  
dDFCurrent?has_content  selected == dDFCurrent selected=selected#elseif 
!currentValue?has_content  noCurrentSelectedKey?has_content  
noCurrentSelectedKey == item.key selected=selected/#if 
value=${item.key}${item.description}/option#rt/
+  option#if currentValue?has_content  currentValue == item.key  
dDFCurrent?has_content  selected == dDFCurrent selected=selected#elseif 
!currentValue?has_content  

[jira] [Created] (OFBIZ-6563) Search for group name reveals all

2015-07-28 Thread Pierre Smits (JIRA)
Pierre Smits created OFBIZ-6563:
---

 Summary: Search for group name reveals all
 Key: OFBIZ-6563
 URL: https://issues.apache.org/jira/browse/OFBIZ-6563
 Project: OFBiz
  Issue Type: Bug
  Components: party
Affects Versions: Trunk
Reporter: Pierre Smits


When searching for group named 'OFBiz' all parties are returned.



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


Re: OFBiz going mobile

2015-07-28 Thread Ean Schuessler
The real difficulty is that if you want a genuinely mobile app and not just
mobile web then the approach has to completely switch. With a Cordova app
you no longer render pages on the server and send them to the client. To
behave like an actual app you need to approach it as a program written in
Javascript that renders HTML interfaces locally and communicates with the
server using a combination of JSON-RPC and REST. This would represent an
enormous refactoring of the entire interface but it would open whole new
horizons from a UI perspective. David has made some real improvements to
handle REST in Moqui's version of the control servlet that we would also
need to bring in (ie. you can bind services to a combination of URL and
HTTP method).

On Wed, Jul 8, 2015 at 11:13 AM, Pierre Smits pierre.sm...@gmail.com
wrote:

 Hi all,

 There are a lot of mobile specific development frameworks out there. There
 are even a few projects under the ASF umbrella that cater to that need.

 What would you consider the best solution to pair OFBiz with? Of are the
 capabilities it delivers sufficient?

 Please share your thoughts.

 Best regards,

 Pierre Smits

 *ORRTIZ.COM http://www.orrtiz.com*
 Services  Solutions for Cloud-
 Based Manufacturing, Professional
 Services and Retail  Trade
 http://www.orrtiz.com




-- 
Ean Schuessler, Brainfood Co-Founder
e...@brainfood.com
214-720-0700


Framework status

2015-07-28 Thread Ron Wheeler
There was a lot of discussion a few months ago about replacing the 
framework.

That seems to have died down.

At the same time, we are talking about the documentation and in the 
documentation plan, the framework is mentioned as a separately 
marketable product.


To me, it is clear that one should not be promoting a framework that 
will be replaced.


If the framework is a separate product that can be delivered separately, 
it needs to be separated from the ERP and have a life of its own with 
clear documentation and a distribution that does not include a whole lot 
of seed data or bits and pieces that are not required.

The dependencies that are screwed up need to be fixed.

Now is the time to make a decision about the framework.
1- Going to replace it - remove discussion about having a framework 
product from all documentation and web sites
2 - Going to muddle along with existing dependency structure and merged 
distribution - remove from docs until ready to turn it into a product.
3 - Going to commit to framework as a product - fix code and seed data 
to have a distribution for the framework, fix docs to clearly describe 
the framework and its use. I would prefer to see the framework as a 
separate sub-project with a technical team of people with expertise and 
interest in persistence, caching, performance, etc. supporting it and 
marketing it to other developers rather than keeping it mixed in with 
a product that is sold based on support for business process. (No 
surprise here).



There is no right or wrong answer but the current approach seems a bit 
muddled and negatively affects the project's ability to project a clear 
vision.


It would be nice if this decision was made soon so that we can get the 
documentation cleaned up.


Ron

--
Ron Wheeler
President
Artifact Software Inc
email: rwhee...@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102



Re: OFBiz going mobile

2015-07-28 Thread Ron Wheeler

Good analysis.

I wonder if Ionic is a good choice for a portable mobile framework. 
http://ionicframework.com/


One does not want to get tied up in low level support for all the 
flavors of mobile devices.


It is open source and supports AngularJS which seems to be a good model 
for building Javascript applications,



Ron

On 28/07/2015 10:25 AM, Ean Schuessler wrote:

The real difficulty is that if you want a genuinely mobile app and not just
mobile web then the approach has to completely switch. With a Cordova app
you no longer render pages on the server and send them to the client. To
behave like an actual app you need to approach it as a program written in
Javascript that renders HTML interfaces locally and communicates with the
server using a combination of JSON-RPC and REST. This would represent an
enormous refactoring of the entire interface but it would open whole new
horizons from a UI perspective. David has made some real improvements to
handle REST in Moqui's version of the control servlet that we would also
need to bring in (ie. you can bind services to a combination of URL and
HTTP method).

On Wed, Jul 8, 2015 at 11:13 AM, Pierre Smits pierre.sm...@gmail.com
wrote:


Hi all,

There are a lot of mobile specific development frameworks out there. There
are even a few projects under the ASF umbrella that cater to that need.

What would you consider the best solution to pair OFBiz with? Of are the
capabilities it delivers sufficient?

Please share your thoughts.

Best regards,

Pierre Smits

*ORRTIZ.COM http://www.orrtiz.com*
Services  Solutions for Cloud-
Based Manufacturing, Professional
Services and Retail  Trade
http://www.orrtiz.com







--
Ron Wheeler
President
Artifact Software Inc
email: rwhee...@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102



[jira] [Comment Edited] (OFBIZ-6504) how to Create PDF with password Protected in Ofbiz

2015-07-28 Thread Jacques Le Roux (JIRA)

[ 
https://issues.apache.org/jira/browse/OFBIZ-6504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14644187#comment-14644187
 ] 

Jacques Le Roux edited comment on OFBIZ-6504 at 7/28/15 10:41 AM:
--

To clarify the issue: when a description used in a drop-down comes from a 
localised label in CommonEntityLabels.xml and contains a single quote (') this 
single quote must be percent encoded to allow the rendering. Else it's a single 
quote inside 2 single quotes for the option like:
{code}
{'key':'EXST_CANCELLED','description':'Annuler l'exemple (En projet)'}
{code}
with the percent encoding there is no issue:
{code}
{'key':'EXST_CANCELLED','description':'Annuler l%27exemple (En projet)'}
{code}


By percent encoding  (ie %27) the ' char (single-quote or apostrophe)
 {code}
 (indeed html entity encoding (ie #39;) did not work)
 {code}
I could bypass the issue due to this call to renderDropDownField macro, where 
having ' inside *'Annuler l'exemple (En projet)'* could not work
{code}
@renderDropDownField [...] 
options=[{'key':'EXST_DEFINED','description':'Définition complète (En 
projet)'},{'key':'EXST_CANCELLED','description':'Annuler l%27exemple (En 
projet)'}] [...]  /
{code}

Since there are many (200+) single quotes used in CommonErrorUiLabels.xml (not 
only in French) I looked for a more general option to percent encode the 
description when creating the options in 
MacroFormRenderer.renderDropDownField(). Actually there the private encode() 
method, which relies on the simpleEncoder or String encoder, is already used. 
In this case, so far and I guess ever, we only need to encode the the ' char. 
So It's easier to simply force it using a String.replaceAll(', %27). This 
workd, but has an annoying side-effect: then the localised labels containing a 
single quote are rendered in drop-downs with %27 instead of '. I thought I 
could try to change that inside renderDropDownField macro in 
htmlFormMacroLibrary.ftl. But I was unable to replace %27 by ' with 
Freemarker by using
{code}
item.description?replace(%27, ')
{code}
I tried many solutions using regexps rather, like
{code}
replace([%]27, ', r)
{code}
none worked.

So this would be my patch if I could replace % in Freemarker. BTW I'm not even 
sure it will not reintroduce the issue I'm fighting :/

{code}
Index: 
framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java
===
--- framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java 
(revision 1692606)
+++ framework/widget/src/org/ofbiz/widget/renderer/macro/MacroFormRenderer.java 
(working copy)
@@ -849,7 +849,7 @@
 if (textSize  0  description.length()  textSize) {
 description = description.substring(0, textSize - 8) + ... + 
description.substring(description.length() - 5);
 }
-options.append(encode(description, modelFormField, context));
+options.append(encode(description.replaceAll(', %27), 
modelFormField, context));

 if (UtilValidate.isNotEmpty(currentValueList)) {
 options.append(');
Index: framework/widget/templates/htmlFormMacroLibrary.ftl
===
--- framework/widget/templates/htmlFormMacroLibrary.ftl (revision 1692606)
+++ framework/widget/templates/htmlFormMacroLibrary.ftl (working copy)
@@ -231,7 +231,7 @@
   span class=ui-widget
 select name=${name?default()}#rt/ @renderClass className alert 
/#if id?has_content id=${id}/#if#if multiple?has_content 
multiple=multiple/#if#if otherFieldSize gt 0 
onchange=process_choice(this,document.${formName}.${otherFieldName})/#if#if
 event?has_content ${event}=${action}/#if#if size?has_content 
size=${size}/#if#if tabindex?has_content 
tabindex=${tabindex}/#if#rt/
   #if firstInList?has_content  currentValue?has_content  
!multiple?has_content
-option selected=selected 
value=${currentValue}${explicitDescription}/option#rt/
+option selected=selected 
value=${currentValue}${explicitDescription?replace(%27, 
')}/option#rt/
 option value=${currentValue}---/option#rt/
   /#if
   #if allowEmpty?has_content || !options?has_content
@@ -239,9 +239,9 @@
   /#if
   #list options as item
 #if multiple?has_content
-  option#if currentValue?has_content  item.selected?has_content 
selected=${item.selected} #elseif !currentValue?has_content  
noCurrentSelectedKey?has_content  noCurrentSelectedKey == item.key 
selected=selected /#if 
value=${item.key}${item.description}/option#rt/
+  option#if currentValue?has_content  item.selected?has_content 
selected=${item.selected} #elseif !currentValue?has_content  
noCurrentSelectedKey?has_content  noCurrentSelectedKey == item.key 
selected=selected /#if 

[jira] [Commented] (OFBIZ-6504) how to Create PDF with password Protected in Ofbiz

2015-07-28 Thread Jacques Le Roux (JIRA)

[ 
https://issues.apache.org/jira/browse/OFBIZ-6504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14644802#comment-14644802
 ] 

Jacques Le Roux commented on OFBIZ-6504:


If nobody knows how to replace a % with Freemarker replace(), then another 
pragmatic solution is to use ’ instead of ' (see 
https://en.wikipedia.org/wiki/Apostrophe). We could also use a Java call inside 
/htmlFormMacroLibrary.ftl

 how to Create PDF with password Protected in Ofbiz
 --

 Key: OFBIZ-6504
 URL: https://issues.apache.org/jira/browse/OFBIZ-6504
 Project: OFBiz
  Issue Type: Improvement
  Components: ALL APPLICATIONS
 Environment: linux
Reporter: Sachin Manjule
Assignee: Shi Jinghai
Priority: Trivial
 Fix For: Upcoming Branch

 Attachments: localhost.png, trunk demo.png


 We can create PDF using FTL that is OK, but how to generate PDF with 
 Encryption password protected?
 itext is best option for this. but can we emmber in ftl or other places?
 pleas Help us.



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


Fwd: Re: OFBiz going mobile

2015-07-28 Thread Ron Wheeler


http://www.manning.com/wilken/IonicinA_MEAP_ch01.pdf is the introductory 
chapter for a manual on building mobile applications using a modern stack.

Short read for someone who wants to see a possible technology stack.

Ron

 Forwarded Message 

Good analysis.

I wonder if Ionic is a good choice for a portable mobile framework.
http://ionicframework.com/

One does not want to get tied up in low level support for all the
flavors of mobile devices.

It is open source and supports AngularJS which seems to be a good model
for building Javascript applications,


Ron

On 28/07/2015 10:25 AM, Ean Schuessler wrote:

The real difficulty is that if you want a genuinely mobile app and not just
mobile web then the approach has to completely switch. With a Cordova app
you no longer render pages on the server and send them to the client. To
behave like an actual app you need to approach it as a program written in
Javascript that renders HTML interfaces locally and communicates with the
server using a combination of JSON-RPC and REST. This would represent an
enormous refactoring of the entire interface but it would open whole new
horizons from a UI perspective. David has made some real improvements to
handle REST in Moqui's version of the control servlet that we would also
need to bring in (ie. you can bind services to a combination of URL and
HTTP method).

On Wed, Jul 8, 2015 at 11:13 AM, Pierre Smits pierre.sm...@gmail.com
wrote:


Hi all,

There are a lot of mobile specific development frameworks out there. There
are even a few projects under the ASF umbrella that cater to that need.

What would you consider the best solution to pair OFBiz with? Of are the
capabilities it delivers sufficient?

Please share your thoughts.

Best regards,

Pierre Smits

*ORRTIZ.COM http://www.orrtiz.com*
Services  Solutions for Cloud-
Based Manufacturing, Professional
Services and Retail  Trade
http://www.orrtiz.com







--
Ron Wheeler
President
Artifact Software Inc
email: rwhee...@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102





Re: OFBiz going mobile

2015-07-28 Thread Ean Schuessler
The trouble with AngularJS is that they have a terrible case of NIH and are
re-inventing all the existing popular patterns like IOC, dependency
management and observer style data change events. In the 1.0 version they
were dismissive of problems like dependency management and let rediscover
the pains of not being able to fractionally load their infrastructure even
though it has been a solved problem for tools like RequireJS for a long
time. Now the roadmap for AngularJS 2.0 is so different from 1.0 that it
might as well be regarded as a different product and there is also real
cloudiness around the relationship between AngularJS and Polymer. Google is
developing both so the it's made by Google argument that usually puts
wind in Angular's sails isn't applicable.

On Tue, Jul 28, 2015 at 10:11 AM, Ron Wheeler 
rwhee...@artifact-software.com wrote:

 Good analysis.

 I wonder if Ionic is a good choice for a portable mobile framework.
 http://ionicframework.com/

 One does not want to get tied up in low level support for all the flavors
 of mobile devices.

 It is open source and supports AngularJS which seems to be a good model
 for building Javascript applications,


 Ron


 On 28/07/2015 10:25 AM, Ean Schuessler wrote:

 The real difficulty is that if you want a genuinely mobile app and not
 just
 mobile web then the approach has to completely switch. With a Cordova
 app
 you no longer render pages on the server and send them to the client. To
 behave like an actual app you need to approach it as a program written
 in
 Javascript that renders HTML interfaces locally and communicates with the
 server using a combination of JSON-RPC and REST. This would represent an
 enormous refactoring of the entire interface but it would open whole new
 horizons from a UI perspective. David has made some real improvements to
 handle REST in Moqui's version of the control servlet that we would also
 need to bring in (ie. you can bind services to a combination of URL and
 HTTP method).

 On Wed, Jul 8, 2015 at 11:13 AM, Pierre Smits pierre.sm...@gmail.com
 wrote:

  Hi all,

 There are a lot of mobile specific development frameworks out there.
 There
 are even a few projects under the ASF umbrella that cater to that need.

 What would you consider the best solution to pair OFBiz with? Of are the
 capabilities it delivers sufficient?

 Please share your thoughts.

 Best regards,

 Pierre Smits

 *ORRTIZ.COM http://www.orrtiz.com*
 Services  Solutions for Cloud-
 Based Manufacturing, Professional
 Services and Retail  Trade
 http://www.orrtiz.com





 --
 Ron Wheeler
 President
 Artifact Software Inc
 email: rwhee...@artifact-software.com

 skype: ronaldmwheeler
 phone: 866-970-2435, ext 102




-- 
Ean Schuessler, Brainfood Co-Founder
e...@brainfood.com
214-720-0700