Help in using a custom ISpecificationResolverDelegate

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Help in using a custom ISpecificationResolverDelegate

andyk
Hiya,

Im using the latest tapestry-4-alpha-3 source and wish to implement a custom
specification resolver which will construct a local specification
(probably held in
a String).

Having constructed this string representation, in accordance with the
ISpecificationResolverDelegate I should return the
IComponentSpecification that
would be created from my local specifcation.

At this point I am having difficulty in determining what the next
action should be ?

Having followed through the source code it appears that the parsing of
the specification is performed by the
Namespace.locateComponent(Page)Specification through the use
of the _specificationSource.getComponentSpecification(location); call.

In trying to follow a similar pattern, having constructed the
specification I would expect
to then make use of the default SpecificationParser to accept my
string representation
and then return the parsed object from my delegate.

In looking at the SpecificationParser.parseDocument() it opens a
stream on a URL object
as the target of the parse operation
...
...

URL resourceURL = resource.getResourceURL();

            if (resourceURL == null)
                throw new
DocumentParseException(ParseMessages.missingResource(resource),
resource,
                        null);

            InputStream rawStream = resourceURL.openStream();
            stream = new BufferedInputStream(rawStream);

            _parser.parse(stream, this, resourceURL.toExternalForm());

...
...

and at this point Im lost as to how to manage/convert my string
representation of a specification into a org.apache.hivemind.Resource
represenation such that the
Resource.getResourceURL.openStream can be activated.

Is there another code path I should take to perform this activity ?

Thanks for the any help

Andy

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]