You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Thierry Yge (JIRA)" <ji...@apache.org> on 2008/09/09 22:41:44 UTC

[jira] Created: (SLING-653) adding a validator plugin for .json files that could be found

adding a validator plugin for .json files that could be found
-------------------------------------------------------------

                 Key: SLING-653
                 URL: https://issues.apache.org/jira/browse/SLING-653
             Project: Sling
          Issue Type: New Feature
          Components: Maven Plugins
    Affects Versions: Maven Sling Plugin 2.0.2
            Reporter: Thierry Yge
            Priority: Minor


It could be nice to have the sling maven plugin that build the bundle to validate the .json files that are found, thus it avoid to find the error during the
deployment of the bundle

simple error message that would tell in which file and where the problem occur would help.
It could use the json library like "JSONObject.fromObject()" to parse the .json files and catch the JSONException when it find an error.


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


[jira] Updated: (SLING-653) adding a validator plugin for .json files that could be found

Posted by "Thierry Yge (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thierry Yge updated SLING-653:
------------------------------

    Attachment: BundleValidateJSONFilesMojo.java

> adding a validator plugin for .json files that could be found
> -------------------------------------------------------------
>
>                 Key: SLING-653
>                 URL: https://issues.apache.org/jira/browse/SLING-653
>             Project: Sling
>          Issue Type: New Feature
>          Components: Maven Plugins
>    Affects Versions: Maven Sling Plugin 2.0.2
>            Reporter: Thierry Yge
>            Priority: Minor
>         Attachments: BundleValidateJSONFilesMojo.java
>
>
> It could be nice to have the sling maven plugin that build the bundle to validate the .json files that are found, thus it avoid to find the error during the
> deployment of the bundle
> simple error message that would tell in which file and where the problem occur would help.
> It could use the json library like "JSONObject.fromObject()" to parse the .json files and catch the JSONException when it find an error.

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


[jira] Resolved: (SLING-653) adding a validator plugin for .json files that could be found

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler resolved SLING-653.
------------------------------------

    Resolution: Fixed

In revision 759465 I've added a new validation mojo which scans all included resources. The idea is to have a general purpose validation mojo which
checks several things. As a first check I've added the json validation.
The mojo can be skipped by configuration and the json validation can be skipped as well (this will allow to just skip json validation once we add other validations)
Please cross check and then close this bug.

> adding a validator plugin for .json files that could be found
> -------------------------------------------------------------
>
>                 Key: SLING-653
>                 URL: https://issues.apache.org/jira/browse/SLING-653
>             Project: Sling
>          Issue Type: New Feature
>          Components: Maven Plugins
>    Affects Versions: Maven Sling Plugin 2.0.2
>            Reporter: Thierry Yge
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>             Fix For: Maven Sling Plugin 2.0.4
>
>         Attachments: BundleValidateJSONFilesMojo.java
>
>
> It could be nice to have the sling maven plugin that build the bundle to validate the .json files that are found, thus it avoid to find the error during the
> deployment of the bundle
> simple error message that would tell in which file and where the problem occur would help.
> It could use the json library like "JSONObject.fromObject()" to parse the .json files and catch the JSONException when it find an error.

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


[jira] Updated: (SLING-653) adding a validator plugin for .json files that could be found

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated SLING-653:
-----------------------------------

    Fix Version/s: Maven Sling Plugin 2.0.4

> adding a validator plugin for .json files that could be found
> -------------------------------------------------------------
>
>                 Key: SLING-653
>                 URL: https://issues.apache.org/jira/browse/SLING-653
>             Project: Sling
>          Issue Type: New Feature
>          Components: Maven Plugins
>    Affects Versions: Maven Sling Plugin 2.0.2
>            Reporter: Thierry Yge
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>             Fix For: Maven Sling Plugin 2.0.4
>
>         Attachments: BundleValidateJSONFilesMojo.java
>
>
> It could be nice to have the sling maven plugin that build the bundle to validate the .json files that are found, thus it avoid to find the error during the
> deployment of the bundle
> simple error message that would tell in which file and where the problem occur would help.
> It could use the json library like "JSONObject.fromObject()" to parse the .json files and catch the JSONException when it find an error.

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


[jira] Updated: (SLING-653) adding a validator plugin for .json files that could be found

