Add winery source code
[vfc/nfvo/wfengine.git] / winery / org.eclipse.winery.repository / README.md
1 # Winery Repository
2
3 Setup, usage, and implementation hints are given in the [Eclipse Wiki]
4
5 ## REST API
6 Winery offers a REST API to communicate with the backend.
7 When issuing an `OPTIONS` request to `winery/`, a [RestDoc] description of the possible interactions is presented.
8 The returned JSON can be views in a browsable html format using [restdoc-renderer].
9 If you install restdoc-renderer as `restdoc.html` in the `ROOT` of the tomcat, Winery automatically displays a link to the renderer in the about dialog.
10
11 ## About the code
12 The code tries to make use of EL and JSP tags wherever possible. All data is accessible via a REST API.
13 The REST API does **not** follow the HATEOAS approach.
14 The URLs follow the pattern `/<type>/<encoded namespace>/<encoded id>`, where `type` is `servicetemplate`, `nodetype`, ...
15 Below a concrete instanance, subresources such as `name` exist.
16
17 Definitions are not modeled as explicit element. Only the nested elements are handled by Winery.
18 That means, it is not possible to specify custom definitions bundling a customized subset of available elements.
19
20 Intentionally, a QName should be unique within the repository.
21 We did not follow this assumption, but only require that QNames are unique within a type.
22 That means, the repository allows `{http://www.example.org}id` for both a service template and a node type.
23 We introduced TOSCAcomponentId uniquely identifying a TOSCA element.
24 Future versions might redesign the backend to use a QName as the unique key.
25
26 Currently, Winery is switching from plain Javascript library loading to [RequireJS].
27
28 The file `src/main/webapp/WEB-INF/common-functions.tld` and the files in `src/main/webapp/WEB-INF/tags/common` are copied from the sister project `org.eclipse.winery.topologymodler` at `mvn generate-sources`.
29
30 ### Trouble shooting
31 In case, `Version.java` is not found, then run `mvn compile`, which should trigger a regeneration of Version.java.
32
33 The error message
34 `HTTP Status 500 - com.sun.jersey.api.container.ContainerException: org.apache.jasper.JasperException: The absolute uri: http://www.eclipse.org/winery/functions cannot be resolved in either web.xml or the jar files deployed with this application` indicates that `mvn generate-sources` was not run.
35
36 In case `javax.servlet.jsp.PageContext` cannot be found:
37 Project -> right click -> Properties -> Project Facets -> Dynamic Web Module -> "Runtimes" -> "New..."
38
39 When running in jetty 9.0.5, there is always the error message "Request Entity Too Large" when uploading a file.
40 There is the `maxFormContentSize` set in `jetty-web.xml`, but it currently does not help to solve this issue.
41
42 When doing a copy-libs-to-tomcat hack, possibly "W3C_XML_SCHEMA_NS_URI cannot be resolved or is not a field" appears.
43 Remove `stax-api-1.0.1.jar` out of `tomcat7/lib`: Java's `rt.jar` should be used instead for `javax.xml.XMLConstants`.
44
45 ## License
46 Copyright (c) 2012-2014 University of Stuttgart.
47
48 All rights reserved. This program and the accompanying materials
49 are made available under the terms of the [Eclipse Public License v1.0]
50 and the [Apache License v2.0] which both accompany this distribution,
51 and are available at http://www.eclipse.org/legal/epl-v10.html
52 and http://www.apache.org/licenses/LICENSE-2.0
53
54 Contributors:
55 * Oliver Kopp - initial API and implementation
56
57
58  [Apache License v2.0]: http://www.apache.org/licenses/LICENSE-2.0.html
59  [Eclipse Wiki]: http://wiki.eclipse.org/winery
60  [Eclipse Public License v1.0]: http://www.eclipse.org/legal/epl-v10.html
61  [RequireJS]: http://requirejs.org/
62  [RestDoc]: http://www.restdoc.org
63  [restdoc-renderer]: https://github.com/hoegertn/restdoc-renderer