insensa.XMLProperties
Class CXmlProperties

java.lang.Object
  extended by insensa.XMLProperties.CXmlProperties
All Implemented Interfaces:
UserListener

public class CXmlProperties
extends java.lang.Object
implements UserListener


Field Summary
(package private)  org.jdom.Document doc
           
private  java.lang.String filename
           
(package private)  org.jdom.Element rootDoc
           
(package private)  java.io.FileOutputStream streamOut
           
(package private)  java.io.File xmlFile
           
(package private)  org.jdom.output.XMLOutputter xmlOut
           
 
Constructor Summary
CXmlProperties(java.lang.String m_filename)
           
 
Method Summary
 org.jdom.Element addProject(org.jdom.Element user, java.lang.String name)
          Add a new Project Tag to an existing user.
 org.jdom.Element addProject(java.lang.String user, java.lang.String name)
          Adds a project with the specified name to a user
 org.jdom.Element addUser(CUser user)
           
 org.jdom.Element addUser(java.lang.String workspace, java.lang.String name)
           
private  org.jdom.Element createGlobalElement()
           
private  org.jdom.Element createUpdateElem()
           
private  org.jdom.Element getGlobalElement()
           
 insensa.settings.GlobalSettings getGlobalSettings()
           
private  java.util.List<org.jdom.Element> getPluginCacheElementList()
           
 java.util.List<insensa.settings.PluginCache> getPluginCacheList()
           
private  java.util.List<insensa.settings.PluginCache> getPluginCacheList(org.jdom.Element updateElem)
           
private  java.lang.Object getProject(org.jdom.Element user, java.lang.String projectName)
           
 java.lang.Object getProject(java.lang.String user, java.lang.String workspace, java.lang.String projectName)
           
 java.util.List<java.lang.String> getProjectNames(java.lang.String user)
           
private  insensa.settings.UpdateCache getUpdateCache(org.jdom.Element globalElem)
           
private  org.jdom.Element getUpdateElement()
           
 org.jdom.Element getUser(java.lang.String user)
           
 java.util.List<CUser> getUsers()
           
 java.lang.String getWorkspace(java.lang.String user)
           
 void projectAdded(CProject project)
           
 void projectClosed(CProject project)
           
 void projectClosing(CProject project)
           
 void projectRemoved(CProject project)
           
 void propertyChanged(CUser user, java.lang.String property, java.lang.String oldValue, java.lang.String newValue)
           
 void removeAllProjects(java.lang.String user)
           
 void removeProject(java.lang.String user, java.lang.String project)
           
 void setFileCount(java.lang.String user, java.lang.String project, java.lang.String workspace, int fileCount)
           
 void setPluginCacheList(java.util.List<insensa.settings.PluginCache> pluginCacheList)
           
 void setWorkspace(java.lang.String user, java.lang.String workspacePath)
           
 void writeConfig()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filename

private java.lang.String filename

doc

org.jdom.Document doc

rootDoc

org.jdom.Element rootDoc

xmlOut

org.jdom.output.XMLOutputter xmlOut

streamOut

java.io.FileOutputStream streamOut

xmlFile

java.io.File xmlFile
Constructor Detail

CXmlProperties

public CXmlProperties(java.lang.String m_filename)
               throws java.io.IOException
Parameters:
m_filename -
Throws:
org.jdom.JDOMException
java.io.IOException
Method Detail

addProject

public org.jdom.Element addProject(org.jdom.Element user,
                                   java.lang.String name)
Add a new Project Tag to an existing user.

Parameters:
user - name of the existing user
name - new project name
Returns:

addProject

public org.jdom.Element addProject(java.lang.String user,
                                   java.lang.String name)
                            throws java.io.IOException
Adds a project with the specified name to a user

Parameters:
user -
name -
Returns:
Throws:
java.io.IOException

addUser

public org.jdom.Element addUser(java.lang.String workspace,
                                java.lang.String name)
                         throws java.io.IOException
Parameters:
workspace -
name -
Returns:
Throws:
java.io.IOException

addUser

public org.jdom.Element addUser(CUser user)
                         throws java.io.IOException
Throws:
java.io.IOException

getProject

private java.lang.Object getProject(org.jdom.Element user,
                                    java.lang.String projectName)
Parameters:
user -
projectName -
Returns:

getProject

public java.lang.Object getProject(java.lang.String user,
                                   java.lang.String workspace,
                                   java.lang.String projectName)
Parameters:
user -
workspace -
projectName -
Returns:

getProjectNames

public java.util.List<java.lang.String> getProjectNames(java.lang.String user)
Parameters:
user -
Returns:

getUser

public org.jdom.Element getUser(java.lang.String user)
Parameters:
user -
Returns:

getUsers

public java.util.List<CUser> getUsers()
                               throws java.io.IOException
Returns:
Throws:
java.io.IOException

getGlobalSettings

public insensa.settings.GlobalSettings getGlobalSettings()

getUpdateCache

private insensa.settings.UpdateCache getUpdateCache(org.jdom.Element globalElem)

getPluginCacheList

private java.util.List<insensa.settings.PluginCache> getPluginCacheList(org.jdom.Element updateElem)

getPluginCacheList

public java.util.List<insensa.settings.PluginCache> getPluginCacheList()

getPluginCacheElementList

private java.util.List<org.jdom.Element> getPluginCacheElementList()

getUpdateElement

private org.jdom.Element getUpdateElement()

getGlobalElement

private org.jdom.Element getGlobalElement()

createGlobalElement

private org.jdom.Element createGlobalElement()

createUpdateElem

private org.jdom.Element createUpdateElem()

setPluginCacheList

public void setPluginCacheList(java.util.List<insensa.settings.PluginCache> pluginCacheList)
                        throws java.io.IOException
Throws:
java.io.IOException

getWorkspace

public java.lang.String getWorkspace(java.lang.String user)
Parameters:
user -
Returns:

projectAdded

public void projectAdded(CProject project)
Specified by:
projectAdded in interface UserListener
See Also:
UserListener.projectAdded(insensa.CProject)

projectClosed

public void projectClosed(CProject project)
Specified by:
projectClosed in interface UserListener
See Also:
UserListener.projectClosed(insensa.CProject)

projectClosing

public void projectClosing(CProject project)
Specified by:
projectClosing in interface UserListener
See Also:
UserListener.projectClosing(insensa.CProject)

projectRemoved

public void projectRemoved(CProject project)
Specified by:
projectRemoved in interface UserListener
See Also:
UserListener.projectRemoved(insensa.CProject)

propertyChanged

public void propertyChanged(CUser user,
                            java.lang.String property,
                            java.lang.String oldValue,
                            java.lang.String newValue)
Specified by:
propertyChanged in interface UserListener
See Also:
UserListener.propertyChanged(insensa.CUser, java.lang.String, java.lang.String, java.lang.String)

removeAllProjects

public void removeAllProjects(java.lang.String user)
Parameters:
user -

removeProject

public void removeProject(java.lang.String user,
                          java.lang.String project)
                   throws java.io.IOException
Parameters:
user -
project -
Throws:
java.io.IOException

setFileCount

public void setFileCount(java.lang.String user,
                         java.lang.String project,
                         java.lang.String workspace,
                         int fileCount)
                  throws java.io.IOException
Parameters:
user -
project -
workspace -
fileCount -
Throws:
java.io.IOException

setWorkspace

public void setWorkspace(java.lang.String user,
                         java.lang.String workspacePath)
                  throws java.io.IOException
Parameters:
user -
workspacePath -
Throws:
java.io.IOException

writeConfig

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