Hello
Please could you let me know if anyone has tried to validate attributes in Content Server, like attribute type, attribute length and other conditions?
@RandhirAtos
You ask if anyone has done this before sure lots of us have:)
If you are doing this in CSIDE(OSCRIPT) if you look at the code that prints ?func=attributes.dump you will see how that is output. In Oscript the CategoryData is a frame that can be parsed easily. Plenty of parsing examples exist in old Oscript documentation and in the old developer forums if you have access see the link
Most Oscripters are supposed to understand this https://knowledge.opentext.com/knowledge/llisapi.dll?func=ll&objId=3499033&objAction=View&viewType=1
https://knowledge.opentext.com/knowledge/llisapi.dll?func=ll&objId=3499041&objAction=View&viewType=1
If you are new to Oscript when you access a Category in its volume what we call the definition you will get the DataStructure, suppose you find an existing node like a document that has a Category, you will ask NodeCategoriesGet and it will provide the same, if you want to add or subtract categories you do that and finally called the DBPut which commits database(inside the database the llattrdatablob table is updated and then llattrdata). This is is one reason why OT says don't tamper llattrdata because the blobdata table is responsible for data integrity and the llattrdata table is an easy-to-report table structure.
If you are a Java or .NET programmer the same info is given to you via the WSDL it is called AttributeGroups so if there were three categories that List will be 3, if you go into it you will see discernible information. there though but the concept is the same. If you use SOAPUI and look at the output you can see it. You will see me parsing using SOAP Response here https://appukili.wordpress.com/2017/06/01/metadata-for-the-brave/
REST is not very conducive to knowing the definition, it relies on a Node having the Category I think that is how OT wants it done perhaps in the future when SOAP goes away they will backport it:)
#AOTDCSIDE1D
Thanks @Appu Nair , but the requirement is that when we upload a document to OTCS, while we provide the values for the category attributes then a validation should happen at that time or when we submit, this validation should be able to see if the min length and max length are met, also if a required pattern is then it should check that too( like attribute should start with 00 and max/min length should be 10)
I could find a KB article: https://knowledge.opentext.com/knowledge/llisapi.dll/kcs/kbarticle/view/KB18209100
Content Server - Validating Workflow Attribute values when entered by a user.
Not sure if there are any alternative solutions
Simply:Use REST forms api or (alternativly) the old fashioned oscript described in
I forgot to add using Oscript you can add your own Attribute that is how OT created Table Key and ADN. The example project OT gives you to study is an implementation of an SSN in the US so it will be nn-nnn-nnn but that all are at least 15 years old before SUI took over, SUI is a very rigid framework that requires you to unlearn old classic javascript. Many learned OT friends use the SUI framework to load other JS frameworks that are more industry-standard, almost like using OT's SUI as a launch point. If you ask around you will see blogs from Christopher Meyer https://schwiiz.org/ Mathew Barben https://www.linkedin.com/in/mbarben/ Pierre Nocera https://www.linkedin.com/in/pnocera/ these are a few stalwarts who do pioneering work in these areas. They are highly trained Oscript developers and they dwelve in advanced JS so it becomes easy for them :)
Hi,
Appu has provided several options but one - possibly simpler? way might be to use WebReports. You or your customer probably have this product on your system already. There are a variety of ways to do this with WebReports but one way that immediately springs to mind is to use a WR Trigger. You can setup any container so that any create/add version event will run a chosen WebReport. There is an option called "Show WebReport" when you set this up which would be checked. When someone adds a document to this folder, after the initial add document screen, the WebReport you have setup will be displayed. Within this WebReport you have complete control over creating your own form inputs and your own validation JS. Once the user has selected wisely, you can then set the attributes using a sub-tag called CATACTION. The ID of the newly created document is returned by a tag called: [LL_REPTAG_TRIGGERID /].
All of the documentation for setting up the trigger feature is under the online help, Reports section. As far as the tags, you can find an "open Tag Guide" option on the function menu for any WebReport.
Greg
gpetti@ravenblackts.com
@Greg Petti good catch will this work if the user was in SmartUI and using the + to add a document?
@Appu Nair simplest answer: No, it will not
If you have OScript access you can add code to the Attribute objects to do some checks in the OScript or you could amend the WebLingo pages to add the validation there as well.
I don't see why the trigger solution wouldn't work. Even if a document is being added via smart view, it should still be using the same back end code to add the document, meaning all of the normal callbacks will be run, meaning the WebReports code will respond to the add.
Sorry, I posted my previous comment, not remembering the original premise, which is to respond to the add document with a screen that prompts for the attributes. I haven't actually thought about the SmartView case as the OP didn't seem to be specifying SmartView which is why I made my original suggestion. This specific approach would not work with SmartView as Reiner correctly pointed out.