Java Doc for Collection.java in  » Content-Management-System » dspace » org » dspace » content » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » dspace » org.dspace.content 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.dspace.content.DSpaceObject
      org.dspace.content.Collection

Collection
public class Collection extends DSpaceObject (Code)
Class representing a collection.

The collection's metadata (name, introductory text etc), workflow groups, and default group of submitters are loaded into memory. Changes to metadata are not written to the database until update is called. If you create or remove a workflow group, the change is only reflected in the database after calling update. The default group of submitters is slightly different - creating or removing this has instant effect.
author:
   Robert Tansley
version:
   $Revision: 2339 $




Constructor Summary
 Collection(Context context, TableRow row)
    

Method Summary
public  voidaddItem(Item item)
     Add an item to the collection.
public  voidcanEdit()
    
public  booleancanEditBoolean()
    
public  intcountItems()
    
static  Collectioncreate(Context context)
     Create a new collection, with a new ID.
public  GroupcreateAdministrators()
     Create a default administrators group if one does not already exist.
public  GroupcreateSubmitters()
     Create a default submitters group if one does not already exist.
public  voidcreateTemplateItem()
     Create an empty template item for this collection.
public  GroupcreateWorkflowGroup(int step)
     Create a workflow group for the given step if one does not already exist.
 voiddelete()
     Delete the collection, including the metadata and logo.
public  booleanequals(Object other)
    
public static  Collectionfind(Context context, int id)
     Get a collection from the database.
public static  Collection[]findAll(Context context)
     Get all collections in the system.
public static  Collection[]findAuthorized(Context context, Community comm, int actionID)
     return an array of collections that user has a given permission on (useful for trimming 'select to collection' list) or figuring out which collections a person is an editor for.
public  GroupgetAdministrators()
     Get the default group of administrators, if there is one.
public  ItemIteratorgetAllItems()
     Get all the items in this collection.
public  Community[]getCommunities()
    
public  StringgetHandle()
    
public  intgetID()
    
public  ItemIteratorgetItems()
     Get the in_archive items in this collection.
public  StringgetLicense()
     Get the license that users must grant before submitting to this collection.
public  StringgetLicenseCollection()
     Get the license that users must grant before submitting to this collection.
public  BitstreamgetLogo()
     Get the logo for the collection.
public  StringgetMetadata(String field)
    
public  StringgetName()
    
public  GroupgetSubmitters()
     Get the default group of submitters, if there is one.
public  ItemgetTemplateItem()
     Get the template item for this collection.
public  intgetType()
    
public  GroupgetWorkflowGroup(int step)
     Get the the workflow group corresponding to a particular workflow step.
public  booleanhasCustomLicense()
    
public  voidremoveItem(Item item)
     Remove an item.
public  voidremoveTemplateItem()
     Remove the template item for this collection, if there is one.
public  voidsetLicense(String license)
     Set the license for this collection.
public  BitstreamsetLogo(InputStream is)
     Give the collection a logo.
public  voidsetMetadata(String field, String value)
    
public  voidsetWorkflowGroup(int step, Group g)
     Set the workflow group corresponding to a particular workflow step.
public  voidupdate()
     Update the collection metadata (including logo, and workflow groups) to the database.


Constructor Detail
Collection
Collection(Context context, TableRow row) throws SQLException(Code)
Construct a collection with the given table row
Parameters:
  context - the context this object exists in
Parameters:
  row - the corresponding row in the table
throws:
  SQLException -




Method Detail
addItem
public void addItem(Item item) throws SQLException, AuthorizeException(Code)
Add an item to the collection. This simply adds a relationship between the item and the collection - it does nothing like set an issue date, remove a personal workspace item etc. This has instant effect; update need not be called.
Parameters:
  item - item to add
throws:
  SQLException -
throws:
  AuthorizeException -



canEdit
public void canEdit() throws AuthorizeException, SQLException(Code)



canEditBoolean
public boolean canEditBoolean() throws java.sql.SQLException(Code)



countItems
public int countItems() throws SQLException(Code)
counts items in this collection total items



create
static Collection create(Context context) throws SQLException, AuthorizeException(Code)
Create a new collection, with a new ID. This method is not public, and does not check authorisation.
Parameters:
  context - DSpace context object the newly created collection
