-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5325 - Simpler way of adding pre-defined knowledge bases
- Added KnowledgeBaseInitializer interface - Added "Add" button to the knowledge base list
- Loading branch information
Showing
10 changed files
with
1,719 additions
and
9 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
1,336 changes: 1,336 additions & 0 deletions
1,336
...ption/project/initializers/wikidatalinking/WikiDataKnowledgeBaseInitializer.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions
38
...java/de/tudarmstadt/ukp/clarin/webanno/project/initializers/KnowledgeBaseInitializer.java
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,38 @@ | ||
/* | ||
* Licensed to the Technische Universität Darmstadt under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The Technische Universität Darmstadt | ||
* licenses this file to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. | ||
* | ||
* 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. | ||
*/ | ||
package de.tudarmstadt.ukp.clarin.webanno.project.initializers; | ||
|
||
import java.util.Optional; | ||
|
||
import org.apache.wicket.request.resource.ResourceReference; | ||
|
||
import de.tudarmstadt.ukp.inception.project.api.ProjectInitializer; | ||
|
||
public interface KnowledgeBaseInitializer | ||
extends ProjectInitializer | ||
{ | ||
default Optional<String> getDescription() | ||
{ | ||
return Optional.empty(); | ||
} | ||
|
||
default Optional<ResourceReference> getThumbnail() | ||
{ | ||
return Optional.empty(); | ||
} | ||
} |
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
42 changes: 42 additions & 0 deletions
42
...n/java/de/tudarmstadt/ukp/inception/ui/kb/project/KnowledgeBaseTemplateSelectedEvent.java
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,42 @@ | ||
/* | ||
* Licensed to the Technische Universität Darmstadt under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The Technische Universität Darmstadt | ||
* licenses this file to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. | ||
* | ||
* 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. | ||
*/ | ||
package de.tudarmstadt.ukp.inception.ui.kb.project; | ||
|
||
import org.apache.wicket.ajax.AjaxRequestTarget; | ||
import org.wicketstuff.event.annotation.AbstractAjaxAwareEvent; | ||
|
||
import de.tudarmstadt.ukp.clarin.webanno.project.initializers.KnowledgeBaseInitializer; | ||
|
||
public class KnowledgeBaseTemplateSelectedEvent | ||
extends AbstractAjaxAwareEvent | ||
{ | ||
private final KnowledgeBaseInitializer kbInitializer; | ||
|
||
public KnowledgeBaseTemplateSelectedEvent(AjaxRequestTarget aTarget, | ||
KnowledgeBaseInitializer aKBInitializer) | ||
{ | ||
super(aTarget); | ||
|
||
kbInitializer = aKBInitializer; | ||
} | ||
|
||
public KnowledgeBaseInitializer getKnowledgeBaseInitializer() | ||
{ | ||
return kbInitializer; | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
...de/tudarmstadt/ukp/inception/ui/kb/project/KnowledgeBaseTemplateSelectionDialogPanel.html
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,65 @@ | ||
<!DOCTYPE html> | ||
<!-- | ||
Licensed to the Technische Universität Darmstadt under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The Technische Universität Darmstadt | ||
licenses this file to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. | ||
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. | ||
--> | ||
<html xmlns:wicket="http://wicket.apache.org"> | ||
<wicket:head> | ||
<style> | ||
.thumbnail { | ||
height: auto; | ||
object-fit: scale-down; | ||
} | ||
.thumbnail-wrapper { | ||
height: 125px; | ||
width: 125px; | ||
} | ||
.template-card { | ||
transition: box-shadow .3s; | ||
border-color: var(--bs-secondary-color) !important; | ||
} | ||
|
||
.template-card:hover { | ||
box-shadow: 0 0 10px var(--bs-tertiary-color); | ||
} | ||
</style> | ||
</wicket:head> | ||
<wicket:panel> | ||
<div class="modal-header"> | ||
<h5 class="modal-title"> | ||
<wicket:message key="addKnowledgeBaseDialogTitle"/> | ||
</h5> | ||
<button wicket:id="closeDialog" type="button" class="btn-close" aria-label="Close"></button> | ||
</div> | ||
<div class="modal-body overflow-auto pt-0"> | ||
<div wicket:id="container" class="row m-0 g-3"> | ||
<div wicket:id="templates" class="d-flex"> | ||
<button wicket:id="create" class="card template-card d-flex flex-row flex-grow-1 p-0 overflow-hidden"> | ||
<div class="bg-light d-flex flex-grow-0 align-content-center justify-content-center thumbnail-wrapper"> | ||
<img wicket:id="thumbnail" type="button" class="thumbnail"> | ||
</div> | ||
<div class="card-body w-100"> | ||
<h5 wicket:id="name" class="card-title text-start"/> | ||
<div class="card-text text-start"> | ||
<wicket:container wicket:id="description"/> | ||
</div> | ||
</div> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</wicket:panel> | ||
</html> |
Oops, something went wrong.