Portals Bridges
  1. Portals Bridges
  2. PB-70

Groovy Bridge needs to support groovy script preferences validator and groovy script pre-286 portlet.

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.3
    • Fix Version/s: 1.0.3
    • Component/s: groovy
    • Labels:
      None

      Description

      We can use Groovy script to write a portlet now, but we need more.
      We should be able to write a groovy preferences validator. Also we should be able to write a groovy script portlet which supports pre-286 header phase.

      In summary, the followings are expected:

      • One can add a portlet preferences validator class into the portlet.xml. The class is a wrapper class for groovy script.
      • The wrapper class reads (read-only) preferences to find the script file and auto-refresh mode.
      • When auto-refresh mode is true, the modification of the validator script should be applied instantly.
      • Also, one can write a groovy portlet to support pre-286 header phase. Currently Jetspeed-2 API provides this interface. So the script developer implements SupportsHeaderPhase interface of Jetspeed-2 to provide header phase.
      • In such case, the developer can set the portlet-class to another wrapper class.

        Activity

        Woonsan Ko created issue -
        Hide
        Woonsan Ko added a comment -

        I wrote a patch to cover the expectations. See the xdoc documentation for details.

        By the way, let me point out one thing related to Groovy:

        • Currently, Groovy has some problems on dealing with library classes built by Java 1.5 or later. There are many bug reports related to this problem. ("GroovyReflector" problems)
          For example, if jetspeed-api-2.x.jar is compiled with Java 1.5 or later, then Groovy script portlet with header phase fails to invoke response.getHeaderResource(). Groovy throws a ClassCastException here.
          However, this problem is not related to the JVM 1.5 or later runtime.
          (Probably, it is a Groovy issue related to Java class target version.)
          So, if jetspeed-api-2.x jar is compiled with Java 1.4 or earlier, then there's no problem.
          Anyway, I believe this problem will be fixed sooner or later.
        Show
        Woonsan Ko added a comment - I wrote a patch to cover the expectations. See the xdoc documentation for details. By the way, let me point out one thing related to Groovy: Currently, Groovy has some problems on dealing with library classes built by Java 1.5 or later. There are many bug reports related to this problem. ("GroovyReflector" problems) For example, if jetspeed-api-2.x.jar is compiled with Java 1.5 or later, then Groovy script portlet with header phase fails to invoke response.getHeaderResource(). Groovy throws a ClassCastException here. However, this problem is not related to the JVM 1.5 or later runtime. (Probably, it is a Groovy issue related to Java class target version.) So, if jetspeed-api-2.x jar is compiled with Java 1.4 or earlier, then there's no problem. Anyway, I believe this problem will be fixed sooner or later.
        Woonsan Ko made changes -
        Field Original Value New Value
        Attachment groovy-improve-diff.zip [ 12360179 ]
        Ate Douma made changes -
        Affects Version/s 1.0.2 [ 12312332 ]
        Component/s groovy [ 12311819 ]
        Fix Version/s 1.0.2 [ 12312332 ]
        Ate Douma made changes -
        Assignee Ate Douma [ adouma ]
        Hide
        Ate Douma added a comment -

        Has been applied (by David Taylor) and tested fine.
        Another great contribution Woonsan!

        Show
        Ate Douma added a comment - Has been applied (by David Taylor) and tested fine. Another great contribution Woonsan!
        Ate Douma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Woonsan Ko added a comment -

        I stupidly commented on "GroovyReflector" problems associating with Java 1.5 jetspeed-api classes.
        The problem is not related to Java 1.5 classes. There's no problem with Java 1.5 both at compile-time and at runtime.

        The "GroovyReflector" problem is related to multiple class loaders, each of which contains groovy-1.x.jar.
        This problem was fixed for groovy-1.1-beta2. ( See http://jira.codehaus.org/browse/GROOVY-1867 )
        Therefore, we need to just upgrade the version of the following library jars for Portals Bridge and Jetspeed-2:

        • groovy-1.0.jar --> groovy-1.1-beta-2.jar
        • antlr-2.7.5.jar --> antlr-2.7.6.jar

        By the way, there's no groovy-1.1-beta-2.jar in ibiblio maven repository.
        So, I'm going to make a request to some other repository (e.g. http://www.bluesunrise.com/maven/) and to change the version information.

        Show
        Woonsan Ko added a comment - I stupidly commented on "GroovyReflector" problems associating with Java 1.5 jetspeed-api classes. The problem is not related to Java 1.5 classes. There's no problem with Java 1.5 both at compile-time and at runtime. The "GroovyReflector" problem is related to multiple class loaders, each of which contains groovy-1.x.jar. This problem was fixed for groovy-1.1-beta2. ( See http://jira.codehaus.org/browse/GROOVY-1867 ) Therefore, we need to just upgrade the version of the following library jars for Portals Bridge and Jetspeed-2: groovy-1.0.jar --> groovy-1.1-beta-2.jar antlr-2.7.5.jar --> antlr-2.7.6.jar By the way, there's no groovy-1.1-beta-2.jar in ibiblio maven repository. So, I'm going to make a request to some other repository (e.g. http://www.bluesunrise.com/maven/ ) and to change the version information.
        Hide
        Woonsan Ko added a comment -

        More exactly speaking, the "GroovyReflector" problem can occur in the following situation:

        • a portlet application contains groovy-1.0.jar in /WEB-INF/lib/.
        • jetspeed portal application also contains groovy-1.0.jar in /WEB-INF/lib/ for some reason.

        However, if each of more than one portlet application has groovy-1.0.jar and if jetspeed portal application does not, then there's no problem.

        With groovy-1.1-beta-2.jar, the above-mentioned problems does not occur any more.
        See http://jira.codehaus.org/browse/GROOVY-1867 for detail.

        Show
        Woonsan Ko added a comment - More exactly speaking, the "GroovyReflector" problem can occur in the following situation: a portlet application contains groovy-1.0.jar in /WEB-INF/lib/. jetspeed portal application also contains groovy-1.0.jar in /WEB-INF/lib/ for some reason. However, if each of more than one portlet application has groovy-1.0.jar and if jetspeed portal application does not, then there's no problem. With groovy-1.1-beta-2.jar, the above-mentioned problems does not occur any more. See http://jira.codehaus.org/browse/GROOVY-1867 for detail.

          People

          • Assignee:
            Ate Douma
            Reporter:
            Woonsan Ko
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development