org.merlotxml.merlot
Class XMLEditorFile

java.lang.Object
  extended byorg.merlotxml.merlot.XMLFile
      extended byorg.merlotxml.merlot.XMLEditorFile
All Implemented Interfaces:
MerlotConstants

public class XMLEditorFile
extends XMLFile

An XML file that is a WebDav resource

Author:
Justin Lipton

Field Summary
protected  com.speedlegal.webdav.EditorFile _efile
           
protected  java.util.Vector _webDavProperties
          WebDav property map
 
Fields inherited from class org.merlotxml.merlot.XMLFile
_dirty, _doc, _docType, _file, _new, _propchange
 
Fields inherited from interface org.merlotxml.merlot.MerlotConstants
ACTION_MENU_ACCELERATOR, ACTION_MENU_ICON, ACTION_NAME, ACTION_SHORT_DESCRIPTION, ACTION_SMALL_ICON, AFTER, BEFORE, ERR, INTO, UI, XML
 
Constructor Summary
XMLEditorFile(java.io.File f)
          Reads in the given filename to create the Document tree
 
Method Summary
protected  void close()
           
protected  void close(java.io.File f)
           
protected  java.io.InputStream getFileInputStream()
           
 boolean hasLock()
          Description of the Method
static boolean hasLock(com.speedlegal.webdav.EditorFile f)
          Description of the Method
protected  boolean hasReadAccess()
          Description of the Method
static boolean hasReadAccess(com.speedlegal.webdav.EditorFile f)
          Does a user have repository access to read this file?
 boolean hasWriteAccess()
          Description of the Method
static boolean hasWriteAccess(com.speedlegal.webdav.EditorFile f)
          Does a user have repository access to write to this file? This means that: - the file is not locked by another user - the user has access to write to the file
 boolean isLocked()
          Gets the locked attribute of the XMLFile object
static boolean isLocked(com.speedlegal.webdav.EditorFile f)
          Gets the locked attribute of the XMLFile class
protected  boolean isLockedByOther()
          Gets the lockedByOther attribute of the XMLFile object
protected static boolean isLockedByOther(com.speedlegal.webdav.EditorFile f)
          Gets the lockedByOther attribute of the XMLFile class
protected  void parseDocument()
          Description of the Method
protected  void removeLock()
          Description of the Method
static void removeLock(com.speedlegal.webdav.EditorFile f)
          Perfoms a repository lock on the file
 void removeProperties()
          Description of the Method
 void saveAs(java.io.File file)
          Description of the Method
protected  boolean setLock()
          Sets the lock attribute of the XMLFile object
static boolean setLock(com.speedlegal.webdav.EditorFile f)
          Perfoms a repository lock on the file
protected  void setLockedByOther(boolean state)
          Sets the lockedByOther attribute of the XMLFile object
 void setProperties()
           
static void setProperties(com.speedlegal.webdav.EditorFile f, java.util.Vector properties)
          Set the given properties on the file, using PROPPATCH
 void setWebDavProperty(java.lang.String namespace, java.lang.String property, java.lang.String value)
          Set the given WebDav property that will be updated/written when the file is saved with namespace support
 
Methods inherited from class org.merlotxml.merlot.XMLFile
addPropertyChangeListener, elementIsValid, firePropertyChange, getDoctype, getDocument, getDTD, getDTDAttributes, getDTDCacheEntry, getInsertableElements, getInsertableElements, getInstanciatedNode, getName, getPath, getValidDocument, getXMLEditorDoc, isDirty, isNew, printRawXML, putInstanciatedNode, save, setDirty, setNew, setXMLEditorDoc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_efile

protected com.speedlegal.webdav.EditorFile _efile

_webDavProperties

protected java.util.Vector _webDavProperties
WebDav property map

Constructor Detail

XMLEditorFile

public XMLEditorFile(java.io.File f)
              throws MerlotException
