public class FileTemplateStoreService extends Object implements TemplateStoreService<File>
TemplateStoreService
Constructor and Description |
---|
FileTemplateStoreService() |
Modifier and Type | Method and Description |
---|---|
File |
commitTemplate(File template,
String newContent)
Will ensure the current saved template, creates also a rollback point for any future reverts.
|
Object |
getDownloadableVersion(File template)
Get a downloadable version of the Template as a File or some object that can be represented as a download option
|
org.apache.commons.collections.Transformer |
getPostAction()
Action transformers that take File as input pre and post
updateTemplate(File, String) |
org.apache.commons.collections.Transformer |
getPreAction()
Action transformers that take File as input pre and post
updateTemplate(File, String) |
String |
getResourceContent(File template)
Get the contents of the template
|
File |
getTemplate(String id,
String path)
Get Template from id and/or path
|
String |
getTemplateHistoryAsMarkup(File template)
Get the history of the template edits (if possible) as Markup (HTML) or JSON
|
String |
getTemplateId(File template)
Get system id for the template
|
String |
getTemplatePath(File template)
Get the system path for the template
|
String |
getTemplateType(File template)
Get a type that the template represents.
|
List<String> |
getVersionIds(File template)
Get the version ids for all the templates.
|
List<File> |
getVersions(File template)
Get the versions for all the templates
|
boolean |
isCommitPossible(File template)
Any commit specific implementation available
|
boolean |
isRevertPossible(File template)
Is there a revert point to go back to for the given template
|
File |
revertTemplate(File template,
String version)
Revert to a rollback (committed) point.
|
void |
setPostAction(org.apache.commons.collections.Transformer postAction)
Action transformers that take File as input pre and post
updateTemplate(File, String) |
void |
setPreAction(org.apache.commons.collections.Transformer preAction)
Action transformers that take File as input pre and post
updateTemplate(File, String) |
File |
updateTemplate(File template,
String newContent)
Update template with latest content provided to the method
Will make changes to the current template |
String |
updateTemplateHistory(File template,
Map updates)
Update Template History with details
|
public String getResourceContent(File template) throws Exception
TemplateStoreService
getResourceContent
in interface TemplateStoreService<File>
Exception
public File updateTemplate(File template, String newContent)
TemplateStoreService
updateTemplate
in interface TemplateStoreService<File>
public File commitTemplate(File template, String newContent)
TemplateStoreService
commitTemplate
in interface TemplateStoreService<File>
public File revertTemplate(File template, String version)
TemplateStoreService
revertTemplate
in interface TemplateStoreService<File>
public boolean isRevertPossible(File template)
TemplateStoreService
isRevertPossible
in interface TemplateStoreService<File>
public List<File> getVersions(File template)
TemplateStoreService
getVersions
in interface TemplateStoreService<File>
public List<String> getVersionIds(File template)
TemplateStoreService
TemplateStoreService.getVersions(Object)
, as it does not fetch the actual template.getVersionIds
in interface TemplateStoreService<File>
List
of version ids. Order of the list is assumed to chronological by defaultpublic String getTemplateId(File template)
TemplateStoreService
getTemplateId
in interface TemplateStoreService<File>
public String getTemplatePath(File template)
TemplateStoreService
getTemplatePath
in interface TemplateStoreService<File>
public String getTemplateHistoryAsMarkup(File template)
TemplateStoreService
getTemplateHistoryAsMarkup
in interface TemplateStoreService<File>
public String getTemplateType(File template)
TemplateStoreService
getTemplateType
in interface TemplateStoreService<File>
public File getTemplate(String id, String path)
TemplateStoreService
getTemplate
in interface TemplateStoreService<File>
public String updateTemplateHistory(File template, Map updates)
TemplateStoreService
updateTemplateHistory
in interface TemplateStoreService<File>
public boolean isCommitPossible(File template)
TemplateStoreService
isCommitPossible
in interface TemplateStoreService<File>
public Object getDownloadableVersion(File template)
TemplateStoreService
getDownloadableVersion
in interface TemplateStoreService<File>
public org.apache.commons.collections.Transformer getPreAction()
updateTemplate(File, String)
public void setPreAction(org.apache.commons.collections.Transformer preAction)
updateTemplate(File, String)
public org.apache.commons.collections.Transformer getPostAction()
updateTemplate(File, String)
public void setPostAction(org.apache.commons.collections.Transformer postAction)
updateTemplate(File, String)
Copyright © 2018. All rights reserved.