cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Klein <cerebr...@yahoo.com>
Subject Action Not Adding Values to Sitemap or is it?
Date Fri, 24 Jan 2003 23:21:03 GMT
Hi All,

I am trying to add a paramater to the sitemap through
an Action extended from the MultiAction Class, but
when I try to access it in my sitemap, it is empty.  I
am certain there should be a value coming out of the
Action b/c it prints the value to my log from inside
the action.  Any help would be greatly appreciated.  I
attached my Action code and sitemap code snippets.  I
am running Cocoon 2.1 dev and java 1.4 on Red Hat 8.0.
 The reason for the action is to get collection names
from the Xindice database, which translate to client's
of the webapp.

Thanks,
Julian

<sitemap-snippet>
   <map:match pattern="view/**">
    	<map:act type="task">
     	  <map:parameter name="method"
value="doAddSubjectsAndMyCategories"/>
     	  <map:parameter name="task-subject-node"
value="Global"/>
    	</map:act>
         <map:match type="request-parameter"
pattern="xpath">
            <map:generate
src="xmldb:xindice://localhost:4080/db/wEMR/tasks/{../1}#{1}"/>
            <map:transform src="stylesheets/task.xsl">
    
		<map:parameter name="users" value="{subjNodes}"/>
		<map:parameter name="categories"
value="{categories}"/>
	    </map:transform>
            <map:serialize type="html"/>
         </map:match>
    <map:generate
src="xmldb:xindice://localhost:4080/db/wEMR/tasks/{1}"/>
    <map:transform src="stylesheets/task.xsl"/>
    <map:serialize type="html"/>
   </map:match>
</sitemap-snippet>
*************************************************
<CocoonMultiActionCode>
  /*Places all the user's into a sitemap parameter.*/
    public Map doAddSubjNodes (Redirector redirector,
                   SourceResolver resolver,
                   Map objectModel,
                   String src,
                   Parameters parameters) throws
Exception {

                       
        Request request =
ObjectModelHelper.getRequest(objectModel);
        Map sitemapParams = new HashMap();
    
        //determine dest of task to be created
        String subjectNode =
parameters.getParameter("task-subject-node",
                             
request.getParameter("task-subject-node"));
        
        TaskManager taskManager = new TaskManager();
       
        //get all available subjectNode's
        String[] subjNodes =
taskManager.getSubjectNodes();
        String subjStr = "";
        //add all user's to sitemap
        for(int x=0;x<subjNodes.length;x++) {
            subjStr = subjStr + "/" + subjNodes[x];
        }
        System.out.println("subjNodes="+subjStr);
        sitemapParams.put("subjNodes", subjStr);
        
        return sitemapParams;
  }
</CocoonMultiActionCode>

=====
Live simply so others may simply live.
 
-Ghandi
 
Pluralitas non est ponenda sine neccesitate.
"Entities should not be multiplied unneccesarily"
 
-William of Occam

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message