[fix] xslt
This commit is contained in:
		
							parent
							
								
									45c736df15
								
							
						
					
					
						commit
						e78818abfb
					
				
					 23 changed files with 233 additions and 136 deletions
				
			
		|  | @ -4,6 +4,8 @@ | |||
|  : @author Andy Bunce may-2017 | ||||
|  :) | ||||
| module namespace vue-poc = 'quodatum:vue.poc'; | ||||
| import module namespace rest = "http://exquery.org/ns/restxq"; | ||||
| 
 | ||||
| declare variable $vue-poc:index:=resolve-uri ('static/' || "app.html",fn:static-base-uri() ); | ||||
| 
 | ||||
| (:~ | ||||
|  | @ -14,6 +16,8 @@ declare | |||
| function vue-poc:redirect()  | ||||
| as element(rest:response)  | ||||
| { | ||||
|   admin:write-log("Start","VUEPOC"), | ||||
|   rest:init(), | ||||
|   web:redirect("/vue-poc/ui") | ||||
| }; | ||||
| 
 | ||||
|  |  | |||
|  | @ -3,9 +3,10 @@ | |||
|  size contents to fit bottom to track window | ||||
|  --> | ||||
| <template id="qd-autoheight"> | ||||
| 	<v-flex style="height:200px;overflow:hidden;" ref="auto" v-resize="onResize" class="green"> | ||||
| 	<v-layout style="height:200px;overflow:hidden;" row wrap | ||||
| 	ref="auto" v-resize="onResize" class="green"> | ||||
| 			<slot >i will auto2</slot> | ||||
| 	</v-flex> | ||||
| 	</v-layout> | ||||
| </template> | ||||
| 
 | ||||
| <script>{ | ||||
|  |  | |||
|  | @ -20,10 +20,10 @@ | |||
|       <v-container fluid> | ||||
| <v-form ref="form" v-model="valid" lazy-validation> | ||||
|     <v-text-field | ||||
|       v-model="name" | ||||
|       :rules="nameRules" | ||||
|       v-model="message" | ||||
|        :rules="[v => !!v || 'message is required']" | ||||
|       :counter="10" | ||||
|       label="Name" | ||||
|       label="Message" | ||||
|       required | ||||
|     ></v-text-field> | ||||
|     | ||||
|  | @ -51,10 +51,9 @@ | |||
| <script>{ | ||||
|   data: () => ({ | ||||
|     valid: true, | ||||
|     name: '', | ||||
|     message: '', | ||||
|     nameRules: [ | ||||
|       v => !!v || 'Name is required', | ||||
|       v => (v && v.length <= 10) || 'Name must be less than 10 characters' | ||||
|       v => !!v || 'Message is required' | ||||
|     ], | ||||
|      | ||||
|     type: "INFO", | ||||
|  | @ -68,14 +67,18 @@ | |||
|   methods: { | ||||
|     submit () { | ||||
|       if (this.$refs.form.validate()) { | ||||
|         // Native form submission is not yet supported | ||||
|          HTTP.post("log/add",{ | ||||
|              name: this.name, | ||||
| 
 | ||||
|          var data={message: this.message, | ||||
|                type: this.type, | ||||
|              checkbox: this.checkbox | ||||
|            }) | ||||
|                checkbox: this.checkbox}; | ||||
|          HTTP.post("log/add",Qs.stringify(data)) | ||||
|       .then(r=>{ | ||||
|         alert("ok") | ||||
|         console.log("submit: ",data); | ||||
|         if(this.checkbox){ | ||||
|           this.clear() | ||||
|         }else{ | ||||
|           router.push({ name: 'logs'}); | ||||
|         } | ||||
|       }) | ||||
|     } | ||||
|     }, | ||||
|  |  | |||
|  | @ -4,20 +4,13 @@ | |||
|   <v-card > | ||||
|    <v-toolbar > | ||||
|     | ||||
|        <v-btn | ||||
|        icon | ||||
|       :loading="loading" | ||||
|       @click="getItems()" | ||||
|       :disabled="loading" | ||||
|     > | ||||
|     <v-icon>refresh</v-icon> | ||||
|     </v-btn> | ||||
|      | ||||
|      | ||||
|       <v-btn icon to="add" append> | ||||
|           <v-icon>add_circle</v-icon> | ||||
|     </v-btn> | ||||
|         | ||||
|       <v-spacer></v-spacer> | ||||
|       | ||||
|       <v-text-field | ||||
|         append-icon="search" | ||||
|         label="Filter logs" | ||||
|  | @ -26,6 +19,27 @@ | |||
|         v-model="search" | ||||
|       ></v-text-field> | ||||
|       | ||||
|         <v-btn | ||||
|        icon :color="autorefresh?'red':'green'" | ||||
|       :loading="loading" | ||||
|       @click="getItems" | ||||
|       @dblclick="toggle" | ||||
|       :disabled="loading" | ||||
|     > | ||||
|     <v-icon>refresh</v-icon> | ||||
|     </v-btn> | ||||
|      <v-spacer></v-spacer> | ||||
|       <v-menu offset-y left> | ||||
|              <v-btn icon  slot="activator"><v-icon>settings</v-icon></v-btn> | ||||
|               <v-card > | ||||
|               <v-toolbar class="green"> | ||||
|                   <v-card-title >Settings  TODO</v-card-title> | ||||
|                   </v-toolbar> | ||||
|                 <v-card-text> | ||||
|                 <v-btn @click="autorefresh= ! autorefresh">Autorefresh</v-btn> | ||||
|                 </v-card-text> | ||||
|                 </v-card> | ||||
|               </v-menu> | ||||
|     </v-toolbar> | ||||
|   <v-data-table | ||||
|       :headers="headers" | ||||
|  | @ -69,7 +83,8 @@ | |||
|       selected:[], | ||||
|       search:"", | ||||
|       loading:false, | ||||
|       timer:null | ||||
|       timer:null, | ||||
|       autorefresh: true | ||||
|       } | ||||
|   }, | ||||
|   methods:{ | ||||
|  | @ -81,14 +96,21 @@ | |||
|         //console.log(r.data) | ||||
|         //var items=r.data.items.filter(item=>{return item.text!="[GET] http://localhost:8984/vue-poc/api/log"}) | ||||
|         this.items=r.data.items | ||||
|         if(this.autorefresh){ | ||||
|           this.timer=setTimeout(()=>{ this.getItems() }, 5000); | ||||
|         } | ||||
|         })  | ||||
|     }, | ||||
|     toggle(){ | ||||
|       alert("toggle auto"); | ||||
|       this.autorefresh= !this.autorefresh; | ||||
|     } | ||||
|   }, | ||||
|   created:function(){ | ||||
|     this.getItems() | ||||
|   }, | ||||
|   beforeRouteLeave(to, from, next){ | ||||
|     this.autorefresh=false; | ||||
|     if(this.timer) clearTimeout(this.timer); | ||||
|     return next() | ||||
|   } | ||||
|  |  | |||
|  | @ -18,14 +18,20 @@ as element(json) | |||
|  return dice:response($items,$entity,web:dice()) | ||||
| }; | ||||
| 
 | ||||
