|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.droplet.EmptyFormHandler atg.droplet.GenericFormHandler atg.repository.servlet.RepositoryFormHandler atg.epub.servlet.RepositoryAssetFormHandler
public class RepositoryAssetFormHandler
RepositoryAssetFormHandler (Moved from EPubAssetFormHandler, file upload functionality removed) Subclass of atg.repository.servlet.RepositoryFormHandler for creating, saving, deleting assets and projects in publishing.
useRequestLocale When set to true, form handler exception messages are retrieved using the locale of the current request.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
protected static java.lang.String |
MSG_UNABLE_TO_ADD_ITEM_TO_PROPERTY
|
protected static java.lang.String |
MSG_UNABLE_TO_GET_UPDATEABLE_ITEM
|
protected static java.lang.String |
MSG_UPDATEABLE_CONTENT_ITEM_ERROR
|
protected static java.lang.String |
MSG_UPDATEABLE_ITEM_CONFIG_ERROR
|
protected static java.lang.String |
UPDATE_KEY
|
Fields inherited from class atg.repository.servlet.RepositoryFormHandler |
---|
STATUS_ERROR_REDIRECT, STATUS_ERROR_STAY, STATUS_SUCCESS |
Fields inherited from class atg.droplet.GenericFormHandler |
---|
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.repository.servlet.RepositoryFormConstants |
---|
NULL_SENTINEL, REPOSITORY_ID_PROPERTY_NAME, RESOURCE_BUNDLE_NAME, UPDATE_APPEND, UPDATE_PREPEND, UPDATE_REMOVE, UPDATE_REPLACE |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
RepositoryAssetFormHandler()
|
Method Summary | |
---|---|
void |
afterGet(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Override this method to set form handler's attributes into the context |
void |
beforeGet(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Called when a form is rendered that references this bean. |
boolean |
beforeSet(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Called before any setX methods on this form are set when a form that modifies properties of this form handler is submitted. |
protected MutableRepositoryItem |
createTransientItem()
Creates a new, empty repository item, does not add new item persistently to the repository. |
java.lang.String |
getActionType()
|
java.lang.String |
getActionURL()
|
java.lang.Object |
getAssetEditor()
This form handler edits its own assets |
AssetInfo |
getAssetInfo()
|
protected AssetInfo |
getAssetInfoFromRequest(DynamoHttpServletRequest pRequest)
|
java.lang.String |
getAssetInfoPath()
|
java.lang.String |
getAssetURI()
Get the asset URI. |
java.util.Map |
getAttributes()
Get the attributes set in the form's mapping |
java.lang.String |
getComponentPath()
|
int |
getContextOp()
|
UploadedFile |
getDataFromUploadedFile(boolean pFileRequired,
UploadedFile pUploadedFile,
int pMaxMegabytes,
java.lang.String pFileSizePropertyName,
java.lang.String pMimeTypePropertyName,
java.lang.String pFileDataPropertyName,
java.lang.String pFilenamePropertyName,
java.lang.String pParentFolderPropertyName,
atg.repository.content.ContentPropertyItemDescriptor pContentDescriptor,
java.lang.String pPathPropertyName,
java.lang.String pLastModifiedPropertyName,
FileValidator pValidator)
|
java.lang.String |
getDisplayName()
|
java.lang.String |
getEncodedPathAndItemType()
|
java.lang.String |
getId()
|
java.lang.String[] |
getIllegalIdCharacters()
|
java.lang.Object |
getItem()
|
java.lang.String |
getItemDisplayName()
|
java.lang.String |
getItemType()
|
RepositoryItem |
getRepositoryItem()
Returns the repository item (if any) to edit from this form handler This is retrieved based on the repository, itemDescriptorName, and repositoryId properties; |
protected javax.transaction.TransactionManager |
getTransactionManager()
Returns the transaction manager for the repository that we are using |
MutableRepositoryItem |
getTransientRepositoryItem()
Get the transient item. |
java.lang.String |
getView()
Return the index to the current asset view as a string. |
protected RepositoryItemDescriptor |
getWrappedItemDescriptor()
|
boolean |
handleChangeView(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Called when user changes view or current item. |
boolean |
handleContextChange(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
|
boolean |
handleCreateTransient(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
|
boolean |
handleDelete(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Deletes the item specified by the repositoryId
property from the repository. |
boolean |
handleSubmitAction(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
A handler method that delegates to other handler methods base on the value of the 'actionType' property. |
boolean |
handleSubmitAction(javax.portlet.PortletRequest pRequest,
javax.portlet.PortletResponse pResponse)
|
boolean |
handleUpdate(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Takes the current set of property values set as members of the value property and, if there were no errors in
submitting the form, modifies the item described by the
repositoryId property with these values. |
boolean |
isEditMode()
|
boolean |
isTransient()
Return true if form handler is working with transient item |
boolean |
isUseAssetUri()
|
boolean |
isUseRequestLocale()
Return the useRequestLocale property. |
protected void |
loadContext(AssetFormContext pContext)
Load context information |
protected void |
nonClearingSetRepositoryId(java.lang.String pId)
Don't clear values no matter what clearValueOnSet says |
java.util.HashMap |
parseSessionVariables(java.lang.String pAttributes)
|
void |
processException(java.lang.Exception pException,
java.lang.String pMsgId,
DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Add a user error message to the form exceptions, and then display the exception in the logs |
void |
processException(java.lang.Exception pException,
java.lang.String pMsgId,
DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse,
java.lang.Object pParam)
Add a user error message to the form exceptions, and then display the exception in the logs |
protected void |
saveContext(AssetFormContext pContext)
Save current context to pContext |
protected RepositoryItem |
saveTransientItem(MutableRepositoryItem pItem)
Save a transient repository item, return the persistent result or null |
void |
setActionType(java.lang.String pActionType)
Set the action type for the submit method |
void |
setActionURL(java.lang.String pURL)
Set the action URL for all possible actions to prevent redirection |
void |
setAssetInfo(AssetInfo pAssetInfo)
Set the AssetInfo for this form handler. |
void |
setAssetInfoPath(java.lang.String pPath)
This method is called on form submits to set the assetInfo via that component's nucleus path |
void |
setAssetURI(java.lang.String pAssetURI)
Set the asset URI. |
void |
setAttributes(java.util.Map pAttributes)
|
void |
setComponentPath(java.lang.String pPath)
|
void |
setContextOp(int pContextOp)
|
void |
setDisplayName(java.lang.String pDisplayName)
|
void |
setEditMode(boolean pEditMode)
|
void |
setEncodedPathAndItemType(java.lang.String pValue)
Set the repository path and item descriptor name as one encoded value. |
void |
setIllegalIdCharacters(java.lang.String[] pIllegalIdCharacters)
|
void |
setItem(java.lang.Object pItem)
|
void |
setItemType(java.lang.String pType)
Set the item descriptor name |
void |
setRepositoryId(java.lang.String pId)
Sets the repository id of the item to be manipulated. |
void |
setSessionVariables(javax.servlet.http.HttpSession pSession,
java.util.Map pSessionVarMap)
|
void |
setTransientItem(java.lang.Object pItem)
|
void |
setUseRequestLocale(boolean pUseRequestLocale)
Set the useRequestLocale property. |
void |
setView(java.lang.String pView)
Set the current asset view |
protected void |
updateAssetInfo()
Set this form handler as the current form handler in the asset info object. |
protected void |
updateAssetInfo(DynamoHttpServletRequest pRequest)
|
void |
updateContextInformation(AssetFormContext pContext)
Called before context push. |
protected boolean |
updateItemProperties()
Update |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
protected static final java.lang.String MSG_UNABLE_TO_ADD_ITEM_TO_PROPERTY
protected static final java.lang.String MSG_UNABLE_TO_GET_UPDATEABLE_ITEM
protected static final java.lang.String MSG_UPDATEABLE_ITEM_CONFIG_ERROR
protected static final java.lang.String MSG_UPDATEABLE_CONTENT_ITEM_ERROR
protected static final java.lang.String UPDATE_KEY
Constructor Detail |
---|
public RepositoryAssetFormHandler()
Method Detail |
---|
public boolean beforeSet(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws DropletFormException
GenericFormHandler
beforeSet
in interface DropletFormHandler
beforeSet
in class GenericFormHandler
DropletFormException
public void beforeGet(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
EmptyFormHandler
beforeGet
in interface DropletFormHandler
beforeGet
in class EmptyFormHandler
public void setAssetInfoPath(java.lang.String pPath) throws javax.servlet.ServletException, java.io.IOException
pPath
- the assetInfo's nucleus component path
javax.servlet.ServletException
java.io.IOException
public java.lang.String getAssetInfoPath()
public boolean isUseAssetUri()
public java.lang.String[] getIllegalIdCharacters()
public void setIllegalIdCharacters(java.lang.String[] pIllegalIdCharacters)
public void setAssetInfo(AssetInfo pAssetInfo) throws javax.servlet.ServletException, java.io.IOException
pAssetInfo
- the asset info
javax.servlet.ServletException
java.io.IOException
public void setEditMode(boolean pEditMode)
public boolean isEditMode()
public AssetInfo getAssetInfo()
public int getContextOp()
public void setContextOp(int pContextOp) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
public void setEncodedPathAndItemType(java.lang.String pValue)
pValue
- the encoded valuepublic java.lang.String getEncodedPathAndItemType()
public void setDisplayName(java.lang.String pDisplayName)
public java.lang.String getDisplayName()
public java.lang.String getId()
public java.lang.String getItemDisplayName()
public java.util.Map getAttributes()
public void setAttributes(java.util.Map pAttributes)
public void setView(java.lang.String pView)
pView
- the viewpublic java.lang.String getView()
public void setActionType(java.lang.String pActionType)
pActionType
- the action type namepublic java.lang.String getActionType()
public java.lang.Object getAssetEditor()
public void setAssetURI(java.lang.String pAssetURI)
pAssetURI
- the asset's URIpublic java.lang.String getAssetURI()
public void setComponentPath(java.lang.String pPath)
public java.lang.String getComponentPath()
public void setItemType(java.lang.String pType)
public java.lang.String getItemType()
public boolean isTransient()
public void setTransientItem(java.lang.Object pItem)
public void setItem(java.lang.Object pItem)
public java.lang.Object getItem()
public RepositoryItem getRepositoryItem()
RepositoryFormHandler
getRepositoryItem
in interface RepositoryFormData
getRepositoryItem
in class RepositoryFormHandler
protected AssetInfo getAssetInfoFromRequest(DynamoHttpServletRequest pRequest)
protected void updateAssetInfo(DynamoHttpServletRequest pRequest) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
public void afterGet(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
afterGet
in interface DropletFormHandler
afterGet
in class EmptyFormHandler
pRequest
- the requestpResponse
- the responseprotected void saveContext(AssetFormContext pContext)
pContext
- the context to save toprotected void loadContext(AssetFormContext pContext)
pContext
- the context to loadpublic void updateContextInformation(AssetFormContext pContext) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
protected void updateAssetInfo() throws javax.servlet.ServletException, java.io.IOException
pRequest
- the dynamo request
javax.servlet.ServletException
java.io.IOException
public java.util.HashMap parseSessionVariables(java.lang.String pAttributes)
public void setSessionVariables(javax.servlet.http.HttpSession pSession, java.util.Map pSessionVarMap)
public MutableRepositoryItem getTransientRepositoryItem()
public boolean isUseRequestLocale()
public void setUseRequestLocale(boolean pUseRequestLocale)
pUseRequestLocale
- protected void nonClearingSetRepositoryId(java.lang.String pId)
pId
- the ID to setpublic boolean handleSubmitAction(javax.portlet.PortletRequest pRequest, javax.portlet.PortletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
public boolean handleSubmitAction(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
protected MutableRepositoryItem createTransientItem() throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
- if there was an error while executing
the code
java.io.IOException
- if there was an error with servlet ioprotected RepositoryItem saveTransientItem(MutableRepositoryItem pItem) throws javax.servlet.ServletException, java.io.IOException
pItem
- the transient item
javax.servlet.ServletException
java.io.IOException
public void setRepositoryId(java.lang.String pId)
value
dictionary, since the property
values in it correspond to the item with the old repository id.
setRepositoryId
in class RepositoryFormHandler
public boolean handleChangeView(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
protected boolean updateItemProperties() throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
public void setActionURL(java.lang.String pURL)
pURL
- the URLpublic java.lang.String getActionURL()
public boolean handleContextChange(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
public boolean handleCreateTransient(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
public boolean handleUpdate(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
RepositoryFormHandler
value
property and, if there were no errors in
submitting the form, modifies the item described by the
repositoryId
property with these values.
If any errors occur in the process, form errors will be added. If there were no errors encountered while submitting the form, we optionally redirect to the value of the property updateSuccessURL. Otherwise, we optionally redirect to updateErrorURL.
handleUpdate
in class RepositoryFormHandler
pRequest
- the servlet's requestpResponse
- the servlet's response
javax.servlet.ServletException
- if there was an error while executing
the code
java.io.IOException
- if there was an error with servlet iopublic boolean handleDelete(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
RepositoryFormHandler
repositoryId
property from the repository.
If any errors occur in the process, form errors will be added. If there were no errors encountered while submitting the form, we optionally redirect to the value of the property deleteSuccessURL. Otherwise, we optionally redirect to deleteErrorURL.
handleDelete
in class RepositoryFormHandler
pRequest
- the servlet's requestpResponse
- the servlet's response
javax.servlet.ServletException
- if there was an error while executing
the code
java.io.IOException
- if there was an error with servlet iopublic void processException(java.lang.Exception pException, java.lang.String pMsgId, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
public void processException(java.lang.Exception pException, java.lang.String pMsgId, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, java.lang.Object pParam) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
protected javax.transaction.TransactionManager getTransactionManager()
getTransactionManager
in class RepositoryFormHandler
protected RepositoryItemDescriptor getWrappedItemDescriptor()
public UploadedFile getDataFromUploadedFile(boolean pFileRequired, UploadedFile pUploadedFile, int pMaxMegabytes, java.lang.String pFileSizePropertyName, java.lang.String pMimeTypePropertyName, java.lang.String pFileDataPropertyName, java.lang.String pFilenamePropertyName, java.lang.String pParentFolderPropertyName, atg.repository.content.ContentPropertyItemDescriptor pContentDescriptor, java.lang.String pPathPropertyName, java.lang.String pLastModifiedPropertyName, FileValidator pValidator) throws javax.servlet.ServletException, java.io.IOException, RepositoryException
pFilenamePropertyName
- String name of file name property in content itempParentFolderPropertyName
- String name of parent folder property in content itempPathPropertyName
- String name of path property in content itempLastModifiedPropertyName
- String name of last modified property in content itempValidator
- optional file content validator
javax.servlet.ServletException
java.io.IOException
RepositoryException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |