Noid
view release on metacpan or search on metacpan
'get/brief' =>
q@
noid get Id Element ... # fetch/map Elements without labels
@,
'get' =>
q@@,
'hello/brief' =>
q@@,
'hello' =>
q@@,
'hold/brief' =>
q@
noid hold (set|release) Id ... # place or remove a "hold" on Id(s)
@,
'hold' =>
q@@,
'mint/brief' =>
q@
noid mint N [ Elem Value ] # to mint N identifiers (optionally binding)
@,
'mint' =>
q@@,
'note/brief' =>
q@@,
'note' =>
q@@,
'peppermint/brief' =>
q@@,
'peppermint' =>
q@@,
'queue/brief' =>
q@
noid queue (now|first|lvf|Time) Id ... # queue (eg, recycle) Id(s)
Time is NU, meaning N units, where U= d(ays) | s(econds).
With "lvf" (Lowest Value First) lowest value of id will mint first.
@,
'queue' =>
q@@,
'validate/brief' =>
q@
noid validate Template Id ... # to check if Ids are valid
Use Template of "-" to use the minter's native template.
@,
'validate' =>
q@@,
);
return(1);
}
sub who_are_you { my( $web )=@_;
my $user;
if ($web) {
$user = $ENV{'REMOTE_USER'} || '';
my $host = $ENV{'REMOTE_HOST'} || $ENV{'REMOTE_ADDR'} || '';
$user .= '@' . $host;
}
# Look up by REAL_USER_ID first.
my ($name, undef, undef, $gid) = getpwuid($<);
my $ugid = getlogin() || $name;
! $ugid and
return "";
$ugid .= "/" . ((getgrgid($gid))[0] || "");
# If EFFECTIVE_USER_ID differs from REAL_USER_ID, get its info too.
if ($> ne $<) {
($name, undef, undef, $gid) = getpwuid($>);
! $name and
return "";
$ugid .= " ($name/" . ((getgrgid($gid))[0] || "") . ")";
}
$user = ($user ? "$user $ugid" : $ugid);
return $user;
}
exit 0;
1;
# yyy Possible for 'c' mask char:
# ASCII 33 to 126 (no SPACE, no DEL) --> 94 (not prime)
# MINUS the 5 chars: / \ - % " --> 89 (prime)
# or MINUS the 5 chars: / \ - % . --> 89 (prime)
# or MINUS the 5 chars: / \ - % SPACE --> 89 (prime)
#
# Note: current (1/2004) restrictions on ARKs are alphanums plus
# = @ $ _ * + #
# with the following reserved for special purposes
# / . - %
# yyy noid example: shuffle play (as in random song list)
# yyy bind is pair-wise or triple-wise? (how to explain consistently)
# yyy add java class to distro
# yyy add pdf of doc to distro
__END__
=pod
=for roff
.nr PS 12p
.nr VS 14.4p
=head1 NAME
noid - nice opaque identifier generator commands
=head1 SYNOPSIS
B<noid> [ B<-f> I<Dbdir> ] [ B<-vh> ] I<Command> I<Arguments>
=head1 DESCRIPTION
The B<noid> utility creates minters (identifier generators) and accepts
commands that operate them. Once created, a minter can be used to produce
persistent, globally unique names for documents, databases, images,
vocabulary terms, etc. Properly managed, these identifiers can be used as
long term durable information object references within naming schemes such
as ARK, PURL, URN, DOI, and LSID. At the same time, alternative minters
can be set up to produce short-lived names for transaction identifiers,
compact web server session keys, and other ephemera.
A B<noid> minter is a lightweight database designed for efficiently
generating, tracking, and binding unique identifiers, which are produced
without replacement in random or
sequential order, and with or without a check character that can be used
( run in 1.806 second using v1.01-cache-2.11-cpan-39bf76dae61 )