Monday, January 24, 2011

Changing the maximum lengths of core metadata fields in Content Server

This has came up in almost every UCM engagement we undertook in the last several years... And chances are - you might be scratching your head about it too... or you’ve given your business folks one of these "No can do" responses, that are so effective for draining their confidence in both - Oracle UCM and you personally.

So, without any further introduction - here's the trick that will help you make these core fields, such content title, security role, account and many other standard metadata fields - longer - to accommodate your business model and your requirements.... and re-gain that confidence and even score some points :)

This will also resolve the archive import issues such as "Content item was not successfully checked in. The Title may not exceed 80 characters" ... or AD/LDAP integration issues - when the roles or accounts you're getting from your LDAP provider are longer then 35 characters, the maximum length of the Role and Account fields.

And the answer is simply this: connect to your database with administrative privileges and alter the lengths of the Title, Role, Account or another standard metadata filed you need to be longer then it is. You'll need to restart the Content Server for the changes to take effect.

For instance, to change the maximum length of Content Server Security Role, you'll need to alter RoleDefinition table and change the length of the dRoleName field.

If Oracle is your database - use the following SQL statement: 

DEV_OCS.RoleDefinition modify (dDocTitle varchar(255) not null)

Where DEV_OCS is your Content Server schema name.... I'm, sure you've got the idea...

The Title field is referenced in Revisions, ArchiveHistory, WorkflowHistory and ProblemReports.

To be on a safe side and make sure you haven't missed a table or two, generate SQL (DDL) for all of the Content Server tables and search this file for your field - for instance, dDocTitle, dRoleName or dDocAccount.

Just one note of caution. Changing the length of content type, security group or account may affect performance! Proceed with caution.

4 comments:

  1. Extending might not be the problem, but how about limiting ?
    If the field is varchar2(500) and you want to limit the field in the check-in form to let's say 200 (special characters can get close to 500 bytes even with only 200 characters!), then how can you limit the user field lenght ?
    I tried the xFieldName.maxLenght=200 on a 11g UCM and it had no effect. It even got beyond the varchar (which then causes the Oracle exception)

    ReplyDelete
  2. There're many ways... The simplest is to use Content Server rules for validation. That will generate JS popups when your condition fails just before the user attempts to submit metadata update or new checkin.

    The more advanced option is to create a custom check in page. This one allows you to use ajax - based validation, server side or anything else that your business folks ask for.

    Hope that helps!

    ReplyDelete
  3. Hi,

    UCM stores all custom metadata fields in a single table. How to design system when one need to capture say 10 different fields for 10 different content types. Adding 100 custom metadata fields can not be solution?

    ReplyDelete
  4. If you add a hundreed fields, that would be a bad design, not a shortcoming of the system. You can simply re-use the same 10 fields. Now you'll use your profiles and rules to have the fields display correct names based on your particular check in scenario.

    I'm happy to help you set this up - simply contact me by email and I'll be happy to assist.

    ReplyDelete