⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jahiaintegerfield.java

📁 java 写的一个新闻发布系统
💻 JAVA
字号:
//  JahiaIntegerField//  YG      08.08.2001package org.jahia.data.fields;import java.util.*;                     // Vector, Calendarimport org.jahia.utils.*; import org.jahia.data.*;    import org.jahia.params.*;          // ParamBeanimport org.jahia.sharing.*;         // JahiaDataSourceManagerimport org.jahia.exceptions.JahiaException;import org.jahia.registries.*;      // Registriespublic class JahiaIntegerField extends JahiaField implements JahiaSimpleField{        /***        * constructor        * YG            *        */    public JahiaIntegerField(Integer      ID,                            Integer         jahiaID,                            Integer         pageID,                            Integer         ctnid,                            Integer         fieldDefID,                            Integer         fieldType,                            Integer         connectType,                            String          fieldValue,                            Integer         rank,                            Integer         aclID )    {        super(ID, jahiaID, pageID, ctnid, fieldDefID, fieldType, connectType,              fieldValue, rank, aclID);    } // end constructor            public void load(int loadFlag, ParamBean jParams)    throws JahiaException    {        switch (this.getConnectType())        {            case (ConnectionTypes.LOCAL) :                //this.setValue(this.getValue());                if (!this.getValue().equals("<empty>")) {                    this.setRawValue(this.getValue());                    this.setValue(FormDataManager.getInstance().decode(this.getValue()));                    if (this.getValue() != null && !this.getValue().equals(""))                    {                        try {                            this.setObject(new Long( this.getValue() ));                        } catch (NumberFormatException e)                        {                            this.setObject(new Long( 0 ));                            this.setValue("");                        }                    }                    else                    {                        this.setObject(new Long( 0 ));                    }                }                break;            case (ConnectionTypes.DATASOURCE) :            if ((loadFlag & LoadFlags.DATASOURCE) != 0) {                this.setValue( JahiaDataSourceManager.getInstance().                    fields().getInstance().getRemoteFieldValue(                    this.getValue() ));                if (this.getValue() != null && !this.getValue().equals(""))                {                    try {                        this.setObject(new Long( this.getValue() ));                    } catch (NumberFormatException e)                    {                        this.setObject(new Long( 0 ));                        this.setValue("");                    }                                    }                else                {                    this.setObject(new Long( 0 ));                }            }        }            }        public void save(ParamBean jParams)    throws JahiaException    {        ;    }        public void delete(ParamBean jParams)    throws JahiaException    {        ;    }    /**     * Returns an hashtable of indexable attributes , pairs [attribute name/value].      * Returned pairs:     * 					("value",val), the integer value     *     * @return Hashtable a map of indexable attributes , pairs [attribute name/value]     */    public Hashtable getIndexableAttributes(){    	Hashtable hash = new Hashtable();    	hash.put("value",getValue());    	return hash;    }        public String getEngineName()    {        return "org.jahia.engines.shared.Integer_Field";    }        public String getFieldContent4Ranking()    {        return this.getValue();    }        public String getIconNameOff()    {        return "n_off";    }        public String getIconNameOn()    {        return "n_on";    }        public JahiaField cloneField(int newctnid, int newPageID, int clonedAclID, boolean childrenCloned)    throws JahiaException    {        JahiaField clonedField = ServicesRegistry.getInstance().getJahiaFieldService().                                 createJahiaField(0, this.getJahiaID(),                                 newPageID, newctnid,                                 this.getFieldDefID(), this.getType(),                                 this.getConnectType(),                                 this.getValue(), this.getRank(),                                 clonedAclID );        //toDebug("cloneField(): value = "+this.getValue());        if (clonedField == null)        {            throw new JahiaException ("Could not clone field.",                "Could not instanciate a new JahiaField object.",                JahiaException.PAGE_ERROR, JahiaException.CRITICAL);        }        clonedField.setRawValue(this.getRawValue());        clonedField.setObject( this.getObject() );        clonedField.setProperties( (Hashtable)(this.getProperties()).clone() );                return clonedField;    }        public Object clone()    {        Object objItem = this.getObject();        JahiaIntegerField intf = new JahiaIntegerField (new Integer(ID), new Integer(jahiaID),                                        new Integer(pageID),                                         new Integer(ctnid),                                        new Integer(fieldDefID),                                         new Integer(fieldType),                                         new Integer(connectType),                                         fieldValue, new Integer(rank),                                         new Integer(aclID) );        intf.setObject(objItem);        return intf;    }            }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -