You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by GitBox <gi...@apache.org> on 2021/01/19 09:52:39 UTC

[GitHub] [ofbiz-framework] danwatford opened a new pull request #252: Fixed: Use data url scheme for logo in CompanyHeader

danwatford opened a new pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252


   (OFBIZ-7327)
   
   Use a data URL rather than a regular URL for company logos when a
   logo has been specified as a Party Content item. This works around the
   problem of Apache FOP failing to retrieve content from HTTPS URLs.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #252: Fixed: Use data url scheme for logo in CompanyHeader

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#issuecomment-762734675


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252) No Coverage information  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] danwatford commented on a change in pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
danwatford commented on a change in pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#discussion_r560114697



##########
File path: applications/order/groovyScripts/order/CompanyHeader.groovy
##########
@@ -135,12 +136,22 @@ if (!partyId) {
 }
 
 // the logo
-partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
+GenericValue partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
 if (partyGroup) {
-    partyContentWrapper = new PartyContentWrapper(dispatcher, partyGroup, locale, EntityUtilProperties.getPropertyValue("content", "defaultMimeType", "text/html; charset=utf-8", delegator))
-    partyContent = partyContentWrapper.getFirstPartyContentByType(partyGroup.partyId , partyGroup, "LGOIMGURL", delegator)
+    GenericValue partyContent = PartyContentWrapper.getFirstPartyContentByType(partyId, partyGroup, "LGOIMGURL", delegator)

Review comment:
       Using getPartyContentAsText didn't work for me. My various attempts at using PartyContentWrapper, ContentWork and DataResourceWorker to render a URL for me didn't work out. I ended up just getting the Content ID returned as a String.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] danwatford commented on a change in pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
danwatford commented on a change in pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#discussion_r563315812



##########
File path: applications/order/groovyScripts/order/CompanyHeader.groovy
##########
@@ -135,17 +136,25 @@ if (!partyId) {
 }
 
 // the logo
-partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
+GenericValue partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
 if (partyGroup) {
-    partyContentWrapper = new PartyContentWrapper(dispatcher, partyGroup, locale, EntityUtilProperties.getPropertyValue("content", "defaultMimeType", "text/html; charset=utf-8", delegator))
-    partyContent = partyContentWrapper.getFirstPartyContentByType(partyGroup.partyId , partyGroup, "LGOIMGURL", delegator)
-    if (partyContent) {
-        logoImageUrl = "/content/control/stream?contentId=" + partyContent.contentId
-    } else {
-        if (partyGroup?.logoImageUrl) {
-            logoImageUrl = partyGroup.logoImageUrl
+    GenericValue dataResource =
+            PartyContentWrapper.getFirstPartyContentByType(partyId, partyGroup, "LGOIMGURL", delegator)
+                    ?.getRelatedOne("Content", true)
+                    ?.getRelatedOne("DataResource", true)
+
+    if (dataResource) {
+        File logoFile = DataResourceWorker.getContentFile(dataResource.getString("dataResourceTypeId"),

Review comment:
       I've added the resource type id check and the fall-back to the previously used content/control/stream url.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] sonarcloud[bot] removed a comment on pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] removed a comment on pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#issuecomment-762734675


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252) No Coverage information  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#issuecomment-764668953


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252) No Coverage information  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] danwatford merged pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
danwatford merged pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] sonarcloud[bot] removed a comment on pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] removed a comment on pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#issuecomment-764668953


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252) No Coverage information  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] dixitdeepak commented on a change in pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
dixitdeepak commented on a change in pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#discussion_r560112591



##########
File path: applications/order/groovyScripts/order/CompanyHeader.groovy
##########
@@ -135,12 +136,22 @@ if (!partyId) {
 }
 
 // the logo
-partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
+GenericValue partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
 if (partyGroup) {
-    partyContentWrapper = new PartyContentWrapper(dispatcher, partyGroup, locale, EntityUtilProperties.getPropertyValue("content", "defaultMimeType", "text/html; charset=utf-8", delegator))
-    partyContent = partyContentWrapper.getFirstPartyContentByType(partyGroup.partyId , partyGroup, "LGOIMGURL", delegator)
+    GenericValue partyContent = PartyContentWrapper.getFirstPartyContentByType(partyId, partyGroup, "LGOIMGURL", delegator)

Review comment:
       I think here we can use getPartyContentAsText directly, it will give you the url stored in dataResource, also it will take care to read data from other supported types as well. 
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#issuecomment-764668953


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252) No Coverage information  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] sonarcloud[bot] removed a comment on pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] removed a comment on pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#issuecomment-764668953


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252) No Coverage information  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] dixitdeepak commented on a change in pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
dixitdeepak commented on a change in pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#discussion_r562390554