| (:~  | ||||
|  : create a log entry | ||||
|  :) | ||||
| declare   | ||||
| %rest:POST %rest:path("/vue-poc/api/log/add") | ||||
| %rest:form-param("type", "{$type}") | ||||
| %rest:form-param("message", "{$message}") | ||||
| %output:method("text")    | ||||
| function j:add() | ||||
| function j:add($type as xs:string, | ||||
|                $message as xs:string) | ||||
| { | ||||
| let $type:="INFO" | ||||
| let $text:="A log message" | ||||
|  return ("AAAA", | ||||
|      admin:write-log($text, $type )  | ||||
|   let $_:=trace(($type,$message),"post") | ||||
|   return ( | ||||
|    "AAAA", | ||||
|    admin:write-log($message, $type )  | ||||
|    ) | ||||
| }; | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ | |||
|  : @author Andy Bunce may-2017 | ||||
|  :) | ||||
| module namespace vue-api = 'quodatum:vue.api.images'; | ||||
| import module namespace cfg = "quodatum:media.image.configure" at "config.xqm"; | ||||
| import module namespace cfg = "quodatum:media.image.configure" at "../../config.xqm"; | ||||
| import module namespace fw="quodatum:file.walker"; | ||||
| import module namespace entity = 'quodatum.models.generated' at "../../models.gen.xqm"; | ||||
| declare namespace c="http://www.w3.org/ns/xproc-step"; | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| (:~  | ||||
| : create xml file list by scanning $SRC and write to vue-poc  | ||||
| :) | ||||
| import module namespace cfg = "quodatum:media.image.configure" at "../config.xqm"; | ||||
| import module namespace cfg = "quodatum:media.image.configure" at "../../../config.xqm"; | ||||
| import module namespace fw="quodatum:file.walker"; | ||||
| declare namespace c="http://www.w3.org/ns/xproc-step"; | ||||
| 
 | ||||
|  |  | |||
|  | @ -3,7 +3,7 @@ | |||
|  : done in batches of 1000 | ||||
|  : @return initial number of missing docs   | ||||
| :) | ||||
| import module namespace cfg = "quodatum:media.image.configure" at "../config.xqm"; | ||||
| import module namespace cfg = "quodatum:media.image.configure" at "../../../config.xqm"; | ||||
| import module namespace imgmeta = "expkg-zone58:image.metadata" ; | ||||
| declare namespace c="http://www.w3.org/ns/xproc-step"; | ||||
| 
 | ||||
