Skip to content

Commit

Permalink
update 19 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 600e07c commit 7f992a9
Show file tree
Hide file tree
Showing 64 changed files with 63 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ doIt
https://doc.orbeon.com/form-runner/api/persistence/forms-metadata.html#returning-all-form-definition-versions"
| application |

application := self getOrbeonApplicationClass applicationNamed: self getApplicationName ifNone: [^'<form/>'].
application := systemRoot applicationNamed: self getApplicationName ifNone: [^'<form/>'].

((application hasRegistryForFormNamed: self getFormName) not and: [self getFormName notNil]) ifTrue: [^'<form/>'].

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"instance" : {
"allforms:" : "brunobb 07/04/2019 03:43",
"allversions:" : "brunobb 02/16/2018 13:20",
"doIt" : "brunobb 04/22/2021 09:59",
"doIt" : "brunobb 07/22/2021 13:20",
"generateXmlNodeForFormBuilderVersionList:with:" : "brunobb 04/22/2021 10:17",
"generateXmlWithAllFormDefinitionsIn:" : "brunobb 04/22/2021 09:52",
"generateXmlWithLatestFormDefinitionVersionIn:" : "brunobb 04/22/2021 09:50" } }
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ doItAndSetVersion: aBlock
This service is used in combination of #getXmlOfFormInstanceWithId:form:app: to <get> the actual data of the form"
| application orbeonDefinition instance |

application := self getOrbeonApplicationClass applicationNamed: self getApplicationName ifNone: [^self signalNoFormException].
application := systemRoot applicationNamed: self getApplicationName ifNone: [^self signalNoFormException].

instance := self getOrbeonApplicationClass getAnyInstanceWith: id formName: self getFormName in: self getApplicationName
ifNone: [self getOrbeonApplicationClass getAnyDraftWith: id formName: self getFormName in: self getApplicationName
instance := systemRoot getAnyInstanceWith: id formName: self getFormName in: self getApplicationName
ifNone: [systemRoot getAnyDraftWith: id formName: self getFormName in: self getApplicationName
ifNone: [^self signalNoFormException]].

orbeonDefinition := instance definition.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"class" : {
},
"instance" : {
"doItAndSetVersion:" : "brunobb 10/02/2020 15:05" } }
"doItAndSetVersion:" : "brunobb 07/22/2021 13:28" } }

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"class" : {
"newOn:withXml:" : "brunobb 06/04/2021 14:08",
"newWithXml:" : "brunobb 06/26/2020 15:29" },
"newOn:withXml:" : "brunobb 06/04/2021 14:08" },
"instance" : {
"doIt" : "brunobb 06/05/2020 19:54",
"generateXmlAnswerForBuilderSummary" : "BrunoBB 12/30/2016 03:27",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ifRequiredUpdateForm
At this point is SAFE to move everything to new location because an <AlreadyExistApplicationOrFormNameException> is NOT possible"
| currentIdDefinition |

currentIdDefinition := self getOrbeonApplicationClass getSavedDefinitionWithId: id ifNone: [^self].
currentIdDefinition := systemRoot getSavedDefinitionWithId: id ifNone: [^self].

((currentIdDefinition applicationName = appName) and: [currentIdDefinition formName = formName])
ifTrue: [^self]. "no change has been made to application name and form name --> no update required"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"instance" : {
"createAndStoreSavedDefinitionOnApplication" : "brunobb 03/25/2021 14:35",
"createOrbeonSavedDefinition" : "brunobb 04/27/2021 13:10",
"ifRequiredUpdateForm" : "brunobb 06/29/2020 13:15",
"ifRequiredUpdateForm" : "brunobb 07/22/2021 13:12",
"initialize" : "brunobb 02/15/2018 13:03",
"isCreationRejectedFor:" : "brunobb 06/26/2020 13:55",
"isValid" : "brunobb 02/15/2018 13:03",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ doItIfNotFound: aBlock

(self getFormName isNil or: [self getApplicationName isNil]) ifTrue: [self setApplicationAndFormNameFromXmlString].

application := self getOrbeonApplicationClass getExistingApplicationOrCreateNewNamed: appName.
application := systemRoot getExistingApplicationOrCreateNewNamed: appName.

version := (headerVersion = 'next')
ifTrue: [(application getLastFormDefinitionVersionOf: formName) + 1]
ifFalse: [Number fromString: headerVersion].

latestSavedDefinition := self getOrbeonApplicationClass getLatestSavedDefinition: formName app: appName ifNone: [nil].
latestSavedDefinition := systemRoot getLatestSavedDefinition: formName app: appName ifNone: [nil].
"is there a form definition with <formName> in application <appName> & the document_id <id> are different ???
--> if <true> --> creation NOT allowed"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
},
"instance" : {
"createPublishedDefinition" : "brunobb 04/27/2021 14:48",
"doItIfNotFound:" : "brunobb 04/16/2021 08:33",
"doItIfNotFound:" : "brunobb 07/22/2021 13:29",
"headerVersion" : "brunobb 02/15/2018 13:07",
"headerVersion:" : "brunobb 02/15/2018 13:07",
"shouldCreateAnotherVersionFor:" : "brunobb 02/15/2018 14:07" } }
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ doItIfNotFound: aBlock

