Cookieless REST API timing issue

8 views
Skip to first unread message

Mark Pitely

unread,
Mar 30, 2021, 11:42:07 AMMar 30
to dot...@googlegroups.com
I have code that uses the "Sign On with Google" authorization process (we are a gmail institution here, so extra useful for us) that is pushing the authentication into a structure.
So, whenever they log in via the google process, I get a piece of content with dmid,name, email, timestamp, googlepicture, page, etc. which I can then use, at the server level, to show them authorized content. These contentlets are nice for debugging. [dmid is the unique session id in dotcms, $visitor.dmid]

The issue I have is that despite waiting for the curl command to the REST API to complete successfully before returning and loading the content, it is *not* available in dotCMS immediately. My theory is that despite having an identifier and so on, it is still waiting on the workflow to truly 'publish' and there is a slight delay. If I sleep/wait for 3 seconds it seems to work okay, but I am worried that under load it might take longer. Is there a way within the REST calls to verify/delay/return only when completed? Can I just make a second curl command to 'view' the object created to do this?

Mark Pitely
Marywood University

Nathan Keiter

unread,
Mar 30, 2021, 11:59:41 AMMar 30
to dot...@googlegroups.com
We've run into this in the past, and unfortunately it is "working as designed".


dotCMS uses an "available eventually" model for content. This means that any create or edit operation cannot be immediately followed by a load operation.


On the technical side, you are waiting for the index and cache to catch up, even though the database has already been written to.


In light of this, we've had to move business operations which require an immediate load operation after a create or update operation to a different system. I.e. don't save the data as content.


With dotCMS there's no promise that the thing you just created or edited will be available in time to fetch it. This is even true when using the Java APIs in a plugin.


The delay is often less than one second, but the Java code runs faster than that. You can try wait or sleep timers, but that will just slow your program down and is not always guaranteed to work. I've done extensive testing with this.


I've spent over a year on this issue and had many help desk tickets open. There's no solution.


My advice would be to save the data as something other than content if you need it immediately after saving. Don't waste your time trying to get this to work as content.


"available eventually" works well for website content, but it's a disaster for promise dependent business processes.

Nathan I. Keiter | Lead Network Applications Programmer | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993
https://www.gettysburg.edu<https://www.gettysburg.edu/>
________________________________
From: dot...@googlegroups.com <dot...@googlegroups.com> on behalf of Mark Pitely <pit...@maryu.marywood.edu>
Sent: Tuesday, March 30, 2021 11:41 AM
To: dot...@googlegroups.com
Subject: [dotcms] Cookieless REST API timing issue

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,FofOnmP-T-OtIMEracGNTkZNcfMIr97m5roHYasL50hs1Pn1EixnHHZ85uPD6UqtvlGHR51ZltflKjN85NXmAN8KSWoGgVEl_56n-2Kn-B1Fhbk,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAFeiKqOVRD-kncv%2BTGTf7p3Kub_7PfW-_Z1f%2BaWhHP%2Bwdh%3D0HQ%40mail.gmail.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAFeiKqOVRD-kncv%252BTGTf7p3Kub_7PfW-_Z1f%252BaWhHP%252Bwdh%253D0HQ%2540mail.gmail.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,2ze8zRdjEL0vMU8nWvbQTdlNp0yXzwHOhYc64dEu1257blvSQgEqTx3NWdp8dHzI3mlB-3GG4Ghdg5UMVZfTXByEqa0owvxUH0mnOINmoQ,,&typo=1>.

Will Ezell

unread,
Mar 30, 2021, 12:06:50 PMMar 30
to dot...@googlegroups.com
If you are on new code (Mark!) You should be able to pass an Index policy of WAIT_FOR or FORCE to wait until the content has been indexed before returing- see:

https://dotcms.com/docs/latest/rest-api-index-policy




--
http://dotcms.com - Open Source Java Content Management

---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/1617119978635.64272%40gettysburg.edu.


--



382 NE 191st St #92150
Miami, Florida 33179-3899
Main: 
305-900-2001 | Direct: 978.294.9429

   

Mark Pitely

unread,
Mar 30, 2021, 12:11:11 PMMar 30
to dot...@googlegroups.com
Great, I am on 5.3.8.2 which is the newest LTS model.
That's exactly what I wanted to know! Maybe there's hope for Nathan now, too.

Mark Pitely
Marywood University

Nathan Keiter

unread,
Mar 30, 2021, 12:18:34 PMMar 30
to dot...@googlegroups.com
A much needed improvement over past versions.


Unfortunately for us that ship has sailed. We've already ported the business operations to a real database.

Nathan I. Keiter | Lead Network Applications Programmer | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993
https://www.gettysburg.edu<https://www.gettysburg.edu/>
________________________________
From: dot...@googlegroups.com <dot...@googlegroups.com> on behalf of Mark Pitely <pit...@maryu.marywood.edu>
Sent: Tuesday, March 30, 2021 12:10 PM
To: dot...@googlegroups.com
Subject: Re: [dotcms] Cookieless REST API timing issue

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
Great, I am on 5.3.8.2 which is the newest LTS model.
That's exactly what I wanted to know! Maybe there's hope for Nathan now, too.

Mark Pitely
Marywood University

On Tue, Mar 30, 2021 at 12:06 PM Will Ezell <wi...@dotcms.com<mailto:wi...@dotcms.com>> wrote:
If you are on new code (Mark!) You should be able to pass an Index policy of WAIT_FOR or FORCE to wait until the content has been indexed before returing- see:

https://dotcms.com/docs/latest/rest-api-index-policy<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fdotcms.com%2fdocs%2flatest%2frest-api-index-policy&c=E,1,NuJ16_RVQLs5xRD5Nmr9hWfJAOTmLcoZQovLbbWElgr3MvReseVnJLSKajjsf4zxEKaGI1gXlk-rs0Yg6bh9EAfP2_Z5x0M-mpT8b8juucvaVknxPcqBgJvGWg,,&typo=1>




On Tue, Mar 30, 2021 at 11:59 AM 'Nathan Keiter' via dotCMS User Group <dot...@googlegroups.com<mailto:dot...@googlegroups.com>> wrote:
We've run into this in the past, and unfortunately it is "working as designed".


dotCMS uses an "available eventually" model for content. This means that any create or edit operation cannot be immediately followed by a load operation.


On the technical side, you are waiting for the index and cache to catch up, even though the database has already been written to.


In light of this, we've had to move business operations which require an immediate load operation after a create or update operation to a different system. I.e. don't save the data as content.


With dotCMS there's no promise that the thing you just created or edited will be available in time to fetch it. This is even true when using the Java APIs in a plugin.


The delay is often less than one second, but the Java code runs faster than that. You can try wait or sleep timers, but that will just slow your program down and is not always guaranteed to work. I've done extensive testing with this.


I've spent over a year on this issue and had many help desk tickets open. There's no solution.


My advice would be to save the data as something other than content if you need it immediately after saving. Don't waste your time trying to get this to work as content.


"available eventually" works well for website content, but it's a disaster for promise dependent business processes.

Nathan I. Keiter | Lead Network Applications Programmer | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993
https://www.gettysburg.edu<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu&c=E,1,HxaIWc_G7WgNc-u7VOXbXznyh0YzOlSbGxHJH4btRR1Klx3LLUQ2aMMa9WZ6ElKBn4HxtHSmkYdb1MvfPbHSZS3bqWfmvTIsbU5xiBPRMSQyQA,,&typo=1><https://www.gettysburg.edu/<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu%2f&c=E,1,GAi02pMWKviNEkn7lkpzW902_lX4mZe__et61dwxEQ40pGIJjP75wSYMZJDAV9j-UcxDTPvJCVoIZYKkMRhG_Eacv9z0LS91tPO1AUv2OUv--7wKiR5xXBcW&typo=1>>
________________________________
From: dot...@googlegroups.com<mailto:dot...@googlegroups.com> <dot...@googlegroups.com<mailto:dot...@googlegroups.com>> on behalf of Mark Pitely <pit...@maryu.marywood.edu<mailto:pit...@maryu.marywood.edu>>
Sent: Tuesday, March 30, 2021 11:41 AM
To: dot...@googlegroups.com<mailto:dot...@googlegroups.com>
Subject: [dotcms] Cookieless REST API timing issue

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
I have code that uses the "Sign On with Google" authorization process (we are a gmail institution here, so extra useful for us) that is pushing the authentication into a structure.
So, whenever they log in via the google process, I get a piece of content with dmid,name, email, timestamp, googlepicture, page, etc. which I can then use, at the server level, to show them authorized content. These contentlets are nice for debugging. [dmid is the unique session id in dotcms, $visitor.dmid]

The issue I have is that despite waiting for the curl command to the REST API to complete successfully before returning and loading the content, it is *not* available in dotCMS immediately. My theory is that despite having an identifier and so on, it is still waiting on the workflow to truly 'publish' and there is a slight delay. If I sleep/wait for 3 seconds it seems to work okay, but I am worried that under load it might take longer. Is there a way within the REST calls to verify/delay/return only when completed? Can I just make a second curl command to 'view' the object created to do this?

