Skip to Content.
Sympa Menu

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

Subject: Grouper Users - Open Discussion List

List archive

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


Chronological Thread 
  • From: Gagné Sébastien <>
  • To: <>
  • Subject: [grouper-users] PSP sync, checking if an attribute is assigned or not
  • Date: Thu, 21 Feb 2013 16:20:34 -0500
  • Authentication-results: sfpop-ironport01.merit.edu; dkim=neutral (message not signed) header.i=none

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