Difference between revisions of "API:EPrints/NamedSet"
Line 8: | Line 8: | ||
'''EPrints::NamedSet''' - Repository Configuration | '''EPrints::NamedSet''' - Repository Configuration | ||
− | |||
− | |||
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
− | |||
<!-- Pod2Wiki=head_synopsis --> | <!-- Pod2Wiki=head_synopsis --> | ||
==SYNOPSIS== | ==SYNOPSIS== | ||
− | + | <source lang="perl">$namedset = EPrints::NamedSet->new( "eprint", | |
− | + | repository => $repository | |
− | + | ); | |
− | + | ||
− | + | $namedset->add_option( "performance", "my_package" ); | |
− | + | $namedset->remove_option( "thesis", "my_package" );</source> | |
− | + | ||
− | < | ||
− | |||
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
− | |||
<!-- Pod2Wiki=head_description --> | <!-- Pod2Wiki=head_description --> | ||
==DESCRIPTION== | ==DESCRIPTION== | ||
A utility class to manipulate named sets. Add and remove methods are designed to be called by Bazaar Packages | A utility class to manipulate named sets. Add and remove methods are designed to be called by Bazaar Packages | ||
− | |||
− | |||
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
− | |||
<!-- Pod2Wiki=head_methods --> | <!-- Pod2Wiki=head_methods --> | ||
==METHODS== | ==METHODS== | ||
− | < | + | <!-- Pod2Wiki=head_new --> |
− | + | ===new=== | |
− | |||
− | |||
− | < | + | <source lang="perl">$namedset = EPrints::NamedSet->new( $id, %opts ) |
− | |||
− | |||
− | |||
− | + | </source> | |
− | |||
− | |||
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
− | + | <!-- Pod2Wiki=head_add_option --> | |
− | <!-- Pod2Wiki= | ||
===add_option=== | ===add_option=== | ||
− | + | <source lang="perl">$nameset->add_option( $option, $package_name [, $index] ) | |
+ | |||
+ | </source> | ||
Add an option to the named set. | Add an option to the named set. | ||
Line 72: | Line 57: | ||
If it already exists, index is ignored. | If it already exists, index is ignored. | ||
− | |||
− | |||
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
− | + | <!-- Pod2Wiki=head_remove_option --> | |
− | <!-- Pod2Wiki= | ||
===remove_option=== | ===remove_option=== | ||
− | + | <source lang="perl">$namedset->remove_option( $option, $package_name ) | |
+ | |||
+ | </source> | ||
Remove an option from the named set. | Remove an option from the named set. | ||
− | |||
− | |||
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
− | + | <!-- Pod2Wiki=head_remove --> | |
− | <!-- Pod2Wiki= | ||
===remove=== | ===remove=== | ||
− | + | <source lang="perl">$ok = $namedset->remove | |
+ | |||
+ | </source> | ||
Remove the namedset from the file system. | Remove the namedset from the file system. | ||
− | |||
− | |||
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
− | |||
<!-- Pod2Wiki=head_copyright --> | <!-- Pod2Wiki=head_copyright --> | ||
==COPYRIGHT== | ==COPYRIGHT== | ||
− | + | : Copyright 2000-2011 University of Southampton. | |
− | + | ||
+ | : This file is part of EPrints http://www.eprints.org/. | ||
+ | |||
+ | : EPrints is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
+ | |||
+ | : EPrints is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. | ||
+ | |||
+ | : You should have received a copy of the GNU Lesser General Public License along with EPrints. If not, see http://www.gnu.org/licenses/. | ||
+ | |||
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
− | + | <!-- Pod2Wiki=_postamble_ --> | |
− | <!-- Pod2Wiki=_postamble_ --><!-- Edit below this comment --> | + | <!-- Edit below this comment --> |
Latest revision as of 09:56, 22 January 2013
EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects
Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki
Contents
NAME
EPrints::NamedSet - Repository Configuration
SYNOPSIS
$namedset = EPrints::NamedSet->new( "eprint",
repository => $repository
);
$namedset->add_option( "performance", "my_package" );
$namedset->remove_option( "thesis", "my_package" );
DESCRIPTION
A utility class to manipulate named sets. Add and remove methods are designed to be called by Bazaar Packages
METHODS
new
$namedset = EPrints::NamedSet->new( $id, %opts )
add_option
$nameset->add_option( $option, $package_name [, $index] )
Add an option to the named set.
If the option already exists and is not core or already beloning to this package then a required_by field is added to the file.
If it already exists, index is ignored.
remove_option
$namedset->remove_option( $option, $package_name )
Remove an option from the named set.
remove
$ok = $namedset->remove
Remove the namedset from the file system.
COPYRIGHT
- Copyright 2000-2011 University of Southampton.
- This file is part of EPrints http://www.eprints.org/.
- EPrints is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
- EPrints is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public License along with EPrints. If not, see http://www.gnu.org/licenses/.