cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "roy huang" <lingererhu...@hotmail.com>
Subject [Help]Any change due to this database action error or just getConfiguration?
Date Tue, 23 Mar 2004 11:39:20 GMT
I use database action to save data into database ,the pipeline looks like:
   <map:match pattern="*-add">
    <map:act type="mod-db-add">
     <map:parameter name="descriptor" value="cocoon:raw:/forms/{1}/define_data.xml" />
     <map:parameter name="table-set" value="default" />
     <map:redirect-to uri="cocoon://gtt/message/form/save_ok.html" />
    </map:act>
    <map:redirect-to uri="cocoon://gtt/message/form/save_fail.html" />
   </map:match>

the cocoon:raw:/forms/{1}/define_data.xml looks like
   <map:match pattern="forms/*/define_data.xml">  
    <map:generate src="forms/{1}/form_define.xml" />
    <map:transform type="formdefine">
     <map:parameter name="type" value="data" />
    </map:transform>   
    <map:serialize type="xml" />
   </map:match>

the formdefine transformer is writter by myself to get the corret xml file from the defien_data.xml(all
config save in this file).
It works fine in 2.1.4,but in current cvs version ,it will produce an error:

Original Exception: org.apache.avalon.framework.configuration.ConfigurationException: Error
trying to load configurations for resource: cocoon://gtt/apps/app1/forms/test/define_data.xml

	at org.apache.cocoon.acting.AbstractComplementaryConfigurableAction.getConfiguration(AbstractComplementaryConfigurableAction.java:102)

	at org.apache.cocoon.acting.modular.DatabaseAction.act(DatabaseAction.java:614)

I try to find why this error occour,so:
1.I use an pipeline to get the xml file in the same way to cocoon:raw:/forms/{1}/define_data.xml,and
save it in define_data.xml
2.I change <map:match pattern="forms/*/define_data.xml">  to 
   <map:match pattern="forms/*/define_data.xml">  
    <map:generate src="forms/{1}/define_data.xml" />
    <map:serialize type="xml" />
   </map:match>
 It works fine,so my transformer did generate the correct xml
3.In my Transformer(extends AbstractSAXTransformer),I insert some println
  in startTransformingElement(String uri,String name,String raw,Attributes attributes)

  System.out.println("name:"+name);//<----for debug only
  if (uri.equals("")) { 
   if (name.equals("root")) 
    this.namespaceURI = Constants.FORM_DEFINE_NS;
   else 
    super.startTransformingElement(uri, name, raw, attributes);
  }
.......

I found when I use this transformer in other condition ,the console will print all the name,so
it is corrent.
But if I use it just like upper description,it only print "name:root"(form_define.xml only
has this none prefix name as xml root).
It works fine in 2.1.4,so I guess it is some change to "cocoon:" protal due to this error.
WDYT?

Roy Huang
Mime
View raw message