Class CustomEditConfig

java.lang.Object
com.day.cq.wcm.core.components.CustomEditConfig
All Implemented Interfaces:
JSONItem, ComponentEditConfig, EditConfig

public class CustomEditConfig extends Object implements EditConfig
Helper class to create a edit config if not edit context is available.
  • Constructor Details

  • Method Details

    • drawEditing

      public void drawEditing(PrintWriter out, String contentPath, String resourceType, String dlgPath, Cell cell, boolean isContainer) throws IOException
      Throws:
      IOException
    • setLayout

      public void setLayout(EditLayout layout)
      Description copied from interface: EditConfig
      Sets the edit layout for the edit control widget.
      Specified by:
      setLayout in interface EditConfig
      Parameters:
      layout - edit layout
    • setInsertBehavior

      public void setInsertBehavior(String insertBehavior)
      Description copied from interface: EditConfig
      Sets the insert behavior
      Specified by:
      setInsertBehavior in interface EditConfig
      Parameters:
      insertBehavior - the behavior
    • setDialogMode

      public void setDialogMode(DialogMode mode)
      Description copied from interface: EditConfig
      Sets the dialog mode
      Specified by:
      setDialogMode in interface EditConfig
      Parameters:
      mode - the mode
    • setInplaceEditingConfig

      public void setInplaceEditingConfig(InplaceEditingConfig inplaceEditingConfig)
      Description copied from interface: EditConfig
      Sets the inplace editing configuration.
      Specified by:
      setInplaceEditingConfig in interface EditConfig
      Parameters:
      inplaceEditingConfig - The inplace editing configuration
    • setEmpty

      public void setEmpty(boolean empty)
      Description copied from interface: EditConfig
      Sets the empty flag. If true this indicates that the component has not visual content and a placeholder text should be rendered.
      Specified by:
      setEmpty in interface EditConfig
      Parameters:
      empty - true if a placeholder text should be rendered.
    • setEmptyText

      public void setEmptyText(String emptyText)
      Description copied from interface: EditConfig
      Sets the text to be displayed when ComponentEditConfig.isEmpty() is true. If text is null then the default text is displayed.
      Specified by:
      setEmptyText in interface EditConfig
      Parameters:
      emptyText - the text or null
    • setOrderable

      public void setOrderable(Boolean orderable)
      Description copied from interface: EditConfig
      Sets if the edited component is orderable.
      Specified by:
      setOrderable in interface EditConfig
      Parameters:
      orderable - true to enable ordering or null if the behavior is defined by the widgets.
    • setDeepCancel

      public void setDeepCancel(Boolean deepCancel)
      Description copied from interface: EditConfig
      Sets if cancelling inheritance of the component sets the cq:isCancelledForChildren flag or not.
      Specified by:
      setDeepCancel in interface EditConfig
      Parameters:
      deepCancel - true if cancel sets the flag or null if cancel does not set the flag.
    • setLiveRelationship

      public void setLiveRelationship(JSONItem liveRelationship)
      Description copied from interface: EditConfig
      Set the computed live relationship of the component TODO seems like we are only considering this as an additional JSONItem to render - if that's confirmed we might rename this method.
      Specified by:
      setLiveRelationship in interface EditConfig
      Parameters:
      liveRelationship - the relationship to set
    • isDefault

      public boolean isDefault()
      Description copied from interface: ComponentEditConfig
      Checks if this config has all default values in respect to the default values of the widgets. If true the edit config does not need to be submitted to the client.
      Specified by:
      isDefault in interface ComponentEditConfig
      Returns:
      true if default
    • getLayout

      public EditLayout getLayout()
      Description copied from interface: ComponentEditConfig
      Returns the edit layout for the edit control widget.
      Specified by:
      getLayout in interface ComponentEditConfig
      Returns:
      the edit layout for the edit control widget.
    • getDropTargets

      public Map<String,DropTarget> getDropTargets()
      Description copied from interface: EditConfig
      Returns amap of configurations of drop targets. the keys are the ids of the configs. Note that the map is modifiable and can be used to extend the drop targets dynamically.
      Specified by:
      getDropTargets in interface ComponentEditConfig
      Specified by:
      getDropTargets in interface EditConfig
      Returns:
      map of drop target configurations.
    • getInsertBehavior

      public String getInsertBehavior()
      Description copied from interface: ComponentEditConfig
      Returns the insert behavior or null of not defined
      Specified by:
      getInsertBehavior in interface ComponentEditConfig
      Returns:
      insert behavior or null
    • getToolbar

      public Toolbar getToolbar()
      Description copied from interface: EditConfig
      Returns the (modifiable) toolbar for the editbar/menu.
      Specified by:
      getToolbar in interface ComponentEditConfig
      Specified by:
      getToolbar in interface EditConfig
      Returns:
      toolbar
    • getDialogMode

      public DialogMode getDialogMode()
      Description copied from interface: ComponentEditConfig
      Returns the display mode of the dialog
      Specified by:
      getDialogMode in interface ComponentEditConfig
      Returns:
      the dialog mode.
    • getInplaceEditingConfig

      public InplaceEditingConfig getInplaceEditingConfig()
      Description copied from interface: ComponentEditConfig
      Returns the configuration for inplace editing of this configuration.
      Specified by:
      getInplaceEditingConfig in interface ComponentEditConfig
      Returns:
      The inplace editing config; null if there is no inplace editing config (which means that no inplace editing is available for the component)
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: ComponentEditConfig
      Returns the empty flag. Indicates if the respective component has no visual content and a placeholder text should be rendered.
      Specified by:
      isEmpty in interface ComponentEditConfig
      Returns:
      true if a placeholder text should be rendered
    • getEmptyText

      public String getEmptyText()
      Description copied from interface: ComponentEditConfig
      Gets the text to be displayed when ComponentEditConfig.isEmpty() is true. Returns null if the default text is displayed.
      Specified by:
      getEmptyText in interface ComponentEditConfig
      Returns:
      the empty text or null
    • isOrderable

      public Boolean isOrderable()
      Description copied from interface: ComponentEditConfig
      Returns if the edited component is orderable.
      Specified by:
      isOrderable in interface ComponentEditConfig
      Returns:
      true if the component is orderable or null if the behavior is defined by the widgets.
    • getFormParameters

      public Map<String,String> getFormParameters()
      Description copied from interface: EditConfig
      Returns a modifiable map for additional form parameters to be included in the dialog.
      Specified by:
      getFormParameters in interface ComponentEditConfig
      Specified by:
      getFormParameters in interface EditConfig
      Returns:
      map of additional form parameters
    • getListeners

      public Map<String,String> getListeners()
      Description copied from interface: EditConfig
      Returns a modifiable map of edit listeners
      Specified by:
      getListeners in interface ComponentEditConfig
      Specified by:
      getListeners in interface EditConfig
      Returns:
      map of edit listeners
    • getLiveRelationship

      public JSONItem getLiveRelationship()
      Description copied from interface: ComponentEditConfig
      Returns the component live relationship. TODO seems like we are only considering this as an additional JSONItem to render - if that's confirmed we might rename this method.
      Specified by:
      getLiveRelationship in interface ComponentEditConfig
      Returns:
      the computed live relationship. null otherwise
    • isDeepCancel

      public Boolean isDeepCancel()
      Description copied from interface: ComponentEditConfig
      Returns if cancelling inheritance of the component sets the cq:isCancelledForChildren flag or not.
      Specified by:
      isDeepCancel in interface ComponentEditConfig
      Returns:
      true if cancel sets the flag or null if cancel does not set the flag.
    • isTargetingDisabled

      public boolean isTargetingDisabled()
      Description copied from interface: ComponentEditConfig
      Returns if targeting is disabled for this component.
      Specified by:
      isTargetingDisabled in interface ComponentEditConfig
      Returns:
      true if targeting is disabled, false if targeting is allowed
    • write

      public void write(JSONWriter out) throws JSONException
      Description copied from interface: JSONItem
      Serializes this descriptor to json
      Specified by:
      write in interface JSONItem
      Parameters:
      out - json writer
      Throws:
      JSONException - if a JSON error occurs
    • getFormParameterMap

      public Map<String,Object> getFormParameterMap()
      Description copied from interface: EditConfig
      Returns the additional form parameters to be included in the dialog. This method allows to use multi value properties for form parameters.
      Specified by:
      getFormParameterMap in interface ComponentEditConfig
      Specified by:
      getFormParameterMap in interface EditConfig
      Returns:
      map of additional form parameters