com.partnersoft.codex
Class Codex

java.lang.Object
  extended by com.partnersoft.codex.Codex
All Implemented Interfaces:
CodexNode

public class Codex
extends java.lang.Object
implements CodexNode

A codex is an object-oriented, version-controlled database with rich metadata. What References What? Codex -- CodexSection -- CodexResource -- CodexResourceModel :rootFile CodexNode <-- CodexEdit The gui references everything in the Codex hierarchy, but the gui is transient and goes away after every page load. Since CodexBrowser reloads itself after every CodexStructuralEdit, a CodexStructuralEdit can do whatever it wants to the Codex hierarchy, because we know that the gui will get reloaded after the edit is applied. The only File we refer to is the Codex's root file. CodexEdits refer to everything in the Codex hierarchy as well, and unlike the gui the edits stay around between CodexStructuralEdits. A CodexEdit's reference to the Codex hierarchy has to stay valid for the life of the program, so once a Codex object is created it cannot be dereferenced.

Author:
Paul Reavis, Russell Cagle Copyright 2005 Partner Software, Inc.

Constructor Summary
protected Codex(java.lang.String name, java.io.File rootDirectory, ConfigLevel configLevel, CodexType codexType)
           
 
Method Summary
 CodexArchive archive()
           
protected  java.io.File createFile()
           
 void deleteCodex()
           
 java.lang.String getArchivePath()
           
 Codex getCodex()
           
 java.lang.String getCodexNodeName()
           
 CodexNode getCodexParent()
           
 CodexResource getCodexResource()
           
 CodexSection getCodexSection()
           
 CodexType getCodexType()
           
 ConfigLevel getConfigLevel()
           
 java.lang.String getName()
           
 CodexSection getRoot()
          Get the root of the section tree.
 java.io.File getRootDirectory()
           
 Workspace getWorkspace()
          Copies the Codex to another config level.
 void install(java.io.File zipfile)
          Installs the given zipfile.
 java.util.List<CodexArchive> listArchives()
           
protected  void loadRoot()
           
 void rename(java.lang.String newName)
           
 CodexResource resourceAt(Path path)
           
 CodexResource resourceAt(java.lang.String path)
           
 void restore(CodexArchive archive)
           
 CodexSection sectionAt(Path path)
           
 CodexSection sectionAt(java.lang.String path)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Codex

protected Codex(java.lang.String name,
                java.io.File rootDirectory,
                ConfigLevel configLevel,
                CodexType codexType)
         throws java.io.IOException
Throws:
java.io.IOException
Method Detail

createFile

protected java.io.File createFile()

loadRoot

protected void loadRoot()
                 throws java.io.IOException
Throws:
java.io.IOException

getWorkspace

public Workspace getWorkspace()
Copies the Codex to another config level.

Specified by:
getWorkspace in interface CodexNode
Parameters:
newConfigLevel -
Throws:
java.io.IOException

getCodex

public Codex getCodex()
Specified by:
getCodex in interface CodexNode

getCodexSection

public CodexSection getCodexSection()
Specified by:
getCodexSection in interface CodexNode

getCodexResource

public CodexResource getCodexResource()
Specified by:
getCodexResource in interface CodexNode

deleteCodex

public void deleteCodex()
                 throws java.io.IOException
Throws:
java.io.IOException

getCodexParent

public CodexNode getCodexParent()
Specified by:
getCodexParent in interface CodexNode

getCodexType

public CodexType getCodexType()

getConfigLevel

public ConfigLevel getConfigLevel()

getName

public java.lang.String getName()

getCodexNodeName

public java.lang.String getCodexNodeName()
Specified by:
getCodexNodeName in interface CodexNode

getRoot

public CodexSection getRoot()
Get the root of the section tree.


getRootDirectory

public java.io.File getRootDirectory()

rename

public void rename(java.lang.String newName)
            throws java.io.IOException
Throws:
java.io.IOException

resourceAt

public CodexResource resourceAt(java.lang.String path)

resourceAt

public CodexResource resourceAt(Path path)

sectionAt

public CodexSection sectionAt(java.lang.String path)

sectionAt

public CodexSection sectionAt(Path path)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

listArchives

public java.util.List<CodexArchive> listArchives()
                                          throws java.io.IOException
Throws:
java.io.IOException

archive

public CodexArchive archive()
                     throws java.io.IOException
Throws:
java.io.IOException

restore

public void restore(CodexArchive archive)
             throws java.io.IOException
Throws:
java.io.IOException

install

public void install(java.io.File zipfile)
             throws java.io.IOException
Installs the given zipfile. Overwrites existing files but does not erase anything.

Parameters:
zipfile -
Throws:
java.io.IOException

getArchivePath

public java.lang.String getArchivePath()