<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>LifeRay 6.2 &amp; velocity variables</title>
  <link rel="self" href="https://liferay.dev/ca/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=40539249" />
  <subtitle>LifeRay 6.2 &amp; velocity variables</subtitle>
  <id>https://liferay.dev/ca/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=40539249</id>
  <updated>2026-05-19T17:38:28Z</updated>
  <dc:date>2026-05-19T17:38:28Z</dc:date>
  <entry>
    <title>RE: LifeRay 6.2 &amp; velocity variables</title>
    <link rel="alternate" href="https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40866194" />
    <author>
      <name>Yogesh Sharma</name>
    </author>
    <id>https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40866194</id>
    <updated>2014-08-01T16:15:32Z</updated>
    <published>2014-08-01T16:15:32Z</published>
    <summary type="html">For detail of more signatures of format method, you can check https://velocity.apache.org/tools/devel/javadoc/org/apache/velocity/tools/generic/DateTool.html</summary>
    <dc:creator>Yogesh Sharma</dc:creator>
    <dc:date>2014-08-01T16:15:32Z</dc:date>
  </entry>
  <entry>
    <title>RE: LifeRay 6.2 &amp; velocity variables</title>
    <link rel="alternate" href="https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40866172" />
    <author>
      <name>Yogesh Sharma</name>
    </author>
    <id>https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40866172</id>
    <updated>2014-08-01T16:13:59Z</updated>
    <published>2014-08-01T16:13:59Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;For your ease, &lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;$dateTool.format("dd-MM-yyyy",$user.getLastLoginDate())&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;displays last login date of user.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Yogesh Sharma</dc:creator>
    <dc:date>2014-08-01T16:13:59Z</dc:date>
  </entry>
  <entry>
    <title>RE: LifeRay 6.2 &amp; velocity variables</title>
    <link rel="alternate" href="https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40866085" />
    <author>
      <name>Yogesh Sharma</name>
    </author>
    <id>https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40866085</id>
    <updated>2014-08-01T16:03:09Z</updated>
    <published>2014-08-01T16:03:09Z</published>
    <summary type="html">String representation of date in db and velocity variable could look different. Liferay provides formatted date in object model.&lt;br /&gt;&lt;br /&gt;So in order to have this date converted to specific string format, you need to format the date in velocity template. There are util variables available in velocity template context for date.</summary>
    <dc:creator>Yogesh Sharma</dc:creator>
    <dc:date>2014-08-01T16:03:09Z</dc:date>
  </entry>
  <entry>
    <title>RE: LifeRay 6.2 &amp; velocity variables</title>
    <link rel="alternate" href="https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40543616" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40543616</id>
    <updated>2014-07-25T12:58:26Z</updated>
    <published>2014-07-25T12:58:26Z</published>
    <summary type="html">The only other thing I can think of is the user object is a proxy (it&amp;#39;s all built on hibernate), and perhaps the proxy cannot access the original value within the scope of a velocity template, but I&amp;#39;d hate to think that&amp;#39;s even a possibility.&lt;br /&gt;&lt;br /&gt;Otherwise the value should be there, not sure why it is not working.</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2014-07-25T12:58:26Z</dc:date>
  </entry>
  <entry>
    <title>RE: LifeRay 6.2 &amp; velocity variables</title>
    <link rel="alternate" href="https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40543478" />
    <author>
      <name>Bartosz Stanczyk</name>
    </author>
    <id>https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40543478</id>
    <updated>2014-07-25T12:40:38Z</updated>
    <published>2014-07-25T12:40:38Z</published>
    <summary type="html">I believe it depends on settings and as far as I know property&lt;br /&gt;users.search.with.index=false&lt;br /&gt;implicate that user should be search directly in DB. We have used this setting because of other liferay search problems.</summary>
    <dc:creator>Bartosz Stanczyk</dc:creator>
    <dc:date>2014-07-25T12:40:38Z</dc:date>
  </entry>
  <entry>
    <title>RE: LifeRay 6.2 &amp; velocity variables</title>
    <link rel="alternate" href="https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40543426" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40543426</id>
    <updated>2014-07-25T12:36:24Z</updated>
    <published>2014-07-25T12:36:24Z</published>
    <summary type="html">Try rebuilding the indexes...&lt;br /&gt;&lt;br /&gt;Liferay does not hit the DB for user objects, it goes to the local index.  If the local index is out of sync w/ the database then sometimes you&amp;#39;ll get oddball things like that.&lt;br /&gt;&lt;br /&gt;Could also be the case that the last login failed date is not in the index at all, hence the failed value.  In this case you&amp;#39;ll need an index post processor to add the field so it gets stored in the index and returned when Liferay pulls the entity.</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2014-07-25T12:36:24Z</dc:date>
  </entry>
  <entry>
    <title>RE: LifeRay 6.2 &amp; velocity variables</title>
    <link rel="alternate" href="https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40543324" />
    <author>
      <name>Bartosz Stanczyk</name>
    </author>
    <id>https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40543324</id>
    <updated>2014-07-25T12:28:19Z</updated>
    <published>2014-07-25T12:28:19Z</published>
    <summary type="html">As I wrote above &lt;br /&gt;&lt;div class="quote-title"&gt;Bartek Stanczyk:&lt;/div&gt;&lt;blockquote&gt; second one is not set properly on vm level even if it is set properly in DB&amp;#39;s user_ table. Can anyone please help me out? Thank You in advance,&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;there is problem with this value even if it is set properly in user_ table. For example : &lt;br /&gt;&lt;br /&gt;{uuid=13ee286a-c390-4553-b1f5-f2d6196c0467, userId=49006, companyId=10157, createDate=Thu Jul 03 16:47:50 CEST 2014, modifiedDate=Thu Jul 17 09:48:09 CEST 2014, defaultUser=false, contactId=49007, password={BCRYPT}$2a$10$EsQ8BWqh8Hm2Ru927sQaJOwbMz1agwsVFvzUZUFFyjkvhmP3IecHq, passwordEncrypted=true, passwordReset=false, passwordModifiedDate=Wed Jul 23 11:42:18 CEST 2014, digest=d997512d04821acb35d1d7c5c19f6846,08ebb3a818b300fe61cdd528c2cab44b,f836e8c50322411cc12ad349d3ee15b7, reminderQueryQuestion=what-is-your-father&amp;#39;s-middle-name, reminderQueryAnswer=tata, graceLoginCount=0, screenName=b.stanczyk.amg, emailAddress=b.stanczyk@amg.net.pl, facebookId=0, ldapServerId=-1, openId=, portraitId=0, languageId=pl_PL, timeZoneId=Europe/Paris, greeting=Witaj Bartosz Stanczyk!, comments=, firstName=Bartosz, middleName=, lastName=Stanczyk, jobTitle=, loginDate=Fri Jul 25 13:58:16 CEST 2014, loginIP=127.0.0.1, lastLoginDate=Fri Jul 25 13:05:22 CEST 2014, lastLoginIP=127.0.0.1, lastFailedLoginDate=null, failedLoginAttempts=0, lockout=false, lockoutDate=null, agreedToTermsOfUse=false, emailAddressVerified=false, status=0} &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;but in DB&lt;/strong&gt; :&lt;br /&gt;&lt;br /&gt;13ee286a-c390-4553-b1f5-f2d6196c0467	49006	10157	14/07/03 16:47:50,329000000	14/07/17 09:48:09,864000000	0	49007	{BCRYPT}$2a$10$EsQ8BWqh8Hm2Ru927sQaJOwbMz1agwsVFvzUZUFFyjkvhmP3IecHq	1	0	14/07/23 11:42:18,651000000	d997512d04821acb35d1d7c5c19f6846,08ebb3a818b300fe61cdd528c2cab44b,f836e8c50322411cc12ad349d3ee15b7	what-is-your-father&amp;#39;s-middle-name	tata	0	b.stanczyk.amg	b.stanczyk@amg.net.pl	0	-1		0	pl_PL	Europe/Paris	Witaj Bartosz Stanczyk!		Bartosz		Stanczyk		14/07/25 12:09:29,803000000	127.0.0.1	14/07/25 11:55:18,857000000	127.0.0.1	14/06/05 09:17:39,076000000	0	0	14/06/05 09:17:39,076000000	0	0	0</summary>
    <dc:creator>Bartosz Stanczyk</dc:creator>
    <dc:date>2014-07-25T12:28:19Z</dc:date>
  </entry>
  <entry>
    <title>RE: LifeRay 6.2 &amp; velocity variables</title>
    <link rel="alternate" href="https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40540270" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40540270</id>
    <updated>2014-07-25T12:24:15Z</updated>
    <published>2014-07-25T12:24:15Z</published>
    <summary type="html">What do you mean, &amp;#39;proper value&amp;#39;?  It&amp;#39;s right there in the User object.  Just invoke user.getLastLoginDate();</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2014-07-25T12:24:15Z</dc:date>
  </entry>
  <entry>
    <title>RE: LifeRay 6.2 &amp; velocity variables</title>
    <link rel="alternate" href="https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40540006" />
    <author>
      <name>Bartosz Stanczyk</name>
    </author>
    <id>https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40540006</id>
    <updated>2014-07-25T12:12:30Z</updated>
    <published>2014-07-25T12:12:30Z</published>
    <summary type="html">That is the simpler part of the question , if anyone knows how to get to the proper value of getLastLoginDate of User object?&lt;br /&gt;&lt;br /&gt;Thank You in advance.</summary>
    <dc:creator>Bartosz Stanczyk</dc:creator>
    <dc:date>2014-07-25T12:12:30Z</dc:date>
  </entry>
  <entry>
    <title>RE: LifeRay 6.2 &amp; velocity variables</title>
    <link rel="alternate" href="https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40539947" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40539947</id>
    <updated>2014-07-25T12:07:20Z</updated>
    <published>2014-07-25T12:07:20Z</published>
    <summary type="html">The object is a Date and therefore will print per Date&amp;#39;s toString().&lt;br /&gt;&lt;br /&gt;There used to be a DateUtil or DateTool object stuffed in the context (it&amp;#39;s been awhile since I&amp;#39;ve used it) that you could use for specialized printing, but I don&amp;#39;t know if it&amp;#39;s still there.&lt;br /&gt;&lt;br /&gt;For the conditional one, you&amp;#39;d determine if it is not null and only then print something out (same as you would do conditional logic in your java code).</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2014-07-25T12:07:20Z</dc:date>
  </entry>
  <entry>
    <title>LifeRay 6.2 &amp; velocity variables</title>
    <link rel="alternate" href="https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40539248" />
    <author>
      <name>Bartosz Stanczyk</name>
    </author>
    <id>https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=40539248</id>
    <updated>2014-07-25T11:20:28Z</updated>
    <published>2014-07-25T11:20:28Z</published>
    <summary type="html">Hello,&lt;br /&gt;&lt;br /&gt;I&amp;#39;m wondering how can I access and format properly, particular vm variable - user&amp;#39;s getLastLoginDate and getLastFailedLoginDate. With my observation, first one format is unchangeable in vm template, second one is not set properly on vm level even if it is set properly in DB&amp;#39;s user_ table. Can anyone please help me out?&lt;br /&gt;&lt;br /&gt;Thank You in advance,</summary>
    <dc:creator>Bartosz Stanczyk</dc:creator>
    <dc:date>2014-07-25T11:20:28Z</dc:date>
  </entry>
</feed>