|  |  | |||
|  | @ -3,7 +3,7 @@ | |||
|  : <metadata/> -> <image/>  | ||||
|  :) | ||||
| import module namespace metadata = 'expkg-zone58:image.metadata'; | ||||
| import module namespace cfg = "quodatum:media.image.configure" at "../config.xqm"; | ||||
| import module namespace cfg = "quodatum:media.image.configure" at "../../../config.xqm"; | ||||
| for $meta in collection($cfg:DB-IMAGE || "/meta")/metadata | ||||
|   let $loc:=db:path($meta)=>tokenize("/") | ||||
|   let $name:=$loc[count($loc)-1] | ||||
|  |  | |||
|  | @ -3,7 +3,7 @@ | |||
|  : @return initial number of missing docs   | ||||
| :) | ||||
| import module namespace t="expkg-zone58:image.thumbnailator"; | ||||
| import module namespace cfg = "quodatum:media.image.configure" at "../config.xqm"; | ||||
| import module namespace cfg = "quodatum:media.image.configure" at "../../../config.xqm"; | ||||
| declare namespace c="http://www.w3.org/ns/xproc-step"; | ||||
| 
 | ||||
| declare variable $CHUNK:=1000; | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| (:~ set original:) | ||||
| import module namespace cfg = "quodatum:media.image.configure" at "../config.xqm"; | ||||
| import module namespace cfg = "quodatum:media.image.configure" at "../../../config.xqm"; | ||||
| 
 | ||||
| for $i in collection($cfg:DB-IMAGE || "/image")/image | ||||
| where $i[file/@path=>contains('original')] | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ | |||
|  :   <idref>14569796 14569818 </idref> | ||||
|  : </keyword> | ||||
| :) | ||||
| import module namespace cfg = "quodatum:media.image.configure" at "../config.xqm"; | ||||
| import module namespace cfg = "quodatum:media.image.configure" at "../../../config.xqm"; | ||||
| declare %updating function local:put($data,$path){ | ||||
|    db:replace($cfg:DB-IMAGE,$path,$data) | ||||
| }; | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ | |||
|  :   <idref>14569796 14569818 </idref> | ||||
|  : </keyword> | ||||
| :) | ||||
| import module namespace cfg = "quodatum:media.image.configure" at "../config.xqm"; | ||||
| import module namespace cfg = "quodatum:media.image.configure" at "../../../config.xqm"; | ||||
| declare %updating function local:put($data,$path){ | ||||
|    db:replace($cfg:DB-IMAGE,$path,$data) | ||||
| }; | ||||
|  |  | |||
|  | @ -1,18 +1,20 @@ | |||
| import module namespace qipe='http://quodatum.com/ns/pipeline' at "../../lib/pipeline.xqm" ; | ||||
| 
 | ||||
| declare namespace docinfo="http://www.lexis-nexis.com/glp/docinfo"; | ||||
| declare variable $src:="C:\Users\BUNCEAX\Desktop\08s3\data\"; | ||||
| 
 | ||||
| declare variable $base:="C:\Users\andy\Dropbox\job\lexisnexis.2\data\"; | ||||
| declare variable $src:="C:\Users\andy\Desktop\basex.versions\data\08s3\raw\"; | ||||
| declare function local:resolve($path,$base){ | ||||
|   file:resolve-path($path,$base) | ||||
| }; | ||||
| let $ip:=file:list($src,false(), "*.xml") | ||||
| let $ip:=subsequence($ip,1,100)!doc(concat($src,.)) | ||||
| let $ip:=subsequence($ip,1,10)!doc(concat($src,.)) | ||||
| let $d:= | ||||
| <root xmlns="http://quodatum.com/ns/pipeline"> | ||||
| <!-- | ||||
| 
 | ||||
|   <xslt href="file:/C:/apb-git/sources/rosetta/EU/Regulatory/08S3/08S3-to-rosetta-legdoc.xsl"/> | ||||
|  <validate href="C:\Users\BUNCEAX\Desktop\08s3\legdoc-norm.dtd" type="dtd" failOnError="true"/> | ||||
|   --> | ||||
|  <xslt href="{ local:resolve('08S3-to-rosetta-legdoc.xsl',$base) }"/> | ||||
|  <validate href="{ local:resolve('legdoc-norm.dtd',$base) }" type="dtd" failOnError="true"/> | ||||
|  <store base="c:\tmp\" fileExpression="'a' || $position || '.xml'" dated="true"/> | ||||
| </root> | ||||
| 
 | ||||
|  return qipe:run($d,$ip) =>count() | ||||
|  return qipe:run($d,$ip) | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,13 +1,13 @@ | |||
| <!DOCTYPE html> | ||||
| <template id="thumbnail"> | ||||
|  <v-container fluid> | ||||
|  <v-stepper v-model="step" non-linear> | ||||
|  <v-stepper v-model="step" non-linear  > | ||||
|   <v-stepper-header> | ||||
|       <v-stepper-step step="1" :complete="step > 1">Select image location</v-stepper-step> | ||||
|       <v-stepper-step step="1" :complete="step > 1" editable>Select image location</v-stepper-step> | ||||
|       <v-divider></v-divider> | ||||
|       <v-stepper-step step="2" :complete="step > 2">Set thumbnail details</v-stepper-step> | ||||
|       <v-stepper-step step="2" :complete="step > 2" editable>Set thumbnail details</v-stepper-step> | ||||
|       <v-divider></v-divider> | ||||
|       <v-stepper-step step="3">Result</v-stepper-step> | ||||
|       <v-stepper-step step="3" editable>Result</v-stepper-step> | ||||
|     </v-stepper-header> | ||||
|   <v-stepper-items> | ||||
|   <v-stepper-content step="1" non-linear> | ||||
|  |  | |||
|  | @ -23,7 +23,11 @@ | |||
|               </v-menu> | ||||
|           </v-toolbar> | ||||
|     <v-card-text > | ||||
|     here | ||||
|        <qd-autoheight> | ||||
|     <v-flex   fill-height xs12 > | ||||
|       test here | ||||
|       </v-flex> | ||||
|     </qd-autoheight> | ||||
|     </v-card-text> | ||||
|     </v-card> | ||||
|  </v-container> | ||||
|  |  | |||
|  | @ -33,19 +33,21 @@ | |||
| 				        </v-card> | ||||
| 				      </v-menu> | ||||
|           </v-toolbar> | ||||
|            | ||||
|     <v-card-text  class="amber" > | ||||
|        <qd-autoheight> | ||||
| 
 | ||||