(self getFormName isNil or: [self getApplicationName isNil]) ifTrue: [self setApplicationAndFormNameFromXmlString].

application := self getOrbeonApplicationClass getExistingApplicationOrCreateNewNamed: appName.
application := systemRoot getExistingApplicationOrCreateNewNamed: appName.

version := Number fromString: headerVersion.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"class" : {
},
"instance" : {
"doItIfNotFound:" : "brunobb 04/15/2021 14:48",
"doItIfNotFound:" : "brunobb 07/22/2021 13:29",
"headerVersion" : "brunobb 03/24/2021 12:01",
"headerVersion:" : "brunobb 03/24/2021 12:01" } }
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ doIt

(self getFormName isNil or: [self getApplicationName isNil]) ifTrue: [self setApplicationAndFormNameFromXmlString].

latestSavedDefinition := self getOrbeonApplicationClass getLatestSavedDefinition: self getFormName app: self getApplicationName ifNone: [nil].
version := (self getOrbeonApplicationClass getDefinitionWithId: id ifNone: [nil]) ifNil: [1] ifNotNil: [:def | def version].
latestSavedDefinition := systemRoot getLatestSavedDefinition: self getFormName app: self getApplicationName ifNone: [nil].
version := (systemRoot getDefinitionWithId: id ifNone: [nil]) ifNil: [1] ifNotNil: [:def | def version].

self ifRequiredUpdateForm. "if the <formName> or <appName> has been changed"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"class" : {
},
"instance" : {
"doIt" : "brunobb 06/04/2021 13:16" } }
"doIt" : "brunobb 07/22/2021 13:27" } }
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ other
doIt
"This method is called by Orbeon when a user click 'Delete' in a Form Definition in the Form Runner page"

^(self getOrbeonApplicationClass logicalRemoveDefinitionWithId: id ifNone: [nil]) xmlString
^(systemRoot logicalRemoveDefinitionWithId: id ifNone: [nil]) xmlString
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"class" : {
},
"instance" : {
"doIt" : "brunobb 02/18/2018 11:44" } }
"doIt" : "brunobb 07/22/2021 13:26" } }
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ doIt
The Summary then should open the Orbeon Builder with the code of the clicked form."
| definition |

definition := self getOrbeonApplicationClass getSavedDefinitionWithId: id ifNone: [^NoOrbeonFormException signal: ('No Form Definition with id:' , id)].
definition := systemRoot getSavedDefinitionWithId: id ifNone: [^NoOrbeonFormException signal: ('No Form Definition with id:' , id)].

"^self decodeFromUTF8: definition xmlString"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"class" : {
},
"instance" : {
"doIt" : "brunobb 05/10/2019 11:59" } }
"doIt" : "brunobb 07/22/2021 13:25" } }
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ streams building
buildStreamFormDefinitions
| allSavedDefinitions |

allSavedDefinitions := self getOrbeonApplicationClass getAllSavedDefinitions.
allSavedDefinitions := self systemRoot getAllSavedDefinitions.

summaryStream fetchFormDefinitionsOn: allSavedDefinitions from: self pageFrom to: self pageTo
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"class" : {
},
"instance" : {
"buildStreamFormDefinitions" : "brunobb 06/05/2020 20:01",
"buildStreamFormDefinitions" : "brunobb 07/22/2021 13:18",
"buildStreams" : "brunobb 06/05/2020 19:58",
"selectFormsDefinitionsFrom:" : "brunobb 11/24/2020 12:38" } }
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ doIt
"This method is called by Orbeon when a user click 'Delete' in a Form Instance Draft in the Form Runner page"
| application instance |

