wadl
  1. wadl
  2. WADL-43

Need a way to control the name of the generated class

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The generation API should provide a way for the client to specify the name of the class being generated, currently this can only be defaulted from the URL.

      A static API that allows the development tools to generate an API should be provided.

      1. MyApi.java
        5 kB
        aroller
      2. Wadl2JavaMojo.java
        6 kB
        aroller

        Issue Links

          Activity

          Hide
          aroller added a comment - - edited

          Changes to the Maven Mojo that will allow configuration of the custom class names (see attached file).

          /**

          • A list of key/value pairs with the key being the Base URL in the WADL file. The value is the
          • desired name of the resulting class.
          • <pre>
          • <customClassNames>
          • <property>
          • <name>http://localhost:8080</name>
          • <value>MyApi</value>
          • </property>
          • <property>
          • <name>http://example.com/api</name>
          • <value>MyApi</value>
          • </property>
          • </customClassNames>
          • </pre>
          • Properties used instead of map because colon is not allowed in xml element name.
          • @parameter expression="$ {customClassNames}

            "
            */
            private Properties customClassNames;

          Show
          aroller added a comment - - edited Changes to the Maven Mojo that will allow configuration of the custom class names (see attached file). /** A list of key/value pairs with the key being the Base URL in the WADL file. The value is the desired name of the resulting class. <pre> <customClassNames> <property> <name> http://localhost:8080 </name> <value>MyApi</value> </property> <property> <name> http://example.com/api </name> <value>MyApi</value> </property> </customClassNames> </pre> Properties used instead of map because colon is not allowed in xml element name. @parameter expression="$ {customClassNames} " */ private Properties customClassNames;
          Hide
          aroller added a comment -

          The resulting Generated file

          Show
          aroller added a comment - The resulting Generated file
          Hide
          gdavison added a comment -

          Merged proposed fix from Aaron, only remaining problem now is the command line interface before I can close this bug.

          Show
          gdavison added a comment - Merged proposed fix from Aaron, only remaining problem now is the command line interface before I can close this bug.
          Hide
          sirgeek added a comment -

          Couldn't something as simple as -r [STRING] be done as a parameter (if it is present, use it else use exactly what you use now.

          i.e. something like:

          wadl2java -r WebServices -p com.isone.testing.webservices.v1_0a -o ../../../workspace/webservices/src ../../../sqaCVS/www/src-bind/wadl_1.31.xml

          Show
          sirgeek added a comment - Couldn't something as simple as -r [STRING] be done as a parameter (if it is present, use it else use exactly what you use now. i.e. something like: wadl2java -r WebServices -p com.isone.testing.webservices.v1_0a -o ../../../workspace/webservices/src ../../../sqaCVS/www/src-bind/wadl_1.31.xml
          Hide
          gdavison added a comment -

          Unfortunately in the above examples you can have multiple root resources in a WADL so you need to be able to enter names for each URI, hence the complication.

          Show
          gdavison added a comment - Unfortunately in the above examples you can have multiple root resources in a WADL so you need to be able to enter names for each URI, hence the complication.
          Hide
          sirgeek added a comment -

          what about using something like the jax-rs-catalog.xml ?

          <uri name="WsProjectDomainCom_ApiV10" uri="WebServices" />
          <uri name="WsSandboxDomainCom_ApiV10" uri="WebServices" />

          Would that work ?

          Show
          sirgeek added a comment - what about using something like the jax-rs-catalog.xml ? <uri name="WsProjectDomainCom_ApiV10" uri="WebServices" /> <uri name="WsSandboxDomainCom_ApiV10" uri="WebServices" /> Would that work ?

            People

            • Assignee:
              gdavison
              Reporter:
              gdavison
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: