Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Problem with LLValue constants
Louis_Routhier
I'm trying to build a generic function to access category (additional node attributes). In general, it is working (except for the ValidValues field which is a string instead of a list) as long as I don't try to know if I must use LLValue.ToBoolean or LLValue.ToInteger.As some may already know, the value for ATTR_DATATYPE_BOOL and ATTR_DATATYPE_INT is the same so my question is: how do I differentiate both?
Find more posts tagged with
Comments
Carsten_Kulms
Which version do you use?I was unable to validate that ATTR_DATATYPE_BOOL and ATTR_DATATYPE_INT have the same value.(Btw: It seems the problem with "ValidValues" being a String has been fixed; unfortunately I could not figure out with which version -- I stumbled over it myself with version 9.5)
Louis_Routhier
I am on 9.5.0.1. If you look at the values, you'll find thatPublic Const ATTR_DATATYPE_INT As Integer = 3Public Const ATTR_DATATYPE_BOOL As Integer = 3
Carsten_Kulms
Ah .. it's basic ...In my 9.5.0.1 (and previous) lapi_attributes.bas it readsPublic Const LL_ATTR_TYPE_BOOL = 5Public Const LL_ATTR_TYPE_INT = 2BUT you're right in lapi_documents.bas it readsPublic Const LL_ATTR_DATATYPE_INT = 3Public Const LL_ATTR_DATATYPE_BOOL = 3Please use the constants in lapi_attributes when accessing category attributes. (I guess the other constants are for `attributes` when accessing doc properties, e.g. from ListObjects -- then int and boolean are quite the same ... well, really misleading names.)
Louis_Routhier
The attributes to use are really those from LL_ATTR_DATATYPE. If I have a date, the value is 5Public Const ATTR_DATATYPE_DATE As Integer = 5 As forPublic Const ATTR_DATATYPE_LONGTEXT As Integer = 2I wasn't able to test it since I wasn'T able to create a multi-line attribute.
Carsten_Kulms
Ok, I'd overread that you access the additional node attributes ... Yes, then the constants you mention are the correct ones AND these are ambiguous ...Maybe you could fall back to the "DisplayType" also included in the RecArrayreturned by GetObjectAttributes:"DisplayType string the type of interface item used to display the attribute, as defined by the System Attribute Display Type Constants"
Louis_Routhier
That's what I'm doing but I find this quite unfriendly not to say tupid to have 2 elements in an enum with the same value... and I hoped to find a better solution... maybe there's none.