You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mansour Al Akeel <ma...@gmail.com> on 2013/05/09 16:58:16 UTC

Using CatalogManager

With C3.0-beta, I am trying to use CatalogManager.properties to direct
request of a DTD to another location.
I copied the files CatalogManager.properties, catalog.xml, dummy.dtd to

src/main/resources and then to rcl-config/WEB-INF/classes, but not luck.

Is there anything I can do to get the requests to a DTD to be server
through the catalog ??

Re: Using CatalogManager

Posted by Mansour Al Akeel <ma...@gmail.com>.
Still no luck, so decided to dig in the source to see if anything can be
done. And got stuck again,

In XSLTTransformer.java:

    @Override
    public void setConfiguration(final Map<String, ? extends Object>
configuration) {
        try {
            this.url = (URL) configuration.get(SOURCE);
        } catch (ClassCastException cce) {
            throw new SetupException(
                    "The configuration value of '" + SOURCE + "' can't be
cast to " + URL.class.getName(), cce);
        }

        if (this.url == null) {
            LOG.debug("Impossible to load XSLT parameters from null
source");
        } else {
            final Object attributesObj = configuration.get("attributes");
            if (attributesObj instanceof Map) {
                @SuppressWarnings("unchecked")
                final Map<String, Object> attributesMap = (Map<String,
Object>) attributesObj;
                this.load(this.url, attributesMap);
            } else {
                this.load(this.url, null);
            }
        }

        this.setParameters(configuration);
    }


The attributes object is passed to load(url, attributesMap). Then in that
method it's passed to the tranformer factory. The question is how can I set
this "attribute" configuration to the map of parameters I need ??
For example:

<map:transform src="path/to/my.xsl" /> doesn't not take "attributes".


If there's a better way to get this catalog business moving, it will be
highly appreciated.

Thank you.





On Thu, May 9, 2013 at 10:58 AM, Mansour Al Akeel <mansour.alakeel@gmail.com
> wrote:

> With C3.0-beta, I am trying to use CatalogManager.properties to direct
> request of a DTD to another location.
> I copied the files CatalogManager.properties, catalog.xml, dummy.dtd to
>
> src/main/resources and then to rcl-config/WEB-INF/classes, but not luck.
>
> Is there anything I can do to get the requests to a DTD to be server
> through the catalog ??
>
>
>