Quantcast
Viewing all articles
Browse latest Browse all 5648

Use Lablel.for within page class

Has anyone used org.apache.tapestry5.corelib.components.Label within page class?  I looked at the code for Lable and see method like beginRender, afterRender...nothing obvious...

Use Case:

I am trying to export the data and semantics of tapestry entity class ("model" package) into semantic web (specifically, RDF subject-predicate-object).  By default I would like the entity class to export its fields as almost exactly the way the label component works in the tapestry template - by picking up the user provided labels in the respective dot-properties or app.properties, otherwise just to a camel case based interpretation.  For text fields the label component can be reused to generate default RDF predicates, for boolean (form checkbox) fields the labels can become the RDF object.  Use the package as the default namespace, and so so on.  Basically, I want to "auto-extract" default semantics from the entity class. 

Example:

Say I had an entity class as follows:

package org.example.entities;

public class model

   String name = ""; 

 

   // semantic for property direction

   boolean east =false; 

   booelan west = false;

The RDF would be

@ base <http://entities.example.org>
<http://entities.example.org/model> <http://entities.example.org/model/name> "The string value of name";
<http://entities.example.org/model> <http://entities.example.org/model/region>"east";

In the above, the label function would be useful for the name portion of the first predicate <http://entities.example.org/model/name>and object in the second RDF triple, "east". 

Hope this makes sense.  Any tips would be appreciated.  Thanks in advance. 

Viewing all articles
Browse latest Browse all 5648

Trending Articles