Class ResourceView

All Implemented Interfaces:
Serializable, EntityContainer, overit.geocall.clipboard.XClip, overit.geocall.marks.MethodExposer, overit.geocall.marks.NameExposer, AjaxableComponent, Badgeable, DBViewManager, DraggableDroppable, Hideable, Identified, Tool, overit.geocall.ux.configurability.UIConfigurable, overit.geocall.ux.edm.ModelConfigurable
Direct Known Subclasses:
overit.geocallapp.wfm.ui.container.ResourceViewMultimediali

@Component public class ResourceView extends TableView
The class extends TableView and implements the table used to arranges and manages the web resources (directories, files) of the application. It provides the methods that allows the user to navigate in the WebResource, and the standard functions used to create, copy and paste, delete and view the resources.
The WebResource is a file-based or database-based virtual file system depending on the parametrization deifned within the configuration file. The use of this component is therefore reccomended in cases where the information is stored through the WebResource and you want to provide a convenient way to find and consult them.
See Also:
GCApi:
component
  • Field Details

    • _wr

      protected WebResource _wr
    • _resource

      protected String _resource
    • _topresource

      protected String _topresource
    • _re

      protected String _re
    • _fileindex

      protected int _fileindex
    • _currRowUnzip

      protected int _currRowUnzip
    • _uploading

      protected boolean _uploading
    • _accept

      protected String _accept
    • _multiple

      protected boolean _multiple
    • download

      protected boolean download
    • _cuttingResource

      protected Serializable _cuttingResource
  • Constructor Details

    • ResourceView

      public ResourceView()
      Creates the ResourceView
  • Method Details

    • setRE

      public void setRE(String s)
      Sets the regual expression used to discriminate the resources that must be loaded by the ResourceView
      Parameters:
      s - A string thet defines a regula expression
    • setRESOURCE

      public void setRESOURCE(String s)
      Sets the folder of the resources
      Parameters:
      s - The string that represents the folder for the resources contained in the ResourceView
    • getResource

      public String getResource()
      Return the folder of the resources
      Returns:
      The string that represents the folder for the resources contained in the ResourceView
    • setTOPRESOURCE

      public void setTOPRESOURCE(String s)
      Sets the top folder of the directory tree for the resources
      Parameters:
      s - The string that represents the top folder for the resources contained in the ResourceView
    • getTopResource

      public String getTopResource()
      Returns the top folder of the directory tree for the resources
      Returns:
      The string that represents the top folder for the resources contained in the ResourceView
    • setACCEPT

      public void setACCEPT(String mediaType)
      Restrict the type of the selectable files.
      Parameters:
      mediaType - it's possible to restrict the accepted file using the following rules:
      • file_extension: A file extension starting with the dot character, e.g: .gif, .jpg, .png, .doc
      • audio/*: All sound files are accepted
      • video/*: All video files are accepted
      • image/*: All image files are accepted
      • media_type: A valid media type, with no parameters. Look at IANA Media Types for a complete list of standard media types
      To specify more than one value, separate the values with a comma (e.g. "audio/*,video/*,image/*")
    • setMULTIPLE

      public void setMULTIPLE(String multiple)
      Indicates if the user is allowed to select more than one file.
      Parameters:
      multiple - A string that represents a boolean value ("true" or "1", "false" or "0").
      If the string is not recognized as a boolean value, it will be used the default value, that is false
    • setDOWNLOAD

      public void setDOWNLOAD(String s)
      Indicates if the file must be downloaded or if should open in a new browser tab.
      Parameters:
      s - true to download the file or false to open it into a new browser tab
    • setup

      protected void setup()
      Description copied from class: Component
      Setup the Component
      Overrides:
      setup in class TableView
    • onOpen

      public void onOpen(Object o)
      Called when is opened the page that contains the ResourceView
      Overrides:
      onOpen in class TableView
      Parameters:
      o - An HashGetter with the parameters to pass on the next page
    • refresh

      public void refresh()
      Refreshes the list of the resources to obtain the updated data
    • setupMetaData

      public void setupMetaData(DBView dbv)
      Description copied from class: TableView
      Called to init all the field starting form the DBView. Setup the Selection, sets the value of the position of the column used to select and the field position.
      Overrides:
      setupMetaData in class TableView
      Parameters:
      dbv - The DBView used to populate all the field
    • isCutted

      public boolean isCutted(int row)
      Checks if the resource is currently one of the cutted ones
      Overrides:
      isCutted in class TableView
      Parameters:
      row - The number of the rows that corresponds to the resource
      Returns:
      true if the resource is currently cutted, false otherwise
    • getCuttingResource

      public Serializable getCuttingResource()
      Returns the Serializable object that contains the currently cutted resources
      Returns:
      The object that contains the currently cutted resources
    • freeClip

      public void freeClip(boolean delete)
      Used in drop phase and manage the deletion of the record of the dbv if the drag operation was a cutting one.
      Implements the XClip interface
      Specified by:
      freeClip in interface overit.geocall.clipboard.XClip
      Overrides:
      freeClip in class TableView
      Parameters:
      delete - Boolean value that indicates if the deletion of the record must be performed
    • doCopy

      protected boolean doCopy(int row, UIMessage uim)
      Description copied from class: TableView
      Copies a row of the table (see XBoard)
      Overrides:
      doCopy in class TableView
      Parameters:
      row - The number of the row to copy
      uim - The UIMessage that contains values, parameters and control values
      Returns:
      false
    • doCut

      protected boolean doCut(int row, UIMessage uim)
      Description copied from class: TableView
      Cuts a row of the table (see XBoard)
      Overrides:
      doCut in class TableView
      Parameters:
      row - The number of the row to cut
      uim - The UIMessage that contains values, parameters and control values
      Returns:
      false
    • doPaste

      protected boolean doPaste(int row, UIMessage uim)
      Description copied from class: TableView
      Pastes a row on the table (see XBoard)
      Overrides:
      doPaste in class TableView
      Parameters:
      row - The number of the row to paste
      uim - The UIMessage that contains values, parameters and control values
      Returns:
      false
    • pasteContent

      protected ArrayList pasteContent(int row, Serializable s, boolean local)
      Overrides:
      pasteContent in class TableView
    • onDelete

      public boolean onDelete(Object o)
      Called to delete the desired resource
      Parameters:
      o - The HashGetter that contains the number of the row of the resources to be deleted
      Returns:
      true
    • onDeleteAll

      public boolean onDeleteAll(Object o)
      Called to delete all the resources of the ResourceView
      Parameters:
      o - Not used
      Returns:
      true
    • onRename

      public boolean onRename(Object o)
      Called to rename the desired resource
      Parameters:
      o - The HashGetter that contains the number of the row of the resources to be renamed
      Returns:
      true
    • onUnzip

      public boolean onUnzip(HashGetter hg)
      Called to unzip a zipped resource
      Parameters:
      hg - The HashGetter that contains the number of the row of the resources to be unzipped
      Returns:
      true
    • onUnzipAll

      public boolean onUnzipAll(HashGetter hg)
      Called to unzip all the resources
      Parameters:
      hg - Not used
      Returns:
      true
    • onUnzipDir

      public boolean onUnzipDir(HashGetter hg)
      Called to unzip all the resources of a directory
      Parameters:
      hg - Not used
      Returns:
      true
    • onZip

      public boolean onZip(Object o)
      Called to zip a resource
      Parameters:
      o - HashGetter containing the prompt parameter
      Returns:
      true
    • onView

      public boolean onView(Object o)
      Called to view a resource
      Parameters:
      o - The HashGetter that contains the number of the row of the resources to be showed
      Returns:
      true
    • onUp

      public boolean onUp(Object o)
      Called to navigate on a upper level of the directory tree
      Parameters:
      o - Not used
      Returns:
      true
    • onNewFolder

      public boolean onNewFolder(Object o)
      Called to create a new folder
      Parameters:
      o - The HashGetter that contains the prompt parameter used as the name of the new folder to create
      Returns:
      true
    • onNewFile

      public boolean onNewFile(Object o)
      Called to create a new file
      Parameters:
      o - Not used
      Returns:
      true
    • onUpload

      public boolean onUpload(Object o) throws ValidationException
      Called to upload a new resource
      Parameters:
      o - Not used
      Returns:
      true
      Throws:
      ValidationException - if the uploaded file's type is not allowed
    • onRefresh

      public boolean onRefresh(Object o)
      Called to refresh the list of the resources to obtain the updated data
      Parameters:
      o - Not used
      Returns:
      true
    • save

      protected boolean save(UpFile uf)
    • getCaption

      protected org.apache.ecs.Element getCaption(EntitySet es)
      Overrides:
      getCaption in class TableView
    • getWebResource

      @Deprecated public WebResource getWebResource()
      Deprecated.
      Return the WebResource on which the ResourceView is based
      Returns:
      The WebResource on which the ResourceView is based