Class BaseOBObject

    • Constructor Detail

      • BaseOBObject

        public BaseOBObject()
    • Method Detail

      • setDefaultValue

        protected void setDefaultValue​(String propName,
                                       Object value)
      • get

        public Object get​(String propName,
                          Language language)
        Returns the value of the Property identified by the propName translating it, if possible, to the language. This method does security checking. If a security violation occurs then a OBSecurityException is thrown.
        Parameters:
        propName - the name of the Property for which the value is requested
        language - language to translate to
        Returns:
        value of the property
        Throws:
        OBSecurityException - in case property is not readable
        See Also:
        get(String)
      • get

        public Object get​(String propName,
                          Language language,
                          String id)
        Returns the value of the Property identified by the propName translating it, if possible, to the language. In case the translated value is not in session, it will look for the same in the object. This method does security checking. If a security violation occurs then a OBSecurityException is thrown.
        Parameters:
        propName - the name of the Property for which the value is requested
        language - language to translate to
        id - uuid of the referenced object
        Returns:
        value of the property
        Throws:
        OBSecurityException - in case property is not readable
        See Also:
        get(String)
      • set

        public void set​(String propName,
                        Object value)
        Set a value for the Property identified by the propName. This method checks the correctness of the value and performs security checks.
        Specified by:
        set in interface BaseOBObjectDef
        Specified by:
        set in interface DynamicEnabled
        Parameters:
        propName - the name of the Property being set
        value - the value being set
        Throws:
        OBSecurityException - , ValidationException
      • checkDerivedReadable

        protected void checkDerivedReadable​(Property p)
      • setValue

        public void setValue​(String propName,
                             Object value)
        Sets a value in the object without any security or validation checking. Should be used with care. Is used by the subclasses and system classes.
        Parameters:
        propName - the name of the Property being set
        value -
      • getValue

        public Object getValue​(String propName)
        Returns the value of Property identified by the propName. This method does not do security checking.
        Parameters:
        propName - the name of the property for which the value is requested.
        Returns:
        the value
      • validate

        public void validate()
        Validates the content of this object using the property validators.
        Throws:
        ValidationException
      • isNewOBObject

        public boolean isNewOBObject()
        Returns true if the id is null or the object is set to new explicitly. After flushing the object to the database then new object is set to false.
        Returns:
        false if the id is set and this is not a new object, true otherwise.
        See Also:
        OBInterceptor.postFlush(java.util.Iterator)
      • setNewOBObject

        public void setNewOBObject​(boolean newOBObject)
      • isAllowRead

        public boolean isAllowRead()
      • setAllowRead

        public void setAllowRead​(boolean allowRead)
        Sets if the object maybe read also by non-authorized users. Can only be called in admin mode (see OBContext.setAdminMode().
        Parameters:
        allowRead -
      • setAccessChecks

        public void setAccessChecks​(boolean checkWriteAccess,
                                    boolean checkOrgClientAccess)
        For internal use only. Used to enable or disable the access checks that are done when invoking SecurityChecker.checkWriteAccess(Object).
        Parameters:
        checkWriteAccess - true to enable the write access or false to disable it.
        checkOrgClientAccess - true to enable the org/client check or false to disable it.
      • isWriteAccessCheckEnabled

        public boolean isWriteAccessCheckEnabled()
        For internal use only.
        Returns:
        true if the write access check should be done when flushing the changes of this object or to disable the write access check
      • isOrgClientAccessCheckEnabled

        public boolean isOrgClientAccessCheckEnabled()
        For internal use only.
        Returns:
        true if the org/client access check should be done when flushing the changes of this object or false to disable the org/client check