Changes for page ClassEditSheet
Last modified by Richard Johnson on 2021/05/07 19:19
Change comment:
Install extension [org.xwiki.platform:xwiki-platform-appwithinminutes-ui/13.3]
Summary
Details
- Page properties
-
- Content
-
... ... @@ -97,6 +97,7 @@ 97 97 #set ($fieldURL = $doc.getURL('edit', $escapetool.url({ 98 98 'xpage': 'plain', 99 99 'sheet': 'AppWithinMinutes.ClassEditSheet', 100 + 'template': 'AppWithinMinutes.ClassTemplate', 100 100 'field': $formFieldDoc.fullName, 101 101 'xeditmode': 'text' 102 102 }))) ... ... @@ -291,12 +291,18 @@ 291 291 #** 292 292 * Displays the input used to edit the specified property of the given object. The given object can be either an 293 293 * instance of an XWiki class or a class field. In the first case the property represents an object field and in the 294 - * second case the property represents a field meta property. 295 + * second case the property represents a field meta property. We currently don't use custom display for metaproperty, 296 + * so in that case we fallback on displayEdit. 295 295 *# 296 296 #macro (displayPropertyEditInput $property $prefix $object) 297 297 #set ($wrappedProperty = $property.propertyClass) 298 298 #if ($wrappedProperty.isCustomDisplayed($xcontext.context)) 299 - $xcontext.get('propertyCustomDisplayer').display($property, $prefix, $object) 301 + #set ($customDisplayer = $!xcontext.get('propertyCustomDisplayer').display($property, $prefix, $object)) 302 + #if ((! $customDisplayer) && ("$!customDisplayer" == "")) 303 + $doc.displayEdit($property, $prefix, $object) 304 + #else 305 + $customDisplayer 306 + #end 300 300 #else 301 301 $doc.displayEdit($property, $prefix, $object) 302 302 #end ... ... @@ -381,6 +381,7 @@ 381 381 * Display the edit class form. 382 382 *# 383 383 #macro (displayEditForm) 391 + #set ($discard = $xwiki.jsfx.use('js/scriptaculous/effects.js')) 384 384 #set ($discard = $xwiki.jsfx.use('js/scriptaculous/dragdrop.js')) 385 385 #set ($discard = $xwiki.jsx.use('AppWithinMinutes.ClassEditSheet')) 386 386 #set ($discard = $xwiki.ssx.use('AppWithinMinutes.ClassEditSheet')) ... ... @@ -431,10 +431,7 @@ 431 431 #try() 432 432 #set ($discard = $copyAsJob.join()) 433 433 #set ($copyAsJobStatus = $services.job.getJobStatus($copyAsJob.request.id)) 434 - #set ($errorLogs = $copyAsJobStatus.log.getLogs('ERROR')) 435 - #if ($errorLogs.size() > 0) 436 - #set ($errorMessage = $errorLogs.get(0).toString()) 437 - #end 442 + #set ($errorMessage = $copyAsJobStatus.logTail.getFirstLogEvent('ERROR').toString()) 438 438 #end 439 439 #end 440 440 #end ... ... @@ -614,6 +614,10 @@ 614 614 #set($discard = $sheetDoc.setParent($doc.documentReference.name)) 615 615 #set($discard = $sheetDoc.setContent($doc.getRenderedContent($sheetGeneratorDoc.content, 616 616 $sheetGeneratorDoc.syntax.toIdString(), 'plain/1.0'))) 622 + ## We assume for now that the output produced by the sheet generator uses the same syntax as the code of the sheet 623 + ## generator. We have to set the syntax because the default wiki syntax (used when creating new wiki pages) could 624 + ## be different than the one used by the sheet generator. 625 + #set($discard = $sheetDoc.setSyntax($sheetGeneratorDoc.syntax)) 617 617 #set($discard = $sheetDoc.setHidden(true)) 618 618 #set($discard = $sheetDoc.save($services.localization.render('platform.appwithinminutes.classEditorSheetSaveComment'), 619 619 $minorEdit)) ... ... @@ -639,6 +639,7 @@ 639 639 #set($translationsGeneratorDoc = $xwiki.getDocument('AppWithinMinutes.ClassTranslationsGenerator')) 640 640 #set($discard = $translationsDoc.setContent($doc.getRenderedContent($translationsGeneratorDoc.content, 641 641 $translationsGeneratorDoc.syntax.toIdString(), 'plain/1.0'))) 651 + #set($discard = $translationsDoc.setSyntaxId('plain/1.0')) 642 642 #set($discard = $translationsDoc.setHidden(true)) 643 643 #set($discard = $translationsDoc.save( 644 644 $services.localization.render('platform.appwithinminutes.classEditorTranslationsSaveComment'),