Class: DatatypeMappingIMG

Inherits:
DatatypeMappingBLOB show all
Defined in:
lib/ontomde-java/struts/mappingForJsp.rb,
lib/ontomde-java/java/xsdDatatypeMapping.rb,
lib/ontomde-java/java/javaDatatypeMapping.rb

Instance Method Summary collapse

Methods inherited from DatatypeMappingBLOB

#getFormCopyTo, #getFormInitFrom, #getFormType, #java_getType, #jpa_addTypeModificator, #xsd_getType

Methods inherited from DatatypeMapping

#crank_validation_annotation, #flex_writeMXML_Form_item_property, #flex_writeMXML_Form_item_property_column, #flex_writeMXML_MXvalidator, #flex_writeMXML_validate, #flex_writeMXML_vo_mapping, #flex_writeVO_getParameter, #flex_writeVO_initFromXML_mapping, #flex_writeVO_initItemFromXML_mapping, #flex_writeVO_vars_datatype, #getFormCopyTo, #getFormInitFrom, #getFormType, #java_Name, #java_getType, #java_getUndefinedValue, #java_helper_addMethods!, #java_helper_customCode, #java_qualifiedName, #jpa_addTypeModificator, #prot_init, #rdf_uri, #struts_edit_writeFieldGeneric_DisplayTable_displayTag_column, #struts_generateHelper, #xsd_getType

Instance Method Details

#actionMethName(field) ⇒ Object



213
214
215
# File 'lib/ontomde-java/struts/mappingForJsp.rb', line 213

def actionMethName(field)
  return "#{field.java_Name}_img"
end

#addActionFieldMethod!(field, action, form) ⇒ Object

adds special action for this type



219
220
221
222
223
224
225
226
227
228
# File 'lib/ontomde-java/struts/mappingForJsp.rb', line 219

def addActionFieldMethod!(field,action,form)
  # generate method returning gif image
  m=action.struts_createAndAddExecuteOperation(actionMethName(field))
  m.java_code=<<END
     #{action.struts_formCastJavaCode(form)}
     return #{action.struts_getActionHelper.java_qualifiedName}.writeGif(mapping,response, form.getReference().get#{field.java_NameBean}());
END


end

#getJSP(datatype, field, owner) ⇒ Object



203
204
205
206
207
208
209
210
211
# File 'lib/ontomde-java/struts/mappingForJsp.rb', line 203

def getJSP(datatype,field,owner)
  n=datatype.java_Name.downcase #TODO
  return %{
#{super}
<br/>
<html:img action="#{owner.context[:strutsActionName]}?#{Muml_Classifier::STRUTS_DISPATCH_FIELD_NAME}=#{actionMethName(field)}" /> &nbsp;
  }

end