I have been assigned by my manager (ie myself and some partners in crime) the grateful task to integrate the Drupal CMS registration system with other database systems. The idea would be that people could login once, and then be never bothered again. Some would get in via Drupal, others via other means. Drupal knows users, roles, profiles and domains. I have been able to recreate the authentication (md5) within a java class, and creating users and roles according to the drupal world. Next on the list are the Drupal profiles. Here is where it gets interesting:

Drupal uses one table to describe the profile layout (default_profile_fields), and another one to hook these things up with values, in default_profile_values


schema of default_profile_fields:

CREATE TABLE `default_profile_fields` (
  `fid` int(11) NOT NULL auto_increment,
  `title` varchar(255) default NULL,
  `name` varchar(128) NOT NULL default '',
  `explanation` text,
  `category` varchar(255) default NULL,
  `page` varchar(255) default NULL,
  `type` varchar(128) default NULL,
  `weight` tinyint(4) NOT NULL default '0',
  `required` tinyint(4) NOT NULL default '0',
  `register` tinyint(4) NOT NULL default '0',
  `visibility` tinyint(4) NOT NULL default '0',
  `autocomplete` tinyint(4) NOT NULL default '0',
  `options` text,
  PRIMARY KEY  (`fid`),
  UNIQUE KEY `name` (`name`),
  KEY `category` (`category`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;

(Don't bother about the mysql, it will be in postgresql)

An example of default_profile_fields:

INSERT INTO `default_profile_fields` (`fid`, `title`, `name`, `explanation`, `category`, `page`, `type`, `weight`, `required`, `register`, `visibility`, `autocomplete`, `options`) VALUES (1, 'Name', 'profile_naam', '', 'Personaldata', '', 'textfield', -10, 1, 1, 2, 0, ''), (2, 'Surname', 'profile_achternaam', '', 'Personaldata', '', 'textfield', -9, 1, 1, 2, 0, '');

The default_profile_values schema:
CREATE TABLE `default_profile_values` (
  `fid` int(10) unsigned NOT NULL default '0',
  `uid` int(10) unsigned NOT NULL default '0',
  `value` text,
  PRIMARY KEY  (`uid`,`fid`),
  KEY `fid` (`fid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


The default_profile_values is filled in such a way:
INSERT INTO `default_profile_values` (`fid`, `uid`, `value`) VALUES
(2, 18, 'Ginger'),
(1, 18, 'Fred');


As you might notice, for a profile of a person with, let's say, 20 attributes, one would end up with a smorgasbord of 20 records in default_profile_values.

I have two questions:
-would it be possible to replicate such a thing in WebObjects? I can imagine creating the default_profile_fields table, that should not be too hard. Creating the form using the data from the default_profile_fields, and the values from default_profile_values fills me with ?wonder?.

-will it blend, sorry, will it scale? I have doubts about this schema when you start having large amounts of users. The enormous amount of records that have to be fetched for for the profile of a user make me question if this will be scalable.

Any ideas about this?

Examples of other WebObjects projects that do something similar?

Regards,

Johan Henselmans
http://www.netsense.nl
Tel: +31-20-6267538
Fax: +31-20-6279159



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to