throws:
  SQLException -
throws:
  AuthorizeException -



createAdministrators
public Group createAdministrators() throws SQLException, AuthorizeException(Code)
Create a default administrators group if one does not already exist. Returns either the newly created group or the previously existing one. Note that other groups may also be administrators. the default group of editors associated with this collection
throws:
  SQLException -
throws:
  AuthorizeException -



createSubmitters
public Group createSubmitters() throws SQLException, AuthorizeException(Code)
Create a default submitters group if one does not already exist. Returns either the newly created group or the previously existing one. Note that other groups may also be allowed to submit to this collection by the authorization system. the default group of submitters associated with this collection
throws:
  SQLException -
throws:
  AuthorizeException -



createTemplateItem
public void createTemplateItem() throws SQLException, AuthorizeException(Code)
Create an empty template item for this collection. If one already exists, no action is taken. Caution: Make sure you call update on the collection after doing this, or the item will have been created but the collection record will not refer to it.
throws:
  SQLException -
throws:
  AuthorizeException -



createWorkflowGroup
public Group createWorkflowGroup(int step) throws SQLException, AuthorizeException(Code)
Create a workflow group for the given step if one does not already exist. Returns either the newly created group or the previously existing one. Note that while the new group is created in the database, the association between the group and the collection is not written until update is called.
Parameters:
  step - the step (1-3) of the workflow to create or get the group for the workflow group associated with this collection
throws:
  SQLException -
throws:
  AuthorizeException -



delete
void delete() throws SQLException, AuthorizeException, IOException(Code)
Delete the collection, including the metadata and logo. Items that are then orphans are deleted. Groups associated with this collection (workflow participants and submitters) are NOT deleted.
throws:
  SQLException -
throws:
  AuthorizeException -
throws:
  IOException -



equals
public boolean equals(Object other)(Code)
Return true if other is the same Collection as this object, false otherwise
Parameters:
  other - object to compare to true if object passed in represents the samecollection as this object



find
public static Collection find(Context context, int id) throws SQLException(Code)
Get a collection from the database. Loads in the metadata
Parameters:
  context - DSpace context object
Parameters:
  id - ID of the collection the collection, or null if the ID is invalid.
throws:
  SQLException -



findAll
public static Collection[] findAll(Context context) throws SQLException(Code)
Get all collections in the system. These are alphabetically sorted by collection name.
Parameters:
  context - DSpace context object the collections in the system
throws:
  SQLException -



findAuthorized
public static Collection[] findAuthorized(Context context, Community comm, int actionID) throws java.sql.SQLException(Code)
return an array of collections that user has a given permission on (useful for trimming 'select to collection' list) or figuring out which collections a person is an editor for.
Parameters:
  context -
Parameters:
  comm - (optional) restrict search to a community, else null
Parameters:
  actionID - fo the action Collection [] of collections with matching permissions
throws:
  SQLException -



getAdministrators
public Group getAdministrators()(Code)
Get the default group of administrators, if there is one. Note that the authorization system may allow others to be administrators for the collection.

The default group of administrators for collection 100 is the one called collection_100_admin. group of administrators, or null if there is nodefault group.




getAllItems
public ItemIterator getAllItems() throws SQLException(Code)
Get all the items in this collection. The order is indeterminate. an iterator over the items in the collection.
throws:
  SQLException -



getCommunities
public Community[] getCommunities() throws SQLException(Code)
Get the communities this collection appears in array of Community objects
throws:
  SQLException -



getHandle
public String getHandle()(Code)

See Also:   org.dspace.content.DSpaceObject.getHandle



getID
public int getID()(Code)
Get the internal ID of this collection the internal identifier



getItems
public ItemIterator getItems() throws SQLException(Code)
Get the in_archive items in this collection. The order is indeterminate. an iterator over the items in the collection.
throws:
  SQLException -



getLicense
public String getLicense()(Code)
Get the license that users must grant before submitting to this collection. If the collection does not have a specific license, the site-wide default is returned. the license for this collection



getLicenseCollection
public String getLicenseCollection()(Code)
Get the license that users must grant before submitting to this collection. the license for this collection