Posted by "Thierry Yge (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thierry Yge updated SLING-653:
------------------------------

    Attachment: JSONValidator.java

example implementation of such plugin using net.sf.json-lib and common-io as dependencies

> adding a validator plugin for .json files that could be found
> -------------------------------------------------------------
>
>                 Key: SLING-653
>                 URL: https://issues.apache.org/jira/browse/SLING-653
>             Project: Sling
>          Issue Type: New Feature
>          Components: Maven Plugins
>    Affects Versions: Maven Sling Plugin 2.0.2
>            Reporter: Thierry Yge
>            Priority: Minor
>         Attachments: JSONValidator.java
>
>
> It could be nice to have the sling maven plugin that build the bundle to validate the .json files that are found, thus it avoid to find the error during the
> deployment of the bundle
> simple error message that would tell in which file and where the problem occur would help.
> It could use the json library like "JSONObject.fromObject()" to parse the .json files and catch the JSONException when it find an error.

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


[jira] Commented: (SLING-653) adding a validator plugin for .json files that could be found

Posted by "Thierry Yge (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629847#action_12629847 ] 

Thierry Yge commented on SLING-653:
-----------------------------------

I dont have a commiter account , but here is the attached java code for the maven-sling-plugin
first have to add 

        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.commons.json</artifactId>
            <version>2.0.3-incubator-SNAPSHOT</version>
        </dependency>

Then use the attached file BundleValidateJSONFilesMojo.java  in the package org.apache.sling.maven.bundlesupport

Thanks.

> adding a validator plugin for .json files that could be found
> -------------------------------------------------------------
>
>                 Key: SLING-653
>                 URL: https://issues.apache.org/jira/browse/SLING-653
>             Project: Sling
>          Issue Type: New Feature
>          Components: Maven Plugins
>    Affects Versions: Maven Sling Plugin 2.0.2
>            Reporter: Thierry Yge
>            Priority: Minor
>         Attachments: BundleValidateJSONFilesMojo.java, JSONValidator.java
>
>
> It could be nice to have the sling maven plugin that build the bundle to validate the .json files that are found, thus it avoid to find the error during the
> deployment of the bundle
> simple error message that would tell in which file and where the problem occur would help.
> It could use the json library like "JSONObject.fromObject()" to parse the .json files and catch the JSONException when it find an error.

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


[jira] Updated: (SLING-653) adding a validator plugin for .json files that could be found

Posted by "Thierry Yge (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thierry Yge updated SLING-653:
------------------------------

    Attachment:     (was: BundleValidateJSONFilesMojo.java)

> adding a validator plugin for .json files that could be found
> -------------------------------------------------------------
>
>                 Key: SLING-653
>                 URL: https://issues.apache.org/jira/browse/SLING-653
>             Project: Sling
>          Issue Type: New Feature
>          Components: Maven Plugins
>    Affects Versions: Maven Sling Plugin 2.0.2
>            Reporter: Thierry Yge
>            Priority: Minor
>         Attachments: BundleValidateJSONFilesMojo.java
>
>
> It could be nice to have the sling maven plugin that build the bundle to validate the .json files that are found, thus it avoid to find the error during the
> deployment of the bundle
> simple error message that would tell in which file and where the problem occur would help.
> It could use the json library like "JSONObject.fromObject()" to parse the .json files and catch the JSONException when it find an error.

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


[jira] Commented: (SLING-653) adding a validator plugin for .json files that could be found

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12693466#action_12693466 ] 

Carsten Ziegeler commented on SLING-653:
----------------------------------------

In revision 759494 I've changed the handling a little bit: file input stream is now properly closed and there is no error any more if the input contains a json array (and not a json object)

> adding a validator plugin for .json files that could be found
> -------------------------------------------------------------
>
>                 Key: SLING-653
>                 URL: https://issues.apache.org/jira/browse/SLING-653
>             Project: Sling
>          Issue Type: New Feature
>          Components: Maven Plugins
>    Affects Versions: Maven Sling Plugin 2.0.2
>            Reporter: Thierry Yge
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>             Fix For: Maven Sling Plugin 2.0.4
>
>         Attachments: BundleValidateJSONFilesMojo.java
>
>
> It could be nice to have the sling maven plugin that build the bundle to validate the .json files that are found, thus it avoid to find the error during the
> deployment of the bundle
> simple error message that would tell in which file and where the problem occur would help.
> It could use the json library like "JSONObject.fromObject()" to parse the .json files and catch the JSONException when it find an error.

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


