namespaces

This commit is contained in:
Andy Bunce 2017-10-22 22:14:33 +01:00
parent 7f8695969e
commit 0b87640f57
15 changed files with 313 additions and 63 deletions

View file

@ -1,5 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<template id="users"> <!-- card showing table -->
<template id="qd-table">
<v-container fluid> <v-container fluid>
<v-card > <v-card >
<v-toolbar > <v-toolbar >
@ -11,6 +12,7 @@
v-model="search" v-model="search"
></v-text-field> ></v-text-field>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn @click="getData">Refresh</v-btn>
</v-toolbar> </v-toolbar>
<v-data-table <v-data-table
:headers="headers" :headers="headers"
@ -22,15 +24,7 @@
no-data-text="No users found @todo" no-data-text="No users found @todo"
> >
<template slot="items" scope="props"> <template slot="items" scope="props">
<td class="vtop"> <slot></slot>
<v-checkbox
primary
hide-details
v-model="props.selected"
></v-checkbox>
</td>
<td class="vtop">{{ props.item.name }}</td>
<td class="vtop "><div>{{ props.item.permission }}</div>
</template> </template>
</v-data-table> </v-data-table>
</v-card> </v-card>
@ -38,13 +32,9 @@
</template> </template>
<script>{ <script>{
data: function(){ props: {
return { headers: {
loading: false, default: [
items: [],
search: null,
selected: [],
headers: [
{ {
text: 'Name', text: 'Name',
left: true, left: true,
@ -52,12 +42,24 @@
}, },
{ text: 'Permission', value: 'state' } { text: 'Permission', value: 'state' }
] ]
},
dataUri:{
default: "users"
}
},
data: function(){
return {
loading: false,
items: [],
search: null,
selected: [],
} }
}, },
methods:{ methods:{
getUsers(){ getData(){
this.loading=true; this.loading=true;
HTTP.get("user") HTTP.get(this.dataUri)
.then(r=>{ .then(r=>{
this.loading=false this.loading=false
this.items=r.data this.items=r.data
@ -65,7 +67,8 @@
} }
}, },
created:function(){ created:function(){
console.log("notfound",this.$route.query.q) console.log("qd-table")
this.getData()
} }
} }
</script> </script>

View file

@ -1,6 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<!-- <!--
for vis-time-line for vis-time-line http://visjs.org/docs/graph2d/
--> -->
<template id="vis-time-line"> <template id="vis-time-line">
<div></div> <div></div>

View file

@ -67,4 +67,13 @@
<description>Geo <description>Geo
</description> </description>
</namespace> </namespace>
<namespace uri="http://www.w3.org/ns/xproc" prefix="xproc">
<description>XProc
</description>
</namespace>
<namespace uri="http://www.w3.org/ns/xproc-step" prefix="c">
<description>XProc step
</description>
</namespace>
</namespaces> </namespaces>

View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<template id="entity">
<v-container fluid>
Entities
</v-container>
</template>
<script>{
data: function(){
return {
message: 'bad route!'
}
},
created:function(){
console.log("notfound",this.$route.query.q)
}
}
</script>

View file

@ -1,4 +1,4 @@
(:~ (:~
: vue-poc thumbnail api. : vue-poc thumbnail api.
: :
: @author Andy Bunce may-2017 : @author Andy Bunce may-2017

View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<template id="namespace">
<v-container fluid>
namespaces
</v-container>
</template>
<script>{
data: function(){
return {
message: 'bad route!'
}
},
created:function(){
console.log("notfound",this.$route.query.q)
}
}
</script>

View file

@ -0,0 +1,32 @@
<!DOCTYPE html>
<template id="users">
<v-container fluid>
<qd-table :headers="headers" data-uri="data/users">
</qd-table>
</v-container>
</template>
<script>{
data: function(){
return {
loading: false,
items: [],
search: null,
selected: [],
headers: [
{
text: 'Name',
left: true,
value: 'id'
},
{ text: 'Permissions', value: 'state' }
]
}
},
created:function(){
console.log("qd-table")
}
}
</script>

View file

@ -0,0 +1,20 @@
module namespace d = 'quodatum.api.data';
(:~
: users
:)
declare
%rest:GET %rest:path("/vue-poc/api/data/users")
%output:method("json")
function d:list()
as element(json)
{
let $jlist:=()
return <json type="array">
{for $j in $jlist
return <_ type="object">
{()}
</_>
}</json>
};

View file

@ -0,0 +1,13 @@
declare variable $xp:=doc("C:\tmp\xqdoc\classify.xqm\xparse.xml")/*;
declare function local:imports($xp as element(XQuery)) as xs:string*
{
$xp/LibraryModule/Prolog/ModuleImport
};
declare function local:variables($xp as element(XQuery)){
$xp/LibraryModule/Prolog/AnnotatedDecl/VarDecl
};
declare function local:functions($xp as element(XQuery)){
$xp/LibraryModule/Prolog/AnnotatedDecl/FunctionDecl
};
local:functions( $xp)/string()

View file

@ -1,5 +1,5 @@
(: entity access maps (: entity access maps
: auto generated from xml files in entities folder at: 2017-10-15T22:56:50.395+01:00 : auto generated from xml files in entities folder at: 2017-10-22T20:37:22.427+01:00
:) :)
module namespace entity = 'quodatum.models.generated'; module namespace entity = 'quodatum.models.generated';
@ -97,6 +97,40 @@ declare variable $entity:list:=map {
"views": map{ "views": map{
}
},
"namespace": map{
"name": "namespace",
"description": "An XML namespace",
"access": map{
"description": function($_ as element()) as xs:string {$_/description },
"prefix": function($_ as element()) as xs:string {$_/@prefix },
"xmlns": function($_ as element()) as xs:string {$_/@uri } },
"filter": function($item,$q) as xs:boolean{
some $e in ( $item/@uri, $item/description) satisfies
fn:contains($e,$q, 'http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive')
},
"json": map{
"description": function($_ as element()) as element(description)? {
(: xs:string :)
fn:data($_/description)!element description { .}
},
"prefix": function($_ as element()) as element(prefix)? {
(: xs:string :)
fn:data($_/@prefix)!element prefix { .}
},
"xmlns": function($_ as element()) as element(xmlns)? {
(: xs:string :)
fn:data($_/@uri)!element xmlns { .}
} },
"data": function() as element(namespace)*
{ collection("vuepoc")/namespaces/namespace
},
"views": map{
'filter': 'xmlns description'
} }
}, },
"query": map{ "query": map{

View file

@ -0,0 +1,24 @@
<entity name="namespace" xmlns="https://github.com/Quodatum/app-doc/entity">
<description>An XML namespace</description>
<fields>
<field name="xmlns" type="xs:string">
<description>namespace</description>
<xpath>@uri</xpath>
</field>
<field name="prefix" type="xs:string">
<description>commonly used namespace prefixes </description>
<xpath>@prefix</xpath>
</field>
<field name="description" type="xs:string">
<description>about the namespace</description>
<xpath>description</xpath>
</field>
</fields>
<views>
<view name="filter">xmlns description</view>
</views>
<iconclass>label</iconclass>
<data type="element(namespace)">collection("vuepoc")/namespaces/namespace
</data>
</entity>

View file

@ -14,6 +14,8 @@ const router = new VueRouter({
{ path: '/images/dates', component: Dates, meta:{title:"Image dates"} }, { path: '/images/dates', component: Dates, meta:{title:"Image dates"} },
{ path: '/images/people', component: People, meta:{title:"Image people"} }, { path: '/images/people', component: People, meta:{title:"Image people"} },
{ path: '/entity', component: Entity, meta:{title:"Entities"} },
{ path: '/namespace', component: Namespace, meta:{title:"Namespaces"} },
{ path: '/select', component: Select, meta:{title:"Select"} }, { path: '/select', component: Select, meta:{title:"Select"} },
{ path: '/search', component: Search, meta:{title:"Search"} }, { path: '/search', component: Search, meta:{title:"Search"} },
{ path: '/tabs', component: Tabs,meta:{title:"tab test",requiresAuth: true} }, { path: '/tabs', component: Tabs,meta:{title:"tab test",requiresAuth: true} },

View file

@ -1,4 +1,4 @@
// generated 2017-10-15T22:47:08.186+01:00 // generated 2017-10-22T22:09:51.205+01:00
Vue.component('qd-confirm',{template:` Vue.component('qd-confirm',{template:`
<v-dialog v-model="value"> <v-dialog v-model="value">
<v-card> <v-card>
@ -133,6 +133,64 @@
} }
} }
);
Vue.component('qd-table',{template:`
<v-container fluid="">
<v-card>
<v-toolbar>
<v-text-field append-icon="search" label="Filter user" single-line="" hide-details="" v-model="search"></v-text-field>
<v-spacer></v-spacer>
<v-btn @click="getData">Refresh</v-btn>
</v-toolbar>
<v-data-table :headers="headers" :items="items" :search="search" v-model="selected" select-all="" class="elevation-1" no-data-text="No users found @todo">
<template slot="items" scope="props">
<slot></slot>
</template>
</v-data-table>
</v-card>
</v-container>
`,
props: {
headers: {
default: [
{
text: 'Name',
left: true,
value: 'id'
},
{ text: 'Permission', value: 'state' }
]
},
dataUri:{
default: "users"
}
},
data: function(){
return {
loading: false,
items: [],
search: null,
selected: [],
}
},
methods:{
getData(){
this.loading=true;
HTTP.get(this.dataUri)
.then(r=>{
this.loading=false
this.items=r.data
})
}
},
created:function(){
console.log("qd-table")
this.getData()
}
}
); );
Vue.component('vis-time-line',{template:` Vue.component('vis-time-line',{template:`
<div></div> <div></div>
@ -1035,6 +1093,23 @@ Vue.filter('round', function(value, decimals) {
} }
} }
);
const Entity=Vue.extend({template:`
<v-container fluid="">
Entities
</v-container>
`,
data: function(){
return {
message: 'bad route!'
}
},
created:function(){
console.log("notfound",this.$route.query.q)
}
}
); );
const Eval=Vue.extend({template:` const Eval=Vue.extend({template:`
<v-container fluid=""> <v-container fluid="">
@ -2024,6 +2099,23 @@ people
} }
} }
);
const Namespace=Vue.extend({template:`
<v-container fluid="">
namespaces
</v-container>
`,
data: function(){
return {
message: 'bad route!'
}
},
created:function(){
console.log("notfound",this.$route.query.q)
}
}
); );
const Ping=Vue.extend({template:` const Ping=Vue.extend({template:`
<v-container fluid=""> <v-container fluid="">
@ -3159,22 +3251,10 @@ created(){
); );
const Users=Vue.extend({template:` const Users=Vue.extend({template:`
<v-container fluid=""> <v-container fluid="">
<v-card> <qd-table :headers="headers" data-uri="data/users">
<v-toolbar> </qd-table>
<v-text-field append-icon="search" label="Filter user" single-line="" hide-details="" v-model="search"></v-text-field>
<v-spacer></v-spacer>
</v-toolbar>
<v-data-table :headers="headers" :items="items" :search="search" v-model="selected" select-all="" class="elevation-1" no-data-text="No users found @todo">
<template slot="items" scope="props">
<td class="vtop">
<v-checkbox primary="" hide-details="" v-model="props.selected"></v-checkbox>
</td>
<td class="vtop">{{ props.item.name }}</td>
<td class="vtop "><div>{{ props.item.permission }}</div>
</td></template>
</v-data-table>
</v-card>
</v-container> </v-container>
`, `,
data: function(){ data: function(){
@ -3189,22 +3269,13 @@ created(){
left: true, left: true,
value: 'id' value: 'id'
}, },
{ text: 'Permission', value: 'state' } { text: 'Permissions', value: 'state' }
] ]
} }
}, },
methods:{
getUsers(){
this.loading=true;
HTTP.get("user")
.then(r=>{
this.loading=false
this.items=r.data
})
}
},
created:function(){ created:function(){
console.log("notfound",this.$route.query.q) console.log("qd-table")
} }
} }
@ -3420,6 +3491,8 @@ created(){
{ path: '/images/dates', component: Dates, meta:{title:"Image dates"} }, { path: '/images/dates', component: Dates, meta:{title:"Image dates"} },
{ path: '/images/people', component: People, meta:{title:"Image people"} }, { path: '/images/people', component: People, meta:{title:"Image people"} },
{ path: '/entity', component: Entity, meta:{title:"Entities"} },
{ path: '/namespace', component: Namespace, meta:{title:"Namespaces"} },
{ path: '/select', component: Select, meta:{title:"Select"} }, { path: '/select', component: Select, meta:{title:"Select"} },
{ path: '/search', component: Search, meta:{title:"Search"} }, { path: '/search', component: Search, meta:{title:"Search"} },
{ path: '/tabs', component: Tabs,meta:{title:"tab test",requiresAuth: true} }, { path: '/tabs', component: Tabs,meta:{title:"tab test",requiresAuth: true} },
@ -3588,15 +3661,15 @@ router.beforeEach((to, from, next) => {
items: [ items: [
{href: '/',text: 'Home', icon: 'home' }, {href: '/',text: 'Home', icon: 'home' },
{ {
icon: 'directions_run', icon: 'input',
text: 'Actions' , text: 'Actions' ,
model: false, model: false,
children: [ children: [
{href: '/eval',text: 'Query',icon: 'play_circle_outline'}, {href: '/eval',text: 'Query',icon: 'play_circle_outline'},
{href: '/edit',text: 'Edit',icon: 'mode_edit'}, {href: '/edit',text: 'Edit',icon: 'mode_edit'},
{href: '/validate',text: 'Validate',icon: 'playlist_add_check'}, {href: '/validate',text: 'Validate',icon: 'playlist_add_check'},
{href: '/transform',text: 'XSLT Transform',icon: 'input'}, {href: '/transform',text: 'XSLT Transform',icon: 'forward'},
{href: '/tasks',text: 'Tasks',icon: 'history'} {href: '/tasks',text: 'Tasks',icon: 'update'}
]}, ]},
{ {
icon: 'folder_open', icon: 'folder_open',
@ -3612,6 +3685,8 @@ router.beforeEach((to, from, next) => {
text: 'Models' , text: 'Models' ,
model: false, model: false,
children: [ children: [
{href: '/namespace', text: 'Namespaces',icon: 'label' },
{href: '/entity', text: 'Entities',icon: 'redeem' },
]}, ]},
{ {
icon: 'cast_connected', icon: 'cast_connected',

View file

@ -9,7 +9,7 @@
<title>Vue Router Test</title> <title>Vue Router Test</title>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic"> <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic">
<link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons"> <link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons">
<link href="https://unpkg.com/vuetify@0.16.6/dist/vuetify.min.css" rel="stylesheet" type="text/css"> <link href="https://unpkg.com/vuetify@0.16.9/dist/vuetify.min.css" rel="stylesheet" type="text/css">
<link href="https://unpkg.com/vue-multiselect@2.0.0-beta.15/dist/vue-multiselect.min.css" rel="stylesheet" type="text/css"> <link href="https://unpkg.com/vue-multiselect@2.0.0-beta.15/dist/vue-multiselect.min.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.2.0/dist/leaflet.css" <link rel="stylesheet" href="https://unpkg.com/leaflet@1.2.0/dist/leaflet.css"
integrity="sha512-M2wvCLH6DSRazYeZRIm1JnYyh22purTM+FDB5CsyxtQJYeKq83arPe5wgbNmcFXGqiSH2XR8dT/fJISVA1r/zQ==" integrity="sha512-M2wvCLH6DSRazYeZRIm1JnYyh22purTM+FDB5CsyxtQJYeKq83arPe5wgbNmcFXGqiSH2XR8dT/fJISVA1r/zQ=="
@ -41,10 +41,10 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue-router/2.7.0/vue-router.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/vue-router/2.7.0/vue-router.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.16.1/axios.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.16.1/axios.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/qs/6.4.0/qs.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/qs/6.4.0/qs.js"></script>
<script src="https://unpkg.com/vuetify@0.16.6/dist/vuetify.min.js"></script> <script src="https://unpkg.com/vuetify@0.16.9/dist/vuetify.min.js"></script>
<script src="https://unpkg.com/vue-multiselect@2.0.0-beta.15/dist/vue-multiselect.min.js"></script> <script src="https://unpkg.com/vue-multiselect@2.0.0-beta.15/dist/vue-multiselect.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.7/ace.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.7/ext-language_tools.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ext-language_tools.js"></script>
<script src="https://d3js.org/d3.v3.min.js"></script> <script src="https://d3js.org/d3.v3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.6.12/beautify.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.6.12/beautify.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.6.12/beautify-css.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.6.12/beautify-css.js"></script>

View file

@ -133,15 +133,15 @@
items: [ items: [
{href: '/',text: 'Home', icon: 'home' }, {href: '/',text: 'Home', icon: 'home' },
{ {
icon: 'directions_run', icon: 'input',
text: 'Actions' , text: 'Actions' ,
model: false, model: false,
children: [ children: [
{href: '/eval',text: 'Query',icon: 'play_circle_outline'}, {href: '/eval',text: 'Query',icon: 'play_circle_outline'},
{href: '/edit',text: 'Edit',icon: 'mode_edit'}, {href: '/edit',text: 'Edit',icon: 'mode_edit'},
{href: '/validate',text: 'Validate',icon: 'playlist_add_check'}, {href: '/validate',text: 'Validate',icon: 'playlist_add_check'},
{href: '/transform',text: 'XSLT Transform',icon: 'input'}, {href: '/transform',text: 'XSLT Transform',icon: 'forward'},
{href: '/tasks',text: 'Tasks',icon: 'history'} {href: '/tasks',text: 'Tasks',icon: 'update'}
]}, ]},
{ {
icon: 'folder_open', icon: 'folder_open',
@ -157,6 +157,8 @@
text: 'Models' , text: 'Models' ,
model: false, model: false,
children: [ children: [
{href: '/namespace', text: 'Namespaces',icon: 'label' },
{href: '/entity', text: 'Entities',icon: 'redeem' },
]}, ]},
{ {
icon: 'cast_connected', icon: 'cast_connected',