Scripted Attribute / weird issue

Bryan Wooten bryan.wooten at utah.edu
Fri Jul 29 12:35:54 EDT 2016


Short description: split function won't split on $.

I have a static attribute uuenrl that has this value(s):

<resolver:DataConnector id="staticuuenrl" xsi:type="dc:Static">
        <dc:Attribute id="uuenrl">
            <dc:Value>Summer 2016$7981$EAS$1060$001$LEC$Expository Wrtg for EAS$3$1,Summer 2017$7981$EAS$1060$001$LEC$Expository Wrtg for EAS$3$1</dc:Value>
        </dc:Attribute>
</resolver:DataConnector>

In my script I have this snippet:


eduCourseOfferingTemp = new BasicAttribute("eduCourseOfferingTemp");
          eduCourseOfferingTemp.getValues().add(uuenrl.getValues());
          var courses = "";
          courses = eduCourseOfferingTemp.getValues().toString();
          logger.info("courses: " + courses);
          var ca = [];
          ca = courses.split(",");
          logger.info("ca[0] after split: "+ca[0]);
          logger.info("ca[1] after split: "+ca[1]);
          var element = [];
          element = ca[0].split("$");
          logger.info("element[0] after $ split: "+element[0]);

The output looks like this:

- courses: [[Summer 2016$7981$EAS$1060$001$LEC$Expository Wrtg for EAS$3$1,Summer 2017$7981$EAS$1060$001$LEC$Expository Wrt
g for EAS$3$1]]
- ca[0] after split: [[Summer 2016$7981$EAS$1060$001$LEC$Expository Wrtg for EAS$3$1
- ca[1] after split: Summer 2017$7981$EAS$1060$001$LEC$Expository Wrtg for EAS$3$1]]
- element[0] after $ split: [[Summer 2016$7981$EAS$1060$001$LEC$Expository Wrtg for EAS$3$1

So the split on ',' on the courses string works, but the split on '$' on ca[0] doesn't do anything.

If I change '$' to '2' it will split on the '2'.

Also note that a replace on '$' doesn't work either.

Any ideas? My google foo is totally failing....

Bryan Wooten
Tel: (801)585-9323
Email: bryan.wooten at utah.edu<mailto:bryan.wooten at utah.edu>

[Identity & Access Management_combined centered]


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20160729/660d451e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 6374 bytes
Desc: image001.jpg
URL: <http://shibboleth.net/pipermail/users/attachments/20160729/660d451e/attachment-0001.jpg>


More information about the users mailing list