Here’s a brief guide on creating your own custom attribute types for Open Text Content Server (Livelink). If you know OScript this will be a breeze, but hopefully I’ve been succinct enough for it to serve as a useful memory jogger. I should say this is based on 9.7.1 but CS10 will give you the same. We’ll just create a new text attribute type which you can extend for your needs.
Assuming you have a new custom module you first need to orphan in the 2 main objects you will be using. Like Livelink objects with their LLNodes and WebNodes, there are two aspects to an Attribute – LLAttribute and WebAttribute. The former is implementing the attribute’s logic, the latter is its UI. Unlike nodes, the UI has 2 modes – the definition UI and the runtime UI.
So first, orphan LLIAPI:LLIAPI Root:LLAttribute into your module and call it MyModule LLAttributes
Orphan WebAttribute:WebAttribute Root:WebAttribute into your module and call it MyModule WebAttributes
Register a new Attribute Type ID with Open Text on their Knowledge Centre or risk just grabbing one of your own – if you ever install a 3rd party or Open Text module which uses the same ID you have a serious conflict problem.
Lets do the LLAttribute first …
If you look in the Documentation object for the LLAttribute there are a bunch of features you need to set. I find it easiest to add a setup script to populate all of these.
Create a new Child of your LLAttribute called, say, TextCustom
Add a new script called 0 setup
Populate the script as follows:
.fContainer = FALSE
.fDataType = $TypeString \\ storage type
.fDefaultShowInSearch = TRUE \\ up to you
.fEnabled = TRUE \\ ofc
.fInRootSetOnly = FALSE \\ if you want to use the attribute in Sets
.fName = "Text: Custom Text Attr"
.fSearchable = TRUE \\ if you want
.fSearchDisplayType = 0 \\ see Documentation object
.fType = 99999 \\ the unique ID you got from Open Text
.fUseRequired = TRUE // if this attribute uses the 'required' value during input
.fUseRows = TRUE // for Multi-Value Attributes
.fUseShowInSearch = TRUE // if the attribute uses the show in search option when editing
Now run it to populate the features.
So now we have a new LLAttribute. What about the UI? Create a new Child of your WebAttribute called the same as your LLAttribute (for sanity). This time there is already a WebAttribute 0 setup, but it needs filling in and a few more features added.
.fEnabled = TRUE
.fType = 99999 // like your LLAttribute
.fAttrCreateHTML = ''
.fAttrEditHTML = 'attreditstringcustom.html'
.fAttrPainterHTML = ''
.fAttrRunTimeHTML = 'attrstringcustom.html'
.fLabelValignTop = FALSE
// you can specify additional definition fields here, but that's for another post
.fPrototypeSubclassAttrCreate = { }
.fPrototypeSubclassAttrCreate2 = { $WebDsp.kCheckPost }
.fPrototypeSubclassAttrEdit = { }
.fPrototypeSubclassAttrEdit2 = { $WebDsp.kCheckPost }
At a minimum add the following to GetValueFromRequest to get the values from the attribute when it is submitted. Of course, depending on what it’s for, you may want to add all sorts of server-side validation or processing.
if IsFeature( request, fieldName )
value = request.( fieldName )
if Length( value ) == 0
value = UNDEFINED
end
end
We’re nearly there. Now you need the weblingo in place to create your attribute and to use it. I would suggest copying the attreditstring.html and attrstring.html from the Web Attribute module’s /html folder. Name them as set in your fAttrEditHTML and fAttrRunTimeHTML. Edit these 2 files to your heart’s content to give the UI you want. If you want the Runtime one to behave differently while in “Painter” mode (rather than use fAttrPainterHTML) you can always put conditional logic around if ( request.Painter )
Finally, you need to tell the system where this new attribute can be used. In the Startup script for your module add:
$lliapi.LLAttributeSubsystem.AssociateTypesByCustomID ( 0, { $AttrTypeTextCustom } )
0 = Categories
2 = Workflows
3 = Forms
This is done from memory and looking at a vanilla Builder. Expect tweaks and clarity. Feedback welcome to make the article better or to fix broken bits
You will get credit and links back … Greg!