| 		      <v-flex  v-if="showOptions.includes('result')" fill-height xs6> | ||||
|       <v-flex  v-if="showOptions.includes('result')" fill-height xs12 > | ||||
|         <vue-ace :content="result" mode="xml" wrap="true" :settings="aceSettings"></vue-ace> | ||||
|       </v-flex> | ||||
|   | ||||
|       <v-flex v-if="showOptions.includes('xml')"    fill-height xs6> | ||||
|       <v-flex v-if="showOptions.includes('xml')"    fill-height > | ||||
| 	      <vue-ace  :content="xml" mode="xml" wrap="true"  | ||||
| 	      v-on:change-content="v => this.xml=v" v-on:annotation="a => this.xmlValid=a.error===0 && a.warning===0" | ||||
| 	     :settings="aceSettings"></vue-ace> | ||||
|      </v-flex> | ||||
|        <v-flex v-if="showOptions.includes('xslt')"   fill-height xs6> | ||||
|       | ||||
|        <v-flex v-if="showOptions.includes('xslt')"   fill-height > | ||||
| 	       <vue-ace  :content="xslt" mode="xml" wrap="true"  | ||||
| 	       v-on:change-content="v => this.xslt=v"  v-on:annotation="a => this.xslValid=a.error===0 && a.warning===0" | ||||
| 	      :settings="aceSettings"></vue-ace> | ||||
|  | @ -53,8 +55,6 @@ | |||
|        | ||||
|      </qd-autoheight> | ||||
|       </v-card-text> | ||||
|        | ||||
|       | ||||
|       </v-card> | ||||
|  </v-container> | ||||
| </template> | ||||
|  |  | |||
|  | @ -2,12 +2,11 @@ | |||
|  :  pipeline library  | ||||
|  : @author Andy Bunce | ||||
|  : @version 0.2 | ||||
|  : @date nov 2017 | ||||
|  : @date nov 2017 jun 2018 | ||||
| :) | ||||
| module namespace  qipe='http://quodatum.com/ns/pipeline'; | ||||
| import module namespace schematron = "http://github.com/Schematron/schematron-basex"; | ||||
| 
 | ||||
| declare variable $qipe:DEBUG:=false(); (: currently unused :) | ||||
| 
 | ||||
