public class TemplateUploadForm
extends org.apache.wicket.markup.html.panel.Panel
Constructor and Description |
---|
TemplateUploadForm(String id,
String templateId)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static String |
bytesToString(org.apache.wicket.util.lang.Bytes bytes,
Locale locale)
Convert
Bytes to a string, produces a prettier output than
Bytes.toString(Locale) |
protected String |
determinePreferredId(List<org.apache.wicket.markup.html.form.upload.FileUpload> uploads)
Determine the preferred resource identifier based on the uploaded files.
|
protected boolean |
isZipFile(org.apache.wicket.markup.html.form.upload.FileUpload upload)
Determines if a file upload is a ZIP file.
|
protected void |
onUploadSuccess(org.apache.wicket.markup.html.form.Form<?> form,
String templateId,
ProjectInfo projectInfo,
boolean updateInfo)
Called after a successful upload.
|
protected void |
restoreContent(File dir,
File oldContent)
Restore the old content of a template from an archive.
|
getWebPage, getWebRequest, getWebResponse, getWebSession
add, addOrReplace, autoAdd, contains, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, onAfterRenderChildren, onComponentTagBody, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildren
add, addStateChange, afterRender, beforeRender, canCallListenerInterface, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnModelChanged, internalPrepareForRender, internalRenderComponent, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, onAfterRender, onBeforeRender, onComponentTag, onConfigure, onDetach, onEvent, onInitialize, onModelChanged, onModelChanging, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderHead, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setRequestFlag, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, visitParents, warn, wrap
protected String determinePreferredId(List<org.apache.wicket.markup.html.form.upload.FileUpload> uploads)
uploads
- the uploaded filesnull
protected void restoreContent(File dir, File oldContent)
dir
- the template directoryoldContent
- the archive with the old contentprotected boolean isZipFile(org.apache.wicket.markup.html.form.upload.FileUpload upload)
upload
- the file uploadprotected void onUploadSuccess(org.apache.wicket.markup.html.form.Form<?> form, String templateId, ProjectInfo projectInfo, boolean updateInfo)
form
- the formtemplateId
- the template identifierprojectInfo
- the project infoupdateInfo
- if for an updated template, the template information
should be updated from the projectBuild 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a