User friendly error messages

Hello,

In our implementation, we have 6 content types and Authors are allowed to create only 4 of the 6 content type items. But they can transition items of all the 6 types. When creating new items, the menu entry displays all the 6 content types. If an author accidently clicks on the 2 types he/she is not authorized to create content for we see the following error


  <?xml version="1.0" encoding="utf-8" ?> 
- <PSXLogErrorSet class="Request preprocessing" host="hpsrfhdev" port="9992" protocol="http" root="/Rhythmyx" rxroot="http://hpsrfhdev:9992/Rhythmyx">
  <Error id="0">An error occurred while pre-processing the request submitted by the host (-not available-).</Error> 
  <Error id="1">An exception occurred while processing the "Java/global/percussion/workflow/sys_wfAuthenticateUser" extension: com.percussion.security.PSAuthorizationException: User is not authorized to create this type of content..</Error> 
  </PSXLogErrorSet>

I want to able to convert this into a readable error message for the end users.

I tried another way out so as to avoid getting the error in the first place:
Hiding the 2 types for authors by creating 2 different communities to control visibility but that lead to another problem of authors not being able transitions the items as they are created in a different community to which the Authors are not assigned.

How do I go about resolving this issue?

OK, firstly a warning - you should not go about modifying system applications in Percussion CMS - or at least if you do make sure you do lots of backups, know what you’re doing, and be prepared for the unexpected (and for any changes to be overwritten during an upgrade).

Now, onto my thoughts…

The “Content->New” menu comes (at least in 6.5.2) from the workbench XML resource sys_cxSupport/newcontentmenu. Within here you could do something clever to modify the SQL, or do some post-processing of the XML that is produced by this resource.

I did some work on this once before for a customer (and regular contributor on this forum) which I believe works find and is (hopefully) still being used.

Another option would be to customise the error message output. There’s an XSL stylesheet (somewhere) that formats the error pages, and you could do some work to customise that. Perhaps looking for the string “User is not authorized to create this type of content” and displaying a more friendly error message.

Thanks for responding. I agree with you that it is not a good idea to modify system applications. I dont want to go that path either for now.

So I believe there should be a solution to the xml error - to be able to have custom display…

How do I create/display such custom error messages instead of the XML error ?

I tried to find the XSL stylesheet. But I believe the error message comes from some other place… Looks like it is generated by one of the java util class.

The system is checking for authentication - which is right, and throws error.
Where is the required stylesheet to be placed in the tree for defaulterror.dtd to pick it up…