Re: Taglib-Block doesn't work? (Deprecated?)

2004-07-01 Thread Joerg Heinicke
On 26.06.2004 10:48, Stephan Coboos wrote:
the problem is a ClassCastException because the code was changed to use a
ServiceSelector, but the configuration uses a 
ExtendedComponentSelector. I

Hello Volker,
is it solved in the actualy nightly build?
Carsten committed the fix one week ago.
http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/taglib/java/org/apache/cocoon/transformation/TagTransformer.java?r1=1.6&r2=1.7&diff_format=h
Joerg


Antwort: Re: Taglib-Block doesn't work? (Deprecated?)

2004-06-27 Thread volker . schmitt



[EMAIL PROTECTED] wrote:

>>the problem is a ClassCastException because the code was changed to use a
>>ServiceSelector, but the configuration uses a ExtendedComponentSelector.
I
>>send you the diff what was changed. You can replace ServiceSelector back
to
>>ComponentSelector and it will work again. It seam that there is no
>>ExtendedServiceSelector available.
>>
>>Volker
>>
>>
>Hello Volker,
>
>is it solved in the actualy nightly build?
>
>I don't want to change something in cocoon blocks because of later
>updates of cocoon.
>
>Thank you.
>
>Regards
>Stepan

yes, Carsten did the change.

Volker







Re: Taglib-Block doesn't work? (Deprecated?)

2004-06-26 Thread Stephan Coboos
[EMAIL PROTECTED] wrote:
the problem is a ClassCastException because the code was changed to use a
ServiceSelector, but the configuration uses a ExtendedComponentSelector. I
send you the diff what was changed. You can replace ServiceSelector back to
ComponentSelector and it will work again. It seam that there is no
ExtendedServiceSelector available.
Volker
 

Hello Volker,
is it solved in the actualy nightly build?
I don't want to change something in cocoon blocks because of later 
updates of cocoon.

Thank you.
Regards
Stepan


RE: Taglib-Block doesn't work? (Deprecated?)

2004-06-14 Thread volker . schmitt

the problem is a ClassCastException because the code was changed to use a
ServiceSelector, but the configuration uses a ExtendedComponentSelector. I
send you the diff what was changed. You can replace ServiceSelector back to
ComponentSelector and it will work again. It seam that there is no
ExtendedServiceSelector available.

Volker

Index: java/org/apache/cocoon/transformation/TagTransformer.java
===
RCS file:
/home/cvspublic/cocoon-2.1/src/blocks/taglib/java/org/apache/cocoon/transformation/TagTransformer.java,v
retrieving revision 1.6
diff -u -r1.6 TagTransformer.java
--- java/org/apache/cocoon/transformation/TagTransformer.java 5 Mar
2004 13:02:25 - 1.6
+++ java/org/apache/cocoon/transformation/TagTransformer.java 14 Jun
2004 06:26:55 -
@@ -28,6 +28,7 @@
 import org.apache.commons.collections.map.StaticBucketMap;
 import org.apache.avalon.excalibur.pool.Recyclable;
 import org.apache.avalon.framework.activity.Disposable;
+import org.apache.avalon.framework.component.ComponentSelector;
 import org.apache.avalon.framework.configuration.Configurable;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
@@ -194,7 +195,7 @@

 Tag tag = (Tag) tagStack.pop();
 if (tag != null) {
-ServiceSelector tagSelector
= (ServiceSelector)tagSelectorStack.pop();
+ComponentSelector tagSelector
= (ComponentSelector)tagSelectorStack.pop();
 try {
 if (saxFragment != null) {
 //start Iteration
@@ -315,7 +316,7 @@
 Tag tag = (Tag) tagStack.pop();
 if (tag == null)
 continue;
-ServiceSelector tagSelector
= (ServiceSelector)tagSelectorStack.pop();
+ComponentSelector tagSelector
= (ComponentSelector)tagSelectorStack.pop();
 tagSelector.release(tag);

 tagNamespaceSelector.release(tagSelector);
@@ -424,10 +425,10 @@

 Tag tag = null;
 if (namespaceURI != null && namespaceURI.length() > 0) {
-ServiceSelector tagSelector = null;
+ComponentSelector tagSelector = null;
 Transformer tagTransformer = null;
 try {
-tagSelector = (ServiceSelector)
tagNamespaceSelector.select(namespaceURI);
+tagSelector = (ComponentSelector)
tagNamespaceSelector.select(namespaceURI);
 tagSelectorStack.push(tagSelector);

 // namespace matches tag library, lookup tag now.




Hello,

I had tried to write my own taglib using the TagTransformer but it
doesn't work. I can't find some informations about it, so I had copied
the example and changed something but it doesn't work. I want to use a
tag  to print out "HELLO WORLD". My changes in detail:

1.) I had written my own class HelloWorldTag:

package foo.bar.taglib;

import org.apache.cocoon.taglib.XMLProducerTagSupport;
import org.xml.sax.SAXException;
import org.xml.sax.Attributes;

public class HelloWorldTag extends XMLProducerTagSupport {

   public int doStartTag(String namespaceURI, String localName, String
qName, Attributes atts)
   throws SAXException {
String hello = "HELLO WORLD";
 this.xmlConsumer.characters(hello.toCharArray(), 0,
hello.length());
 this.getLogger().error("T E X T = " + hello);
 return this.EVAL_BODY;
   }
}

2.) I had created a subproject tagtest containing a xml file tagtest.xml:



 


3.) My sitemap looks as follow:


http://apache.org/cocoon/sitemap/1.0";>



  
 
   tag
 
  




  

 



 

  




3.) In cocoon.xconf I had registered the tag :

   
 
   

4.) After calling http://localhost:8080/cocoon/tagtest the tag 
will not be replaces by "HELLO WORLD". I got the following output -
nothing parsed:


   
   


What is wrong here? Thank you for your help.

PS: I had tried the taglib block it seems it doesn't work, too! Whats
about this block? Is it deprecated?

Regards
Stephan