Graham,

You can get the resource from any class, just create a class object
from the right package. Let's not get hung up on how the schemas are
pulled into the build. Just copy them into the src tree and build from
there. We just need to update them periodically until the spec
finalizes.

-- Arthur

On 12/11/06, Graham Turrell <[EMAIL PROTECTED]> wrote:
Arthur,

I could certainly do that, though the implication with WODEN-85 [1] is that
we'd be using the ant build to dynamically
populate java packages, which I'm a lot less comfortable with.

If we're adding the schema to a java package at build time,
then developers would expect to see those schema in that package in the src
tree also. If we *store* the schema files in svn under say
trunk/java/src/org/apache/woden/resolver/resources, we'd avoid that
concern, but this kind of goes against my reading
of the requirement of [1] (to pull down the schema files dynamically at
build time).
That was my rationale for staying outside of the java package hierarchy.

I think my proposal does meet your needs, but perhaps you could help me
better understand your requirements through your example?
(I believe that it would only return an InputStream if wsdl20.xsd was in
the same package as the calling class, since non-absolute
resource name arguments to getResource()/getResourceAsStream() are treated
as relative to the current package name only.
So simply specifiying an unqualified resource name would seem limited in
value)

The methods getResource()/getResourceAsStream() will find the resource
on the classpath if given the qualified package name, so if wsdl20.xsd is
held in /xmlcatalog/wsdl (in woden.jar), then

InputStream is = this.getClass().getResourceAsStream(
"/xmlcatalog/wsdl/wsdl20.xsd" );

would create the InputStream as required (regardless of the calling class).
Do you have scenarios where this would be insufficient?

Also I wasn't clear why you say we should necessarily use an existing
package for the schema?

Thanks.

Kind Regards,

Graham.


[1] [1] http://issues.apache.org/jira/browse/WODEN-85

Arthur Ryman <[EMAIL PROTECTED]> wrote on 11/12/2006 19:43:33:

>
> Graham,
>
> The schemas and DTDs should be in a Java package directory so the
> usual Java class loader can find them and return them as input streams.
>
> e.g.
>
> InputStream is = this.getClass().getResourceAsStream( "wsdl20.xsd" );
>
> You should pick an existing package. Maybe the one that holds the
> URI resolver.
>
> Arthur Ryman,
> IBM Software Group, Rational Division
>
> blog: http://ryman.eclipsedevelopersjournal.com/
> phone: +1-905-413-3077, TL 969-3077
> assistant: +1-905-413-2411, TL 969-2411
> fax: +1-905-413-4920, TL 969-4920
> mobile: +1-416-939-5063, text: [EMAIL PROTECTED]
>

>
> Graham Turrell <[EMAIL PROTECTED]>
> 12/11/2006 01:54 PM
>
> Please respond to
> woden-dev@ws.apache.org
>
> To
>
> woden-dev@ws.apache.org
>
> cc
>
> Subject
>
> location for standard schema in woden.jar
>
>
>
>
>
> List,
>
> I've not had any feedback to my recent comments on Woden-85 [1], so I
> assume there is nothing contentious therein.
>
> For building woden.jar, I plan to change build.xml to copy the xml and
> wsdl2 schema files from the unzipped w3c test-suite.zip into
> xmlcatalog/wsdl and xmlcatalog/wsdl respectively (which happens to mirror
> the structure in downloads/w3c in the w3c test-suite).
> This also simplifies configuration the developers' enviroment (eg eclipse
> projects) too, as the schema downloaded from test-suite.zip into the
> workspace can be used directly when running the test suites.
> The hard-coded catalog file "system.catalog" (containing URI resolution
> info for these local schema files) will appear in trunk/java in svn
> (alongside build.xml, license files etc) and will be copied into the "/"
> directory of woden.jar at build time.
>
> There is a slight alternative to these locations, which is to place the
> schema and catalog in woden.jar /META-INF. The only proviso is that in
svn
> the system catalog would need to appear
trunk/java/META-INF/system.catalog.
> If this is prefered to the first alternative and there is no objection to
a
> META-INF directory in svn, then I'll do it that way.
>
> Please let me know asap if you have a view on this either way.
>
> Finally, which is preferred? - copying the schema to woden.jar from w3c
> test-suite.zip, or directly from their published web locations? I'm in
> favour of the former, since a built woden.jar should result from a build
> tested with test-suite.zip's current contents.
>
> Again, any views asap please. Thanks.
>
> [1] http://issues.apache.org/jira/browse/WODEN-85
>
> Kind Regards,
>
> Graham.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to