|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.wikitty.publication.AbstractWikittyFileService
org.nuiton.wikitty.publication.synchro.WikittyPublicationFileSystem
public class WikittyPublicationFileSystem
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.nuiton.wikitty.WikittyService |
|---|
WikittyService.ServiceListenerType |
| Field Summary | |
|---|---|
protected List<String> |
directoryNameBlackList
List of directory name that does'nt have to be harvest exampe : .svn, .git |
protected File |
homeFile
The working directory of the wikitty service |
protected String |
label
The initial label of the wikitties, and the path to the first wikitties of the working directory |
static String |
META_CURRENT_LABEL
Property key to store the current label in a wikittyProperty meta file. |
static String |
META_PREFIX_KEY_CHECKSUM
property key used in the metaPropertyFile to store the wikitty's content checksum |
static String |
META_PREFIX_KEY_ID
property key used in the metaPropertyFile to store the wikitty's id |
static String |
META_PREFIX_KEY_VERSION
property key used in the metaPropertyFile to store the wikitty's version |
protected MimeTypePubHelper |
mimeHelper
the mimeType Handler used to determine mimeType for file extension and if file have to be converted as wikittyPubText or WikittyPubData |
static String |
PROPERTY_DIRECTORY
the file name of the property directory |
protected boolean |
recursion
if recursion is chose |
| Constructor Summary | |
|---|---|
WikittyPublicationFileSystem(org.nuiton.util.ApplicationConfig app)
Default constructor, call by a factory |
|
| Method Summary | |
|---|---|
void |
addWikittyServiceListener(WikittyListener listener,
WikittyService.ServiceListenerType type)
|
boolean |
canDelete(String securityToken,
String wikittyId)
|
boolean |
canRead(String securityToken,
String wikittyId)
|
boolean |
canWrite(String securityToken,
Wikitty wikitty)
|
protected void |
checkModifications(File child)
Check with the corresponding checksum if the file have been modified since the last check. |
WikittyEvent |
clear(String securityToken)
|
WikittyEvent |
delete(String securityToken,
Collection<String> ids)
|
WikittyEvent |
deleteExtension(String securityToken,
Collection<String> extNames)
|
WikittyEvent |
deleteTree(String securityToken,
String treeNodeId)
|
boolean |
exists(String securityToken,
String wikittyId)
|
TreeNodeResult<String> |
findTreeNode(String securityToken,
String wikittyId,
int depth,
boolean count,
Criteria filter)
|
List<String> |
getAllExtensionIds(String securityToken)
|
List<String> |
getAllExtensionsRequires(String securityToken,
String extensionName)
|
protected Map<String,Wikitty> |
getAllWikitties()
Method that must be implemented by the extended service. |
File |
getHomeFile()
|
String |
getLabel()
|
static PropertiesExtended |
getWikittyPublicationProperties(File starts,
String name)
Simply return the propertyExtended corresponding that can be found in starts/.wp/ directory. |
org.apache.commons.collections.BidiMap |
harvestLocalWikitties(File starts,
boolean recursivly)
|
protected void |
harvestNewCheckModificationsAndDeleted(File starts,
String label)
Check on local file if there new file that have to be converted into wikitty, check wikitty if they have been modified, and check if some wikitty were deleted and update property |
List<File> |
harvestPropertyDirectory(File starts,
boolean recursivly)
Method that create a list of the properties directory |
boolean |
isDeleted(String securityToken,
String wikittyId)
|
boolean |
isRecursion()
|
String |
login(String login,
String password)
|
void |
logout(String securityToken)
|
void |
removeWikittyServiceListener(WikittyListener listener,
WikittyService.ServiceListenerType type)
|
WikittyEvent |
replay(String securityToken,
List<WikittyEvent> events,
boolean force)
|
protected Wikitty |
restore(String id,
FileSystemWIkittyId fileId)
Restore the corresponding wikitty identify by the id and is location on the filesytem |
List<Wikitty> |
restore(String securityToken,
List<String> id)
|
WikittyExtension |
restoreExtension(String securityToken,
String extensionId)
|
Wikitty |
restoreVersion(String securityToken,
String wikittyId,
String version)
|
void |
setHomeFile(File homeFile)
|
void |
setLabel(String label)
|
void |
setRecursion(boolean recursion)
|
WikittyEvent |
store(String securityToken,
Collection<Wikitty> wikitties,
boolean force)
|
WikittyEvent |
storeExtension(String securityToken,
Collection<WikittyExtension> exts)
|
void |
syncSearchEngine(String securityToken)
|
protected void |
writeWikittyFileProperties(File towrite,
String wikittyID,
String wikittyVersion)
write in properties file property about the file corresponding to a wikitty. |
| Methods inherited from class org.nuiton.wikitty.publication.AbstractWikittyFileService |
|---|
checkRestriction, findAllByCriteria, findByCriteria, restoreExtensionLastVersion |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected File homeFile
protected boolean recursion
protected String label
public static String META_CURRENT_LABEL
public static String META_PREFIX_KEY_VERSION
public static String META_PREFIX_KEY_CHECKSUM
public static String META_PREFIX_KEY_ID
public static String PROPERTY_DIRECTORY
protected MimeTypePubHelper mimeHelper
protected List<String> directoryNameBlackList
| Constructor Detail |
|---|
public WikittyPublicationFileSystem(org.nuiton.util.ApplicationConfig app)
throws URISyntaxException,
IOException
app - application config needed to correctly initialize this. Need
wikitty url to be set (with URI format) and option for
recursion, @see WikittyPublication for constant
URISyntaxException - if serveur url is not in the proper format (URI format)
IOException - if error while creating/reading the wikitty service
properties| Method Detail |
|---|
public File getHomeFile()
public void setHomeFile(File homeFile)
public boolean isRecursion()
public void setRecursion(boolean recursion)
public String getLabel()
public void setLabel(String label)
public void addWikittyServiceListener(WikittyListener listener,
WikittyService.ServiceListenerType type)
public void removeWikittyServiceListener(WikittyListener listener,
WikittyService.ServiceListenerType type)
public String login(String login,
String password)
public void logout(String securityToken)
public WikittyEvent clear(String securityToken)
public boolean canWrite(String securityToken,
Wikitty wikitty)
public boolean canDelete(String securityToken,
String wikittyId)
public boolean canRead(String securityToken,
String wikittyId)
public boolean exists(String securityToken,
String wikittyId)
public boolean isDeleted(String securityToken,
String wikittyId)
public WikittyEvent replay(String securityToken,
List<WikittyEvent> events,
boolean force)
public WikittyEvent store(String securityToken,
Collection<Wikitty> wikitties,
boolean force)
public List<String> getAllExtensionIds(String securityToken)
public List<String> getAllExtensionsRequires(String securityToken,
String extensionName)
public WikittyEvent storeExtension(String securityToken,
Collection<WikittyExtension> exts)
public WikittyEvent deleteExtension(String securityToken,
Collection<String> extNames)
public WikittyExtension restoreExtension(String securityToken,
String extensionId)
public List<Wikitty> restore(String securityToken,
List<String> id)
public WikittyEvent delete(String securityToken,
Collection<String> ids)
protected Map<String,Wikitty> getAllWikitties()
AbstractWikittyFileService
getAllWikitties in class AbstractWikittyFileService
public WikittyEvent deleteTree(String securityToken,
String treeNodeId)
public TreeNodeResult<String> findTreeNode(String securityToken,
String wikittyId,
int depth,
boolean count,
Criteria filter)
public Wikitty restoreVersion(String securityToken,
String wikittyId,
String version)
public void syncSearchEngine(String securityToken)
public List<File> harvestPropertyDirectory(File starts,
boolean recursivly)
starts - harvested directoryrecursivly -
public org.apache.commons.collections.BidiMap harvestLocalWikitties(File starts,
boolean recursivly)
throws IOException
starts - recursivly -
IOException
public static PropertiesExtended getWikittyPublicationProperties(File starts,
String name)
throws IOException
starts - the directory that containt a .wp directory containing the
propertyname - the property file name, use constants
IOException - if error while reading the file
protected Wikitty restore(String id,
FileSystemWIkittyId fileId)
throws IOException
id - the wikitty idfileId - the wikitty file system id (his localisation on the
wikittyFileSystem)
IOException - if errors while reading the file
protected void harvestNewCheckModificationsAndDeleted(File starts,
String label)
throws IOException
starts - the starting directorylabel - the current label, normaly equals to the starting directory
IOException - if error while read file, read property
protected void checkModifications(File child)
throws IOException
child - the file need to check if modified
IOException
protected void writeWikittyFileProperties(File towrite,
String wikittyID,
String wikittyVersion)
throws IOException
towrite - the filewikittyID - wiitty id, null if wikitty does not exist yetwikittyVersion - wikitty version, null if wikitty not exist yet
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||