Hi,

I just saw some new docs Eric Dalquist put on the dashboard today. From
a quick look at that it seems I should be doing something like the
following.

<bean id="multiRowJdbcPersonAttributeDao"
class="org.jasig.services.persondir.support.jdbc.MultiRowJdbcPersonAttributeDao">
    <constructor-arg index="0" ref="dataSource" />
    <constructor-arg index="1" value="SELECT * FROM USER_DATA WHERE {0}" />
    <property name="nameValueColumnMappings">
        <map>
            <entry key="attr_name" value="attr_value" />
        </map>
    </property>
    <property name="queryAttributeMapping">
        <map>
            <entry key="username" value="uid" />
        </map>
    </property>
    <property name="resultAttributeMapping">
        <map>
            <entry key="uid" value="username" />
            <entry key="first_name" value="first_name" />
            <entry key="last_name" value="last_name" />
            <entry key="email" value="email" />
        </map>
    </property>
</bean>

However, my attributes are stored per service id. I will modify the
above for my case.

Thanks,

Robert Lewis


> Hi Scott,

> My dialect is set correctly for mysql and the services whitelist is
> being stored and retrieved correctly. I think my problem has to do
> with
> the attributeRepository bean. We want to store the allowed attributes > in
> the mysql database. It seems like I would use something like the
> following.


>  <bean id="attributeRepository"
>
class="org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao">
                <constructor-arg index="0" ref="dataSource"/>
                <constructor-arg>
                        <list>
                                <value>%u</value>
                        </list>
                        </constructor-arg>
                        <constructor-arg>
                        <value>
                SELECT tamuEduPersonNetID AS , cn, tamuEduPersonUIN,
tamuEduPersonNetID, mail, telephoneNumber
                FROM  cas_registry
                WHERE service=?
                        </value>
                        </constructor-arg>
                <property name="columnsToAttributes">
                <map>
<!-- Mapping between attributes (key) and Principal"s (value) -->
                <entry key="cn" value="Name"/>
                <entry key="tamuEduPersonUIN" value="uin"/>
                <entry key="tamuEduPersonNetID" value="user" />
                <entry key="mail" value="mail" />
                <entry key="telephoneNumber" value="telephoneNumber" />
                </map>
                </property>
        </bean>

> Does the above make any sense as far as retrieving the allowed
> attributes? One thing I need to change is the "%u" which is the
> username. I need to change this to the service id, but I don't know
> how
> to reference the service id in deployerConfigContext.xml; do you
> happen
> to know to do that?

> Thanks,

> Robert Lewis

> > Robert,
> > Its using JPA/Hibernate to do the storage.  Do you have the correct
> > dialect
> > set for Hibernate?  I can give it a try under MySql, I think my
> > notebook has
> > it, but probably not until later or tomorrow.

> > -Scott
_______________________________________________
Yale CAS mailing list
[email protected]
http://tp.its.yale.edu/mailman/listinfo/cas

Reply via email to