You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Sarah Skinner <sk...@post.queensu.ca> on 2006/05/26 15:53:20 UTC

Problem Creating Custom Resource Type

I have been using Lenya 1.2 for a few weeks now and have created a few
custom doctypes following the instructions on the website...

The problem is that in Lenya under Site, File "New myresource Document" I
can create a new document with the resource type: myresource but the
DocumentID must be myresource or it will default to a resource type of
xhtml. Obviously that means I can only use each doctype once. 

So when I create a second document of the same resource type, giving it a
document id of myresource2, the resource type ends up being xhtml and so it
uses the xslt's for that resource type. I does however use the
myresource.xml sample file that I specified.

I have been over the config files again and again. Has anyone experienced
this before?

Thanks
Sarah Skinner



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


RE: Problem Creating Custom Resource Type

Posted by Josias Thöny <jo...@wyona.com>.
On Fri, 2006-05-26 at 10:59 -0400, Sarah Skinner wrote:
> On Fri, 2006-05-26 at 09:53 -0400, Sarah Skinner wrote:
[...]
> 
> I would like to use the SourceTypeAction, but am not sure how to set that
> up. I am sure that this is the problem. The doctype I am using is called
> services, I believe I am trying to match it by URL, using the pipeline in
> parameter-doctype.xmap...
> 
> <map:pipeline>
>       <map:match pattern="*/services*.html">
>         <map:generate type="serverpages"
> src="../../config/parameters/default.xsp">
>           <map:parameter name="value" value="services"/>
>         </map:generate>
>         <map:serialize type="xml"/>
>       </map:match>
>     </map:pipeline>

This matcher will only match documents with an id starting with
"services". That's probably not what you want.
If you use the SourceTypeAction, you won't need this matcher anymore.

> 
> Here is what I have in parameter-doctype.xmap under components...
> 
> <map:components>
>     <map:generators default="file"/>
>     <map:transformers default="xslt"/>
>     <map:readers default="resource"/>
>     <map:serializers default="html"/>
>     <map:matchers default="wildcard"/>
>     <map:actions>
>       <map:action logger="sitemap.action.sourcetype" name="sourcetype"
> src="org.apache.cocoon.acting.sourcetype.SourceTypeAction">
>         <sourcetype name="xhtml">
>           <document-element namespace="http://www.w3.org/1999/xhtml"/>
>         </sourcetype>
>         <sourcetype name="links">
>           <document-element
> namespace="http://apache.org/lenya/pubs/default/1.0"/>
>         </sourcetype>
>       </map:action>
>     </map:actions>
>   </map:components>

You could try to add this:

<sourcetype name="services">
  <document-element namespace="http://your-namespace"/>
</sourcetype>

Now Lenya should assign the doctype 'services' to all documents whose
document-element has the namespace http://your-namespace.
That means the sample file of your doctype should look somehow like
that:

<services:services xmlns:services="http://your-namespace">
...
</services:services>

hth,
Josias


> 
> 
> 
> - Thanks
> Sarah
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


RE: Problem Creating Custom Resource Type

Posted by Sarah Skinner <sk...@post.queensu.ca>.
On Fri, 2006-05-26 at 11:24 -0400, Sarah Skinner wrote:
[...]
>Josias wrote:
>Ehm, did you try the hints about the SourceTypeAction I wrote at the
>bottom of my last email?
>For further information, please have a look at
>http://forrest.apache.org/docs_0_70/cap.html

Yes thank you that makes so much more sense now!
Cheers,
Sarah





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


RE: Problem Creating Custom Resource Type

Posted by Josias Thöny <jo...@wyona.com>.
On Fri, 2006-05-26 at 11:24 -0400, Sarah Skinner wrote:
[...]
> 
> I can see where I made my mistake, I must have a document ID that begins
> with services, or it will not match. Tested and it works. I can make that
> work for me, but if you have any suggestions on how to use SourceTypeAction
> it would be appreciated! 

Ehm, did you try the hints about the SourceTypeAction I wrote at the
bottom of my last email?
For further information, please have a look at
http://forrest.apache.org/docs_0_70/cap.html

- Josias

> Thanks for pointing me to the right file!
> -Sarah
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


RE: Problem Creating Custom Resource Type

Posted by Sarah Skinner <sk...@post.queensu.ca>.
On Fri, 2006-05-26 at 09:53 -0400, Sarah Skinner wrote:
> I have been using Lenya 1.2 for a few weeks now and have created a few
> custom doctypes following the instructions on the website...
> 
> The problem is that in Lenya under Site, File "New myresource Document" I
> can create a new document with the resource type: myresource but the
> DocumentID must be myresource or it will default to a resource type of
> xhtml. Obviously that means I can only use each doctype once. 
> 
> So when I create a second document of the same resource type, giving it a
> document id of myresource2, the resource type ends up being xhtml and so
it
> uses the xslt's for that resource type. I does however use the
> myresource.xml sample file that I specified.
> 
> I have been over the config files again and again. Has anyone experienced
> this before?



Josias wrote:
How do you assign the doctype in parameter-doctypes.xmap? (With the
SourceTypeAction or by URL matching?) I'm just guessing, but the problem
might be there.
If you check the files in the filesystem, do they have the correct
doctype?

