<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-2022-jp">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
The wiki states:</div>
<blockquote itemscope="" itemtype="https://schemas.microsoft.com/QuotedText" style="border-left-width: 3px; border-left-style: solid; border-color: rgb(200, 200, 200); padding-left: 1ex; margin-left: 0.8ex; color: rgb(102, 102, 102);">
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="caret-color:rgb(9, 30, 66);color:rgb(9, 30, 66);font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif;font-size:14px;background-color:rgb(255, 255, 255);display:inline !important">The </span><code style="font-family:SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace;caret-color:rgb(9, 30, 66);color:rgb(9, 30, 66);font-size:14px">ScriptedAttribute</code><span style="caret-color:rgb(9, 30, 66);color:rgb(9, 30, 66);font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif;font-size:14px;background-color:rgb(255, 255, 255);display:inline !important"><span class="Apple-converted-space"> </span>AttributeDefinition
constructs an output attribute via the execution of a </span><a href="https://docs.oracle.com/en/java/javase/11/scripting/index.html" class="external-link" rel="nofollow" style="color:rgb(0, 82, 204);font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif;font-size:14px">JSR-223</a><span style="caret-color:rgb(9, 30, 66);color:rgb(9, 30, 66);font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif;font-size:14px;background-color:rgb(255, 255, 255);display:inline !important"><span class="Apple-converted-space"> </span>script.</span><br>
</div>
</blockquote>
<div>
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
The JSR-223 link goes Oracles Java Scripting docs, but I have not found an Object/Class library guide. I think it's just a top level doc.</div>
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
I know a limited set of operations, e.g.:</div>
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;">if (some_attribute.getValues().contains("this")) {</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space" style="font-family: "Courier New", monospace;"> </span></span><span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;">my_attribute.getValues().add("that");</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;">}</span></p>
<br>
</div>
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
But I'd like a complete guide.</div>
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
My immediate want is to copy an attribute and then add values. How do I copy-assign from one attribute to another? I want the IdP to enhance our eduPersonAffiliation so it expressly asserts some POSET rules. e.g.</div>
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Arial, Helvetica, sans-serif;">staff</span> $B"*(B <span style="font-family: Arial, Helvetica, sans-serif;">
employee</span></div>
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Arial, Helvetica, sans-serif;">student</span> $B"*(B <span style="font-family: Arial, Helvetica, sans-serif;">
member</span></div>
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;"></span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;"><AttributeDefinition id="affilAsPOSET" xsi:type="ScriptedAttribute" ></span><span style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space" style="font-family: "Courier New", monospace;"> </span></span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space" style="font-family: "Courier New", monospace;">
</span></span><span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;"><InputAttributeDefinition ref="affiliation" /></span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space" style="font-family: "Courier New", monospace;">
</span></span><span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;"><AttributeEncoder xsi:type="SAML2String" name="urn:oid:1.3.6.1.4.1.5923.1.1.1.1"</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space" style="font-family: "Courier New", monospace;">
</span></span><span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;">friendlyName="eduPersonAffiliation" /></span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space" style="font-family: "Courier New", monospace;">
</span></span><span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;"><Script><![CDATA[</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space" style="font-family: "Courier New", monospace;">
</span></span><span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;">for (value in affiliation.getValues()) {</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space" style="font-family: "Courier New", monospace;">
</span></span><span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;">affliAsPOSET.getValues().add(value);</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space" style="font-family: "Courier New", monospace;">
</span></span><span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;">}</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space" style="font-family: "Courier New", monospace;">
</span></span><span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;">if (affiliation.getValues().contains("faculty") {</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space" style="font-family: "Courier New", monospace;">
</span></span><span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;">affilAsPOSET.getValues().add("employee");</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space" style="font-family: "Courier New", monospace;">
</span></span><span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;">}</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space" style="font-family: "Courier New", monospace;">
</span></span><span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;">]]></span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space" style="font-family: "Courier New", monospace;">
</span></span><span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;"></Script></span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;"></AttributeDefinition></span></p>
<br>
</div>
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
The <span style="font-family: "Courier New", monospace;">for</span> loop doesn't work. Nor does this one:</div>
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;">a = affiliation.getValues();</span><span style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space" style="font-family: "Courier New", monospace;"> </span></span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;">for (affil in ("staff", "student", "faculty")) {</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space" style="font-family: "Courier New", monospace;">
</span></span><span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;">if (a.contains(affil)) {</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space" style="font-family: "Courier New", monospace;">
</span></span><span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;">affilAsPOSET.getValues().add(affil);</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space" style="font-family: "Courier New", monospace;">
</span></span><span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;">}</span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:13.0px Monaco;color:#3b2322;background-color:#e4e4e4">
<span style="font-variant-ligatures: no-common-ligatures; font-family: "Courier New", monospace;">}</span></p>
<br>
</div>
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
Where do I find docs on the correct use of for loops?</div>
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
What class is "affiliation"? What methods are supported? How to I copy an object?</div>
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; font-size: 12pt; color: rgb(0, 0, 0);">
Paul</div>
<div id="Signature">
<div>
<div></div>
<div style="font-family:"Palatino Linotype","Book Antiqua",Palatino,serif; font-size:12pt; color:rgb(0,0,0)">
-- </div>
<div style="font-family:"Palatino Linotype","Book Antiqua",Palatino,serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:Arial,Helvetica,sans-serif; color:rgb(23,78,134); font-size:11pt">Paul Fardy, Shib Admin, Info Security, ITS</span></div>
<div style="font-family:"Palatino Linotype","Book Antiqua",Palatino,serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-size:11pt"></span><span style="font-family:Arial,Helvetica,sans-serif; color:rgb(23,78,134); font-size:11pt">University of Toronto</span></div>
</div>
</div>
</div>
</body>
</html>