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
TemplateStoreServicegetResourceContent in interface TemplateStoreService<File>Exceptionpublic File updateTemplate(File template, String newContent)
TemplateStoreServiceupdateTemplate in interface TemplateStoreService<File>public File commitTemplate(File template, String newContent)
TemplateStoreServicecommitTemplate in interface TemplateStoreService<File>public File revertTemplate(File template, String version)
TemplateStoreServicerevertTemplate in interface TemplateStoreService<File>public boolean isRevertPossible(File template)
TemplateStoreServiceisRevertPossible in interface TemplateStoreService<File>public List<File> getVersions(File template)
TemplateStoreServicegetVersions in interface TemplateStoreService<File>public List<String> getVersionIds(File template)
TemplateStoreServiceTemplateStoreService.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)
TemplateStoreServicegetTemplateId in interface TemplateStoreService<File>public String getTemplatePath(File template)
TemplateStoreServicegetTemplatePath in interface TemplateStoreService<File>public String getTemplateHistoryAsMarkup(File template)
TemplateStoreServicegetTemplateHistoryAsMarkup in interface TemplateStoreService<File>public String getTemplateType(File template)
TemplateStoreServicegetTemplateType in interface TemplateStoreService<File>public File getTemplate(String id, String path)
TemplateStoreServicegetTemplate in interface TemplateStoreService<File>public String updateTemplateHistory(File template, Map updates)
TemplateStoreServiceupdateTemplateHistory in interface TemplateStoreService<File>public boolean isCommitPossible(File template)
TemplateStoreServiceisCommitPossible in interface TemplateStoreService<File>public Object getDownloadableVersion(File template)
TemplateStoreServicegetDownloadableVersion 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.