org.mycore.frontend.cli
Class MCRDerivateCommands

java.lang.Object
  extended by org.mycore.frontend.cli.MCRAbstractCommands
      extended by org.mycore.frontend.cli.MCRDerivateCommands
All Implemented Interfaces:
MCRExternalCommandInterface

public class MCRDerivateCommands
extends MCRAbstractCommands

Provides static methods that implement commands for the MyCoRe command line interface.

Version:
$Revision: 15291 $ $Date: 2009-05-28 12:49:38 +0200 (Thu, 28 May 2009) $
Author:
Jens Kupferschmidt, Frank Luetzenkirchen

Field Summary
static String DEFAULT_TRANSFORMER
          Default transformer script
 
Fields inherited from class org.mycore.frontend.cli.MCRAbstractCommands
command, CONFIG
 
Constructor Summary
MCRDerivateCommands()
          The constructor.
 
Method Summary
static void delete(String ID)
          Delete an MCRDerivate from the datastore.
static void delete(String IDfrom, String IDto)
          Delete MCRDerivates form ID to ID from the datastore.
static List<String> deleteAllDerivates()
          deletes all MCRDerivate from the datastore.
static void export(String ID, String dirname, String style)
          Save an MCRDerivate to a file named MCRObjectID .xml in a directory with dirname and store the derivate objects in a directory under them named MCRObjectID.
static void export(String fromID, String toID, String dirname, String style)
          Export any MCRDerivate's to files named MCRObjectID .xml in a directory and the objects under them named MCRObjectID.
static List<String> exportAllDerivates(String dirname, String style)
           
static List<String> loadFromDirectory(String directory)
          Loads MCRDerivates from all XML files in a directory.
static boolean loadFromFile(String file)
          Loads an MCRDerivates from an XML file.
static boolean loadFromFile(String file, boolean importMode)
          Loads an MCRDerivates from an XML file.
static List<String> repairDerivateSearch()
          The method start the repair the content search index for all derivates.
static void repairDerivateSearchForID(String id)
          The method start the repair the content search index for one.
static void show(String ID, String dirname)
          Save an MCRDerivate to a file named MCRObjectID .xml in a directory with dirname and store the derivate objects in a directory under them named MCRObjectID.
static List<String> synchronizeAllDerivates()
          The method start the repair the content search index for all derivates.
static void synchronizeDerivateForID(String id)
          The method sychronize the xlink:label of the mycorederivate with the xlink:label of the derivate refernce of mycoreobject.
static List<String> updateFromDirectory(String directory)
          Updates MCRDerivates from all XML files in a directory.
static boolean updateFromFile(String file)
          Updates an MCRDerivates from an XML file.
static boolean updateFromFile(String file, boolean importMode)
          Updates an MCRDerivates from an XML file.
 
Methods inherited from class org.mycore.frontend.cli.MCRAbstractCommands
getPossibleCommands
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TRANSFORMER

public static final String DEFAULT_TRANSFORMER
Default transformer script

See Also:
Constant Field Values
Constructor Detail

MCRDerivateCommands

public MCRDerivateCommands()
The constructor.

Method Detail

deleteAllDerivates

public static List<String> deleteAllDerivates()
deletes all MCRDerivate from the datastore.


delete

public static void delete(String ID)
Delete an MCRDerivate from the datastore.

Parameters:
ID - the ID of the MCRDerivate that should be deleted

delete

public static void delete(String IDfrom,
                          String IDto)
Delete MCRDerivates form ID to ID from the datastore.

Parameters:
IDfrom - the start ID for deleting the MCRDerivate
IDto - the stop ID for deleting the MCRDerivate

loadFromDirectory

public static List<String> loadFromDirectory(String directory)
Loads MCRDerivates from all XML files in a directory.

Parameters:
directory - the directory containing the XML files

updateFromDirectory

public static List<String> updateFromDirectory(String directory)
Updates MCRDerivates from all XML files in a directory.

Parameters:
directory - the directory containing the XML files

loadFromFile

public static boolean loadFromFile(String file)
Loads an MCRDerivates from an XML file.

Parameters:
file - the location of the xml file

loadFromFile

public static boolean loadFromFile(String file,
                                   boolean importMode)
Loads an MCRDerivates from an XML file.

Parameters:
file - the location of the xml file
importMode - if true, servdates are taken from xml file

updateFromFile

public static boolean updateFromFile(String file)
Updates an MCRDerivates from an XML file.

Parameters:
file - the location of the xml file

updateFromFile

public static boolean updateFromFile(String file,
                                     boolean importMode)
Updates an MCRDerivates from an XML file.

Parameters:
file - the location of the xml file
importMode - if true, servdates are taken from xml file

show

public static void show(String ID,
                        String dirname)
Save an MCRDerivate to a file named MCRObjectID .xml in a directory with dirname and store the derivate objects in a directory under them named MCRObjectID. The IFS-Attribute of the derivate files aren't saved, for reloading purpose after deleting a derivate in the datastore

Parameters:
ID - the ID of the MCRDerivate to be save.
dirname - the dirname to store the derivate

export

public static void export(String ID,
                          String dirname,
                          String style)
Save an MCRDerivate to a file named MCRObjectID .xml in a directory with dirname and store the derivate objects in a directory under them named MCRObjectID. The method use the converter stylesheet mcr_style_object.xsl.

Parameters:
ID - the ID of the MCRDerivate to be save.
dirname - the dirname to store the derivate
style - the type of the stylesheet

export

public static void export(String fromID,
                          String toID,
                          String dirname,
                          String style)
Export any MCRDerivate's to files named MCRObjectID .xml in a directory and the objects under them named MCRObjectID. The saving starts with fromID and runs to toID. ID's they was not found will skiped. The method use the converter stylesheet mcr_style_object.xsl.

Parameters:
fromID - the ID of the MCRObject from be save.
toID - the ID of the MCRObject to be save.
dirname - the filename to store the object
style - the type of the stylesheet

exportAllDerivates

public static List<String> exportAllDerivates(String dirname,
                                              String style)

repairDerivateSearch

public static List<String> repairDerivateSearch()
The method start the repair the content search index for all derivates.


repairDerivateSearchForID

public static void repairDerivateSearchForID(String id)
The method start the repair the content search index for one.

Parameters:
id - the MCRObjectID as String

synchronizeAllDerivates

public static List<String> synchronizeAllDerivates()
The method start the repair the content search index for all derivates.


synchronizeDerivateForID

public static void synchronizeDerivateForID(String id)
The method sychronize the xlink:label of the mycorederivate with the xlink:label of the derivate refernce of mycoreobject.

Parameters:
id - the MCRObjectID as String