Update of /var/cvs/applications/editwizard/blocks/samples
In directory james.mmbase.org:/tmp/cvs-serv19681/samples

Modified Files:
        news.xml news_implicitcreates.xml news_origin.xml 
Log Message:
let the example for posrel be actually universally correct


See also: http://cvs.mmbase.org/viewcvs/applications/editwizard/blocks/samples


Index: news.xml
===================================================================
RCS file: /var/cvs/applications/editwizard/blocks/samples/news.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- news.xml    4 Aug 2008 16:56:19 -0000       1.1
+++ news.xml    5 Mar 2009 08:11:30 -0000       1.2
@@ -74,7 +74,7 @@
 
       <action type="add">
         <relation destinationtype="images" role="posrel">
-          <field name="pos">{sum(//relati...@role='posrel' and 
@lastitem='true']/fie...@name='pos'])+{$pos}}</field>
+          <field name="pos">{sum(//relati...@role='posrel' and 
@lastitem='true' and @source=/data/object/@number and object/@searchtype = 
'images']/fie...@name='pos'])+{$pos}}</field>
         </relation>
       </action>
     </list>
@@ -91,7 +91,7 @@
 
       <action type="create">
         <relation destinationtype="urls" role="posrel">
-          <field name="pos">{sum(//relati...@role='posrel' and 
@lastitem='true']/fie...@name='pos'])+{$pos}}</field>
+          <field name="pos">{sum(//relati...@role='posrel' and 
@lastitem='true' and @source=/data/object/@number and object/@searchtype = 
'urls']/fie...@name='pos'])+{$pos}}</field>
           <object type="urls">
             <field name="url">http://</field>
           </object>


Index: news_implicitcreates.xml
===================================================================
RCS file: 
/var/cvs/applications/editwizard/blocks/samples/news_implicitcreates.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- news_implicitcreates.xml    23 Dec 2008 15:43:02 -0000      1.1
+++ news_implicitcreates.xml    5 Mar 2009 08:11:30 -0000       1.2
@@ -14,98 +14,17 @@
       <relation role="related">
         <object type="people" />
       </relation>
-      <relation destination="{$parent}" role="posrel"  createdir="destination">
+      <relation destination="{$origin}" role="posrel"  createdir="destination">
         <field name="pos">{$newPos}</field>
       </relation>
     </object>
   </action>
 
-  <action type="delete" />
-  <action type="unlink" />
-
-  <action type="load">
-    <relation destination="people" />
-    <relation destination="images" role="posrel" />
-    <relation destination="urls"   role="posrel" />
-  </action>
 
   <form-schema id="step1">
     <title>Enter form title here</title>
     <title xml:lang="nl">Voer hier de formulier titel in</title>
-    <field name="title" />
-    <field name="subtitle" />
-    <field name="intro" ftype="text" rows="4" />
-    <field name="body"  ftype="html" rows="8" />
-    <field name="date" />
-
-    <list role="related" destination="people" minoccurs="0" maxoccurs="*">
-      <title xml:lang="nl">Auteurs</title>
-      <title xml:lang="en">Authors</title>
-
-      <item>
-        <field ftype="data" name="firstname" />
-        <field ftype="data" name="lastname" />
-      </item>
-
-      <command name="search" nodepath="people" fields="firstname,lastname" 
orderby="lastname" age="-1">
-        <prompt xml:lang="nl">Personen</prompt>
-        <prompt xml:lang="en">People</prompt>
-        <search-filter>
-          <name>first name contains</name>
-          <name xml:lang="nl">voornaam bevat</name>
-          <search-fields>firstname</search-fields>
-        </search-filter>
-        <search-filter>
-          <name>last name contains</name>
-          <name xml:lang="nl">achternaam bevat</name>
-          <search-fields>lastname</search-fields>
-        </search-filter>
-      </command>
-
-      <action type="add">
-        <relation destinationtype="people" role="related" />
-      </action>
-    </list>
-
-    <list role="posrel" destination="images" orderby="fie...@name='pos']">
-      <title xml:lang="nl">Gerelateerde plaatjes</title>
-      <title xml:lang="en">Related images</title>
-
-      <item>
-        <field name="title" ftype="image" />
-      </item>
-
-      <command name="search" nodepath="images" fields="title" age="-1">
-        <prompt>Images</prompt>
-        <prompt xml:lang="nl">Plaatjes</prompt>
-      </command>
 
-      <action type="add">
-        <relation destinationtype="images" role="posrel">
-          <field name="pos">{sum(//relati...@role='posrel' and 
@lastitem='true']/fie...@name='pos'])+{$pos}}</field>
-        </relation>
-      </action>
-    </list>
-
-    <list role="posrel" destination="urls" orderby="fie...@name='pos']">
-      <title xml:lang="nl">Gerelateerde Urls</title>
-      <title xml:lang="en">Related urls</title>
-
-      <item>
-        <field name="url" />
-      </item>
-
-      <command name="insert" />
-
-      <action type="create">
-        <relation destinationtype="urls" role="posrel">
-          <field name="pos">{sum(//relati...@role='posrel' and 
@lastitem='true']/fie...@name='pos'])+{$pos}}</field>
-          <object type="urls">
-            <field name="url">http://</field>
-          </object>
-        </relation>
-      </action>
-    </list>
 
   </form-schema>
 </wizard-schema>


Index: news_origin.xml
===================================================================
RCS file: /var/cvs/applications/editwizard/blocks/samples/news_origin.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- news_origin.xml     4 Aug 2008 16:56:19 -0000       1.1
+++ news_origin.xml     5 Mar 2009 08:11:30 -0000       1.2
@@ -74,7 +74,7 @@
 
       <action type="add">
         <relation destinationtype="images" role="posrel">
-          <field name="pos">{sum(//relati...@role='posrel' and 
@lastitem='true']/fie...@name='pos'])+{$pos}}</field>
+          <field name="pos">{sum(//relati...@role='posrel' and 
@lastitem='true' and @source=/data/object/@number and object/@searchtype = 
'images']/fie...@name='pos'])+{$pos}}</field>
         </relation>
       </action>
     </list>
@@ -91,7 +91,7 @@
 
       <action type="create">
         <relation destinationtype="urls" role="posrel">
-          <field name="pos">{sum(//relati...@role='posrel' and 
@lastitem='true']/fie...@name='pos'])+{$pos}}</field>
+          <field name="pos">{sum(//relati...@role='posrel' and 
@lastitem='true' and @source=/data/object/@number and object/@searchtype = 
'urls']/fie...@name='pos'])+{$pos}}</field>
           <object type="urls">
             <field name="url">http://</field>
           </object>
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to