Skip to content

Commit

Permalink
update 18 to fix issue #423
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobuzzi committed Jul 22, 2021
1 parent 1511038 commit 600e07c
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
other
newOn: anOrbeonSystemRoot

^self new setRoot: anOrbeonSystemRoot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ getAllOrbeonApplications
| dbApplicationsNames |

dbApplicationsNames := (self getAllApplicationsName subStrings: String lf) "a collection of strings with App names"
reject: [:each | self getOrbeonApplicationClass hasApplicationNamed: each]. "we filter existing app"
reject: [:each | systemRoot hasApplicationNamed: each]. "we filter existing app"

^(dbApplicationsNames collect: [:eachName | self getOrbeonApplicationClass getExistingApplicationOrCreateNewNamed: eachName]) "we create a new app for each new row"
^(dbApplicationsNames collect: [:eachName | systemRoot getExistingApplicationOrCreateNewNamed: eachName]) "we create a new app for each new row"
asSortedCollection: [:a :b | a applicationName <= b applicationName]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ getIdForDefinition: anOrbeonFormDefinition

"<anOrbeonFormDefinition> has previous version --> we get the [id] from stored definitions"

^(self getOrbeonApplicationClass formDefinitionNamed: anOrbeonFormDefinition formName in: anOrbeonFormDefinition applicationName) id
^(systemRoot formDefinitionNamed: anOrbeonFormDefinition formName in: anOrbeonFormDefinition applicationName) id
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ migrateFormDefinitionNamed: aString version: version in: applicationName
savedDefinition setMetadata.
definition definition: savedDefinition.
savedDefinition definition: definition.
app := self getOrbeonApplicationClass applicationNamed: applicationName.
app := systemRoot applicationNamed: applicationName.
savedDefinition storeInApplication.
definition storeInApplication.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
private
setRoot: anOrbeonSystemRoot

systemRoot := anOrbeonSystemRoot
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ updateFormDefinitionNamed: form app: app version: version from: stringTimeStamp
5. If NOT necesary then update the existing one"
| application currentDefinition savedDefinition newDefinition comparator shouldCreateAnotherVersion |

application := self getOrbeonApplicationClass getExistingApplicationOrCreateNewNamed: app.
currentDefinition := self getOrbeonApplicationClass getLastPublishedDefinitionNamed: form fromApplicationNamed: app withVersion: (Integer fromString: version) ifNone: [nil].
application := systemRoot getExistingApplicationOrCreateNewNamed: app.
currentDefinition := systemRoot getLastPublishedDefinitionNamed: form fromApplicationNamed: app withVersion: (Integer fromString: version) ifNone: [nil].
savedDefinition := self importFormDefinitionNamed: form version: version in: app from: stringTimeStamp.
newDefinition := savedDefinition definition.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"class" : {
"defaultDatabaseReaderClass" : "brunobb 03/16/2020 14:17" },
"defaultDatabaseReaderClass" : "brunobb 03/16/2020 14:17",
"newOn:" : "brunobb 07/22/2021 14:29" },
"instance" : {
"defaultDatabaseReaderClass" : "brunobb 03/16/2020 14:17",
"execute:" : "brunobb 03/16/2020 13:37",
Expand All @@ -13,14 +14,14 @@
"getAllApplicationsName" : "brunobb 03/16/2020 13:39",
"getAllDocumentIdsForDefinition:" : "brunobb 03/16/2020 13:42",
"getAllFormsDefinitionNameOf:" : "brunobb 03/17/2020 06:10",
"getAllOrbeonApplications" : "brunobb 03/16/2020 13:39",
"getAllOrbeonApplications" : "brunobb 07/22/2021 14:31",
"getAllVersionsNumberOf:in:" : "brunobb 03/16/2020 13:46",
"getApplicationDefinitionVersionOf:" : "brunobb 03/16/2020 13:42",
"getDBStringForInstanceDefinitionWithId:" : "brunobb 03/16/2020 13:46",
"getDBStringForInstanceDefinitionWithId:version:" : "brunobb 03/16/2020 13:46",
"getDefinitionAttachmentContentFor:version:" : "brunobb 03/16/2020 13:38",
"getFormWithId:" : "brunobb 03/16/2020 13:39",
"getIdForDefinition:" : "brunobb 03/16/2020 13:42",
"getIdForDefinition:" : "brunobb 07/22/2021 14:31",
"getLastUpdateOf:in:version:" : "brunobb 03/17/2020 10:19",
"getOldTimeStamp" : "brunobb 03/17/2020 10:24",
"importAllFormInstancesOf:" : "brunobb 04/26/2021 14:14",
Expand All @@ -33,11 +34,12 @@
"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:" : "bruno 07/19/2020 14:35",
"migrateFormDefinitionNamed:version:in:" : "brunobb 07/22/2021 14:31",
"migrateInstanceAttachmentsOf:" : "brunobb 06/11/2020 14:34",
"migrateInstanceAttachmentsOf:from:" : "brunobb 07/16/2020 14:06",
"migrateInstancesOf:version:from:" : "brunobb 03/24/2020 14:06",
"setDatabaseIP:user:password:" : "brunobb 03/16/2020 13:37",
"setRoot:" : "brunobb 07/22/2021 14:29",
"sqlReader:" : "brunobb 03/16/2020 13:34",
"updateFormDefinitionNamed:app:version:" : "brunobb 03/20/2020 16:09",
"updateFormDefinitionNamed:app:version:from:" : "brunobb 04/16/2021 08:34" } }
"updateFormDefinitionNamed:app:version:from:" : "brunobb 07/22/2021 14:31" } }
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
],
"commentStamp" : "",
"instvars" : [
"sqlReader" ],
"sqlReader",
"systemRoot" ],
"name" : "OrbeonDatabaseMigrator",
"pools" : [
],
Expand Down

Large diffs are not rendered by default.

0 comments on commit 600e07c

Please sign in to comment.