[Building Sakai] Very basic velocity question: parsing data from java to template in Sakai

Matthew Jones matthew at longsight.com
Tue Nov 5 07:57:11 PST 2013


I'm not sure, it works for me. You're redeploying the webapp with the new
war, and new source code from that java file, right? I'd make 100% that
your variable names match up, in your span class it says
pawword-expire-warning, making me think you might have had a typo.

Though what you *really* want to do for something like this is put it in
portal-impl/impl/src/bundle/sitenav.properties

*pwd_expire_msg = Some message about expiration*

And use the ResourceLoader, which for portal looks like it is

${rloader.pwd_expire_msg}




On Tue, Nov 5, 2013 at 10:22 AM, David Wafula Wanyonyi <
DavidWafula.Wanyonyi at wits.ac.za> wrote:

>  Hi all,
> Never used velocity before, so my first attempt is not going any where;
> please point me where am getting it wrong:
>
> in
> https://source.sakaiproject.org/svn/portal/tags/portal-base-2.9.2/portal-impl/impl/src/java/org/sakaiproject/portal/charon/SkinnableCharonPortal.java,
>
>
>
> there is  includeLogin(),  with lines:
> ....
>   rcontext.put("loginLogInOutUrl", logInOutUrl);
>   rcontext.put("loginMessage", message);
> .......
>
> so am adding something simple:
>
>  String pwdMessage = "Warning: Your password is expiring in 6 days";
>   rcontext.put("passwordExpireMessage", pwdMessage);
>
>
> I go to includeTabs.vm:
>
> <span class="pawword-expire-warning">
> ${passwordExpireMessage}
> </span>
>
> it prints '${passwordExpireMessage}' instead of actual message
>
>
> if i try and replace this with say ${loginMessage}, just for testing, the
> correct message is printed.
>
>
>
> The trick ?
> Thanks.
>
>  This communication is intended for the addressee only. It is confidential. If you have received this communication in error, please notify us immediately and destroy the original message. You may not copy or disseminate this communication without the permission of the University. Only authorised signatories are competent to enter into agreements on behalf of the University and recipients are thus advised that the content of this message may not be legally binding on the University and may contain the personal views and opinions of the author, which are not necessarily the views and opinions of The University of the Witwatersrand, Johannesburg. All agreements between the University and outsiders are subject to South African Law unless the University agrees in writing to the contrary.
>
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to
> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
> "unsubscribe"
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20131105/bc9be8be/attachment.html 


More information about the sakai-dev mailing list