Database persistence - SQL Server

Do you want to create a native client or integrate with third party applications: webservices are the solution.
Forum rules
Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
Post Reply
hayline
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: Tue Sep 08, 2009 4:33 pm

Database persistence - SQL Server

Post by hayline »

Hi all..

I\'m trying for almost a week configure repository and authentication do Sql Server 2000.

:S I`m a little confused about how to do that.

So,what I tried: Configured longin-config.xml, openkm-ds.xml, repository.xml..
Untill now nothing worked...Following my files...

Is there anyone to help me?? Is there anything wrong?? Is there anything missing??


*************** Repository.xml **********************
<?xml version=\"1.0\"?>
<Repository>
<FileSystem class=\"org.apache.jackrabbit.core.fs.local.LocalFileSystem\">
<param name=\"path\" value=\"${rep.home}/repository\"/>
</FileSystem>
<Security appName=\"Jackrabbit\">
<AccessManager class=\"es.git.openkm.core.OKMAccessManager\"/>
</Security>
<Workspaces rootPath=\"${rep.home}/workspaces\" defaultWorkspace=\"default\" />
<Workspace name=\"${wsp.name}\">
<FileSystem class=\"org.apache.jackrabbit.core.fs.db.DbFileSystem\">
<param name=\"driver\" value=\"com.microsoft.jdbc.sqlserver.SQLServerDriver\"/>
<param name=\"url\" value=\"jdbc:microsoft:sqlserver://localhost:1433;;DatabaseName=okm;SelectMethod=Cursor;\"/>
<param name=\"schema\" value=\"mssql\"/>
<param name=\"user\" value=\"sa\"/>
<param name=\"password\" value=\"admin\"/>
<param name=\"schemaObjectPrefix\" value=\"rep_\"/>
</FileSystem>

<PersistenceManager class=\"org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager\">
<param name=\"driver\" value=\"com.microsoft.jdbc.sqlserver.SQLServerDriver\"/>
<param name=\"url\" value=\"jdbc:microsoft:sqlserver://localhost:1433;;DatabaseName=okm;SelectMethod=Cursor;\"/>
<param name=\"schema\" value=\"mssql\"/>
<param name=\"user\" value=\"sa\"/>
<param name=\"password\" value=\"admin\"/>
<param name=\"schemaObjectPrefix\" value=\"${wsp.name}_\"/>
<param name=\"externalBLOBs\" value=\"false\"/>
</PersistenceManager>

<SearchIndex class=\"org.apache.jackrabbit.core.query.lucene.SearchIndex\">
<param name=\"path\" value=\"${wsp.home}/index\"/>
<param name=\"textFilterClasses\" value=\"
org.apache.jackrabbit.core.query.lucene.TextPlainTextFilter,
org.apache.jackrabbit.core.query.MsExcelTextFilter,
org.apache.jackrabbit.core.query.MsPowerPointTextFilter,
org.apache.jackrabbit.core.query.MsWordTextFilter,
org.apache.jackrabbit.core.query.PdfTextFilter,
org.apache.jackrabbit.core.query.HTMLTextFilter,
org.apache.jackrabbit.core.query.XMLTextFilter,
org.apache.jackrabbit.core.query.RTFTextFilter,
org.apache.jackrabbit.core.query.OpenOfficeTextFilter\" />

<!-- These are all default values. You can change them if you want -->
<!--
<param name=\"useCompoundFile\" value=\"true\"/>
<param name=\"minMergeDocs\" value=\"100\"/>
<param name=\"volatileIdleTime\" value=\"3\"/>
<param name=\"maxMergeDocs\" value=\"100000\"/>
<param name=\"mergeFactor\" value=\"10\"/>
<param name=\"bufferSize\" value=\"10\"/>
<param name=\"cacheSize\" value=\"1000\"/>
<param name=\"forceConsistencyCheck\" value=\"false\"/>
<param name=\"autoRepair\" value=\"true\"/>
<param name=\"analyzer\" value=\"org.apache.lucene.analysis.standard.StandardAnalyzer\"/>
<param name=\"queryClass\" value=\"org.apache.jackrabbit.core.query.QueryImpl\"/>
<param name=\"idleTime\" value=\"-1\"/>
-->
<!-- end of default values -->
</SearchIndex>
</Workspace>
<Versioning rootPath=\"${rep.home}/versions\">
<FileSystem class=\"org.apache.jackrabbit.core.fs.db.DbFileSystem\">
<param name=\"driver\" value=\"com.microsoft.jdbc.sqlserver.SQLServerDriver\"/>
<param name=\"url\" value=\"jdbc:microsoft:sqlserver://localhost:1433;;DatabaseName=okm;SelectMethod=Cursor;\"/>
<param name=\"schema\" value=\"mssql\"/>
<param name=\"user\" value=\"sa\"/>
<param name=\"password\" value=\"admin\"/>
<param name=\"schemaObjectPrefix\" value=\"rep_\"/>
</FileSystem>

<PersistenceManager class=\"org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager\">
<param name=\"driver\" value=\"com.microsoft.jdbc.sqlserver.SQLServerDriver\"/>
<param name=\"url\" value=\"jdbc:microsoft:sqlserver://localhost:1433;;DatabaseName=okm;SelectMethod=Cursor;\"/>
<param name=\"schema\" value=\"mssql\"/>
<param name=\"user\" value=\"sa\"/>
<param name=\"password\" value=\"admin\"/>
<param name=\"schemaObjectPrefix\" value=\"${wsp.name}_\"/>
<param name=\"externalBLOBs\" value=\"false\"/>
</PersistenceManager>
</Versioning>
</Repository>




***************** openkm-ds.xml ***************************

<?xml version=\"1.0\" encoding=\"UTF-8\"?>

<datasources>
<!-- OpenKM User Activity -->
<local-tx-datasource>
<jndi-name>OKMActivityDS</jndi-name>
<connection-url>jdbc:microsoft:sqlserver://localhost:1433;;DatabaseName=okm</connection-url>
<driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
<user-name>sa</user-name>
<password>admin</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<track-statements/>
<!--<security-domain>HsqlDbRealm</security-domain>-->
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<metadata>
<type-mapping>MS SQL Server</type-mapping>
</metadata>
<!-- <depends>jboss:service=Hypersonic,database=OKMActivity</depends> -->
</local-tx-datasource>

<!-- For hsqldb accessed from jboss only, in-process (standalone) mode -->
<!--<mbean code=\"org.jboss.jdbc.HypersonicDatabase\"
name=\"jboss:service=Hypersonic,database=OKMActivity\">
<attribute name=\"Database\">OKMActivity</attribute>
<attribute name=\"InProcessMode\">true</attribute>
</mbean>-->

<!-- OpenKM User Auth -->
<local-tx-datasource>
<jndi-name>OKMAuthDS</jndi-name>
<connection-url>jdbc:microsoft:sqlserver://localhost:1433;;DatabaseName=okm</connection-url>
<driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
<user-name>sa</user-name>
<password>admin</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<track-statements/>
<!--<security-domain>HsqlDbRealm</security-domain>-->
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<metadata>
<type-mapping>MS Sql Server</type-mapping>
</metadata>
<!--<depends>jboss:service=Hypersonic,database=OKMAuth</depends> -->
</local-tx-datasource>

<!-- For hsqldb accessed from jboss only, in-process (standalone) mode -->
<!--<mbean code=\"org.jboss.jdbc.HypersonicDatabase\"
name=\"jboss:service=Hypersonic,database=OKMAuth\">
<attribute name=\"Database\">OKMAuth</attribute>
<attribute name=\"InProcessMode\">true</attribute>
</mbean>-->

<!-- OpenKM Dashboard Stats -->
<local-tx-datasource>
<jndi-name>OKMDashboardStatsDS</jndi-name>
<connection-url>jdbc:microsoft:sqlserver://localhost:1433;;DatabaseName=okm</connection-url>
<driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
<user-name>sa</user-name>
<password>admin</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<track-statements/>
<!--<security-domain>HsqlDbRealm</security-domain>-->
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<metadata>
<type-mapping>MS Sql Server</type-mapping>
</metadata>
<!--<depends>jboss:service=Hypersonic,database=OKMDashboardStats</depends> -->
</local-tx-datasource>

<!-- For hsqldb accessed from jboss only, in-process (standalone) mode -->
<!--<mbean code=\"org.jboss.jdbc.HypersonicDatabase\"
name=\"jboss:service=Hypersonic,database=OKMDashboardStats\">
<attribute name=\"Database\">OKMDashboardStats</attribute>
<attribute name=\"InProcessMode\">true</attribute>
</mbean>
</datasources> -->


************************* login-config.xml******************************

<?xml version=\'1.0\'?>
<!DOCTYPE policy PUBLIC
\"-//JBoss//DTD JBOSS Security Config 3.0//EN\"
\"http://www.jboss.org/j2ee/dtd/security_config.dtd\">

<!-- The XML based JAAS login configuration read by the
org.jboss.security.auth.login.XMLLoginConfig mbean. Add
an application-policy element for each security domain.

The outline of the application-policy is:
<application-policy name=\"security-domain-name\">
<authentication>
<login-module code=\"login.module1.class.name\" flag=\"control_flag\">
<module-option name = \"option1-name\">option1-value</module-option>
<module-option name = \"option2-name\">option2-value</module-option>
...
</login-module>

<login-module code=\"login.module2.class.name\" flag=\"control_flag\">
...
</login-module>
...
</authentication>
</application-policy>

$Revision: 64598 $
-->

<policy>
<!-- Used by clients within the application server VM such as
mbeans and servlets that access EJBs.
-->
<application-policy name = \"client-login\">
<authentication>
<login-module code = \"org.jboss.security.ClientLoginModule\"
flag = \"required\">
<!-- Any existing security context will be restored on logout -->
<module-option name=\"restore-login-identity\">true</module-option>
</login-module>
</authentication>
</application-policy>

<!-- Security domain for JBossMQ -->
<application-policy name = \"jbossmq\">
<authentication>
<login-module code = \"org.jboss.security.auth.spi.DatabaseServerLoginModule\"
flag = \"required\">
<module-option name = \"unauthenticatedIdentity\">guest</module-option>
<module-option name = \"dsJndiName\">java:/DefaultDS</module-option>
<module-option name = \"principalsQuery\">SELECT PASSWD FROM JMS_USERS WHERE USERID=?</module-option>
<module-option name = \"rolesQuery\">SELECT ROLEID, \'Roles\' FROM JMS_ROLES WHERE USERID=?</module-option>
</login-module>
</authentication>
</application-policy>

<!-- Security domain for JBossMQ when using file-state-service.xml
<application-policy name = \"jbossmq\">
<authentication>
<login-module code = \"org.jboss.mq.sm.file.DynamicLoginModule\"
flag = \"required\">
<module-option name = \"unauthenticatedIdentity\">guest</module-option>
<module-option name = \"sm.objectname\">jboss.mq:service=StateManager</module-option>
</login-module>
</authentication>
</application-policy>
-->

<!-- Security domains for testing new jca framework -->
<application-policy name = \"HsqlDbRealm\">
<authentication>
<login-module code = \"org.jboss.resource.security.ConfiguredIdentityLoginModule\"
flag = \"required\">
<module-option name = \"principal\">sa</module-option>
<module-option name = \"userName\">sa</module-option>
<module-option name = \"password\"></module-option>
<module-option name = \"managedConnectionFactoryName\">jboss.jca:service=LocalTxCM,name=DefaultDS</module-option>
</login-module>
</authentication>
</application-policy>

<application-policy name = \"JmsXARealm\">
<authentication>
<login-module code = \"org.jboss.resource.security.ConfiguredIdentityLoginModule\"
flag = \"required\">
<module-option name = \"principal\">guest</module-option>
<module-option name = \"userName\">guest</module-option>
<module-option name = \"password\">guest</module-option>
<module-option name = \"managedConnectionFactoryName\">jboss.jca:service=TxCM,name=JmsXA</module-option>
</login-module>
</authentication>
</application-policy>

<!-- A template configuration for the jmx-console web application. This
defaults to the UsersRolesLoginModule the same as other and should be
changed to a stronger authentication mechanism as required.
-->
<application-policy name = \"jmx-console\">
<authentication>
<login-module code=\"org.jboss.security.auth.spi.UsersRolesLoginModule\"
flag = \"required\">
<module-option name=\"usersProperties\">props/jmx-console-users.properties</module-option>
<module-option name=\"rolesProperties\">props/jmx-console-roles.properties</module-option>
</login-module>
</authentication>
</application-policy>

<!-- A template configuration for the web-console web application. This
defaults to the UsersRolesLoginModule the same as other and should be
changed to a stronger authentication mechanism as required.
-->
<application-policy name = \"web-console\">
<authentication>
<login-module code=\"org.jboss.security.auth.spi.UsersRolesLoginModule\"
flag = \"required\">
<module-option name=\"usersProperties\">web-console-users.properties</module-option>
<module-option name=\"rolesProperties\">web-console-roles.properties</module-option>
</login-module>
</authentication>
</application-policy>

<!--
A template configuration for the JBossWS security domain.
This defaults to the UsersRolesLoginModule the same as other and should be
changed to a stronger authentication mechanism as required.
-->
<application-policy name=\"JBossWS\">
<authentication>
<login-module code=\"org.jboss.security.auth.spi.UsersRolesLoginModule\"
flag=\"required\">
<module-option name=\"usersProperties\">props/jbossws-users.properties</module-option>
<module-option name=\"rolesProperties\">props/jbossws-roles.properties</module-option>
<module-option name=\"unauthenticatedIdentity\">anonymous</module-option>
</login-module>
</authentication>
</application-policy>

<!-- OpenKM -->
<application-policy name = \"OpenKM\">
<authentication>
<login-module code=\"org.jboss.security.auth.spi.DatabaseServerLoginModule\" flag = \"required\">
<module-option name=\"dsJndiName\">java:/OKMAuthDS</module-option>
<module-option name=\"principalsQuery\">select usr_pass as PASSWD from users where usr_id=? and usr_active=\'true\'</module-option>
<module-option name=\"rolesQuery\">select ur_role as ROLEID, \'Roles\' from user_role where ur_user=?</module-option>
</login-module>
</authentication>
</application-policy>

<!--<application-policy name = \"OpenKM\">
<authentication>
<login-module code=\"org.jboss.security.auth.spi.UsersRolesLoginModule\" flag = \"required\">
<module-option name=\"usersProperties\">props/users.properties</module-option>
<module-option name=\"rolesProperties\">props/roles.properties</module-option>
</login-module>
<login-module code=\"org.jboss.security.ClientLoginModule\" flag=\"required\" />
</authentication>
</application-policy>-->

<!-- The default login configuration used by any security domain that
does not have a application-policy entry with a matching name
-->
<application-policy name = \"other\">
<!-- A simple server login module, which can be used when the number
of users is relatively small. It uses two properties files:
users.properties, which holds users (key) and their password (value).
roles.properties, which holds users (key) and a comma-separated list of
their roles (value).
The unauthenticatedIdentity property defines the name of the principal
that will be used when a null username and password are presented as is
the case for an unuathenticated web client or MDB. If you want to
allow such users to be authenticated add the property, e.g.,
unauthenticatedIdentity=\"nobody\"
-->
<authentication>
<login-module code = \"org.jboss.security.auth.spi.UsersRolesLoginModule\"
flag = \"required\" />
</authentication>
</application-policy>

</policy>
Post Reply