Re: Adding user attributes to database-only portal - Websphere

This is a discussion on Re: Adding user attributes to database-only portal - Websphere ; Dudes, I found the reason it cannot find the table WMMLAKEYS. This is because the db username is not set to db2admin!!! Try that and it will work. Here is a quick howto I managed to set LookAside successfully into ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Re: Adding user attributes to database-only portal

  1. Re: Adding user attributes to database-only portal

    Dudes,

    I found the reason it cannot find the table WMMLAKEYS. This is because the db username is not set to db2admin!!! Try that and it will work.

    Here is a quick howto I managed to set LookAside successfully into the default portal cloudscape db:

    NOTE: The path names need to be changed to your env:

    1. Edit /cygdrive/c/Program Files/IBM/SDP70/runtimes/PortalServer/wmm/wmm.xml and:

    Line 6: Turn lookaside to 6.

    After Line 43 add the following repository:

    UUID="LA"
    supportTransactions="true"
    adapterClassName="com.ibm.ws.wmm.lookaside.db.LookAsideAdapter"
    supportDynamicAttributes="true"
    dbMemberRetrievalLimit="200"
    dataSourceName="jdbc/wpdbDS"
    databaseType="cloudscape"
    dataAccessManagerClassName="com.ibm.ws.wmm.db.dao.cloudscape.WMMCloudscapeDao" />


    2. Edit /cygdrive/c/Program Files/IBM/SDP70/runtimes/PortalServer/wmm/wmmLAAttributes.xml and at the end add:

    pluginAttributeName="age"
    applicableMemberTypes="Person"
    dataType="String"
    valueLength="256"
    multiValued="true"/>

    pluginAttributeName="profession"
    applicableMemberTypes="Person"
    dataType="String"
    valueLength="256"
    multiValued="true"/>

    pluginAttributeName="maritalStatus"
    applicableMemberTypes="Person"
    dataType="String"
    valueLength="256"
    multiValued="true"/>

    pluginAttributeName="childrenNumber"
    applicableMemberTypes="Person"
    dataType="String"
    valueLength="256"
    multiValued="true"/>

    pluginAttributeName="nationality"
    applicableMemberTypes="Person"
    dataType="String"
    valueLength="256"
    multiValued="true"/>

    pluginAttributeName="residenceLocation"
    applicableMemberTypes="Person"
    dataType="String"
    valueLength="256"
    multiValued="true"/>

    pluginAttributeName="emailCommunication"
    applicableMemberTypes="Person"
    dataType="String"
    valueLength="256"
    multiValued="true"/>


    3. Add the following to wmm.xml:

    applicableMemberTypes="Person"
    dataType="String"
    valueLength="256"
    multiValued="true"/>

    applicableMemberTypes="Person"
    dataType="String"
    valueLength="256"
    multiValued="true"/>

    applicableMemberTypes="Person"
    dataType="String"
    valueLength="256"
    multiValued="true"/>

    applicableMemberTypes="Person"
    dataType="String"
    valueLength="256"
    multiValued="true"/>

    applicableMemberTypes="Person"
    dataType="String"
    valueLength="256"
    multiValued="true"/>

    applicableMemberTypes="Person"
    dataType="String"
    valueLength="256"
    multiValued="true"/>

    applicableMemberTypes="Person"
    dataType="String"
    valueLength="256"
    multiValued="true"/>

    4. Put that into the wmmAtributesDescription.xml:


    attributeName="age"
    attributeDescription="The person age." />



    attributeName="profession"
    attributeDescription="The person profession." />



    attributeName="maritalStatus"
    attributeDescription="The person marital status." />



    attributeName="childrenNumber"
    attributeDescription="The person children number." />



    attributeName="nationality"
    attributeDescription="The person nationality." />



    attributeName="residenceLocation"
    attributeDescription="The person residence location." />



    attributeName="emailCommunication"
    attributeDescription="The person email communication." />


    5. Make copies of \config\work\wmm\bin\setenv.bat and attributeLoader.bat, respectively, to mySetenv.bat and myAttributeLoader.bat.

    6. If you do not have JAVA_HOME env set sort that out first to look at your JRE/JDK home directory and test that it is set successfully.

    7. Edit mySetend.bat and replace all with:

    @echo off

    set WP_root=C:\Progra~1\IBM\SDP70\runtimes\PortalServe r
    set WAS_root=C:\Progra~1\IBM\SDP70\runtimes\base_v6
    set SERVER_NAME=WebSphere_Portal

    @REM WMM repository configurations, choose one of the following:
    @REM 1 - Database repository only
    @REM 2 - LDAP repository only
    @REM 3 - LDAP repository plus lookaside
    @REM 4 - Database repository and LDAP repository
    @REM 5 - Horizontal Partitioning
    set WMM_CONFIG=5

    @REM Set to true if use wmm.xml as WMM configure source. WMM adminConsole GUI will not be installed.
    @REM Set to false if use resource-pme.xml (WCCM) source. WMM adminConsole GUI will be installed (require WAS PME version).
    @REM If install WMM on WAS base version, should set to true
    set USE_WMM_XML=true

    @REM If WMM_COFIG is 2 (LDAP only), you don't need to change the following settings:
    if %WMM_CONFIG%==2 goto end

    @REM Following are sample configuration information
    @REM ************************************************** ************************************************** ***************************
    @REM DB_TYPE DB_DRIVER_LOCATION DB_DRIVER DB_JDBC_URL
    @REM ************************************************** ************************************************** ***************************
    @REM db2 \java\db2java.zip COM.ibm.db2.jdbc.app.DB2Driver jdbc:db2:wmm
    @REM cloudscape \AppServer\lib\db2j.jar com.ibm.db2j.jdbc.DB2jDriver jdbc:db2j:wmm
    @REM ************************************************** ************************************************** ***************************
    @REM Database driver information.

    set DB_TYPE=cloudscape
    set DB_DRIVER_LOCATION=C:\Progra~1\IBM\SDP70\runtimes\ base_v6\cloudscape\lib\db2j.jar
    set DB_DRIVER=com.ibm.db2j.jdbc.DB2jDriver
    set DB_NAME=wpsdb
    set DB_JDBC_URL="jdbc:db2j:wpsdb;create=true"
    set DB_USER=db2admin
    set DB_PASSWORD=admin
    set TRACE_ENABLE=true
    set REPORT_SQL_ERROR=false

    call %WAS_root%\bin\setupCmdLine.bat

    @REM Database system home for cloudscape, for example: \wmm\system. Only need if DB_TYPE is cloudscape
    set CS_HOME=

    @REM Database owner. This field is for MS SQL server only. By default, database owner is dbo.
    set WMM_DBOWNER=dbo
    :end

    8. Edit myAttributeLoader.bat and replace with:

    @echo on

    call mySetenv.bat

    set JAVA_EXE=%JAVA_HOME%\bin\java

    set TRACE_LOG=%WP_root%\config\work\wmm\bin\attrloader .log

    set ATTR_PRELOAD=com.ibm.ws.wmm.dbload.AttributePreLoa der
    set COMMON_SIG=%DB_JDBC_URL% %DB_DRIVER% %DB_USER% %DB_PASSWORD%
    set WMM_CP=%WAS_root%\lib\wmm.jar;%DB_DRIVER_LOCATION% ;%WAS_root%\lib\ras.jar;%WAS_root%\lib\j2ee.jar;%W AS_root%\lib\wsexception.jar;%

    WAS_root%\lib\utils.jar;%WAS_root%\lib\bootstrap.j ar;%WAS_root%\lib\emf.jar

    set xml=%1
    if ".%xml%." == ".." goto showusage

    echo loading attributes >> "%TRACE_LOG%" 2>&1
    "%JAVA_EXE%" -classpath "%WMM_CP%" -Ddb2j.system.home="C:/Program Files/IBM/SDP70/runtimes/PortalServer/cloudscape/" %ATTR_PRELOAD% %1 %DB_TYPE% %

    COMMON_SIG% %TRACE_ENABLE% >> "%TRACE_LOG%" 2>&1

    echo Please see "%TRACE_LOG%" for details.

    goto end

    :showusage
    echo Usage: attributeLoader.bat "%WP_root%\wmm\wmmLAAttributes.xml"

    :end

    endlocal

    9. Check attrloader.log that has at the end something like the following:

    ...Loading attribute: age
    attribute age is created with id=10087
    memberType P is created for 10087
    LookAside Attribute: age is loaded.
    ...Loading attribute: profession
    attribute profession is created with id=10088
    memberType P is created for 10088
    LookAside Attribute: profession is loaded.
    ...Loading attribute: maritalStatus
    attribute maritalStatus is created with id=10089
    memberType P is created for 10089
    LookAside Attribute: maritalStatus is loaded.
    ...Loading attribute: childrenNumber
    attribute childrenNumber is created with id=10090
    memberType P is created for 10090
    LookAside Attribute: childrenNumber is loaded.
    ...Loading attribute: nationality
    attribute nationality is created with id=10091
    memberType P is created for 10091
    LookAside Attribute: nationality is loaded.
    ...Loading attribute: residenceLocation
    attribute residenceLocation is created with id=10092
    memberType P is created for 10092
    LookAside Attribute: residenceLocation is loaded.
    ...Loading attribute: emailCommunication
    attribute emailCommunication is created with id=10093
    memberType P is created for 10093
    LookAside Attribute: emailCommunication is loaded.

    10. You can connect to the database to see that the db2admin.wmmlaatr contains the new data.


    Good luck,
    Georgios C. Kossionis.

  2. Re: Adding user attributes to database-only portal

    Hi Georgios,
    I have added custom attributes to the wmm, but when i try to add a user then it throws an error like - com.ibm.wps.um.exceptions.impl.AttributeNotDefined ExceptionImpl: com.ibm.portal.puma.AttributeNotDefinedException: EJPSG0007E: One of the attribute specified is not defined for this member type-

    But I am able to fetch those user attributes with the jsr api, I mean by adding +user-attribute+ to the portlet.xml.

    Is there anything I need to do after running the attributeloader.bat?

    Thanks in advance.
    Vijaya

+ Reply to Thread