All Packages Class Hierarchy This Package Previous Next Index
Class icc.db.File
java.lang.Object
|
+----icc.db.Entity
|
+----icc.db.Header
|
+----icc.db.File
- public class File
- extends Header
the File class represents the information defining a project
document. In addition to the information defined in the Header
class, this includes category, action, attribute and additional link
information.
A document can have any number of categories, type/value attributes and
links beyond the grouping, threading and versioning link information
defined in the Header class.
Action information is automatically added to a document by the project
database as a result of creation, modification and editing actions.
This action information includes author and date/time. A creation action
is specified when the file is created in the database, a modification
action when the document name is modified, and an editing action upon any
other change. Only the most recent editing action is remembered.
This class also defines a number of methods for creating data requests
to create, modify or delete documents. Each project document must reside
in a project cube, which also specifies the access rights for partners
with respect to the reading, writing and deleting of documents.
As a general exception, the creation author of a document always has
delete permission for this document.
A document may be created either by specifying a short text, a path
to be uploaded, an existing URL, or with a content string.
In the case of an upload, this path will replaced by the corresponding URL
upon upload. In the case of a content string, this will be saved and the
corresponding URL will be specified in the document. However, when
retrieving this document, this content string will be included as well.
- See Also:
- Action, Link, WorkFile
-
categories
- This variable specifies the document categories.
-
creation
- This variable specifies the creation action.
-
lastedit
- This variable specifies the last edit action.
-
modifications
- This variable specifies any modification actions.
-
SYSTEM
- The name of a service that provides access to the local file system
on request.
-
File(String, String, String)
- Allocates a File object with the specified type, name and
title.
-
alter()
- Creates a data request to modify this document information.
-
alter(String)
- Creates a data request to modify this document information.
-
attribute(String)
- Returns the document's attribute value with respect to the specified
key.
-
attributes()
- Returns an enumeration of the attributes.
-
clean()
- Clears all information in this document.
-
clear()
- Removes all Header objects previously put.
-
collaborate()
- Duplicates a File object as a WorkFile object.
-
contains(Integer)
- Tests if a document or document header with the specified identifier
has previously been put.
-
containsFile(Integer)
- Tests if a document with the specified identifier has previously been
put.
-
copy(File)
- Copies the specified document information into this document.
-
create(Cube)
- Creates a data request to create this document with respect to the
specified project cube.
-
create(Cube, String)
- Creates a data request to create this document with respect to the
specified project cube.
-
delete()
- Creates a data request to delete this document from the project
database.
-
delete(Integer)
- Creates a data request to delete the document with the specified
identifier from the project database.
-
duplicate()
- Duplicates a File object.
-
equals(Object)
- Compares this object to the specified object.
-
find(Cube, String)
- Creates a data request to find and retrieve the document corresponding
the specified document name and with respect to the specified project
cube.
-
get(Integer)
- Retrieves the File or Header object for the
specified identifier, if previously put.
-
getContent()
- Returns the content string of this document, if any.
-
getFile(Integer)
- Retrieves the File object for the specified identifier,
if previously put.
-
hasAttributes()
- Returns the number of attributes defined for this document.
-
hasContent()
- Returns whether this document contains a content string.
-
hasLinks()
- Returns the number of additional links defined for this document.
-
link(Integer)
- Returns the document's link with respect to the specified
document identifier.
-
link(Integer, String)
- Adds a document link.
-
link(Link)
- Adds a document link.
-
link(String, String)
- Adds a document link.
-
links()
- Returns an enumeration of the links.
-
put()
- Stores this object for later retrieval by identifier.
-
remove()
- Removes this object from local storage, if previously put.
-
remove(Integer)
- Removes the File and Header objects with the
specified identifier previously put, if any.
-
removeAttribute(String)
- Removes an attribute.
-
removeFile(Integer)
- Removes the File object with the specified identifier
previously put, if any.
-
retrieve(Integer)
- Creates a data request to retrieve the document information for
the specified identifier.
-
retrieve(Integer, Cube)
- Creates a data request to retrieve the document information for
the specified identifier.
-
retrieve(Integer[])
- Creates a data request to retrieve an array of document informations for
the specified identifiers.
-
setAttribute(String, String)
- Sets an attribute.
-
setCategories(String)
- Sets the document categories.
-
setContent(String)
- Sets the content string of this document.
-
unlink(Integer)
- Removes a document link.
-
unlink(String)
- Removes a document link.
-
upload(Cube, String)
- Creates a data request to create this document with respect to the
specified project cube.
-
upload(String)
- Creates a data request to modify this document information.
SYSTEM
public static final String SYSTEM
- The name of a service that provides access to the local file system
on request.
categories
public Vector categories
- This variable specifies the document categories.
creation
public Action creation
- This variable specifies the creation action.
lastedit
public Action lastedit
- This variable specifies the last edit action.
modifications
public Action modifications[]
- This variable specifies any modification actions.
File
public File(String type,
String name,
String title)
- Allocates a File object with the specified type, name and
title. The document identifier is set to NEW.
- Parameters:
- type - a document type
- name - a document name
- title - a document title
- See Also:
- NEW
hasContent
public boolean hasContent()
- Returns whether this document contains a content string.
- Returns:
- true if the content string is not null,
false otherwise
getContent
public String getContent()
- Returns the content string of this document, if any.
- Returns:
- the content string, null otherwise
hasAttributes
public int hasAttributes()
- Returns the number of attributes defined for this document.
- Returns:
- the number of attributes
attribute
public String attribute(String key)
- Returns the document's attribute value with respect to the specified
key.
- Parameters:
- key - the attribute key
- Returns:
- the attribute value
attributes
public Enumeration attributes()
- Returns an enumeration of the attributes. Use the Enumeration
methods on the returned object to fetch the elements sequentially.
- Returns:
- an enumeration of the attributes
hasLinks
public int hasLinks()
- Returns the number of additional links defined for this document.
- Returns:
- the number of links
link
public Link link(Integer key)
- Returns the document's link with respect to the specified
document identifier.
- Parameters:
- key - the other document's identifier
- Returns:
- a link object
links
public Enumeration links()
- Returns an enumeration of the links. Use the Enumeration
methods on the returned object to fetch the elements sequentially.
- Returns:
- an enumeration of the links
setContent
public void setContent(String text)
- Sets the content string of this document. Any previous setting is lost.
Altering the document's content has no actual effect until this
content is also updated in the database.
- Parameters:
- text - a text
- See Also:
- alter
setAttribute
public void setAttribute(String key,
String value)
- Sets an attribute. Any previous setting for this attribute is lost.
Altering the document's attributes has no actual effect until these
attributes are also updated in the database.
- Parameters:
- key - the attribute key
- value - the attribute value
- See Also:
- alter
removeAttribute
public void removeAttribute(String key)
- Removes an attribute.
Altering the document's attributes has no actual effect until these
attributes are also updated in the database.
- Parameters:
- key - the attribute key
- See Also:
- alter
link
public void link(String id,
String name)
- Adds a document link.
This method is accessible from JavaScript.
- Parameters:
- id - a document identifier as a string
- name - the link name
link
public void link(Integer id,
String name)
- Adds a document link.
- Parameters:
- id - a document identifier
- name - the link name
link
public void link(Link link)
- Adds a document link.
- Parameters:
- id - a document identifier
- link - the link object
unlink
public void unlink(String id)
- Removes a document link.
This method is accessible from JavaScript.
- Parameters:
- id - a document identifier as a string
unlink
public void unlink(Integer id)
- Removes a document link.
- Parameters:
- id - a document identifier
setCategories
public boolean setCategories(String categories)
- Sets the document categories. Each term in the specified categories
string is assigned as a category to the document.
Any previously specified categories are lost.
- Parameters:
- categories - a string of categories separated by spaces
- Returns:
- true if each of the terms has no more than 20
characters; false otherwise
duplicate
public File duplicate()
- Duplicates a File object.
- Returns:
- the duplicate object
collaborate
public WorkFile collaborate()
- Duplicates a File object as a WorkFile object.
- Returns:
- the duplicate object
copy
public void copy(File from)
- Copies the specified document information into this document.
This document cannot be trusted.
- Parameters:
- from - the document information to be copied
clean
public void clean()
- Clears all information in this document.
This document cannot be trusted.
equals
public boolean equals(Object obj)
- Compares this object to the specified object.
The result is true if and only if the argument is not
null and is an object of the same class that has the same
identifier (or either identifier equals to NEW), type, title,
and grouping, threading and versioning links as this object.
- Parameters:
- obj - the object to compare with
- Returns:
- true if the objects are the same;
false otherwise
- Overrides:
- equals in class Header
containsFile
public static boolean containsFile(Integer id)
- Tests if a document with the specified identifier has previously been
put.
- Parameters:
- id - a document identifier
- Returns:
- true if this document has previously been
put; false otherwise
contains
public static boolean contains(Integer id)
- Tests if a document or document header with the specified identifier
has previously been put.
- Parameters:
- id - a document identifier
- Returns:
- true if this document has previously been
put; false otherwise
getFile
public static File getFile(Integer id)
- Retrieves the File object for the specified identifier,
if previously put.
- Parameters:
- id - a document identifier
- Returns:
- the document corresponding this identifier, if known;
otherwise null
get
public static Header get(Integer id)
- Retrieves the File or Header object for the
specified identifier, if previously put.
- Parameters:
- id - a document identifier
- Returns:
- the document corresponding this identifier, if known;
otherwise null
put
public void put()
- Stores this object for later retrieval by identifier.
Only trusted objects can be stored.
- Overrides:
- put in class Header
remove
public void remove()
- Removes this object from local storage, if previously put.
- Overrides:
- remove in class Header
removeFile
public static File removeFile(Integer id)
- Removes the File object with the specified identifier
previously put, if any.
- Parameters:
- id - a document identifier
- Returns:
- the object in question, if any; otherwise null
remove
public static void remove(Integer id)
- Removes the File and Header objects with the
specified identifier previously put, if any.
- Parameters:
- id - a document identifier
- Returns:
- the object in question, if any; otherwise null
clear
public static void clear()
- Removes all Header objects previously put.
retrieve
public static DataRequest retrieve(Integer id)
- Creates a data request to retrieve the document information for
the specified identifier. Only partners with read
permission for this document can submit this request successfully.
- Parameters:
- id - a document identifier
- Returns:
- a data request to retrieve document information
- See Also:
- SERVICE
retrieve
public static DataRequest retrieve(Integer id,
Cube cube)
- Creates a data request to retrieve the document information for
the specified identifier. Only partners with read permission for
this document can submit this request successfully.
This data request will return the specified project cube as an
argument in the result.
- Parameters:
- id - a document identifier
- cube - a project cube
- Returns:
- a data request to retrieve document information
- See Also:
- SERVICE, Cube
retrieve
public static DataRequest retrieve(Integer ids[])
- Creates a data request to retrieve an array of document informations for
the specified identifiers. Only documents for which the partner has read
permission will make part of the result, other entries in the array will
be null.
- Parameters:
- ids - an array of document identifiers
- Returns:
- a data request to retrieve an array of document informations
- See Also:
- SERVICE
delete
public static DataRequest delete(Integer id)
- Creates a data request to delete the document with the specified
identifier from the project database. Only partners with delete
permission for this document can submit this request.
If successful, an appropriate event is posted.
- Parameters:
- id - a document identifier
- Returns:
- a data request to delete a project document
- See Also:
- SERVICE, FileEvents
delete
public DataRequest delete()
- Creates a data request to delete this document from the project
database. Only partners with delete permission for this document can
submit this request. If successful, an appropriate event is posted.
- Returns:
- a data request to delete a project document
- See Also:
- SERVICE, FileEvents
create
public DataRequest create(Cube cube)
- Creates a data request to create this document with respect to the
specified project cube. Only partners with write permission for this
project cube can submit this request.
If successful, an appropriate event is posted.
- Parameters:
- cube - a project cube
- Returns:
- a data request to create a project document
- See Also:
- SERVICE, FileEvents
create
public DataRequest create(Cube cube,
String content)
- Creates a data request to create this document with respect to the
specified project cube. The specified content is written to a file in
an HTTP accessible directory and the corresponding URL is taken as
the document name. Only partners with write permission for this
project cube can submit this request.
If successful, an appropriate event is posted.
- Parameters:
- cube - a project cube
- content - the content string to be written to a file
- Returns:
- a data request to create a project document
- See Also:
- SERVICE, FileEvents
upload
public DataRequest upload(Cube cube,
String filename)
- Creates a data request to create this document with respect to the
specified project cube. If a service is available that allows access
to the local file system, the specified file is copied into an HTTP
accessible directory and the corresponding URL is taken as the
document name. Only partners with write permission for this
project cube can submit this request.
If successful, an appropriate event is posted.
- Parameters:
- cube - a project cube
- filename - the name of a file in the local file system
- Returns:
- a data request to create a collaborative project document
- See Also:
- SERVICE, FileEvents
alter
public DataRequest alter()
- Creates a data request to modify this document information.
Only partners with write permission for this document can submit
this request. If successful, an appropriate event is posted.
- Returns:
- a data request to modify document information
- See Also:
- SERVICE, PartnerEvents
alter
public DataRequest alter(String content)
- Creates a data request to modify this document information.
The specified content is written to a file in an HTTP accessible
directory and the corresponding URL is taken as the document name.
Only partners with write permission for this document can submit
this request. If successful, an appropriate event is posted.
- Returns:
- a data request to modify document information
- See Also:
- SERVICE, PartnerEvents
upload
public DataRequest upload(String filename)
- Creates a data request to modify this document information.
If a service is available that allows access to the local file system,
the specified file is copied into an HTTP accessible directory and the
corresponding URL is taken to be the document name.
Only partners with write permission for this document can submit
this request. If successful, an appropriate event is posted.
- Parameters:
- filename - the name of a file in the local file system
- Returns:
- a data request to modify collaborative document information
- See Also:
- SERVICE, PartnerEvents
find
public static DataRequest find(Cube cube,
String name)
- Creates a data request to find and retrieve the document corresponding
the specified document name and with respect to the specified project
cube.
- Parameters:
- cube - a project cube
- name - a document name
- Returns:
- a data request to find a document identifier
- See Also:
- SERVICE
All Packages Class Hierarchy This Package Previous Next Index
This website has been archived and is no longer maintained.