Mark Pitely
Marywood University

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,B-nB44j8YW9dsHlyhPUrl19GH66yHeWg6ypGJeXQEOGb4ie9cssZ5FUfSTd2M2jl3zEghXYu5BFxUQJvaDBzb7wzqJPHdFS52OB97HhY7z8X2BpA1oA,&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,FofOnmP-T-OtIMEracGNTkZNcfMIr97m5roHYasL50hs1Pn1EixnHHZ85uPD6UqtvlGHR51ZltflKjN85NXmAN8KSWoGgVEl_56n-2Kn-B1Fhbk,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms%2Bunsu...@googlegroups.com><mailto:dotcms+un...@googlegroups.com<mailto:dotcms%2Bunsu...@googlegroups.com>>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAFeiKqOVRD-kncv%2BTGTf7p3Kub_7PfW-_Z1f%2BaWhHP%2Bwdh%3D0HQ%40mail.gmail.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAFeiKqOVRD-kncv%252BTGTf7p3Kub_7PfW-_Z1f%252BaWhHP%252Bwdh%253D0HQ%2540mail.gmail.com&c=E,1,5M3jVmIx7ieOBqj3kgkNZ6Z7vYdKrKrv1hiKV19xAiCYZMoLJK_jMu0EWIGb0Bp6qmQWGdZaUmFBmigEAsPgqQzv8mCnO-Q-c1AwgUt5hA,,&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAFeiKqOVRD-kncv%252BTGTf7p3Kub_7PfW-_Z1f%252BaWhHP%252Bwdh%253D0HQ%2540mail.gmail.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,2ze8zRdjEL0vMU8nWvbQTdlNp0yXzwHOhYc64dEu1257blvSQgEqTx3NWdp8dHzI3mlB-3GG4Ghdg5UMVZfTXByEqa0owvxUH0mnOINmoQ,,&typo=1>.

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,1ZOwYOyWokkJBUXDkzHZQ8V8W59P1m4GmGO4wUsGn_HqM3OSSAMb5N61P5Qjs6wgkPD-Xq6A31nCKR_gNkz1RtYLsbJcpONevrmG25c2PdothB1n7Ok,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms%2Bunsu...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/1617119978635.64272%40gettysburg.edu<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f1617119978635.64272%2540gettysburg.edu&c=E,1,RISw633qo-_2Oz4_Lgqa5lfFHK4FHtkmRsRgf0Bi2HC8fmygHRBQs5cv4BvtOpdpWD15Vmv7525CTKXQ73niA4Nt7PIC-T7XxLt0evxJ0t-f_P2FfQ,,&typo=1>.


--
[https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fdotcms.com%2fdA%2f99fe3769-d649%2f256w%2fdotcms.png&c=E,1,ociNX3caly5WcxDsHEJ_9b5EVHSLVlbSBhVh6eX3DUqiD1TdeLx2lA3VcEbR_1CCzEw8uJDTWEjlE1iwCCGMLAkQdIMvtS735FreOzvTsAxaVshlpQ,,&typo=1]


382 NE 191st St #92150
Miami, Florida 33179-3899
Main: 305-900-2001 | Direct: 978.294.9429

wi...@dotcms.com<mailto:wi...@dotcms.com> | dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.dotcms.com%2f&c=E,1,FshjzuRM-dot5WbyHggsNZwOCj9PcxPfe7UOS-Bp71rnOCN8p--Zplyc8rQ_mHoaq7xiU4ItJ9C67EbN1Nla_pkTnL7IXTkSf6etErL0VKpERfdSjQ,,&typo=1>

