2010-07-07 00:29:25 +02:00
|
|
|
|
2010-08-04 01:01:18 +02:00
|
|
|
importPackage(com.google.gridworks.rdf.commands);
|
2010-07-07 00:29:25 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Function invoked to initialize the extension.
|
|
|
|
*/
|
|
|
|
function init() {
|
|
|
|
/*
|
|
|
|
* Attach an rdf schema to each project.
|
|
|
|
*/
|
2010-08-04 01:01:18 +02:00
|
|
|
Packages.com.google.gridworks.model.Project.registerOverlayModel(
|
2010-07-07 00:29:25 +02:00
|
|
|
"rdfSchema",
|
2010-08-04 01:01:18 +02:00
|
|
|
Packages.com.google.gridworks.rdf.RdfSchema);
|
2010-07-07 00:29:25 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Operations
|
|
|
|
*/
|
2010-08-24 06:03:46 +02:00
|
|
|
Packages.com.google.gridworks.operations.OperationRegistry.registerOperation(
|
|
|
|
module, "save-rdf-schema", Packages.com.google.gridworks.rdf.operations.SaveRdfSchemaOperation);
|
2010-07-07 00:29:25 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Exporters
|
|
|
|
*/
|
2010-08-22 07:19:29 +02:00
|
|
|
var ExporterRegistry = Packages.com.google.gridworks.exporters.ExporterRegistry;
|
2010-08-04 01:01:18 +02:00
|
|
|
var RdfExporter = Packages.com.google.gridworks.rdf.exporters.RdfExporter;
|
2010-07-07 00:29:25 +02:00
|
|
|
|
2010-08-22 07:19:29 +02:00
|
|
|
ExporterRegistry.registerExporter("rdf", new RdfExporter("RDF/XML"));
|
|
|
|
ExporterRegistry.registerExporter("n3", new RdfExporter("N3"));
|
2010-07-07 00:29:25 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* GEL Functions and Binders
|
|
|
|
*/
|
2010-08-04 01:01:18 +02:00
|
|
|
Packages.com.google.gridworks.gel.ControlFunctionRegistry.registerFunction(
|
|
|
|
"urlify", new Packages.com.google.gridworks.rdf.expr.functions.strings.Urlify());
|
2010-07-07 00:29:25 +02:00
|
|
|
|
2010-08-04 01:01:18 +02:00
|
|
|
Packages.com.google.gridworks.expr.ExpressionUtils.registerBinder(
|
|
|
|
new Packages.com.google.gridworks.rdf.expr.RdfBinder());
|
2010-07-07 00:29:25 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Commands
|
|
|
|
*/
|
2010-08-04 01:01:18 +02:00
|
|
|
var GridworksServlet = Packages.com.google.gridworks.GridworksServlet;
|
2010-08-22 08:16:13 +02:00
|
|
|
GridworksServlet.registerCommand(module, "save-rdf-schema", new SaveRdfSchemaCommand());
|
|
|
|
GridworksServlet.registerCommand(module, "preview-rdf", new PreviewRdfCommand());
|
|
|
|
GridworksServlet.registerCommand(module, "save-baseURI", new SaveBaseURI());
|
|
|
|
GridworksServlet.registerCommand(module, "suggest-term", new SuggestTermCommand());
|
|
|
|
GridworksServlet.registerCommand(module, "import-vocabulary", new ImportVocabularyCommand());
|
|
|
|
GridworksServlet.registerCommand(module, "list-vocabularies", new ListVocabulariesCommand());
|
|
|
|
GridworksServlet.registerCommand(module, "delete-vocabulary", new DeleteVocabularyCommand());
|
2010-07-07 00:29:25 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Client-side Resources
|
|
|
|
*/
|
2010-08-04 01:01:18 +02:00
|
|
|
var ClientSideResourceManager = Packages.com.google.gridworks.ClientSideResourceManager;
|
2010-07-07 00:29:25 +02:00
|
|
|
|
|
|
|
// Script files to inject into /project page
|
|
|
|
ClientSideResourceManager.addPaths(
|
|
|
|
"project/scripts",
|
|
|
|
module,
|
|
|
|
[
|
|
|
|
"scripts/menu-bar-extensions.js",
|
|
|
|
"scripts/rdf-schema-alignment.js",
|
|
|
|
"scripts/rdf-schema-alignment-ui-node.js",
|
|
|
|
"scripts/rdf-schema-alignment-ui-link.js",
|
|
|
|
"scripts/suggestterm.suggest.js"
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
|
|
|
// Style files to inject into /project page
|
|
|
|
ClientSideResourceManager.addPaths(
|
|
|
|
"project/styles",
|
|
|
|
module,
|
|
|
|
[
|
|
|
|
"styles/rdf-schema-alignment-dialog.css",
|
|
|
|
]
|
|
|
|
);
|
|
|
|
}
|