| (:~  run a pipeline  | ||||
|  : @param $pipe the pipeline document | ||||
|  | @ -17,8 +16,14 @@ declare variable $qipe:DEBUG:=false(); (: currently unused :) | |||
| declare function qipe:run($pipe as node(),$initial as item()* ) | ||||
| as item()* | ||||
| { | ||||
|   let $steps:=$pipe/*/qipe:* | ||||
|   return fold-left($steps,$initial,qipe:step#2) | ||||
|   let $opts:=map{"id":"66", "log":true(),"trace":true()} | ||||
|   let $_:=qipe:log( "start: " || count($initial),$opts) | ||||
|   let $steps:=$pipe/qipe:* | ||||
|   let $result:= fold-left($steps,$initial,qipe:step(?,?,$opts)) | ||||
|   return ( | ||||
|           $result, | ||||
|           qipe:log( "end: ",$opts) | ||||
|         ) | ||||
| }; | ||||
| 
 | ||||
| (:~ check pipeline is valid against schema :) | ||||
|  | @ -32,20 +37,20 @@ as document-node() | |||
|  : @param $acc current state | ||||
|  : @param $this current step as qipe:* element | ||||
|  :) | ||||
| declare function qipe:step($acc,$this as element(*)) | ||||
| declare function qipe:step($acc,$this as element(*),$opts as map(*)) | ||||
| { | ||||
|   typeswitch($this) | ||||
|   case element(qipe:validate)  return qipe:validate($acc,$this) | ||||
|   case element(qipe:xquery) return qipe:xquery($acc,$this) | ||||
|   case element(qipe:xslt) return qipe:xslt($acc,$this) | ||||
|   case element(qipe:load) return qipe:load($acc,$this) | ||||
|   case element(qipe:store) return qipe:store($acc,$this) | ||||
|   typeswitch($this=>trace("RUNNING:")) | ||||
|   case element(qipe:validate)  return qipe:validate($acc,$this,$opts) | ||||
|   case element(qipe:xquery) return qipe:xquery($acc,$this,$opts) | ||||
|   case element(qipe:xslt) return qipe:xslt($acc,$this,$opts) | ||||
|   case element(qipe:load) return qipe:load($acc,$this,$opts) | ||||
|   case element(qipe:store) return qipe:store($acc,$this,$opts) | ||||
|   default return error(xs:QName('qipe'), 'unknown step:' || name($this)) | ||||
| }; | ||||
| 
 | ||||
| (:~  run validate step based on @type | ||||
| :) | ||||
| declare function qipe:validate($acc,$this as element(qipe:validate)) | ||||
| declare function qipe:validate($acc,$this as element(qipe:validate),$opts as map(*)) | ||||
| { | ||||
|   let $href:=qipe:resolve($this/@href) | ||||
|   let $failOnError:=boolean($this/@failOnError) | ||||
|  | @ -53,16 +58,20 @@ declare function qipe:validate($acc,$this as element(qipe:validate)) | |||
|              case "relax-ng" return  qipe:relax-ng(?,$href ) | ||||
|              case "schematron" return  qipe:schematron(?,$href ) | ||||
|              case "xml-schema" return  qipe:validate-xsd(?,$href ) | ||||
|              case "dtd" return  qipe:validate-dtd(?,$href ) | ||||
|              default return error(xs:QName('qipe'), 'unknown validation type: ' || $this/@type/string() ) | ||||
|   for  $doc in $acc | ||||
|   for  $doc at $i in $acc | ||||
|   let $report:=$fn($doc) | ||||
|   let $_:=qipe:log("validate: " || $i,$opts) | ||||
|    | ||||
|   return   | ||||
|          if($report/status = "valid") then | ||||
|              $doc | ||||
|          else | ||||
|            let $_:=trace($report,"validation errors") | ||||
|            return  if($failOnError) then | ||||
|                         error(xs:QName('qipe'), ' validation fails: ' || base-uri($doc)) | ||||
|                         error(xs:QName('qipe'),  | ||||
|                         ' validation fails: ' || $i || "=" || base-uri($doc)) | ||||
|                    else | ||||
|                        $doc | ||||
| }; | ||||
|  | @ -70,7 +79,7 @@ declare function qipe:validate($acc,$this as element(qipe:validate)) | |||
| (:~   | ||||
|  : run xquery referenced by @href and append result sequence to accumulator | ||||
|  :) | ||||
| declare function qipe:xquery($acc,$this  as element(qipe:xquery)) | ||||
| declare function qipe:xquery($acc,$this  as element(qipe:xquery),$opts as map(*)) | ||||
| { | ||||
|   let $href:=$this/@href/string() | ||||
|   let $result:=xquery:invoke($href) | ||||
|  | @ -80,29 +89,36 @@ declare function qipe:xquery($acc,$this  as element(qipe:xquery)) | |||
| (:~   | ||||
|  : apply XSLT transform to each item in accumulator | ||||
|  :) | ||||
| declare function qipe:xslt($acc,$this  as element(qipe:xslt)) | ||||
| declare function qipe:xslt($acc,$this  as element(qipe:xslt),$opts as map(*)) | ||||
| { | ||||
|   let $href:=qipe:resolve($this/@href) | ||||
|   let $result:=$acc!xslt:transform(., $href)   | ||||
|   return $result | ||||
|   for $d at $i in $acc | ||||
|   let $_:=qipe:log("xslt: " || $i,$opts) | ||||
|   return xslt:transform($d, $href)   | ||||
| }; | ||||
| 
 | ||||
| (:~   | ||||
|  : store each item in accumulator at computed path | ||||
|  :) | ||||
| declare function qipe:store($acc,$this  as element(qipe:store)) | ||||
| declare function qipe:store($acc,$this  as element(qipe:store),$opts as map(*)) | ||||
| { | ||||
|   let $href:=qipe:resolve($this/@base) | ||||
|   let $dated:=boolean($this/@dated) | ||||
|   let $name:=$this/@fileExpression/string() | ||||
|   let $href:=$href || (if( $dated) then format-date(current-date(),"/[Y0001][M01][D01]") else ()) | ||||
|   let $eval:="declare variable $position external :=0; " || $name | ||||
|   let $href:=$href || (if( $dated) then  | ||||
|                           format-date(current-date(),"/[Y0001][M01][D01]")  | ||||
|                        else  | ||||
|                           ()) | ||||
|    | ||||
|   return ($acc, | ||||
|   return ( | ||||
|           if(file:exists($href)) then () else file:create-dir($href), | ||||
|           for $item in $acc | ||||
|           let $name:=xquery:eval($name,map{"":$item}) (:eval against doc:) | ||||
|           for $item at $pos in $acc | ||||
|           let $name:=xquery:eval($eval, | ||||
|                                  map{"":$item, | ||||
|                                      "position": $pos}) (:eval against doc:) | ||||
|           let $dest:=$href || "/" || $name | ||||
|           return file:write($dest,$item) | ||||
|           return ($dest,file:write($dest,$item)) | ||||
|         ) | ||||
| }; | ||||
| 
 | ||||
|  | @ -113,6 +129,13 @@ as element(report) | |||
|   validate:xsd-report($doc,$xsd)  | ||||
| }; | ||||
| 
 | ||||
| (:~  validate with dtd  :) | ||||
| declare function qipe:validate-dtd($doc,$dtd ) | ||||
| as element(report) | ||||
| {  | ||||
|   validate:dtd-report($doc,$dtd)  | ||||
| }; | ||||
| 
 | ||||
| (:~  validate with relax-ng  :) | ||||
| declare function qipe:relax-ng($doc,$rng ) | ||||
| as element(report) | ||||
|  | @ -140,7 +163,7 @@ as element(report) | |||
| }; | ||||
| 
 | ||||
| (:~  load from file system  :) | ||||
| declare function qipe:load($acc,$this ) | ||||
| declare function qipe:load($acc,$this,$opts as map(*) ) | ||||
| {  | ||||
|  let $href:=qipe:resolve($this/@href)=>trace("load") | ||||
|  let $new:=if(file:is-dir($href)) then   | ||||
|  | @ -155,3 +178,13 @@ declare function qipe:resolve($href as node()? ) | |||
| {  | ||||
|  resolve-uri( $href,base-uri($href)) | ||||
| }; | ||||
| 
 | ||||
| (:~  log msg :) | ||||
| declare function qipe:log($text as xs:string,$opts as map(*) ) | ||||
| as empty-sequence() | ||||
| {  | ||||
|  if($opts?log) then | ||||
|       admin:write-log(``[[`{ $opts?id }`] `{$text}`]``,"QIPE") | ||||
|  else     | ||||
|    ()         | ||||
| }; | ||||
|  | @ -1,9 +1,9 @@ | |||
| (: entity access maps  | ||||
|  : auto generated from xml files in entities folder at: 2018-05-16T23:18:57.393+01:00  | ||||
|  : auto generated from xml files in entities folder at: 2018-06-20T22:41:55.037+01:00  | ||||
|  :) | ||||
| 
 | ||||
| module namespace entity = 'quodatum.models.generated'; | ||||
| import module namespace cfg = "quodatum:media.image.configure" at "features/images/config.xqm";declare namespace ent='https://github.com/Quodatum/app-doc/entity'; | ||||
| import module namespace cfg = "quodatum:media.image.configure" at "config.xqm";declare namespace ent='https://github.com/Quodatum/app-doc/entity'; | ||||
| declare namespace h='urn:quodatum:vue-poc.history'; | ||||
| declare namespace xqdoc='http://www.xqdoc.org/1.0'; | ||||
| declare namespace c='http://www.w3.org/ns/xproc-step'; | ||||
|  |  | |||
|  | @ -103,9 +103,6 @@ const router = new VueRouter({ | |||
|     { path: '/tasks/vuecompile', component: Vuecompile, meta:{title:"vue compile"} }, | ||||
|     { path: '/tasks/:task', component: Runtask, props: true, meta:{title:"Run task"} }, | ||||
|          | ||||
|     { path: '/jobs', component: Jobs, meta:{title:"Jobs running"} }, | ||||
|     { path: '/jobs/:job',  name:"jobShow", component: Job, props: true, meta:{title:"Job Status"} }, | ||||
|      | ||||
|     { path: '/timeline', component: Timeline,meta:{title:"timeline"} }, | ||||
|     { path: '/tree', component: Tree, meta:{title:"tree"} }, | ||||
|     { path: '/tree2', component: Tree2, meta:{title:"tree2"} }, | ||||
|  |  | |||
|  | @ -1,10 +1,10 @@ | |||
| // generated 2018-06-19T23:27:38.406+01:00
 | ||||
| // generated 2018-06-24T22:46:13.105+01:00
 | ||||
| 
 | ||||
| // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/qd-autoheight.vue
 | ||||
| Vue.component('qd-autoheight',{template:` 
 | ||||
| 	<v-flex style="height:200px;overflow:hidden;" ref="auto" v-resize="onResize" class="green"> | ||||
| 	<v-layout style="height:200px;overflow:hidden;" row="" wrap="" ref="auto" v-resize="onResize" class="green"> | ||||
| 			<slot>i will auto2</slot> | ||||
| 	</v-flex> | ||||
| 	</v-layout> | ||||
|  `,
 | ||||
|        | ||||
|   props: ['show'], | ||||
|  | @ -968,7 +968,7 @@ const Logadd=Vue.extend({template:` | |||
|     <v-card-text> | ||||
|       <v-container fluid=""> | ||||
| <v-form ref="form" v-model="valid" lazy-validation=""> | ||||
|     <v-text-field v-model="name" :rules="nameRules" :counter="10" label="Name" required=""></v-text-field> | ||||
|     <v-text-field v-model="message" :rules="[v => !!v || 'message is required']" :counter="10" label="Message" required=""></v-text-field> | ||||
|     | ||||
|     <v-select v-model="type" :items="types" :rules="[v => !!v || 'type is required']" label="Type" required=""></v-select> | ||||
|     <v-checkbox v-model="checkbox" label="Add more?"></v-checkbox> | ||||
|  | @ -983,10 +983,9 @@ const Logadd=Vue.extend({template:` | |||
|        | ||||
|   data: () => ({ | ||||
|     valid: true, | ||||
|     name: '', | ||||
|     message: '', | ||||
|     nameRules: [ | ||||
|       v => !!v || 'Name is required', | ||||
|       v => (v && v.length <= 10) || 'Name must be less than 10 characters' | ||||
|       v => !!v || 'Message is required' | ||||
|     ], | ||||
|      | ||||
|     type: "INFO", | ||||
|  | @ -1000,14 +999,18 @@ const Logadd=Vue.extend({template:` | |||
|   methods: { | ||||
|     submit () { | ||||
|       if (this.$refs.form.validate()) { | ||||
|         // Native form submission is not yet supported
 | ||||
|          HTTP.post("log/add",{ | ||||
|              name: this.name, | ||||
| 
 | ||||
|          var data={message: this.message, | ||||
|                type: this.type, | ||||
|              checkbox: this.checkbox | ||||
|            }) | ||||
|                checkbox: this.checkbox}; | ||||
|          HTTP.post("log/add",Qs.stringify(data)) | ||||
|       .then(r=>{ | ||||
|         alert("ok") | ||||
|         console.log("submit: ",data); | ||||
|         if(this.checkbox){ | ||||
|           this.clear() | ||||
|         }else{ | ||||
|           router.push({ name: 'logs'}); | ||||
|         } | ||||
|       }) | ||||
|     } | ||||
|     }, | ||||
|  | @ -1028,17 +1031,30 @@ const Log=Vue.extend({template:` | |||
|   <v-card> | ||||
|    <v-toolbar> | ||||
|     | ||||
|        <v-btn icon="" :loading="loading" @click="getItems()" :disabled="loading"> | ||||
|     <v-icon>refresh</v-icon> | ||||
|     </v-btn> | ||||
|      | ||||
|      | ||||
|       <v-btn icon="" to="add" append=""> | ||||
|           <v-icon>add_circle</v-icon> | ||||
|     </v-btn> | ||||
|         | ||||
|       <v-spacer></v-spacer> | ||||
|       | ||||
|       <v-text-field append-icon="search" label="Filter logs" single-line="" hide-details="" v-model="search"></v-text-field> | ||||
|       | ||||
|         <v-btn icon="" :color="autorefresh?'red':'green'" :loading="loading" @click="getItems" @dblclick="toggle" :disabled="loading"> | ||||
|     <v-icon>refresh</v-icon> | ||||
|     </v-btn> | ||||
|      <v-spacer></v-spacer> | ||||
|       <v-menu offset-y="" left=""> | ||||
|              <v-btn icon="" slot="activator"><v-icon>settings</v-icon></v-btn> | ||||
|               <v-card> | ||||
|               <v-toolbar class="green"> | ||||
|                   <v-card-title>Settings  TODO</v-card-title> | ||||
|                   </v-toolbar> | ||||
|                 <v-card-text> | ||||
|                 <v-btn @click="autorefresh= ! autorefresh">Autorefresh</v-btn> | ||||
|                 </v-card-text> | ||||
|                 </v-card> | ||||
|               </v-menu> | ||||
|     </v-toolbar> | ||||
|   <v-data-table :headers="headers" :items="items" :search="search" class="elevation-1" no-data-text="No logs found" v-bind:pagination.sync="pagination"> | ||||
|     <template slot="items" slot-scope="props"> | ||||
|  | @ -1074,7 +1090,8 @@ const Log=Vue.extend({template:` | |||
|       selected:[], | ||||
|       search:"", | ||||
|       loading:false, | ||||
|       timer:null | ||||
|       timer:null, | ||||
|       autorefresh: true | ||||
|       } | ||||
|   }, | ||||
|   methods:{ | ||||
|  | @ -1086,14 +1103,21 @@ const Log=Vue.extend({template:` | |||
|         //console.log(r.data)
 | ||||
|         //var items=r.data.items.filter(item=>{return item.text!="[GET] http://localhost:8984/vue-poc/api/log"})
 | ||||
|         this.items=r.data.items | ||||
|         if(this.autorefresh){ | ||||
|           this.timer=setTimeout(()=>{ this.getItems() }, 5000); | ||||
|         } | ||||
|         })  | ||||
|     }, | ||||
|     toggle(){ | ||||
|       alert("toggle auto"); | ||||
|       this.autorefresh= !this.autorefresh; | ||||
|     } | ||||
|   }, | ||||
|   created:function(){ | ||||
|     this.getItems() | ||||
|   }, | ||||
|   beforeRouteLeave(to, from, next){ | ||||
|     this.autorefresh=false; | ||||
|     if(this.timer) clearTimeout(this.timer); | ||||
|     return next() | ||||
|   } | ||||
|  | @ -5220,11 +5244,11 @@ const Thumbnail=Vue.extend({template:` | |||
|  <v-container fluid=""> | ||||
|  <v-stepper v-model="step" non-linear=""> | ||||
|   <v-stepper-header> | ||||
|       <v-stepper-step step="1" :complete="step > 1">Select image location</v-stepper-step> | ||||
|       <v-stepper-step step="1" :complete="step > 1" editable="">Select image location</v-stepper-step> | ||||
|       <v-divider></v-divider> | ||||
|       <v-stepper-step step="2" :complete="step > 2">Set thumbnail details</v-stepper-step> | ||||
|       <v-stepper-step step="2" :complete="step > 2" editable="">Set thumbnail details</v-stepper-step> | ||||
|       <v-divider></v-divider> | ||||
|       <v-stepper-step step="3">Result</v-stepper-step> | ||||
|       <v-stepper-step step="3" editable="">Result</v-stepper-step> | ||||
|     </v-stepper-header> | ||||
|   <v-stepper-items> | ||||
|   <v-stepper-content step="1" non-linear=""> | ||||
|  | @ -5360,7 +5384,11 @@ const Validate=Vue.extend({template:` | |||
|               </v-menu> | ||||
|           </v-toolbar> | ||||
|     <v-card-text> | ||||
|     here | ||||
|        <qd-autoheight> | ||||
|     <v-flex fill-height="" xs12=""> | ||||
|       test here | ||||
|       </v-flex> | ||||
|     </qd-autoheight> | ||||
|     </v-card-text> | ||||
|     </v-card> | ||||
|  </v-container> | ||||
|  | @ -5514,24 +5542,24 @@ const Transform=Vue.extend({template:` | |||
| 				        </v-card> | ||||
| 				      </v-menu> | ||||
|           </v-toolbar> | ||||
|            | ||||
|     <v-card-text class="amber"> | ||||
|        <qd-autoheight> | ||||
| 
 | ||||
| 		      <v-flex v-if="showOptions.includes('result')" fill-height="" xs6=""> | ||||
|       <v-flex v-if="showOptions.includes('result')" fill-height="" xs12=""> | ||||
|         <vue-ace :content="result" mode="xml" wrap="true" :settings="aceSettings"></vue-ace> | ||||
|       </v-flex> | ||||
|   | ||||
|       <v-flex v-if="showOptions.includes('xml')" fill-height="" xs6=""> | ||||
|       <v-flex v-if="showOptions.includes('xml')" fill-height=""> | ||||
| 	      <vue-ace :content="xml" mode="xml" wrap="true" v-on:change-content="v => this.xml=v" v-on:annotation="a => this.xmlValid=a.error===0 && a.warning===0" :settings="aceSettings"></vue-ace> | ||||
|      </v-flex> | ||||
|        <v-flex v-if="showOptions.includes('xslt')" fill-height="" xs6=""> | ||||
|       | ||||
|        <v-flex v-if="showOptions.includes('xslt')" fill-height=""> | ||||
| 	       <vue-ace :content="xslt" mode="xml" wrap="true" v-on:change-content="v => this.xslt=v" v-on:annotation="a => this.xslValid=a.error===0 && a.warning===0" :settings="aceSettings"></vue-ace> | ||||
|       </v-flex> | ||||
|        | ||||
|      </qd-autoheight> | ||||
|       </v-card-text> | ||||
|        | ||||
|       | ||||
|       </v-card> | ||||
|  </v-container> | ||||
|  `,
 | ||||
|  | @ -5704,9 +5732,6 @@ const router = new VueRouter({ | |||
|     { path: '/tasks/vuecompile', component: Vuecompile, meta:{title:"vue compile"} }, | ||||
|     { path: '/tasks/:task', component: Runtask, props: true, meta:{title:"Run task"} }, | ||||
|          | ||||
|     { path: '/jobs', component: Jobs, meta:{title:"Jobs running"} }, | ||||
|     { path: '/jobs/:job',  name:"jobShow", component: Job, props: true, meta:{title:"Job Status"} }, | ||||
|      | ||||
|     { path: '/timeline', component: Timeline,meta:{title:"timeline"} }, | ||||
|     { path: '/tree', component: Tree, meta:{title:"tree"} }, | ||||
|     { path: '/tree2', component: Tree2, meta:{title:"tree2"} }, | ||||
|  |  | |||
|  | @ -9,7 +9,7 @@ import module namespace bf = 'quodatum.tools.buildfields' at "../lib/entity-gen. | |||
| declare variable $efolder:="C:/Users/andy/git/vue-poc/src/vue-poc/models"; | ||||
| declare variable $target:="C:/Users/andy/git/vue-poc/src/vue-poc/models.gen.xqm"; | ||||
| 
 | ||||
| let $config:='import module namespace cfg = "quodatum:media.image.configure" at "features/images/config.xqm";' | ||||
| let $config:='import module namespace cfg = "quodatum:media.image.configure" at "config.xqm";' | ||||
| 
 | ||||
| let $src:=bf:module(bf:entities($efolder),$config) | ||||
| return ( | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue