Package org.apache.empire.data

Examples of org.apache.empire.data.Record


        if (isReadOnly())
            return false;
        // Check Record
        if ((getRecord() instanceof Record))
        {   // Ask Record
            Record r = (Record) record;
            return r.isFieldRequired(getColumn());
        }
        // Check Value Attribute
        if (hasValueExpression())
            return false;
        // Required
View Full Code Here


            if (isRecordReadOnly())
                return true;
            // Check Record
            if ((getRecord() instanceof Record))
            { // Ask Record
                Record r = (Record) record;
                return r.isFieldReadOnly(getColumn());
            }
            // column
            return getColumn().isReadOnly();
        }
View Full Code Here

                return loadRecord(key);
            }
            // Data persistence
            case Data:
            {   // get record object from session
                Record rec = getRecordFromSession();
                if (rec!=null && (rec instanceof DBRecord))
                {   // Check rowset
                    if (((DBRecord)rec).getRowSet()!=rowset)
                        return error(Errors.ObjectNotValid, "record");
                    // Record restored
View Full Code Here

        if (keyValues == null || keyValues.length != keyColumns.length)
            return error(DBErrors.RecordInvalidKey, keyValues, "keyValues");
        // Get Persistent record
        if (persistence==SessionPersistence.Data)
        {   // Get the record from the session
            Record rec = getRecordFromSession();
            if (rec==null || (rec instanceof DBRecord)==false)
            {   // Record restored
                return error(WebErrors.InvalidFormData);
            }
            // Record not found
View Full Code Here

    public abstract Record getRecord();

    public String getRecordKeyString()
    {
        Record record = getRecord();
        if (record==null || record.isValid()==false)
        {   // Check whether we can get the record key from the request or the session
            String property = getRecordPropertyName();
            String key = getActionParam(property, persistence==SessionPersistence.Key);
            if (key!=null || (persistence!=SessionPersistence.Data))
                return key; // Return key or null
View Full Code Here

        return action.getRecordKeyString(record);
    }
   
    public boolean isNewRecord()
    {
        Record record = getRecord();
        if (record==null || record.isValid()==false)
        {   // Check whether we can get the record key from the request or the session
            String property = getRecordPropertyName();
            String key = getActionParam(property, persistence==SessionPersistence.Key);
            if (key!=null)
                return action.getRecordNewFlagFromString(key); // Return key or null
            if (persistence!=SessionPersistence.Data)
                return false; // Unknown
            // Get Record from the session
            record = getRecordFromSession();
            if (record==null)
                return false; // No Record Provided
            // We have a record
            // setRecord(record);
        }
        return record.isNew();
    }
View Full Code Here

     * @return true if all fields supplied with the request have been successfully set on the record
     */
    @Override
    public boolean loadFormData()
    {
        Record record = getRecord();
        if (record.isValid()==false)
            return error(Errors.ObjectNotValid, "record");
        // Load Data
        clearError();
        return setUpdateFields(record);
    }
View Full Code Here

        // Default
        Object readOnly = getPageAttribute(FormPartTag.READONLY_ATTRIBUTE, null);
        if (readOnly!=null && ObjectUtils.getBoolean(readOnly))
            return true; // Form is read Only
        // Detect only if record is supplied!
        Record record = getRecord();
        if (record!=null)
            return record.isFieldReadOnly(column);
        else if (getRecordData()!=null)
            return true; // Only a record data object
        else if (getBean()!=null)
            return column.isReadOnly();
        // Render editable
View Full Code Here

    private Options getLookupOptions()
    {
        if (options == null)
        { // Get List from Column
            Record rec = getRecord();
            if (rec!=null && rec.isValid())
            { // Options from Record
                return rec.getFieldOptions(column);
            } else
            { // Options from column
                return column.getOptions();
            }
        }
View Full Code Here

    private String getRecordKey()
    {
        if ((record instanceof Record)==false)
            return null; // not supported
        // find Action
        Record rec = (Record)record;
        if (rec.isValid()==false)
        {   log.error("Unable to detect record key. Record supplied is not valid!");
            return null;
        }
        Object action = this.pageContext.getRequest().getAttribute("action");
        if (action instanceof ActionBase)
        {
            return ((ActionBase)action).getRecordKeyString(rec);
        }
        // Assemble
        StringBuffer key = new StringBuffer();
        Column [] keyCols = rec.getKeyColumns();
        for (int i=0; i<keyCols.length; i++)
        {
            if (i>0)
                key.append("/");
            key.append(StringUtils.valueOf(rec.getValue(keyCols[i])));
        }
        return key.toString();
    }
View Full Code Here

TOP

Related Classes of org.apache.empire.data.Record

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.