org.nuiton.wikitty.publication
Class WikittyPublication

java.lang.Object
  extended by org.nuiton.wikitty.publication.WikittyPublication

public class WikittyPublication
extends Object

Main class of the sync part of wikitty publication, this class is the entry point for sync operation : import, checkout, commit, delete, relocate and update.

Author:
mfortun

Field Summary
protected static org.nuiton.util.ApplicationConfig applicationConfig
           
static String DEFAULT_PROPERTY_NAME_SEP
           
static String DIRECTORY_KEY
           
static String HESSIAN_PROTOCOL_KEY
           
static String META_CURRENT_LABEL
           
static String META_SUB_LABEL
           
static String META_SUFFIX_KEY_CHECKSUM
           
static String META_SUFFIX_KEY_ID
           
static String META_SUFFIX_KEY_VERSION
           
static String NO_RECURSION_KEY
           
static String PROPERTY_DIRECTORY
           
static String WIKITTY_FILE_META_PROPERTIES_FILE
           
static String WIKITTY_ID_PROPERTIES_FILE
           
static String WIKITTYPUBLICATION_PROPERTIES_FILE
           
static String WITTY_SERVICE_KEY
           
 
Constructor Summary
WikittyPublication()
           
 
Method Summary
static void checkoutFromWikitty(String label)
          Method that checkout a label recursivly or not into a local directory from a wikitty service
static void commitToWikitty()
          commit the current wikittyworkspace into a wikitty service
protected static HashMap<String,String> deleteFile(File toDelete)
           
static void deleteFromWikitty(File toDelete)
          delete a file or directory from the workspace it remove the label from the wikitty
static void importToWikitty()
          Method that import the content of a directory into a wikitty service
protected static List<File> listFile(File starts, boolean recursivly)
          Method that create the list of file needed to commit, delete, update import.
static void main(String[] args)
           
static void printDirectory(File dir, boolean recur)
           
static void relocateWikitty()
          Relocate the default url of the wikitty service
protected static File searchWikittyPublicationHomeDir(File start)
          Use to search in the file system the directory that containt the .wp dir that containt the properties file for the wikitty service's adresse
static void updateFromWikitty()
          update the current workspace from a wikitty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

applicationConfig

protected static org.nuiton.util.ApplicationConfig applicationConfig

WITTY_SERVICE_KEY

public static String WITTY_SERVICE_KEY

NO_RECURSION_KEY

public static String NO_RECURSION_KEY

DIRECTORY_KEY

public static String DIRECTORY_KEY

HESSIAN_PROTOCOL_KEY

public static String HESSIAN_PROTOCOL_KEY

DEFAULT_PROPERTY_NAME_SEP

public static String DEFAULT_PROPERTY_NAME_SEP

PROPERTY_DIRECTORY

public static String PROPERTY_DIRECTORY

WIKITTYPUBLICATION_PROPERTIES_FILE

public static String WIKITTYPUBLICATION_PROPERTIES_FILE

WIKITTY_ID_PROPERTIES_FILE

public static String WIKITTY_ID_PROPERTIES_FILE

WIKITTY_FILE_META_PROPERTIES_FILE

public static String WIKITTY_FILE_META_PROPERTIES_FILE

META_SUFFIX_KEY_VERSION

public static String META_SUFFIX_KEY_VERSION

META_SUFFIX_KEY_CHECKSUM

public static String META_SUFFIX_KEY_CHECKSUM

META_SUFFIX_KEY_ID

public static String META_SUFFIX_KEY_ID

META_CURRENT_LABEL

public static String META_CURRENT_LABEL

META_SUB_LABEL

public static String META_SUB_LABEL
Constructor Detail

WikittyPublication

public WikittyPublication()
Method Detail

main

public static void main(String[] args)
                 throws Exception
Parameters:
args -
Throws:
org.nuiton.util.ArgumentsParserException
Exception

importToWikitty

public static void importToWikitty()
                            throws Exception
Method that import the content of a directory into a wikitty service

Throws:
Exception

printDirectory

public static void printDirectory(File dir,
                                  boolean recur)

listFile

protected static List<File> listFile(File starts,
                                     boolean recursivly)
Method that create the list of file needed to commit, delete, update import. It harvest file in order to transform them into wikitties

Parameters:
starts - harvested directory
recursivly - boolean id the directory have to be harvest
Returns:
list of harvested file

checkoutFromWikitty

public static void checkoutFromWikitty(String label)
                                throws Exception
Method that checkout a label recursivly or not into a local directory from a wikitty service

Throws:
Exception

relocateWikitty

public static void relocateWikitty()
                            throws Exception
Relocate the default url of the wikitty service

Throws:
Exception

commitToWikitty

public static void commitToWikitty()
                            throws Exception
commit the current wikittyworkspace into a wikitty service

Throws:
Exception

deleteFromWikitty

public static void deleteFromWikitty(File toDelete)
                              throws Exception
delete a file or directory from the workspace it remove the label from the wikitty

Throws:
Exception

updateFromWikitty

public static void updateFromWikitty()
                              throws Exception
update the current workspace from a wikitty

Throws:
Exception

searchWikittyPublicationHomeDir

protected static File searchWikittyPublicationHomeDir(File start)
                                               throws Exception
Use to search in the file system the directory that containt the .wp dir that containt the properties file for the wikitty service's adresse

Parameters:
start -
Returns:
File the directory container of the master property file
Throws:
Exception

deleteFile

protected static HashMap<String,String> deleteFile(File toDelete)
                                            throws Exception
Throws:
Exception


Copyright © 2010-2011 CodeLutin. All Rights Reserved.