In one of my Postprocessor extensions, I am trying to copy the value from sys_title field to another field called: url. I have the following piece of code:
It’s not clear to me what you’re really trying to do here. If you are trying to copy a field on INPUT (that is, the user has inserted or edited the item, and you want the URL field to have the same contents as the sys_title field).
In this case, use the PSCopyParameter extension as a “Pre-Processor” extension, not a post-processor extension.
As you have seen from your “experiments”, adding parameters in a Post Processor extension has no effect on the contents of the field.
If this is not what you are trying to do, please describe your usage scenario in some more detail.
Yes…you are right once I changed the type to Pre processor it worked out fine. When does the Post processor extension gets executed? Is it after we press the Update/ Insert button on Content Item window?
Also is there any rule of thumb when we should pre processor and when post processor extensions?
Yes, post-processors are run when you submit the Content Item to the Repository. (Pre-processors are run when the Content Item is retrieved from the Repository.) For a graphical representation of this processing, in the Rhythmyx Technical Reference (Version 6.6 link), see the topic “Content Processing”.
The situation is actually a bit more complicated than Bob describes…
Pre-processors run whenever the user makes a request of the server. The pre-processor can change the parameters and/or add new ones
Post-processors run after the server generates its internal XML document, before transforming them into the resulting HTML form. Post-processors are usually used to modify the XML document to add new information.
This means that both types of extensions run on EVERY request, but at different points in the request/response cycle.
I believe in that case most of our extensions will fit in the preprocessor category. Can you pl. give some examples of scenarios which might require a Post Processor extension.
I am having a hard time to visualize what could ever qualify for Post processor as you described as: "Post-processors run after the server generates its internal XML document, before transforming them into the resulting HTML form. Post-processors are usually used to modify the XML document to add new information. "
We have a customer who wanted different workflow choices in each community (for the same content type). We built a post-processor extension that looks up the community (in a table) and sets the workflow choices according to the contents of the table.
These things are much less common than “pre-processor” extensions.
I recently dealt with a customer who had questions about the order of Pre- and Post-processing as well as Item Validation, and I was informed of this thread. I would like to post my findings, as some of the data provided here is no longer accurate.
I just spoke with one of our Developers and he has given me the exact order of the actions. The order is the same whether you are saving a new item or saving an existing item (the only difference in whether the data is overwritten or created). Upon creating a new item, nothing occurs until you try to save it.
Saving:
Item-level Input Transforms
Field-level Input Transforms
Field-level Validation
Item-level Pre-Processing
Data is saved at this point
Post-Processing of Extensions
Loading:
Pre-Processing of Extensions
Data is loaded
Post-Processing of Extensions
Item-level Output Transforms
Field-level Output Transforms
Note that there is no validation run upon Load.
Workflow Transitions:
Item-level Validation
Pre-Processing of Extensions
The Transition occurs at this point
Post-processing of Extensions
Check-in/Check-out:
Pre-Processing of Extensions
The Check-In/Out occurs at this point
Post-processing of Extensions
Please note that our documentation, as of this writing, has a minor error stating that Item Validation is run during Check-In and Check-Out actions. This is inaccurate as of this writing. I have brought this to the attention of our Documentation Team.