##########
File path: applications/order/groovyScripts/order/CompanyHeader.groovy
##########
@@ -135,17 +136,25 @@ if (!partyId) {
 }
 
 // the logo
-partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
+GenericValue partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
 if (partyGroup) {
-    partyContentWrapper = new PartyContentWrapper(dispatcher, partyGroup, locale, EntityUtilProperties.getPropertyValue("content", "defaultMimeType", "text/html; charset=utf-8", delegator))
-    partyContent = partyContentWrapper.getFirstPartyContentByType(partyGroup.partyId , partyGroup, "LGOIMGURL", delegator)
-    if (partyContent) {
-        logoImageUrl = "/content/control/stream?contentId=" + partyContent.contentId
-    } else {
-        if (partyGroup?.logoImageUrl) {
-            logoImageUrl = partyGroup.logoImageUrl
+    GenericValue dataResource =
+            PartyContentWrapper.getFirstPartyContentByType(partyId, partyGroup, "LGOIMGURL", delegator)
+                    ?.getRelatedOne("Content", true)
+                    ?.getRelatedOne("DataResource", true)
+
+    if (dataResource) {
+        File logoFile = DataResourceWorker.getContentFile(dataResource.getString("dataResourceTypeId"),

Review comment:
       I think here we should add following check to make sure we are getting base64 in case of file
   `if (dataResourceTypeId.indexOf("_FILE") >= 0) {`
   
   As content can be configured in different ways, and can have a complete url it self
   
   I'd recommand to  add /content/control/stream?contentId in else part. 

##########
File path: applications/order/groovyScripts/order/CompanyHeader.groovy
##########
@@ -135,12 +136,22 @@ if (!partyId) {
 }
 
 // the logo
-partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
+GenericValue partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
 if (partyGroup) {
-    partyContentWrapper = new PartyContentWrapper(dispatcher, partyGroup, locale, EntityUtilProperties.getPropertyValue("content", "defaultMimeType", "text/html; charset=utf-8", delegator))
-    partyContent = partyContentWrapper.getFirstPartyContentByType(partyGroup.partyId , partyGroup, "LGOIMGURL", delegator)
+    GenericValue partyContent = PartyContentWrapper.getFirstPartyContentByType(partyId, partyGroup, "LGOIMGURL", delegator)

Review comment:
       I don't object :)
   added comments to add condition while getting the data it'd be good we think around it as well. 
   
   

##########
File path: applications/order/groovyScripts/order/CompanyHeader.groovy
##########
@@ -135,12 +136,22 @@ if (!partyId) {
 }
 
 // the logo
-partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
+GenericValue partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
 if (partyGroup) {
-    partyContentWrapper = new PartyContentWrapper(dispatcher, partyGroup, locale, EntityUtilProperties.getPropertyValue("content", "defaultMimeType", "text/html; charset=utf-8", delegator))
-    partyContent = partyContentWrapper.getFirstPartyContentByType(partyGroup.partyId , partyGroup, "LGOIMGURL", delegator)
+    GenericValue partyContent = PartyContentWrapper.getFirstPartyContentByType(partyId, partyGroup, "LGOIMGURL", delegator)

Review comment:
       I won't object :)
   added comments to add condition while getting the data it'd be good we think around it as well. 
   
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] dixitdeepak commented on a change in pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
dixitdeepak commented on a change in pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#discussion_r562389488



##########
File path: applications/order/groovyScripts/order/CompanyHeader.groovy
##########
@@ -135,12 +136,22 @@ if (!partyId) {
 }
 
 // the logo
-partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
+GenericValue partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
 if (partyGroup) {
-    partyContentWrapper = new PartyContentWrapper(dispatcher, partyGroup, locale, EntityUtilProperties.getPropertyValue("content", "defaultMimeType", "text/html; charset=utf-8", delegator))
-    partyContent = partyContentWrapper.getFirstPartyContentByType(partyGroup.partyId , partyGroup, "LGOIMGURL", delegator)
+    GenericValue partyContent = PartyContentWrapper.getFirstPartyContentByType(partyId, partyGroup, "LGOIMGURL", delegator)

Review comment:
       I don't think there is way to get base64 from content/dataresouce worker classes, 
   

##########
File path: applications/order/groovyScripts/order/CompanyHeader.groovy
##########
@@ -135,17 +136,25 @@ if (!partyId) {
 }
 
 // the logo
-partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
+GenericValue partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
 if (partyGroup) {
-    partyContentWrapper = new PartyContentWrapper(dispatcher, partyGroup, locale, EntityUtilProperties.getPropertyValue("content", "defaultMimeType", "text/html; charset=utf-8", delegator))
-    partyContent = partyContentWrapper.getFirstPartyContentByType(partyGroup.partyId , partyGroup, "LGOIMGURL", delegator)
-    if (partyContent) {
-        logoImageUrl = "/content/control/stream?contentId=" + partyContent.contentId
-    } else {
-        if (partyGroup?.logoImageUrl) {
-            logoImageUrl = partyGroup.logoImageUrl
+    GenericValue dataResource =
+            PartyContentWrapper.getFirstPartyContentByType(partyId, partyGroup, "LGOIMGURL", delegator)
+                    ?.getRelatedOne("Content", true)
+                    ?.getRelatedOne("DataResource", true)
+
+    if (dataResource) {
+        File logoFile = DataResourceWorker.getContentFile(dataResource.getString("dataResourceTypeId"),

Review comment:
       I think here we should add following check to make sure we are getting base64 in case of file
   `if (dataResourceTypeId.indexOf("_FILE") >= 0) {`
   
   As content can be configured in different ways, and can have a complete url it self
   
   I'd recommand to  add /content/control/stream?contentId in else part. 

##########
File path: applications/order/groovyScripts/order/CompanyHeader.groovy
##########
@@ -135,12 +136,22 @@ if (!partyId) {
 }
 
 // the logo
-partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
+GenericValue partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
 if (partyGroup) {
-    partyContentWrapper = new PartyContentWrapper(dispatcher, partyGroup, locale, EntityUtilProperties.getPropertyValue("content", "defaultMimeType", "text/html; charset=utf-8", delegator))
-    partyContent = partyContentWrapper.getFirstPartyContentByType(partyGroup.partyId , partyGroup, "LGOIMGURL", delegator)
+    GenericValue partyContent = PartyContentWrapper.getFirstPartyContentByType(partyId, partyGroup, "LGOIMGURL", delegator)

Review comment:
       I don't object :)
   added comments to add condition while getting the data it'd be good we think around it as well. 
   
   

##########
File path: applications/order/groovyScripts/order/CompanyHeader.groovy
##########
@@ -135,12 +136,22 @@ if (!partyId) {
 }
 
 // the logo
-partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
+GenericValue partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
 if (partyGroup) {
-    partyContentWrapper = new PartyContentWrapper(dispatcher, partyGroup, locale, EntityUtilProperties.getPropertyValue("content", "defaultMimeType", "text/html; charset=utf-8", delegator))
-    partyContent = partyContentWrapper.getFirstPartyContentByType(partyGroup.partyId , partyGroup, "LGOIMGURL", delegator)
+    GenericValue partyContent = PartyContentWrapper.getFirstPartyContentByType(partyId, partyGroup, "LGOIMGURL", delegator)

Review comment:
       I won't object :)
   added comments to add condition while getting the data it'd be good we think around it as well. 
   
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] dixitdeepak commented on a change in pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
dixitdeepak commented on a change in pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#discussion_r560119881



##########
File path: applications/order/groovyScripts/order/CompanyHeader.groovy
##########
@@ -135,12 +136,22 @@ if (!partyId) {
 }
 
 // the logo
-partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
+GenericValue partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
 if (partyGroup) {
-    partyContentWrapper = new PartyContentWrapper(dispatcher, partyGroup, locale, EntityUtilProperties.getPropertyValue("content", "defaultMimeType", "text/html; charset=utf-8", delegator))
-    partyContent = partyContentWrapper.getFirstPartyContentByType(partyGroup.partyId , partyGroup, "LGOIMGURL", delegator)
+    GenericValue partyContent = PartyContentWrapper.getFirstPartyContentByType(partyId, partyGroup, "LGOIMGURL", delegator)

Review comment:
       Could you please share the dataResouce data?
   It should work properly 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] sonarcloud[bot] removed a comment on pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] removed a comment on pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#issuecomment-762734675


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252) No Coverage information  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] danwatford merged pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
danwatford merged pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] danwatford commented on a change in pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
danwatford commented on a change in pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#discussion_r561058042



##########
File path: applications/order/groovyScripts/order/CompanyHeader.groovy
##########
@@ -135,12 +136,22 @@ if (!partyId) {
 }
 
 // the logo
-partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
+GenericValue partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
 if (partyGroup) {
-    partyContentWrapper = new PartyContentWrapper(dispatcher, partyGroup, locale, EntityUtilProperties.getPropertyValue("content", "defaultMimeType", "text/html; charset=utf-8", delegator))
-    partyContent = partyContentWrapper.getFirstPartyContentByType(partyGroup.partyId , partyGroup, "LGOIMGURL", delegator)
+    GenericValue partyContent = PartyContentWrapper.getFirstPartyContentByType(partyId, partyGroup, "LGOIMGURL", delegator)

Review comment:
       Hi @dixitdeepak , 
   After manually setting DataResource.mimeTypeId to null I was able to call:
   ```
   PartyContentWrapper.getPartyContentAsText(partyGroup, content.getString("contentId"), context.request, "html")
   ```
   and get a String in response of the form `%EF%BF%BDPNG%0D%0A%1A...` which looks like a textual representation of the PNG file contents that I could then appropriately convert to base64 and include as a data-uri which is then consumed by Apache FOP.
   
   However, to do this we had to manually amend a database record which was created as a result of uploading party content via the UI. It is not clear to me how where the problem is. 
   
   Is there an issue with how content is handled when uploaded to ofbiz?
   Is there an issue which how content is rendered to text? Do we need a way to tell PartyContentRenderer/DataResourceWorker that we wish to render a binary file as a base64 encoded string? I'm not really familiar with the content handling mechanisms in ofbiz so am not able to advise a direction at the moment.
   
   It seems these issues might take a while to resolve. Meanwhile this PR is a workaround to get company logos displayed correctly in PDF documents and I would rather not delay the workaround unless there is a problem with its implementation.
   
   Would you object to me merging the PR as is?
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] danwatford commented on a change in pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
danwatford commented on a change in pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#discussion_r560210028



##########
File path: applications/order/groovyScripts/order/CompanyHeader.groovy
##########
@@ -135,12 +136,22 @@ if (!partyId) {
 }
 
 // the logo
-partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
+GenericValue partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
 if (partyGroup) {
-    partyContentWrapper = new PartyContentWrapper(dispatcher, partyGroup, locale, EntityUtilProperties.getPropertyValue("content", "defaultMimeType", "text/html; charset=utf-8", delegator))
-    partyContent = partyContentWrapper.getFirstPartyContentByType(partyGroup.partyId , partyGroup, "LGOIMGURL", delegator)
+    GenericValue partyContent = PartyContentWrapper.getFirstPartyContentByType(partyId, partyGroup, "LGOIMGURL", delegator)

Review comment:
       Hi @dixitdeepak , I still just get a string version of the content ID.
   
   After adding a new logo and assigning to the Company party as the logo image I end up with the following GenericEntities:
   
   (I appreciate the following is difficult to read so please let me know of any preferred way to get and present this sort of information.)
   
   dataResource.asImmutable().toString():
   ```
   {dataResourceName=TestLogo.png, lastUpdatedStamp=2021-01-19 13:57:11.498, surveyId=null,
   dataTemplateTypeId=NONE, lastModifiedDate=2021-01-19 13:57:10.159, createdTxStamp=2021-01-19 13:57:09.983,
   createdStamp=2021-01-19 13:57:11.176, mimeTypeId=image/png, lastUpdatedTxStamp=2021-01-19 13:57:09.983, 
   dataCategoryId=PERSONAL, surveyResponseId=null, characterSetId=null, dataSourceId=null,
   lastModifiedByUserLogin=admin, createdDate=2021-01-19 13:57:10.159, statusId=CTNT_PUBLISHED,
   localeString=null, relatedDetailId=null, dataResourceId=10030, isPublic=N, 
   objectInfo=C:/dev/floss/ofbiz/ofbiz-framework/runtime/uploads/1610721557185/10030.png,
   dataResourceTypeId=LOCAL_FILE, createdByUserLogin=admin}
   ```
   
   content.asImmutable().toString():
   ```
   {ownerContentId=null, createdStamp=2021-01-19 13:57:12.593, contentId=10030, contentTypeId=DOCUMENT, 
   description=null, mimeTypeId=image/png, childLeafCount=null, privilegeEnumId=null, dataSourceId=null, 
   lastModifiedByUserLogin=admin, dataResourceId=10030, createdByUserLogin=admin, 
   lastUpdatedStamp=2021-01-19 13:57:12.593, templateDataResourceId=null, lastModifiedDate=2021-01-19 13:57:12.593,
    instanceOfContentId=null, createdTxStamp=2021-01-19 13:57:09.983, lastUpdatedTxStamp=2021-01-19 13:57:09.983,
    serviceName=null, customMethodId=null, characterSetId=null, contentName=TestLogo.png, 
   createdDate=2021-01-19 13:57:12.593, statusId=CTNT_PUBLISHED, localeString=null, 
   decoratorContentId=null, childBranchCount=null}
   ```
   
   partyContent.asImmutable().toString()
   ```
   {fromDate=2021-01-19 13:57:13.014, lastUpdatedStamp=2021-01-19 13:57:13.014, partyContentTypeId=LGOIMGURL, 
   createdTxStamp=2021-01-19 13:57:09.983, createdStamp=2021-01-19 13:57:13.014, contentId=10030, 
   lastUpdatedTxStamp=2021-01-19 13:57:09.983, partyId=Company, thruDate=null}
   ```
   
   I tried the following methods at calling PartyContentWrapper.getPartyContentAsText from CompanyHeader.groovy:
   
   PartyContentWrapper.getPartyContentAsText(partyGroup, content.getString("contentId"), context.request, "html")
   `"10030"`
   
   PartyContentWrapper.getPartyContentAsText(partyGroup, content.getString("contentId"), context.request, "url")
   `"10030"`
   
   PartyContentWrapper.getPartyContentAsText(partyGroup, content.getString("contentId"), context.request, null)
   `"10030"`
   
   I'm not sure how else I should be using getPartyContentAsText as part of retrieving the binary content in order to convert to a data-uri.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] danwatford commented on a change in pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
danwatford commented on a change in pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#discussion_r563315812



##########
File path: applications/order/groovyScripts/order/CompanyHeader.groovy
##########
@@ -135,17 +136,25 @@ if (!partyId) {
 }
 
 // the logo
-partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
+GenericValue partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
 if (partyGroup) {
-    partyContentWrapper = new PartyContentWrapper(dispatcher, partyGroup, locale, EntityUtilProperties.getPropertyValue("content", "defaultMimeType", "text/html; charset=utf-8", delegator))
-    partyContent = partyContentWrapper.getFirstPartyContentByType(partyGroup.partyId , partyGroup, "LGOIMGURL", delegator)
-    if (partyContent) {
-        logoImageUrl = "/content/control/stream?contentId=" + partyContent.contentId
-    } else {
-        if (partyGroup?.logoImageUrl) {
-            logoImageUrl = partyGroup.logoImageUrl
+    GenericValue dataResource =
+            PartyContentWrapper.getFirstPartyContentByType(partyId, partyGroup, "LGOIMGURL", delegator)
+                    ?.getRelatedOne("Content", true)
+                    ?.getRelatedOne("DataResource", true)
+
+    if (dataResource) {
+        File logoFile = DataResourceWorker.getContentFile(dataResource.getString("dataResourceTypeId"),

Review comment:
       I've added the resource type id check and the fall-back to the previously used content/control/stream url.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] danwatford commented on a change in pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
danwatford commented on a change in pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#discussion_r560122119



##########
File path: applications/order/groovyScripts/order/CompanyHeader.groovy
##########
@@ -135,12 +136,22 @@ if (!partyId) {
 }
 
 // the logo
-partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
+GenericValue partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
 if (partyGroup) {
-    partyContentWrapper = new PartyContentWrapper(dispatcher, partyGroup, locale, EntityUtilProperties.getPropertyValue("content", "defaultMimeType", "text/html; charset=utf-8", delegator))
-    partyContent = partyContentWrapper.getFirstPartyContentByType(partyGroup.partyId , partyGroup, "LGOIMGURL", delegator)
+    GenericValue partyContent = PartyContentWrapper.getFirstPartyContentByType(partyId, partyGroup, "LGOIMGURL", delegator)

Review comment:
       I can take another look, but before I do so what sort of URL would you expect from getPartyContentAsText?
   
   If the URL is of the form https://localhost/content/control/stream?contentId=10001 then this won't solve the problem. I still need to read the binary data of the content so that I can turn it into a base64 encoded data-uri.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] dixitdeepak commented on a change in pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
dixitdeepak commented on a change in pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#discussion_r562389488



##########
File path: applications/order/groovyScripts/order/CompanyHeader.groovy
##########
@@ -135,12 +136,22 @@ if (!partyId) {
 }
 
 // the logo
-partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
+GenericValue partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
 if (partyGroup) {
-    partyContentWrapper = new PartyContentWrapper(dispatcher, partyGroup, locale, EntityUtilProperties.getPropertyValue("content", "defaultMimeType", "text/html; charset=utf-8", delegator))
-    partyContent = partyContentWrapper.getFirstPartyContentByType(partyGroup.partyId , partyGroup, "LGOIMGURL", delegator)
+    GenericValue partyContent = PartyContentWrapper.getFirstPartyContentByType(partyId, partyGroup, "LGOIMGURL", delegator)

Review comment:
       I don't think there is way to get base64 from content/dataresouce worker classes, 
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] dixitdeepak commented on a change in pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
dixitdeepak commented on a change in pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#discussion_r560144021



##########
File path: applications/order/groovyScripts/order/CompanyHeader.groovy
##########
@@ -135,12 +136,22 @@ if (!partyId) {
 }
 
 // the logo
-partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
+GenericValue partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
 if (partyGroup) {
-    partyContentWrapper = new PartyContentWrapper(dispatcher, partyGroup, locale, EntityUtilProperties.getPropertyValue("content", "defaultMimeType", "text/html; charset=utf-8", delegator))
-    partyContent = partyContentWrapper.getFirstPartyContentByType(partyGroup.partyId , partyGroup, "LGOIMGURL", delegator)
+    GenericValue partyContent = PartyContentWrapper.getFirstPartyContentByType(partyId, partyGroup, "LGOIMGURL", delegator)

Review comment:
       This will give the file path if data setup properly 
   It depends upon combination of following fields 
   - Data Template Type ID 
   - Data Resource Type ID 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] dixitdeepak commented on a change in pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
dixitdeepak commented on a change in pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#discussion_r560712502



##########
File path: applications/order/groovyScripts/order/CompanyHeader.groovy
##########
@@ -135,12 +136,22 @@ if (!partyId) {
 }
 
 // the logo
-partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
+GenericValue partyGroup = from("PartyGroup").where("partyId", partyId).queryOne()
 if (partyGroup) {
-    partyContentWrapper = new PartyContentWrapper(dispatcher, partyGroup, locale, EntityUtilProperties.getPropertyValue("content", "defaultMimeType", "text/html; charset=utf-8", delegator))
-    partyContent = partyContentWrapper.getFirstPartyContentByType(partyGroup.partyId , partyGroup, "LGOIMGURL", delegator)
+    GenericValue partyContent = PartyContentWrapper.getFirstPartyContentByType(partyId, partyGroup, "LGOIMGURL", delegator)

Review comment:
       After debugging code it fails to return object info due the check at DataResourceWorker.writeDataResourceText method
   https://github.com/apache/ofbiz-framework/blob/trunk/applications/content/src/main/java/org/apache/ofbiz/content/data/DataResourceWorker.java#L927
   
   `            if (dataResourceMimeTypeId == null || dataResourceMimeTypeId.startsWith("text")) {`
   
   If we delete the dataResourceMimeTypeId field from DataResource, it will work 
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#issuecomment-766385908


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252) No Coverage information  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #252: Fixed: Use data url scheme for logo in CompanyHeader (OFBIZ-7327)

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #252:
URL: https://github.com/apache/ofbiz-framework/pull/252#issuecomment-766385908


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=VULNERABILITY)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=SECURITY_HOTSPOT)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=252&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252) No Coverage information  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=252&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org