Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

How do a bind a value to a specific page version?

Vote:
 

I have a piece of information I need to store on a specific page version, not necessarily a page.

My client has a set of several thousand highly-regulated procedures, managed in EPiServer. These procedures are updated several at a time, in batches.  So, "Batch X" would represent the updating of several dozen procedures at one time.  All changes in Batch X would be reviewed as a group.

When my client updates a procedure, they create a new version of the page.  They need some way to specify that a particular version of a page is in a particular batch.

I figured I could store this with the page data as a property, but it gets a little complicated.  Consider:

  1. My client has a published version of a procedure.  This is Version #1.
  2. My client edits that procedure, and enters a batch number (413, let's say) and declares it "Ready to Publish."  They have created Version #2.
  3. Later, they need to make another change, so they re-edit, creating Version #3.  The "413" number will carry over from Version #2 to Version #3.  Howevr, this isn't accurate -- Version #2 is no longer in Batch 413.  Version #3 is the only version that should be in Batch #413.  The designation of being in Batch 413 now needs to be removed from Version #2.

You see where this gets weird?  The value isn't meant for the page itself, it's meant for the the specifc page version.

Now, I could go back to Version #2 and clear the batch number from that...or could I?  If I save Version #2, I think that would create Version #4.

I thought about storing this in DDS.  I would have tri-valued object -- Batch Number, Page ID, and Work ID.  However, I don't want to have to build a special interface for it.  I'd rather editors worked with this purely in Edit Mode.

One option: create the Batch Number as a property, then catch the PageSaving event.  Read it out, update DDS, then clear the value.  (I might have to do PagePublished, to get the Work ID, though.  If so, I could go back and clear the property then save and ForceCurrentVersion.)

Any ideas on how to tackle this?

#55187
Nov 21, 2011 23:53
Vote:
 

So everytime you publish (not save) you need to update the batch number? Is this something the editors need to see and manually update or should the system take care of it behind the scenes?

Frederik

#55214
Nov 22, 2011 19:51
Vote:
 

The batch number is non-derivable. It will need to be manually added by the editor.

I think the logic should work like this --

Say someone has Version #1 with a Batch Number of 413.  If they edit that page and create Version #2 and do not change the Batch Number (it remains 413), then that Batch Number needs to be removed from Version #1 -- so it would transfer, effectively, to Version #2.  But if they enter a new Batch Number for Version #2 (414, let's say), then that's fine -- 413 can stay on Version #1.

Put another way -- Batch Numbers need to be unique between versions.  No two versions of a page can carry the same Batch Number.

#55215
Edited, Nov 22, 2011 19:55
Vote:
 

So a page version can either have a unique batch id or none at all? Maybe hook into the save/publish event (using workflows or initializable module etc), store the pagereference (page id + work id) in DDS together with the batch id, then you have a property on the page that reads this data from DDS and displays the correct batch id for that version. You can also easily add logic for checking that the batch id is unique and update existing references.

Frederik

#55216
Nov 22, 2011 20:17
* 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.