Author: dandre
Date: Wed Dec  4 18:07:18 2013
New Revision: 4696

Log:
Velocity template and GedArt
* Add getParent to property
* Add SortTool ($sorter) in template context

Modified:
   
trunk/AncestrisCore/modules.renderer.velocity/src/ancestris/renderer/velocity/PropertyWrapper.java
   
trunk/AncestrisCore/modules.renderer.velocity/src/ancestris/renderer/velocity/VelocityRenderer.java
   trunk/AncestrisCore/reports/src/ancestris/reports/gedart/DocReport.java

Modified: 
trunk/AncestrisCore/modules.renderer.velocity/src/ancestris/renderer/velocity/PropertyWrapper.java
==============================================================================
--- 
trunk/AncestrisCore/modules.renderer.velocity/src/ancestris/renderer/velocity/PropertyWrapper.java
  (original)
+++ 
trunk/AncestrisCore/modules.renderer.velocity/src/ancestris/renderer/velocity/PropertyWrapper.java
  Wed Dec  4 18:07:18 2013
@@ -77,6 +77,11 @@
         return create(subProp);
     }
 
+    public PropertyWrapper getParent(){
+            if (property == null) return null;
+        return create(property.getParent());
+    }
+
     // Shortcut for getProperty so that $indi.name is equivalent to 
$indi.getProperty("NAME")
     public Object get(String tag) {
         return getProperty(tag.toUpperCase());

Modified: 
trunk/AncestrisCore/modules.renderer.velocity/src/ancestris/renderer/velocity/VelocityRenderer.java
==============================================================================
--- 
trunk/AncestrisCore/modules.renderer.velocity/src/ancestris/renderer/velocity/VelocityRenderer.java
 (original)
+++ 
trunk/AncestrisCore/modules.renderer.velocity/src/ancestris/renderer/velocity/VelocityRenderer.java
 Wed Dec  4 18:07:18 2013
@@ -23,6 +23,7 @@
 import org.apache.velocity.runtime.RuntimeInstance;
 import org.apache.velocity.tools.generic.DateTool;
 import org.apache.velocity.tools.generic.ListTool;
+import org.apache.velocity.tools.generic.SortTool;
 import org.openide.modules.Places;
 import org.openide.util.lookup.ServiceProvider;
 
@@ -68,6 +69,7 @@
         context = new VelocityContext();
         context.put("gedcom", new Gedcom());
         context.put("list", new ListTool());
+        context.put("sorter", new SortTool());
 //             context.put("date", (new Date()).toString());
         context.put("date", new DateTool());
         context.put("null", null);

Modified: 
trunk/AncestrisCore/reports/src/ancestris/reports/gedart/DocReport.java
==============================================================================
--- trunk/AncestrisCore/reports/src/ancestris/reports/gedart/DocReport.java     
(original)
+++ trunk/AncestrisCore/reports/src/ancestris/reports/gedart/DocReport.java     
Wed Dec  4 18:07:18 2013
@@ -29,6 +29,7 @@
 import org.apache.velocity.app.VelocityEngine;
 import org.apache.velocity.tools.generic.DateTool;
 import org.apache.velocity.tools.generic.ListTool;
+import org.apache.velocity.tools.generic.SortTool;
 import org.openide.modules.Places;
 
 // FIXME: refactor this class, remove @suppresswarning
@@ -80,6 +81,7 @@
                context = new VelocityContext();
                context.put("gedcom", new Gedcom());
                context.put("list", new ListTool());
+               context.put("sorter", new SortTool());
 //             context.put("date", (new Date()).toString());
                context.put("date", new DateTool());
                context.put("docindex", new reportIndex());
@@ -482,7 +484,12 @@
                        return create(subProp);
                }
 
-               // Shortcut for getProperty so that $indi.name is equivalent to 
$indi.getProperty("NAME")
+                public reportProperty getParent(){
+                       if (property == null) return null;
+                    return create(property.getParent());
+                }
+
+                // Shortcut for getProperty so that $indi.name is equivalent 
to $indi.getProperty("NAME")
                public Object get(String tag) { return 
getProperty(tag.toUpperCase());}
                
                public reportProperty[] getProperties(String tagPath) {

---------------------------------------------------------------------
Site Web Ancestris : http://www.ancestris.org

<*> Pour vous desinscrire de cette liste, envoyez un mail a :
              [email protected]
<*> Pour obtenir de l'aide sur les commandes de la liste :
              [email protected]

Pour obtenir tous les messages lies a ce fil de discussion, cliquez sur le 
lien ci-dessous, cela ouvrira votre logiciel de messagerie. Il vous suffira 
d'envoyer le message :
              [email protected]

Reply via email to