ontomde-uml2-java 1.0.4 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
|
-
require 'hoe'
|
4
|
+
require 'ontomde-hoe'
|
5
5
|
require './lib/ontomde-uml2-java/version.rb'
|
6
6
|
|
7
|
-
|
7
|
+
OntomdeHoe.new('ontomde-uml2-java', Ontomde::Uml2::Java::VERSION) do |p|
|
8
8
|
p.rubyforge_name = 'ontomde'
|
9
9
|
p.author = 'Stephane (Pierre) Carrie'
|
10
10
|
p.email = 'stephanepierre.carrie -nospam- @orange-ftgroup.com'
|
@@ -454,10 +454,10 @@ END
|
|
454
454
|
# 1<->*
|
455
455
|
write <<END
|
456
456
|
/* TPL:0016 */
|
457
|
-
if(#{
|
458
|
-
#{oa.uml_type_one.java_qualifiedName} previous=#{
|
459
|
-
|
460
|
-
#{
|
457
|
+
if(#{oa.java_NameProperty}!=null && #{oa.java_NameProperty}.equals(#{getterParameterName(oa)})) { return ;}
|
458
|
+
#{oa.uml_type_one.java_qualifiedName} previous=#{oa.java_NameProperty};
|
459
|
+
|
460
|
+
#{oa.java_NameProperty}=null;
|
461
461
|
if(previous!=null) { previous.remove#{oe.java_NameBean}(this); }
|
462
462
|
|
463
463
|
#{java_this(oa)}#{oa.java_NameProperty}=#{getterParameterName(oa)};
|
@@ -114,7 +114,8 @@ module Muml_Operation
|
|
114
114
|
p.uml_ownedComment.each { |comment|
|
115
115
|
c="#{c} #{comment.uml_body_one}"
|
116
116
|
}
|
117
|
-
|
117
|
+
c=" self-explanatory"
|
118
|
+
#next if c.empty? && p.uml_direction_one.isReturn?
|
118
119
|
"#{p.uml_direction_one.isReturn? ? %{@return} : %{@param}} #{p.java_Name unless p.uml_direction_one.isReturn?}#{c}".java_writeJavadoc(self)
|
119
120
|
}
|
120
121
|
|
@@ -32,6 +32,7 @@ module Mrdf_Model
|
|
32
32
|
cn="#{c.java_qualifiedName}.class"
|
33
33
|
c.uml_ownedOperation.each {|op|
|
34
34
|
next unless op.umlx_businessMethod?
|
35
|
+
next unless op.umlx_isSecured?
|
35
36
|
#operation was generated from an interface
|
36
37
|
next if (!op.umlx_redefinesMethod.empty?) && (!op.umlx_redefinesMethod_one.umlx_owner_one.kind_of?(Muml_Interface))
|
37
38
|
lit=e.umlx_createAndAddLiteral("#{op.umlx_owner_one.java_qualifiedName}_#{op.java_Name}")
|
@@ -77,16 +78,38 @@ END
|
|
77
78
|
|
78
79
|
end
|
79
80
|
|
81
|
+
#JAVA_GLOBAL_ACCESS_CONTROL_ENUM="xmda .security.StaticSecurityRole"
|
82
|
+
#Enumerated containing the list of all access control criteria
|
83
|
+
JAVA_GLOBAL_ACCESS_CONTROL_ENUM="xmda.security.GlobalComputedAccessControlCriteria"
|
84
|
+
JAVA_GLOBAL_ACCESS_CONTROL_ENUM_COMMENT=<<ENDHELP
|
85
|
+
This enum contains a list of all computed access control criteria.
|
86
|
+
|
87
|
+
Generic examples of access control:
|
88
|
+
* userIsManagerForThisObject
|
89
|
+
* userOwnsThisObject
|
90
|
+
* userIsOnDuty
|
91
|
+
|
92
|
+
AccessControl criteria are computed in the context of one class instance of the model and one user. (ex: User Martin accessing contract number 3003).
|
93
|
+
|
94
|
+
Some criteria migth not need to know what object is beeing accessed (example: userIsOnDuty). Some other will need to know what object is access (Is martin a manager for contract 42000 ?, Does Martin owns product number 13239 ?)
|
95
|
+
|
96
|
+
This list is defined at design time because these rules criteria are implemented usign an algorithm (model query, date computation, ...) that require some coding and optimisation at developpement time. It is however possible to add RESERVED elements for future extension (RESERVED1, RESERVED2, ...).
|
97
|
+
ENDHELP
|
98
|
+
|
99
|
+
|
80
100
|
#model may contain several enumeration of roles stereotypes staticSecurityRole
|
81
101
|
#For implementation use, an enumeration containing every roles is generated.
|
82
102
|
#Role container name could be appended to role name but it is not because it
|
83
103
|
#would make code refactoring more complex.
|
84
104
|
#As a consequence, role name should be unique application wide.
|
85
105
|
def umlx_generateStaticSecurityRoleEnum
|
86
|
-
e=umlx_reserved_model.umlx_getOrCreateEnumeration(
|
106
|
+
e=umlx_reserved_model.umlx_getOrCreateEnumeration(JAVA_GLOBAL_ACCESS_CONTROL_ENUM,Muml_Classifier::UMLX_SEARCH_EVERY_MODEL)
|
107
|
+
e.umlx_createAndAddComment("#{e.rdf_uri}_comment",JAVA_GLOBAL_ACCESS_CONTROL_ENUM_COMMENT) if e.uml_ownedComment.empty?
|
108
|
+
|
87
109
|
self.each_value { |v|
|
88
110
|
next unless v.kind_of?(Muml_Enumeration)
|
89
|
-
next unless v.umlx_hasStereotype?("staticSecurityRole")
|
111
|
+
#next unless v.umlx_hasStereotype?("staticSecurityRole")
|
112
|
+
next unless v.umlx_hasStereotype?("ComputedAccessControlCriteria")
|
90
113
|
v.uml_ownedLiteral.each {|c|
|
91
114
|
#role name should be unique
|
92
115
|
e.umlx_createAndAddLiteral(c.to_s)
|
@@ -209,15 +232,15 @@ ENDHELP
|
|
209
232
|
#method default implementation
|
210
233
|
JAVA_GETSTATIC_ROLE_CODE=<<ENDROLECODE
|
211
234
|
//return empty list (every static role are denied)
|
212
|
-
return new java.util.HashSet
|
235
|
+
return new java.util.HashSet<#{Mrdf_Model::JAVA_GLOBAL_ACCESS_CONTROL_ENUM}>();
|
213
236
|
ENDROLECODE
|
214
237
|
|
215
238
|
#public List<SecurityRole> getStaticRoles(org.acegi.security.UserDetails userName
|
216
239
|
def umlx_addGetStaticRoleOperation!
|
217
|
-
m=self.umlx_createAndAddOperation("#{rdf_uri}
|
240
|
+
m=self.umlx_createAndAddOperation("#{rdf_uri}_getComputedAccessControlGrant","getComputedAccessControlGrant")
|
218
241
|
|
219
242
|
r=m.umlx_createAndAddReturnParameter("#{m.rdf_uri}_return")
|
220
|
-
r.uml_type=umlx_reserved_model.umlx_getOrCreateEnumeration(
|
243
|
+
r.uml_type=umlx_reserved_model.umlx_getOrCreateEnumeration(Mrdf_Model::JAVA_GLOBAL_ACCESS_CONTROL_ENUM,Muml_Classifier::UMLX_SEARCH_EVERY_MODEL)
|
221
244
|
r.uml_upperValue=umlx_literal(-1)
|
222
245
|
r.umlx_createAndAddComment("#{r.rdf_uri}_c1",JAVA_GETSTATIC_ROLE_COMMENT)
|
223
246
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ontomde-uml2-java
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephane (Pierre) Carrie
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-03-
|
12
|
+
date: 2008-03-25 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -19,16 +19,7 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - "="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 1.0.
|
23
|
-
version:
|
24
|
-
- !ruby/object:Gem::Dependency
|
25
|
-
name: hoe
|
26
|
-
version_requirement:
|
27
|
-
version_requirements: !ruby/object:Gem::Requirement
|
28
|
-
requirements:
|
29
|
-
- - ">="
|
30
|
-
- !ruby/object:Gem::Version
|
31
|
-
version: 1.5.0
|
22
|
+
version: 1.0.6
|
32
23
|
version:
|
33
24
|
description: "ontomde-uml2-java is a full-featured UML2 to Java5 code generator library. This library is meant to be used trough a command line wrapper available in ontomde-uml2-javaFrontEnd gem. A sample raw UML2 source model is available here: http://ontomde.rubyforge.org/website/demo/java5/index.html. This model is included in a running demonstration available from this page: http://ontomde.rubyforge.org/website/demonstration.html == FEATURES/PROBLEMS: Managed class modifiers * interface implements * single class inheritance * attribute * association * method * inner class"
|
34
25
|
email: stephanepierre.carrie -nospam- @orange-ftgroup.com
|