[https://origin.ih.constantcontact.com/fs172/1109987089110/img/11.png]<https://twitter.com/dotcms> [https://origin.ih.constantcontact.com/fs172/1109987089110/img/14.png] <http://www.linkedin.com/company/dotcms> [https://origin.ih.constantcontact.com/fs172/1109987089110/img/15.png] <https://plus.google.com/+Dotcms> [https://origin.ih.constantcontact.com/fs172/1109987089110/img/13.png] <https://www.facebook.com/dotCMS>

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,6Qa2D_bDvSqXalwVv98MX2x5vLmwdqLthOyNgyqU4m7FSMMNxZgDm0FEPn5An_vaJh84QFU-JZ3fKbcxvKxcyHrKwM8U-dD7luBMrtejZPRvbQhhJfXF&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAPL0VyFEzg9jdaMEGYjyj2mYO8xZxpg5KVZAK0pZxFEHaM55pg%40mail.gmail.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAPL0VyFEzg9jdaMEGYjyj2mYO8xZxpg5KVZAK0pZxFEHaM55pg%2540mail.gmail.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,4EAHPUHnCvX8VxZ5ZJipxQin2axvEeyFADZGjX4yiAlJZbxfTJoOSiCuHa_XQCSdFi9fVVjsmtk8Stc6e-mtxw5sEBu6WP_6gS9aC0yWgGCb8vha9kKRdA,,&typo=1>.

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,RrFABsGrlNH8YKlQPrUvcQZw0AaUaLYLT7qZAepkn8F4A_rGejM6ZvU6CT8PRdparnP954XZxU79i3-nVe9pm-kurl2qtFFV577eGAJMybHu6Wal&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAFeiKqPB7RY-D7JaKVy0R5QJVyzX3Adsgo2NW-r7G9CmDpORCQ%40mail.gmail.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAFeiKqPB7RY-D7JaKVy0R5QJVyzX3Adsgo2NW-r7G9CmDpORCQ%2540mail.gmail.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,QFGryAADD6HkYIg5q00ZDeU6YtUbLrIHzXdTmmiFfMLs_QkEJQYtTAIsae__ezZonyWoF2oKxWaBNQKfRZPFd8bti5cNeuSUQWiRD_SHBw,,&typo=1>.

jonathan...@dotcms.com

unread,
Mar 30, 2021, 12:59:38 PMMar 30
to dotCMS User Group
As Will said, you can use index policy as WAIT_FOR.
It can be use on Rest API and also on Java API, by setting the public void setIndexPolicy(IndexPolicy.WAIT_FOR); before running a workflow or checkin

Thanks,
J

Nathan Keiter

unread,
Mar 30, 2021, 1:01:00 PMMar 30
to dot...@googlegroups.com
For the benefit of the group, which versions support that new feature?

Nathan I. Keiter | Lead Network Applications Programmer | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993
https://www.gettysburg.edu<https://www.gettysburg.edu/>
________________________________
From: dot...@googlegroups.com <dot...@googlegroups.com> on behalf of jonathan...@dotcms.com <jonathan...@dotcms.com>
Sent: Tuesday, March 30, 2021 12:59 PM
To: dotCMS User Group
Subject: Re: [dotcms] Cookieless REST API timing issue

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
As Will said, you can use index policy as WAIT_FOR.
It can be use on Rest API and also on Java API, by setting the public void setIndexPolicy(IndexPolicy.WAIT_FOR); before running a workflow or checkin

Thanks,
J

On Tuesday, March 30, 2021 at 10:06:50 AM UTC-6 Will Ezell wrote:
If you are on new code (Mark!) You should be able to pass an Index policy of WAIT_FOR or FORCE to wait until the content has been indexed before returing- see:

https://dotcms.com/docs/latest/rest-api-index-policy<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fdotcms.com%2fdocs%2flatest%2frest-api-index-policy&c=E,1,Q-j-ncphVCSMTgbCxR8Bb89v-rmfXbXoIy8ok8XNyjA72j_ER2UKOYpAVUNFXse83Gz3QhEsEEVMYZtNGoiMurcQsT8XZLtrQQfVPQbanJ0v-RagEyHFp-7uDpyF&typo=1>




On Tue, Mar 30, 2021 at 11:59 AM 'Nathan Keiter' via dotCMS User Group <dot...@googlegroups.com> wrote:
We've run into this in the past, and unfortunately it is "working as designed".


dotCMS uses an "available eventually" model for content. This means that any create or edit operation cannot be immediately followed by a load operation.


On the technical side, you are waiting for the index and cache to catch up, even though the database has already been written to.


In light of this, we've had to move business operations which require an immediate load operation after a create or update operation to a different system. I.e. don't save the data as content.


With dotCMS there's no promise that the thing you just created or edited will be available in time to fetch it. This is even true when using the Java APIs in a plugin.


The delay is often less than one second, but the Java code runs faster than that. You can try wait or sleep timers, but that will just slow your program down and is not always guaranteed to work. I've done extensive testing with this.


I've spent over a year on this issue and had many help desk tickets open. There's no solution.


My advice would be to save the data as something other than content if you need it immediately after saving. Don't waste your time trying to get this to work as content.


"available eventually" works well for website content, but it's a disaster for promise dependent business processes.

Nathan I. Keiter | Lead Network Applications Programmer | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993<tel:(717)%20337-6993>
https://www.gettysburg.edu<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu&c=E,1,VgQPHuVmdgJ_4ku4mUEg629pJP3FNutx6hicoxdWEbEvyYhIgok7OX-lyjlyIpEI5KUuK4Pz2bx3KMJbu8XiZkhP1vkSHTsGYRHIKEV7lQYi8kMTWvv2Amqu9g,,&typo=1><https://www.gettysburg.edu/<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu%2f&c=E,1,OoIJSMmr_-ru6sXRNh1INoIClQVEXNWFoBLazoO0O_5xeARPJEXH4MBWoCrL_YT2TNwXCqkYqfGBXihXtmjVdNXajMwPlJCquAIA0Q0R0QtcQFgDXtfv-StK-bHt&typo=1>>
________________________________
From: dot...@googlegroups.com <dot...@googlegroups.com> on behalf of Mark Pitely <pit...@maryu.marywood.edu>
Sent: Tuesday, March 30, 2021 11:41 AM
To: dot...@googlegroups.com
Subject: [dotcms] Cookieless REST API timing issue

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
I have code that uses the "Sign On with Google" authorization process (we are a gmail institution here, so extra useful for us) that is pushing the authentication into a structure.
So, whenever they log in via the google process, I get a piece of content with dmid,name, email, timestamp, googlepicture, page, etc. which I can then use, at the server level, to show them authorized content. These contentlets are nice for debugging. [dmid is the unique session id in dotcms, $visitor.dmid]

The issue I have is that despite waiting for the curl command to the REST API to complete successfully before returning and loading the content, it is *not* available in dotCMS immediately. My theory is that despite having an identifier and so on, it is still waiting on the workflow to truly 'publish' and there is a slight delay. If I sleep/wait for 3 seconds it seems to work okay, but I am worried that under load it might take longer. Is there a way within the REST calls to verify/delay/return only when completed? Can I just make a second curl command to 'view' the object created to do this?

Mark Pitely
Marywood University

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,KEeiPiyyUZ8AX8XVelU2K-97-RGycIDvwl3kwUEaWSsdhlY1dibRtLZdU16KO46DlVdCE7MxL1wmSwMk4c2XOAsbC0FkUFOfDZzx-6ZTTom--M3NFsdKY4fIieQ,&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,FofOnmP-T-OtIMEracGNTkZNcfMIr97m5roHYasL50hs1Pn1EixnHHZ85uPD6UqtvlGHR51ZltflKjN85NXmAN8KSWoGgVEl_56n-2Kn-B1Fhbk,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAFeiKqOVRD-kncv%2BTGTf7p3Kub_7PfW-_Z1f%2BaWhHP%2Bwdh%3D0HQ%40mail.gmail.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAFeiKqOVRD-kncv%252BTGTf7p3Kub_7PfW-_Z1f%252BaWhHP%252Bwdh%253D0HQ%2540mail.gmail.com&c=E,1,_YGi_qmMYNZkl_5kqbWKgD2Q5Zzor-pgfOpHKp-x-BBfI4w4miA3KaEq5oGkEdaakehF8AVkdVKk_oBEiqdzwmeNTBsMFUuSXPxbp311_Qng&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAFeiKqOVRD-kncv%252BTGTf7p3Kub_7PfW-_Z1f%252BaWhHP%252Bwdh%253D0HQ%2540mail.gmail.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,2ze8zRdjEL0vMU8nWvbQTdlNp0yXzwHOhYc64dEu1257blvSQgEqTx3NWdp8dHzI3mlB-3GG4Ghdg5UMVZfTXByEqa0owvxUH0mnOINmoQ,,&typo=1>.

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,hVsji_aD8ddaEjwtel19zOUkcxMwma6b_9SMo8B9LHSJf1JjG2Jx67f5HiR4ZjdUIr9zWwT07Q9V6VgZHuTMwZZzZTbPNn4CK9u_hqftG1X03Fs,&typo=1> - Open Source Java Content Management

---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/1617119978635.64272%40gettysburg.edu<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f1617119978635.64272%2540gettysburg.edu&c=E,1,vD5fQdEdaRvBVCYu8MH6uKiw97xYvxwTYYghfcDnw97KkZ6MQfheYG5KxSYm4o_O9LPaLUS3SI1JAie1KSh8uSCUuXkEol7tUArQ92M8QiCBlR3vIFMchCgDLA,,&typo=1>.


--
[https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fci4.googleusercontent.com%2fproxy%2fX9lAIhwzFcyac0u6VckJIJOVKHsVGrb2-WVPneybOshP-_9Qtuowal1-gnnA4giqPrNqM9Bub2QCowjKdInrHRRV7-BqHQ%3ds0-d-e1-ft%23https%3a%2f%2fdotcms.com%2fdA%2f99fe3769-d649%2f256w%2fdotcms.png&c=E,1,OMGE74BnQlVLDDinWB8R2j7KYv3BxzLMR4isFfWKvy8JeYywOxLfYZ8DEWljHXmTfo_GyQxXe9rt8DBzdLCX_oHu-YpNelxvnSAn6yr6wQllAYCz7pVL&typo=1]


382 NE 191st St #92150
Miami, Florida 33179-3899
Main: 305-900-2001 | Direct: 978.294.9429

wi...@dotcms.com | dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.dotcms.com%2f&c=E,1,WkUgcY2S9FiJ8HFJNTP2E1sU7h7XOVyn4wI2xGp-NL41M0z-fGp-8qeAJwFANT6NUGFBslMVXvYkT7I7XZZ0XwvOeZs0aF45t4mC62jJAH6z9Oua&typo=1>

[https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fci6.googleusercontent.com%2fproxy%2fcmkOvj-Lmnc1m6I0I4JByU6E_tqmEgGg8eG-L2qMp1J37Kb_3dGsHgupQ8AFJiIDQcTSaASsKimZecPq9OvckCG7yYFVLipY8Lx0gAM_QZ-fNiRJa9vy%3ds0-d-e1-ft%23https%3a%2f%2forigin.ih.constantcontact.com%2ffs172%2f1109987089110%2fimg%2f11.png&c=E,1,cVr8KRfbScyMe88ukf1NIoG2XcV48uUWeeb6lLJElmhFfzgFeQZqBzERtnNFtkXQSH_g1cpKfRwkIHyTnMS3SfJdrPgxNhPuMkI6kG0TAaM,&typo=1]<https://twitter.com/dotcms> [https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fci3.googleusercontent.com%2fproxy%2fYUK5J6Z5acoGtktGsQpEFlUYRzYYwV-Ahk4l-P8v91F4lSntXcTs5ufL6v2WS_Jozl7n5VP8WaUN7XlfmKRfpv1siTBGOgAHfYnIASkil6cFkJ7rr0PL%3ds0-d-e1-ft%23https%3a%2f%2forigin.ih.constantcontact.com%2ffs172%2f1109987089110%2fimg%2f14.png&c=E,1,Oq3o7ZOKHChJ6xKZstQcvPnjuuk1PrJz_oZ1ey4w7G6MPunFtZ-9TYDU-BDtoalyROlSX7OaNk5wd-2IR4rgpiTOFk34obPjzY2wngOWKOBrW3Jjfw,,&typo=1] <http://www.linkedin.com/company/dotcms> [https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fci5.googleusercontent.com%2fproxy%2feG1MZ6nIkN1cgtm80hkWS9FS3sv95G3hZ231Mbd5w_MdUOoAyZc8RrY592Sv52YEbcts3Yd4JbFSRYbA-JLvh5dqggSRgefLQzHgLdoBaJwv5wOxmAza%3ds0-d-e1-ft%23https%3a%2f%2forigin.ih.constantcontact.com%2ffs172%2f1109987089110%2fimg%2f15.png&c=E,1,qNqYrzwQ9k0dqQ8KOSNxxtgBbJ5o2B2rGw25oPZqCBu5i39gVNkJ6bZjw5cEnQijdg7cdr_1u6rlE19cwwZ7gTjquv2v4CRzWV6X_QWoslM,&typo=1] <https://plus.google.com/+Dotcms> [https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fci6.googleusercontent.com%2fproxy%2f-Mo3gBU-3HQjvZWkduSazsWE0q2xmHIDrMV46crWeKixn16Ov0JCmDK_ch4hdHIQ3OIP3tEQFNd6ZizUPn4jK6E8w-3U9sNxLyFKFBg78SxlDQFJr-ht%3ds0-d-e1-ft%23https%3a%2f%2forigin.ih.constantcontact.com%2ffs172%2f1109987089110%2fimg%2f13.png&c=E,1,RLz38l19UxgZ4LIg0t1OFgD_1_LjsLryTpUityAqrDvdGUpAKeAulQF_ThkWMOslI0Bkx7qRTgE6dMYXwBZ8M4Xh4Qdzl-FN8wA0zuha_Cgef1-ENWPbxw,,&typo=1] <https://www.facebook.com/dotCMS>

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,JX8YC2NWk78rkuOoTtjQzj2na-6LWHQHgXdz-4fon8cDqJ8xK3i3V5ksKKzatcu98YFVOCRGVlRg1glWWV-aga_xtUli2zPNTVkdh-qvI1gS4mE,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/55c6c29c-ed38-4342-864c-906415406365n%40googlegroups.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f55c6c29c-ed38-4342-864c-906415406365n%2540googlegroups.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,_zS7gpiO2ia4yogCD86mC1VvF5Iek0urJzcLZVxlM51IIVMZXXa2tGrFLXSlsk7BOf6uz0dsTv6huSDpcms3SLkzsWgRsXLd7KK4iIy-HqiQBit1ibFCvTeI&typo=1>.

jonathan...@dotcms.com

unread,
Mar 30, 2021, 1:37:23 PMMar 30
to dotCMS User Group
1) As part of the Java API, from 5.1 such as

```
Contentlet spanishPageAsset = APILocator.getContentletAPI().checkout(htmlPage.getInode(), user false);
spanishPageAsset.setIdentifier(htmlPage.getIdentifier());
spanishPageAsset.setIndexPolicy(IndexPolicy.WAIT_FOR);
spanishPageAsset = APILocator.getContentletAPI().checkin(spanishPageAsset,  user, false);
```

2) As part of the contentlet body in a POST or PUT from 5.2 such as

```
--header 'Content-Type: application/json' \
--data-raw '{
    "contentlet": {
        "indexPolicy":"WAIT_FOR",
        "contentType":"webPageContent",
        "title":"Test title",
        "body":"Test body",
        "contentHost":"default"
     }
}'
```

