Class: JavaMappingGenericEnum

Inherits:
JavaMapping show all
Defined in:
lib/ontomde-uml2-struts/mappingForJsp.rb

Instance Method Summary collapse

Methods inherited from JavaMapping

#addActionFieldMethod!, #getFormCopyTo, #getFormInitFrom, #getFormType, #java_Name, #java_helper_addMethods!, #java_helper_customCode, #java_qualifiedName, #rdf_uri, #struts_edit_writeFieldGeneric_DisplayTable_displayTag_column, #struts_generateHelper

Instance Method Details

#getJSP(datatype, field, owner) ⇒ Object



155
156
157
158
159
160
161
# File 'lib/ontomde-uml2-struts/mappingForJsp.rb', line 155

def getJSP(datatype,field,owner)
  if field.context[:jspUseXmdaTaglib]
    return getJSP_XmdaTagLib(datatype,field,owner)
  else
    return getJSP_StrutsOnly(datatype,field,owner)
  end
end

#getJSP_StrutsOnly(datatype, field, owner) ⇒ Object



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/ontomde-uml2-struts/mappingForJsp.rb', line 171

def getJSP_StrutsOnly(datatype,field,owner)
  return <<END
<html:select property="#{field.java_Name}" >
 <logic:iterate id="_#{field.java_Name}" name="#{owner.java_Name}StrutsForm" property="#{field.java_Name}Sug" >
<option value="<bean:write name="_#{field.java_Name}" property="value" />" >
 <bean:define id="_id">
   <bean:write name="_#{field.java_Name}" property="label" />
 </bean:define>
 <%-- TODO: eviter entrelacement balises XML --%>
 <bean:message key="<%= _id %>"/>
</option>
 </logic:iterate>
</html:select>
<SCRIPT> <%-- TODO : supprimer javascript --%>
document.forms[0].#{field.java_Name}.value="<bean:write name="#{owner.java_Name}StrutsForm" property="#{field.java_Name}" />";
</SCRIPT>
END
end

#getJSP_XmdaTagLib(datatype, field, owner) ⇒ Object



163
164
165
166
167
168
169
# File 'lib/ontomde-uml2-struts/mappingForJsp.rb', line 163

def getJSP_XmdaTagLib(datatype,field,owner)
  return %{
<html:select property="#{field.java_Name}" >
<xmda:i18noptionsCollection name="#{owner.java_Name}StrutsForm" property="#{field.java_Name}Sug" label="label" value="value"/>
</html:select>
  }
end