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

Variable Index

 o categories
This variable specifies the document categories.
 o creation
This variable specifies the creation action.
 o lastedit
This variable specifies the last edit action.
 o modifications
This variable specifies any modification actions.
 o SYSTEM
The name of a service that provides access to the local file system on request.

Constructor Index

 o File(String, String, String)
Allocates a File object with the specified type, name and title.

Method Index

 o alter()
Creates a data request to modify this document information.
 o alter(String)
Creates a data request to modify this document information.
 o attribute(String)
Returns the document's attribute value with respect to the specified key.
 o attributes()
Returns an enumeration of the attributes.
 o clean()
Clears all information in this document.
 o clear()
Removes all Header objects previously put.
 o collaborate()
Duplicates a File object as a WorkFile object.
 o contains(Integer)
Tests if a document or document header with the specified identifier has previously been put.
 o containsFile(Integer)
Tests if a document with the specified identifier has previously been put.
 o copy(File)
Copies the specified document information into this document.
 o create(Cube)
Creates a data request to create this document with respect to the specified project cube.
 o create(Cube, String)
Creates a data request to create this document with respect to the specified project cube.
 o delete()
Creates a data request to delete this document from the project database.
 o delete(Integer)
Creates a data request to delete the document with the specified identifier from the project database.
 o duplicate()
Duplicates a File object.
 o equals(Object)
Compares this object to the specified object.
 o 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.
 o get(Integer)
Retrieves the File or Header object for the specified identifier, if previously put.
 o getContent()
Returns the content string of this document, if any.
 o getFile(Integer)
Retrieves the File object for the specified identifier, if previously put.
 o hasAttributes()
Returns the number of attributes defined for this document.
 o hasContent()
Returns whether this document contains a content string.
 o hasLinks()
Returns the number of additional links defined for this document.
 o link(Integer)
Returns the document's link with respect to the specified document identifier.
 o link(Integer, String)
Adds a document link.
 o link(Link)
Adds a document link.
 o link(String, String)
Adds a document link.
 o links()
Returns an enumeration of the links.
 o put()
Stores this object for later retrieval by identifier.
 o remove()
Removes this object from local storage, if previously put.
 o remove(Integer)
Removes the File and Header objects with the specified identifier previously put, if any.
 o removeAttribute(String)
Removes an attribute.
 o removeFile(Integer)
Removes the File object with the specified identifier previously put, if any.
 o retrieve(Integer)
Creates a data request to retrieve the document information for the specified identifier.
 o retrieve(Integer, Cube)
Creates a data request to retrieve the document information for the specified identifier.
 o retrieve(Integer[])
Creates a data request to retrieve an array of document informations for the specified identifiers.
 o setAttribute(String, String)
Sets an attribute.
 o setCategories(String)
Sets the document categories.
 o setContent(String)
Sets the content string of this document.
 o unlink(Integer)
Removes a document link.
 o unlink(String)
Removes a document link.
 o upload(Cube, String)
Creates a data request to create this document with respect to the specified project cube.
 o upload(String)
Creates a data request to modify this document information.

Variables

 o SYSTEM
 public static final String SYSTEM
The name of a service that provides access to the local file system on request.

 o categories
 public Vector categories
This variable specifies the document categories.

 o creation
 public Action creation
This variable specifies the creation action.

 o lastedit
 public Action lastedit
This variable specifies the last edit action.

 o modifications
 public Action modifications[]
This variable specifies any modification actions.

Constructors

 o 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

Methods

 o hasContent
 public boolean hasContent()
Returns whether this document contains a content string.

Returns:
true if the content string is not null, false otherwise
 o getContent
 public String getContent()
Returns the content string of this document, if any.

Returns:
the content string, null otherwise
 o hasAttributes
 public int hasAttributes()
Returns the number of attributes defined for this document.

Returns:
the number of attributes
 o 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
 o 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
 o hasLinks
 public int hasLinks()
Returns the number of additional links defined for this document.

Returns:
the number of links
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o link
 public void link(Integer id,
                  String name)
Adds a document link.

Parameters:
id - a document identifier
name - the link name
 o link
 public void link(Link link)
Adds a document link.

Parameters:
id - a document identifier
link - the link object
 o unlink
 public void unlink(String id)
Removes a document link. This method is accessible from JavaScript.

Parameters:
id - a document identifier as a string
 o unlink
 public void unlink(Integer id)
Removes a document link.

Parameters:
id - a document identifier
 o 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
 o duplicate
 public File duplicate()
Duplicates a File object.

Returns:
the duplicate object
 o collaborate
 public WorkFile collaborate()
Duplicates a File object as a WorkFile object.

Returns:
the duplicate object
 o 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
 o clean
 public void clean()
Clears all information in this document. This document cannot be trusted.

 o 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
 o 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
 o 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
 o 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
 o 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
 o put
 public void put()
Stores this object for later retrieval by identifier. Only trusted objects can be stored.

Overrides:
put in class Header
 o remove
 public void remove()
Removes this object from local storage, if previously put.

Overrides:
remove in class Header
 o 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
 o 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
 o clear
 public static void clear()
Removes all Header objects previously put.

 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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.