3) An addition of the query string, from 5.3 such as 


```
--header 'Content-Type: application/json' \
--data-raw '{
    "contentlet": {
        "contentType":"webPageContent",
        "title":"Test title",
        "body":"Test body",
        "contentHost":"default"
     }
}'
```




Nathan Keiter

unread,
Mar 30, 2021, 2:15:38 PMMar 30
to dot...@googlegroups.com
Thanks, that's helpful.

Nathan I. Keiter | Lead Network Applications Programmer | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993
https://www.gettysburg.edu<https://www.gettysburg.edu/>
________________________________
From: dot...@googlegroups.com <dot...@googlegroups.com> on behalf of jonathan...@dotcms.com <jonathan...@dotcms.com>
Sent: Tuesday, March 30, 2021 1:37 PM
To: dotCMS User Group
Subject: Re: [dotcms] Cookieless REST API timing issue

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
Phone: 717.337.6993<tel:(717)%20337-6993>
https://www.gettysburg.edu<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu&c=E,1,cnensSfbswQ7k0xTmpC7dqDF-DVTruqB4aQw5v2wX3JEjMIpaVmG8zrINC6uu1rTxv-CDxMdSqAiHt86VAdzfTdziuz7rNNkifo50qJeWn0elzS58eVyKBLSKzh2&typo=1><https://www.gettysburg.edu/<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu%2f&c=E,1,S8o8F2wqIifGEJ8i_LTUtRv_H49b240PYg3K563Kg9dAFc_AKIS47fq6KpwK-5oFIDLJHBnBL4xzFDf_szYQDvUQRG95ZI_OEOkdq88LnGnGHdD2EXJSN5gGuO7l&typo=1>>
________________________________
From: dot...@googlegroups.com <dot...@googlegroups.com> on behalf of jonathan...@dotcms.com <jonathan...@dotcms.com>
Sent: Tuesday, March 30, 2021 12:59 PM
To: dotCMS User Group
Subject: Re: [dotcms] Cookieless REST API timing issue

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
As Will said, you can use index policy as WAIT_FOR.
It can be use on Rest API and also on Java API, by setting the public void setIndexPolicy(IndexPolicy.WAIT_FOR); before running a workflow or checkin

Thanks,
J

On Tuesday, March 30, 2021 at 10:06:50 AM UTC-6 Will Ezell wrote:
If you are on new code (Mark!) You should be able to pass an Index policy of WAIT_FOR or FORCE to wait until the content has been indexed before returing- see:

https://dotcms.com/docs/latest/rest-api-index-policy<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fdotcms.com%2fdocs%2flatest%2frest-api-index-policy&c=E,1,GPloSlcnJw7m2Rlxwv79luMau-UQ1PqmnigGFpi3OvlrtGDCs0perm3djpEmenXE4zCWSjr4Q2WLmwY4JPD9RwJOV33Iwt8lDL4Tq4dS&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fdotcms.com%2fdocs%2flatest%2frest-api-index-policy&c=E,1,Q-j-ncphVCSMTgbCxR8Bb89v-rmfXbXoIy8ok8XNyjA72j_ER2UKOYpAVUNFXse83Gz3QhEsEEVMYZtNGoiMurcQsT8XZLtrQQfVPQbanJ0v-RagEyHFp-7uDpyF&typo=1>




On Tue, Mar 30, 2021 at 11:59 AM 'Nathan Keiter' via dotCMS User Group <dot...@googlegroups.com> wrote:
We've run into this in the past, and unfortunately it is "working as designed".


dotCMS uses an "available eventually" model for content. This means that any create or edit operation cannot be immediately followed by a load operation.


On the technical side, you are waiting for the index and cache to catch up, even though the database has already been written to.


In light of this, we've had to move business operations which require an immediate load operation after a create or update operation to a different system. I.e. don't save the data as content.


With dotCMS there's no promise that the thing you just created or edited will be available in time to fetch it. This is even true when using the Java APIs in a plugin.


The delay is often less than one second, but the Java code runs faster than that. You can try wait or sleep timers, but that will just slow your program down and is not always guaranteed to work. I've done extensive testing with this.


I've spent over a year on this issue and had many help desk tickets open. There's no solution.


My advice would be to save the data as something other than content if you need it immediately after saving. Don't waste your time trying to get this to work as content.


"available eventually" works well for website content, but it's a disaster for promise dependent business processes.

Nathan I. Keiter | Lead Network Applications Programmer | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993<tel:(717)%20337-6993><tel:(717)%20337-6993>
https://www.gettysburg.edu<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu&c=E,1,_XSP0lPoDzHNxab64ULHyYK9AJ4wfeeXvhZohdBbgyHgt3Ll3E0DRMAKC0neaS0obuaUeV3Ct6gMt7DCGOG_lN5PpYxzol6rgHJGtJn1ww,,&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu&c=E,1,VgQPHuVmdgJ_4ku4mUEg629pJP3FNutx6hicoxdWEbEvyYhIgok7OX-lyjlyIpEI5KUuK4Pz2bx3KMJbu8XiZkhP1vkSHTsGYRHIKEV7lQYi8kMTWvv2Amqu9g,,&typo=1><https://www.gettysburg.edu/<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu%2f&c=E,1,NwrFyypK7s_EM2GXVLD__hdOrVqincuCm1FBemHcs4G8H7Kx1OrdidpPGqu5r2n4PdncMQM0YI5FbvaU4B4WKLBa2yBd6jSM81diQR8VIb6N3uk-TfFH7ws,&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu%2f&c=E,1,OoIJSMmr_-ru6sXRNh1INoIClQVEXNWFoBLazoO0O_5xeARPJEXH4MBWoCrL_YT2TNwXCqkYqfGBXihXtmjVdNXajMwPlJCquAIA0Q0R0QtcQFgDXtfv-StK-bHt&typo=1>>
________________________________
From: dot...@googlegroups.com <dot...@googlegroups.com> on behalf of Mark Pitely <pit...@maryu.marywood.edu>
Sent: Tuesday, March 30, 2021 11:41 AM
To: dot...@googlegroups.com
Subject: [dotcms] Cookieless REST API timing issue

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
I have code that uses the "Sign On with Google" authorization process (we are a gmail institution here, so extra useful for us) that is pushing the authentication into a structure.
So, whenever they log in via the google process, I get a piece of content with dmid,name, email, timestamp, googlepicture, page, etc. which I can then use, at the server level, to show them authorized content. These contentlets are nice for debugging. [dmid is the unique session id in dotcms, $visitor.dmid]

The issue I have is that despite waiting for the curl command to the REST API to complete successfully before returning and loading the content, it is *not* available in dotCMS immediately. My theory is that despite having an identifier and so on, it is still waiting on the workflow to truly 'publish' and there is a slight delay. If I sleep/wait for 3 seconds it seems to work okay, but I am worried that under load it might take longer. Is there a way within the REST calls to verify/delay/return only when completed? Can I just make a second curl command to 'view' the object created to do this?

Mark Pitely
Marywood University

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,5m2jIwt6YJBfKjEYgMIzldgHefMM56jLJRNL73AdkpqaTC09T5DUeQAwTxzYNYvchkIeAdx0JyduhbF4hsXL5qe2ME7xmP0qqF7DR6oafA,,&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,KEeiPiyyUZ8AX8XVelU2K-97-RGycIDvwl3kwUEaWSsdhlY1dibRtLZdU16KO46DlVdCE7MxL1wmSwMk4c2XOAsbC0FkUFOfDZzx-6ZTTom--M3NFsdKY4fIieQ,&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,FofOnmP-T-OtIMEracGNTkZNcfMIr97m5roHYasL50hs1Pn1EixnHHZ85uPD6UqtvlGHR51ZltflKjN85NXmAN8KSWoGgVEl_56n-2Kn-B1Fhbk,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAFeiKqOVRD-kncv%2BTGTf7p3Kub_7PfW-_Z1f%2BaWhHP%2Bwdh%3D0HQ%40mail.gmail.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAFeiKqOVRD-kncv%252BTGTf7p3Kub_7PfW-_Z1f%252BaWhHP%252Bwdh%253D0HQ%2540mail.gmail.com&c=E,1,uZz79K3PAtlT60B8s1yqSsYlPaxDf5WWpTrSgAGdaMxtSNFs9cXSuJWsHUnuvNHBx5_i2hH-B3faarg-iz0hba0oH6jaEFJQZhMIP_GdGw,,&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAFeiKqOVRD-kncv%252BTGTf7p3Kub_7PfW-_Z1f%252BaWhHP%252Bwdh%253D0HQ%2540mail.gmail.com&c=E,1,_YGi_qmMYNZkl_5kqbWKgD2Q5Zzor-pgfOpHKp-x-BBfI4w4miA3KaEq5oGkEdaakehF8AVkdVKk_oBEiqdzwmeNTBsMFUuSXPxbp311_Qng&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAFeiKqOVRD-kncv%252BTGTf7p3Kub_7PfW-_Z1f%252BaWhHP%252Bwdh%253D0HQ%2540mail.gmail.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,2ze8zRdjEL0vMU8nWvbQTdlNp0yXzwHOhYc64dEu1257blvSQgEqTx3NWdp8dHzI3mlB-3GG4Ghdg5UMVZfTXByEqa0owvxUH0mnOINmoQ,,&typo=1>.

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,_iFnvHtaSDeeOrFRYMCpdhQXpgfWh7xe4dJJJDaVk9DCtRbNePdok8b-5Ub68e03bejhar37qbduJbDLy6vTOkVxLQ2skqowyzK03bFn9Wihpw,,&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,hVsji_aD8ddaEjwtel19zOUkcxMwma6b_9SMo8B9LHSJf1JjG2Jx67f5HiR4ZjdUIr9zWwT07Q9V6VgZHuTMwZZzZTbPNn4CK9u_hqftG1X03Fs,&typo=1> - Open Source Java Content Management

