Class AbstractStructureDialog

java.lang.Object
org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Window
com.saperion.ngc.events.BaseWindow
com.saperion.ngc.dialogs.AbstractStructureDialog
All Implemented Interfaces:
EventChild, EventChildHandler, LogEventChildHandler, Serializable, Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.ext.Scope, org.zkoss.zk.ui.IdSpace, org.zkoss.zk.ui.sys.ComponentCtrl, org.zkoss.zul.ext.Framable
Direct Known Subclasses:
CheckinDialog, EditStructureDialog, ShareBaseCheckInDialog

public abstract class AbstractStructureDialog extends BaseWindow
Base-class for dialogs that change a document's structure.
See Also:
  • Field Details

  • Constructor Details

    • AbstractStructureDialog

      public AbstractStructureDialog()
  • Method Details

    • removeItem

      public abstract void removeItem()
      Removes the selected item from the list.
    • uploadItem

      public abstract void uploadItem()
      Uploads a new item to add it to the document.
    • setLocalization

      public void setLocalization(LocalizationUtil localizationUtil)
      Sets localization.
      Parameters:
      localizationUtil - localization utility object
    • setDocumentPages

      protected void setDocumentPages(List<DocumentArchiveMetaInfo.ElementArchiveMetaInfo> documentPages)
      Parameters:
      documentPages - list of the document's elements
    • addContentUpdate

      public void addContentUpdate(int position, org.zkoss.util.media.Media media)
      Adds update entry for the given position; if entry exits for that position, it is replaced.
      Parameters:
      position - content's position in document
      media - content, null indicates content to be removed
    • addContentUpdate

      public void addContentUpdate(int position, InputStream dataStream, String fileName)
    • undoContentUpdate

      public void undoContentUpdate(int position)
      Deletes content entry at the given position.
      Parameters:
      position - content's position in document
    • hasNoUpdates

      public boolean hasNoUpdates()
      Returns:
      true if no updates are enqueued
    • endModalOk

      public void endModalOk(String versionComment) throws Exception
      Ok.
      Parameters:
      versionComment - version comment
      Throws:
      Exception - exception
    • getLocalizedString

      public String getLocalizedString(String text)
      Parameters:
      text - text to localize
      Returns:
      localized text
    • endModalCancel

      public void endModalCancel() throws Exception
      Cancel dialog.
      Throws:
      Exception - exception
    • setListener

      protected void setListener(org.zkoss.zk.ui.event.EventListener eventListener)
      Parameters:
      eventListener - listener to be called when dialog is closed
    • onUpload

      public void onUpload(org.zkoss.zk.ui.event.Event event)
      Event-listener for upload-event triggered when a user adds a new document in the dialog.
      Parameters:
      event - upload-event
    • addNewDocument

      protected org.zkoss.zul.Listitem addNewDocument(org.zkoss.zk.ui.event.UploadEvent uploadEvent)
      Adds a new item to the structure.
      Parameters:
      uploadEvent - event with unploaded document
      Returns:
      newly created listitem or null if no item was added
    • setDefaultComment

      protected void setDefaultComment(String defaultComment)
      Parameters:
      defaultComment - default comment for comment-textbox in dialog
    • setCommentEnabled

      protected void setCommentEnabled(boolean commentEnabled)
      Parameters:
      commentEnabled - enable or disable comment-textbox in dialog
    • isCommentEnabled

      public boolean isCommentEnabled()
      Returns:
      true if comment textbox is enabled
    • setUploadAction

      public void setUploadAction(AbstractStructureDialog.StructureUploadAction action)
      Sets the action to perform when a document was uploaded.
      Parameters:
      action - action
      See Also:
    • isUploadable

      public static boolean isUploadable(DocumentArchiveMetaInfo.ElementArchiveMetaInfo info)
      Indicates if the given element can be updloaded by this dialog. Currently all other types than images can be uploaded.
      Parameters:
      info - archive-meta-info of element
      Returns:
      true if this dialog permits to upload (checkin) this element, false otherwise.
    • isDeletable

      public static boolean isDeletable(DocumentArchiveMetaInfo.ElementArchiveMetaInfo info)
      Indicates if the given element can be deleted by this dialog. Currently all other types than images can be uploaded.
      Parameters:
      info - archive-meta-info of element
      Returns:
      true if this dialog permits to delete this element, false otherwise.