-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #134 from VizierDB/v1.1
Version 1.1.1
- Loading branch information
Showing
26 changed files
with
546 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.svg"><title>Vizier</title><link href="/static/css/2.5fff324c.chunk.css" rel="stylesheet"><link href="/static/css/main.b41ff8bb.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script src="/env.js"></script><script>!function(e){function r(r){for(var n,l,a=r[0],p=r[1],f=r[2],c=0,s=[];c<a.length;c++)l=a[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in p)Object.prototype.hasOwnProperty.call(p,n)&&(e[n]=p[n]);for(i&&i(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var p=t[a];0!==o[p]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var a=this.webpackJsonpplayground=this.webpackJsonpplayground||[],p=a.push.bind(a);a.push=r,a=a.slice();for(var f=0;f<a.length;f++)r(a[f]);var i=p;t()}([])</script><script src="/static/js/2.680dae7d.chunk.js"></script><script src="/static/js/main.993fa3b4.chunk.js"></script></body></html> | ||
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.svg"><title>Vizier</title><link href="/static/css/2.5fff324c.chunk.css" rel="stylesheet"><link href="/static/css/main.b41ff8bb.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script src="/env.js"></script><script>!function(e){function r(r){for(var n,l,a=r[0],p=r[1],f=r[2],c=0,s=[];c<a.length;c++)l=a[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in p)Object.prototype.hasOwnProperty.call(p,n)&&(e[n]=p[n]);for(i&&i(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var p=t[a];0!==o[p]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var a=this.webpackJsonpplayground=this.webpackJsonpplayground||[],p=a.push.bind(a);a.push=r,a=a.slice();for(var f=0;f<a.length;f++)r(a[f]);var i=p;t()}([])</script><script src="/static/js/2.680dae7d.chunk.js"></script><script src="/static/js/main.6e8d5bbf.chunk.js"></script></body></html> |
4 changes: 2 additions & 2 deletions
4
...urces/ui/static/js/main.993fa3b4.chunk.js → ...urces/ui/static/js/main.6e8d5bbf.chunk.js
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...s/ui/static/js/main.993fa3b4.chunk.js.map → ...s/ui/static/js/main.6e8d5bbf.chunk.js.map
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/main/scala/info/vizierdb/api/GetPublishedArtifact.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* -- copyright-header:v2 -- | ||
* Copyright (C) 2017-2021 University at Buffalo, | ||
* New York University, | ||
* Illinois Institute of Technology. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* -- copyright-header:end -- */ | ||
package info.vizierdb.api | ||
|
||
import scalikejdbc.DB | ||
import play.api.libs.json._ | ||
import org.mimirdb.api.{ Request, Response } | ||
import info.vizierdb.api.handler.{ Handler, ClientConnection } | ||
import info.vizierdb.api.response._ | ||
import info.vizierdb.catalog.PublishedArtifact | ||
|
||
object GetPublishedArtifactHandler | ||
extends Handler | ||
{ | ||
def handle( | ||
pathParameters: Map[String, JsValue], | ||
connection: ClientConnection | ||
): Response = | ||
{ | ||
val published:PublishedArtifact = DB.readOnly { implicit s => | ||
PublishedArtifact.getOption(pathParameters("name").as[String]) | ||
.getOrElse { | ||
return NoSuchEntityResponse() | ||
} | ||
} | ||
|
||
return GetArtifactHandler.handle(Map( | ||
"projectId" -> JsNumber(published.projectId), | ||
"artifactId" -> JsNumber(published.artifactId), | ||
), connection) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
src/main/scala/info/vizierdb/catalog/PublishedArtifact.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* -- copyright-header:v2 -- | ||
* Copyright (C) 2017-2021 University at Buffalo, | ||
* New York University, | ||
* Illinois Institute of Technology. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* -- copyright-header:end -- */ | ||
package info.vizierdb.catalog | ||
|
||
import scalikejdbc._ | ||
import java.net.URL | ||
import play.api.libs.json._ | ||
import info.vizierdb.VizierAPI | ||
import info.vizierdb.types._ | ||
import info.vizierdb.catalog.binders._ | ||
|
||
case class PublishedArtifact( | ||
name: String, | ||
artifactId: Identifier, | ||
projectId: Identifier, | ||
properties: JsObject, | ||
) | ||
{ | ||
def url = VizierAPI.urls.publishedArtifact(name) | ||
def artifact(implicit session: DBSession) = Artifact.get(target = artifactId, projectId = Some(projectId)) | ||
} | ||
|
||
object PublishedArtifact | ||
extends SQLSyntaxSupport[PublishedArtifact] | ||
{ | ||
def apply(rs: WrappedResultSet): PublishedArtifact = autoConstruct(rs, (PublishedArtifact.syntax).resultName) | ||
override def columns = Schema.columns(table) | ||
|
||
def get(name: String)(implicit session: DBSession): PublishedArtifact = | ||
getOption(name).get | ||
def getOption(name: String)(implicit session: DBSession): Option[PublishedArtifact] = | ||
withSQL { | ||
val b = PublishedArtifact.syntax | ||
select | ||
.from(PublishedArtifact as b) | ||
.where.eq(b.name, name) | ||
}.map { apply(_) }.single.apply() | ||
def make( | ||
artifact: Artifact, | ||
name: Option[String] = None, | ||
properties: JsObject = Json.obj(), | ||
overwrite: Boolean = false | ||
)(implicit session: DBSession): PublishedArtifact = | ||
{ | ||
val actualName = name.getOrElse { s"${artifact.t}_${artifact.id}"} | ||
if(overwrite){ | ||
withSQL { | ||
val a = PublishedArtifact.column | ||
deleteFrom(PublishedArtifact) | ||
.where.eq(a.name, actualName) | ||
}.update.apply() | ||
} | ||
withSQL { | ||
val a = PublishedArtifact.column | ||
insertInto(PublishedArtifact) | ||
.namedValues( | ||
a.name -> actualName, | ||
a.artifactId -> artifact.id, | ||
a.projectId -> artifact.projectId, | ||
a.properties -> properties | ||
) | ||
}.update.apply() | ||
PublishedArtifact( | ||
name = actualName, | ||
artifactId = artifact.id, | ||
projectId = artifact.projectId, | ||
properties = properties | ||
) | ||
} | ||
|
||
def nameFromURL(url: String): Option[String] = | ||
{ | ||
val base = | ||
VizierAPI.urls.publishedArtifact("").toString | ||
if(url.startsWith(base)){ | ||
Some(url.drop(base.length).split("/").head) | ||
} else { | ||
return None | ||
} | ||
} | ||
|
||
|
||
{ | ||
} | ||
} |
Oops, something went wrong.