Orchard CMS: How to understand when content item version is actually published? - orchardcms

I need to notify client if new content item version was published. Orchard sends request to client with published content item id, and after that client performs request back to Orchard for this content item data.
I made it by following workflow:
Web request just sends call with content item id.
I found, that sometimes client receives previous published content item version.
Looks like new published content item version can be accessible only after workflow completely executed.
(Thread.Sleep(1000); in client code resolved this problem). System Cache and Output cache modules are disabled.
Is there some way to understand when content item version is published and actually available from frontend?

When I make custom content parts that have an Orchard.OrchardManagement.ContentItem, using the method of HasPublished(); seems to work.
bool i = part.ContentItem.HasPublished();

Related

StorefrontRenderEvent::class event

StorefrontRenderEvent::class event in Shopware 6.2. this event is working only once. then it is not working. I think the event is cached by Shopware.
What I can do?
I want to get the customer id, sales channel context, and need to pass some params to view page. Are there any events available for this without caching?
Shopware uses Full Page Http Cache. You should consider using Ajax for dynamic things

How to submit for content approval/ approve content in sharpepoint using graph api

I currently have bunch of files stored in Sharepoint.
I've set the versioning so - that everytime user uploads a file it's set as draft and versions are set as 0.1, 0.2. Once the content is approved my version then gets updated to major version ex 1.0
I want to perform content approval process/ and also request approval all via sharepoint graph api.
I don't see any resources or endpoint to do the following.
I'm using this as of now: https://learn.microsoft.com/en-us/graph/api/listitem-list-versions?view=graph-rest-1.0&tabs=http
As far as I know, the graph api cannot update SharePoint content approval yet. Every time the content approval value is updated, the system will automatically create a new version, approved status back to pending again.
You could have a try: https://learn.microsoft.com/en-us/graph/api/listitem-update?view=graph-rest-1.0&tabs=http
Similar issue: https://social.msdn.microsoft.com/Forums/office/en-US/a63b8952-1e0c-4f3b-917b-fcffa8bd9560/content-approval-using-graph-api-for-sharepoint?forum=appsforsharepoint

Creating form data via rest doesn't trigger autoresponder

Kentico 10. When I make a rest request to post data to the kentico form module I get a successful http 201 back and I can see the data created in the kentico interface. This particular form I am posting data to has an autoresponder set up.
I have a default smtp server set up and can successfully email out through it, which leads me to believe that the autoresponder on the form does not get triggered when data is created in the kentico form via rest. I never see the autoresponder attempt to send an email in either the email queue module or the event viewer (with the proper web.config key set).
Is that the intended behavior, to not trigger the autoresponder when forms module data is created via a rest request? If so, any idea how to get it to trigger?
Yes you are correct. Kentico REST is meant to perform simple CRUD operations. Essentially what you doing is the same as if you do it inside the admin i.e. go inside admin -> forms -> your form name -> recorded data and add new record. It doesn't trigger anything like sending email or Redirect to URL etc.
What you can do if you want to send email using form global events and on insert send email yourself. Here is the example of using global events

Dynamic Meta Description

I have a page which populates meta keywords and meta description dynamically for a bunch of products. Now that I think back on it, can search engines even see that meta data when they crawl since it isn't even rendered on the page until runtime? Does meta need to be hard-coded to allow search engines to see it?
When the search engine analyses the page, it just requests it like anyone else would. "Runtime" in a CF sense occurs before the page is served:
The user agent (be that a browser or a search engine crawler) sends a request to the web server
The web server passes it to CF
CF renders request and creates the HTML doc (incl. all your metadata)
CF passes it back to the web server
The web server sends the response sent back to user agent
So, yes, it sees your metadata.

Zabbix web scenarios - how to include the content of the web response in notifications?

I have notifications coming back from web scenarios that say "PROBLEM' and "OK". I would like to include the content of the web response when a problem happens. I'm not worrying about header values, just the content of the web page. Is this a variable I can reference in the Notification setup?
Unfortunately zabbix doesn't store that data (the database would get rather huge). One thing you could do is add a media type script, which you send your alert to (instead of standard email). Then in that script you could parse the item that is triggering and do a separate curl on the webpage. Ugly and error-prone, but as good as it gets for now.

Resources