getLogo
public Bitstream getLogo()(Code)
Get the logo for the collection. null is return if the collection does not have a logo. the logo of the collection, or null



getMetadata
public String getMetadata(String field)(Code)
Get the value of a metadata field
Parameters:
  field - the name of the metadata field to get the value of the metadata field
exception:
  IllegalArgumentException - if the requested metadata field doesn't exist



getName
public String getName()(Code)



getSubmitters
public Group getSubmitters()(Code)
Get the default group of submitters, if there is one. Note that the authorization system may allow others to submit to the collection, so this is not necessarily a definitive list of potential submitters.

The default group of submitters for collection 100 is the one called collection_100_submit. the default group of submitters, or null if thereis no default group.




getTemplateItem
public Item getTemplateItem() throws SQLException(Code)
Get the template item for this collection. null is returned if the collection does not have a template. Submission mechanisms may copy this template to provide a convenient starting point for a submission. the item template, or null



getType
public int getType()(Code)
return type found in Constants int Constants.COLLECTION



getWorkflowGroup
public Group getWorkflowGroup(int step)(Code)
Get the the workflow group corresponding to a particular workflow step. This returns null if there is no group associated with this collection for the given step.
Parameters:
  step - the workflow step (1-3) the group of reviewers or null



hasCustomLicense
public boolean hasCustomLicense()(Code)
Find out if the collection has a custom license true if the collection has a custom license



removeItem
public void removeItem(Item item) throws SQLException, AuthorizeException, IOException(Code)
Remove an item. If the item is then orphaned, it is deleted.
Parameters:
  item - item to remove
throws:
  SQLException -
throws:
  AuthorizeException -
throws:
  IOException -



removeTemplateItem
public void removeTemplateItem() throws SQLException, AuthorizeException, IOException(Code)
Remove the template item for this collection, if there is one. Note that since this has to remove the old template item ID from the collection record in the database, the colletion record will be changed, including any other changes made; in other words, this method does an update.
throws:
  SQLException -
throws:
  AuthorizeException -
throws:
  IOException -



setLicense
public void setLicense(String license)(Code)
Set the license for this collection. Passing in null means that the site-wide default will be used.
Parameters:
  license - the license, or null



setLogo
public Bitstream setLogo(InputStream is) throws AuthorizeException, IOException, SQLException(Code)
Give the collection a logo. Passing in null removes any existing logo. You will need to set the format of the new logo bitstream before it will work, for example to "JPEG". Note that update(/code> will need to be called for the change to take effect. Setting a logo and not calling update later may result in a previous logo lying around as an "orphaned" bitstream.
Parameters:
  is - the stream to use as the new logo the new logo bitstream, or null if there is nologo (null was passed in)
throws:
  AuthorizeException -
throws:
  IOException -
throws:
  SQLException -



setMetadata
public void setMetadata(String field, String value) throws MissingResourceException(Code)
Set a metadata value
Parameters:
  field - the name of the metadata field to get
Parameters:
  value - value to set the field to
exception:
  IllegalArgumentException - if the requested metadata field doesn't exist
exception:
  MissingResourceException -



setWorkflowGroup
public void setWorkflowGroup(int step, Group g)(Code)
Set the workflow group corresponding to a particular workflow step. null can be passed in if there should be no associated group for that workflow step; any existing group is NOT deleted.
Parameters:
  step - the workflow step (1-3)
Parameters:
  g - the new workflow group, or null



update
public void update() throws SQLException, IOException, AuthorizeException(Code)
Update the collection metadata (including logo, and workflow groups) to the database. Inserts if this is a new collection.
throws:
  SQLException -
throws:
  IOException -
throws:
  AuthorizeException -



Methods inherited from org.dspace.content.DSpaceObject
protected void addDetails(String d)(Code)(Java Doc)
protected void clearDetails()(Code)(Java Doc)
public static DSpaceObject find(Context context, int type, int id) throws SQLException(Code)(Java Doc)
protected String getDetails()(Code)(Java Doc)
abstract public String getHandle()(Code)(Java Doc)
abstract public int getID()(Code)(Java Doc)
abstract public String getName()(Code)(Java Doc)
abstract public int getType()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.