Skip to content

Commit 019cff9

Browse files
author
Open Lowcode SAS
committed
Close #256 Close #262
Limitations to be entered in related tickets
1 parent 9f98d19 commit 019cff9

15 files changed

Lines changed: 476 additions & 73 deletions

src/org/openlowcode/client/action/CPageInlineAction.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.openlowcode.tools.structure.DataElt;
2626
import org.openlowcode.tools.structure.DataEltType;
2727
import org.openlowcode.tools.structure.MultipleChoiceDataElt;
28+
import org.openlowcode.tools.structure.ObjectIdDataElt;
2829
import org.openlowcode.tools.structure.ObjectIdDataEltType;
2930
import org.openlowcode.tools.structure.TextDataElt;
3031
import org.openlowcode.tools.structure.TextDataEltType;
@@ -110,6 +111,11 @@ public CActionData getDataContent(CPage page) {
110111
treated=true;
111112
result.addActionAttribute(new MultipleChoiceDataElt(thisbusinessdataloc.getName()));
112113
}
114+
if (thisbusinessdataloc.getType().equals("OID")) {
115+
treated=true;
116+
result.addActionAttribute(new ObjectIdDataElt(thisbusinessdataloc.getName()));
117+
}
118+
113119
if (thisbusinessdataloc.getType().startsWith("ARR")) {
114120
String subtype = thisbusinessdataloc.getType().substring(4);
115121
if (subtype.compareTo(CActionDataLoc.CHOICE_TYPE) == 0) {

src/org/openlowcode/design/action/ActionDefinition.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ public void generateToFile(SourceGenerator sg, Module module) throws IOException
11081108
String objectvariable = StringFormatter.formatForAttribute(thisobjectinarrayarg.getType());
11091109
String objectclass = StringFormatter.formatForJavaClass(thisobjectinarrayarg.getType());
11101110

1111-
sg.wl("if (attribute" + i + ".getArrayPayloadEltType() instanceof ObjectDataEltType) {");
1111+
sg.wl(" if (attribute" + i + ".getArrayPayloadEltType() instanceof ObjectDataEltType) {");
11121112
sg.wl(" ArrayList<" + objectclass + "> inputlist = new ArrayList<" + objectclass
11131113
+ ">();");
11141114
sg.wl(" for (int i=0;i<attribute" + i + ".getObjectNumber();i++) {");

src/org/openlowcode/design/data/DataAccessMethod.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class DataAccessMethod
3939
private boolean ismassive = false;
4040
private boolean allowsconsumer = false;
4141
private ObjectArgument implicitobject;
42+
private Property<?> parentproperty;
4243

4344
/**
4445
* @return true if the method accepts a query condition. This is mostly true for
@@ -168,12 +169,14 @@ public boolean isStatic() {
168169
for (int i = 0; i < this.input.getSize(); i++) {
169170
ArgumentContent thisargumentcontent = input.get(i).getContent();
170171
if (thisargumentcontent instanceof ObjectArgument) {
172+
ObjectArgument thisobjectargument = (ObjectArgument) thisargumentcontent;
173+
if (thisobjectargument.getMasterObject().equals(this.parentproperty.getParent())) {
171174
// note - may need to add a condition on the type of object
172175
this.implicitobjectmethod = input.get(i); // as argument is implicit, it will not be an attribute for
173176
// the user
174177
this.implicitobject = (ObjectArgument) thisargumentcontent;
175178
return false;
176-
179+
}
177180
}
178181
}
179182
return true;
@@ -545,4 +548,12 @@ public String generateMethodArguments(boolean securityarguments) {
545548
}
546549
return arguments.toString();
547550
}
551+
552+
public void setParentProperty(Property<?> parentproperty) {
553+
this.parentproperty = parentproperty;
554+
555+
}
556+
public Property<?> getParentProperty() {
557+
return this.parentproperty;
558+
}
548559
}

src/org/openlowcode/design/data/DataObjectDefinition.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2536,13 +2536,14 @@ private ActionDefinition generateCreateLinkAndRightObjectAction(LinkObject<?, ?>
25362536
}
25372537

25382538
private void addAttributesToCreateobject(DynamicActionDefinition action, DataObjectDefinition object) {
2539-
addAttributesToCreateobject(action, object, false);
2539+
addAttributesToCreateobject(action, object, false,true);
25402540
}
25412541

25422542
private void addAttributesToCreateobject(
25432543
DynamicActionDefinition action,
25442544
DataObjectDefinition object,
2545-
boolean objectisoptional) {
2545+
boolean objectisoptional,boolean addlinks) {
2546+
25462547
for (int i = 0; i < object.propertylist.getSize(); i++) {
25472548
Property<?> property = object.propertylist.get(i);
25482549
for (int j = 0; j < property.getContextDataForCreationSize(); j++) {
@@ -2556,7 +2557,7 @@ private void addAttributesToCreateobject(
25562557
}
25572558
}
25582559
// ---- specific processing for left for links with show as field
2559-
for (int i = 0; i < object.propertylist.getSize(); i++) {
2560+
if (addlinks) for (int i = 0; i < object.propertylist.getSize(); i++) {
25602561
Property<?> property = object.propertylist.get(i);
25612562
if (property instanceof LeftForLink) {
25622563
LeftForLink leftforlink = (LeftForLink) property;
@@ -2571,7 +2572,15 @@ private void addAttributesToCreateobject(
25712572
ObjectArgument mainobject = new ObjectArgument("object", object);
25722573
mainobject.setOptional(objectisoptional);
25732574
action.addInputArgumentAsAccessCriteria(mainobject);
2575+
25742576
}
2577+
2578+
private void addAttributesToCreateobject(
2579+
DynamicActionDefinition action,
2580+
DataObjectDefinition object,
2581+
boolean objectisoptional) {
2582+
addAttributesToCreateobject(action,object,objectisoptional,false);
2583+
}
25752584

25762585
private DynamicActionDefinition generateDuplicateAction() {
25772586
DynamicActionDefinition duplicateaction = new DynamicActionDefinition(

0 commit comments

Comments
 (0)