public class PersistenceService extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PersistenceService.LoadingBean |
static class |
PersistenceService.MetaPersistenceBean |
Modifier and Type | Field and Description |
---|---|
Integer |
__version |
protected boolean |
canRedo |
static String |
GLOBAL_MAP_NAME |
protected static Logger |
logger
create a static logger.
|
static SimpleDateFormat |
PERSISTENCE_DATE_FORMAT |
static boolean |
STORE_DATA_PROPERTIES |
static String |
STORE_FILE_PREFIX |
static int |
UNDO_DEPTH |
Constructor and Description |
---|
PersistenceService() |
Modifier and Type | Method and Description |
---|---|
boolean |
canRedo() |
boolean |
canUndo() |
int |
checkStructureIntegrity(ContentContext ctx,
PrintStream out,
MenuElement root) |
boolean |
clean(ContentContext ctx) |
void |
cleanFile() |
void |
clearTrackCache() |
void |
correctAllFiles() |
protected void |
finalize() |
void |
flush() |
List<Date> |
getBackupDates() |
String |
getDirectory() |
static PersistenceService |
getInstance(GlobalContext globalContext) |
static String |
getKey(GlobalContext globalContext) |
String |
getPersistenceFilePrefix(int mode) |
List<PersistenceService.MetaPersistenceBean> |
getPersistences() |
Properties |
getTrackCache() |
int |
getVersion() |
void |
insertContent(NodeXML pageXML,
MenuElement elem,
String defaultLg,
boolean releaseID) |
MenuElement |
insertPage(GlobalContext globalContext,
NodeXML pageXML,
MenuElement parent,
Map<MenuElement,String[]> vparentPreparation,
String defaultLg,
boolean checkName) |
boolean |
isAskStore() |
boolean |
isLoaded() |
boolean |
isPreviewVersion(int version)
check if a preview version exist on FileSystem.
|
MenuElement |
load(ContentContext ctx,
int renderMode,
Map<String,String> contentAttributeMap,
Date timeTravelDate) |
protected MenuElement |
load(ContentContext ctx,
int renderMode,
Map<String,String> contentAttributeMap,
Date timeTravelDate,
boolean correctXML,
Integer previewVersion) |
protected PersistenceService.LoadingBean |
load(ContentContext ctx,
Object in,
File propFile,
Map<String,String> contentAttributeMap,
TaxonomyBean taxonomyBean,
int renderMode)
load data from InputStream of Reader
|
MenuElement |
loadPreview(ContentContext ctx,
Integer version)
load a specific preview version.
|
Track[] |
loadTracks(Date from,
Date to,
boolean onlyViewClick,
boolean onlyResource)
load current version of preview content.
|
static void |
main(String[] args) |
static Date |
parseDate(String date) |
void |
publishPreviewFile(ContentContext ctx) |
void |
redo() |
static String |
renderDate(Date date) |
void |
resetVersion() |
protected void |
saveVersion() |
void |
sendPersistenceErrorToAdministrator(String message,
File file,
Throwable e) |
void |
setAskStore(boolean askStore)
ask storage of data at the end of request
|
boolean |
setVersion(int version)
set preview version for next loading.
|
void |
store(ContentContext ctx) |
void |
store(ContentContext ctx,
boolean async) |
void |
store(ContentContext ctx,
int renderMode) |
void |
store(ContentContext ctx,
int renderMode,
boolean async) |
void |
store(Track track) |
void |
storeTrackCache() |
void |
storeView(InputStream in) |
void |
undo() |
public static boolean STORE_DATA_PROPERTIES
protected static Logger logger
public static SimpleDateFormat PERSISTENCE_DATE_FORMAT
public static final String GLOBAL_MAP_NAME
public static final String STORE_FILE_PREFIX
public static int UNDO_DEPTH
public Integer __version
protected boolean canRedo
public static final Date parseDate(String date) throws ParseException
ParseException
public static final PersistenceService getInstance(GlobalContext globalContext) throws ServiceException
ServiceException
public static String getKey(GlobalContext globalContext)
public boolean canRedo()
public boolean canUndo()
public void cleanFile()
public void correctAllFiles()
public List<PersistenceService.MetaPersistenceBean> getPersistences()
public String getDirectory()
public Properties getTrackCache()
public void clearTrackCache()
public void storeTrackCache()
protected void finalize() throws Throwable
public int getVersion()
public void resetVersion()
public void insertContent(NodeXML pageXML, MenuElement elem, String defaultLg, boolean releaseID) throws DebugHelper.StructureException
DebugHelper.StructureException
public MenuElement insertPage(GlobalContext globalContext, NodeXML pageXML, MenuElement parent, Map<MenuElement,String[]> vparentPreparation, String defaultLg, boolean checkName) throws DebugHelper.StructureException, IOException
protected PersistenceService.LoadingBean load(ContentContext ctx, Object in, File propFile, Map<String,String> contentAttributeMap, TaxonomyBean taxonomyBean, int renderMode) throws ServiceException, InterruptedException
ctx
- in
- can Reader of InputStreamcontentAttributeMap
- renderMode
- ServiceException
InterruptedException
public MenuElement load(ContentContext ctx, int renderMode, Map<String,String> contentAttributeMap, Date timeTravelDate) throws Exception
Exception
public boolean isPreviewVersion(int version)
version
- public MenuElement loadPreview(ContentContext ctx, Integer version) throws Exception
ctx
- version
- Exception
public int checkStructureIntegrity(ContentContext ctx, PrintStream out, MenuElement root)
public String getPersistenceFilePrefix(int mode)
protected MenuElement load(ContentContext ctx, int renderMode, Map<String,String> contentAttributeMap, Date timeTravelDate, boolean correctXML, Integer previewVersion) throws Exception
Exception
public Track[] loadTracks(Date from, Date to, boolean onlyViewClick, boolean onlyResource)
IOException
public void publishPreviewFile(ContentContext ctx) throws IOException, ParseException
IOException
ParseException
public void redo()
public boolean setVersion(int version)
version
- a content versionprotected void saveVersion()
public void setAskStore(boolean askStore)
askStore
- public boolean isAskStore()
public void store(ContentContext ctx) throws Exception
Exception
public void store(ContentContext ctx, boolean async) throws Exception
Exception
public void store(ContentContext ctx, int renderMode) throws Exception
Exception
public void store(ContentContext ctx, int renderMode, boolean async) throws Exception
Exception
public void flush()
public void storeView(InputStream in) throws Exception
Exception
public void undo()
public void sendPersistenceErrorToAdministrator(String message, File file, Throwable e) throws javax.mail.internet.AddressException
javax.mail.internet.AddressException
public boolean clean(ContentContext ctx)
public boolean isLoaded()
Copyright © 2012-2018. All Rights Reserved.