org.nuiton.wikitty.publication.synchro
Class WikittyPublicationSynchronize

java.lang.Object
  extended by org.nuiton.wikitty.publication.synchro.WikittyPublicationSynchronize

public class WikittyPublicationSynchronize
extends Object

Main class of the sync part of wikitty publication, this class is the entry point for sync operation. Existing, delete and update.

Author:
mfortun

Field Summary
protected static org.nuiton.util.ApplicationConfig applicationConfig
           
static String CAJO_URI_PREFIX
          the prefix use in cajo url
static String FILE_URI_PREFIX
          the prefix use in file url
protected static boolean FLAG_COMMIT_UPDATE
           
static String HESSIAN_URI_PREFIX
          the prefix use in hessian url
static String IS_DELETE_OPTION
          for delete option
static String IS_EXISTING_OPTION
          for existing option
static String IS_RECURSION_OPTION
          for recursion option
static String LABEL_DELIM
          the string that mark the beginnning of the label
static String LABEL_KEY
          Use to save the label by the wikitty publication file system
static String LABEL_REGEX
          regex to select the label part of the uri
protected static boolean MAIN_ENABLE
           
static String WIKITTY_FILE_SERVICE
          The file name of the wikitty service property
static String WIKITTY_SERVICE_INTERLOCUTEUR
          Key for the other uri, usefull in the case of commit/update with a file system wikitty service.
 
Method Summary
static void commit(String label, String... uriFileSystem)
           
protected static void commitUpdateDelegate(String label, boolean isCommit, String... uriFileSystem)
           
protected static Criteria constructCriteriaLabelRecur(String label, boolean isRecur)
          Used to construct criteria on wikittypubdata and pubtext on the wikittylabel extension
static void main(String[] args)
           
static File searchWikittyPublicationHomePropertie(File start)
          Use to search and return the home property that containt informations about wikitty service use to synchronise a wikitty publication file system
protected static org.nuiton.util.ApplicationConfig setUpApplicationConfigServerConnector(URI uri)
          Use to setup correct url property in the application config and correct component for the wikittyservice
static void synchronisation(String origin, String target)
           
static void synchronisationServices(String origin, String target, boolean isRecur, boolean isDelete, boolean isExisting)
          Synchronize the wikitty service designed by their Uri
static void update(String label, String... uriFileSystem)
           
static void usage()
           
protected static void writeProperty(String ur)
          Called when syncrhonising with file system, used to store info about the "other" service used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WIKITTY_SERVICE_INTERLOCUTEUR

public static String WIKITTY_SERVICE_INTERLOCUTEUR
Key for the other uri, usefull in the case of commit/update with a file system wikitty service.


applicationConfig

protected static org.nuiton.util.ApplicationConfig applicationConfig

IS_RECURSION_OPTION

public static String IS_RECURSION_OPTION
for recursion option


IS_DELETE_OPTION

public static String IS_DELETE_OPTION
for delete option


IS_EXISTING_OPTION

public static String IS_EXISTING_OPTION
for existing option


LABEL_KEY

public static String LABEL_KEY
Use to save the label by the wikitty publication file system


LABEL_DELIM

public static String LABEL_DELIM
the string that mark the beginnning of the label


LABEL_REGEX

public static String LABEL_REGEX
regex to select the label part of the uri


FILE_URI_PREFIX

public static String FILE_URI_PREFIX
the prefix use in file url


CAJO_URI_PREFIX

public static String CAJO_URI_PREFIX
the prefix use in cajo url


HESSIAN_URI_PREFIX

public static String HESSIAN_URI_PREFIX
the prefix use in hessian url


WIKITTY_FILE_SERVICE

public static String WIKITTY_FILE_SERVICE
The file name of the wikitty service property


MAIN_ENABLE

protected static boolean MAIN_ENABLE

FLAG_COMMIT_UPDATE

protected static boolean FLAG_COMMIT_UPDATE
Method Detail

main

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

synchronisation

public static void synchronisation(String origin,
                                   String target)
                            throws URISyntaxException
Throws:
URISyntaxException

synchronisationServices

public static void synchronisationServices(String origin,
                                           String target,
                                           boolean isRecur,
                                           boolean isDelete,
                                           boolean isExisting)
                                    throws URISyntaxException
Synchronize the wikitty service designed by their Uri

Parameters:
origin - Uri of the wikitty service from
target - Uri of the wikitty service to
isRecur - If recursion for synchronize (only label or label and sub label)
isDelete - if only delete wikitty that are on origin but not on target
isExisting - if only update wikitty and not send wikitty that are on origin and not on target
Throws:
URISyntaxException

constructCriteriaLabelRecur

protected static Criteria constructCriteriaLabelRecur(String label,
                                                      boolean isRecur)
Used to construct criteria on wikittypubdata and pubtext on the wikittylabel extension

Parameters:
label - the label criteria
isRecur - is recusion
Returns:
the constructed criteria

setUpApplicationConfigServerConnector

protected static org.nuiton.util.ApplicationConfig setUpApplicationConfigServerConnector(URI uri)
Use to setup correct url property in the application config and correct component for the wikittyservice

Parameters:
uri - of the targeted wikitty service

update

public static void update(String label,
                          String... uriFileSystem)
                   throws Exception
Throws:
Exception

commit

public static void commit(String label,
                          String... uriFileSystem)
                   throws Exception
Throws:
Exception

commitUpdateDelegate

protected static void commitUpdateDelegate(String label,
                                           boolean isCommit,
                                           String... uriFileSystem)
                                    throws Exception
Throws:
Exception

usage

public static void usage()

writeProperty

protected static void writeProperty(String ur)
Called when syncrhonising with file system, used to store info about the "other" service used. Infos used when try to commit update from a service over file system

Parameters:
label -

searchWikittyPublicationHomePropertie

public static File searchWikittyPublicationHomePropertie(File start)
                                                  throws IOException
Use to search and return the home property that containt informations about wikitty service use to synchronise a wikitty publication file system

Parameters:
start - the directory where starts the search
Returns:
PropertiesExtended the home property
Throws:
IOException - if error while reading property file


Copyright © 2010-2011 CodeLutin. All Rights Reserved.