public abstract class ABasicResourceBean<E extends IFileDataEntity<?>,T extends IFileProviding<?,E> & INameProviding & IDescriptionProviding> extends FCContextBean
AJSFContext.RedirectOptions, AJSFContext.RedirectOptionsBuilder
Modifier and Type | Field and Description |
---|---|
static String |
FILENAME_RESOURCES_SUFFIX |
static String |
FILENAME_RESOURCES_ZIP |
protected boolean |
forceTextEdit
If true, show an editor for text files even if they are binary files or very large.
|
protected IEntityListModel<T> |
model |
protected org.primefaces.model.UploadedFile |
upload |
protected String |
uploadFileName |
protected Integer |
uploadFileSize |
systemUC
Constructor and Description |
---|
ABasicResourceBean() |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
checkResourceNameExist(String name) |
void |
cleanup() |
protected abstract T |
createResource(String resourceName,
String description,
String fileName,
byte[] data,
String userName) |
org.primefaces.model.StreamedContent |
getMarkedResources()
Generates
StreamedContent from the List of all the marked resources contained within the model. |
IEntityListModel<T> |
getModel() |
protected abstract IEntityListModel<T> |
getNewModel() |
EContentType |
getPreviewType() |
ResourceContentBean |
getResourceContentBean() |
String |
getResourceName() |
protected org.primefaces.model.StreamedContent |
getStreamedContent(List<T> resources,
String zipFileName)
Generates
StreamedContent from the given List of resources. |
String |
getUploadFileName() |
Integer |
getUploadFileSize() |
boolean |
hasResourceData() |
boolean |
isForceTextEdit() |
boolean |
isImageResource(T resource) |
boolean |
isPreviewResource(T resource) |
boolean |
isReaderResource(T resource) |
boolean |
isShowImagePreview() |
boolean |
isShowPreview() |
boolean |
isShowReaderPreview() |
boolean |
isShowTextPreview()
Deprecated.
Use a more specific editor (JS, CSS etc.)
|
boolean |
isShowTextPreviewBinary() |
boolean |
isSourceCodeResource(T resource) |
boolean |
isTextPreviewSizeExceeded() |
boolean |
isTextResource(T resource) |
protected void |
resetUploadValues() |
void |
setForceTextEdit(boolean forceTextEdit) |
void |
setModel(IEntityListModel<T> model) |
void |
setResourceContentBean(ResourceContentBean resourceContentBean) |
void |
setResourceName(String resourceName) |
void |
updateModel() |
protected void |
updateResource(byte[] data)
Processes uploaded resource
|
protected abstract T |
updateResource(String resourceName,
String newResourceName,
String description,
String fileName,
byte[] data,
String userName) |
protected int |
updateResourceDependentConditions(String resourceName,
String newResourceName,
ERessourcenTyp resourceType)
Updates the conditions that depend on the resource with the given resource name to use the new resource name
|
void |
upload(org.primefaces.event.FileUploadEvent event)
Uploads resource to Bean
|
void |
uploadAndPersist(org.primefaces.event.FileUploadEvent event)
Uploads a file and persists it as a new resource
|
getNavigationBean, getSessionBean, isSetupUser, redirectToDashboard, setNavigationBean, setSessionBean, switchMainView, switchMainView, switchSubView, switchSubView
ec, isDetached, isHasDB
destroySessionBean, encodeURL, findBean, findBean, findBean, findBean, findCurrentView, getBeanName, getBeanName, getContext, getCurrentViewBean, getLocaleBean, getRequest, getResponse, getSession, getSession, getSessionAttribute, isMasterServerContext, loadLazy, redirect, redirect, redirect, redirect, redirectToDashboard, redirectToDashboard, setLocaleBean, setSessionAttribute, uc
addErrorMsg, addErrorMsg, addErrorMsg, addErrorMsg, addErrorMsg, addErrorMsg, addErrorMsgFromString, addErrorMsgFromString, addErrorMsgToComponent, addErrorMsgToComponent, addErrorMsgToComponent, addErrorMsgToComponent, addErrorMsgToComponent, addErrorMsgToComponent, addInfoMsg, addInfoMsg, addInfoMsg, addInfoMsg, addInfoMsgFromString, addInfoMsgFromString, addInfoMsgToComponent, addInfoMsgToComponent, addInfoMsgToComponent, addInfoMsgToComponent, addMsg, addMsg, addMsg, addMsg, addMsgs, addMsgToComponent, addMsgToComponent, addWarnMsg, addWarnMsg, addWarnMsg, addWarnMsg, addWarnMsgFromString, addWarnMsgFromString, addWarnMsgToComponent, addWarnMsgToComponent, addWarnMsgToComponent, addWarnMsgToComponent, cleanErrorMsg, getErrorMessage
public static final String FILENAME_RESOURCES_ZIP
public static final String FILENAME_RESOURCES_SUFFIX
protected boolean forceTextEdit
protected IEntityListModel<T extends IFileProviding<?,E> & INameProviding & IDescriptionProviding> model
protected org.primefaces.model.UploadedFile upload
protected String uploadFileName
protected Integer uploadFileSize
public ResourceContentBean getResourceContentBean()
public void setResourceContentBean(ResourceContentBean resourceContentBean)
public String getResourceName()
public void setResourceName(String resourceName)
public String getUploadFileName()
public Integer getUploadFileSize()
public void updateModel()
public IEntityListModel<T> getModel()
public void setModel(IEntityListModel<T> model)
model
- the model to setpublic boolean hasResourceData()
public boolean isShowPreview()
public EContentType getPreviewType()
public boolean isShowImagePreview()
public boolean isShowReaderPreview()
@Deprecated public boolean isShowTextPreview()
public boolean isShowTextPreviewBinary()
public boolean isTextPreviewSizeExceeded()
public boolean isForceTextEdit()
public void setForceTextEdit(boolean forceTextEdit)
public boolean isPreviewResource(T resource)
public boolean isImageResource(T resource)
public boolean isReaderResource(T resource)
public boolean isTextResource(T resource)
public boolean isSourceCodeResource(T resource)
public org.primefaces.model.StreamedContent getMarkedResources()
StreamedContent
from the List of all the marked resources contained within the model. If
this list contains only a single entry the StreamedContent
for this resource will be returned. If the list
contains more than one entry the resources will be packed into a zip file and the generated StreamedContent
of the zip file will be returned.StreamedContent
of all the marked model resourcespublic void upload(org.primefaces.event.FileUploadEvent event)
event
- FileUploadEvent
containing the resourcepublic void uploadAndPersist(org.primefaces.event.FileUploadEvent event)
event
- FileUploadEvent
containing the new resourceprotected org.primefaces.model.StreamedContent getStreamedContent(List<T> resources, String zipFileName)
StreamedContent
from the given List of resources. If this list contains only a single entry the
StreamedContent
for this resource will be returned. If the list contains more than one entry the resources
will be packed into a zip file with the specified filename and the generated StreamedContent
of the zip
file will be returned.protected void updateResource(byte[] data)
protected void resetUploadValues()
protected int updateResourceDependentConditions(String resourceName, String newResourceName, ERessourcenTyp resourceType)
resourceName
- String
old name of the resourcenewResourceName
- String
new name of the resourceresourceType
- ERessourcenTyp
type of resourceprotected abstract IEntityListModel<T> getNewModel()
protected abstract T createResource(String resourceName, String description, String fileName, byte[] data, String userName) throws Exception
Exception
protected abstract T updateResource(String resourceName, String newResourceName, String description, String fileName, byte[] data, String userName) throws Exception
Exception
protected abstract boolean checkResourceNameExist(String name)
@PreDestroy public void cleanup()
Copyright © 2019 XIMA MEDIA GmbH. All rights reserved.