Interface DFSharedObjectCapability

  • All Superinterfaces:
    DFCapability
    All Known Subinterfaces:
    DFSharedObjectOwnerCapability

    public interface DFSharedObjectCapability
    extends DFCapability
    This capability should be added to all user specific DFItems. It means this capability can be part of DFList, DFQuery and DFView.

    This is an optional functionality so you should not expect it's always part of these DFItems. This interface is read-only so you can't change sharing status property value using it. If you are owner of the object you can try to obtain DFSharedObjectOwnerCapability and change the sharing status there.

    Author:
    Petr Hamernik
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PROP_OWNER
      Code name of 'owner' property.
      static java.lang.String PROP_SHARING
      Code name of 'sharing' property.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getOwner()
      Get username of this DFItem's owner.
      com.im.commons.sharing.DFSharing getSharing​(com.im.commons.progress.DFEnvironmentRO env)
      Get the full sharing information about this object.
      boolean isPrivateAndHidden()
      This method provides faster access for users who don't need full sharing information, like e.g.
      boolean isSharedForReading()
      Is the item shared to somebody for reading? If not, other users can potentially see this item in the "copy" dialogue.
    • Field Detail

      • PROP_SHARING

        static final java.lang.String PROP_SHARING
        Code name of 'sharing' property.
        See Also:
        Constant Field Values
      • PROP_OWNER

        static final java.lang.String PROP_OWNER
        Code name of 'owner' property.
        See Also:
        Constant Field Values
    • Method Detail

      • getSharing

        com.im.commons.sharing.DFSharing getSharing​(com.im.commons.progress.DFEnvironmentRO env)
        Get the full sharing information about this object. This method is guaranteed to return full sharing information. This information may be cached. However, it must be updated upon calling DFSharedObjectOwnerCapability.setSharing(DFSharing, com.im.commons.progress.DFEnvironmentRW).
        Parameters:
        env - Environment used for feedback as this method may query the database.
        Returns:
        The current sharing status
      • isPrivateAndHidden

        boolean isPrivateAndHidden()
        This method provides faster access for users who don't need full sharing information, like e.g. icon provider.
        Returns:
        whether nobody other than owner can access the item
      • isSharedForReading

        boolean isSharedForReading()
        Is the item shared to somebody for reading? If not, other users can potentially see this item in the "copy" dialogue. This method provides faster access for users who don't need full sharing information, like e.g. icon provider.
        Returns:
        whether somebody else than owner will see this item
      • getOwner

        java.lang.String getOwner()
        Get username of this DFItem's owner. This name corresponds to usernames which can be obtained from IJCUserLoginService. If the current user is owner, the name returned from this method should be the same like IJCUserLoginService.whoAmI() return value.
        Returns:
        Username of owner of the DFItem object.