[jira] Commented: (SLING-653) adding a validator plugin for .json files that could be found

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629717#action_12629717 ] 

Felix Meschberger commented on SLING-653:
-----------------------------------------

This looks like an interesting addition. Could you create a patch against the current (trunk) maven-sling-plugin project and also use the Sling's own commons/json library as a dependency instead of the Sourceforge one ? Thanks.

> adding a validator plugin for .json files that could be found
> -------------------------------------------------------------
>
>                 Key: SLING-653
>                 URL: https://issues.apache.org/jira/browse/SLING-653
>             Project: Sling
>          Issue Type: New Feature
>          Components: Maven Plugins
>    Affects Versions: Maven Sling Plugin 2.0.2
>            Reporter: Thierry Yge
>            Priority: Minor
>         Attachments: JSONValidator.java
>
>
> It could be nice to have the sling maven plugin that build the bundle to validate the .json files that are found, thus it avoid to find the error during the
> deployment of the bundle
> simple error message that would tell in which file and where the problem occur would help.
> It could use the json library like "JSONObject.fromObject()" to parse the .json files and catch the JSONException when it find an error.

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


[jira] Assigned: (SLING-653) adding a validator plugin for .json files that could be found

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler reassigned SLING-653:
--------------------------------------

    Assignee: Carsten Ziegeler

> adding a validator plugin for .json files that could be found
> -------------------------------------------------------------
>
>                 Key: SLING-653
>                 URL: https://issues.apache.org/jira/browse/SLING-653
>             Project: Sling
>          Issue Type: New Feature
>          Components: Maven Plugins
>    Affects Versions: Maven Sling Plugin 2.0.2
>            Reporter: Thierry Yge
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>             Fix For: Maven Sling Plugin 2.0.4
>
>         Attachments: BundleValidateJSONFilesMojo.java
>
>
> It could be nice to have the sling maven plugin that build the bundle to validate the .json files that are found, thus it avoid to find the error during the
> deployment of the bundle
> simple error message that would tell in which file and where the problem occur would help.
> It could use the json library like "JSONObject.fromObject()" to parse the .json files and catch the JSONException when it find an error.

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


[jira] Updated: (SLING-653) adding a validator plugin for .json files that could be found

Posted by "Thierry Yge (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thierry Yge updated SLING-653:
------------------------------

    Attachment: BundleValidateJSONFilesMojo.java

the class rewritten for maven sling plugin

> adding a validator plugin for .json files that could be found
> -------------------------------------------------------------
>
>                 Key: SLING-653
>                 URL: https://issues.apache.org/jira/browse/SLING-653
>             Project: Sling
>          Issue Type: New Feature
>          Components: Maven Plugins
>    Affects Versions: Maven Sling Plugin 2.0.2
>            Reporter: Thierry Yge
>            Priority: Minor
>         Attachments: BundleValidateJSONFilesMojo.java, JSONValidator.java
>
>
> It could be nice to have the sling maven plugin that build the bundle to validate the .json files that are found, thus it avoid to find the error during the
> deployment of the bundle
> simple error message that would tell in which file and where the problem occur would help.
> It could use the json library like "JSONObject.fromObject()" to parse the .json files and catch the JSONException when it find an error.

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


[jira] Updated: (SLING-653) adding a validator plugin for .json files that could be found

Posted by "Thierry Yge (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thierry Yge updated SLING-653:
------------------------------

    Attachment:     (was: JSONValidator.java)

> adding a validator plugin for .json files that could be found
> -------------------------------------------------------------
>
>                 Key: SLING-653
>                 URL: https://issues.apache.org/jira/browse/SLING-653
>             Project: Sling
>          Issue Type: New Feature
>          Components: Maven Plugins
>    Affects Versions: Maven Sling Plugin 2.0.2
>            Reporter: Thierry Yge
>            Priority: Minor
>         Attachments: BundleValidateJSONFilesMojo.java
>
>
> It could be nice to have the sling maven plugin that build the bundle to validate the .json files that are found, thus it avoid to find the error during the
> deployment of the bundle
> simple error message that would tell in which file and where the problem occur would help.
> It could use the json library like "JSONObject.fromObject()" to parse the .json files and catch the JSONException when it find an error.

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