Class: DatatypeMappingBoolean

Inherits:
DatatypeMapping show all
Defined in:
lib/ontomde-java/flex/Editor.mxml.rb,
lib/ontomde-java/kbjava/rdfToJava.rb,
lib/ontomde-java/flex/ValueObjectAS.rb,
lib/ontomde-java/flex/Editor.mxml.as.rb,
lib/ontomde-java/struts/mappingForJsp.rb,
lib/ontomde-java/struts/mappingForBean.rb,
lib/ontomde-java/java/xsdDatatypeMapping.rb,
lib/ontomde-java/java/javaDatatypeMapping.rb

Constant Summary collapse

STRUTS_BEAN_KEY =

name of the key used by struts to referece current bean in session.

"org.apache.struts.taglib.html.BEAN"

Instance Method Summary collapse

Methods inherited from DatatypeMapping

#addActionFieldMethod!, #crank_validation_annotation, #flex_writeMXML_MXvalidator, #getFormCopyTo, #getFormInitFrom, #getFormType, #java_Name, #java_helper_addMethods!, #java_helper_customCode, #java_qualifiedName, #jpa_addTypeModificator, #prot_init, #rdf_uri, #struts_edit_writeFieldGeneric_DisplayTable_displayTag_column, #struts_generateHelper

Instance Method Details

#flex_prefixObject



532
533
534
# File 'lib/ontomde-java/flex/Editor.mxml.rb', line 532

def flex_prefix
	return "chk"
end

#flex_writeMXML_Form_item_property(prop) ⇒ Object



535
536
537
# File 'lib/ontomde-java/flex/Editor.mxml.rb', line 535

def flex_writeMXML_Form_item_property(prop)
	prop.write(%{<mx:CheckBox id="#{flex_prefix}#{prop.java_NameBean}" label="" selected="{model.#{prop.java_Name}}" />\n})
end

#flex_writeMXML_Form_item_property_column(pcol) ⇒ Object



543
544
545
# File 'lib/ontomde-java/flex/Editor.mxml.rb', line 543

def flex_writeMXML_Form_item_property_column(pcol)
	pcol.write(%{<mx:DataGridColumn headerText="Column " dataField="#{pcol.java_Name}"/>\n})
end

#flex_writeMXML_validate(prop) ⇒ Object



176
177
178
# File 'lib/ontomde-java/flex/Editor.mxml.as.rb', line 176

def flex_writeMXML_validate(prop)
	super
end

#flex_writeMXML_vo_mapping(prop) ⇒ Object

ascenceur=“DatatypeMappingBoolean.chkascenceurchkascenceur.selected”



540
541
542
# File 'lib/ontomde-java/flex/Editor.mxml.rb', line 540

def flex_writeMXML_vo_mapping(prop)
	prop.write(%{ #{prop.java_Name}="{#{flex_prefix}#{prop.java_NameBean}.selected}"})
end

#flex_writeVO_getParameter(prop) ⇒ Object



161
162
163
# File 'lib/ontomde-java/flex/ValueObjectAS.rb', line 161

def flex_writeVO_getParameter(prop)
	prop.write("param.#{prop.java_Name} = #{prop.java_Name};\n")
end

#flex_writeVO_initFromXML_mapping(prop) ⇒ Object

EXAMPLES: isX = DeserializeXMLUtil.getFormBooleanAttributValue(source, ‘isX’);



167
168
169
# File 'lib/ontomde-java/flex/ValueObjectAS.rb', line 167

def flex_writeVO_initFromXML_mapping(prop)
	prop.write("#{prop.java_Name} = DeserializeXMLUtil.getFormBooleanAttributValue(source, '#{prop.java_Name}');\n")
end

#flex_writeVO_initItemFromXML_mapping(prop) ⇒ Object



171
172
173
# File 'lib/ontomde-java/flex/ValueObjectAS.rb', line 171

def flex_writeVO_initItemFromXML_mapping(prop)
	prop.write("#{prop.java_Name}=DeserializeXMLUtil.getOptionBooleanAttributValue(source,'#{prop.java_Name}');\n")
end

#flex_writeVO_vars_datatype(prop) ⇒ Object



158
159
160
# File 'lib/ontomde-java/flex/ValueObjectAS.rb', line 158

def flex_writeVO_vars_datatype(prop)
	prop.write("public var #{prop.java_Name}:Boolean;\n")
end

#getJSP(datatype, field, owner) ⇒ Object



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/ontomde-java/struts/mappingForJsp.rb', line 75

def getJSP(datatype,field,owner)
  if field.context[:jspUseXmdaTaglib]
    return %{<xmda:checkbox property="#{field.java_Name}"/>\n}
  else
    return %{
<html:hidden property="#{field.java_Name}" />
<logic:equal value="true" property="#{field.java_Name}" name="#{STRUTS_BEAN_KEY}" >
	<input type="checkbox" name="#{field.java_Name}_tmp" onClick='document.forms[0].#{field.java_Name}.value=this.checked;' checked />
</logic:equal>
<logic:notEqual value="true" property="#{field.java_Name}" name="#{STRUTS_BEAN_KEY}" >
	<input type="checkbox" name="#{field.java_Name}_tmp" onClick='document.forms[0].#{field.java_Name}.value=this.checked;' />
</logic:notEqual>
    }
  end
end

#java_getJavaParse(jsrc) ⇒ Object



83
84
85
# File 'lib/ontomde-java/struts/mappingForBean.rb', line 83

def java_getJavaParse(jsrc)
  return %{((#{jsrc}).compareTo("true")==0)}
end

#java_getJavaToString(jsrc) ⇒ Object



80
81
82
# File 'lib/ontomde-java/struts/mappingForBean.rb', line 80

def java_getJavaToString(jsrc)
  return %{((#{jsrc}) ? "true" : "false")}
end

#java_getTypeObject



80
81
82
# File 'lib/ontomde-java/java/javaDatatypeMapping.rb', line 80

def java_getType
  return "boolean"
end

#java_getUndefinedValueObject



83
84
85
# File 'lib/ontomde-java/java/javaDatatypeMapping.rb', line 83

def java_getUndefinedValue
  return %{false}
end

#prot_convertToJava(umlprop, valitem) ⇒ Object

Protege string to Java code conversions



388
389
390
# File 'lib/ontomde-java/kbjava/rdfToJava.rb', line 388

def prot_convertToJava(umlprop,valitem)
  return valitem
end

#xsd_getTypeObject

name of the key used by struts to referece current bean in session.



49
50
51
# File 'lib/ontomde-java/java/xsdDatatypeMapping.rb', line 49

def xsd_getType
  return "xsd:boolean"
end