You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@manifoldcf.apache.org by "Piergiorgio Lucidi (JIRA)" <ji...@apache.org> on 2011/09/26 13:12:26 UTC
[jira] [Created] (CONNECTORS-265) Remove all the HTML snippets from
the Java code
Remove all the HTML snippets from the Java code
-----------------------------------------------
Key: CONNECTORS-265
URL: https://issues.apache.org/jira/browse/CONNECTORS-265
Project: ManifoldCF
Issue Type: Improvement
Components: CMIS connector
Reporter: Piergiorgio Lucidi
Assignee: Piergiorgio Lucidi
We have to start to remove all the HTML code inside Java classes, I started a refactoring to create a simple outputResource method that can be considered globally for all the connectors.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CONNECTORS-265) Remove all the HTML snippets
from the Java code
Posted by "Karl Wright (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CONNECTORS-265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13121351#comment-13121351 ]
Karl Wright commented on CONNECTORS-265:
----------------------------------------
There's already support in ManifoldCF ui-core for the escaping methods we need. But more to the point, in one .html file there will be multiple types of escaping needed. A simplistic solution will not work; you'll have to actually parse the .html file to find what sections should be escaped in what way.
I'm not adverse to checking the patch in as it stands, but bear in mind that we're not going to be able to apply the same technique broadly, for the reasons I've stated.
> Remove all the HTML snippets from the Java code
> -----------------------------------------------
>
> Key: CONNECTORS-265
> URL: https://issues.apache.org/jira/browse/CONNECTORS-265
> Project: ManifoldCF
> Issue Type: Improvement
> Components: CMIS connector
> Reporter: Piergiorgio Lucidi
> Assignee: Piergiorgio Lucidi
> Attachments: patch.txt, patch2.txt
>
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> We have to start to remove all the HTML code inside Java classes, I started a refactoring to create a simple outputResource method that can be considered globally for all the connectors.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CONNECTORS-265) Remove all the HTML snippets from
the Java code
Posted by "Piergiorgio Lucidi (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CONNECTORS-265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Piergiorgio Lucidi updated CONNECTORS-265:
------------------------------------------
Fix Version/s: ManifoldCF 0.4
> Remove all the HTML snippets from the Java code
> -----------------------------------------------
>
> Key: CONNECTORS-265
> URL: https://issues.apache.org/jira/browse/CONNECTORS-265
> Project: ManifoldCF
> Issue Type: Improvement
> Components: CMIS connector
> Reporter: Piergiorgio Lucidi
> Assignee: Piergiorgio Lucidi
> Fix For: ManifoldCF 0.4
>
> Attachments: patch.txt, patch2.txt
>
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> We have to start to remove all the HTML code inside Java classes, I started a refactoring to create a simple outputResource method that can be considered globally for all the connectors.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CONNECTORS-265) Remove all the HTML snippets from
the Java code
Posted by "Piergiorgio Lucidi (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CONNECTORS-265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Piergiorgio Lucidi updated CONNECTORS-265:
------------------------------------------
Attachment: patch.txt
The first patch
> Remove all the HTML snippets from the Java code
> -----------------------------------------------
>
> Key: CONNECTORS-265
> URL: https://issues.apache.org/jira/browse/CONNECTORS-265
> Project: ManifoldCF
> Issue Type: Improvement
> Components: CMIS connector
> Reporter: Piergiorgio Lucidi
> Assignee: Piergiorgio Lucidi
> Attachments: patch.txt
>
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> We have to start to remove all the HTML code inside Java classes, I started a refactoring to create a simple outputResource method that can be considered globally for all the connectors.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CONNECTORS-265) Remove all the HTML snippets from
the Java code
Posted by "Piergiorgio Lucidi (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CONNECTORS-265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Piergiorgio Lucidi updated CONNECTORS-265:
------------------------------------------
Resolution: Fixed
Status: Resolved (was: Patch Available)
r1179441
> Remove all the HTML snippets from the Java code
> -----------------------------------------------
>
> Key: CONNECTORS-265
> URL: https://issues.apache.org/jira/browse/CONNECTORS-265
> Project: ManifoldCF
> Issue Type: Improvement
> Components: CMIS connector
> Reporter: Piergiorgio Lucidi
> Assignee: Piergiorgio Lucidi
> Attachments: patch.txt, patch2.txt
>
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> We have to start to remove all the HTML code inside Java classes, I started a refactoring to create a simple outputResource method that can be considered globally for all the connectors.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CONNECTORS-265) Remove all the HTML snippets
from the Java code
Posted by "Piergiorgio Lucidi (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CONNECTORS-265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13115343#comment-13115343 ]
Piergiorgio Lucidi commented on CONNECTORS-265:
-----------------------------------------------
Karl has found a first problem about HTML escaping, I hope to attach a second patch soon.
> Remove all the HTML snippets from the Java code
> -----------------------------------------------
>
> Key: CONNECTORS-265
> URL: https://issues.apache.org/jira/browse/CONNECTORS-265
> Project: ManifoldCF
> Issue Type: Improvement
> Components: CMIS connector
> Reporter: Piergiorgio Lucidi
> Assignee: Piergiorgio Lucidi
> Attachments: patch.txt
>
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> We have to start to remove all the HTML code inside Java classes, I started a refactoring to create a simple outputResource method that can be considered globally for all the connectors.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CONNECTORS-265) Remove all the HTML snippets from
the Java code
Posted by "Piergiorgio Lucidi (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CONNECTORS-265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Piergiorgio Lucidi updated CONNECTORS-265:
------------------------------------------
Attachment: patch2.txt
This patch must be installed after the first patch.txt.
I just added the escaping check before showing parameters values in the output template.
> Remove all the HTML snippets from the Java code
> -----------------------------------------------
>
> Key: CONNECTORS-265
> URL: https://issues.apache.org/jira/browse/CONNECTORS-265
> Project: ManifoldCF
> Issue Type: Improvement
> Components: CMIS connector
> Reporter: Piergiorgio Lucidi
> Assignee: Piergiorgio Lucidi
> Attachments: patch.txt, patch2.txt
>
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> We have to start to remove all the HTML code inside Java classes, I started a refactoring to create a simple outputResource method that can be considered globally for all the connectors.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CONNECTORS-265) Remove all the HTML snippets
from the Java code
Posted by "Karl Wright (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CONNECTORS-265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13116650#comment-13116650 ]
Karl Wright commented on CONNECTORS-265:
----------------------------------------
The second patch makes the CMIS connector correct again, near as I can tell. However, as a technology that we'd consider porting to other connectors as well, there are some things we'll need to deal with. Specifically:
(1) Attribute escape vs. body escape vs. javascript escape. Each context has a different escaping requirement, therefore we need a way to distinguish them from one another. Possibilities include taking the escape code out of the common method and putting it in the caller, or recognizing context by parsing the HTML, etc.
(2) HTML snippets that repeat based on a loop. This is a common construct when we build tables, and we must have a way to do it.
(3) Places where we need to talk to the connector in order to find information, and how to handle errors in such cases. Usually this has a form something like this:
{code}
<get connection>
try
{
... generate some html, possibly in a loop ...
}
catch (ManifoldCFException e)
{
... generate different html that gives an error ...
}
finally
{
<release connection>
}
{code}
This is also something we need to be able to do.
My suggestion is therefore to think through these cases before committing the patches. Let's come up with a way to (for example) deal with the jcifs connector, before claiming we have a good universal solution.
> Remove all the HTML snippets from the Java code
> -----------------------------------------------
>
> Key: CONNECTORS-265
> URL: https://issues.apache.org/jira/browse/CONNECTORS-265
> Project: ManifoldCF
> Issue Type: Improvement
> Components: CMIS connector
> Reporter: Piergiorgio Lucidi
> Assignee: Piergiorgio Lucidi
> Attachments: patch.txt, patch2.txt
>
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> We have to start to remove all the HTML code inside Java classes, I started a refactoring to create a simple outputResource method that can be considered globally for all the connectors.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CONNECTORS-265) Remove all the HTML snippets
from the Java code
Posted by "Piergiorgio Lucidi (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CONNECTORS-265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13121124#comment-13121124 ]
Piergiorgio Lucidi commented on CONNECTORS-265:
-----------------------------------------------
{quote}
(1) Attribute escape vs. body escape vs. javascript escape. Each context has a different escaping requirement, therefore we need a way to distinguish them from one another. Possibilities include taking the escape code out of the common method and putting it in the caller, or recognizing context by parsing the HTML, etc.
{quote}
We could implement a check method to understand if the string contains Javascript code (if it starts with "<script type=\"text/javascript\">") or HTML code (if it starts with "<table") and then escape the string using StringEscapeUtils methods like escapeHtml and escapeEcmaScript:
http://commons.apache.org/lang/api-release/src-html/org/apache/commons/lang3/StringEscapeUtils.html#line.313
> Remove all the HTML snippets from the Java code
> -----------------------------------------------
>
> Key: CONNECTORS-265
> URL: https://issues.apache.org/jira/browse/CONNECTORS-265
> Project: ManifoldCF
> Issue Type: Improvement
> Components: CMIS connector
> Reporter: Piergiorgio Lucidi
> Assignee: Piergiorgio Lucidi
> Attachments: patch.txt, patch2.txt
>
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> We have to start to remove all the HTML code inside Java classes, I started a refactoring to create a simple outputResource method that can be considered globally for all the connectors.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CONNECTORS-265) Remove all the HTML snippets
from the Java code
Posted by "Karl Wright (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CONNECTORS-265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114625#comment-13114625 ]
Karl Wright commented on CONNECTORS-265:
----------------------------------------
Could you attach a patch for this before committing? I'd love to see what the plan is.
> Remove all the HTML snippets from the Java code
> -----------------------------------------------
>
> Key: CONNECTORS-265
> URL: https://issues.apache.org/jira/browse/CONNECTORS-265
> Project: ManifoldCF
> Issue Type: Improvement
> Components: CMIS connector
> Reporter: Piergiorgio Lucidi
> Assignee: Piergiorgio Lucidi
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> We have to start to remove all the HTML code inside Java classes, I started a refactoring to create a simple outputResource method that can be considered globally for all the connectors.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CONNECTORS-265) Remove all the HTML snippets from
the Java code
Posted by "Piergiorgio Lucidi (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CONNECTORS-265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Piergiorgio Lucidi updated CONNECTORS-265:
------------------------------------------
Status: Patch Available (was: Open)
This is the initial version of the code refactoring to remove HTML snippets. Feel free to leave comments to improve this implementation.
> Remove all the HTML snippets from the Java code
> -----------------------------------------------
>
> Key: CONNECTORS-265
> URL: https://issues.apache.org/jira/browse/CONNECTORS-265
> Project: ManifoldCF
> Issue Type: Improvement
> Components: CMIS connector
> Reporter: Piergiorgio Lucidi
> Assignee: Piergiorgio Lucidi
> Attachments: patch.txt
>
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> We have to start to remove all the HTML code inside Java classes, I started a refactoring to create a simple outputResource method that can be considered globally for all the connectors.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CONNECTORS-265) Remove all the HTML snippets
from the Java code
Posted by "Karl Wright (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CONNECTORS-265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119990#comment-13119990 ]
Karl Wright commented on CONNECTORS-265:
----------------------------------------
I've been thinking about this, and I've concluded that in order to support the required constructs, we're going to need a language, not just a simple substitution. I liked JSP because it allowed this to be done with Java, but with JSP as implemented in app servers you lose control over the class loading. (Or do you? if you can find a way to put JSP's in resources such that we call them from the connector class and the right class loader gets used, that would work.
Solr uses Velocity. I'm not thrilled with Velocity because it forces all control logic to be tags, and thus becomes very cumbersome very quickly. But perhaps it has gotten better - maybe we should look at it again.
If none of these works out, I may be able to design a language that would meet the goals. It would, of course, be unique to ManifoldCF, but so is the substitution scheme.
> Remove all the HTML snippets from the Java code
> -----------------------------------------------
>
> Key: CONNECTORS-265
> URL: https://issues.apache.org/jira/browse/CONNECTORS-265
> Project: ManifoldCF
> Issue Type: Improvement
> Components: CMIS connector
> Reporter: Piergiorgio Lucidi
> Assignee: Piergiorgio Lucidi
> Attachments: patch.txt, patch2.txt
>
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> We have to start to remove all the HTML code inside Java classes, I started a refactoring to create a simple outputResource method that can be considered globally for all the connectors.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CONNECTORS-265) Remove all the HTML snippets from
the Java code
Posted by "Piergiorgio Lucidi (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CONNECTORS-265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Piergiorgio Lucidi updated CONNECTORS-265:
------------------------------------------
Comment: was deleted
(was: The first patch)
> Remove all the HTML snippets from the Java code
> -----------------------------------------------
>
> Key: CONNECTORS-265
> URL: https://issues.apache.org/jira/browse/CONNECTORS-265
> Project: ManifoldCF
> Issue Type: Improvement
> Components: CMIS connector
> Reporter: Piergiorgio Lucidi
> Assignee: Piergiorgio Lucidi
> Attachments: patch.txt
>
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> We have to start to remove all the HTML code inside Java classes, I started a refactoring to create a simple outputResource method that can be considered globally for all the connectors.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CONNECTORS-265) Remove all the HTML snippets
from the Java code
Posted by "Piergiorgio Lucidi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CONNECTORS-265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114631#comment-13114631 ]
Piergiorgio Lucidi commented on CONNECTORS-265:
-----------------------------------------------
Ok it's not a problem, I'll attach a patch this night, but only for the CMIS Connector.
I taken the idea from the OpenSearchServer connector but I implemented only a simple method that could be moved in a common class. I also think that the method could be declared static.
> Remove all the HTML snippets from the Java code
> -----------------------------------------------
>
> Key: CONNECTORS-265
> URL: https://issues.apache.org/jira/browse/CONNECTORS-265
> Project: ManifoldCF
> Issue Type: Improvement
> Components: CMIS connector
> Reporter: Piergiorgio Lucidi
> Assignee: Piergiorgio Lucidi
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> We have to start to remove all the HTML code inside Java classes, I started a refactoring to create a simple outputResource method that can be considered globally for all the connectors.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira