Skip to content

Commit 3a5d384

Browse files
authored
Merge pull request #8 from mendix/Get-Attributes-as-list
Added getmember values by list functions
2 parents 44a10a5 + 82e06f7 commit 3a5d384

16 files changed

+432
-0
lines changed

src/ObjectHandling/GPUCache/data_0

44 KB
Binary file not shown.

src/ObjectHandling/GPUCache/data_1

264 KB
Binary file not shown.

src/ObjectHandling/GPUCache/data_2

8 KB
Binary file not shown.

src/ObjectHandling/GPUCache/data_3

4.01 MB
Binary file not shown.

src/ObjectHandling/GPUCache/index

256 KB
Binary file not shown.

src/ObjectHandling/ObjectHandling.mpr

28 KB
Binary file not shown.
8.54 MB
Binary file not shown.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// This file was generated by Mendix Studio Pro.
2+
//
3+
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
5+
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
7+
// Other code you write will be lost the next time you deploy the project.
8+
// Special characters, e.g., é, ö, à, etc. are supported in comments.
9+
10+
package metamodel.actions;
11+
12+
import java.util.ArrayList;
13+
import com.mendix.core.Core;
14+
import com.mendix.systemwideinterfaces.core.IContext;
15+
import com.mendix.webui.CustomJavaAction;
16+
import metamodel.proxies.Entity;
17+
import com.mendix.systemwideinterfaces.core.IMendixObject;
18+
import com.mendix.systemwideinterfaces.core.meta.IMetaObject;
19+
20+
public class GetAllEntityNames extends CustomJavaAction<java.util.List<IMendixObject>>
21+
{
22+
public GetAllEntityNames(IContext context)
23+
{
24+
super(context);
25+
}
26+
27+
@java.lang.Override
28+
public java.util.List<IMendixObject> executeAction() throws Exception
29+
{
30+
// BEGIN USER CODE
31+
ArrayList<IMendixObject> result = new ArrayList<IMendixObject>();
32+
for(IMetaObject metaObject : Core.getMetaObjects())
33+
{
34+
IMendixObject entity = Core.instantiate(getContext(), Entity.getType());
35+
entity.setValue(getContext(), Entity.MemberNames.CompleteName.toString(), metaObject.getName());
36+
result.add(entity);
37+
}
38+
return result;
39+
// END USER CODE
40+
}
41+
42+
/**
43+
* Returns a string representation of this action
44+
*/
45+
@java.lang.Override
46+
public java.lang.String toString()
47+
{
48+
return "GetAllEntityNames";
49+
}
50+
51+
// BEGIN EXTRA CODE
52+
// END EXTRA CODE
53+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// This file was generated by Mendix Studio Pro.
2+
//
3+
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
5+
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
7+
// Other code you write will be lost the next time you deploy the project.
8+
// Special characters, e.g., é, ö, à, etc. are supported in comments.
9+
10+
package metamodel.actions;
11+
12+
import java.util.ArrayList;
13+
import com.mendix.core.Core;
14+
import com.mendix.systemwideinterfaces.core.IContext;
15+
import com.mendix.webui.CustomJavaAction;
16+
import metamodel.proxies.Association;
17+
import com.mendix.systemwideinterfaces.core.IMendixObject;
18+
import com.mendix.systemwideinterfaces.core.meta.IMetaAssociation;
19+
import com.mendix.systemwideinterfaces.core.meta.IMetaObject;
20+
21+
public class GetAssociationsOfEntity extends CustomJavaAction<java.util.List<IMendixObject>>
22+
{
23+
private java.lang.String entityName;
24+
25+
public GetAssociationsOfEntity(IContext context, java.lang.String entityName)
26+
{
27+
super(context);
28+
this.entityName = entityName;
29+
}
30+
31+
@java.lang.Override
32+
public java.util.List<IMendixObject> executeAction() throws Exception
33+
{
34+
// BEGIN USER CODE
35+
IMetaObject metaObject = Core.getMetaObject(entityName);
36+
if (metaObject==null) return null;
37+
ArrayList<IMendixObject> result = new ArrayList<IMendixObject>();
38+
for(IMetaAssociation metaAssoc : metaObject.getMetaAssociationsParent())
39+
{
40+
IMendixObject assoc = Core.instantiate(getContext(), Association.getType());
41+
assoc.setValue(getContext(), Association.MemberNames.CompleteName.toString(), metaAssoc.getName());
42+
assoc.setValue(getContext(), Association.MemberNames.TargetEntityName.toString(), metaAssoc.getChild().getName());
43+
result.add(assoc);
44+
}
45+
return result;
46+
// END USER CODE
47+
}
48+
49+
/**
50+
* Returns a string representation of this action
51+
*/
52+
@java.lang.Override
53+
public java.lang.String toString()
54+
{
55+
return "GetAssociationsOfEntity";
56+
}
57+
58+
// BEGIN EXTRA CODE
59+
// END EXTRA CODE
60+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// This file was generated by Mendix Studio Pro.
2+
//
3+
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
5+
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
7+
// Other code you write will be lost the next time you deploy the project.
8+
// Special characters, e.g., é, ö, à, etc. are supported in comments.
9+
10+
package metamodel.actions;
11+
12+
import java.util.ArrayList;
13+
import com.mendix.core.Core;
14+
import com.mendix.systemwideinterfaces.core.IContext;
15+
import com.mendix.webui.CustomJavaAction;
16+
import metamodel.proxies.Attribute;
17+
import com.mendix.systemwideinterfaces.core.IMendixObject;
18+
import com.mendix.systemwideinterfaces.core.meta.IMetaObject;
19+
import com.mendix.systemwideinterfaces.core.meta.IMetaPrimitive;
20+
21+
public class GetAttributesOfEntity extends CustomJavaAction<java.util.List<IMendixObject>>
22+
{
23+
private java.lang.String entityName;
24+
25+
public GetAttributesOfEntity(IContext context, java.lang.String entityName)
26+
{
27+
super(context);
28+
this.entityName = entityName;
29+
}
30+
31+
@java.lang.Override
32+
public java.util.List<IMendixObject> executeAction() throws Exception
33+
{
34+
// BEGIN USER CODE
35+
IMetaObject metaObject = Core.getMetaObject(entityName);
36+
if (metaObject==null) return null;
37+
ArrayList<IMendixObject> result = new ArrayList<IMendixObject>();
38+
for(IMetaPrimitive metaPrim : metaObject.getMetaPrimitives())
39+
{
40+
IMendixObject attribute = Core.instantiate(getContext(), Attribute.getType());
41+
attribute.setValue(getContext(), Attribute.MemberNames.AttributeName.toString(), metaPrim.getName());
42+
attribute.setValue(getContext(), Attribute.MemberNames.AttributeType.toString(), metaPrim.getType().toString());
43+
result.add(attribute);
44+
}
45+
return result;
46+
// END USER CODE
47+
}
48+
49+
/**
50+
* Returns a string representation of this action
51+
*/
52+
@java.lang.Override
53+
public java.lang.String toString()
54+
{
55+
return "GetAttributesOfEntity";
56+
}
57+
58+
// BEGIN EXTRA CODE
59+
// END EXTRA CODE
60+
}

0 commit comments

Comments
 (0)