com.partnersoft.codex
Class Workspace

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

public class Workspace
extends java.lang.Object
implements CodexNode

Author:
Russell Cagle Copyright 2006 Partner Software, Inc.

Field Summary
static CodexType[] CODEX_TYPES
           
static ConfigLevel[] CONFIG_HIERARCHY
           
static ConfigLevel CUSTOMER
           
static CodexType MAPSET_CODEX
           
static CodexType MAPSPACE_CODEX
           
static ConfigLevel PROVIDER
           
static ConfigLevel SEAT
           
static ConfigLevel SITE
           
 
Constructor Summary
Workspace()
           
 
Method Summary
 Codex createCodex(CodexType codexType, java.lang.String codexName, ConfigLevel configLevel)
           
 Codex getCodex()
           
 Codex getCodex(CodexType codexType, java.lang.String codexName)
           
 Codex getCodex(java.lang.String codexType, java.lang.String codexName)
           
 java.lang.String getCodexNodeName()
           
 CodexNode getCodexParent()
           
 CodexResource getCodexResource()
           
 CodexResource getCodexResourceFromPath(java.lang.String path)
          Expects a path in the form "config/seat/mapsets/My Cool Mapset/mysection/...", and looks up the corresponding CodexResource.
 CodexSection getCodexSection()
           
 CodexType getCodexType(java.lang.String codexDirectoryName)
          NOTE: uses the directory name, not the type name, i.e "mapsets" instead of "mapset".
 Naming<Codex> getCodices(CodexType codexType)
           
 Workspace getWorkspace()
           
 boolean hasCodex(CodexType codexType, java.lang.String codexName)
           
 void initialize(java.io.File root)
          Load all the codices.
static Workspace singleton()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CUSTOMER

public static ConfigLevel CUSTOMER

PROVIDER

public static ConfigLevel PROVIDER

SEAT

public static ConfigLevel SEAT

SITE

public static ConfigLevel SITE

MAPSET_CODEX

public static CodexType MAPSET_CODEX

MAPSPACE_CODEX

public static CodexType MAPSPACE_CODEX

CONFIG_HIERARCHY

public static ConfigLevel[] CONFIG_HIERARCHY

CODEX_TYPES

public static CodexType[] CODEX_TYPES
Constructor Detail

Workspace

public Workspace()
Method Detail

singleton

public static Workspace singleton()

createCodex

public Codex createCodex(CodexType codexType,
                         java.lang.String codexName,
                         ConfigLevel configLevel)
                  throws java.io.IOException
Throws:
java.io.IOException

getCodex

public Codex getCodex(java.lang.String codexType,
                      java.lang.String codexName)

getCodex

public Codex getCodex(CodexType codexType,
                      java.lang.String codexName)

getCodexParent

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

getCodexResourceFromPath

public CodexResource getCodexResourceFromPath(java.lang.String path)
Expects a path in the form "config/seat/mapsets/My Cool Mapset/mysection/...", and looks up the corresponding CodexResource. Case sensitive -- should it be?

Parameters:
path -
Returns:
Throws:
java.lang.IllegalArgumentException - if the path is bad.

getCodexType

public CodexType getCodexType(java.lang.String codexDirectoryName)
NOTE: uses the directory name, not the type name, i.e "mapsets" instead of "mapset".

Parameters:
codexDirectoryName -
Returns:

getCodices

public Naming<Codex> getCodices(CodexType codexType)

getCodexNodeName

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

hasCodex

public boolean hasCodex(CodexType codexType,
                        java.lang.String codexName)

initialize

public void initialize(java.io.File root)
                throws java.io.IOException
Load all the codices.

Throws:
java.io.IOException

getWorkspace

public Workspace getWorkspace()
Specified by:
getWorkspace in interface CodexNode

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