Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Versioned Documents View modes: 
User avatar
Certified Developer 11
Certified Developer 11
dfahy@ecentricarts.com - 11/6/2012 11:58:42 AM
   
Versioned Documents
Hi,

I have set up Versioning without workflow in my site. I have a doc type that allows the user to set publish from and publish to dates. when these dates are set I can see in the database that the DocumentPublishFrom and DocumentPublishTo fields in the CMS_Document table are null but that the PublishFrom and PublishTo fields of the CMS_VersionHistory are set to the entered values. I assume this is expected behaviour?

I want to use the API to only select documents that are set to be published now i.e. where DateTime.Now is between the publish dates. I tried passing selectOnlyPublished = true to the DocumentHelper.GetDocuments method but this returns documents that have both the publish from and publish to dates set to the future.

I thin tried to pass a wherecondition to this method. I even set the wherecondition to just 'DocumentPublishFrom IS NULL but the method still returns documents that have publish dates set (the publish dates are set in the CMS_VersionHistory but NULL in the CMS_Document).

Am I misunderstanding how versioning works? How can I query documents that have their publish dates set in the CMS_VersionHistory table?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/8/2012 2:46:26 AM
   
RE:Versioned Documents
Hi,

Regrettably this seems to be a bug. I am in touch with our developers - I will keep you updated.

Best regards,
Juraj Ondrus

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/23/2012 5:14:40 AM
   
RE:Versioned Documents
Hi,

I am sorry for the delay. The developer I assigned the bug was out of office last week - my fault, I should have checked it.

It is a bug at the end and it will be fixed in next week's hotfix, 7.0.10.
We are sorry for these inconveniences.

Best regards,
Juraj Ondrus

User avatar
Member
Member
support-rocksolid.com - 1/22/2014 3:39:24 AM
   
RE:Versioned Documents
I'm using version 7.0.58 and I believe I'm having this issue.

I can see that the DocumentPublishFrom date is coming through null when I try to save this.

When I look at the CMS_Document table, the value is null. If I manually update this like so (see below), then I can see the filter (more or less what was described above) working.

update CMS_Document
set DocumentPublishFrom = '2014-01-01'
where DocumentID = 782

The odd thing is I can see the new value when I look at the page under the CMS desk, but when I look at this same document in the CMS_Documents table it still shows the old date. I have of course published the document.

User avatar
Member
Member
support-rocksolid.com - 1/22/2014 7:14:47 AM
   
RE:Versioned Documents
After a bit of research I suspect that the problem I'm having is described here:

http://devnet.kentico.com/Knowledge-Base/Content-Management/Difference-between-content-scheduling-and-workflow.aspx

I don't really want to have to archive the document every single time to get it out of the current publishing life-cycle, since I'm using a publish cycle which requires approval from multiple users and this is definitely going to create confusion/headaches.

Is there a flag somewhere in Kentico which allows the DocumentPublishFrom/DocumentPublishedTo fields to override the 'Published' status of the document so that it doesn't end up in this weird branched state?

Alternately, is there a way to get the latest DocumentPublishFrom value with a query (i.e. the value that shows up under the CMS desk) when the document is published?

As a general comments on usability:

a) I don't really understand why Kentico needs to work this way. Modifying the DocumentPublishFrom should modify the current published state of the document - not create a branch. I assume there is some feature that depends on it working the way it does, otherwise it should be changed as this is really annoying.

b) even if it has to work this way, showing the new value for the DocumentPublishFrom value is confusing to the end user. At the very least there needs to be some sort of visual indication of this next to the field. I believe this is shown by showing half of the status circle in green and red/orange, but this could be a lot clearer.

User avatar
Certified Developer 13
Certified Developer 13
kentico_josefd - 1/22/2014 10:10:01 AM
   
RE:Versioned Documents
Hi,

Since Rocksolid has valid maintenance contract, we have been in contact via email. Here is the explanation of this behaviour, should anyone else encounter the same problem.


It works like this in order to allow you to create and pre-approve new version of a document, which will be published and replace currently published version of the document at specific time. For example, if you have a new information which has to be published at your home page, but not before given time, this allows you to create new document in advance, approve it, and have it automatically published at midnight of given day, without forcing you to un-publish current version first (effectively disabling your website). Also, setting up deadlines like this comes in handy when synchronizing content updates across multiple documents which need to be rolled out at the same time.

In order to explicitly take down any existing document and have it re-published in future, you need to archive it first and resubmit it as new version with desired publish from date. And if you need to have content changes published immediately after approval, do not set any publish from date at all.

As for your other question, all versions of a document under workflow are stored in table CMS_VersionHistory, you can query against this table using its DocumentID. Also, you can view which version of document is currently published and its publish from/to dates in the its Properties -> Versions.

You are right; the circle next to each document shows statuses of the live version and if it has any to-be-published versions.

Regards,
Josef