📄 jahiabooleanfield.java
字号:
// JahiaBooleanField// 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 JahiaBooleanField extends JahiaField implements JahiaSimpleField{ /*** * constructor * YG * */ public JahiaBooleanField(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("") && (this.getValue().equals("true") || this.getValue().equals("false"))) { this.setObject(new Boolean( this.getValue() )); } else { this.setObject(new Boolean( "true" )); this.setValue(""); } } 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("")) { this.setObject(new Boolean( this.getValue() )); } else { this.setObject(new Boolean( "true" )); } } } } 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 boolean 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.Boolean_Field"; } public String getFieldContent4Ranking() { return this.getValue(); } public String getIconNameOff() { return "01_off"; } public String getIconNameOn() { return "01_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(); JahiaBooleanField bf = new JahiaBooleanField (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) ); bf.setObject(objItem); return bf; } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -