Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] PSP sync, checking if an attribute is assigned or not

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] PSP sync, checking if an attribute is assigned or not


Chronological Thread 
  • From: Tom Zeller <>
  • To: Gagné Sébastien <>
  • Cc: "" <>
  • Subject: Re: [grouper-users] PSP sync, checking if an attribute is assigned or not
  • Date: Tue, 26 Feb 2013 16:20:23 -0600
  • Authentication-results: sfpop-ironport01.merit.edu; dkim=pass (signature verified)

Some of the script attribute definitions I wrote, especially for the
changelog, are scary.

My suggestion is to review the ecma script syntax used by the script
attribute definitions, to deal with null vs empty vs blank attributes.

On Thu, Feb 21, 2013 at 3:20 PM, Gagné Sébastien
<>
wrote:
> Hi,
>
> In my PSP sync I want to check if a no-value attribute is assigned to a
> group. I added it to my group Data Connector and want to check it via a
> script
>
>
>
> The problem is that whether or not the attribute is assigned the attribute
> isn’t null. I don’t think I can check if a value is assigned, since it’s a
> “no-value” attribute. What would be a key difference ? Is there an Empty
> value (attribute assigned) vs. no values at all (no attribute assigned).
>
>
>
> In the following code, I always get
> “smtp:
> in
> my attribute
>
>
>
> Here is my sample definition
>
>
>
> <resolver:AttributeDefinition
>
> id="groupeDistribution"
>
> xsi:type="ad:Simple"
>
> sourceAttributeID="etc:mail:groupeDistribution">
>
> <resolver:Dependency ref="GroupWithoutMembershipsDataConnector" />
>
> </resolver:AttributeDefinition>
>
>
>
>
>
> <resolver:AttributeDefinition
>
> id="testDistribution"
>
> xsi:type="ad:Script">
>
> <resolver:Dependency ref="groupeDistribution" />
>
> <ad:Script><![CDATA[
>
> // Import Shibboleth attribute provider.
>
>
> importPackage(Packages.edu.internet2.middleware.shibboleth.common.attribute.provider);
>
>
>
> // Create the attribute to be returned.
>
> testDistribution = new BasicAttribute("testDistribution");
>
>
>
> if (typeof groupeDistribution == "undefined" ) {
>
>
> testDistribution.getValues().add("smtp:")
>
> }
>
> if (groupeDistribution == null ) {
>
>
> testDistribution.getValues().add("smtp:")
>
> } else {
>
>
> testDistribution.getValues().add("smtp:")
>
> }
>
> ]]></ad:Script>
>
> </resolver:AttributeDefinition>
>
>
>
>
>
> Sébastien Gagné, | Analyste en informatique
>
> 514-343-6111 x33844 | Université de Montréal,
>
> | Pavillon Roger-Gaudry, local X-100-11
>
>



Archive powered by MHonArc 2.6.16.

Top of Page