org.outerj.daisy.repository.variant
Interface VariantManager


public interface VariantManager

Allows to manage the branch and language definitions.

Note that this is only about defining branches and languages, the actual creation of documents on these branches and languages is done through the Repository API.


Method Summary
 Branch createBranch(java.lang.String name)
          Creates a new branch definition.
 Language createLanguage(java.lang.String name)
           
 void deleteBranch(long id)
          Deletes a branch.
 void deleteLanguage(long id)
           
 Branches getAllBranches(boolean updateable)
           
 Languages getAllLanguages(boolean updateable)
           
 Branch getBranch(long id, boolean updateable)
          Retrieves a branch by ID.
 Branch getBranch(java.lang.String branch, boolean updateable)
          Retrieves a branch by ID or by name depending on whether the branch parameter starts with a digit.
 Branch getBranchByName(java.lang.String name, boolean updateable)
          Retrieves a branch by name.
 Language getLanguage(long id, boolean updateable)
           
 Language getLanguage(java.lang.String language, boolean updateable)
           
 Language getLanguageByName(java.lang.String name, boolean updateable)
           
 

Method Detail

createBranch

public Branch createBranch(java.lang.String name)
Creates a new branch definition. The branch is not immediately created in the repository, you need to call the save() method of the returned object to do this.

Parameters:
name - a unique name satisfying the regexp "[a-zA-Z][a-zA-Z\-_0-9]*"

getBranch

public Branch getBranch(long id,
                        boolean updateable)
                 throws RepositoryException
Retrieves a branch by ID.

Throws:
RepositoryException

getBranch

public Branch getBranch(java.lang.String branch,
                        boolean updateable)
                 throws RepositoryException
Retrieves a branch by ID or by name depending on whether the branch parameter starts with a digit.

Throws:
RepositoryException

getBranchByName

public Branch getBranchByName(java.lang.String name,
                              boolean updateable)
                       throws RepositoryException
Retrieves a branch by name.

Throws:
RepositoryException

getAllBranches

public Branches getAllBranches(boolean updateable)
                        throws RepositoryException
Throws:
RepositoryException

deleteBranch

public void deleteBranch(long id)
                  throws RepositoryException
Deletes a branch. A branch can only be deleted if no document exists on the branch. Thus before deleting a branch, all document variants on this branch must be deleted. This can be easily done by performing a query that searches all documents on the branch -- see QueryManager -- and then deletes them one by one in a loop.

Throws:
RepositoryException

createLanguage

public Language createLanguage(java.lang.String name)

getLanguage

public Language getLanguage(long id,
                            boolean updateable)
                     throws RepositoryException
Throws:
RepositoryException

getLanguage

public Language getLanguage(java.lang.String language,
                            boolean updateable)
                     throws RepositoryException
Throws:
RepositoryException

getLanguageByName

public Language getLanguageByName(java.lang.String name,
                                  boolean updateable)
                           throws RepositoryException
Throws:
RepositoryException

getAllLanguages

public Languages getAllLanguages(boolean updateable)
                          throws RepositoryException
Throws:
RepositoryException

deleteLanguage

public void deleteLanguage(long id)
                    throws RepositoryException
Throws:
RepositoryException


Copyright © -2005 . All Rights Reserved.