AW: [opencms-dev] Can someone please answer my question (very important)

Sebastian Jekutsch jekutsch at pcpool.mi.fu-berlin.de
Tue May 4 15:09:01 CEST 2004


Hi Dylan,
 
I was curious enough to look after this, and here's what I discovered for version 5.3.3 (5.0 may be different!):
 
Short answer: Look at org.opencms.db.generic.CmsProjectDriver.fillDefaults().
 
Long answer: 
The call stack while creating the users/groups/projects is
 CmsProjectDriver(CmsProjectDriver).fillDefaults()
 CmsDriverManager.init(ExtendedProperties, I_CmsVfsDriver, I_CmsUserDriver, I_CmsProjectDriver, I_CmsWorkflowDriver, I_CmsBackupDriver)
 CmsDriverManager.newInstance(ExtendedProperties)
 OpenCmsCore.initConfiguration(ExtendedProperties)
 OpenCmsCore.upgradeRunlevel(ExtendedProperties)
 CmsShell.<init>(String, String, I_CmsShellCommands)
 [...]
 
I called CmsShell as an easy way to boot OpenCms. OpenCms has three runlevels:
 (0 - Nothing's up)
 1 - OpenCmsCore is created, some instances for managing vfs, user, project created initially
 2 - Connection to database established, specific manager instances created, CmsObject singleton available
 3 - Servlet-Context created for use of OpenCms in web context
 
We are stuck in upgrading runlevel to 2. In fact, CmsShell runs in level 2 only. OpenCmsCore (something like the operating system of OpenCms) initializes itself from the configuration (opencms.properties in 5.3.3). Here's where the names of the users/groups are taken (key db.default.users). The CmsDriverManager is constructed (a special version for your specific DBMS) and calls fillDefaults(). fillDefaults() also creates projects, i.e. the Online project.
 
As a matter of fact, the default users/groups/projects are created in every boot of OpenCms, not during installation.
 
It wasn't easy to find because fillDefaults() doesn't use the official Java-API (i.e. methods which are collected in CmsObject) but the primitive DB-specific calls in CmsDriverManager.
 
If you like to alter this, it should be straightforward to do, but coding is necessary. It doesn't help to just alter the value of db.default.users in opencms.properties, of course. I think, it's in it for localization only.
 
Hope this helps,
Sebastian
 
--
Sebastian Jekutsch
Arbeitsgruppe Software Engineering
Institut für Informatik
Freie Universität Berlin
Takustr. 9, 14195 Berlin, Germany
+49 30 838 75239
 


	-----Ursprüngliche Nachricht-----
	Von: opencms-dev-admin at opencms.org [mailto:opencms-dev-admin at opencms.org] Im Auftrag von Dylan Milks
	Gesendet: Montag, 3. Mai 2004 23:36
	An: OpenCMS Mailing List (E-mail)
	Betreff: [opencms-dev] Can someone please answer my question (very important)
	
	
	
	I've posted this question about 3 times over the last week and a half. There's got to be someone who can answer it. I don't think it's that hard of a question. I really need the help of the group here.
	 
	Here's the post again.
	 
	/***********************/
	 
	Immediately following a new install, the database contains some records. EX: CMS_USERS table has 2 entries - Guest and Admin. Where are these records inserted? It's easy to see where the tables are created, but not where these records are inserted. And where are these default values declared ? (in a properties or SQL file? I can't seem to find where.)  Nowhere do I see a call to the addUser method where (2, Admin, admin, ...) is passed in to do an insert.
	 
	Thanks, 
	- Dylan

	
________________________________

	This communication, including its attachments, if any, is intended solely for the recipient; it is confidential and may contain personal or private information, or proprietary and/or privileged material. As such, any unauthorized use, retention, copying, disclosure or other distribution of this communication, or the taking of any action in reliance on its contents
	is strictly prohibited. If you have received this communication in error, please notify us immediately and delete this communication (and any attachments.) 

	

	 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20040504/602c8d04/attachment.htm>


More information about the opencms-dev mailing list