ontomde-uml2-crank 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +5 -0
- data/Manifest.txt +16 -0
- data/README.txt +50 -0
- data/Rakefile +32 -0
- data/lib/ontomde-uml2-crank.rb +19 -0
- data/lib/ontomde-uml2-crank/context.rb +384 -0
- data/lib/ontomde-uml2-crank/crankJpa.rb +103 -0
- data/lib/ontomde-uml2-crank/equals.rb +83 -0
- data/lib/ontomde-uml2-crank/facelets.rb +243 -0
- data/lib/ontomde-uml2-crank/facesconfig.rb +113 -0
- data/lib/ontomde-uml2-crank/helper.rb +46 -0
- data/lib/ontomde-uml2-crank/main.rb +53 -0
- data/lib/ontomde-uml2-crank/menu.rb +39 -0
- data/lib/ontomde-uml2-crank/menu2.rb +78 -0
- data/lib/ontomde-uml2-crank/validation.rb +34 -0
- data/lib/ontomde-uml2-crank/version.rb +7 -0
- metadata +88 -0
@@ -0,0 +1,103 @@
|
|
1
|
+
module Muml_Property
|
2
|
+
|
3
|
+
def jpa_addRelationCascadeType(isIncludeType=true)
|
4
|
+
if crank_isMasterFromMasterDetail?
|
5
|
+
self.java_annotation_add("@xmda.jpa.annotations.MasterDetail")
|
6
|
+
self.umlx_owner_one.java_import_add("org.hibernate.annotations.Cascade");
|
7
|
+
self.java_annotation_add("@Cascade({org.hibernate.annotations.CascadeType.DELETE_ORPHAN})")
|
8
|
+
if (isIncludeType)
|
9
|
+
return ",cascade={CascadeType.ALL}"
|
10
|
+
else
|
11
|
+
return "(cascade={CascadeType.ALL})"
|
12
|
+
end
|
13
|
+
elsif crank_isDetailFromMasterDetail?
|
14
|
+
self.java_annotation_add("@xmda.jpa.annotations.Detail")
|
15
|
+
end
|
16
|
+
|
17
|
+
if (isIncludeType)
|
18
|
+
return CRANK_DEFAULT_CASCADE_I
|
19
|
+
else
|
20
|
+
return CRANK_DEFAULT_CASCADE
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
CRANK_DEFAULT_CASCADE="(cascade={CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH})"
|
25
|
+
CRANK_DEFAULT_CASCADE_I=",cascade={CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}"
|
26
|
+
|
27
|
+
alias super_jpa_addPersistenceToAssociation! jpa_addPersistenceToAssociation!
|
28
|
+
def jpa_addPersistenceToAssociation!(ah)
|
29
|
+
super_jpa_addPersistenceToAssociation!(ah)
|
30
|
+
end
|
31
|
+
|
32
|
+
def crank_isMasterFromMasterDetail?
|
33
|
+
return true if self.umlx_isComposite?
|
34
|
+
return false
|
35
|
+
end
|
36
|
+
def crank_isDetailFromMasterDetail?
|
37
|
+
oe=umlx_otherEnd
|
38
|
+
binav=(!oe.nil?) && oe.umlx_isNavigable?
|
39
|
+
return false if !binav
|
40
|
+
return oe.crank_isMasterFromMasterDetail?
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
module DAO
|
48
|
+
DAOInterface="GenericDao"
|
49
|
+
DAOQualifiedInterface="org.crank.crud.GenericDao"
|
50
|
+
|
51
|
+
alias super_jpa_addDAO! jpa_addDAO!
|
52
|
+
def jpa_addDAO!
|
53
|
+
|
54
|
+
if !context[:crank]
|
55
|
+
super_jpa_addDAO!
|
56
|
+
return
|
57
|
+
end
|
58
|
+
|
59
|
+
log.debug { "adding dao for #{self}" }
|
60
|
+
p=umlx_package
|
61
|
+
|
62
|
+
p_dao=p.umlx_getOrCreatePackage(context[:dbDAOsubPackage,"dao"],p)
|
63
|
+
c=p_dao.umlx_createAndAddInterface(rdf_uri+"_dao")
|
64
|
+
c.db_isDAO=RDF_TRUE
|
65
|
+
c.db_isTransient=RDF_TRUE
|
66
|
+
self.java_DAOClass=c
|
67
|
+
c.java_persistentClass=self
|
68
|
+
c.uml_name=uml_name_one+"DAO"
|
69
|
+
|
70
|
+
i = umlx_getOrCreateClass("#{DAO::DAOInterface}<#{uml_name_one},Long>");
|
71
|
+
i.db_isTransient=RDF_TRUE
|
72
|
+
i.java_isGeneric=RDF_TRUE
|
73
|
+
c.umlx_createAndAddGeneralization(i)
|
74
|
+
|
75
|
+
self.jpa_addNamedQuery
|
76
|
+
|
77
|
+
log.debug { "DAO added: #{c.uml_name} in #{c.umlx_package.uml_name}"}
|
78
|
+
c.java_import_add(DAO::DAOQualifiedInterface)
|
79
|
+
c.java_import_add("#{self.java_qualifiedName}")
|
80
|
+
end
|
81
|
+
|
82
|
+
def jpa_addNamedQuery
|
83
|
+
namedQuery = "@javax.persistence.NamedQueries( {\n"
|
84
|
+
namedQuery << " @javax.persistence.NamedQuery( name = \"#{self.java_Name}.readPopulated\",\n"
|
85
|
+
namedQuery << " query = \"select distinct #{self.java_Name.downcase} from #{self.java_Name} #{self.java_Name.downcase} "
|
86
|
+
umlx_ownedAndInheritedAttribute.each { |a|
|
87
|
+
next if a.uml_type_one.db_isTransient?
|
88
|
+
next if a.uml_isDerived?
|
89
|
+
if !a.umlx_isAttribute?
|
90
|
+
namedQuery << jpa_addNamedQueryToAssociation!(a)
|
91
|
+
end
|
92
|
+
}
|
93
|
+
namedQuery << " where #{self.java_Name.downcase}.id=?\" )"
|
94
|
+
|
95
|
+
namedQuery += "})"
|
96
|
+
self.java_annotation_add(namedQuery)
|
97
|
+
end
|
98
|
+
|
99
|
+
def jpa_addNamedQueryToAssociation!(a)
|
100
|
+
return "left outer join fetch #{self.java_Name.downcase}.#{a.java_Name} "
|
101
|
+
end
|
102
|
+
|
103
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
module Muml_Classifier
|
2
|
+
|
3
|
+
def java_generate_equalsAndHash
|
4
|
+
ret=Set.new
|
5
|
+
uml_ownedAttribute.each {|biz|
|
6
|
+
ret << biz if biz.umlx_hasStereotype?("EqualsValue")
|
7
|
+
}
|
8
|
+
if !ret.empty?
|
9
|
+
java_generateEquals(ret, !crank_isTopCrankBean)
|
10
|
+
java_generateHashCode(ret)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
|
15
|
+
def java_generateEquals(ret, callSuperEquals)
|
16
|
+
me=self.umlx_createAndAddOperation(self.rdf_uri+"_equals")
|
17
|
+
me.uml_name="equals"
|
18
|
+
# me.uml_class=self
|
19
|
+
me.uml_visibility=Cuml_VisibilityKind::Public
|
20
|
+
rme=me.umlx_createAndAddReturnParameter("#{me.rdf_uri}_ret")
|
21
|
+
rme.uml_type=umlx_getOrCreateDataType("boolean")
|
22
|
+
rpe=me.umlx_createAndAddParameter("#{me.rdf_uri}_par", "o")
|
23
|
+
rpe.uml_type=umlx_getOrCreateClass("Object")
|
24
|
+
me.java_annotation_add("@Override")
|
25
|
+
meCode = <<CODE
|
26
|
+
if(this == o) {
|
27
|
+
return true;
|
28
|
+
}
|
29
|
+
if(o==null || !(o instanceof #{self.java_Name})) {
|
30
|
+
return false;
|
31
|
+
}
|
32
|
+
CODE
|
33
|
+
if callSuperEquals
|
34
|
+
meCode << <<CODE
|
35
|
+
if !super.equals(o) {
|
36
|
+
return false;
|
37
|
+
}
|
38
|
+
CODE
|
39
|
+
end
|
40
|
+
meCode << <<CODE
|
41
|
+
final #{self.java_Name} _o = (#{self.java_Name}) o;
|
42
|
+
CODE
|
43
|
+
ret.each { |a|
|
44
|
+
meCode << <<CODE
|
45
|
+
if (#{a.java_Name} != null ?
|
46
|
+
!#{a.java_Name}.equals(_o.#{a.java_Name}) :
|
47
|
+
_o.#{a.java_Name} != null) {
|
48
|
+
return false;
|
49
|
+
}
|
50
|
+
CODE
|
51
|
+
}
|
52
|
+
meCode << <<CODE
|
53
|
+
return true;
|
54
|
+
CODE
|
55
|
+
me.java_code = meCode
|
56
|
+
end
|
57
|
+
|
58
|
+
|
59
|
+
def java_generateHashCode(ret)
|
60
|
+
me=self.umlx_createAndAddOperation(self.rdf_uri+"_hash")
|
61
|
+
me.uml_name="hashCode"
|
62
|
+
me.uml_class=self
|
63
|
+
me.uml_visibility=Cuml_VisibilityKind::Public
|
64
|
+
rme=me.umlx_createAndAddReturnParameter("#{me.rdf_uri}_ret")
|
65
|
+
rme.uml_type=umlx_getOrCreateDataType("int")
|
66
|
+
me.java_annotation_add("@Override")
|
67
|
+
meCode = <<CODE
|
68
|
+
final int prime = 31;
|
69
|
+
int result = 1;
|
70
|
+
CODE
|
71
|
+
ret.each { |a|
|
72
|
+
meCode << <<CODE
|
73
|
+
result = prime * result + ((#{a.java_Name} == null) ? 0 : #{a.java_Name}.hashCode());
|
74
|
+
CODE
|
75
|
+
}
|
76
|
+
meCode << <<CODE
|
77
|
+
return result;
|
78
|
+
CODE
|
79
|
+
me.java_code = meCode
|
80
|
+
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
@@ -0,0 +1,243 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
module Muml_Classifier
|
4
|
+
|
5
|
+
def crank_generate_listing
|
6
|
+
mtk_writeSession("#{context[:webContentDir]}/pages/crud/#{self.java_Name}/Listing.xhtml") {
|
7
|
+
write <<END
|
8
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
9
|
+
<html xmlns="http://www.w3.org/1999/xhtml"
|
10
|
+
xmlns:ui="http://java.sun.com/jsf/facelets"
|
11
|
+
xmlns:h="http://java.sun.com/jsf/html"
|
12
|
+
xmlns:f="http://java.sun.com/jsf/core"
|
13
|
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
|
14
|
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich"
|
15
|
+
xmlns:c="http://java.sun.com/jstl/core"
|
16
|
+
xmlns:crank="http://www.googlecode.com/crank"
|
17
|
+
>
|
18
|
+
<ui:composition template="/templates/layout.xhtml">
|
19
|
+
<ui:define name="javascript">
|
20
|
+
<script type="text/javascript" src="${request.contextPath}/js/jquery.js"/>
|
21
|
+
<script type="text/javascript" src="${request.contextPath}/js/messages.js"/>
|
22
|
+
<script type="text/javascript" src="${request.contextPath}/js/details.js"/>
|
23
|
+
</ui:define>
|
24
|
+
<ui:define name="content">
|
25
|
+
|
26
|
+
<h:outputText value="#{self.java_Name}s" styleClass="pageTitle"/>
|
27
|
+
|
28
|
+
<a4j:region renderRegionOnly="false">
|
29
|
+
<a4j:form id="${daoName}ListForm">
|
30
|
+
<crank:listing
|
31
|
+
paginator="${paginators['#{self.java_Name}']}"
|
32
|
+
jsfCrudAdapter="${cruds['#{self.java_Name}']}"
|
33
|
+
propertyNames="#{self.crank_listingProperties}"
|
34
|
+
pageTitle="${daoName}"
|
35
|
+
parentForm="${daoName}ListForm"
|
36
|
+
reRender="${daoName}ListForm"
|
37
|
+
crud="${cruds['#{self.java_Name}'].controller}"
|
38
|
+
END
|
39
|
+
if crank_hasCrankBeanChild?
|
40
|
+
write <<END
|
41
|
+
|
42
|
+
clazzs="
|
43
|
+
END
|
44
|
+
isFirstSubclazz = true
|
45
|
+
crank_subCrankBean.each{|c|
|
46
|
+
if isFirstSubclazz
|
47
|
+
isFirstSubclazz = false
|
48
|
+
elsif
|
49
|
+
write ","
|
50
|
+
end
|
51
|
+
write "#{c.java_Name}"
|
52
|
+
}
|
53
|
+
write "\""
|
54
|
+
end
|
55
|
+
|
56
|
+
write <<END
|
57
|
+
/>
|
58
|
+
</a4j:form>
|
59
|
+
</a4j:region>
|
60
|
+
|
61
|
+
|
62
|
+
</ui:define>
|
63
|
+
</ui:composition>
|
64
|
+
</html>
|
65
|
+
END
|
66
|
+
}
|
67
|
+
end
|
68
|
+
|
69
|
+
|
70
|
+
def crank_generate_form
|
71
|
+
mtk_writeSession("#{context[:webContentDir]}/pages/crud/#{self.java_Name}/Form.xhtml") {
|
72
|
+
write <<END
|
73
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
74
|
+
<html xmlns="http://www.w3.org/1999/xhtml"
|
75
|
+
xmlns:ui="http://java.sun.com/jsf/facelets"
|
76
|
+
xmlns:h="http://java.sun.com/jsf/html"
|
77
|
+
xmlns:f="http://java.sun.com/jsf/core"
|
78
|
+
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
|
79
|
+
xmlns:rich="http://richfaces.ajax4jsf.org/rich"
|
80
|
+
xmlns:c="http://java.sun.com/jstl/core"
|
81
|
+
xmlns:crank="http://www.googlecode.com/crank"
|
82
|
+
xmlns:validation="http://code.google.com/p/krank/validation"
|
83
|
+
>
|
84
|
+
|
85
|
+
<ui:composition template="/templates/layout.xhtml">
|
86
|
+
<ui:define name="content">
|
87
|
+
|
88
|
+
<c:set var="adapter" value="${#{self.java_Name.downcase}Crud}" />
|
89
|
+
<c:set var="crud" value="${adapter.controller}" />
|
90
|
+
|
91
|
+
<span class="pageTitle">#{self.java_Name} Entry Form</span>
|
92
|
+
|
93
|
+
<a4j:region renderRegionOnly="false">
|
94
|
+
<a4j:form
|
95
|
+
id="#{self.java_Name.downcase}Form">
|
96
|
+
|
97
|
+
<crank:form
|
98
|
+
crud="${crud}"
|
99
|
+
parentForm="#{self.java_Name.downcase}Form"
|
100
|
+
propertyNames="#{self.crank_editSimpleProperties}"
|
101
|
+
readOnlyProperties="#{self.crank_readOnlyProperties}">
|
102
|
+
#{crank_crud_relationship}
|
103
|
+
</crank:form>
|
104
|
+
</a4j:form>
|
105
|
+
</a4j:region>
|
106
|
+
|
107
|
+
</ui:define>
|
108
|
+
</ui:composition>
|
109
|
+
</html>
|
110
|
+
END
|
111
|
+
}
|
112
|
+
end
|
113
|
+
|
114
|
+
|
115
|
+
def crank_crud_relationship
|
116
|
+
rel = ""
|
117
|
+
rels = eachCrankBeanRelations
|
118
|
+
rels.each { |a|
|
119
|
+
if !a.umlx_isComposite? && !a.java_isManyAssociation?
|
120
|
+
rel << crank_simpleRelationHelper(a)
|
121
|
+
end
|
122
|
+
}
|
123
|
+
bManyAsociation = false
|
124
|
+
rels.each { |a|
|
125
|
+
if !a.umlx_isComposite? && a.java_isManyAssociation?
|
126
|
+
if !bManyAsociation
|
127
|
+
rel << "<rich:tabPanel width=\"100%\">\n"
|
128
|
+
bManyAsociation = true
|
129
|
+
end
|
130
|
+
rel << " <rich:tab label=\"${crud:createLabel('#{a.java_Name}')}\">\n"
|
131
|
+
rel << crank_simpleRelationHelper(a)
|
132
|
+
rel << " </rich:tab>\n"
|
133
|
+
end
|
134
|
+
}
|
135
|
+
if bManyAsociation
|
136
|
+
rel << "</rich:tabPanel>\n"
|
137
|
+
end
|
138
|
+
bManyAsociation = false
|
139
|
+
rels.each { |a|
|
140
|
+
if a.crank_isMasterFromMasterDetail?
|
141
|
+
if !bManyAsociation
|
142
|
+
rel << "<rich:tabPanel width=\"100%\">\n"
|
143
|
+
bManyAsociation = true
|
144
|
+
end
|
145
|
+
rel << " <rich:tab label=\"${crud:createLabel('#{a.java_Name}')}\">\n"
|
146
|
+
rel << crank_masterDetailRelationHelper(a)
|
147
|
+
rel << " </rich:tab>\n"
|
148
|
+
end
|
149
|
+
}
|
150
|
+
if bManyAsociation
|
151
|
+
rel << "</rich:tabPanel>\n"
|
152
|
+
end
|
153
|
+
return rel
|
154
|
+
end
|
155
|
+
|
156
|
+
def crank_simpleRelationHelper(a)
|
157
|
+
rel=""
|
158
|
+
if a.java_isManyAssociation?
|
159
|
+
rel += " <crank:selectManyExtended jsfSelectManyController="
|
160
|
+
elsif
|
161
|
+
rel += " <crank:selectOneListing jsfSelectOneController="
|
162
|
+
end
|
163
|
+
rel +=<<CODE
|
164
|
+
"${#{a.java_Name.downcase}From#{java_Name}To#{a.uml_type_one.java_Name}Controller}"
|
165
|
+
propertyNames="#{a.uml_type_one.crank_listingProperties}"
|
166
|
+
parentForm="#{self.java_Name.downcase}Form" editRelation="${true}"
|
167
|
+
/>
|
168
|
+
|
169
|
+
CODE
|
170
|
+
return rel
|
171
|
+
end
|
172
|
+
|
173
|
+
def crank_masterDetailRelationHelper(a)
|
174
|
+
rel=<<CODE
|
175
|
+
<crank:detailListingExtended detailController="${#{a.java_Name.downcase}From#{java_Name}To#{a.uml_type_one.java_Name}Controller}"
|
176
|
+
propertyNames="#{a.uml_type_one.crank_listingProperties}" editRelation="${true}"
|
177
|
+
CODE
|
178
|
+
if a.uml_type_one.crank_hasCrankBeanChild?
|
179
|
+
rel << " clazzs=\""
|
180
|
+
isFirstSubclazz = true
|
181
|
+
a.uml_type_one.crank_subCrankBean.each{|c|
|
182
|
+
if isFirstSubclazz
|
183
|
+
isFirstSubclazz = false
|
184
|
+
elsif
|
185
|
+
rel << ","
|
186
|
+
end
|
187
|
+
rel << "#{c.java_Name}"
|
188
|
+
}
|
189
|
+
rel << "\""
|
190
|
+
end
|
191
|
+
rel << " />\n"
|
192
|
+
return rel
|
193
|
+
end
|
194
|
+
|
195
|
+
def crank_listingProperties
|
196
|
+
attributes = nil
|
197
|
+
umlx_ownedAndInheritedAttribute.each { |a|
|
198
|
+
next if a.umlx_isComposite?
|
199
|
+
next unless a.umlx_isAttribute?
|
200
|
+
#next if a.uml_type_one.db_isTransient?
|
201
|
+
next if a.uml_isStatic?
|
202
|
+
next if a.uml_isReadOnly?
|
203
|
+
next if "id" == "#{a.java_Name}" #TODO Faire mieux
|
204
|
+
next if "objectVersion" == "#{a.java_Name}" #TODO Faire mieux
|
205
|
+
if attributes.nil?
|
206
|
+
attributes = "#{a.java_Name}"
|
207
|
+
else
|
208
|
+
attributes << ",#{a.java_Name}"
|
209
|
+
end
|
210
|
+
}
|
211
|
+
if (attributes.nil?)
|
212
|
+
attributes = ""
|
213
|
+
end
|
214
|
+
return attributes
|
215
|
+
end
|
216
|
+
|
217
|
+
def crank_readOnlyProperties
|
218
|
+
attributes = nil
|
219
|
+
umlx_ownedAndInheritedAttribute.each { |a|
|
220
|
+
next if a.umlx_isComposite?
|
221
|
+
next unless a.umlx_isAttribute?
|
222
|
+
#next if a.uml_type_one.db_isTransient?
|
223
|
+
next if a.uml_isStatic?
|
224
|
+
next if !a.uml_isReadOnly?
|
225
|
+
next if "id" == "#{a.java_Name}" #TODO Faire mieux
|
226
|
+
next if "objectVersion" == "#{a.java_Name}" #TODO Faire mieux
|
227
|
+
if attributes.nil?
|
228
|
+
attributes = "#{a.java_Name}"
|
229
|
+
else
|
230
|
+
attributes << ",#{a.java_Name}"
|
231
|
+
end
|
232
|
+
}
|
233
|
+
if (attributes.nil?)
|
234
|
+
attributes = ""
|
235
|
+
end
|
236
|
+
return attributes
|
237
|
+
end
|
238
|
+
|
239
|
+
def crank_editSimpleProperties
|
240
|
+
return crank_listingProperties
|
241
|
+
end
|
242
|
+
|
243
|
+
end
|
@@ -0,0 +1,113 @@
|
|
1
|
+
|
2
|
+
module Mrdf_Model
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
def crank_faces_header
|
8
|
+
write <<END
|
9
|
+
<?xml version="1.0"?>
|
10
|
+
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
|
11
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
12
|
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
|
13
|
+
version="1.2">
|
14
|
+
|
15
|
+
<!--
|
16
|
+
<lifecycle>
|
17
|
+
<phase-listener>org.crank.jsf.support.DebugPhaseListener</phase-listener>
|
18
|
+
</lifecycle>
|
19
|
+
-->
|
20
|
+
|
21
|
+
<application>
|
22
|
+
<action-listener>org.crank.crud.jsf.support.JsfMessageActionListener</action-listener>
|
23
|
+
<variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
|
24
|
+
<message-bundle>messages</message-bundle>
|
25
|
+
</application>
|
26
|
+
|
27
|
+
<!--
|
28
|
+
<component>
|
29
|
+
<component-type>org.crank.javax.faces.SelectOne</component-type>
|
30
|
+
<component-class>org.crank.javax.faces.component.UISelectOne</component-class>
|
31
|
+
</component>
|
32
|
+
<render-kit>
|
33
|
+
<renderer>
|
34
|
+
<component-family>javax.faces.SelectOne</component-family>
|
35
|
+
<renderer-type>org.crank.javax.faces.Listbox</renderer-type>
|
36
|
+
<renderer-class>
|
37
|
+
org.crank.javax.faces.component.ListboxRenderer
|
38
|
+
</renderer-class>
|
39
|
+
</renderer>
|
40
|
+
|
41
|
+
</render-kit>
|
42
|
+
-->
|
43
|
+
|
44
|
+
<navigation-rule>
|
45
|
+
<navigation-case>
|
46
|
+
<from-outcome>HOME</from-outcome>
|
47
|
+
<to-view-id>/pages/Home.xhtml</to-view-id>
|
48
|
+
</navigation-case>
|
49
|
+
</navigation-rule>
|
50
|
+
END
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
def crank_faces_footer
|
55
|
+
if context[:crankXmdaNav]
|
56
|
+
write <<END
|
57
|
+
<navigation-rule>
|
58
|
+
<from-view-id>/pages/crud/*</from-view-id>
|
59
|
+
<navigation-case>
|
60
|
+
<from-outcome>LISTING</from-outcome>
|
61
|
+
<to-view-id>\#{%sCrudProxy.crudViewHandler.calculateListingViewId}</to-view-id>
|
62
|
+
</navigation-case>
|
63
|
+
<navigation-case>
|
64
|
+
<from-outcome>FORM</from-outcome>
|
65
|
+
<to-view-id>\#{%sCrudProxy.crudViewHandler.calculateFormViewId}</to-view-id>
|
66
|
+
</navigation-case>
|
67
|
+
</navigation-rule>
|
68
|
+
END
|
69
|
+
end
|
70
|
+
write <<END
|
71
|
+
|
72
|
+
</faces-config>
|
73
|
+
END
|
74
|
+
end
|
75
|
+
|
76
|
+
def crank_faces_crankbean
|
77
|
+
eachCrankBean.each { |c|
|
78
|
+
write <<BEAN
|
79
|
+
<navigation-rule>
|
80
|
+
<navigation-case>
|
81
|
+
<from-outcome>#{c.java_Name.upcase}</from-outcome>
|
82
|
+
<to-view-id>/pages/crud/#{c.java_Name}/Listing.xhtml</to-view-id>
|
83
|
+
</navigation-case>
|
84
|
+
</navigation-rule>
|
85
|
+
|
86
|
+
<navigation-rule>
|
87
|
+
<navigation-case>
|
88
|
+
<from-outcome>#{c.java_Name.upcase}_FORM</from-outcome>
|
89
|
+
<to-view-id>/pages/crud/#{c.java_Name}/Form.xhtml</to-view-id>
|
90
|
+
</navigation-case>
|
91
|
+
</navigation-rule>
|
92
|
+
|
93
|
+
BEAN
|
94
|
+
if !context[:crankXmdaNav]
|
95
|
+
write <<BEAN
|
96
|
+
<navigation-rule>
|
97
|
+
<from-view-id>/pages/crud/#{c.java_Name}/*</from-view-id>
|
98
|
+
<navigation-case>
|
99
|
+
<from-outcome>LISTING</from-outcome>
|
100
|
+
<to-view-id>/pages/crud/#{c.java_Name}/Listing.xhtml</to-view-id>
|
101
|
+
</navigation-case>
|
102
|
+
<navigation-case>
|
103
|
+
<from-outcome>FORM</from-outcome>
|
104
|
+
<to-view-id>/pages/crud/#{c.java_Name}/Form.xhtml</to-view-id>
|
105
|
+
</navigation-case>
|
106
|
+
</navigation-rule>
|
107
|
+
|
108
|
+
BEAN
|
109
|
+
end
|
110
|
+
}
|
111
|
+
end
|
112
|
+
|
113
|
+
end
|