Class PortalFile

All Implemented Interfaces:
IElement, IFile, ILibraryElement, IResource, IDeletionSupport, IExternalSupport, IProtocolSupport, ISearchSupport, ISecuritySupport, ITrashSupport, IUriSupport, Serializable

public class PortalFile extends PortalElement implements IFile
Author:
vlygeros
See Also:
  • Field Details

    • document

      protected com.axemble.webdrive.om.DocumentNode document
    • history

      protected IResourceHistory history
  • Constructor Details

    • PortalFile

      public PortalFile(IModule module, com.axemble.webdrive.om.DocumentNode document)
  • Method Details

    • getNativeObject

      public Object getNativeObject()
      Description copied from interface: IElement
      Gets the native object underneath.
      Specified by:
      getNativeObject in interface IElement
      Returns:
      an object.
    • getExternalClassName

      public String getExternalClassName()
      Specified by:
      getExternalClassName in interface IExternalSupport
    • getExternalNativeId

      public String getExternalNativeId()
      Specified by:
      getExternalNativeId in interface IExternalSupport
    • setName

      public void setName(String name)
      Description copied from interface: IFile
      Sets the name of the file.
      Specified by:
      setName in interface IFile
      Parameters:
      name - the new name to set.
    • getURI

      public String getURI()
      Description copied from interface: IUriSupport
      Gets the URI of the object supporting this interface
      Specified by:
      getURI in interface IUriSupport
      Returns:
      A String object.
    • getName

      public String getName()
      Description copied from interface: IResource
      Gets the name of a resource.
      Specified by:
      getName in interface ILibraryElement
      Specified by:
      getName in interface IResource
      Returns:
      a string object.
    • setDescription

      public void setDescription(String description)
      Description copied from interface: IFile
      Sets the description of the file.
      Specified by:
      setDescription in interface IFile
      Parameters:
      description - the new description to set.
    • getDescription

      public String getDescription()
      Description copied from interface: IFile
      Gets the description of the file.
      Specified by:
      getDescription in interface IFile
      Specified by:
      getDescription in interface ILibraryElement
      Returns:
      a String of the file.
    • getCreatedDate

      public Date getCreatedDate()
      Description copied from interface: IResource
      Gets the created date.
      Specified by:
      getCreatedDate in interface IResource
      Returns:
      a Date object.
    • setCreatedDate

      public void setCreatedDate(Date date)
      Description copied from interface: IResource
      Sets the created date.
      Specified by:
      setCreatedDate in interface IResource
      Parameters:
      date - The Date to set.
    • getModifiedDate

      public Date getModifiedDate()
      Description copied from interface: IResource
      Gets the modified date.
      Specified by:
      getModifiedDate in interface IResource
      Returns:
      a Date object.
    • setModifiedDate

      public void setModifiedDate(Date date)
      Description copied from interface: IResource
      Sets the modified date.
      Specified by:
      setModifiedDate in interface IResource
      Parameters:
      date - The Date to set.
    • setCreatedBy

      public void setCreatedBy(IUser user)
      Description copied from interface: IResource
      Sets the creator of the resource. Can only be set if the resource has not been created yet
      Specified by:
      setCreatedBy in interface IResource
      Parameters:
      user - The creator IUser of the resource.
    • getCreatedBy

      public IUser getCreatedBy()
      Description copied from interface: IResource
      Gets the creator of the resource.
      Specified by:
      getCreatedBy in interface IResource
      Returns:
      a IUser object.
    • setModifiedBy

      public void setModifiedBy(IUser user)
      Description copied from interface: IResource
      Sets last user who modified the resource.
      Specified by:
      setModifiedBy in interface IResource
      Parameters:
      user - The last IUser who modified the resource.
    • getModifiedBy

      public IUser getModifiedBy()
      Description copied from interface: IResource
      Gets the last user who modified the resource.
      Specified by:
      getModifiedBy in interface IResource
      Returns:
      a IUser object.
    • setLanguage

      public void setLanguage(String language)
      Description copied from interface: IFile
      Sets the language of the file.
      Specified by:
      setLanguage in interface IFile
      Parameters:
      language - the language to set.
    • getLanguage

      public String getLanguage()
      Description copied from interface: IFile
      Gets the language of the file.
      Specified by:
      getLanguage in interface IFile
      Returns:
      a String of the file.
    • addCategory

      public void addCategory(ICategory category)
      Description copied from interface: IFile
      Associates a category to the file.
      Specified by:
      addCategory in interface IFile
      Parameters:
      category - the ICategory to add.
    • addCategories

      public void addCategories(Collection categories)
      Description copied from interface: IFile
      Associates a collection of ICategory objects to the file.
      Specified by:
      addCategories in interface IFile
      Parameters:
      categories - a collection of ICategory objects.
    • exists

      public boolean exists(String propertyName)
      Description copied from interface: IResource
      Checks if a property exists.
      Specified by:
      exists in interface IResource
      Parameters:
      propertyName - The system name of the property.
      Returns:
      true if the property exists,
      invalid @link
      {@link false
      } otherwise.
    • setValueNoEvents

      public void setValueNoEvents(String propertyName, Object value)
      Description copied from interface: IResource
      Sets a value to a property without throwing any event.
      Specified by:
      setValueNoEvents in interface IResource
      Parameters:
      propertyName - The system name of the property.
      value - The value object to set.
    • setValue

      public void setValue(String propertyName, Object value)
      Description copied from interface: IResource
      Sets a value to a property
      Specified by:
      setValue in interface IResource
      Parameters:
      propertyName - The system name of the property.
      value - The value object to set.
    • getValue

      public Object getValue(String propertyName)
      Description copied from interface: IResource
      Gets the value of a property.
      Specified by:
      getValue in interface IResource
      Parameters:
      propertyName - The system name of the property.
      Returns:
      an Object.
    • getList

      public Collection getList(String propertyName)
      Description copied from interface: IResource
      Gets the available values of a list property.
      Specified by:
      getList in interface IResource
      Parameters:
      propertyName - The system name of the property.
      Returns:
      A java.util.Collection of IOptionList.IOption.
    • setList

      public void setList(String propertyName, Collection value)
      Description copied from interface: IResource
      Sets the available values for a list property.
      Specified by:
      setList in interface IResource
      Parameters:
      propertyName - The system name of the property.
      value - A java.util.Collection of IOptionList.IOption objects..
    • getLibrary

      public ILibrary getLibrary()
      Description copied from interface: IFile
      Gets the library.
      Specified by:
      getLibrary in interface IFile
      Returns:
      a ILibrary object.
    • getParentFolder

      public IFolder getParentFolder()
      Description copied from interface: IFile
      Gets the parent folder.
      Specified by:
      getParentFolder in interface IFile
      Returns:
      a IFolder object.
    • getHistory

      public IResourceHistory getHistory()
      Description copied from interface: IResource
      Gets the history of the resource
      Specified by:
      getHistory in interface IResource
      Returns:
      a IResourceHistory object.
    • getDefinition

      public IResourceDefinition getDefinition()
      Description copied from interface: IResource
      Gets the definition of the resource
      Specified by:
      getDefinition in interface IResource
      Returns:
      A IResourceDefinition object.
    • setDefinition

      public void setDefinition(IResourceDefinition definition)
      Description copied from interface: IFile
      Associates the specified definition with the file.
      Specified by:
      setDefinition in interface IFile
      Parameters:
      definition - the IResourceDefinition object.
    • createLinkedResource

      public ILinkedResource createLinkedResource(String propertyName)
      Description copied from interface: IResource
      Creates a linked resource within a property.
      Specified by:
      createLinkedResource in interface IResource
      Parameters:
      propertyName - The system name of the property.
      Returns:
      a ILinkedResource object.
    • addLinkedResource

      public boolean addLinkedResource(ILinkedResource linkedResource)
      Description copied from interface: IResource
      Allows to add a linked resource.
      Specified by:
      addLinkedResource in interface IResource
      Parameters:
      linkedResource - The ILinkedResource to add.
      Returns:
      true if succeed,
      invalid @link
      {@link false
      } otherwise.
    • addLinkedResources

      public boolean addLinkedResources(Collection linkedResources)
      Description copied from interface: IResource
      Allows to add linked resources.
      Specified by:
      addLinkedResources in interface IResource
      Parameters:
      linkedResources - The collection of ILinkedResource objects to add.
      Returns:
      true if succeed,
      invalid @link
      {@link false
      } otherwise.
    • getLinkedResources

      public Collection getLinkedResources(String propertyName)
      Description copied from interface: IResource
      Retrieves all the linked resources of a property.
      Specified by:
      getLinkedResources in interface IResource
      Parameters:
      propertyName - The system name of the property.
      Returns:
      A java.util.Collection of ILinkedResource objects.
    • save

      public boolean save(IContext context)
      Description copied from interface: IElement
      Saves or updates the element.
      Specified by:
      save in interface IElement
      Overrides:
      save in class PortalElement
      Parameters:
      context - The Execution context.
      Returns:
      return true if succeeded, false otherwise.
    • save

      public boolean save()
      Description copied from interface: IResource
      Saves the resource.
      Specified by:
      save in interface IResource
      Returns:
      true if succeed,
      invalid @link
      {@link false
      } otherwise.
    • save

      public boolean save(String propertyName)
      Description copied from interface: IResource
      Saves a specified property.
      Specified by:
      save in interface IResource
      Parameters:
      propertyName - The system name of the property.
      Returns:
      true if succeed,
      invalid @link
      {@link false
      } otherwise.
    • delete

      public void delete(IContext context)
      Description copied from interface: IDeletionSupport
      Deletes the IElement object.
      Specified by:
      delete in interface IDeletionSupport
      Parameters:
      context - The Execution context.
    • allowEvents

      public void allowEvents()
      Description copied from interface: IResource
      Allows events to be thrown.
      Specified by:
      allowEvents in interface IResource
    • denyEvents

      public void denyEvents()
      Description copied from interface: IResource
      Prevents from throwing events.
      Specified by:
      denyEvents in interface IResource
    • removeCategories

      public void removeCategories(Collection categories)
      Description copied from interface: IFile
      Removes the associations between the file and the collection of categories.
      Specified by:
      removeCategories in interface IFile
      Parameters:
      categories - the collection of ICategory objects to remove.
    • removeCategory

      public void removeCategory(ICategory category)
      Description copied from interface: IFile
      Removes the association between the file and the specified category.
      Specified by:
      removeCategory in interface IFile
      Parameters:
      category - the ICategory object to remove.
    • getCategories

      public Collection getCategories()
      Description copied from interface: IFile
      Gets all the associated categories.
      Specified by:
      getCategories in interface IFile
      Returns:
      a collection of ICategory objects.
    • deleteLinkedResource

      public void deleteLinkedResource(ILinkedResource linkedResource)
      Description copied from interface: IResource
      Allows to remove a linked resource.
      Specified by:
      deleteLinkedResource in interface IResource
      Parameters:
      linkedResource - The ILinkedResource to remove.
    • deleteLinkedResources

      public void deleteLinkedResources(Collection linkedResources)
      Description copied from interface: IResource
      Allows to remove a collection of linked resources.
      Specified by:
      deleteLinkedResources in interface IResource
      Parameters:
      linkedResources - The collection of ILinkedResource objects.
    • checkIn

      public void checkIn()
      Description copied from interface: IFile
      Check in a file.
      Specified by:
      checkIn in interface IFile
    • checkOut

      public void checkOut()
      Description copied from interface: IFile
      Check out a file.
      Specified by:
      checkOut in interface IFile
    • undoCheckOut

      public void undoCheckOut()
      Description copied from interface: IFile
      Undo check out.
      Specified by:
      undoCheckOut in interface IFile
    • checkedOutBy

      public IUser checkedOutBy()
      Description copied from interface: IFile
      Retrieve the user who checked out the file.
      Specified by:
      checkedOutBy in interface IFile
      Returns:
      a IUser object.
    • isCheckedOut

      public boolean isCheckedOut()
      Description copied from interface: IFile
      Check if the file has been checked out.
      Specified by:
      isCheckedOut in interface IFile
      Returns:
      true if the file has been checked out, false otherwise.
    • moveTo

      public boolean moveTo(IFolder destFolder, boolean bOverwrite)
      Description copied from interface: IFile
      Move a file to a folder.
      Specified by:
      moveTo in interface IFile
      Parameters:
      destFolder - The IFolder to put the file to.
      bOverwrite - delete the file.
      Returns:
      true if succeed,
      invalid @link
      {@link false
      } otherwise.
    • refresh

      public void refresh()
      Description copied from interface: IResource
      Refresh all children values cache
      Specified by:
      refresh in interface IResource
    • refresh

      public void refresh(String propertyName)
      Description copied from interface: IResource
      Refresh children cache for given property
      Specified by:
      refresh in interface IResource
      Parameters:
      propertyName -
    • getText

      public Object getText(String propertyName)
      Specified by:
      getText in interface IResource
      Parameters:
      propertyName - The system name of the property.
      Returns:
      A java.util.Collection of String labels objects.
    • isInTrash

      public boolean isInTrash()
      Description copied from interface: ITrashSupport
      Check if the element has been sent to the trash.
      Specified by:
      isInTrash in interface ITrashSupport
      Returns:
      true if yes,
      invalid @link
      {@link false
      } otherwise.
    • restoreFromTrash

      public void restoreFromTrash()
      Description copied from interface: ITrashSupport
      Restore the element from the trash.
      Specified by:
      restoreFromTrash in interface ITrashSupport
    • moveToTrash

      public void moveToTrash()
      Description copied from interface: ITrashSupport
      Move the element to the trash.
      Specified by:
      moveToTrash in interface ITrashSupport
    • deleteFromTrash

      public void deleteFromTrash()
      Description copied from interface: ITrashSupport
      Delete the element from the trash.
      Specified by:
      deleteFromTrash in interface ITrashSupport