psdi.mbo

Class MboValue

  • java.lang.Object
    • psdi.mbo.MboValue
    • Field Detail

      • currentValue

        protected MaxType currentValue
        Current value of the field
      • mbovalueinfo

        protected MboValueInfo mbovalueinfo
        Link back to the data dictionary
      • mbo

        protected Mbo mbo
        Mbo that owns this field
    • Constructor Detail

      • MboValue

        public MboValue()
    • Method Detail

      • init

        public void init()
                  throws MXException
        Called by the frame work once to allow expensive initilization of access information. Guaranteed to be called once, and before any setValues with access control takes place. This will also call the init() of all listeners. If once of those listeners fails in the init and throws an exception, there is no guarentee that other listener's init() methods will not be called again.
        Throws:
        MXException
      • initValue

        public void initValue()
                       throws MXException
        Called by the frame work once to allow expensive initialization of the initial value. Guaranteed to be called once, and before any getString, getDouble, etc... takes place. This will also call the initValue() of all listeners. If once of those listeners fails in its initValue and throws an exception, there is no guarantee that other listener's initValue() methods will not be called again. initValue differs from init in that initValue is called before the get methods, while init is called before the set methods.
        Throws:
        MXException
      • getMboValueData

        public MboValueData getMboValueData()
        Return the MboValueData for this field. This includes type, requiredness and readonlyness but also what the current value of the field is.
      • getMboValueData

        public MboValueData getMboValueData(boolean ignoreFieldFlags)
      • getMbo

        public Mbo getMbo()
        Get the related Mbo for this field.
      • getDefault

        public java.lang.String getDefault()
        Return the default value used in this field.
      • hasLongDescription

        public boolean hasLongDescription()
        does it has a long description
      • setDefault

        public void setDefault(java.lang.String val)
        Allow the user to set the default value. Currently does nothing !
      • setValueNull

        public void setValueNull(long accessModifier)
                          throws MXException
        Set the value null, use the specified access modifiers to determine if this can be done
        Throws:
        MXException
      • _setValueNull

        public void _setValueNull()
                           throws MXException
        Set a field value to null.
        Throws:
        MXException
      • getPreviousValue

        public MaxType getPreviousValue()
                                 throws MXException
        Return the previous field value as a MaxType object
        Throws:
        MXException
      • getString

        public final java.lang.String getString()
                                         throws MXException
        Get the field value as a string representation. This value is locale sensitive and WILL contain formatting characters, for example in numbers, '.'s and ',' will be used approriately for number grouping and decimal markings. Using a string value for comparisons of non-string data can be ambiguous and should be avoided where possible.
        Returns:
        the string value of the attribute in locale format.
        Throws:
        MXException
      • getBoolean

        public final boolean getBoolean()
                                 throws MXException
        Return the field value as a boolean This will be sensitive to locale, so if the field contains a 'J' and the locale is set to German, this will return true.
        Returns:
        the boolean value of the attribute.
        Throws:
        MXException
      • getByte

        public final byte getByte()
                           throws MXException
        Get the value as a byte. Not currently supported.
        Returns:
        the byte value of the attribute.
        Throws:
        MXException
      • getInt

        public final int getInt()
                         throws MXException
        Get the value as a integer.
        Returns:
        the integer value of the attribute. 0 if the value is null.
        Throws:
        MXException
      • getLong

        public final long getLong()
                           throws MXException
        Get the value as a long.
        Returns:
        the long value of the attribute. 0 if the value is null.
        Throws:
        MXException
      • getFloat

        public final float getFloat()
                             throws MXException
        Get the value as a float.
        Returns:
        the float value of the attribute. 0.0 if the value is null.
        Throws:
        MXException
      • getDouble

        public final double getDouble()
                               throws MXException
        Get the value as a double.
        Returns:
        the double value of the attribute. 0.0 if the value is null.
        Throws:
        MXException
      • getDate

        public final java.util.Date getDate()
                                     throws MXException
        Get the value as a date. Can be used on Date, DateTime and Time fields.
        Returns:
        the date value of the attribute.
        Throws:
        MXException
      • getBytes

        public final byte[] getBytes()
                              throws MXException
        Get the value as a byte array.
        Throws:
        MXException
      • getMaxType

        public final MaxType getMaxType()
                                 throws MXException
        Get a clone of the MaxType object of the current MboValue. Null is returned if there is no current value.
        Throws:
        MXException
      • setValue

        public final void setValue(int value)
                            throws MXException
        Set the value of the field using the specified access modifiers
        Throws:
        MXException
      • setValue

        public final void setValue(int val,
                                   long accessModifier)
                            throws MXException
        Set the value of the field.
        Throws:
        MXException
      • setValue

        public final void setValue(java.lang.String value)
                            throws MXException
        Set the value of the field using the specified access modifiers
        Throws:
        MXException
      • setValue

        public final void setValue(java.lang.String val,
                                   long accessModifier)
                            throws MXException
        Set the value of the field. For non-string fields, parsing will occur. There can be ambiguity for YORN fields where the MboSet locale is different from the clients, in this case, the setValue(boolean) is recommended.
        Throws:
        MXException
      • setValue

        public final void setValue(boolean value)
                            throws MXException
        Set the value of the field using the specified access modifiers
        Throws:
        MXException
      • setValue

        public final void setValue(boolean val,
                                   long accessModifier)
                            throws MXException
        Set the value of the field.
        Throws:
        MXException
      • setValue

        public final void setValue(byte value)
                            throws MXException
        Set the value of the field using the specified access modifiers
        Throws:
        MXException
      • setValue

        public final void setValue(byte val,
                                   long accessModifier)
                            throws MXException
        Set the value of the field.
        Throws:
        MXException
      • setValue

        public final void setValue(long value)
                            throws MXException
        Set the value of the field using the specified access modifiers
        Throws:
        MXException
      • setValue

        public final void setValue(long val,
                                   long accessModifier)
                            throws MXException
        Set the value of the field.
        Throws:
        MXException
      • setValue

        public final void setValue(float value)
                            throws MXException
        Set the value of the field using the specified access modifiers
        Throws:
        MXException
      • setValue

        public final void setValue(float val,
                                   long accessModifier)
                            throws MXException
        Set the value of the field.
        Throws:
        MXException
      • setValue

        public final void setValue(double value)
                            throws MXException
        Set the value of the field using the specified access modifiers
        Throws:
        MXException
      • setValue

        public final void setValue(double val,
                                   long accessModifier)
                            throws MXException
        Set the value of the field.
        Throws:
        MXException
      • setValue

        public final void setValue(byte[] value)
                            throws MXException
        Set the value of the field using the specified access modifiers
        Throws:
        MXException
      • setValue

        public final void setValue(byte[] val,
                                   long accessModifier)
                            throws MXException
        Set the value of the field.
        Throws:
        MXException
      • setValue

        public final void setValue(java.util.Date value)
                            throws MXException
        Set the value of the field using the specified access modifiers
        Throws:
        MXException
      • setValue

        public final void setValue(java.util.Date val,
                                   long accessModifier)
                            throws MXException
        Set the value of the field.
        Throws:
        MXException
      • setCurrentFieldAccess

        public void setCurrentFieldAccess(long access)
        Set the curent field access modifiers. Used internally,. not generally useful outside of MboValue
      • resetCurrentFieldAccess

        public void resetCurrentFieldAccess()
        Resets the current access modifiers to NONE
      • getCurrentFieldAccess

        public long getCurrentFieldAccess()
        Get what the current field access modifiers are.
      • validate

        public final void validate()
                            throws MXException
        Called by the framework to validate the field. This method will delgate the call to a registered domain object.
        Throws:
        MXException
      • isModified

        public boolean isModified()
        Has the field been modified ? If calling this from a validate routine, may return false as the value has not yet been changed.
      • isReadOnly

        public boolean isReadOnly()
        Is the field read only ?
      • setReadOnly

        public void setReadOnly(boolean ro)
        Set this field read only.
      • isHidden

        public boolean isHidden()
        Is the field hidden ?
      • setHidden

        public void setHidden(boolean val)
        Set or clear the hidden flag.
      • getName

        public java.lang.String getName()
        What is this field's name ?
      • getAttributeName

        public java.lang.String getAttributeName()
        What is this field's name in the database ?
      • getMboValueInfo

        public MboValueInfo getMboValueInfo()
        Returns the MboValueInfo associated with the attribute
      • getLength

        public int getLength()
        How long is it ? Only useful for String and GL types
      • getScale

        public int getScale()
        If field is a decimal, what is it's scale ?
      • getColumnTitle

        public java.lang.String getColumnTitle()
        Get column title. The returned string is in the language of the user who obtained this MboValue object. If you want to get the title in ase language use UserInfo.getTitle().
      • getType

        public abstract int getType()
        Return a numeric value for the type. The returned in matches one of the defined types in the MXFormat class. e.g. a dattime returns MXFormat.DATETIME.
      • hasList

        public boolean hasList()
        Has this field got a lookup list ?
      • getList

        public MboSetRemote getList()
                             throws MXException,
                                    java.rmi.RemoteException
        Give a list of possible values to the user
        Throws:
        MXException
        java.rmi.RemoteException
      • smartFill

        public MboSetRemote smartFill(java.lang.String value,
                                      boolean exact)
                               throws MXException,
                                      java.rmi.RemoteException
        Returns a MBO set of the lookup MBO based on the criteria set on the field. If the result yields to one MBO only, this MBO's values will be to this field and its other fields which compose the foreign key.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • smartFind

        public MboSetRemote smartFind(java.lang.String value,
                                      boolean exact)
                               throws MXException,
                                      java.rmi.RemoteException
        Returns a MBO set based on the value set to this field. Different than smartFill(), even if the result yields to one MBO only, the MBO's values will not be set tot he fields corresponding to the foreign keys.
        Parameters:
        value -
        exact -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • smartFind

        public MboSetRemote smartFind(java.lang.String object,
                                      java.lang.String value,
                                      boolean exact)
                               throws MXException,
                                      java.rmi.RemoteException
        Returns a MBO set of the type specified based on the value set to this field. Different than smartFill(), even if the result yields to one MBO only, the MBO's values will not be set tot he fields corresponding to the foreign keys.
        Parameters:
        value -
        exact -
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getMatchingAttr

        public java.lang.String getMatchingAttr()
                                         throws MXException,
                                                java.rmi.RemoteException
        Get the attribute in the lookup table which matches this field.
        Throws:
        MXException
        java.rmi.RemoteException
      • getMatchingAttr

        public java.lang.String getMatchingAttr(java.lang.String sourceObjectName)
                                         throws MXException,
                                                java.rmi.RemoteException
        Get the attribute in the lookup table which matches this field.
        Throws:
        MXException
        java.rmi.RemoteException
      • isRequired

        public boolean isRequired()
        Is this field required before it can be saved to stroage ?
      • setRequired

        public void setRequired(boolean state)
        Set this field required.
      • isPersistent

        public boolean isPersistent()
        Is the field persistent ? i.e. is it stored in the database ?
      • isExtended

        public boolean isExtended()
        Is the field an extended field ? i.e. is it stored in the extension table ?
      • isGuaranteedUnique

        public boolean isGuaranteedUnique()
        Is the value being set guarenteed to be unique ?
      • setGuaranteedUnique

        public void setGuaranteedUnique(boolean flag)
        Set the guaranteedUnique flag.
        Parameters:
        flag -
      • autoKey

        public void autoKey()
                     throws MXException
        Generate an autokey value for this field. Assumes there is an appropriate entry in the autokey table.

        WARNING: Currently there is only one autokey value per database table, so the programmer should make sure that an autokey is only used once in each object.

        Throws:
        MXException
        See Also:
        AutoKey, Mbo.generateAutoKey()
      • autoKeyByMboSiteOrg

        public void autoKeyByMboSiteOrg()
                                 throws MXException
        Set the autokey based on the mbo's site, not insert set.
        Throws:
        MXException
      • addMboValueListener

        public void addMboValueListener(MboValueListener l)
        Register a listener to the MboValue
      • getListeners

        public java.util.Vector getListeners()
      • removeMboValueListener

        public void removeMboValueListener(MboValueListener l)
        Remove a listener to the MboValue
      • checkFieldAccess

        public void checkFieldAccess(long accessModifier)
                              throws MXException
        Check the access control and the specified access modifier. If the field should not be updated, it throws an MXAccessException
        Throws:
        MXException
      • hasFieldAccess

        public boolean hasFieldAccess(long accessModifier)
                               throws MXException
        Check the access control and the specified access modifier. This is prefered comparing to checkFrieldAccess. This method does not throw exception when it does not have field access.
        Throws:
        MXException
      • setFlags

        public void setFlags(long flags)
        Set the fields flags to the specified values. Flags used are usually READONLY and REQUIRED.
      • setFlags

        public void setFlags(long flags,
                             MXException mxe)
        Set the fields flags to the specified values. Flags used are usually READONLY and REQUIRED. It also sets the MXException to be thrown. Note : this is not a remote method.
      • getFlags

        public long getFlags()
        Return all the flags
      • setFlag

        public void setFlag(long flag,
                            boolean state)
        Set the specified flag on or off. See setFlags() method for discussion on flags usually used.
      • setFlag

        public void setFlag(long flag,
                            boolean state,
                            MXException mxe)
        Set the specified flag on or off. See setFlags() method for discussion on flags usually used.\ It also sets the MXException too Note : THis is not a remote method.
      • isFlagSet

        public boolean isFlagSet(long flag)
        Return the state of the specified flag
      • getFieldFlagFromMbo

        public void getFieldFlagFromMbo(long flag)
        The field flags such as readonly and required will be fetched from the MBO to the MboValue if exists. This operation will only be performed if it hasn't been fetched to the MboValue. If the field flags hasn't be set on the Mbo, it will call MBO's initFieldFlagsOnMbo() to initialize the field flags before moving them to the MboValue. This method is called the first time when a field flag is fetched from the MboValue, or is set directly to the MboValue.
      • getMXException

        public MXException getMXException()
        Return the mxException
      • generateUniqueID

        public void generateUniqueID()
                              throws MXException
        Generate an ID that is unique within the table of this column. Currently, the field must be numeric or string.
        Throws:
        MXException
      • isToBeValidated

        public boolean isToBeValidated()
        Returns the value of the internal toBeValidated boolean.
      • setToBeValidated

        public void setToBeValidated(boolean value)
      • getIntegrationService

        public ServiceRemote getIntegrationService()
                                            throws java.rmi.RemoteException,
                                                   MXException
        Convenience Method for getting the IntegrationServiceRemote.
        Throws:
        java.rmi.RemoteException
        MXException
      • rollbackToCheckpoint

        public void rollbackToCheckpoint()
        Reverts to the saved value. To save the value, use startCheckpoint.
      • takeCheckpoint

        public void takeCheckpoint()
        takes a checkpoint i.e. marks the current values.
      • setValueFromLookup

        public void setValueFromLookup(MboRemote sourceMbo)
                                throws MXException,
                                       java.rmi.RemoteException
        This method sets the value of the correspoinding field of the lookup Mbo and it also set other fields corresponding to the other keys of the lookup Mbo if it is multi-keyed. The work is actually done by the attached Mbo value listner.
        Parameters:
        sourceMbo - The Mbo whose key values will be crossed over to the current Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • getAppLink

        public java.lang.String[] getAppLink()
                                      throws MXException,
                                             java.rmi.RemoteException
        Return the application name for the application link. The first field value listner's not null app link will be returned.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • getLookupName

        public java.lang.String getLookupName()
                                       throws MXException,
                                              java.rmi.RemoteException
        Return the lookup name. The first not null lookup name will be returned.
        Returns:
        Throws:
        MXException
        java.rmi.RemoteException
      • setCustomLookupName

        public void setCustomLookupName(java.lang.String lookupName)
      • setBypassOperatorCheck

        public void setBypassOperatorCheck(boolean val)
        Used in special circumstances when a key value needs to have a value that normally would be prohibited by FldMboKey EXPRLIST. This should not be exposed remotely.
        Parameters:
        val - When set to True, the validation class FldMboKey will not check the EXPRLIST when validating this MboValue.
        See Also:
        FldMboKey.operatorExistCheck(java.lang.String)
      • setApplicationError

        public void setApplicationError(ApplicationError appError)
        This method will set the passed in ApplicationError on the MboValue. This method allows the Application Framework (UI) to associate an error with an attribute so that all UI components bound to that attribute will know of the error. If passing in null this method will also clear out the current Process value (which is the value the user tried that generated the error.
        Parameters:
        appError - The ApplicationError to be set on the MboValue
      • getApplicationError

        public ApplicationError getApplicationError()
        Returns the ApplicationError associated witht he MboValue. Returns null if there is not one.
      • setCurProcessValue

        public void setCurProcessValue(java.lang.String value)
        Sets the incoming value which was attempted to be saved. This value was passed by UI User.
      • getCurProcessValue

        public java.lang.String getCurProcessValue()
        get the incoming value which was attempted to be saved. This value was passed by UI User.
      • setApplicationRequired

        public void setApplicationRequired(boolean appRequired)
        Allows the application to flag this attribute as conditionally required or not
        Parameters:
        appReqired -
      • isApplicationRequired

        public boolean isApplicationRequired()
        Return whether or not the application has marked this field as conditional required
        Returns:
      • isRecordHover

        public boolean isRecordHover()
        Is Record Hover functionality currently being executed for this value? Can be used in field class MboValue.getList() to exclude SQL filtering that might otherwise impede the display of record hover data.
        Returns:
      • setRecordHover

        public void setRecordHover(boolean isRecordHover)
        Used by Mbo.smartFind(String, String, boolean, boolean) to inform MboValue whether or not execution is for Record Hover functionality. Record Hover may need to exclude part of the SQL filter in getList() used for lookups.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object