Attributes

5 views
Skip to first unread message

dizinha

unread,
Oct 6, 2008, 11:49:22 AM10/6/08
to openid-server-dev
Hello:)

Our test was:

1. Add attribute with alias="test"

mysql> select * from jos_attribute;
+----------------------------------
+-----------------.........................+
| attribute_id | attribute_alias
|
+----------------------------------
+-----------------..........................+
| 4108a7991ccc5e6f011ccc5ef8470001 | teste |

2. Add value "a" to attribute "test"

mysql> select * from jos_attribute_value;
+----------------------------------+----------------------------------
+-----------------------+-----------------------+
| attribute_value_user_id |
attribute_value_attribute_id | attribute_value_index |
attribute_value_value |
+----------------------------------+----------------------------------
+-----------------------+-----------------------+
| 4108a7991ccc5e6f011ccc5ef8470001 | 4108a7991ccc5e6f011ccc5ef8470001
| 0 | a |

so far so good.

3. Add attribute "test2" and value of "test2" = "b". The server
stopped working, with error
" OpenID is Unavailable [...] "

Now watch this:

mysql> select * from jos_attribute_value;
+----------------------------------+----------------------------------
+-----------------------+-----------------------+
| attribute_value_user_id | attribute_value_attribute_id
| attribute_value_index | attribute_value_value |
+----------------------------------+----------------------------------
+-----------------------+-----------------------+
| 4108a7991ccc59b4011ccc5af12b0002 | 4108a7991ccc5e6f011ccc5ef8470001
| 0 | a |
| 4108a7991ccc59b4011ccc5af12b0002 | 4108a7991ccc5e6f011ccc6179120002
| 0 | |

see what's the problem? Attribute_value_index is allways '0'

4. To see if the problem was on the database we added those lines
(with mysql command):

mysql> select * from jos_attribute_value;
+----------------------------------+----------------------------------
+-----------------------+-----------------------+
| attribute_value_user_id | attribute_value_attribute_id
| attribute_value_index | attribute_value_value |
+----------------------------------+----------------------------------
+-----------------------+-----------------------+
| 4108a7991ccc59b4011ccc5af12b0002 | 4108a7991ccc5e6f011ccc5ef8470001
| 0 | a |
| 4108a7991ccc59b4011ccc5af12b0002 | 4108a7991ccc5e6f011ccc6179120002
| 1 | b |

And it worked, so the problem must be the attribute_value_index. It
should be a value that auto-increments.

To try to fix this i did:

5. changed jos-hibernate/.../attributeValue.hbm.xml to:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD
3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="cn.net.openid.jos.domain">
<class name="AttributeValue" table="jos_attribute_value">
<many-to-one name="user" column="attribute_value_user_id" />
<many-to-one name="attribute" column="attribute_value_attribute_id" /
>
<id name="index" column="attribute_value_index" >
<generator class="uuid"/>
</id>

<property name="value" column="attribute_value_value" />
</class>
</hibernate-mapping>

So that the column="attribute_value_index" would be like an id
attribute, i mean, auto-increment and unique


6. created the jar (that is exactly the same as jos-
hibernate-1.2.0.jar except on attributevalue.hbm.xml) and added the
classpath of this file on dataAccessContext-hibernate.xml to the list
of xml files that existed.

7. ERROR! ERROR! ERROR! Everything stopped working :( To get it to
work again i had to put everything like it was before so i'm thinking
that the xml that i wrote is all wrong;)


If we fix this the server would work perfectly and we would be able to
add these attributes to the persona:)

Sutra Zhou

unread,
Oct 6, 2008, 12:07:02 PM10/6/08
to openid-s...@googlegroups.com
I'll take this database design in these two days, please wait.

2008/10/6 dizinha <diana.r...@gmail.com>:

Diana Almeida

unread,
Oct 7, 2008, 8:38:09 AM10/7/08
to openid-s...@googlegroups.com
Ok, thanks. Need help? Just let me know :)

-----Mensagem original-----
De: openid-s...@googlegroups.com [mailto:openid-s...@googlegroups.com] Em nome de Sutra Zhou
Enviada em: segunda-feira, 6 de Outubro de 2008 17:07
Para: openid-s...@googlegroups.com
Assunto: Re: Attributes

dizinha

unread,
Oct 10, 2008, 7:31:42 AM10/10/08
to openid-server-dev
Hello:)

Any News?

have a nice day:)

Sutra Zhou

unread,
Oct 12, 2008, 1:24:51 PM10/12/08
to openid-s...@googlegroups.com
I'll commit it 4 minutes later, I'm installing svn.

From Oct 1, I reinstall my os from Mac OS X to Ubuntu, so wasted some time.

2008/10/10 dizinha <diana.r...@gmail.com>:

Diana Almeida

unread,
Oct 12, 2008, 1:51:12 PM10/12/08
to openid-s...@googlegroups.com
Thanks!!!!! Please let me know when you finish the commit:)

-----Mensagem original-----
De: openid-s...@googlegroups.com [mailto:openid-s...@googlegroups.com] Em nome de Sutra Zhou
Enviada em: domingo, 12 de Outubro de 2008 18:25
Para: openid-s...@googlegroups.com
Assunto: Re: RES: Attributes

Sutra Zhou

unread,
Oct 12, 2008, 2:10:42 PM10/12/08
to openid-s...@googlegroups.com
You can follow this group if you like:
http://groups.google.com/group/openid-server-notifications?pli=1

2008/10/13 Diana Almeida <diana.r...@gmail.com>:

dizinha

unread,
Oct 13, 2008, 4:39:00 PM10/13/08
to openid-server-dev

:)

The database design is great, just what was needed.

however... did you test it?

Because there seems to be a problem, adding the attributes.

We can add an attribute, but then it doens't link with a persona
because on table jos_attribute the field attribute_persona_id is
always NULL.
I added an attribute and a persona id "by hand" on the table and it
appeared on the persona page, so this works fine. The problem is just
when the attribute is inserted on to jos_attribute, the persona_id
isn't sent there so it's always null...

One other thing, what's "attribute_type_uri" ?

Thanks

dizinha

unread,
Oct 16, 2008, 4:21:10 AM10/16/08
to openid-server-dev
Still there is a problem with the insertion on database (like i
explained on my last post).

Any Ideias? :)
Reply all
Reply to author
Forward
0 new messages