Reads in the given filename to create the Document tree

Parameters:
f - Description of the Parameter
Throws:
MerlotException - Description of the Exception
Method Detail

parseDocument

protected void parseDocument()
                      throws MerlotException
Description copied from class: XMLFile
Description of the Method

Overrides:
parseDocument in class XMLFile
Throws:
MerlotException - Description of the Exception

getFileInputStream

protected java.io.InputStream getFileInputStream()
                                          throws java.io.FileNotFoundException
Overrides:
getFileInputStream in class XMLFile
Throws:
java.io.FileNotFoundException

setLock

public static boolean setLock(com.speedlegal.webdav.EditorFile f)
Perfoms a repository lock on the file

Parameters:
f - The new lock value

setLock

protected boolean setLock()
Sets the lock attribute of the XMLFile object


setProperties

public static void setProperties(com.speedlegal.webdav.EditorFile f,
                                 java.util.Vector properties)
Set the given properties on the file, using PROPPATCH

Parameters:
f - The new properties value
properties - The new properties value

setProperties

public void setProperties()

setWebDavProperty

public void setWebDavProperty(java.lang.String namespace,
                              java.lang.String property,
                              java.lang.String value)
Set the given WebDav property that will be updated/written when the file is saved with namespace support

Parameters:
namespace - The new webDavProperty value
property - The new webDavProperty value
value - The new webDavProperty value

removeProperties

public void removeProperties()
Description of the Method


removeLock

public static void removeLock(com.speedlegal.webdav.EditorFile f)
Perfoms a repository lock on the file

Parameters:
f - Description of the Parameter

removeLock

protected void removeLock()
Description of the Method


hasReadAccess

public static boolean hasReadAccess(com.speedlegal.webdav.EditorFile f)
Does a user have repository access to read this file?

Parameters:
f - Description of the Parameter
Returns:
Description of the Return Value

hasReadAccess

protected boolean hasReadAccess()
Description of the Method

Returns:
Description of the Return Value

hasWriteAccess

public static boolean hasWriteAccess(com.speedlegal.webdav.EditorFile f)
Does a user have repository access to write to this file? This means that: - the file is not locked by another user - the user has access to write to the file

Parameters:
f - Description of the Parameter
Returns:
Description of the Return Value

hasLock

public static boolean hasLock(com.speedlegal.webdav.EditorFile f)
Description of the Method

Parameters:
f - Description of the Parameter
Returns:
Description of the Return Value

hasLock

public boolean hasLock()
Description of the Method

Returns:
Description of the Return Value

isLocked

public boolean isLocked()
Gets the locked attribute of the XMLFile object

Returns:
The locked value

isLocked

public static boolean isLocked(com.speedlegal.webdav.EditorFile f)
Gets the locked attribute of the XMLFile class

Parameters:
f - Description of the Parameter
Returns:
The locked value

hasWriteAccess

public boolean hasWriteAccess()
Description of the Method

Returns:
Description of the Return Value

isLockedByOther

protected boolean isLockedByOther()
Gets the lockedByOther attribute of the XMLFile object

Returns:
The lockedByOther value

isLockedByOther

protected static boolean isLockedByOther(com.speedlegal.webdav.EditorFile f)
Gets the lockedByOther attribute of the XMLFile class

Parameters:
f - Description of the Parameter
Returns:
The lockedByOther value

setLockedByOther

protected void setLockedByOther(boolean state)
Sets the lockedByOther attribute of the XMLFile object

Parameters:
state - The new lockedByOther value

saveAs

public void saveAs(java.io.File file)
            throws MerlotException
Description of the Method

Overrides:
saveAs in class XMLFile
Parameters:
file - Description of the Parameter
Returns:
Description of the Return Value
Throws:
MerlotException - Description of the Exception

close

protected void close()
Overrides:
close in class XMLFile

close

protected void close(java.io.File f)
Overrides:
close in class XMLFile