---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/1617119978635.64272%40gettysburg.edu<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f1617119978635.64272%2540gettysburg.edu&c=E,1,gX72WjUY6o9ac-9VkDbrPrOq0j53QYkgQVfNm_dy2xTlfTmNv6SosGJLhz9WSBbobzxw1DqANYkkHA9uXD0Tv1ByFy2Fr-7-biXCphXL_59vVwn1oxy71zawGg,,&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f1617119978635.64272%2540gettysburg.edu&c=E,1,vD5fQdEdaRvBVCYu8MH6uKiw97xYvxwTYYghfcDnw97KkZ6MQfheYG5KxSYm4o_O9LPaLUS3SI1JAie1KSh8uSCUuXkEol7tUArQ92M8QiCBlR3vIFMchCgDLA,,&typo=1>.
Main: 305-900-2001<tel:(305)%20900-2001> | Direct: 978.294.9429<tel:(978)%20294-9429>

wi...@dotcms.com | dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,gDG-wbh1pa0mbM_tCi_OmvExhmiWB0aucqFPXJ9onsUI74eq9VcXNRvYElMb3Zu8wj1dWY2ephbxy_1VcO1sS_0igNz0J_1j9EPc3R6tenmYyg,,&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.dotcms.com%2f&c=E,1,WkUgcY2S9FiJ8HFJNTP2E1sU7h7XOVyn4wI2xGp-NL41M0z-fGp-8qeAJwFANT6NUGFBslMVXvYkT7I7XZZ0XwvOeZs0aF45t4mC62jJAH6z9Oua&typo=1>

[https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fci6.googleusercontent.com%2fproxy%2fcmkOvj-Lmnc1m6I0I4JByU6E_tqmEgGg8eG-L2qMp1J37Kb_3dGsHgupQ8AFJiIDQcTSaASsKimZecPq9OvckCG7yYFVLipY8Lx0gAM_QZ-fNiRJa9vy%3ds0-d-e1-ft%23https%3a%2f%2forigin.ih.constantcontact.com%2ffs172%2f1109987089110%2fimg%2f11.png&c=E,1,cVr8KRfbScyMe88ukf1NIoG2XcV48uUWeeb6lLJElmhFfzgFeQZqBzERtnNFtkXQSH_g1cpKfRwkIHyTnMS3SfJdrPgxNhPuMkI6kG0TAaM,&typo=1]<https://twitter.com/dotcms> [https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fci3.googleusercontent.com%2fproxy%2fYUK5J6Z5acoGtktGsQpEFlUYRzYYwV-Ahk4l-P8v91F4lSntXcTs5ufL6v2WS_Jozl7n5VP8WaUN7XlfmKRfpv1siTBGOgAHfYnIASkil6cFkJ7rr0PL%3ds0-d-e1-ft%23https%3a%2f%2forigin.ih.constantcontact.com%2ffs172%2f1109987089110%2fimg%2f14.png&c=E,1,Oq3o7ZOKHChJ6xKZstQcvPnjuuk1PrJz_oZ1ey4w7G6MPunFtZ-9TYDU-BDtoalyROlSX7OaNk5wd-2IR4rgpiTOFk34obPjzY2wngOWKOBrW3Jjfw,,&typo=1] <http://www.linkedin.com/company/dotcms> [https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fci5.googleusercontent.com%2fproxy%2feG1MZ6nIkN1cgtm80hkWS9FS3sv95G3hZ231Mbd5w_MdUOoAyZc8RrY592Sv52YEbcts3Yd4JbFSRYbA-JLvh5dqggSRgefLQzHgLdoBaJwv5wOxmAza%3ds0-d-e1-ft%23https%3a%2f%2forigin.ih.constantcontact.com%2ffs172%2f1109987089110%2fimg%2f15.png&c=E,1,qNqYrzwQ9k0dqQ8KOSNxxtgBbJ5o2B2rGw25oPZqCBu5i39gVNkJ6bZjw5cEnQijdg7cdr_1u6rlE19cwwZ7gTjquv2v4CRzWV6X_QWoslM,&typo=1] <https://plus.google.com/+Dotcms> [https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fci6.googleusercontent.com%2fproxy%2f-Mo3gBU-3HQjvZWkduSazsWE0q2xmHIDrMV46crWeKixn16Ov0JCmDK_ch4hdHIQ3OIP3tEQFNd6ZizUPn4jK6E8w-3U9sNxLyFKFBg78SxlDQFJr-ht%3ds0-d-e1-ft%23https%3a%2f%2forigin.ih.constantcontact.com%2ffs172%2f1109987089110%2fimg%2f13.png&c=E,1,RLz38l19UxgZ4LIg0t1OFgD_1_LjsLryTpUityAqrDvdGUpAKeAulQF_ThkWMOslI0Bkx7qRTgE6dMYXwBZ8M4Xh4Qdzl-FN8wA0zuha_Cgef1-ENWPbxw,,&typo=1] <https://www.facebook.com/dotCMS>

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,zyLCLDYmGZAU9Zd58bv8amof9MlefCbfV4CeRLc6Y7e-qkzmnvTl-7II2YSNJdBLFWLurM_-qO-YbmJLFQLJerfYmCkqxJ6CoXl6_7tW2bkTrFPM2qRqJg,,&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,JX8YC2NWk78rkuOoTtjQzj2na-6LWHQHgXdz-4fon8cDqJ8xK3i3V5ksKKzatcu98YFVOCRGVlRg1glWWV-aga_xtUli2zPNTVkdh-qvI1gS4mE,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/55c6c29c-ed38-4342-864c-906415406365n%40googlegroups.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f55c6c29c-ed38-4342-864c-906415406365n%2540googlegroups.com&c=E,1,WI6D86_IhKbsQkmaZTkVWCxlpx5LZj5qy20Huh3x8wEzk1JxA_wvfJbkQMrYQ5j1WFTs8sIFUJ9Ow-sDJQrbezbPTlWr0RHXKXXpIgwYpnP50gsn&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f55c6c29c-ed38-4342-864c-906415406365n%2540googlegroups.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,_zS7gpiO2ia4yogCD86mC1VvF5Iek0urJzcLZVxlM51IIVMZXXa2tGrFLXSlsk7BOf6uz0dsTv6huSDpcms3SLkzsWgRsXLd7KK4iIy-HqiQBit1ibFCvTeI&typo=1>.

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,HNm8-9ThnP9IPaydol2dETz95UclnqfkkdXL012x3VZgu2A8QUceSlPX7jHrFjVSiBnb_93GXT77MylHFu-MHwqa4T8d_zOf7Yd91R2XIntHFA0,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/48d02e71-9726-4595-9c24-bc3abfd944e4n%40googlegroups.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f48d02e71-9726-4595-9c24-bc3abfd944e4n%2540googlegroups.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,T_gmg7gDEMZGIg2cRTM2AcVZdiBv9EymVmuoVf_vwu4f3bV_1TT-z91zw-w4E2otEJxeMVPC0IsO8pI58Q1ku8pX5IuSmPK92tzwttjL9D6dKJOj8lxl8lO1qWs,&typo=1>.

Mark Pitely

unread,
Mar 30, 2021, 2:31:42 PMMar 30
to dot...@googlegroups.com
I can attest that this works!

Here's the PHP code doing the push for an example.
I can give the velocity/js code too, if someone wants to see it:

<?PHP
header("Access-Control-Allow-Origin: *");
ini_set('display_errors',1);
error_reporting(E_ALL);

require_once 'vendor/autoload.php';
 //https://developers.google.com/identity/sign-in/web/backend-auth
//Instructions for the google vendor PHP code

$id_token=$_POST['idtoken'];
$dmid=$_POST['dmid'];
$rurl=$_POST['url'];

if (!$id_token) die("No token");


date_default_timezone_set('America/New_York');// major gotcha, HAVE to have this or everything fails.
$CLIENT_ID = '1073939996487-dqeldgj9g7gmho0jlh8io1pq3ci7lcm5.apps.googleusercontent.com';


