schedule publication /schedule take offline feature in document in Hippo CMS

79 views
Skip to first unread message

sumans...@gmail.com

unread,
Dec 12, 2017, 11:45:10 AM12/12/17
to Hippo Community
Hi

I am using Schedule publication feature and schedule offline feature in Hippo cms.
Currently, I have published a document and scheduled it being offline on 31st dec,2017.(using hippo cms feature , i have not written any scheduler)
Now in my java class,How can i get this schedule offiline date.

Basically , i want the code to get 
/content/documents/mynode/hippo:request/hipposched:triggers/default : "hipposched:nextFireTime"

in my java class.

Thanks for the help !!

Marijan Milicevic

unread,
Dec 12, 2017, 12:32:55 PM12/12/17
to hippo-c...@googlegroups.com
Hi,

quite simple:

session.getNode("/content/documents/mynode/hippo:request/hipposched:triggers/default").getProperty("hipposched:nextFireTime").getDate() 

cheers
marijan 

Thanks for the help !!

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-community@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-community+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.

sumans...@gmail.com

unread,
Dec 13, 2017, 1:03:23 AM12/13/17
to Hippo Community
Thanks for the help !

But its not working 

I tried this :

String path = "/content/documents/mynode/hippo:request/hipposched:triggers/default" ;
Calendar offlineDate = requestContext.getSession().get
getNode(path).getProperty("hipposched:nextFireTime").getDate();

But this one is throwing path not found exception on this  :
requestContext.getSession().get
getNode(path)

because it is not treating "/content/documents/mynode/hippo:request/hipposched:triggers/default" as node.

whereas it is treating only "/content/documents/mynode" as node



On Tuesday, 12 December 2017 23:02:55 UTC+5:30, marijan milicevic wrote:
Hi,

On Tue, Dec 12, 2017 at 5:45 PM, <sumans...@gmail.com> wrote:
Hi

I am using Schedule publication feature and schedule offline feature in Hippo cms.
Currently, I have published a document and scheduled it being offline on 31st dec,2017.(using hippo cms feature , i have not written any scheduler)
Now in my java class,How can i get this schedule offiline date.

Basically , i want the code to get 
/content/documents/mynode/hippo:request/hipposched:triggers/default : "hipposched:nextFireTime"

in my java class.

quite simple:

session.getNode("/content/documents/mynode/hippo:request/hipposched:triggers/default").getProperty("hipposched:nextFireTime").getDate() 

cheers
marijan 

Thanks for the help !!

--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-c...@googlegroups.com

RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.

Marijan Milicevic

unread,
Dec 13, 2017, 12:31:39 PM12/13/17
to hippo-c...@googlegroups.com
On Wed, Dec 13, 2017 at 7:03 AM, <sumans...@gmail.com> wrote:
Thanks for the help !

But its not working 

I tried this :

String path = "/content/documents/mynode/hippo:request/hipposched:triggers/default" ;
Calendar offlineDate = requestContext.getSession().get
getNode(path).getProperty("hipposched:nextFireTime").getDate();

But this one is throwing path not found exception on this  :
requestContext.getSession().get
getNode(path)

because it is not treating "/content/documents/mynode/hippo:request/hipposched:triggers/default" as node.

whereas it is treating only "/content/documents/mynode" as node


that's because your session has insufficient rights to access it, you are using live user session,
and that is not gonna work,
Please describe your use case, why do you need to access publish time?

cheers
marijan


 
To post to this group, send email to hippo-community@googlegroups.com

RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-community+unsubscribe@googlegroups.com.

sumans...@gmail.com

unread,
Dec 14, 2017, 6:15:17 AM12/14/17
to Hippo Community
I Actually need to expose a CMS rest API to Mobile Api and mobile app track in which i'll expose the expiration date of one document.
As the intention is to stop displaying that document on desktop as well as mobile when that document is expired.

Your response on session really helped me.


and then i tried :- 

Session jcrSession =
       repository.login(new SimpleCredentials("admin", "admin".toCharArray());

It really worked for me.
But for security reasons , i guess i should not directly display "admin", "admin" in my code.

So i thought to store this information as key in hst-config.properties.

and then tried to read these keys from this file by this way.

But unable to accomplish my task.

private static String getPassword() { String retValue = System.getProperty("env.hippo.password"); return retValue; }

and here below is my hst-config.properties

env.hippo.username=admin
env.hippo.password=admin

but unable to read values from these keys.
Basically unable to load this hst-config.properties.

Please help!!

Marijan Milicevic

unread,
Dec 14, 2017, 8:34:14 AM12/14/17
to hippo-c...@googlegroups.com
On Thu, Dec 14, 2017 at 12:15 PM, <sumans...@gmail.com> wrote:
I Actually need to expose a CMS rest API to Mobile Api and mobile app track in which i'll expose the expiration date of one document.
 
As the intention is to stop displaying that document on desktop as well as mobile when that document is expired.


this will be automatically done once document is unpublished..so for this part, you don't need to do any effort

 
Your response on session really helped me.


and then i tried :- 

Session jcrSession =
       repository.login(new SimpleCredentials("admin", "admin".toCharArray());

It really worked for me.
But for security reasons , i guess i should not directly display "admin", "admin" in my code.

So i thought to store this information as key in hst-config.properties.

and then tried to read these keys from this file by this way.

But unable to accomplish my task.

private static String getPassword() { String retValue = System.getProperty("env.hippo.password"); return retValue; }

and here below is my hst-config.properties

env.hippo.username=admin
env.hippo.password=admin

but unable to read values from these keys.
Basically unable to load this hst-config.properties.


you already opened another thread for this...
/m 

Please help!!




 
To post to this group, send email to hippo-community@googlegroups.com

RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-community+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages