You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Jason Zhou <Ja...@sas.com> on 2002/02/11 14:42:07 UTC

Why Changing schema cannot reflect references in .vm!?

> OK. I  successfully run the newapp on Turbine  2.1 . Then I added EMAIL in the schema file: newapp-schema.xml under conf. Run ant init and then added           
> #entryCell ($entry.Email)
> in Index.vm so it looks like:
> 
>           #entryCell ($entry.Title)
>           #entryCell ($entry.Dept)
>           #entryCell ($entry.Email)
>           #entryCell ($entry.Author)
>           #entryCell ($entry.Url)
>           #entryCell ($entry.Body)
> 
> Why at run time velocity.log says 
> 
> screens/Index.vm [line 1,column 10] : $entry.Email is not a valid reference.
> Fri Feb 08 16:18:09 EST 2002   [warn] 
> 
> Thanks for the help!!! <<velocity.log>>  <<newapp-schema.xml>>  <<Index.vm>>  <<BaseRdf.java>> 
> 
> Best Regards,
> 
> J. Jason Zhou
> Business Intelligence Platform Division (BIP), R & D, 
> SAS Institute, 100 SAS Campus Dr.
> Cary, North Carolina 27513-8617
> Voice: 919-531-0568(O)
> Email: jason.zhou@sas.com
> 
> 

Re: Why Changing schema cannot reflect references in .vm!?

Posted by Jason van Zyl <jv...@zenplex.com>.
On 2/11/02 10:12 AM, "Randall G. Alley" <ir...@bellsouth.net> wrote:

> Hi Jason,
> 
> Turbine experts correct me if I'm wrong, but simply adding EMAIL to your
> schema file and running ant init doesn't put the information into your
> context.

I haven't looked at the TDK app in a while but you should be able to change
schema which should in turn change the bean that represents the RDF object.
The bean should be placed in the context so $entry.email should be
available. I'd have to look at the sample app to see. I should have set it
up so that changes to the schema limit the changes required to the java
code. If I didn't then I will change it.

> You need to first retrieve a entry from your data base, then place the
> entry into your context.
> You could put this in a Screen file (or in an Action):
> 
> // Ideally you would add criteria to narrow the search, this simply gets
> all the records
> Criteria c = new Criteria();
> 
>       RDF rdf = (RDF)RDFPeer.doSelect(c).elementAt(0);
> 
>       try
>       {
> 
>           RDF rdf = (RDF)RDFPeer.doSelect(c).elementAt(0);
>           context.put("entry",rdf);
> 
>       }
>       catch( Exception e )
>       {          
>           System.out.println("Exception accessing database");
>       }
> 
> Have you done this, or the equivalent ?
> 
> Jason Zhou wrote:
> 
>>> OK. I  successfully run the newapp on Turbine  2.1 . Then I added EMAIL in
>>> the schema file: newapp-schema.xml under conf. Run ant init and then added
>>> #entryCell ($entry.Email)
>>> in Index.vm so it looks like:
>>> 
>>>          #entryCell ($entry.Title)
>>>          #entryCell ($entry.Dept)
>>>          #entryCell ($entry.Email)
>>>          #entryCell ($entry.Author)
>>>          #entryCell ($entry.Url)
>>>          #entryCell ($entry.Body)
>>> 
>>> Why at run time velocity.log says
>>> 
>>> screens/Index.vm [line 1,column 10] : $entry.Email is not a valid reference.
>>> Fri Feb 08 16:18:09 EST 2002   [warn]
>>> 
>>> Thanks for the help!!! <<velocity.log>>  <<newapp-schema.xml>>  <<Index.vm>>
>>> <<BaseRdf.java>>
>>> 
>>> Best Regards,
>>> 
>>> J. Jason Zhou
>>> Business Intelligence Platform Division (BIP), R & D,
>>> SAS Institute, 100 SAS Campus Dr.
>>> Cary, North Carolina 27513-8617
>>> Voice: 919-531-0568(O)
>>> Email: jason.zhou@sas.com
>>> 
>>> 
>>> 
>>> ------------------------------------------------------------------------
>>> 
>>> --
>>> To unsubscribe, e-mail:
>>> <ma...@jakarta.apache.org>
>>> For additional commands, e-mail:
>>> <ma...@jakarta.apache.org>
>>> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Why Changing schema cannot reflect references in .vm!?