$client = new Google_Client(['client_id' => $CLIENT_ID]);  // Specify the CLIENT_ID of the app that accesses the backend
$payload = $client->verifyIdToken($id_token);
if ($payload) {
  $userid = $payload['sub'];
    $domain = $payload['hd'];
    $image=$payload['picture'];
   $email=$payload['email'];
   
$email=str_replace('@maryu.','@', $email);
   
// If request specified a G Suite domain:
  //$domain = $payload['hd'];
   
 
   //Get the ERP data we want and send it along as well, so the authed process is completely independant
//NO PII
  $link=mssql_connect('REDACTED');  
   
if ($link===false) {
    die('MSSQL error: ' . mssql_get_last_message());
}
      $link=mssql_select_db('[coll18_production]');
   
    $query="Select * from M54_PORTAL_PEOPLE where EMPLOYEE_EMAIL like '{$email}';";
   
    $result = MSSQL_Query($query);
$output='';
if (!$result)  die('MSSQL error: ' . mssql_get_last_message());
$num_fields = mssql_num_fields($result);

for ($i = 0; $i < $num_fields; $i++) {
    $output.=mssql_field_name($result , $i);
    $output.='|';
}
     $output.='~';
while ($row = mssql_fetch_row($result)){
   for ($i = 0; $i < $num_fields; $i++) {
       $output.=$row[$i];
       $output.='|';    
     }
   }
  $output.= '~';    
       
   
   $url = "https://mint.marywood.edu/api/content/publish/1?indexPolicy=WAIT_FOR";//necessary to have the content immediately available.
   
   
    //googleauth field is probably not necessary - also needs to be a textbox rather than text for length.
$myarray= array("contentType"=>'MintAuthorized',
               "dmid"=>$dmid,
               "googleauth"=>$id_token,
               "url"=> $rurl,
                "email"=>$email,
                "content" =>$output,
                "image" =>$image
               );    
   
$myjson=json_encode($myarray);
       
   
$username="cu...@marywood.edu";
$password="REDACTED";
 
$ch = curl_init();
   
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");    
//curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));  
curl_setopt($ch, CURLOPT_POSTFIELDS, $myjson);    
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
$data = curl_exec($ch);


echo '-OK-';
 
   echo curl_error($ch);

 
 curl_close($ch);    
 //sleep(5);  
 
} else {
  // Invalid ID token
    echo 'Error';
}
?>





--
http://dotcms.com - Open Source Java Content Management

---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.

jonathan...@dotcms.com

unread,
Mar 30, 2021, 2:44:40 PMMar 30
to dotCMS User Group
Awesome, I am glad it worked for you

Just keep in mind that the WAIT_FOR will do the chekin slower, (DEFER) would be faster and recommend when you do not care about immediate results, but in your case totally make sense to use WAIT_FOR

Nathan Keiter

unread,
Mar 30, 2021, 2:47:10 PMMar 30
to dot...@googlegroups.com
What does FORCE do?

Nathan I. Keiter | Lead Network Applications Programmer | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993
https://www.gettysburg.edu<https://www.gettysburg.edu/>
________________________________
From: dot...@googlegroups.com <dot...@googlegroups.com> on behalf of jonathan...@dotcms.com <jonathan...@dotcms.com>
Sent: Tuesday, March 30, 2021 2:44 PM
To: dotCMS User Group
Subject: Re: [dotcms] Cookieless REST API timing issue

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
Awesome, I am glad it worked for you

Just keep in mind that the WAIT_FOR will do the chekin slower, (DEFER) would be faster and recommend when you do not care about immediate results, but in your case totally make sense to use WAIT_FOR

On Tuesday, March 30, 2021 at 12:31:42 PM UTC-6 Mark Pitely wrote:
I can attest that this works!

Here's the PHP code doing the push for an example.
I can give the velocity/js code too, if someone wants to see it:

<?PHP
header("Access-Control-Allow-Origin: *");
ini_set('display_errors',1);
error_reporting(E_ALL);

require_once 'vendor/autoload.php';
//https://developers.google.com/identity/sign-in/web/backend-auth
//Instructions for the google vendor PHP code

$id_token=$_POST['idtoken'];
$dmid=$_POST['dmid'];
$rurl=$_POST['url'];

if (!$id_token) die("No token");


date_default_timezone_set('America/New_York');// major gotcha, HAVE to have this or everything fails.
$CLIENT_ID = '1073939996487-dqeldgj9g7gmho0jlh8io1pq3ci7lcm5.apps.googleusercontent.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2f1073939996487-dqeldgj9g7gmho0jlh8io1pq3ci7lcm5.apps.googleusercontent.com&c=E,1,XCZYvyEBr0dXqAlk7pWqeEnJCuPt5zeDOTialY7elWIKoDKIIvyeRVFFv4NXSTtmgjehszgu02mcjC2lmWc4PwuihmMvuDq6Pli43lm9qz1i9xEYWonhPRNdHUI,&typo=1>';
$url = "https://mint.marywood.edu/api/content/publish/1?indexPolicy=WAIT_FOR<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fmint.marywood.edu%2fapi%2fcontent%2fpublish%2f1%3findexPolicy%3dWAIT_FOR&c=E,1,j1fq1H_zmS-S11VE7pK2J0SyiZlhMMXoRajPJTuPeCEWWxEWnQ29NAYXzh4orHTbK5LA_ftHK3odNkY3z27ca-b0eRJA8aMizY7l8MOuMqZAtg,,&typo=1>";//necessary to have the content immediately available.
Phone: 717.337.6993<tel:(717)%20337-6993>
https://www.gettysburg.edu<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu&c=E,1,DpiBPa4DhuYiaYGQxGJ6QmQ2lIl7HyCKwSdhwHk0S2IP5AUCPnJVx12bZlSmrqVLMeDCYEOFkmBtn4VgBEXd5tOePavbSk9Hru5VDJIrhPtsiTHA&typo=1><https://www.gettysburg.edu/<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu%2f&c=E,1,exX0ZD6CR4u2lCfLBX0y5CcH0534dq5b8ykODpFwXFhKuEiiewukRq7ssjIubvdJWb7zMWlPOkCZzFrgafU5c64OY6D857kwrDrm76XK&typo=1>>
Phone: 717.337.6993<tel:(717)%20337-6993><tel:(717)%20337-6993>
https://www.gettysburg.edu<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu&c=E,1,JoTBK95Yi8Qfdpp954ZUORGzH5OeSHPPjH-3GMvwxVnKAKpUef59xzTjCgrhncPgVagKYBmbZ1JbfR2SiJ_TwcmSOf6esLNnF3w1hr2iOse6PfBx&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu&c=E,1,cnensSfbswQ7k0xTmpC7dqDF-DVTruqB4aQw5v2wX3JEjMIpaVmG8zrINC6uu1rTxv-CDxMdSqAiHt86VAdzfTdziuz7rNNkifo50qJeWn0elzS58eVyKBLSKzh2&typo=1><https://www.gettysburg.edu/<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu%2f&c=E,1,N9Wfd1QfJEODuRBi0DVKWYm2a8bKkYzXRKwGW5PGvYB5pwDTuubArl2De5M1rxWS23vjGCJIBjHVjX957r9UXyQv16kWk69jX7vet9ySGw,,&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu%2f&c=E,1,S8o8F2wqIifGEJ8i_LTUtRv_H49b240PYg3K563Kg9dAFc_AKIS47fq6KpwK-5oFIDLJHBnBL4xzFDf_szYQDvUQRG95ZI_OEOkdq88LnGnGHdD2EXJSN5gGuO7l&typo=1>>
________________________________
From: dot...@googlegroups.com <dot...@googlegroups.com> on behalf of jonathan...@dotcms.com <jonathan...@dotcms.com>
Sent: Tuesday, March 30, 2021 12:59 PM
To: dotCMS User Group
Subject: Re: [dotcms] Cookieless REST API timing issue

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
As Will said, you can use index policy as WAIT_FOR.
It can be use on Rest API and also on Java API, by setting the public void setIndexPolicy(IndexPolicy.WAIT_FOR); before running a workflow or checkin

Thanks,
J

On Tuesday, March 30, 2021 at 10:06:50 AM UTC-6 Will Ezell wrote:
If you are on new code (Mark!) You should be able to pass an Index policy of WAIT_FOR or FORCE to wait until the content has been indexed before returing- see:

https://dotcms.com/docs/latest/rest-api-index-policy<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fdotcms.com%2fdocs%2flatest%2frest-api-index-policy&c=E,1,QOS6QPQhj1pV-mm6RFE855h4ziyFnqWJZGWaaJw4P1BDa9B3-gjpLTp80YSXwvbb5G6KSHtwhR4BEBPB3RjFvFhcPsMxD8uNiLXNM9hnyRFU&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fdotcms.com%2fdocs%2flatest%2frest-api-index-policy&c=E,1,GPloSlcnJw7m2Rlxwv79luMau-UQ1PqmnigGFpi3OvlrtGDCs0perm3djpEmenXE4zCWSjr4Q2WLmwY4JPD9RwJOV33Iwt8lDL4Tq4dS&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fdotcms.com%2fdocs%2flatest%2frest-api-index-policy&c=E,1,Q-j-ncphVCSMTgbCxR8Bb89v-rmfXbXoIy8ok8XNyjA72j_ER2UKOYpAVUNFXse83Gz3QhEsEEVMYZtNGoiMurcQsT8XZLtrQQfVPQbanJ0v-RagEyHFp-7uDpyF&typo=1>




On Tue, Mar 30, 2021 at 11:59 AM 'Nathan Keiter' via dotCMS User Group <dot...@googlegroups.com> wrote:
We've run into this in the past, and unfortunately it is "working as designed".


dotCMS uses an "available eventually" model for content. This means that any create or edit operation cannot be immediately followed by a load operation.


On the technical side, you are waiting for the index and cache to catch up, even though the database has already been written to.


In light of this, we've had to move business operations which require an immediate load operation after a create or update operation to a different system. I.e. don't save the data as content.


With dotCMS there's no promise that the thing you just created or edited will be available in time to fetch it. This is even true when using the Java APIs in a plugin.


The delay is often less than one second, but the Java code runs faster than that. You can try wait or sleep timers, but that will just slow your program down and is not always guaranteed to work. I've done extensive testing with this.