application := self getOrbeonApplicationClass applicationNamed: self getApplicationName ifNone: [^NoApplicationException signal: 'No application named [', self getApplicationName, '] was found'].
application := systemRoot applicationNamed: self getApplicationName ifNone: [^NoApplicationException signal: 'No application named [', self getApplicationName, '] was found'].
instance := application getAnyDraftWithId: id of: self getFormName.

^instance definition removeDraft: instance
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"class" : {
},
"instance" : {
"doIt" : "brunobb 04/10/2018 09:15" } }
"doIt" : "brunobb 07/22/2021 13:22" } }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
other
getInstance

^self getOrbeonApplicationClass getAnyDraftWith: id formName: self getFormName in: self getApplicationName ifNone: [^self signalNoFormException]
^systemRoot getAnyDraftWith: id formName: self getFormName in: self getApplicationName ifNone: [^self signalNoFormException]
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"class" : {
},
"instance" : {
"getInstance" : "brunobb 04/10/2018 10:28" } }
"getInstance" : "brunobb 07/22/2021 13:34" } }
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ other
doIt
| application instance |

application := self getOrbeonApplicationClass applicationNamed: self getApplicationName ifNone: [^NoApplicationException signal: 'No application named [', self getApplicationName, '] was found'].
application := systemRoot applicationNamed: self getApplicationName ifNone: [^NoApplicationException signal: 'No application named [', self getApplicationName, '] was found'].

instance := application getAnyInstanceWithId: id of: self getFormName.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"class" : {
},
"instance" : {
"doIt" : "brunobb 02/16/2018 12:33" } }
"doIt" : "brunobb 07/22/2021 13:25" } }
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ doIt
"This method is called by Orbeon when a user click 'Duplicate' in a Form Instance in the Form Runner"
| orbeonInstance application instanceDefinition |

application := self getOrbeonApplicationClass applicationNamed: self getApplicationName ifNone: [^self signalNoApplicationException: self getApplicationName].
application := systemRoot applicationNamed: self getApplicationName ifNone: [^self signalNoApplicationException: self getApplicationName].

instanceDefinition := application getDefinitionNamed: self getFormName withVersion: version ifNone: [^self signalNoFormException].

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"class" : {
},
"instance" : {
"doIt" : "brunobb 04/26/2021 14:15" } }
"doIt" : "brunobb 07/22/2021 13:24" } }
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ other
doItIfRejected: aBlock
| application instance |

application := self getOrbeonApplicationClass applicationNamed: self getApplicationName ifNone: [^NoApplicationException signal: 'No application named [', self getApplicationName, '] was found'].
application := systemRoot applicationNamed: self getApplicationName ifNone: [^NoApplicationException signal: 'No application named [', self getApplicationName, '] was found'].

instance := application getAnyInstanceWithId: id of: self getFormName.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"class" : {
},
"instance" : {
"doItIfRejected:" : "brunobb 11/19/2020 13:31",
"doItIfRejected:" : "brunobb 07/22/2021 13:33",
"setTimeoutFromString:" : "brunobb 07/04/2018 10:36",
"timeout" : "brunobb 07/04/2018 10:36",
"timeout:" : "brunobb 07/04/2018 10:36" } }
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"instance" : {
"getUsernameFromXmlString" : "brunobb 06/04/2021 13:48",
"getXmlLockUnlockRejectionFor:" : "brunobb 06/04/2021 13:48",
"initialize" : "brunobb 06/04/2021 13:45" } }
"initialize" : "brunobb 07/22/2021 13:23" } }
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ other
doItIfRejected: aBlock
| application instance |

application := self getOrbeonApplicationClass applicationNamed: self getApplicationName ifNone: [^NoApplicationException signal: 'No application named [', self getApplicationName, '] was found'].
application := systemRoot applicationNamed: self getApplicationName ifNone: [^NoApplicationException signal: 'No application named [', self getApplicationName, '] was found'].

instance := application getAnyInstanceWithId: id of: self getFormName.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"class" : {
},
"instance" : {
"doItIfRejected:" : "brunobb 06/26/2020 14:21" } }
"doItIfRejected:" : "brunobb 07/22/2021 13:33" } }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
other
getInstance

^self getOrbeonApplicationClass getAnyInstanceWith: id formName: self getFormName in: self getApplicationName ifNone: [^self signalNoFormException]
^systemRoot getAnyInstanceWith: id formName: self getFormName in: self getApplicationName ifNone: [^self signalNoFormException]
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"class" : {
},
"instance" : {
"getInstance" : "brunobb 02/17/2018 07:35" } }
"getInstance" : "brunobb 07/22/2021 13:25" } }
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ doIt
"This method is called by Orbeon when a Form is autosaved in a Form Instance page"
| application definition orbeonDraft |