If you want to post your parameter-doctypes.xmap, we may be able to help
more.


Sarah wrote:

I would like to use the SourceTypeAction, but am not sure how to set that
up. I am sure that this is the problem. The doctype I am using is called
services, I believe I am trying to match it by URL, using the pipeline in
parameter-doctype.xmap...

<map:pipeline>
      <map:match pattern="*/services*.html">
        <map:generate type="serverpages"
src="../../config/parameters/default.xsp">
          <map:parameter name="value" value="services"/>
        </map:generate>
        <map:serialize type="xml"/>
      </map:match>
    </map:pipeline>




Here is what I have in parameter-doctype.xmap under components...

<map:components>
    <map:generators default="file"/>
    <map:transformers default="xslt"/>
    <map:readers default="resource"/>
    <map:serializers default="html"/>
    <map:matchers default="wildcard"/>
    <map:actions>
      <map:action logger="sitemap.action.sourcetype" name="sourcetype"
src="org.apache.cocoon.acting.sourcetype.SourceTypeAction">
        <sourcetype name="xhtml">
          <document-element namespace="http://www.w3.org/1999/xhtml"/>
        </sourcetype>
        <sourcetype name="links">
          <document-element
namespace="http://apache.org/lenya/pubs/default/1.0"/>
        </sourcetype>
      </map:action>
    </map:actions>
  </map:components>

- Thanks
Sarah


I can see where I made my mistake, I must have a document ID that begins
with services, or it will not match. Tested and it works. I can make that
work for me, but if you have any suggestions on how to use SourceTypeAction
it would be appreciated! 
Thanks for pointing me to the right file!
-Sarah


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


RE: Problem Creating Custom Resource Type

Posted by Sarah Skinner <sk...@post.queensu.ca>.
On Fri, 2006-05-26 at 09:53 -0400, Sarah Skinner wrote:
> I have been using Lenya 1.2 for a few weeks now and have created a few
> custom doctypes following the instructions on the website...
> 
> The problem is that in Lenya under Site, File "New myresource Document" I
> can create a new document with the resource type: myresource but the
> DocumentID must be myresource or it will default to a resource type of
> xhtml. Obviously that means I can only use each doctype once. 
> 
> So when I create a second document of the same resource type, giving it a
> document id of myresource2, the resource type ends up being xhtml and so
it
> uses the xslt's for that resource type. I does however use the
> myresource.xml sample file that I specified.
> 
> I have been over the config files again and again. Has anyone experienced
> this before?



Josias wrote:
How do you assign the doctype in parameter-doctypes.xmap? (With the
SourceTypeAction or by URL matching?) I'm just guessing, but the problem
might be there.
If you check the files in the filesystem, do they have the correct
doctype?

If you want to post your parameter-doctypes.xmap, we may be able to help
more.



I would like to use the SourceTypeAction, but am not sure how to set that
up. I am sure that this is the problem. The doctype I am using is called
services, I believe I am trying to match it by URL, using the pipeline in
parameter-doctype.xmap...

<map:pipeline>
      <map:match pattern="*/services*.html">
        <map:generate type="serverpages"
src="../../config/parameters/default.xsp">
          <map:parameter name="value" value="services"/>
        </map:generate>
        <map:serialize type="xml"/>
      </map:match>
    </map:pipeline>




Here is what I have in parameter-doctype.xmap under components...

<map:components>
    <map:generators default="file"/>
    <map:transformers default="xslt"/>
    <map:readers default="resource"/>
    <map:serializers default="html"/>
    <map:matchers default="wildcard"/>
    <map:actions>
      <map:action logger="sitemap.action.sourcetype" name="sourcetype"
src="org.apache.cocoon.acting.sourcetype.SourceTypeAction">
        <sourcetype name="xhtml">
          <document-element namespace="http://www.w3.org/1999/xhtml"/>
        </sourcetype>
        <sourcetype name="links">
          <document-element
namespace="http://apache.org/lenya/pubs/default/1.0"/>
        </sourcetype>
      </map:action>
    </map:actions>
  </map:components>


- Thanks
Sarah




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Problem Creating Custom Resource Type

Posted by Josias Thöny <jo...@wyona.com>.
On Fri, 2006-05-26 at 09:53 -0400, Sarah Skinner wrote:
> I have been using Lenya 1.2 for a few weeks now and have created a few
> custom doctypes following the instructions on the website...
> 
> The problem is that in Lenya under Site, File "New myresource Document" I
> can create a new document with the resource type: myresource but the
> DocumentID must be myresource or it will default to a resource type of
> xhtml. Obviously that means I can only use each doctype once. 
> 
> So when I create a second document of the same resource type, giving it a
> document id of myresource2, the resource type ends up being xhtml and so it
> uses the xslt's for that resource type. I does however use the
> myresource.xml sample file that I specified.
> 
> I have been over the config files again and again. Has anyone experienced
> this before?

How do you assign the doctype in parameter-doctypes.xmap? (With the
SourceTypeAction or by URL matching?) I'm just guessing, but the problem
might be there.
If you check the files in the filesystem, do they have the correct
doctype?

If you want to post your parameter-doctypes.xmap, we may be able to help
more.

Josias

> 
> Thanks
> Sarah Skinner
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org