Skip to content

Commit

Permalink
update 29 to fix issue #423
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobuzzi committed Jul 30, 2021
1 parent 0f61f3e commit 18af96a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
generate orbeon objects
generateFormDefinition: formName app: appName from: dbArray
"Create a new definition of the Form based on <dbArray>"
| formDefinition |
| formDefinition xmlString builder |

formDefinition := self defaultSavedFormDefinitionClass newNamed: formName inAppNamed: appName.
formDefinition := self defaultSavedFormDefinitionClass newNamed: formName in: (systemRoot getExistingApplicationOrCreateNewNamed: appName).

formDefinition updateFrom: dbArray.

formDefinition setXmlString: ((dbArray at: 8) copyReplaceAll: '\n' with: Character lf). "-\n- is inserted by Bash "

xmlString := ((dbArray at: 8) copyReplaceAll: '\n' with: Character lf). "-\n- is inserted by Bash "
formDefinition setXmlString: xmlString.

builder := systemRoot newFormBuilderFor: xmlString.

formDefinition setTitleAndDescriptionWith: builder.

^formDefinition
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
generate orbeon objects
generateFormInstanceDefinition: formName app: appName from: aDBString
"Create a new instance of the Form based on <dbArray>"
| instance resultArray |
| instance resultArray xmlString builder |

resultArray := aDBString subStrings: String tab.
instance := self defaultSavedFormDefinitionClass new.
^instance setApplication: appName;
formName: formName;
xmlString := ((resultArray at: 7) copyReplaceAll: '\n' with: Character lf). "-\n- is inserted by Bash "
builder := systemRoot newFormBuilderFor: xmlString.

instance := self defaultSavedFormDefinitionClass newNamed: formName in: (systemRoot getExistingApplicationOrCreateNewNamed: appName).
^instance
updateFrom: resultArray;
xmlString: ((resultArray at: 7) copyReplaceAll: '\n' with: Character lf); "-\n- is inserted by Bash "
"setApplicationAndFormName;"
setMetadata;
xmlString: xmlString;
setTitleAndDescriptionWith: builder;
yourself.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ migrateFormDefinitionNamed: aString version: version in: applicationName
| definition savedDefinition dbString app |

definition := self importFormDefinitionNamed: aString version: version in: applicationName.
definition setMetadata.
dbString := self getDBStringForInstanceDefinitionWithId: definition id version: version.
"it could be a form definition with version = 2, but NO form instance definition with version 2 (it was never save after being published) --> we get the last"
dbString isEmpty ifTrue: [dbString := self getDBStringForInstanceDefinitionWithId: definition id].

savedDefinition := self generateFormInstanceDefinition: aString app: applicationName from: dbString.
savedDefinition setMetadata.
definition definition: savedDefinition.
savedDefinition definition: definition.
app := systemRoot applicationNamed: applicationName.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"execute:" : "brunobb 03/16/2020 13:37",
"fileoutDefinitionAttachmentOn:defintionId:fileId:version:" : "brunobb 05/28/2020 11:29",
"fileoutInstanceAttachmentOn:defintionId:fileId:version:" : "brunobb 03/16/2020 13:38",
"generateFormDefinition:app:from:" : "brunobb 04/27/2021 13:08",
"generateFormInstanceDefinition:app:from:" : "brunobb 04/27/2021 13:08",
"generateFormDefinition:app:from:" : "brunobb 07/29/2021 14:08",
"generateFormInstanceDefinition:app:from:" : "brunobb 07/29/2021 14:05",
"generateFormInstanceOf:from:" : "brunobb 03/16/2020 13:41",
"getAllApplicationDefinitionVersionFromDB" : "brunobb 03/16/2020 13:41",
"getAllApplicationsName" : "brunobb 03/16/2020 13:39",
Expand All @@ -34,7 +34,7 @@
"migrateDefinitionAttachmentsOf:" : "brunobb 08/14/2020 10:32",
"migrateDefinitionCustomAttachmentOf:" : "brunobb 08/17/2020 11:11",
"migrateFormDefinitionNamed:in:" : "brunobb 03/17/2020 05:49",
"migrateFormDefinitionNamed:version:in:" : "brunobb 07/22/2021 14:31",
"migrateFormDefinitionNamed:version:in:" : "brunobb 07/29/2021 14:09",
"migrateInstanceAttachmentsOf:" : "brunobb 06/11/2020 14:34",
"migrateInstanceAttachmentsOf:from:" : "brunobb 07/16/2020 14:06",
"migrateInstancesOf:version:from:" : "brunobb 03/24/2020 14:06",
Expand Down
Loading

0 comments on commit 18af96a

Please sign in to comment.