I've spent over a year on this issue and had many help desk tickets open. There's no solution.


My advice would be to save the data as something other than content if you need it immediately after saving. Don't waste your time trying to get this to work as content.


"available eventually" works well for website content, but it's a disaster for promise dependent business processes.

Nathan I. Keiter | Lead Network Applications Programmer | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993<tel:(717)%20337-6993><tel:(717)%20337-6993><tel:(717)%20337-6993>
https://www.gettysburg.edu<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu&c=E,1,DnFwYpRlDuY4SsWgewixbhzeecoGhuopbXQi-rr8B75Occru8JMyJN2TGmTZQO4R1pdP3E7xo4OvNyNQzqOSdV8Lz1XE5LCAQitZrLxCtw,,&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu&c=E,1,_XSP0lPoDzHNxab64ULHyYK9AJ4wfeeXvhZohdBbgyHgt3Ll3E0DRMAKC0neaS0obuaUeV3Ct6gMt7DCGOG_lN5PpYxzol6rgHJGtJn1ww,,&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu&c=E,1,VgQPHuVmdgJ_4ku4mUEg629pJP3FNutx6hicoxdWEbEvyYhIgok7OX-lyjlyIpEI5KUuK4Pz2bx3KMJbu8XiZkhP1vkSHTsGYRHIKEV7lQYi8kMTWvv2Amqu9g,,&typo=1><https://www.gettysburg.edu/<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu%2f&c=E,1,acJwzYKd5Qmnl9vElYeKweROKPMbVBgsCHDEmJ-O4B94dsQkQurytlurfHnM_ignq3MZbDkVye9Bc58AboBwHh6SmtDDrSrf3JfMHjoVWYJ5VP81&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu%2f&c=E,1,NwrFyypK7s_EM2GXVLD__hdOrVqincuCm1FBemHcs4G8H7Kx1OrdidpPGqu5r2n4PdncMQM0YI5FbvaU4B4WKLBa2yBd6jSM81diQR8VIb6N3uk-TfFH7ws,&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.gettysburg.edu%2f&c=E,1,OoIJSMmr_-ru6sXRNh1INoIClQVEXNWFoBLazoO0O_5xeARPJEXH4MBWoCrL_YT2TNwXCqkYqfGBXihXtmjVdNXajMwPlJCquAIA0Q0R0QtcQFgDXtfv-StK-bHt&typo=1>>
________________________________
From: dot...@googlegroups.com <dot...@googlegroups.com> on behalf of Mark Pitely <pit...@maryu.marywood.edu>
Sent: Tuesday, March 30, 2021 11:41 AM
To: dot...@googlegroups.com
Subject: [dotcms] Cookieless REST API timing issue

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
________________________________
I have code that uses the "Sign On with Google" authorization process (we are a gmail institution here, so extra useful for us) that is pushing the authentication into a structure.
So, whenever they log in via the google process, I get a piece of content with dmid,name, email, timestamp, googlepicture, page, etc. which I can then use, at the server level, to show them authorized content. These contentlets are nice for debugging. [dmid is the unique session id in dotcms, $visitor.dmid]

The issue I have is that despite waiting for the curl command to the REST API to complete successfully before returning and loading the content, it is *not* available in dotCMS immediately. My theory is that despite having an identifier and so on, it is still waiting on the workflow to truly 'publish' and there is a slight delay. If I sleep/wait for 3 seconds it seems to work okay, but I am worried that under load it might take longer. Is there a way within the REST calls to verify/delay/return only when completed? Can I just make a second curl command to 'view' the object created to do this?

Mark Pitely
Marywood University

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,jEPw68S5YDGi1BGLWaFKWra81Ncz3nfCEmJQSwt2aTRbBKlMTVACga1-4YDprxhyebVTr7lcv7BgWF5tyCcIgYQHpEdHskFOOZp6n9-c&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,5m2jIwt6YJBfKjEYgMIzldgHefMM56jLJRNL73AdkpqaTC09T5DUeQAwTxzYNYvchkIeAdx0JyduhbF4hsXL5qe2ME7xmP0qqF7DR6oafA,,&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,KEeiPiyyUZ8AX8XVelU2K-97-RGycIDvwl3kwUEaWSsdhlY1dibRtLZdU16KO46DlVdCE7MxL1wmSwMk4c2XOAsbC0FkUFOfDZzx-6ZTTom--M3NFsdKY4fIieQ,&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,FofOnmP-T-OtIMEracGNTkZNcfMIr97m5roHYasL50hs1Pn1EixnHHZ85uPD6UqtvlGHR51ZltflKjN85NXmAN8KSWoGgVEl_56n-2Kn-B1Fhbk,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAFeiKqOVRD-kncv%2BTGTf7p3Kub_7PfW-_Z1f%2BaWhHP%2Bwdh%3D0HQ%40mail.gmail.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAFeiKqOVRD-kncv%252BTGTf7p3Kub_7PfW-_Z1f%252BaWhHP%252Bwdh%253D0HQ%2540mail.gmail.com&c=E,1,DV5jn8xpirIWL0PQNx5HzeCtqXP01WKhWkIJWPvZq5gs3sMwynSHCJ7zvtD4dm6q2yT3OItoYuqZEUWy5kiVTQJ8e_kYWjzE_H6hVBnDe1aeb4IzvA,,&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAFeiKqOVRD-kncv%252BTGTf7p3Kub_7PfW-_Z1f%252BaWhHP%252Bwdh%253D0HQ%2540mail.gmail.com&c=E,1,uZz79K3PAtlT60B8s1yqSsYlPaxDf5WWpTrSgAGdaMxtSNFs9cXSuJWsHUnuvNHBx5_i2hH-B3faarg-iz0hba0oH6jaEFJQZhMIP_GdGw,,&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAFeiKqOVRD-kncv%252BTGTf7p3Kub_7PfW-_Z1f%252BaWhHP%252Bwdh%253D0HQ%2540mail.gmail.com&c=E,1,_YGi_qmMYNZkl_5kqbWKgD2Q5Zzor-pgfOpHKp-x-BBfI4w4miA3KaEq5oGkEdaakehF8AVkdVKk_oBEiqdzwmeNTBsMFUuSXPxbp311_Qng&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2fCAFeiKqOVRD-kncv%252BTGTf7p3Kub_7PfW-_Z1f%252BaWhHP%252Bwdh%253D0HQ%2540mail.gmail.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,2ze8zRdjEL0vMU8nWvbQTdlNp0yXzwHOhYc64dEu1257blvSQgEqTx3NWdp8dHzI3mlB-3GG4Ghdg5UMVZfTXByEqa0owvxUH0mnOINmoQ,,&typo=1>.

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,oSBnLU_022HzMSExAVZ7lQaBGiaDHOdjfSPJO571Zmt1v8XJxeVXmUi9GMBivZjyrsOIx5qmMWmmRBQvG_QdSNFxstxB26S7LEy7CvK5PB7R-qw,&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,_iFnvHtaSDeeOrFRYMCpdhQXpgfWh7xe4dJJJDaVk9DCtRbNePdok8b-5Ub68e03bejhar37qbduJbDLy6vTOkVxLQ2skqowyzK03bFn9Wihpw,,&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,hVsji_aD8ddaEjwtel19zOUkcxMwma6b_9SMo8B9LHSJf1JjG2Jx67f5HiR4ZjdUIr9zWwT07Q9V6VgZHuTMwZZzZTbPNn4CK9u_hqftG1X03Fs,&typo=1> - Open Source Java Content Management

---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/1617119978635.64272%40gettysburg.edu<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f1617119978635.64272%2540gettysburg.edu&c=E,1,cUVmlwoFNTzCK4RRqBr18E_JGM6ZESBO9WCR6ziGC9SHBVXvCCOcTK7bAVahoa4MBbEWzS3M_gLTi0FNaOG5ddu7Au9FpQCNSobQeq1WVz5doic8PT__&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f1617119978635.64272%2540gettysburg.edu&c=E,1,gX72WjUY6o9ac-9VkDbrPrOq0j53QYkgQVfNm_dy2xTlfTmNv6SosGJLhz9WSBbobzxw1DqANYkkHA9uXD0Tv1ByFy2Fr-7-biXCphXL_59vVwn1oxy71zawGg,,&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f1617119978635.64272%2540gettysburg.edu&c=E,1,vD5fQdEdaRvBVCYu8MH6uKiw97xYvxwTYYghfcDnw97KkZ6MQfheYG5KxSYm4o_O9LPaLUS3SI1JAie1KSh8uSCUuXkEol7tUArQ92M8QiCBlR3vIFMchCgDLA,,&typo=1>.
Main: 305-900-2001<tel:(305)%20900-2001><tel:(305)%20900-2001> | Direct: 978.294.9429<tel:(978)%20294-9429><tel:(978)%20294-9429>

wi...@dotcms.com | dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,a-GBBwxBN6g6wNNs9rD0GMoA-_Q-pJnhiq6rW_CF_Gw_CcoIlap2HMRwgLPKq2-XbnrAL0mJ7X1A_vDqmSsng0_j3LiBPoH3ukQw6RgUKnIC&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,gDG-wbh1pa0mbM_tCi_OmvExhmiWB0aucqFPXJ9onsUI74eq9VcXNRvYElMb3Zu8wj1dWY2ephbxy_1VcO1sS_0igNz0J_1j9EPc3R6tenmYyg,,&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.dotcms.com%2f&c=E,1,WkUgcY2S9FiJ8HFJNTP2E1sU7h7XOVyn4wI2xGp-NL41M0z-fGp-8qeAJwFANT6NUGFBslMVXvYkT7I7XZZ0XwvOeZs0aF45t4mC62jJAH6z9Oua&typo=1>

