Sébastien,
it is because it's a OpenBlueLab feature :-)
There is one in cocoon called role-filter but I didn't integrate it.
You can keep or delete elements with the filter. You can have :
* filter:keep-current-node, that keeps the father
* filter:delete-current-node, that deletes the father
if the condition is true
The condition is for the moment the result of the concatenation of the
role (group) name and screen. For example, you may have :
* admin-create
* anonymous-search
* -search
Technically, it's possible to have other conditions.
What are the conditions you are looking for ?
Jean-Christophe
Trouvé Sébastien wrote:
Can you give me more information about the filter function. I tryed to
find them in the cocoon documentation, but no success....
Le lundi 10 juillet 2006 à 14:26 +0200, Jean-Christophe Kermagoret a
écrit :
I understand your question.
In classes, you can use filter:* that permit you to filter xml elements
according condition.
Look in News.xml, you have sth like this :
<fd:field id="title" required="true">
<filter:delete-current-node when="-search"/>
<fd:datatype base="string"/>
</fd:field>
It means that when you are in search mode, this fields is not available.
You can use the same mechanism to have or not the selection-list property.
HTH
Jean-Christophe
Trouvé Sébastien wrote:
I want the same widget but with 2 properties. One property for a data
capture form ,an d another for a selection-list form. Then, in my form
repository, i call the class and its property.
Le lundi 10 juillet 2006 à 12:30 +0200, Jean-Christophe Kermagoret a
écrit :
Eric,
I'm sorry but I don't understand your question.
Can you ask precisely what you want, with ONLY the important part of
your form file ?
Thanks,
Jean-Christophe
Trouvé Sébastien wrote:
Thanks for your answer, but can i create a code for my ThirdpartyAccount
class, which nominate a widget as a selection-list or as a simple field,
according to the form in use?
Le lundi 10 juillet 2006 à 12:03 +0200, Jean-Christophe Kermagoret a
écrit :
Sebastien,
happily, you can use your existing class.
Selection-list is just a query that concatenates data.
For example, in your case, if you want to reuse the data you entered
through your class, you just have to create a new widget (and not a new
class) with selection-list type :
<fd:multivaluefield id="activity.organizer">
<fd:datatype base="string"/>
<fd:selection-list
src="cocoon:/process-selection-list-specific?xpath=/document[meta/type='organisateur'][meta/doctype='ae_entity']&order=meta/name&value=$doc/docid&label=fn:string(fn:concat($doc/meta/name,%20'%20-%20',%20$doc/meta/city))"
dynamic="true"/>
</fd:multivaluefield>
The process-selection-list is the query that will build your
selection-list. It takes 4 arguments :
* xpath : the query to get the basic results
* order : the sort order to use
* value : the option value to use
* label : the option label to display
Jean-Christophe
Trouvé Sébastien wrote:
Hello,
I created a form to capture customer's features. This form contains a
class called ThirdpartyAccount, which capture the identity, the label
and the type of the thirdparty account (Customer or Supplier).
My class looks like:
/<?xml version="1.0" encoding="ISO-8859-1"?>/
/<!-- BX CPT -->/
/<fd:form/
/ xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"/
/ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"/
/ xmlns:filter="http://bluexml.org/filter/1.0">/
/ <fd:widgets>/
/ <fd:class id="ThirdpartyAccount">/
/ <fd:widgets>/
/ <fd:field id="AccountId" required="true">/
/ <fd:datatype base="string"/>/
/ </fd:field>/
/ <fd:field id="AccountLabel">/
/ <fd:datatype base="string"/>/
/ </fd:field>/
/ <fd:field id="AccountingType" required="true">/
/ <fd:datatype base="string"/>/
/ <fd:selection-list
src="cocoon://navigation/getNomenclature?field=thirdPartyAccountType&viewStyle=label"
dynamic="true"/>/
/ </fd:field>/
/ </fd:widgets>/
/ </fd:class>/
/ </fd:widgets>/
/</fd:form>/
And my repositoty like this:
/<fd:form/
/ xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"/
/ xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"/
/ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"/
/ xmlns:filter="http://bluexml.org/filter/1.0">/
/ <fd:widgets id="AccountingCustomer">/
/ <fd:new id="Base"/>/
/ <fd:new id="Authoring"/>/
/ <fd:new id="Identity"/>/
/ <fd:new id="ThirdpartyAccount"/>/
/ <fd:new id="AccountingInformation"/>/
/ <fd:new id="Classification"/>/
/ <fd:new id="CommunicationWork"/>/
/ <fd:new id="CommunicationHome"/>/
/ <fd:new id="Personality"/>/
/ <fd:new id="Marketing"/>/
/ <fd:new id="Credential"/>/
/ <fd:new id="Security"/> /
/ <fd:new id="Company"/>/
/ <fd:new id="Address"/>/
/ <fd:new id="Date"/>/
/ <fd:new id="NewVersion"/>/
/<!-- /
/ <fd:new id="NewVersionWithoutAttachment"/>/
/-->/
/ <fd:new id="Versions"/> /
/ </fd:widgets>/
/</fd:form>/
I called my ThirdpartyAccount class
Now , i want to create a new form, where my class ThirdpartyAccount is
here, but used as a selection-list.
How could i do this?
- Do i create a new class to build my selection list?
- or can i use my present class?
Thanks for your help
------------------------------------------------------------------------
_______________________________________________
User mailing list
User-E0IXfuzpajFHgg9j4ji3+w@xxxxxxxxxxxxxxxx <mailto:User-E0IXfuzpajFHgg9j4ji3+w@xxxxxxxxxxxxxxxx>
<mailto:User@xxxxxxxxxxxxxxx <mailto:User-E0IXfuzpajFHgg9j4ji3+w@xxxxxxxxxxxxxxxx>>
<mailto:User-E0IXfuzpajETjw5LBJl88A@xxxxxxxxxxxxxxxxx <mailto:User-E0IXfuzpajFHgg9j4ji3+w@xxxxxxxxxxxxxxxx>
<mailto:User-E0IXfuzpajFHgg9j4ji3+w@xxxxxxxxxxxxxxxx <mailto:User@xxxxxxxxxxxxxxx>>>
http://mlm.triglyphe.com/mailman/listinfo/user
------------------------------------------------------------------------
_______________________________________________
User mailing list
User-E0IXfuzpajFHgg9j4ji3+w@xxxxxxxxxxxxxxxx
<mailto:User-E0IXfuzpajFHgg9j4ji3+w@xxxxxxxxxxxxxxxx> <mailto:User@xxxxxxxxxxxxxxx
<mailto:User-E0IXfuzpajFHgg9j4ji3+w@xxxxxxxxxxxxxxxx>>
http://mlm.triglyphe.com/mailman/listinfo/user
------------------------------------------------------------------------
_______________________________________________
User mailing list
User-E0IXfuzpajFHgg9j4ji3+w@xxxxxxxxxxxxxxxx
<mailto:User-E0IXfuzpajFHgg9j4ji3+w@xxxxxxxxxxxxxxxx>
http://mlm.triglyphe.com/mailman/listinfo/user
------------------------------------------------------------------------
_______________________________________________
User mailing list
User-E0IXfuzpajFHgg9j4ji3+w@xxxxxxxxxxxxxxxx
http://mlm.triglyphe.com/mailman/listinfo/user
--
Jean-Christophe Kermagoret
jck-v3FNGYKZ9cyNvCAlj6F9uA@xxxxxxxxxxxxxxxx
|