Skip to content

Commit fb8c183

Browse files
author
Open Lowcode SAS
committed
Close #47
1 parent 0e46525 commit fb8c183

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
import org.openlowcode.design.data.properties.basic.RightForLink;
5252
import org.openlowcode.design.data.properties.basic.Schedule;
5353
import org.openlowcode.design.data.properties.basic.SimpleTaskWorkflow;
54+
import org.openlowcode.design.data.properties.basic.StoredObject;
5455
import org.openlowcode.design.data.properties.basic.SubObject;
5556
import org.openlowcode.design.data.properties.basic.TargetDate;
5657
import org.openlowcode.design.data.properties.basic.TimeSlot;
@@ -1913,6 +1914,7 @@ public void generateAutomaticPagesAndActions(Module module) {
19131914
if (((linkobject == null) && (autolinkobject == null)) || (this.isShowActionAutomaticallyGenerated())) {
19141915
module.addAction(this.generatePrepareStandardCreateAction());
19151916
module.addAction(this.generateStandardCreateAction());
1917+
19161918
this.addActionOnObjectPage(this.generateSaveAsAction());
19171919
module.AddPage(this.generateStandardCreatePage());
19181920
}
@@ -2098,8 +2100,8 @@ private DynamicActionDefinition generateSaveAsAction() {
20982100
true);
20992101
saveasaction.addInputArgument(new ObjectIdArgument("ORIGINID", this));
21002102
saveasaction.addOutputArgument(new ObjectArgument("COPYOBJECT", this));
2101-
saveasaction.setButtonlabel("Save as");
2102-
this.addActionToCreateNewGroup(saveasaction);
2103+
saveasaction.setButtonlabel("Duplicate");
2104+
if (this.isSaveAsInCreateNewGroup()) this.addActionToCreateNewGroup(saveasaction);
21032105

21042106
return saveasaction;
21052107
}
@@ -2318,6 +2320,12 @@ public boolean isStoredobject() {
23182320
return true;
23192321
}
23202322

2323+
public boolean isSaveAsInCreateNewGroup() {
2324+
StoredObject storedobject = (StoredObject) this.getPropertyByName("STOREDOBJECT");
2325+
if (storedobject!=null) return storedobject.isSaveAsInCreateNewGroup();
2326+
return false;
2327+
}
2328+
23212329
/**
23222330
* @return true if the data object has the property Iterated
23232331
*/

src/org/openlowcode/design/data/properties/basic/StoredObject.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,32 @@ public class StoredObject
3838
Property<StoredObject> {
3939

4040
private NamedList<DynamicActionDefinition> actionsonobject;
41+
private boolean saveasincreatenewgroup;
4142

4243
/**
43-
* creates a stored object property
44+
* @return
45+
*/
46+
public boolean isSaveAsInCreateNewGroup() {
47+
return this.saveasincreatenewgroup;
48+
}
49+
50+
/**
51+
* creates a stored object property with default save-as / duplicate action
52+
* visible in create new group
4453
*/
4554
public StoredObject() {
55+
this(true);
56+
}
57+
58+
/**
59+
* creates a stored object property with specified visibility for save-as /
60+
* duplicate action
61+
*
62+
* @param saveasincreatenewgroup
63+
*/
64+
public StoredObject(boolean saveasincreatenewgroup) {
4665
super("STOREDOBJECT");
66+
this.saveasincreatenewgroup = saveasincreatenewgroup;
4767
}
4868

4969
@Override

0 commit comments

Comments
 (0)