How do I change/update the page status while still calling SaveAction.ForceCurrentVersion?


How do I change/update the page status while still calling SaveAction.ForceCurrentVersion? Every test I've run so far does not change the page status. For example, if I make the following call when the current page status is "Rejected" or "CheckedIn", the page status does not change from "Rejected". I know I could not use SaveAction.ForceCurrentVersion, but I want to be able to track the progress of this specific page. I also do not wish to create unneccesarry versions. Calling Save with an action of SaveAction.Save should move the status to "CheckedOut".

repository.Save(content: epiWhitePage, action: SaveAction.Save | SaveAction.ForceCurrentVersion, access: EPiServer.Security.AccessLevel.NoAccess);

Feb 27, 2014 19:56

What if you check the content.Status and determine which of the save states you should use according to the enum values?

Feb 27, 2014 20:04

In my case that will not work. The frontend I'm writing will allow someone to make multiple changes. For example, they could make a draft copy (CheckedOut) and save it. Then come back later and make changes and submit for approval (CheckedIn). If the approver rejects the changes (Rejected), I need to be able to have the user go back in and check out the document again. As it stand, EPiServer is only letting us change the status of a ForceCurrentVersion document from CheckedOut to ChecekedIn to Rejected. Once it's CheckedIn or Rejected, it will not let us go back to to CheckedOut.

Feb 27, 2014 20:31

Do you need the actual states in EPiServer or is it only for the user and your UI that the states are used?

Otherwise why not keep a separate state where you can keep your own life cycle / work flow?

Feb 28, 2014 0:04

Keeping my own page status really wont help. The goal is to not have to create a new version of the page while changing the ContentVersion status.

Edited, Feb 28, 2014 1:45

I've been doing some more testing and my results are in the table below. Does anyone know if EPiServer has any documentation on changes statuses from one to another using the Common Draft (LoadCommonDraft)?

To (accross)

From (down

CheckedOut CheckedIn Published Rejected
CheckedOut Yes Yes Yes Not Allowed
CheckedIn * Yes Yes Yes
Published * * Yes Not Allowed
Rejected Not Allowed * * Yes

Yes = Can chnage the status while keeping the same version (SaveAction.ForceCurrentVersion)

* = Requires that a new page version be created and set to the common draft (SetCommonDraft)

Mar 03, 2014 15:34
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.