[https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fci6.googleusercontent.com%2fproxy%2fcmkOvj-Lmnc1m6I0I4JByU6E_tqmEgGg8eG-L2qMp1J37Kb_3dGsHgupQ8AFJiIDQcTSaASsKimZecPq9OvckCG7yYFVLipY8Lx0gAM_QZ-fNiRJa9vy%3ds0-d-e1-ft%23https%3a%2f%2forigin.ih.constantcontact.com%2ffs172%2f1109987089110%2fimg%2f11.png&c=E,1,cVr8KRfbScyMe88ukf1NIoG2XcV48uUWeeb6lLJElmhFfzgFeQZqBzERtnNFtkXQSH_g1cpKfRwkIHyTnMS3SfJdrPgxNhPuMkI6kG0TAaM,&typo=1]<https://twitter.com/dotcms> [https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fci3.googleusercontent.com%2fproxy%2fYUK5J6Z5acoGtktGsQpEFlUYRzYYwV-Ahk4l-P8v91F4lSntXcTs5ufL6v2WS_Jozl7n5VP8WaUN7XlfmKRfpv1siTBGOgAHfYnIASkil6cFkJ7rr0PL%3ds0-d-e1-ft%23https%3a%2f%2forigin.ih.constantcontact.com%2ffs172%2f1109987089110%2fimg%2f14.png&c=E,1,Oq3o7ZOKHChJ6xKZstQcvPnjuuk1PrJz_oZ1ey4w7G6MPunFtZ-9TYDU-BDtoalyROlSX7OaNk5wd-2IR4rgpiTOFk34obPjzY2wngOWKOBrW3Jjfw,,&typo=1] <http://www.linkedin.com/company/dotcms> [https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fci5.googleusercontent.com%2fproxy%2feG1MZ6nIkN1cgtm80hkWS9FS3sv95G3hZ231Mbd5w_MdUOoAyZc8RrY592Sv52YEbcts3Yd4JbFSRYbA-JLvh5dqggSRgefLQzHgLdoBaJwv5wOxmAza%3ds0-d-e1-ft%23https%3a%2f%2forigin.ih.constantcontact.com%2ffs172%2f1109987089110%2fimg%2f15.png&c=E,1,qNqYrzwQ9k0dqQ8KOSNxxtgBbJ5o2B2rGw25oPZqCBu5i39gVNkJ6bZjw5cEnQijdg7cdr_1u6rlE19cwwZ7gTjquv2v4CRzWV6X_QWoslM,&typo=1] <https://plus.google.com/+Dotcms> [https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fci6.googleusercontent.com%2fproxy%2f-Mo3gBU-3HQjvZWkduSazsWE0q2xmHIDrMV46crWeKixn16Ov0JCmDK_ch4hdHIQ3OIP3tEQFNd6ZizUPn4jK6E8w-3U9sNxLyFKFBg78SxlDQFJr-ht%3ds0-d-e1-ft%23https%3a%2f%2forigin.ih.constantcontact.com%2ffs172%2f1109987089110%2fimg%2f13.png&c=E,1,RLz38l19UxgZ4LIg0t1OFgD_1_LjsLryTpUityAqrDvdGUpAKeAulQF_ThkWMOslI0Bkx7qRTgE6dMYXwBZ8M4Xh4Qdzl-FN8wA0zuha_Cgef1-ENWPbxw,,&typo=1] <https://www.facebook.com/dotCMS>

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,F_D3sqgk1FvHMWmEZz2h__REGhbGny4W7G9HNsNN7qf7MefccZXbtzjdqI7kx87C4IBwHAYzNZuo-vvq9CrSdF77X9H1X8ke-vMoW8ABcVoIg6tct_vgcw,,&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,zyLCLDYmGZAU9Zd58bv8amof9MlefCbfV4CeRLc6Y7e-qkzmnvTl-7II2YSNJdBLFWLurM_-qO-YbmJLFQLJerfYmCkqxJ6CoXl6_7tW2bkTrFPM2qRqJg,,&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,JX8YC2NWk78rkuOoTtjQzj2na-6LWHQHgXdz-4fon8cDqJ8xK3i3V5ksKKzatcu98YFVOCRGVlRg1glWWV-aga_xtUli2zPNTVkdh-qvI1gS4mE,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/55c6c29c-ed38-4342-864c-906415406365n%40googlegroups.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f55c6c29c-ed38-4342-864c-906415406365n%2540googlegroups.com&c=E,1,IGfJKw4rLwbXBRY9tzs24rC-Vru3GTb7zysS80CDWpJjc_N9alwHTjDBMlm8h04NDLUCBxh9PF2jeTNbkjJtOkG2BEe5vFbkMav6MBKm5FnrstSxdyPtT44,&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f55c6c29c-ed38-4342-864c-906415406365n%2540googlegroups.com&c=E,1,WI6D86_IhKbsQkmaZTkVWCxlpx5LZj5qy20Huh3x8wEzk1JxA_wvfJbkQMrYQ5j1WFTs8sIFUJ9Ow-sDJQrbezbPTlWr0RHXKXXpIgwYpnP50gsn&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f55c6c29c-ed38-4342-864c-906415406365n%2540googlegroups.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,_zS7gpiO2ia4yogCD86mC1VvF5Iek0urJzcLZVxlM51IIVMZXXa2tGrFLXSlsk7BOf6uz0dsTv6huSDpcms3SLkzsWgRsXLd7KK4iIy-HqiQBit1ibFCvTeI&typo=1>.

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,k1DsvJRUtABtdLltgfMS5x6quRYXdKVq4SVntMyVbv6Sn62lj_dmeQ_XFiQY94qvJ1QSVLm__68DwvvSpgvxcJ1SJjOt8w5-7aD4NVfk2oEf_BCcCufh4a_1&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,HNm8-9ThnP9IPaydol2dETz95UclnqfkkdXL012x3VZgu2A8QUceSlPX7jHrFjVSiBnb_93GXT77MylHFu-MHwqa4T8d_zOf7Yd91R2XIntHFA0,&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/48d02e71-9726-4595-9c24-bc3abfd944e4n%40googlegroups.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f48d02e71-9726-4595-9c24-bc3abfd944e4n%2540googlegroups.com&c=E,1,aLiArD9E1Ydk1cpelWJrmu9WuypDa6qsjsKIDdUb2EpmbEwjpAs9CYrqntsu-pc_NtgENlowj8-Uilxea1KMgY8MxqKyQ9H8juKPoKXGAWkWqKuA9_65ImTi&typo=1><https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f48d02e71-9726-4595-9c24-bc3abfd944e4n%2540googlegroups.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,T_gmg7gDEMZGIg2cRTM2AcVZdiBv9EymVmuoVf_vwu4f3bV_1TT-z91zw-w4E2otEJxeMVPC0IsO8pI58Q1ku8pX5IuSmPK92tzwttjL9D6dKJOj8lxl8lO1qWs,&typo=1>.

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,eMo4Xtc40q4clS7gckdpNU-sZ9G-tTrDb3SIvCRK1rFxccyN_dhcnAMlCrYDIiipZ_3GrD_jlYoxD5kwgS3Bp9vlVSTVhQAd4-RDJfDtFg3dxkQ,&typo=1> - Open Source Java Content Management

---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/1617128133790.36812%40gettysburg.edu<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2f1617128133790.36812%2540gettysburg.edu&c=E,1,h70Hr3l3GWWfU8LCf3U-W1dqto1Ay1NX6iLYf1-utLCUVlf1wiBikyqCVbVxhAbMHHz8gQ9FxFlO1F87Pn7KzJ5FzqYN2wStysuuQQB_&typo=1>.

--
http://dotcms.com<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fdotcms.com&c=E,1,sSf8L-LihDMjPKm12z5qOtP3mNAJQF5CSMuvMghG25n0dg09wejWaWecBoJqvHsfy1o9yZ14srDE4mBgu-TDS1LJqst84SJfkyBBacihPhgFEOL3uyhhsWot&typo=1> - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com<mailto:dotcms+un...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/aca3d9bc-c8ef-443c-b8ee-a5333df945ebn%40googlegroups.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2fdotcms%2faca3d9bc-c8ef-443c-b8ee-a5333df945ebn%2540googlegroups.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,f_t_7vK-qElwM6Ow8GzpX6gMXCM8lREyYJTj0L5qaRT2kwueD1tCmeHQCb5LtTkDSJCFf0AabpRE_LNNSvfF13p9Xf9jZiqeU9Q8D_Ol8fjOaeuhUO6DQayuuw,,&typo=1>.

Mark Pitely

unread,
Mar 30, 2021, 2:48:43 PMMar 30
to dot...@googlegroups.com

Force:
Forces Elasticsearch to index the content immediately.
Important: Using this value may cause system performance issues, and should only be used for testing purposes.

Dunno if you need more information than that.
M

--
http://dotcms.com - Open Source Java Content Management

---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.

jonathan...@dotcms.com

unread,
Mar 30, 2021, 2:55:24 PMMar 30
to dotCMS User Group
Force is not a scalable Policy, it is mostly for unit testing where the time and performance at less relevant.
Do not use it on Production, at least it is the Elastic Search advise.

Reply all
Reply to author
Forward
0 new messages