application := self getOrbeonApplicationClass applicationNamed: self getApplicationName ifNone: [^self signalNoApplicationException: self getApplicationName].
application := systemRoot applicationNamed: self getApplicationName ifNone: [^self signalNoApplicationException: self getApplicationName].
definition := application getDefinitionNamed: self getFormName withVersion: version ifNone: [^self signalNoFormException].
orbeonDraft := definition getDraftWithId: id ifNone: [definition addDraft: (OrbeonFormInstance newFor: definition withId: id)].

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"class" : {
},
"instance" : {
"doIt" : "brunobb 04/21/2021 09:55" } }
"doIt" : "brunobb 07/22/2021 13:25" } }
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ other
doIt
| application definition instance |

application := self getOrbeonApplicationClass applicationNamed: self getApplicationName ifNone: [^self signalNoApplicationException: self getApplicationName].
application := systemRoot applicationNamed: self getApplicationName ifNone: [^self signalNoApplicationException: self getApplicationName].
definition := application getDefinitionNamed: self getFormName withVersion: version ifNone: [^self signalNoFormException].
instance := definition
getInstanceWithId: id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"class" : {
},
"instance" : {
"doIt" : "brunobb 04/26/2021 14:14" } }
"doIt" : "brunobb 07/22/2021 13:25" } }
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ doIt

xmlWriter := XMLWriter new.
xmlWriter writeWith: [:writer |
writer tag: 'forms' with: [self getOrbeonApplicationClass getLastDefinitions do: [:eachDef |
writer tag: 'forms' with: [systemRoot getLastDefinitions do: [:eachDef |
self getXmlNodeForRunnerHome: eachDef with: writer]].
].

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"class" : {
},
"instance" : {
"doIt" : "brunobb 07/05/2019 08:43",
"doIt" : "brunobb 07/22/2021 13:27",
"getXmlNodeForRunnerHome:with:" : "brunobb 03/19/2021 13:12" } }
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ doItIfNotFound: aBlock
It show the available -Library- forms for the application named <appName> "
| application latestDefinition |

application := self getOrbeonApplicationClass applicationNamed: self getApplicationName ifNone: [^aBlock value].
application := systemRoot applicationNamed: self getApplicationName ifNone: [^aBlock value].

version := headerValue ifNil: [application getLastFormDefinitionVersionOf: 'library'] ifNotNil: [Number fromString: headerValue].

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"class" : {
},
"instance" : {
"doItIfNotFound:" : "brunobb 06/26/2020 15:04",
"doItIfNotFound:" : "brunobb 07/22/2021 13:29",
"headerValue" : "brunobb 02/16/2018 12:45",
"headerValue:" : "brunobb 02/16/2018 12:45" } }

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"class" : {
"newOn:withXml:application:form:" : "brunobb 06/04/2021 14:11",
"newWithXml:application:form:" : "brunobb 06/26/2020 15:21" },
"newOn:withXml:application:form:" : "brunobb 06/04/2021 14:11" },
"instance" : {
"application" : "brunobb 06/08/2020 13:12",
"application:" : "brunobb 06/05/2020 14:35",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ doItAndSetVersion: setVersionBlock ifNotFound: notFoundBlock
It also called when a new Form Instance page is about to be displayed (app/form/new)"
| application latestDefinition headerVersion |

application := self getOrbeonApplicationClass
application := systemRoot
applicationNamed: self getApplicationName
ifNone: [^((appName = 'orbeon') or: [formName = 'library']) ifFalse: [notFoundBlock value] ifTrue: [self defaultLibrarySourceTemplate]].

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"class" : {
},
"instance" : {
"doItAndSetVersion:ifNotFound:" : "brunobb 03/26/2021 11:08",
"doItAndSetVersion:ifNotFound:" : "brunobb 07/22/2021 13:25",
"headerVersionValue" : "brunobb 06/04/2020 12:52",
"headerVersionValue:" : "brunobb 06/04/2020 12:52" } }
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ doIt
"This service is called when a user click on ReIndex Database.
It trigger a reindex process all indexed collections"

self getOrbeonApplicationClass getAllFormDefinitions do: [:publishedFormDefinition |
systemRoot getAllFormDefinitions do: [:publishedFormDefinition |
publishedFormDefinition rebuildAllIndexes.
].
Loading

0 comments on commit 7f992a9

Please sign in to comment.