Oliver
Thank you. Is there a simple way to access domain xml from AbstractRDBMSAdapter.java ?
I was considering to do the following
slide.properties:
----------------------
# RDBMS Object Name for URI
# Default: URI (if missing or not set then URI is used)
org.apache.slide.store.impl.rdbms.rdbmsobjectname.URI=SLIDE_URI
AbstratRDBMSAdapter.java:
--------------------------------------------
private static String resolveRDBMSObjectName(String name)
{
//rdbms object name is configured in slide.properties
//as proertynames prefixed with
// "org.apache.slide.store.impl.rdbms.rdbmsobjectname."
//for example, property name for URI will be set as
// org.apache.slide.store.impl.rdbms.rdbmsobjectname.URI=SLIDE_URI
String propertyName = "org.apache.slide.store.impl.rdbms.rdbmsobjectname."+ name;
//return the original name if property is not set so that slide
//will stay backward compatible.
return org.apache.slide.util.Configuration.getDefault().getProperty(propertyName ,
name);
}
Code changes to support entries in slide.properties look very simple. I can move it to
domain.xml instead of slide.properties, if that's more appropriate in line with slide
development standards. Could you guide me on how you would like Domain.xml to be
modified?
-- xml fragment to be added to Domain.xml ?
-- does it require any changes to any DTD/Schema files?
-- does it require changes to Domain.java?
-- any code fragment for simple access of these setting from Domain xml
Thanks for your help. Look forward to your response.
regards
Var George
Oliver Zeigermann <[EMAIL PROTECTED]> wrote: Sounds like a good idea to me. What about configuring the table names in
Domain.xml?
Also having the old table names as default would be good for backward
compatibility.
Oliver
Var George schrieb:
When I try to create slide tables on my existing application schema, I have some name
conflicts because slide tables are named without any namespace prefix (e.g.
PERMISSIONS vs SLIDE_PERMISSIONS). I would like to make slide table names configurable
to solve this problem.
Here are the changes that I am considering
1. AbstratRDBMSAdapter.java:
---------------------------------------
Define constants for all table names and statically initialize them from a property file
(slide.properties ?). if property files doesn’t exist or property is not configured
then initialize them to use default names (this way these changes will be backward compatible)
e.g.
protected final String URI_TABLE = resolveRDBMSObjectName(“URI”);;
2. StandardRDBMSAdapter.java
--------------------------------------------
Update this class to use the constants instead of hard coded table names
e.g.
connection.prepareStatement("select 1 from " + OBJECT_TABLE + " o, " + URI_TABLE + " u " +
where o.URI_ID=u.URI_ID and u.URI_STRING=?");
3. CommonRDBMSAdapter.java
----------------------------------------
Update this class to use the constants instead of hard coded table names, similar to
(2)
4. RDBMSComparableResourcesPool.java
---------------------------------------------------------
Update this class to use the constants instead of hard coded table names, similar to
(2)
I am using CommonRDBMSAdapter against Oracle 9i so I am not sure how many of the
platform specific **RDBMSAdapter classes are required but the strategy will be to
apply changes to all required classes similar to (2)
Please let know you your thoughts on this approach. Also I would like to know if slide
team is interested to pull these changes into slide as a standard enhancement. I will
be glad to send my changes if you are interested.
regards
Var George
---------------------------------
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.