Author Message
MichaelNorman
Joined: Jun 3, 2015
Messages: 448
Offline
If I have an attribute as a type LIST. How can I retrieve that list of values in code?

The getServiceAttribute method only returns a String value unless there are other methods I'm not seeing.

MichaelNorman
Joined: Jun 3, 2015
Messages: 448
Offline
Also how would you override defaults by using the <attribute_overrides> tags?
JoelEzell
Joined: Nov 15, 2013
Messages: 780
Offline
Michael, sorry for the delay and for the lack of documentation in this area. I'm workling on finding an an answer to your questions. Can you say more about the second question? Are there multiple snap-ins that you are creating that require the attribute override feature? If you're just wanting to set factory defaults for a single snap-in, the developer guide indicates how to do this in your properties.xml.
MichaelNorman
Joined: Jun 3, 2015
Messages: 448
Offline
I managed to figure out that it returns a comma delimited string when retrieving a LIST type. My second question was how to override the default for the LIST type, which I'd assume should also be given as a comma delimited string, but since there is no documentation for this, would be great for you to confirm.
JoelEzell
Joined: Nov 15, 2013
Messages: 780
Offline
Hi Michael, here's a bunch of detailed info. Please let me know if you have any further questions.

The list value is stored in database as quotes and “,” delimiter - The reason being , and space could also be part of the list value like “Tom, Dick, and Harry”,”My dog has fleas” – this is considered as list with two values i.e. “Tom, Dick, and Harry“ being one value and ”My dog has fleas” being another

PFB the example – in properties .xml

<attribute name="validateList">
<displayName>ValidateList</displayName>
<helpInfo>Attribute added for List Type Validation</helpInfo>
<global>false</global>
<type>LIST</type>
<validation name="anyList">
<type>STRING</type>
</validation>
<admin_visible>true</admin_visible>
<factory>
<value>sample,23,drop,76,down,0987,validation</value>
<user_changeable>true</user_changeable>
</factory>
</attribute>

The value stored in database is “sample”,”23”,”drop”,”76”,”down”,”0987”,”validation”

Valid Formats:
1. a,b,c - Stored as (“a”,”b”,”c”)
2. “a”,b,c – Stored as (“a”,”b”,”c”)
3. a,”b”,c – Stored as (“a”,”b”,”c”)
4. a,”b,c”,d – Stored as (“a”,”b,c”,”d”)
5. a,b,<space> - Stored as (“a”,”b”,”<space>”)
6. “a”,”b”,”c” – Stored as (“a”,”b”,”c”)

Invalid Formats
1. a,b, (please note the earlier valid format case there is space at end)
2. a,”
3. ,a,b
4. ,
5. a,b”,c
6. a,”b,c

Note:
- The factory value provided in properties.xml can be overridden from SMGR GUI – By checking the override Default Boolean flag – List values can be added (+ button)/deleted(- button)/modified – by modifying the text field
- Please note that double quotes are not entertained as an valid value for Entry in the List
MichaelNorman
Joined: Jun 3, 2015
Messages: 448
Offline
Great info thanks!
Go to:   
Mobile view