com.sap.portal.admin.editor
Interface IEditorContext

All Superinterfaces:
IBasicEditingContext

public interface IEditorContext
extends IBasicEditingContext

The editor context is the session representor. It contains APIs for manage properties on the session, and other helper methods.


Method Summary
 IEditorResponse getEditorResponse()
          Get the editor response of the current context.
 com.sapportals.htmlb.event.Event getEvent()
          Get the event object that was sent by the Htmlb The event can be then checked for inside details. (navigation details for example)
 java.util.Map getInitialParameters()
          Get the request parameters passed to the editor
 java.lang.Object getProperty(java.lang.String key)
          Get the property at path "key" from the session
 com.sapportals.portal.prt.component.IPortalComponentRequest getRequest()
          Get the request that this context was constructed from.
 com.sapportals.util.session.util.StoreableMap getSubtreeAsMap(java.lang.String subtreeRoot)
          Get subtree of properties as StoreableMap
 boolean isDirty()
          Get whether the editor state was changed and therfore the data need to be saved when the editor will be closed.
 boolean isEmbeddedEditor()
          Indicates whether this editor was opened as embedded editor of another editor.
 boolean isHoldLock()
          Indicates whether in the current context, the locking mechanism was opertaed successfully.
 boolean isReadOnly()
          Indicates weather the editor is in read-only mode
 void removeProperty(java.lang.String key)
          Remove the property at path "key" from the session
 void removeSubtree(java.lang.String subtreeRoot)
          Remove the property at path "key" and all of it's subproperties at path "key.*" from the session
 void setDirty(boolean isDirty)
          Set whether the editor state was changed and therfore requires save operation when the editor will be closed.
 void setLoadDataRequired(boolean requireLoadData)
          Set whether the editor data must be loaded.
 void setProperty(java.lang.String key, java.lang.Object value)
          Set the property at path "key" in the session
 void setReadOnly()
          Mark this context as a "read only" state.
 void setTemporaryProperty(java.lang.String key, java.lang.Object value)
          Set the temporary property at path "key" in the session This property will be availible only In the current request cycle.
 

Method Detail

setLoadDataRequired

public void setLoadDataRequired(boolean requireLoadData)
Set whether the editor data must be loaded. This API can be used for reset the data: Passing requireLoadData=true will cause in the next request cycle the editor to load the data as it is stored in the server.
Parameters:
requireLoadData - true if the data must be loaded, false if the data was already loaded

setDirty

public void setDirty(boolean isDirty)
Set whether the editor state was changed and therfore requires save operation when the editor will be closed. By default the value will be false. When set this value to true, it will persist untill saving- then it will be reset by the framework.
Parameters:
isDirty - - true if save is needed.

isDirty

public boolean isDirty()
Get whether the editor state was changed and therfore the data need to be saved when the editor will be closed. By default the value will be false. When set this value to true, it will persist untill saving- then it will be reset by the framework.
Returns:
true if the data must be saved before closing the editor.

getInitialParameters

public java.util.Map getInitialParameters()
Get the request parameters passed to the editor
Specified by:
getInitialParameters in interface IBasicEditingContext
Returns:
Map of all parameters

getEditorResponse

public IEditorResponse getEditorResponse()
Get the editor response of the current context. The editor can be used for adding java scripts code to the response.
Returns:
IEditorResponse the editor response object.
See Also:
IEditorResponse

isEmbeddedEditor

public boolean isEmbeddedEditor()
Indicates whether this editor was opened as embedded editor of another editor. The default value is false. The value is set to true only if the main editor passed a paramter in the request: com.sap.portal.editorMode=embedded
Returns:
true if this editor is an embedded editor.

getEvent

public com.sapportals.htmlb.event.Event getEvent()
Get the event object that was sent by the Htmlb The event can be then checked for inside details. (navigation details for example)
Returns:
htmlb event

isHoldLock

public boolean isHoldLock()
Indicates whether in the current context, the locking mechanism was opertaed successfully. This can be a sign that a lock release should be performed.
Returns:
true if the current context hold lock

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object value)
Set the property at path "key" in the session
Specified by:
setProperty in interface IBasicEditingContext

getProperty

public java.lang.Object getProperty(java.lang.String key)
Get the property at path "key" from the session
Specified by:
getProperty in interface IBasicEditingContext

setReadOnly

public void setReadOnly()
Mark this context as a "read only" state. This read only will be valid only for the current request. After setting this context as read only, there is no option to reverse it to "edit mode" in the current request\

isReadOnly

public boolean isReadOnly()
Indicates weather the editor is in read-only mode
Returns:
true if in read-only mode, or false if in read-write mode

getSubtreeAsMap

public com.sapportals.util.session.util.StoreableMap getSubtreeAsMap(java.lang.String subtreeRoot)
Get subtree of properties as StoreableMap
Specified by:
getSubtreeAsMap in interface IBasicEditingContext
Parameters:
subtreeRoot - the property that is the roor for the subtree
Returns:
StoreableMap map that can be stored at the client.

setTemporaryProperty

public void setTemporaryProperty(java.lang.String key,
                                 java.lang.Object value)
Set the temporary property at path "key" in the session This property will be availible only In the current request cycle.
Specified by:
setTemporaryProperty in interface IBasicEditingContext

removeProperty

public void removeProperty(java.lang.String key)
Remove the property at path "key" from the session
Specified by:
removeProperty in interface IBasicEditingContext

removeSubtree

public void removeSubtree(java.lang.String subtreeRoot)
Remove the property at path "key" and all of it's subproperties at path "key.*" from the session
Specified by:
removeSubtree in interface IBasicEditingContext

getRequest

public com.sapportals.portal.prt.component.IPortalComponentRequest getRequest()
Get the request that this context was constructed from.

IMPORTANT
The request must be used only for services that are not supported by the editor framework!!
DO NOT USE THE REQUEST FOR SAVING PROPERTIES OR/AND ANY OTHER SERVICE THAT THE EDIOTR FRAMEWORK PROVIDES!!!

Specified by:
getRequest in interface IBasicEditingContext
Returns:
portal component request object