You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@clerezza.apache.org by re...@apache.org on 2015/04/14 15:12:43 UTC
[08/87] [abbrv] [partial] clerezza git commit: CLEREZZA-966: removed
platform. prefix of folder names
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/RemoteConceptsDescriptionManager.java
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/RemoteConceptsDescriptionManager.java b/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/RemoteConceptsDescriptionManager.java
deleted file mode 100644
index 7932829..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/RemoteConceptsDescriptionManager.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF 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. 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.
- */
-package org.apache.clerezza.platform.concepts.core;
-
-import java.util.Iterator;
-import org.apache.clerezza.rdf.core.Graph;
-import org.apache.clerezza.rdf.core.Literal;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.Triple;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
-import org.apache.clerezza.rdf.core.access.TcManager;
-import org.apache.clerezza.rdf.ontologies.RDF;
-import org.apache.clerezza.rdf.ontologies.RDFS;
-import org.apache.clerezza.rdf.ontologies.SKOS;
-import org.apache.clerezza.rdf.utils.GraphNode;
-
-/**
- * This class stores description of concepts resulted from searches
- * performed by {@link RemoteConceptProvider}s.
- *
- * @author hasan
- */
-public class RemoteConceptsDescriptionManager {
-
- private UriRef REMOTE_CONCEPTS_DESCRIPTION_MGRAPH =
- new UriRef("urn:x-localinstance:/remote.concepts.description");
-
- /**
- * Stores SKOS:prefLabel and RDFS.comment of concepts available in the
- * specified Graph.
- *
- * @param graph
- * the Graph which contains concepts and their descriptions.
- */
- void storeConceptsDescription(Graph graph) {
- MGraph remoteConceptsDescriptionMGraph =
- getRemoteConceptsDescriptionMGraph();
-
- Iterator<Triple> concepts = graph.filter(null, RDF.type, SKOS.Concept);
- while (concepts.hasNext()) {
- UriRef concept = (UriRef) concepts.next().getSubject();
- copyConceptDescription(new GraphNode(concept, graph),
- new GraphNode(concept, remoteConceptsDescriptionMGraph));
- }
- }
-
- /**
- * This method creates an {@link MGraph} to store concepts' descriptions
- * if this graph does not already exist.
- *
- * @return
- * an {@link MGraph}
- */
- public MGraph getRemoteConceptsDescriptionMGraph() {
- MGraph remoteConceptsDescriptionMGraph = null;
- TcManager tcManager = TcManager.getInstance();
- try {
- remoteConceptsDescriptionMGraph =
- tcManager.getMGraph(REMOTE_CONCEPTS_DESCRIPTION_MGRAPH);
- } catch (NoSuchEntityException nsee) {
- remoteConceptsDescriptionMGraph =
- tcManager.createMGraph(REMOTE_CONCEPTS_DESCRIPTION_MGRAPH);
- }
- return remoteConceptsDescriptionMGraph;
- }
-
- private void copyConceptDescription(GraphNode sourceGraphNode,
- GraphNode destinationGraphNode) {
-
- destinationGraphNode.deleteNodeContext();
-
- Iterator<Literal> prefLabelStatements =
- sourceGraphNode.getLiterals(SKOS.prefLabel);
- if (prefLabelStatements.hasNext()) {
- destinationGraphNode.addProperty(SKOS.prefLabel,
- prefLabelStatements.next());
- }
- Iterator<Literal> commentStatements =
- sourceGraphNode.getLiterals(RDFS.comment);
- while (commentStatements.hasNext()) {
- destinationGraphNode.addProperty(RDFS.comment,
- commentStatements.next());
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ResourceTagger.java
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ResourceTagger.java b/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ResourceTagger.java
deleted file mode 100644
index 3bff348..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/ResourceTagger.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF 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. 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.
- */
-package org.apache.clerezza.platform.concepts.core;
-
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.List;
-
-import javax.ws.rs.FormParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-import javax.ws.rs.core.UriInfo;
-
-import org.apache.clerezza.jaxrs.utils.RedirectUtil;
-import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
-import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesService;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.ontologies.DCTERMS;
-import org.apache.clerezza.rdf.ontologies.RDFS;
-import org.apache.clerezza.rdf.utils.GraphNode;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
-import org.osgi.framework.BundleContext;
-import org.osgi.service.component.ComponentContext;
-
-/**
- * This JAX-RS resource can be used for adding concepts to a resource.
- *
- * The URI path of this service is /concepts/tagger.
- *
- * @author tio
- */
-@Component
-@Service(Object.class)
-@Property(name = "javax.ws.rs", boolValue = true)
-@Path("/concepts/tagger/")
-public class ResourceTagger {
-
- @Reference
- protected ContentGraphProvider cgProvider;
- @Reference
- private ScalaServerPagesService scalaServerPagesService;
-
- protected void activate(ComponentContext context)
- throws URISyntaxException {
-
- BundleContext bundleContext = context.getBundleContext();
- URL template = getClass().getResource("concept-existing-subjects.ssp");
-
- scalaServerPagesService.registerScalaServerPage(
- template,
- RDFS.Resource, "concept-existing-subjects-naked",
- MediaType.APPLICATION_XHTML_XML_TYPE, bundleContext);
-
- template = getClass().getResource("concept-tagging.ssp");
- scalaServerPagesService.registerScalaServerPage(
- template,
- RDFS.Resource, "concept-tagging-naked",
- MediaType.APPLICATION_XHTML_XML_TYPE, bundleContext);
-
- template = getClass().getResource("concept-find-create.ssp");
- scalaServerPagesService.registerScalaServerPage(
- template,
- RDFS.Resource, "concept-find-create-naked",
- MediaType.APPLICATION_XHTML_XML_TYPE, bundleContext);
-
- template = getClass().getResource("selected-concepts.ssp");
- scalaServerPagesService.registerScalaServerPage(
- template,
- RDFS.Resource, "selectedconcepts-naked",
- MediaType.APPLICATION_XHTML_XML_TYPE, bundleContext);
- }
-
- /**
- * Adds concepts to a resource. If parameters uri and
- * concepts are not defined a response with code BAD_REQUEST is returned. If
- * the relation is succefully added a redirect to /concepts/generic-resource with
- * the UriRef of the resource as parameter.
- *
- * @param uri specifies the uri of a resource
- * @param concepts specifies a list of concept uris.
- *
- * @return
- * A Response
- */
- @POST
- @Path("set")
- public Response updateConcepts(@FormParam("uri") UriRef uri,
- @FormParam("concepts") List<String> concepts,
- @Context UriInfo uriInfo) {
-
-
- if (uri != null) {
- GraphNode node = new GraphNode(uri, cgProvider.getContentGraph());
- node.deleteProperties(DCTERMS.subject);
- if(concepts != null) {
- for (String subject : concepts) {
- node.addProperty(DCTERMS.subject, new UriRef(subject));
- }
- }
- } else {
- throw new WebApplicationException(Response.status(
- Status.BAD_REQUEST).entity("No resource uri defined.").build());
- }
- return RedirectUtil.createSeeOtherResponse("/concepts/generic-resource?uri=" +
- uri.getUnicodeString(), uriInfo);
- }
-}
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/SimpleConceptProviderManager.java
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/SimpleConceptProviderManager.java b/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/SimpleConceptProviderManager.java
deleted file mode 100644
index 98ee7cc..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/java/org/apache/clerezza/platform/concepts/core/SimpleConceptProviderManager.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF 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. 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.
- */
-package org.apache.clerezza.platform.concepts.core;
-
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.security.AccessControlException;
-import java.security.AccessController;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-import javax.ws.rs.core.UriInfo;
-import org.apache.clerezza.jaxrs.utils.TrailingSlash;
-import org.apache.clerezza.platform.concepts.ontologies.CONCEPTS;
-import org.apache.clerezza.platform.globalmenu.GlobalMenuItem;
-import org.apache.clerezza.platform.globalmenu.GlobalMenuItemsProvider;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.clerezza.platform.graphprovider.content.ContentGraphProvider;
-import org.apache.clerezza.platform.typerendering.RenderletManager;
-import org.apache.clerezza.platform.typerendering.scalaserverpages.ScalaServerPagesRenderlet;
-import org.apache.clerezza.rdf.core.BNode;
-import org.apache.clerezza.rdf.core.LiteralFactory;
-import org.apache.clerezza.rdf.core.MGraph;
-import org.apache.clerezza.rdf.core.NonLiteral;
-import org.apache.clerezza.rdf.core.Triple;
-import org.apache.clerezza.rdf.core.TypedLiteral;
-import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.access.TcManager;
-import org.apache.clerezza.rdf.core.access.security.TcPermission;
-import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
-import org.apache.clerezza.rdf.core.impl.TripleImpl;
-import org.apache.clerezza.rdf.ontologies.PLATFORM;
-import org.apache.clerezza.rdf.ontologies.RDF;
-import org.apache.clerezza.rdf.utils.GraphNode;
-import org.apache.clerezza.rdf.utils.RdfList;
-import org.apache.clerezza.rdf.utils.UnionMGraph;
-import org.apache.felix.scr.annotations.Services;
-import org.osgi.service.component.ComponentContext;
-
-/**
- * This service manages concept providers. Concept providers are prioritized.
- *
- * The URI path of this service is /concepts/provider-manager.
- *
- * @author hasan, tio
- */
-@Component
-@Services({
- @Service(Object.class),
- @Service(ConceptProviderManager.class),
- @Service(GlobalMenuItemsProvider.class)
-})
-@Property(name = "javax.ws.rs", boolValue = true)
-@Path("/concepts/provider-manager")
-public class SimpleConceptProviderManager implements ConceptProviderManager,
- GlobalMenuItemsProvider {
-
- @Reference
- private TcManager tcManager;
-
- @Reference
- protected ContentGraphProvider cgProvider;
-
- @Reference
- private RenderletManager renderletManager;
-
- private List<ConceptProvider> conceptProviderList =
- new ArrayList<ConceptProvider>();
-
- /**
- * The activate method is called when SCR activates the component
- * configuration.
- *
- * @param context
- * @throws IOException
- * @throws URISyntaxException
- */
- protected void activate(ComponentContext context)
- throws IOException,
- URISyntaxException {
-
- URL template = getClass().getResource("manage-concept-providers-page.ssp");
- renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
- new UriRef(template.toURI().toString()),
- CONCEPTS.ManageConceptProvidersPage, "naked",
- MediaType.APPLICATION_XHTML_XML_TYPE, true);
-
- instantiateConceptProviders();
- }
-
- protected void deactivate(ComponentContext context) {
- conceptProviderList.clear();
- }
-
- private void instantiateConceptProviders() {
- conceptProviderList.clear();
- MGraph contentGraph = cgProvider.getContentGraph();
-
- NonLiteral cplNode = getConceptProviderListNode(contentGraph);
- RdfList cpl = new RdfList(cplNode, contentGraph);
- for (int i = 0; i < cpl.size(); i++) {
- NonLiteral conceptProvider = (NonLiteral) cpl.get(i);
- Iterator<Triple> conceptProviderTypes = contentGraph.filter(
- conceptProvider, RDF.type, null);
- if (conceptProviderTypes.hasNext()) {
- UriRef conceptProviderType = (UriRef) conceptProviderTypes.next().getObject();
- if (conceptProviderType.equals(CONCEPTS.LocalConceptProvider)) {
- instantiateLocalConceptProvider(contentGraph, conceptProvider);
- } else {
- instantiateRemoteConceptProvider(contentGraph, conceptProvider);
- }
- }
- }
- }
-
- private NonLiteral getConceptProviderListNode(MGraph contentGraph) {
- Iterator<Triple> triples = contentGraph.filter(null, RDF.type,
- CONCEPTS.ConceptProviderList);
- if (triples.hasNext()) {
- return triples.next().getSubject();
- }
- NonLiteral cplNode = new BNode();
- new RdfList(cplNode, contentGraph);
- contentGraph.add(new TripleImpl(cplNode, RDF.type,
- CONCEPTS.ConceptProviderList));
- return cplNode;
- }
-
- private void instantiateLocalConceptProvider(MGraph contentGraph,
- NonLiteral conceptProvider) {
- Iterator<Triple> selectedSchemes = contentGraph.filter(
- conceptProvider, CONCEPTS.selectedScheme, null);
- if (selectedSchemes.hasNext()) {
- UriRef selectedScheme = (UriRef) selectedSchemes.next().getObject();
- conceptProviderList.add(new LocalConceptProvider(tcManager,
- cgProvider, selectedScheme));
- }
- }
-
- private void instantiateRemoteConceptProvider(MGraph contentGraph,
- NonLiteral conceptProvider) {
- Iterator<Triple> endPoints = contentGraph.filter(
- conceptProvider, CONCEPTS.sparqlEndPoint, null);
- if (endPoints.hasNext()) {
- UriRef sparqlEndPoint = (UriRef) endPoints.next().getObject();
- Iterator<Triple> defaultGraphs = contentGraph.filter(
- conceptProvider, CONCEPTS.defaultGraph, null);
- UriRef defaultGraph = null;
- if (defaultGraphs.hasNext()) {
- defaultGraph = (UriRef) defaultGraphs.next().getObject();
- }
- Iterator<Triple> queryTemplates = contentGraph.filter(
- conceptProvider, CONCEPTS.queryTemplate, null);
- if (queryTemplates.hasNext()) {
- TypedLiteral queryTemplate =
- (TypedLiteral) queryTemplates.next().getObject();
- conceptProviderList.add(
- new RemoteConceptProvider(sparqlEndPoint,
- defaultGraph, queryTemplate.getLexicalForm()));
- }
- }
- }
-
- /**
- * Returns a GraphNode containing a list of {@link ConceptProvider}s stored
- * in the content graph to be managed. The order in the list represents
- * the priority of the providers.
- * This resource is accessible through a GET request on the URI sub-path
- * "edit-concept-provider-list".
- *
- */
- @GET
- @Path("edit-concept-provider-list")
- public GraphNode getProviderList(@Context UriInfo uriInfo) {
- AccessController.checkPermission(
- new ConceptProviderManagerAppPermission());
- TrailingSlash.enforceNotPresent(uriInfo);
- MGraph contentGraph = cgProvider.getContentGraph();
- MGraph resultGraph = new SimpleMGraph();
-
- NonLiteral cplNode = getConceptProviderListNode(contentGraph);
- GraphNode resultNode = new GraphNode(cplNode, resultGraph);
-
- resultNode.addProperty(RDF.type, CONCEPTS.ManageConceptProvidersPage);
- resultNode.addProperty(RDF.type, PLATFORM.HeadedPage);
- return new GraphNode(resultNode.getNode(),
- new UnionMGraph(resultGraph, contentGraph));
- }
-
- /**
- * Allows the list of {@link ConceptProvider}s stored in the content graph
- * to be updated with the list POSTed via the URI sub-path
- * "update-concept-provider-list".
- * The order in the list represents the priority of the providers.
- *
- * @param types
- * specify the type of each ConceptProvider: either a
- * LocalConceptProvider or a RemoteConceptProvider.
- * @param sparqlEndPoints
- * the SPARQL EndPoint to connect to in case of a RemoteConceptProvider.
- * @param defaultGraphs
- * the Graph to be queried in case of a RemoteConceptProvider.
- * @param queryTemplates
- * the template for the query to be used in case of a RemoteConceptProvider.
- * @param conceptSchemes
- * the concept scheme within which concepts are to be searched,
- * in case of a LocalConceptProvider.
- * @return
- * - a 200 (OK) response if everything is fine.
- * - a 400 (BAD REQUEST) response if types parameter is undefined.
- */
- @POST
- @Path("update-concept-provider-list")
- public Response updateConceptProviders(
- @FormParam("types") List<String> types,
- @FormParam("sparqlEndPoints") List<String> sparqlEndPoints,
- @FormParam("defaultGraphs") List<String> defaultGraphs,
- @FormParam("queryTemplates") List<String> queryTemplates,
- @FormParam("conceptSchemes") List<String> conceptSchemes) {
-
- if (types == null) {
- //types is null when all provider have been removed, processing empty list
- types = new ArrayList<String>();
- }
- MGraph contentGraph = cgProvider.getContentGraph();
- NonLiteral cplNode = getConceptProviderListNode(contentGraph);
- GraphNode cplGraphNode = new GraphNode(cplNode, contentGraph);
- cplGraphNode.deleteNodeContext();
-
- cplNode = getConceptProviderListNode(contentGraph);
- RdfList cpl = new RdfList(cplNode, contentGraph);
-
- int length = types.size();
- for (int i=0; i<length; i++) {
- UriRef conceptProviderType = new UriRef(types.get(i));
- BNode conceptProvider = new BNode();
- contentGraph.add(new TripleImpl(conceptProvider, RDF.type,
- conceptProviderType));
- if (conceptProviderType.equals(CONCEPTS.LocalConceptProvider)) {
- contentGraph.add(new TripleImpl(conceptProvider,
- CONCEPTS.selectedScheme,
- new UriRef(conceptSchemes.get(i))));
- } else {
- contentGraph.add(new TripleImpl(conceptProvider,
- CONCEPTS.sparqlEndPoint,
- new UriRef(sparqlEndPoints.get(i))));
- String defaultGraph = defaultGraphs.get(i);
- if (!defaultGraph.trim().isEmpty()) {
- contentGraph.add(new TripleImpl(conceptProvider,
- CONCEPTS.defaultGraph,
- new UriRef(defaultGraph)));
- }
- contentGraph.add(new TripleImpl(conceptProvider,
- CONCEPTS.queryTemplate,
- LiteralFactory.getInstance().createTypedLiteral(
- queryTemplates.get(i))));
- }
- cpl.add(i, conceptProvider);
- }
- instantiateConceptProviders();
- return Response.status(Status.OK).build();
- }
-
- @Override
- public List<ConceptProvider> getConceptProviders() {
- return conceptProviderList;
- }
-
- @Override
- public Set<GlobalMenuItem> getMenuItems() {
- Set<GlobalMenuItem> items = new HashSet<GlobalMenuItem>();
- try {
- AccessController.checkPermission(
- new TcPermission("urn:x-localinstance:/content.graph",
- TcPermission.READWRITE));
- } catch (AccessControlException e) {
- return items;
- }
- try {
- AccessController.checkPermission(
- new ConceptProviderManagerAppPermission());
- } catch (AccessControlException e) {
- return items;
- }
- items.add(new GlobalMenuItem("/concepts/provider-manager/edit-concept-provider-list",
- "CPM", "Concept Providers", 5, "Administration"));
- return items;
- }
-}
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-find-create.js
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-find-create.js b/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-find-create.js
deleted file mode 100644
index 67c4ee4..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-find-create.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF 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. 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.
- *
-*/
-
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-provider-manipulation.js
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-provider-manipulation.js b/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-provider-manipulation.js
deleted file mode 100644
index 67c4ee4..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/concept-provider-manipulation.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF 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. 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.
- *
-*/
-
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/selected-concepts.js
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/selected-concepts.js b/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/selected-concepts.js
deleted file mode 100644
index 67c4ee4..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/scripts/selected-concepts.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF 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. 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.
- *
-*/
-
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/style/form.css
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/style/form.css b/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/style/form.css
deleted file mode 100644
index 67c4ee4..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/META-INF/static-web/concepts/style/form.css
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF 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. 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.
- *
-*/
-
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-existing-subjects.ssp
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-existing-subjects.ssp b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-existing-subjects.ssp
deleted file mode 100644
index 823cb97..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-existing-subjects.ssp
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF 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. 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.
- *
-*/
-
-def skos(s: Any) = new UriRef("http://www.w3.org/2008/05/skos#"+s)
-def dct(s: Any) = new UriRef("http://purl.org/dc/terms/"+s)
-def cpt(s: Any) = new UriRef("http://clerezza.org/2010/01/concepts#"+s);
-
-<form method="post" action="/concepts/tagger/set" id="selected-concepts-form">
- <input type="hidden" name="uri" value={res/cpt("resource")*}></input>
- {render(res/cpt("resource"), "selectedconcepts-naked")}
-</form>
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-find-create.ssp
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-find-create.ssp b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-find-create.ssp
deleted file mode 100644
index c0436d8..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-find-create.ssp
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF 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. 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.
- *
-*/
-
-resultDocModifier.addScriptReference("/jquery/jquery-1.3.2.min.js");
-resultDocModifier.addScriptReference("/scripts/ajax-options.js");
-//resultDocModifier.addScriptReference("/scripts/modification-status.js");
-resultDocModifier.addScriptReference("/scripts/status-message.js");
-
-resultDocModifier.addScriptReference("/concepts/generic-resource/scripts/concept-find-create.js");
-resultDocModifier.addScriptReference("/concepts/generic-resource/scripts/jquery.rdfquery.core-1.0.js");
-
-resultDocModifier.addScriptReference("/scripts/alert-message.js");
-resultDocModifier.addScriptReference("/yui/2/yahoo-dom-event/yahoo-dom-event.js");
-resultDocModifier.addScriptReference("/yui/2/element/element-min.js");
-resultDocModifier.addScriptReference("/yui/2/container/container-min.js");
-resultDocModifier.addStyleSheet("/yui/2/container/assets/container-core.css");
-
-
-<div>Add Concepts</div>
-<form onsubmit="return ConceptFinder.search()" id="search-form">
- <br/>
- <input type="text" value="" name="search-term"/>
- <a href="#" id="go-button" class="tx-icon tx-icon-search">Go</a>
- <br/>
- <br/>
- <div id="system-found-concepts-area">
- <div id="label-for-search-results">
- Found Concepts:
- </div>
- <br/>
- <div id="system-found-concepts"></div>
- </div>
- <br/>
- <div id="user-defined-concept-area">
- <div id="add-button-label"></div>
- <div>Description (optional):</div>
- <textarea rows="8" id="concept-description" name="comment"/>
- <input type="hidden" value="en" name="lang"/>
- <div>
- <a href="#" class="tx-icon tx-icon-plus" id="add-user-defined-concept">Add</a>
- </div>
- </div>
-</form>
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-tagging.ssp
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-tagging.ssp b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-tagging.ssp
deleted file mode 100644
index a81d5a2..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/concept-tagging.ssp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF 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. 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.
- *
-*/
-
-<div class="concept-tagging">{render(res,"concept-existing-subjects-naked")}
-{render(res,"concept-find-create-naked")}</div>
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/generic-resource-page.ssp
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/generic-resource-page.ssp b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/generic-resource-page.ssp
deleted file mode 100644
index e27759b..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/generic-resource-page.ssp
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF 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. 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.
- *
-*/
-
-def skos(s: Any) = new UriRef("http://www.w3.org/2008/05/skos#"+s)
-def dct(s: Any) = new UriRef("http://purl.org/dc/terms/"+s)
-def cpt(s: Any) = new UriRef("http://clerezza.org/2010/01/concepts#"+s);
-
-resultDocModifier.setTitle("Generic Resource Page");
-resultDocModifier.addNodes2Elem("tx-module", <h1>Generic Resource Page</h1>);
-resultDocModifier.addNodes2Elem("tx-module-tabs-ol", <li class="tx-active"><a href="#">Resource</a></li>);
-resultDocModifier.addNodes2Elem("tx-contextual-buttons-ol", <li><a id="addButton" class="tx-button tx-button-create" href="#">Save</a></li>);
-
-<div id="tx-content">
- <script type="text/javascript">
- $(document).ready(function() {{
- $("#addButton").click(function() {{
- $("#selected-concepts-form").submit();
- }});
- }});
- </script>
- <h4>About: {res/cpt("resource")*}</h4>
- <div><object width="80%" data={res/cpt("resource")*}></object></div>
- <br/>
- {render(res,"concept-tagging-naked")}
-</div>
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/manage-concept-providers-page.ssp
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/manage-concept-providers-page.ssp b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/manage-concept-providers-page.ssp
deleted file mode 100644
index e0ef754..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/manage-concept-providers-page.ssp
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF 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. 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.
- *
-*/
-
-def skos(s: Any) = new UriRef("http://www.w3.org/2008/05/skos#"+s)
-def cpt(s: Any) = new UriRef("http://clerezza.org/2010/01/concepts#"+s)
-def lingvoj(s: Any) = new UriRef("http://www.lingvoj.org/ontology#"+s)
-def rdfs(s: Any) = new UriRef("http://www.w3.org/2000/01/rdf-schema#"+s)
-def rdf(s: Any) = new UriRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#"+s)
-
-def createProvider(rdfType: String, selectedScheme: String, sparqlEndPoint: String, defaultGraph: String, query: String) =
- <tr>
- <td>
- <input type="checkbox" value={rdfType}/>
- </td>
- <td>
- <div>Provider:
- </div>
- {createSelection(!selectedScheme.equals(""))}
- <br/>
- <div>Concept Scheme:</div>
- <input type="text" value={selectedScheme} name="conceptSchemes"/>
- <div>SPARQL Endpoint:</div>
- <input type="text" value={sparqlEndPoint} name="sparqlEndPoints"/>
- <div>Default Graph:</div>
- <input type="text" value={defaultGraph} name="defaultGraphs"/>
- <div>Query Template:</div>
- <textarea rows="8" name="queryTemplates">{query}</textarea>
- <br/>
- <br/>
- </td>
- </tr>
-
-
-def createSelection(isLocal: Boolean) = <select name="types">
- {if(isLocal) {
- <option value={cpt("LocalConceptProvider").getUnicodeString()} selected="selected">LocalConceptProvider</option>
- <option value={cpt("RemoteConceptProvider").getUnicodeString()} >RemoteConceptProvider</option>
- } else {
- <option value={cpt("LocalConceptProvider").getUnicodeString()}>LocalConceptProvider</option>
- <option value={cpt("RemoteConceptProvider").getUnicodeString()} selected="selected">RemoteConceptProvider</option>
- }}
- </select>
-
-resultDocModifier.addStyleSheet("/static/concepts/style/form.css");
-resultDocModifier.addScriptReference("/jquery/jquery.tooltip.pack.js");
-resultDocModifier.addScriptReference("/jquery/jquery.ajaxQueue.js");
-resultDocModifier.addScriptReference("/jquery/jquery.autocomplete.min.js");
-resultDocModifier.addScriptReference("/yui/2/yahoo-dom-event/yahoo-dom-event.js");
-/*resultDocModifier.addScriptReference("/yui/2/container/assets/container-core.css");*/
-resultDocModifier.addScriptReference("/yui/2/container/container-min.js");
-resultDocModifier.addScriptReference("/scripts/alert-message.js");
-resultDocModifier.addScriptReference("/scripts/ajax-options.js");
-resultDocModifier.addScriptReference("/concepts/generic-resource/scripts/concept-provider-manipulation.js");
-resultDocModifier.setTitle("Resource Tagging");
-resultDocModifier.addNodes2Elem("tx-module", <h1>Resource Tagging</h1>);
-
-resultDocModifier.addNodes2Elem("tx-module-tabs-ol", <li class="tx-active"><a href="">Concept Providers Manager</a></li>);
-
-resultDocModifier.addNodes2Elem("tx-contextual-buttons-ol", <li><a id="deleteButton" class="tx-button tx-button-remove" href="#">Remove</a></li>);
-resultDocModifier.addNodes2Elem("tx-contextual-buttons-ol", <li><a id="addButton" class="tx-button tx-button-create" href="#">Save</a></li>);
-
-<div id="tx-content">
- <div class="tx-tree">
- <form action="" id="providers" method="post">
- <fieldset>
- <table>
- <thead>
- <tr>
- <th><a href="#"></a></th>
- <th style="width: 95%"><a href="#"></a>Concept Providers</th>
- </tr>
- </thead>
- <tbody>
- { for (provider <- (res!!)) yield {
- if((provider/rdf("type")*).indexOf("LocalConceptProvider") != -1) {
- createProvider((provider/rdf("type")*), provider/cpt("selectedScheme")*, "", "", "")
- } else {
- createProvider((provider/rdf("type")*), "", provider/cpt("sparqlEndPoint")*, provider/cpt("defaultGraph")*, provider/cpt("queryTemplate")*)
- }
- }
- }
- <tr id="last">
- <td></td>
- <td>
- <div>Add Concept Provider:</div>
- <select id="type">
- <option value={cpt("LocalConceptProvider").getUnicodeString()}>LocalConceptProvider</option>
- <option value={cpt("RemoteConceptProvider").getUnicodeString()}>RemoteConceptProvider</option>
- </select>
- <div>Concept Scheme:</div>
- <input type="text" name="conceptScheme" id="conceptScheme"/>
- <div>SPARQL Endpoint</div>
- <input type="text" name="sparqlEndPoint" id="sparqlEndPoint" />
- <div>Default Graph:</div>
- <input type="text" name="defaultGraph" id="defaultGraph"/>
- <div>Query Template:</div>
- <textarea rows="8" id="query"/>
- <br/>
- <br/>
- <div>
- <a href="#" class="tx-icon tx-icon-ok" id="addProvider">Add</a>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </fieldset>
- </form>
- </div>
-</div>
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/selected-concepts.ssp
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/selected-concepts.ssp b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/selected-concepts.ssp
deleted file mode 100644
index 707c11a..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/selected-concepts.ssp
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF 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. 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.
- *
-*/
-
-def skos(s: Any) = new UriRef("http://www.w3.org/2008/05/skos#"+s)
-def dct(s: Any) = new UriRef("http://purl.org/dc/terms/"+s)
-
-resultDocModifier.addScriptReference("/concepts/generic-resource/scripts/selected-concepts.js");
-
-<div>
- <div id="selected-concepts">
- {for (concept <- (res/dct("subject"))) yield {
- <div>
- <div>PrefLabel: {concept/skos("prefLabel")*}</div>
- <div>Uri: {concept*}</div>
- <input type="hidden" name="concepts" value={concept*}></input>
- <a href="#" class="tx-icon tx-icon-delete" >Remove</a>
- <br />
- <br />
- </div>
- }
- }
- </div>
-</div>
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/skos-collection-json.ssp
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/skos-collection-json.ssp b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/skos-collection-json.ssp
deleted file mode 100644
index 5ee4663..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/skos-collection-json.ssp
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF 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. 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.
- *
-*/
-
-import org.json.simple.JSONObject
-
-def skos(s: Any) = new UriRef("http://www.w3.org/2008/05/skos#"+s)
-
-"{\"concepts\":" +
- (for (concept <- (res/skos("member"))) yield {
- "{" +
- "\"prefLabel\":\"" + JSONObject.escape(concept/skos("prefLabel")*) + "\"," +
- "\"uri\":\"" + JSONObject.escape(concept*) + "\"" +
- "}"
- }).mkString("[", ",", "]") +
-"}";
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-find-create.js
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-find-create.js b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-find-create.js
deleted file mode 100644
index e31bd88..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-find-create.js
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF 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. 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.
- *
- * @author hasan, andre
- */
-function ConceptFinder(){
-};
-
-ConceptFinder.callback;
-
-ConceptFinder.setAddConceptCallback = function(callback){
- this.callback = callback;
-}
-
-/**
- * Request the server concepts that match the search term in the input field "search-term"
- */
-ConceptFinder.search = function(){
- $("#system-found-concepts").empty();
- var queryResult = null;
- var searchTerm = $(":text[name=\"search-term\"]").val();
- if (searchTerm.length > 0) {
- var options = new AjaxOptions("find-concepts", "finding concepts", function(data){
- var databank = $.rdf.databank();
- var store = databank.load(data, {});
- var query = $.rdf({
- databank: store
- });
- query.prefix('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#');
- query.prefix('concepts', 'http://clerezza.org/2010/01/concepts#');
- query.prefix('rdfs', 'http://www.w3.org/2000/01/rdf-schema#');
- query.prefix('qr', 'http://clerezza.org/2010/04/queryresult#');
- var resultSet = query.where('?subject rdf:type qr:QueryResult');
- if (resultSet.size() != 1) {
- AlertMessage.show(function(){
- }, "The query results did not match what's expected: exactly 1 result");
- }
- var queryResult = query.node(resultSet.get(0).subject);
- var conceptProperty = $.rdf.resource("<http://clerezza.org/2010/04/queryresult#concept>");
- var conceptProperties = queryResult.get(conceptProperty);
- if (conceptProperties) {
- ConceptFinder.addFoundConcepts(conceptProperties);
- }
- $("#add-button-label").html("<div>Add '" + searchTerm + "' as new Free Concept</div>");
- $("#system-found-concepts-area").show();
- var newFreeConceptProperty = $.rdf.resource("<http://clerezza.org/2010/04/queryresult#creationOfNewFreeConceptSuggested>");
- var creationOfNewFreeConceptSuggested = queryResult.get(newFreeConceptProperty)[0].value.toString() == "true";
- if (creationOfNewFreeConceptSuggested) {
- $("#user-defined-concept-area").show();
- } else {
- $("#user-defined-concept-area").hide();
- }
- });
- options.url = "/concepts/find";
- options.data = "searchTerm=" + encodeURIComponent(searchTerm) + "&xPropObj=http://clerezza.org/2010/04/queryresult%23concept";
- options.dataType = "json";
- options.beforeSend = function(req){
- req.setRequestHeader("Accept", "application/rdf+json");
- };
-
- $.ajax(options);
- }
- return false;
-}
-
-/**
- * Adds the given (array of) concepts to the UI (that's currently being displayed). Displays them by a
- * +-button and labels (for each of them)
- *
- * @param Json array of concepts
- */
-ConceptFinder.addFoundConcepts = function(concepts){
- var selectedConceptsExists = false;
- if (typeof(SelectedConcepts) != "undefined") {
- selectedConceptsExists = true;
- }
- var added = false;
- for (var i = 0; i < concepts.length; i++) {
- var concept = concepts[i];
- if (!selectedConceptsExists || !SelectedConcepts.exists(concept.value)) {
- added = true;
- var prefLabelProperty = $.rdf.resource("<http://www.w3.org/2008/05/skos#prefLabel>");
- var prefLabel = concept.get(prefLabelProperty).value;
- var uri = concept.value;
- ConceptFinder.createSystemFoundConcept(prefLabel, uri);
- }
- }
- if (added) {
- $("#label-for-search-results").text("Concepts found:");
- }
- else {
- $("#label-for-search-results").text("No additional concepts found.");
- }
-}
-
-/**
- * Creates the widget that show the user a concept that was found on the backend. Shows prefLabel,
- * uri and a button to add the concept to the backend
- *
- * @param {Object} prefLabel
- * @param {Object} uri
- */
-ConceptFinder.createSystemFoundConcept = function(prefLabel, uri) {
- var div = $("<div/>");
- ConceptFinder.createConceptWidgets(prefLabel, uri).appendTo(div)
- $("<a/>").addClass("tx-icon tx-icon-plus").attr({
- href: "#"
- }).text("Add").click(ConceptFinder.onAddClicked(prefLabel, uri)).appendTo(div);
- $("<br/>").appendTo(div);
- $("<br/>").appendTo(div);
- div.appendTo("#system-found-concepts")
-}
-
-ConceptFinder.onAddClicked = function(prefLabel, uri){
- return function(){
- if (typeof(SelectedConcepts) != "undefined") {
- SelectedConcepts.addConcept(prefLabel, uri);
- }
- if (typeof(ConceptFinder.callback) == "function") {
- ConceptFinder.callback(prefLabel, uri);
- }
- $(this).parent().remove();
- };
-}
-
-/**
- * Creates html elements that show the given pref label and uri. Appends them to the given div.
- *
- * @param {Object} prefLabel
- * @param {Object} uri
- * @param {Object} div
- */
-ConceptFinder.createConceptWidgets = function(prefLabel, uri) {
- var div = $("<div/>");
- if (prefLabel.substr(0,1) == "\"") {
- prefLabel = prefLabel.substring(1, prefLabel.length - 1);
- }
- $("<div/>").text("PrefLabel: " + prefLabel).appendTo(div);
- $("<div/>").text("Uri: " + uri).appendTo(div);
- $("<input/>").attr({
- "type": "hidden",
- "name": "concepts"
- }).val(uri).appendTo(div);
- return div;
-}
-
-/**
- * Checks if a concept with the given uri already exists
- * @param {Object} uri
- */
-ConceptFinder.exists = function(uri){
-
-};
-
-function ConceptManipulator(){
-};
-
-ConceptManipulator.callback;
-
-ConceptManipulator.setAddConceptCallback = function(callback){
- this.callback = callback;
-}
-
-/**
- * sends a new concept to the backend for addition. Uses the search term entered by the user (in the same form).
- */
-ConceptManipulator.addConcept = function(){
- var searchTerm = $(":text[name='search-term']").val();
- if (searchTerm.length > 0) {
- var options = new AjaxOptions("add-concepts", "adding concepts", function(uri){
- $("#concept-description").val("");
- if (typeof(SelectedConcepts) != "undefined") {
- SelectedConcepts.addConcept(searchTerm, uri);
- }
- if (typeof(this.callback) == "function") {
- this.callback(searchTerm, uri);
- }
- });
- options.type = "POST";
- options.url = "/concepts/manipulator/add-concept";
- options.data = {
- "pref-label": searchTerm,
- lang: $(":input[name='lang']").val(),
- comment: $(":textarea[name='comment']").val()
- }
-
- $.ajax(options);
- }
- return false;
-}
-
-$(document).ready(function(){
- $("#go-button").click(function(){
- ConceptFinder.search();
- });
- $("#add-user-defined-concept").click(function(){
- ConceptManipulator.addConcept();
- $("#user-defined-concept-area").hide();
- });
- $("#system-found-concepts-area").hide();
- $("#user-defined-concept-area").hide();
-});
http://git-wip-us.apache.org/repos/asf/clerezza/blob/70220239/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-provider-manipulation.js
----------------------------------------------------------------------
diff --git a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-provider-manipulation.js b/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-provider-manipulation.js
deleted file mode 100644
index fcab2c1..0000000
--- a/platform/platform.concepts/platform.concepts.core/src/main/resources/org/apache/clerezza/platform/concepts/core/staticweb/scripts/concept-provider-manipulation.js
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF 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. 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.
- */
-function ConceptProviderGui(){};
-
-ConceptProviderGui.isModified = false;
-
-ConceptProviderGui.query = "PREFIX owl: <http://www.w3.org/2002/07/owl#> \n" +
- "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" +
- "PREFIX skos08: <http://www.w3.org/2008/05/skos#> \n" +
- "PREFIX skos04: <http://www.w3.org/2004/02/skos/core#> \n" +
- "CONSTRUCT { ?concept a skos08:Concept; skos08:prefLabel ?prefLabel; " +
- "rdfs:comment ?comment; owl:sameAs ?sameConcept . } \n" +
- "WHERE { ?concept a skos04:Concept; skos04:prefLabel ?prefLabel . \n" +
- "OPTIONAL { ?concept rdfs:comment ?comment . } \n" +
- "OPTIONAL { ?concept owl:sameAs ?sameConcept . } \n" +
- "FILTER (REGEX(STR(?prefLabel), '${searchTerm}', 'i'))}";
-
-ConceptProviderGui.initButtons = function() {
-
- ConceptProviderGui.updateButtonState();
-
- $("#deleteButton").click(function(event) {
- $("input:checked").each(function() {
- $(this).parent().parent().remove();
- });
- $(this).addClass("tx-inactive");
- ConceptProviderGui.isModified = true;
- });
-
- $("#addProvider").click(function(event) {
- ConceptProviderGui.addProvider($("#type").val(),
- $("#conceptScheme").val(),
- $("#sparqlEndPoint").val(),
- $("#defaultGraph").val(),
- $("#query").val());
- $("#conceptScheme").val("");
- $("#sparqlEndPoint").val("");
- $("#defaultGraph").val("");
- $("#query").val("");
- });
-
- $("#addButton").click(function(event) {
- if($(this).text() == "Save") {
- var options = new AjaxOptions("update-providers", "updating providers", function(obj) {
- });
- $("textarea[id!=query]").each(function() {
- $(this).removeAttr("disabled");
- });
- options.type = "POST";
- options.url = "update-concept-provider-list";
- options.data = $("#providers").serialize();
- $.ajax(options);
- }
- });
-}
-
-ConceptProviderGui.addProvider = function(rdfType, conceptScheme, sparqlEndPoint, defaultGraph, query) {
- var tr = $("<tr/>").attr("id", "");
- var td1 = $("<td/>");
- var div = $("<div/>").text("Provider:");
- var td2 = $("<td/>");
-
- var selection = $("<select/>").attr("name","types");
-
- $("#type > option:not(:selected)").each(function() {
- selection.append($(this).clone());
- });
- $("#type > option:selected").each(function() {
- var option = $(this).clone();
- option.attr("selected", "selected");
- selection.append(option);
- });
-
- td2.append(div);
- td2.append(selection);
-
- var inputText = $("<input/>").attr({
- "type":"text",
- "name":"conceptSchemes",
- "value": conceptScheme
- });
-
- div = $("<div/>").text("Concept Scheme:");
- td2.append(div);
- td2.append(inputText);
-
- inputText = $("<input/>").attr({
- "type":"text",
- "name":"sparqlEndPoints",
- "value": sparqlEndPoint
- });
-
- div = $("<div/>").text("SPARQL End Point");
- td2.append(div);
- td2.append(inputText);
-
- inputText = $("<input/>").attr({
- "type":"text",
- "name":"defaultGraphs",
- "value": defaultGraph
- });
-
- div = $("<div/>").text("Default Graph:");
- td2.append(div);
- td2.append(inputText)
- var inputCheckbox = $("<input/>").attr({
- "type":"checkbox",
- "value": rdfType
- });
-
- inputCheckbox.appendTo(td1);
-
- td1.appendTo(tr);
-
- var textArea = $("<textarea/>").attr({
- "rows":"8",
- "name":"queryTemplates"
- }).val(query);
- div = $("<div/>").text("Query Template:");
- td2.append(div);
- td2.append(textArea);
- td2.append($("<br/>"));
- td2.append($("<br/>"));
- td2.appendTo(tr);
- tr.insertBefore("#last");
- ConceptProviderGui.isModified = true;
-
- $("select[name=types] > option:selected").each(function() {
- ConceptProviderGui.updateDropDown($(this), "conceptSchemes");
- });
-}
-
-ConceptProviderGui.updateDropDown = function (obj, name) {
- if(obj.val().indexOf("Local") != -1) {
- obj.parent().parent().find("input[name!=" + name + "]").each(function() {
- $(this).prev().hide();
- $(this).hide();
- });
- obj.parent().parent().find("input[name=" + name + "]").each(function() {
- $(this).prev().show();
- $(this).show();
- });
- obj.parent().parent().find("textarea").each(function() {
- $(this).prev().hide();
- $(this).hide();
- });
- } else {
- obj.parent().parent().find("input[name!=" + name + "]").each(function() {
- $(this).prev().show();
- $(this).show();
- });
- obj.parent().parent().find("input[name=" + name + "]").each(function() {
- $(this).prev().hide();
- $(this).hide();
- });
- obj.parent().parent().find("textarea").each(function() {
- $(this).prev().show();
- $(this).show();
- });
- }
-}
-
-ConceptProviderGui.updateButtonState = function() {
- var counter = $("input:checked").length;
- if(counter == 0) {
- $("#deleteButton").addClass("tx-inactive");
- } else {
- $("#deleteButton").removeClass("tx-inactive");
- }
-}
-
-$(document).ready(function () {
-
- $("select[name=types]").live("change", function() {
- $("select[name=types] > option:selected").each(function(){
- ConceptProviderGui.updateDropDown($(this), "conceptSchemes");
- });
- });
- $("select[name=types] > option:selected").each(function() {
- ConceptProviderGui.updateDropDown($(this), "conceptSchemes");
- });
- $("#type").live("change", function() {
- $("#type > option:selected").each(function(){
- ConceptProviderGui.updateDropDown($(this), "conceptScheme");
- $("#query").val(ConceptProviderGui.query);
- });
- });
- $("#type > option:selected").each(function() {
- ConceptProviderGui.updateDropDown($(this), "conceptScheme");
- $("#query").val(ConceptProviderGui.query);
- });
- $("input:checkbox").live("change",function() {
- ConceptProviderGui.updateButtonState();
- });
-
- ConceptProviderGui.initButtons();
-});