[jboss-user] [JBoss Portal] - Problem about new column of table 'jbp_user'

gumreal do-not-reply at jboss.com
Sat Mar 1 12:18:12 EST 2008


Hi all,
Using portal 2.6.2, I want to add new column to table 'jbp_users' and make the new column accessed from 'profile.xhtml'.

First modified the jboss-identity 1.0.0 as follow,
domain.hbm.xml

  |        <property 
  |        		name="unit"
  |        		column="col_unit"
  |        		type="java.lang.String"
  |        		update="true"
  |        		insert="true"
  |        		unique="false"/>
  | 

User.java

  | public String getUnit();
  | public void setUnit(String unit);
  | 

HibernateUserImpl.java

  | protected String unit;
  | public String getUnit() {return unit;}
  | public void setUnit(String unit) {this.unit = unit;}
  | 

Then built new portal-identity-lib.jar for JBoss Portal.

In JBoss Portal Source, modified 3 files follow the chapter 'Reference Guide - 16.3.3. Example 3: adding new properties'.
profile-config.xml

  |    <property>
  |       <name>user.unit</name>
  |       <type>java.lang.String</type>
  |       <access-mode>read-write</access-mode>
  |       <usage>mandatory</usage>
  |       <display-name xml:lang="en">Unit</display-name>
  |       <description xml:lang="en">User's Unit</description>
  |       <mapping>
  |          <database>
  |             <type>column</type>
  |             <value>col_unit</value>
  |          </database>
  |       </mapping>
  |    </property>
  | 

identity-ui-configuration.xml

  | <ui-component name="unit">
  | 	<property-ref>user.unit</property-ref>
  | 	<required>true</required>
  | </ui-component>
  | 

profile.xhtml

  | <h:panelGroup>
  |    <h:outputText value="unit"/>
  |    <h:outputText value=" *" rendered="#metadataservice.unit.required}" />
  |   </h:panelGroup>
  |   <h:inputText id="unit" value="#{manager.uiUser.attribute.unit}" required="#{metadataservice.unit.required}"/>
  |   	<h:panelGroup />
  | 

Finally, deploy the jboss portal.

However, what I input in the profile page for the column 'unit' has been saved to table 'jbp_user_prop' with the key 'user.unit', remainning 'NULL' in column 'col_unit' of table 'jbp_user'.

How to solve this problem? 
Thanks for any help:)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4133449#4133449

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4133449



More information about the jboss-user mailing list