Impressing Andreas! Not easy to see that from the error message.
You also need to add import of extensions:properties
import sculptormetamodel;
import sculptorguimetamodel;
extension extensions::guihelper;
extension extensions::properties;
Från: Andreas Källberg
Ämne: Re: [Fornax-developer] [sculptor]How to change generation of xhtml views?
Till: fornax-developer@lists.sourceforge.net
Datum: torsdag 23 september 2010 14:51
One thing, you need to import sculptorguimetamodel in your modifications.
Andreas
On Sep 23, 2010 2:23 p.m., "greatfooty" wrote:
So took a plunge at this, gungho with xtend&xpand ! ... but now bombing
during generation.
Created this in extensions/WebSpecialCases.ext (intent to just have an extra
bit for custom type BigText):
import sculptormetamodel;
extension extensions::guihelper;
around extensions::guihelper::resolveJSFInputComponent(ViewDataProperty
prop, boolean startTag) :
if (prop.getAttributeType() == "BigText") then
"rich:editor" + (startTag ? ' rendered="true" theme="advanced"
viewMode="visual"' : '')
else if (prop.getAttributeType() == "Date") then
((getDateTimeLibrary() == "java") ? 't:inputDate' + (startTag ?
'
popupCalendar="true"' : '') : "h:inputText")
else if (prop.getAttributeType() == "DateTime" ||
prop.getAttributeType()
== "Timestamp") then
((getDateTimeLibrary() == "java") ? 't:inputDate' + (startTag ?
'
popupCalendar="true" type="both"' : '') : "h:inputText")
else if (prop.getAttributeType() == "boolean" ||
prop.getAttributeType() ==
"Boolean") then
"h:selectBooleanCheckbox"
else if prop.getDatabaseLength() != null &&
prop.getDatabaseLength().asInteger() > 100 then
'h:inputTextarea' + (startTag ? ' rows="10"' : '')
else
"h:inputText";
And this in WebSpecialCases.xpt (to include the rich and a4j namespaces):
«IMPORT sculptormetamodel»
«EXTENSION extensions::helper»
«EXTENSION extensions::properties»
«EXTENSION extensions::guihelper»
«AROUND templates::JSFCrudGuiFlowJsf::faceletsXmlns FOR Object»
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:t="http://myfaces.apache.org/tomahawk"
xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:sf="http://www.springframework.org/tags/faces"
xmlns:a="ApplicationTaglib"
«ENDAROUND»
Enabled these two files as per the dev guide:
<workflow>
<cartridge file="sculptorguidslworkflow.mwe">
<modelFile value="classpath:/model.guidesign"/>
</cartridge>
<component adviceTarget="generator" id="reflectionAdvice"
class="org.eclipse.xpand2.GeneratorAdvice">
<advices value="templates::WebSpecialCases" />
<extensionAdvices value="extensions::WebSpecialCases" />
<fileEncoding value="iso-8859-1" />
</component>
</workflow>
But when running i get the following which refers to a completely different
template ???
21:55:24,319 ERROR Generator:194 - Error in Component generator of type
org.ecli
pse.xpand2.Generator:
EvaluationException : null
templates::web::JSFCrudGuiConfigWebXml.xpt[8202,12] on line 231
'getWebR
oot()'
templates::web::JSFCrudGuiConfigWebXml.xpt[1312,22] on line 36
'EXPAND a
pplicationName'
templates::web::JSFCrudGuiConfigWebXml.xpt[919,20] on line 26
'EXPAND we
bXmlContent'
templates::web::JSFCrudGuiConfig.xpt[883,37] on line 25 'EXPAND
JSFCrudG
uiConfigWebXml::webXml'
templates::web::JSFCrudGui.xpt[839,31] on line 24 'EXPAND
JSFCrudGuiConf
ig::config'
templates::GuiRoot.xpt[1088,41] on line 28 'EXPAND
templates::web::JSFCr
udGui::webApp'
[23,47] on line 1 'EXPAND templates::GuiRoot::GuiRoot FOR guiModel'
21:55:24,319 ERROR WorkflowRunner:423 - Workflow interrupted. Reason: null
21:55:24,319 ERROR WorkflowRunner:450 - [ERROR](Element: getWebRoot();
Reported
by: Generator(generator): generating 'templates::GuiRoot::GuiRoot FOR
guiModel'
I can see this setup as
«DEFINE applicationName FOR GuiApplication»
<display-name>«getWebRoot()»</display-name>
«ENDDEFINE»
and
String getWebRoot(GuiApplication guiApplication) :
JAVA
org.fornax.cartridges.sculptor.generator.util.GuiGenerationHelper.getWebRoot(sculptorguimetamodel.GuiApplication);
App was fully functional previously but fairly obviously there's some impact
from my changes .. maybe some basic syntax error ??
Any ideas? - note I'm running 1.9.0
--
View this message in context:
http://old.nabble.com/-sculptor-How-to-change-generation-of-xhtml-views--tp29777660s17564p29788690.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.
--------------------------------...
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Fornax-developer mailing list
Fornax-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fornax-developer