## com.arsdigita.cms.docmgr
Class Repository

    java.lang.Object
      com.arsdigita.domain.DomainObject
          com.arsdigita.domain.ObservableDomainObject
              com.arsdigita.kernel.ACSObject
                  com.arsdigita.kernel.Resource
                      com.arsdigita.web.Application
                          com.arsdigita.cms.docmgr.Repository

public class Repository
extends com.arsdigita.web.Application

A repository is the application that provides access to files and folders.

Author:
  Stefan Deusch (stefan@arsdigita.com), Ron Henderson (ron@arsdigita.com)

Field Summary
`static String` `BASE_DATA_OBJECT_TYPE`
`static String` `OWNER`
`static String` `ROOT`

Fields inherited from class com.arsdigita.web.Application
`PRIMARY_URL, versionId`

Fields inherited from class com.arsdigita.kernel.Resource
`CHILD_RESOURCE, DESCRIPTION, PARENT_RESOURCE, RESOURCE_TYPE, TIMESTAMP, TITLE`

Fields inherited from class com.arsdigita.kernel.ACSObject
`CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE`

Constructor Summary
`Repository(BigDecimal id)` Constructor.
`Repository(com.arsdigita.persistence.DataObject obj)` Constructs a repository from the underlying data object.
`Repository(com.arsdigita.persistence.OID oid)` Retreives a repository from the database usings its OID.

Method Summary
`protected void` `afterSave()` Grant write permission to the Portal participants.
`protected void` `beforeSave()`
`static Repository` `create(String urlName, String title, com.arsdigita.web.Application parent)` This is called when the application is created.
`protected String` `getBaseDataObjectType()`
`static Repository` `getCurrentRepository(HttpServletRequest req)`
`com.arsdigita.kernel.Party` `getOwner()` Returns the party owning the repository.
`static DocumentCollection` `getRecentlyModifiedDocuments()`
`static DocumentCollection` `getRecentlyModifiedDocuments(Repository rep)`
`DocFolder` `getRoot()`
`static Resource` `retrieveResource(String absPath)` Convenience method to retrieve a resource (file or folder) by absolute path name.
`void` `setLegacyRoot()`
`static void` `setRepositoryRoot(String folderName)` Special case, only called by import script, so we can specify where the root folders of repositories belong.

Methods inherited from class com.arsdigita.web.Application

`afterDelete, beforeDelete, createApplication, createApplication, createRootApplication, getAncestorApplications, getApplicationType, getCanonicalURL, getChildApplications, getChildApplicationsForType, getContainingApplication, getContextPath, getCurrentApplication, getPackageType, getParentApplication, getPath, getPrimaryURL, getRelevantPrivileges, getServletPath, getSiteNode, getStylesheetPath, isInstalled, retrieveAllApplications, retrieveApplication, retrieveApplication, retrieveApplication, retrieveApplicationForPath, retrieveApplicationForSiteNode, setApplicationType, setParentApplication, setPath`

Methods inherited from class com.arsdigita.kernel.Resource
`createResource, createResource, getChildResources, getContainer, getContainingResource, getDescription, getDisplayName, getParentResource, getResourceType, getTimestamp, getTitle, isContainerModified, retrieveAllResources, retrieveResource, retrieveResource, retrieveResource, setDescription, setParentResource, setResourceType, setTitle`

Methods inherited from class com.arsdigita.kernel.ACSObject
`assertPrivilege, checkPrivilege, doCreateCheck, doWriteCheck, getDefaultDomainClass, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, initialize, setID, setID`

Methods inherited from class com.arsdigita.domain.ObservableDomainObject
`addObserver, getObservers`

Methods inherited from class com.arsdigita.domain.DomainObject
`add, add, addToAssociation, clear, delete, disconnect, equals, get, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject, toString`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### BASE_DATA_OBJECT_TYPE

    public static final String BASE_DATA_OBJECT_TYPE

See Also:
  Constant Field Values

### OWNER

    public static final String OWNER

See Also:
  Constant Field Values

### ROOT

    public static final String ROOT

See Also:
  Constant Field Values

Constructor Detail

### Repository

    public Repository(com.arsdigita.persistence.OID oid)
               throws com.arsdigita.domain.DataObjectNotFoundException

  Retreives a repository from the database usings its OID.

Parameters:
  `oid` - the OID of the repository

### Repository

    public Repository(BigDecimal id)
               throws com.arsdigita.domain.DataObjectNotFoundException

  Constructor. The contained `DataObject` is retrieved from the persistent storage mechanism with an `OID` specified by id.

Parameters:
  `id` - The `id` for the retrieved `DataObject`.

### Repository

    public Repository(com.arsdigita.persistence.DataObject obj)

  Constructs a repository from the underlying data object.

Method Detail

### getBaseDataObjectType

    protected String getBaseDataObjectType()

### beforeSave

    protected void beforeSave()

### afterSave

    protected void afterSave()

  Grant write permission to the Portal participants.

### create

    public static Repository create(String urlName,
                                    String title,
                                    com.arsdigita.web.Application parent)

  This is called when the application is created.

### setRepositoryRoot

    public static void setRepositoryRoot(String folderName)

  Special case, only called by import script, so we can specify where the root folders of repositories belong. For instance, if the content section is "foo", and the folderName argument is "special", whenever a Repository is instantiated it will create its root DocFolder under "foo/special".

### retrieveResource

    public static Resource retrieveResource(String absPath)

  Convenience method to retrieve a resource (file or folder) by absolute path name.

### getOwner

    public com.arsdigita.kernel.Party getOwner()

  Returns the party owning the repository.

  Returns:
    the party owning the repository.

### getRoot

    public DocFolder getRoot()

  Returns:
    the root file folder for this repository

### setLegacyRoot

    public void setLegacyRoot()

### getRecentlyModifiedDocuments

    public static DocumentCollection getRecentlyModifiedDocuments()

### getRecentlyModifiedDocuments

    public static DocumentCollection getRecentlyModifiedDocuments(Repository rep)

### getCurrentRepository

    public static Repository getCurrentRepository(HttpServletRequest req)

Copyright (c) 2006 Red Hat, Inc. Corporation. All Rights Reserved. Generated at June 1 2006:1113 UTC