[Cosmo] Like the simple SQL wrapper
bcm at maz.org
Thu Jan 5 04:40:39 PST 2006
On 1/5/06, Jared Rhine <jared at wordzoo.com> wrote:
> It'd be cool to see a quick example or useful hack in bin or elsewhere
> that preserves this pattern, recently removed by a patch:
> -# generate the list of users in the user db
> -echo "Writing list of user accounts to $USERFILE"
> -java -jar $TOMCATLIB/hsqldb-18.104.22.168.jar \
> - --rcfile "$SQLTOOL_RC" --noinput \
> - --sql 'select limit 0 0 username from user order by upper(username);' \
> - cosmo-0.2 > "$USERFILE"
> Granted, this was only in the code for a couple hours, but it was
> certainly educational to see fly by, and savvy sysadmins who can do
> this but can't write something like
> org.osaf.cosmo.ops.HomeDirectoryRecoverer would be happy to find this
> hack in a script somewhere.
you can do something very similar with CMP without having to know
anything about cosmo's storage implementation:
GET /api/users ( 0.2)
GET /cmp/users (0.3)
granted this returns all public user attributes, in xml, and the list
is not ordered, but savvy sysadmins can winnow that down to an ordered
list of usernames pretty quickly :) adding ordering and an attribute
filter is on the table for 0.3.
More information about the Cosmo