Posted by "Randall G. Alley" <ir...@bellsouth.net>.
Hi Jason,

Turbine experts correct me if I'm wrong, but simply adding EMAIL to your 
schema file and running ant init doesn't put the information into your 
context.

You need to first retrieve a entry from your data base, then place the 
entry into your context.
You could put this in a Screen file (or in an Action):

// Ideally you would add criteria to narrow the search, this simply gets 
all the records
Criteria c = new Criteria();
 
        RDF rdf = (RDF)RDFPeer.doSelect(c).elementAt(0);

        try
        {

            RDF rdf = (RDF)RDFPeer.doSelect(c).elementAt(0);
            context.put("entry",rdf);
  
        }
        catch( Exception e )
        {          
            System.out.println("Exception accessing database");       
        }

Have you done this, or the equivalent ?

Jason Zhou wrote:

>>OK. I  successfully run the newapp on Turbine  2.1 . Then I added EMAIL in the schema file: newapp-schema.xml under conf. Run ant init and then added           
>>#entryCell ($entry.Email)
>>in Index.vm so it looks like:
>>
>>          #entryCell ($entry.Title)
>>          #entryCell ($entry.Dept)
>>          #entryCell ($entry.Email)
>>          #entryCell ($entry.Author)
>>          #entryCell ($entry.Url)
>>          #entryCell ($entry.Body)
>>
>>Why at run time velocity.log says 
>>
>>screens/Index.vm [line 1,column 10] : $entry.Email is not a valid reference.
>>Fri Feb 08 16:18:09 EST 2002   [warn] 
>>
>>Thanks for the help!!! <<velocity.log>>  <<newapp-schema.xml>>  <<Index.vm>>  <<BaseRdf.java>> 
>>
>>Best Regards,
>>
>>J. Jason Zhou
>>Business Intelligence Platform Division (BIP), R & D, 
>>SAS Institute, 100 SAS Campus Dr.
>>Cary, North Carolina 27513-8617
>>Voice: 919-531-0568(O)
>>Email: jason.zhou@sas.com
>>
>>
>>
>>------------------------------------------------------------------------
>>
>>--
>>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>>For additional commands, e-mail: <ma...@jakarta.apache.org>
>>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Why Changing schema cannot reflect references in .vm!?

Posted by Paulo Silveira <Pa...@commworld.de>.
Probably because it is NULL?
You need to add entry to the RunData context somewhere

Context.put("entry", new EmailPeer());

Or sth like

paulo

-----Original Message-----
From: Jason Zhou [mailto:Jason.Zhou@sas.com]
Sent: Montag, 11. Februar 2002 14:42
To: 'turbine-dev@jakarta.apache.org'
Subject: Why Changing schema cannot reflect references in .vm!?



> OK. I  successfully run the newapp on Turbine  2.1 . Then I added
> EMAIL in the schema file: newapp-schema.xml under conf. Run ant init
> and then added #entryCell ($entry.Email) in Index.vm so it looks like:
>
>           #entryCell ($entry.Title)
>           #entryCell ($entry.Dept)
>           #entryCell ($entry.Email)
>           #entryCell ($entry.Author)
>           #entryCell ($entry.Url)
>           #entryCell ($entry.Body)
>
> Why at run time velocity.log says
>
> screens/Index.vm [line 1,column 10] : $entry.Email is not a valid
reference.
> Fri Feb 08 16:18:09 EST 2002   [warn]
>
> Thanks for the help!!! <<velocity.log>>  <<newapp-schema.xml>>
> <<Index.vm>>  <<BaseRdf.java>>
>
> Best Regards,
>
> J. Jason Zhou
> Business Intelligence Platform Division (BIP), R & D,
> SAS Institute, 100 SAS Campus Dr.
> Cary, North Carolina 27513-8617
> Voice: 919-531-0568(O)
> Email: jason.zhou@sas.com
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>