diff --git a/debian/LICENSE.md b/debian/LICENSE.md new file mode 100644 index 0000000000..40d70c2d6d --- /dev/null +++ b/debian/LICENSE.md @@ -0,0 +1,214 @@ +UnifiedViews License +==================== + +UnifiedViews is meant to be an free and open source for all now and in future. +We encourage continuous, self sustainable development supported by both the open source community and commercial stake holders. This way both parties (community and commercial users) profit from each other by code and financial resources for core development. Therefore we adopted a dual licensing approach for UnifiedViews. All contributor need to agree and sign the CLA (Contribution Agreement), if they want to push in the master repository of UnifiedViews. + +Open source Software License +==================== + +The Open Source version of UnifiedViews is released under the terms of GPLv3 or later http://www.gnu.org/licenses/gpl-3.0.html (or see license text below) and LGPLv3 or later http://opensource.org/licenses/lgpl-3.0.html. + +As an additional permission to the GNU GPL version 3, you may distribute non-source (e.g., minimized or compacted) forms of the UnifiedViews source code without the copy of the GNU GPL normally required, provided you include this license notice and a URL through which recipients can access the Corresponding Source. + +Commercial Software License +==================== + +The commercial version allows to use, modify, copy and distribute without any restrictions as stated in the commercial license agreement. + +GNU GENERAL PUBLIC LICENSE +==================== + +Version 3, 29 June 2007 +Copyright © 2007 Free Software Foundation, Inc. +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +## Preamble ## + +The GNU General Public License is a free, copyleft license for software and other kinds of works. +The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. +For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. + +Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. +Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and modification follow. + +## TERMS AND CONDITIONS ## + +### 0. Definitions. ### + + +“This License” refers to version 3 of the GNU General Public License. +“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. +“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations. +To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work. + +A “covered work” means either the unmodified Program or a work based on the Program. +To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. + +To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. + +An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. + +### 1. Source Code. ### + +The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work. + +A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. + +The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. + +The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. + +However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. +The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same work. + +### 2. Basic Permissions. ### + +All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. +Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. + +### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. ### + +No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. + +When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. + +### 4. Conveying Verbatim Copies. ### + +You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. +You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. + +### 5. Conveying Modified Source Versions. ### + +You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: + +a) The work must carry prominent notices stating that you modified it, and giving a relevant date. +b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”. +c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. +d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. + +A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. + +### 6. Conveying Non-Source Forms. ### + +You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: + +a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. +b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. +c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. +d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. +e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. +A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. + +A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. + +“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. + +If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). + +The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. + +### 7. Additional Terms. ### + +“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: + +a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or +b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or +c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or +d) Limiting the use for publicity purposes of names of licensors or authors of the material; or +e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or +f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. + +All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. +Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. + +### 8. Termination. ### + +You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). + +However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. + +Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. + +### 9. Acceptance Not Required for Having Copies. ### + +You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. + +### 10. Automatic Licensing of Downstream Recipients. ### + +Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. + +An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. + +### 11. Patents. ### + +A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”. +A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. +Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. + +In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. + +If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. + +A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. +Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. + +### 12. No Surrender of Others' Freedom. ### + +If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. + +### 13. Use with the GNU Affero General Public License. ### + +Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. + +### 14. Revised Versions of this License. ### + +The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. + +Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. + +### 15. Disclaimer of Warranty. ### + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +### 16. Limitation of Liability. ### + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +### 17. Interpretation of Sections 15 and 16. ### + +If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/debian/README.md b/debian/README.md new file mode 100644 index 0000000000..e91e06ae85 --- /dev/null +++ b/debian/README.md @@ -0,0 +1,42 @@ +Packages +======== + +Provides source for creating UnifiedViews packages for various Linux distributions. + +How to install with dependency + +~~~bash +echo "deb http://packages.comsode.eu/debian wheezy main" > /etc/apt/sources.list.d/odn.list +wget -O - http://packages.comsode.eu/key/odn.gpg.key | apt-key add - +apt-get update +~~~ + + +To install unifiedview using postgresql +~~~bash +apt-get install unifiedviews-pgsql +~~~ + +To install unifiedview using mysql +~~~bash +apt-get install unifiedviews-mysql +~~~ + + + +How to create .deb packages for Debian: + +go to where pom.xml is placed and run +~~~bash +mvn package +~~~ + +that creates files .deb in target/ +![Debian dependency graph](debian_dependencyGraph.png) + +The known issues: +- be aware of the possible problem - https://github.com/UnifiedViews/Core/issues/258 +- to add backup configuration before an update installation of packages +- to clean database schema during a purge phase +- to change location from /etc/unifiedviews to /etc/default/unifiedviews + diff --git a/debian/debian_dependencyGraph.png b/debian/debian_dependencyGraph.png new file mode 100644 index 0000000000..e0a8366ff4 Binary files /dev/null and b/debian/debian_dependencyGraph.png differ diff --git a/debian/pom.xml b/debian/pom.xml new file mode 100644 index 0000000000..c64ecb0505 --- /dev/null +++ b/debian/pom.xml @@ -0,0 +1,59 @@ + + + 4.0.0 + + + eu.unifiedviews + uv-core + 2.2.0-SNAPSHOT + + + eu.unifiedviews.packages + unifiedviews-packages + unifiedviews-packages + pom + + + + unifiedviews-mysql + unifiedviews-pgsql + unifiedviews-backend + unifiedviews-backend-mysql + unifiedviews-backend-pgsql + unifiedviews-backend-shared + unifiedviews-webapp + unifiedviews-webapp-mysql + unifiedviews-webapp-pgsql + unifiedviews-webapp-shared + + + + 2.1.2~ + ${project.build.directory}/${project.artifactId}-${debian-package-version}_all.deb + UTF-8 + UTF-8 + + + + + + external.atlassian.jgitflow + jgitflow-maven-plugin + 1.0-m4.3 + + + + release/UV_v + + UV_v + + true + true + + + + + + diff --git a/debian/unifiedviews-backend-mysql/pom.xml b/debian/unifiedviews-backend-mysql/pom.xml new file mode 100644 index 0000000000..3569cd857e --- /dev/null +++ b/debian/unifiedviews-backend-mysql/pom.xml @@ -0,0 +1,74 @@ + + + 4.0.0 + + + eu.unifiedviews.packages + unifiedviews-packages + 2.2.0-SNAPSHOT + + + eu.unifiedviews.packages + unifiedviews-backend-mysql + unifiedviews-backend-mysql + + + + + + + eu.unifiedviews + backend + 2.1.2 + + + + + + maven.eea.sk + maven.eea.sk-public + http://maven.eea.sk/artifactory/public/ + + + + + + + jdeb + org.vafer + 1.4 + + + package + + jdeb + + + ${debian-package-name} + + + + ${basedir}/src/deb/etc/unifiedviews/backend-config.properties + file + + perm + /etc/unifiedviews + + + + + ${basedir}/src/deb/usr/share/unifiedviews/mysql + directory + + perm + /usr/share/unifiedviews/mysql + + + + + + + + + + diff --git a/debian/unifiedviews-backend-mysql/src/deb/control/conffiles b/debian/unifiedviews-backend-mysql/src/deb/control/conffiles new file mode 100644 index 0000000000..9dc7ad5ef8 --- /dev/null +++ b/debian/unifiedviews-backend-mysql/src/deb/control/conffiles @@ -0,0 +1 @@ +/etc/unifiedviews/backend-config.properties \ No newline at end of file diff --git a/debian/unifiedviews-backend-mysql/src/deb/control/config b/debian/unifiedviews-backend-mysql/src/deb/control/config new file mode 100644 index 0000000000..5e6966e988 --- /dev/null +++ b/debian/unifiedviews-backend-mysql/src/deb/control/config @@ -0,0 +1,11 @@ +#!/bin/sh +set -e +. /usr/share/debconf/confmodule + +db_input low backend/mysql_root || true +db_go +db_input low backend/mysql_db_user || true +db_go +db_input low backend/mysql_db_password || true +db_go + diff --git a/debian/unifiedviews-backend-mysql/src/deb/control/control b/debian/unifiedviews-backend-mysql/src/deb/control/control new file mode 100644 index 0000000000..d379edd66c --- /dev/null +++ b/debian/unifiedviews-backend-mysql/src/deb/control/control @@ -0,0 +1,9 @@ +Package: unifiedviews-backend-mysql +Version: [[debian-package-version]] +Section: java +Priority: extra +Architecture: all +Maintainer: jmc@eea.sk +Depends: unifiedviews-backend-shared (>> 2.1), unifiedviews-backend-shared (<< 2.2), mysql-server, debconf (>= 0.5) +Conflicts: unifiedviews-backend-pgsql +Description: The mysql database and settings for unifiedviews's backend. diff --git a/debian/unifiedviews-backend-mysql/src/deb/control/postinst b/debian/unifiedviews-backend-mysql/src/deb/control/postinst new file mode 100644 index 0000000000..6fe108e926 --- /dev/null +++ b/debian/unifiedviews-backend-mysql/src/deb/control/postinst @@ -0,0 +1,193 @@ +#!/bin/sh +# postinst script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +. /usr/share/debconf/confmodule + +db_creadentials(){ + echo " >>> db_creadentials" + db_get backend/mysql_root + ROOT_PW=$RET + + db_get backend/mysql_db_user + DBA_USER=$RET + + db_get backend/mysql_db_password + DBA_PASS=$RET + echo " <<< db_creadentials" +} + +set_java() { + echo " >>> set_java" + + JAVA_VERSION=`java -version 2>&1 | grep "java version" | awk '{print $3}' | tr -d \" | awk '{split($0, array, ".")} END{print array[2]}'` + echo -n "check java version" + if [ ! $JAVA_VERSION -eq 7 ]; then + JAVA_NAME=`update-java-alternatives -l | grep 7 | cut -d' ' -f1` + if [ -n $JAVA_NAME ] ; then + /usr/sbin/update-java-alternatives --jre-headless --set $JAVA_NAME + echo " - Java version is set to 1.7" + else + echo " ERROR: java 7 is not installed" + fi + + else + echo " - ok" + fi + echo " <<< set_java" +} + + +db_up() { + echo " >>> db_up" + + #Check if mysql is started + service mysql status > /dev/null || service mysql start >/dev/null 2>&1 + + echo -n "INFO: Waiting for mysql to be up..." + + CPT=0 + TIMEOUT=60 + while [ 1 ] + do + mysql --password=$ROOT_PW -e ' SELECT "isRunning" '>/dev/null 2>&1 + if [ $? -eq 0 ]; then + break + fi + + echo -n "." + sleep 1 + CPT=$((${CPT}+1)) + if [ ${CPT} -eq ${TIMEOUT} ] + then + echo -e "\nERROR: Connection to Mysql has not been established before timeout. Exiting" + exit 1 + fi + done + + echo " Done" + echo " <<< db_up" +} + + +db_configure() { + echo " >>> db_configure" + DB_NAME=unifiedviews + # if database unifiedviews is not exist + if ! mysql -u $DBA_USER --password=$DBA_PASS -e 'use '$DB_NAME''; then + echo "create database if not exists $DB_NAME;" | mysql --password=$ROOT_PW + echo "created database: $DB_NAME" + # create a user if not exists + echo "create user '${DBA_USER}' identified by '${DBA_PASS}';" | mysql --password=$ROOT_PW || true + echo "created user: $DBA_USER" + cd /usr/share/unifiedviews/mysql + mysql -u $DBA_USER --password=$DBA_PASS $DB_NAME < \ + /usr/share/unifiedviews/mysql/schema.sql + mysql -u $DBA_USER --password=$DBA_PASS $DB_NAME < \ + /usr/share/unifiedviews/mysql/data.sql + fi + + version=`mysql -u $DBA_USER --password=$DBA_PASS -s -N -e "select value from properties WHERE properties.key='UV.Core.version' " $DB_NAME` + if [ "$version" = "001.004.000" ] + then + # set db schema version + mysql -u $DBA_USER --password=$DBA_PASS $DB_NAME < \ + /usr/share/unifiedviews/mysql/1.5.0-update.sql + fi + + version=`mysql -u $DBA_USER --password=$DBA_PASS -s -N -e "select value from properties WHERE properties.key='UV.Core.version' " $DB_NAME` + if [ "$version" = "001.005.000" ] + then + # set db schema version + mysql -u $DBA_USER --password=$DBA_PASS $DB_NAME < \ + /usr/share/unifiedviews/mysql/1.5.5-update.sql + fi + + version=`mysql -u $DBA_USER --password=$DBA_PASS -s -N -e "select value from properties WHERE properties.key='UV.Core.version' " $DB_NAME` + if [ "$version" = "001.005.005" ] + then + # set db schema version + mysql -u $DBA_USER --password=$DBA_PASS $DB_NAME < \ + /usr/share/unifiedviews/mysql/1.6.0-update.sql + fi + + version=`mysql -u $DBA_USER --password=$DBA_PASS -s -N -e "select value from properties WHERE properties.key='UV.Core.version' " $DB_NAME` + if [ "$version" = "001.006.000" ] + then + # set db schema version + mysql -u $DBA_USER --password=$DBA_PASS $DB_NAME < \ + /usr/share/unifiedviews/mysql/2.0.0-update.sql + fi + + version=`mysql -u $DBA_USER --password=$DBA_PASS -s -N -e "select value from properties WHERE properties.key='UV.Core.version' " $DB_NAME` + if [ "$version" = "002.000.000" ] + then + # set db schema version + mysql -u $DBA_USER --password=$DBA_PASS $DB_NAME < \ + /usr/share/unifiedviews/mysql/2.1.0-update.sql + fi + + # set permissions for user uv + echo "grant all on $DB_NAME.* to '$DBA_USER' identified by '$DBA_PASS';" | mysql --password=$ROOT_PW || true + echo "granted all on $DB_NAME for user: $DBA_USER" + + # update backend config + sed --in-place \ + -e "s/database.sql.hostname = .*/database.sql.hostname = $address_host/" \ + -e "s/database.sql.port = .*/database.sql.port = 3306/" \ + -e "s/database.sql.user = .*/database.sql.user = $DBA_USER/" \ + -e "s/database.sql.password = .*/database.sql.password = $DBA_PASS/" \ + /etc/unifiedviews/backend-config.properties + + echo " <<< db_configure" +} + +fix_perms() { + chown unifiedviews:unifiedviews /etc/unifiedviews/backend-config.properties + chown -R unifiedviews:unifiedviews /usr/share/unifiedviews/mysql +} + +case "$1" in + configure) + db_creadentials + fix_perms + db_up + set_java + db_configure + db_stop + + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + + ;; +esac + + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/unifiedviews-backend-mysql/src/deb/control/postrm b/debian/unifiedviews-backend-mysql/src/deb/control/postrm new file mode 100644 index 0000000000..ce4a5c8632 --- /dev/null +++ b/debian/unifiedviews-backend-mysql/src/deb/control/postrm @@ -0,0 +1,68 @@ +#!/bin/sh +# postrm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +. /usr/share/debconf/confmodule + +db_creadentials(){ + echo " >>> db_creadentials" + db_get backend/mysql_root + ROOT_PW=$RET + + db_get backend/mysql_db_user + DBA_USER=$RET + + db_get backend/mysql_db_password + DBA_PASS=$RET + echo " <<< db_creadentials" +} + + +case "$1" in + + remove|abort-install|disappear) + db_creadentials + echo "DROP DATABASE unifiedviews" + # DROP DATABASE unifiedviews + dbname=unifiedviews + mysql -u $DBA_USER --password=$DBA_PASS -s -N -e "DROP DATABASE IF EXISTS ${dbname}" + db_stop + ;; + + purge) + + ;; + + + upgrade|failed-upgrade|abort-upgrade) + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/unifiedviews-backend-mysql/src/deb/control/prerm b/debian/unifiedviews-backend-mysql/src/deb/control/prerm new file mode 100644 index 0000000000..040a82e256 --- /dev/null +++ b/debian/unifiedviews-backend-mysql/src/deb/control/prerm @@ -0,0 +1,46 @@ +#!/bin/sh +# prerm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + if [ -x "/etc/init.d/unifiedviews-backend" ]; then + invoke-rc.d unifiedviews-backend stop || true + fi + + + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + + +#DEBHELPER# + +exit 0 + + diff --git a/debian/unifiedviews-backend-mysql/src/deb/control/templates b/debian/unifiedviews-backend-mysql/src/deb/control/templates new file mode 100644 index 0000000000..efa0b8ae3b --- /dev/null +++ b/debian/unifiedviews-backend-mysql/src/deb/control/templates @@ -0,0 +1,15 @@ +Template: backend/mysql_root +Type: password +Default: root +Description: MySQL root password + +Template: backend/mysql_db_user +Type: string +Default: uv +Description: MySQL user for unifiedviews + + +Template: backend/mysql_db_password +Type: password +Default: uv +Description: MySQL user password for unifiedviews diff --git a/debian/unifiedviews-backend-mysql/src/deb/etc/unifiedviews/backend-config.properties b/debian/unifiedviews-backend-mysql/src/deb/etc/unifiedviews/backend-config.properties new file mode 100644 index 0000000000..93aaf6badf --- /dev/null +++ b/debian/unifiedviews-backend-mysql/src/deb/etc/unifiedviews/backend-config.properties @@ -0,0 +1,73 @@ +# This is the central configuration for BACKEND of ODCS application. +# +# The key and element characters #, !, =, and : should be properly escaped +# with a preceding backslash to ensure that they are properly loaded. + +# !!! The frontend is configured separately from file +# frontend/src/main/webapp/WEB-INF/config.properties +# use frontend/src/main/webapp/WEB-INF/config.sample.properties as a +# configuration file template. + +# directory where backend log should be stored (should not end with / or \ ) +backend.log.directory = /var/log/unifiedviews/backend/ +# how long should backend keep log history +backend.log.keepDays = 7 + +# General settings (should end with "backend/working") +general.workingdir = /var/cache/unifiedviews/backend/working + +# Backend application configuration +backend.host = 127.0.0.1 +backend.port = 5010 + +# Connection configuration setting for relational database +# for mysql { +database.sql.driver = com.mysql.jdbc.Driver +database.sql.url = jdbc:mysql://localhost:3306/unifiedviews?characterEncoding=utf8 +database.sql.user = unifiedviews +database.sql.password = unifiedviews +#} + +# for postgresql { +#database.sql.driver = org.postgresql.Driver +#database.sql.url = jdbc:postgresql://localhost:5432/unifiedviews +#database.sql.user = unifiedviews +#database.sql.password = unifiedviews +# } + + +# Connection configuration setting for RDF database +# use local rdf platform { +database.rdf.platform = localRDF +# } + +# or use remote rdf platform (sesame) { +#database.rdf.platform = remoteRDF +#database.rdf.url = http://ip6-localhost:8080/openrdf-sesame +#database.rdf.user = +#database.rdf.password = +# } + + + +# Administrator contact email for sending reports and failure notifications +email.enabled = false +email.admin = admin@example.com +# use if email.enabled = true +#email.smtp.host = smtp.server.cz +#email.smtp.port = 25 +#email.smtp.ttl = false +#email.from = odcs@xrg.mff.cuni.cz +#email.authorization = false +# use if email.authorization = true +#email.username = +#email.password = + +# Configuration of DPU modules +module.path = /var/lib/unifiedviews/common +module.backend.expose = sun.misc,sun.io,com.sun.nio.file + +# Language configuration (e.g.: en_US, sk) +locale = en +#type of ownership user|organization +ownership.type=user diff --git a/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/1.5.0-update.sql b/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/1.5.0-update.sql new file mode 100644 index 0000000000..e5a1017843 --- /dev/null +++ b/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/1.5.0-update.sql @@ -0,0 +1,27 @@ +-- Update version. +UPDATE `properties` SET `value` = '001.005.000' WHERE `key` = 'UV.Core.version'; +UPDATE `properties` SET `value` = '001.001.000' WHERE `key` = 'UV.Plugin-DevEnv.version'; + +-- Add property for template shared configuration. +ALTER TABLE `dpu_instance` ADD COLUMN `use_template_config` SMALLINT NOT NULL DEFAULT 0; + +-- Views. + +# Last execution for each pipeline +CREATE VIEW `exec_last_view` AS +SELECT id, pipeline_id, t_end, t_start, status +FROM `exec_pipeline` AS exec +WHERE t_end = (SELECT max(t_end) FROM `exec_pipeline` AS lastExec WHERE exec.pipeline_id = lastExec.pipeline_id); + +# Pipeline list +CREATE VIEW `pipeline_view` AS +SELECT ppl.id AS id, ppl.name AS name, exec.t_start AS t_start, exec.t_end AS t_end, exec.status AS status +FROM `ppl_model` AS ppl +LEFT JOIN `exec_last_view` AS exec ON exec.pipeline_id = ppl.id; + +# Execution list. +CREATE VIEW `exec_view` AS +SELECT exec.id AS id, exec.status AS status, ppl.id AS pipeline_id, ppl.name AS pipeline_name, exec.debug_mode AS debug_mode, exec.t_start AS t_start, exec.t_end AS t_end, exec.schedule_id AS schedule_id, owner.username AS owner_name, exec.stop AS stop, exec.t_last_change AS t_last_change +FROM `exec_pipeline` AS exec +JOIN `ppl_model` AS ppl ON ppl.id = exec.pipeline_id +JOIN `usr_user` AS owner ON owner.id = exec.owner_id; diff --git a/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/1.5.5-update.sql b/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/1.5.5-update.sql new file mode 100644 index 0000000000..a1820f63dd --- /dev/null +++ b/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/1.5.5-update.sql @@ -0,0 +1,20 @@ +ALTER TABLE dpu_instance MODIFY use_dpu_description boolean; +ALTER TABLE dpu_instance MODIFY config_valid boolean; +ALTER TABLE dpu_instance MODIFY use_template_config boolean NOT NULL DEFAULT FALSE; +ALTER TABLE dpu_template MODIFY use_dpu_description boolean; +ALTER TABLE dpu_template MODIFY config_valid boolean NOT NULL; +ALTER TABLE exec_dataunit_info MODIFY is_input boolean; +ALTER TABLE exec_context_pipeline MODIFY dummy boolean; +ALTER TABLE exec_pipeline MODIFY debug_mode boolean; +ALTER TABLE exec_pipeline MODIFY silent_mode boolean; +ALTER TABLE exec_pipeline MODIFY stop boolean; +ALTER TABLE exec_schedule MODIFY just_once boolean; +ALTER TABLE exec_schedule MODIFY enabled boolean; +ALTER TABLE exec_schedule MODIFY strict_timing boolean; + +-- Update loggin table, rename column logLevel into log_level. +ALTER TABLE `logging` CHANGE COLUMN `logLevel` `log_level` INT(11) NOT NULL ; + +-- Update version. +UPDATE `properties` SET `value` = '001.005.005' WHERE `key` = 'UV.Core.version'; +UPDATE `properties` SET `value` = '001.002.000' WHERE `key` = 'UV.Plugin-DevEnv.version'; diff --git a/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/1.6.0-update.sql b/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/1.6.0-update.sql new file mode 100644 index 0000000000..67bb1a798a --- /dev/null +++ b/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/1.6.0-update.sql @@ -0,0 +1,8 @@ + +-- Update version. +UPDATE `properties` SET `value` = '001.006.000' WHERE `key` = 'UV.Core.version'; +UPDATE `properties` SET `value` = '001.003.000' WHERE `key` = 'UV.Plugin-DevEnv.version'; + +-- This constraint is only limited to first 255 characters in column. Larger constraint is only +-- possible with 'innodb_large_prefix' setting on database. +ALTER TABLE ppl_model ADD UNIQUE (name(255)); diff --git a/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/2.0.0-update.sql b/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/2.0.0-update.sql new file mode 100644 index 0000000000..78d7f357ae --- /dev/null +++ b/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/2.0.0-update.sql @@ -0,0 +1,271 @@ +SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; +SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; +SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL'; + +ALTER TABLE `dpu_template` +ADD COLUMN `organization_id` INT(11) NULL DEFAULT NULL AFTER `user_id`, +ADD INDEX `ix_DPU_TEMPLATE_organization_id` (`organization_id` ASC); + +ALTER TABLE `exec_pipeline` +ADD COLUMN `organization_id` INT(11) NULL DEFAULT NULL AFTER `owner_id`, +ADD INDEX `ix_EXEC_PIPELINE_organization_id` (`organization_id` ASC); + +ALTER TABLE `exec_schedule` +ADD COLUMN `organization_id` INT(11) NULL DEFAULT NULL AFTER `user_id`, +ADD INDEX `ix_EXEC_SCHEDULE_organization_id` (`organization_id` ASC); + +CREATE TABLE IF NOT EXISTS `organization` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `name` VARCHAR(255) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE INDEX `name` (`name` ASC), + INDEX `ix_organization_name` (`name` ASC)) +ENGINE = InnoDB +DEFAULT CHARACTER SET = utf8; + +CREATE TABLE IF NOT EXISTS `permission` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `name` VARCHAR(142) NOT NULL, + `rwonly` TINYINT(1) NULL DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE INDEX `name` (`name` ASC), + INDEX `ix_permission_name` (`name` ASC)) +ENGINE = InnoDB +DEFAULT CHARACTER SET = utf8; + +ALTER TABLE `ppl_model` +ADD COLUMN `organization_id` INT(11) NULL DEFAULT NULL AFTER `user_id`, +ADD INDEX `ix_PPL_MODEL_organization_id` (`organization_id` ASC); + +CREATE TABLE IF NOT EXISTS `role` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `name` VARCHAR(142) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE INDEX `name` (`name` ASC), + INDEX `ix_role_name` (`name` ASC)) +ENGINE = InnoDB +DEFAULT CHARACTER SET = utf8; + +CREATE TABLE IF NOT EXISTS `user_role_permission` ( + `role_id` INT(11) NOT NULL, + `permission_id` INT(11) NOT NULL, + PRIMARY KEY (`role_id`, `permission_id`)) +ENGINE = InnoDB +DEFAULT CHARACTER SET = utf8; + +CREATE TABLE IF NOT EXISTS `usr_extuser` ( + `id_usr` INT(11) NOT NULL, + `id_extuser` VARCHAR(255) NOT NULL, + PRIMARY KEY (`id_usr`, `id_extuser`)) +ENGINE = InnoDB +DEFAULT CHARACTER SET = utf8; + +ALTER TABLE `usr_user_role` +ADD INDEX `role_id` (`role_id` ASC); + +ALTER TABLE `exec_pipeline` +ADD CONSTRAINT `exec_pipeline_ibfk_6` + FOREIGN KEY (`organization_id`) + REFERENCES `organization` (`id`) + ON DELETE CASCADE + ON UPDATE CASCADE; + +ALTER TABLE `exec_schedule` +ADD CONSTRAINT `exec_schedule_ibfk_3` + FOREIGN KEY (`organization_id`) + REFERENCES `organization` (`id`) + ON DELETE CASCADE + ON UPDATE CASCADE; + +ALTER TABLE `ppl_model` +ADD CONSTRAINT `ppl_model_ibfk_2` + FOREIGN KEY (`organization_id`) + REFERENCES `organization` (`id`) + ON DELETE CASCADE + ON UPDATE CASCADE; + +ALTER TABLE `usr_user_role` +ADD CONSTRAINT `usr_user_role_ibfk_2` + FOREIGN KEY (`role_id`) + REFERENCES `role` (`id`) + ON DELETE CASCADE + ON UPDATE CASCADE; + +DROP VIEW IF EXISTS `exec_last_view`; +CREATE VIEW `exec_last_view` AS +SELECT id, pipeline_id, t_end, t_start, status +FROM `exec_pipeline` AS exec +WHERE t_end = (SELECT max(t_end) FROM `exec_pipeline` AS lastExec WHERE exec.pipeline_id = lastExec.pipeline_id); + +DROP VIEW IF EXISTS `exec_view`; +CREATE VIEW `exec_view` AS +SELECT exec.id AS id, exec.status AS status, ppl.id AS pipeline_id, ppl.name AS pipeline_name, exec.debug_mode AS debug_mode, exec.t_start AS t_start, +exec.t_end AS t_end, exec.schedule_id AS schedule_id, owner.username AS owner_name, exec.stop AS stop, exec.t_last_change AS t_last_change, +org.name AS org_name +FROM `exec_pipeline` AS exec +LEFT JOIN `ppl_model` AS ppl ON ppl.id = exec.pipeline_id +LEFT JOIN `usr_user` AS owner ON owner.id = exec.owner_id +left JOIN `organization` as org ON exec.organization_id = org.id; + +DROP VIEW IF EXISTS `pipeline_view`; +CREATE VIEW `pipeline_view` AS +SELECT ppl.id AS id, ppl.name AS name, exec.t_start AS t_start, exec.t_end AS t_end, exec.status AS status, usr.username as usr_name, org.name +AS org_name , ppl.visibility AS visibility FROM `ppl_model` AS ppl +LEFT JOIN `exec_last_view` AS exec ON exec.pipeline_id = ppl.id +LEFT JOIN `usr_user` AS usr ON ppl.user_id = usr.id +left JOIN `organization` as org ON ppl.organization_id = org.id; + +SET SQL_MODE=@OLD_SQL_MODE; +SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; +SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; + +INSERT INTO `role` VALUES (NULL, 'Administrator'); +INSERT INTO `role` VALUES (NULL,'User'); + +-- INSERT INTO `permission` VALUES (nextval('seq_permission'), 'pipeline.definePipelineDependencies'); +INSERT INTO `permission` VALUES (NULL, 'administrator', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.delete', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.save', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.edit', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.export', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.exportScheduleRules', false); +INSERT INTO `permission` VALUES (NULL, 'pipeline.import', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.importScheduleRules', false); +INSERT INTO `permission` VALUES (NULL, 'pipeline.importUserData', false); +INSERT INTO `permission` VALUES (NULL, 'pipeline.schedule', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.read', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.runDebug', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.exportDpuData', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.exportDpuJars', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.setVisibilityAtCreate', false); +INSERT INTO `permission` VALUES (NULL, 'pipelineExecution.delete', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipelineExecution.stop', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.run', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipelineExecution.downloadAllLogs', false); +INSERT INTO `permission` VALUES (NULL, 'pipelineExecution.read', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipelineExecution.readDpuInputOutputData', false); +INSERT INTO `permission` VALUES (NULL, 'pipelineExecution.readEvent', false); +INSERT INTO `permission` VALUES (NULL, 'pipelineExecution.readLog', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipelineExecution.sparqlDpuInputOutputData', false); +INSERT INTO `permission` VALUES (NULL, 'scheduleRule.create', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'scheduleRule.delete', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'scheduleRule.edit', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'scheduleRule.disable', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'scheduleRule.enable', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'scheduleRule.read', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'scheduleRule.execute', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'scheduleRule.setPriority', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.create', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.save', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.setVisibilityAtCreate', false); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.delete', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.edit', true); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.export', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.copy', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.import', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.read', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'user.management', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'user.create', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'user.edit', false); +INSERT INTO `permission` VALUES (NULL, 'user.login', false); +INSERT INTO `permission` VALUES (NULL, 'user.read', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'user.delete', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'role.create', false); +INSERT INTO `permission` VALUES (NULL, 'role.edit', true); +INSERT INTO `permission` VALUES (NULL, 'role.read', false); +INSERT INTO `permission` VALUES (NULL, 'role.delete', true); +INSERT INTO `permission` VALUES (NULL, 'pipeline.create', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.copy', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'deleteDebugResources', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'runtimeProperties.edit', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'userNotificationSettings.editEmailGlobal', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'userNotificationSettings.editNotificationFrequency', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'userNotificationSettings.createPipelineExecutionSettings', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); + +INSERT INTO `usr_extuser` VALUES ((select id from usr_user where username='admin'), 'admin'); +INSERT INTO `usr_extuser` VALUES ((select id from usr_user where username='user'), 'user'); + +DELETE FROM `usr_user_role`; +INSERT INTO `usr_user_role` VALUES ((select id from usr_user where username='admin'),(select id from role where name='Administrator')); +INSERT INTO `usr_user_role` VALUES ((select id from usr_user where username='admin'),(select id from role where name='User')); +INSERT INTO `usr_user_role` VALUES ((select id from usr_user where username='user'),(select id from role where name='User')); + +-- Update version. +UPDATE `properties` SET `value` = '002.000.000' WHERE `key` = 'UV.Core.version'; +UPDATE `properties` SET `value` = '002.000.000' WHERE `key` = 'UV.Plugin-DevEnv.version'; diff --git a/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/2.1.0-update.sql b/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/2.1.0-update.sql new file mode 100644 index 0000000000..484b2d5269 --- /dev/null +++ b/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/2.1.0-update.sql @@ -0,0 +1,218 @@ +-- ############################################################## +-- ## Database update script for standard UV installation # +-- ## Update from v. 2.0.x to 2.1.0 # +-- ############################################################## + +-- Update permission table +ALTER TABLE `permission` CHANGE `rwonly` `sharedentityinstancewriterequired` boolean; +-- Update version. +UPDATE `properties` SET `value` = '002.001.000' WHERE `key` = 'UV.Core.version'; +UPDATE `properties` SET `value` = '002.001.000' WHERE `key` = 'UV.Plugin-DevEnv.version'; + +-- Add new columns +ALTER TABLE `dpu_instance` ADD COLUMN `menu_name` VARCHAR(255) NULL DEFAULT NULL; +ALTER TABLE `dpu_template` ADD COLUMN `menu_name` VARCHAR(255) NULL DEFAULT NULL; + +-- Email notifications +ALTER TABLE `sch_sch_notification` ADD COLUMN `type_started` SMALLINT; +UPDATE `sch_sch_notification` SET type_started = 2 WHERE type_started IS NULL; + +ALTER TABLE `sch_usr_notification` ADD COLUMN `type_started` SMALLINT; +UPDATE `sch_usr_notification` SET type_started = 2 WHERE type_started IS NULL; + +ALTER TABLE `sch_usr_notification` ADD COLUMN `report_not_scheduled` boolean DEFAULT false; + +-- full name for user is now mandatory parameter - copy username if missing +UPDATE `usr_user` SET `full_name` = `username` WHERE `full_name` IS NULL; +ALTER TABLE `usr_user` MODIFY `full_name` VARCHAR(55) NOT NULL; + +-- Organizations removed, actor added +DROP VIEW `pipeline_view`; +DROP VIEW `exec_view`; + +CREATE TABLE `user_actor` +( + `id` INTEGER AUTO_INCREMENT, + `id_extuser` VARCHAR(255) NOT NULL, + `name` VARCHAR(255) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE (`id_extuser`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +ALTER TABLE `exec_schedule` DROP FOREIGN KEY `exec_schedule_ibfk_3`; +ALTER TABLE `exec_schedule` DROP COLUMN organization_id; +ALTER TABLE exec_schedule ADD COLUMN user_actor_id INTEGER; +CREATE INDEX `ix_EXEC_SCHEDULE_user_actor_id` ON `exec_schedule` (`user_actor_id`); + +ALTER TABLE `exec_pipeline` DROP FOREIGN KEY `exec_pipeline_ibfk_6`; +ALTER TABLE `exec_pipeline` DROP COLUMN organization_id; +ALTER TABLE exec_pipeline ADD COLUMN user_actor_id INTEGER; +CREATE INDEX `ix_EXEC_PIPELINE_actor_id` ON `exec_pipeline` (`user_actor_id`); + +ALTER TABLE `ppl_model` DROP FOREIGN KEY `ppl_model_ibfk_2`; +ALTER TABLE `ppl_model` DROP COLUMN organization_id; +ALTER TABLE ppl_model ADD COLUMN user_actor_id INTEGER; +CREATE INDEX `ix_PPL_MODEL_user_actor_id` ON `ppl_model` (`user_actor_id`); +DROP TABLE `organization`; + +-- Constraints +ALTER TABLE `exec_pipeline` +ADD CONSTRAINT `exec_pipeline_ibfk_6` + FOREIGN KEY (`user_actor_id`) + REFERENCES `user_actor` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE `exec_schedule` +ADD CONSTRAINT `exec_schedule_ibfk_3` + FOREIGN KEY (`user_actor_id`) + REFERENCES `user_actor` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE `ppl_model` +ADD CONSTRAINT `ppl_model_ibfk_2` + FOREIGN KEY (`user_actor_id`) + REFERENCES `user_actor` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +-- Recreate views +CREATE VIEW `pipeline_view` AS +SELECT ppl.id AS id, ppl.name AS name, exec.t_start AS t_start, exec.t_end AS t_end, exec.status AS status, usr.username as usr_name, usr.full_name as usr_full_name, +ppl.visibility AS visibility, actor.name AS user_actor_name FROM `ppl_model` AS ppl +LEFT JOIN `exec_last_view` AS exec ON exec.pipeline_id = ppl.id +LEFT JOIN `usr_user` AS usr ON ppl.user_id = usr.id +LEFT JOIN `user_actor` AS actor ON ppl.user_actor_id = actor.id; + +CREATE VIEW `exec_view` AS +SELECT exec.id AS id, exec.status AS status, ppl.id AS pipeline_id, ppl.name AS pipeline_name, exec.debug_mode AS debug_mode, exec.t_start AS t_start, +exec.t_end AS t_end, exec.schedule_id AS schedule_id, owner.username AS owner_name, owner.full_name AS owner_full_name, exec.stop AS stop, exec.t_last_change AS t_last_change, +actor.name AS user_actor_name FROM `exec_pipeline` AS exec +LEFT JOIN `ppl_model` AS ppl ON ppl.id = exec.pipeline_id +LEFT JOIN `usr_user` AS owner ON owner.id = exec.owner_id +LEFT JOIN `user_actor` AS actor ON actor.id = exec.user_actor_id; + +-- Permissions +-- Update permissions - delete all current permissions and insert latest version +DELETE FROM `user_role_permission`; +DELETE FROM `permission`; +ALTER TABLE `permission` AUTO_INCREMENT = 1; + +-- Insert permissions +INSERT INTO `permission` VALUES (NULL, 'administrator', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.delete', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.edit', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.definePipelineDependencies', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.export', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.exportScheduleRules', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.import', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.importScheduleRules', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.importUserData', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.schedule', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.read', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.runDebug', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.exportDpuData', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.exportDpuJars', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.setVisibility', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.setVisibilityPublicRw', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipelineExecution.delete', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipelineExecution.stop', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.run', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipelineExecution.read', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'scheduleRule.create', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'scheduleRule.delete', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'scheduleRule.edit', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'scheduleRule.read', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'scheduleRule.setPriority', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.create', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.createFromInstance', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.setVisibility', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.delete', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.edit', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.export', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.copy', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.read', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.showScreen', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'user.management', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.create', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.copy', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'runtimeProperties.edit', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'userNotificationSettings.editEmailGlobal', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'userNotificationSettings.editNotificationFrequency', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'userNotificationSettings.createPipelineExecutionSettings', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); + diff --git a/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/data-core.sql b/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/data-core.sql new file mode 100644 index 0000000000..cf56c5d4d5 --- /dev/null +++ b/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/data-core.sql @@ -0,0 +1,31 @@ +delete from `properties`; +delete from `sch_email`; +delete from `usr_user_role`; +delete from `sch_email`; +delete from `sch_usr_notification`; +delete from `sch_usr_notification_email`; +delete from `usr_user`; +delete from `runtime_properties`; +delete from `role`; +delete from `permission`; + +INSERT INTO `properties` VALUES ('UV.Core.version','002.001.000'),('UV.Plugin-DevEnv.version','002.001.000'); +INSERT INTO `sch_email` VALUES (NULL,'admin@example.com'),(NULL,'user@example.com'); + +INSERT INTO `role` VALUES (NULL, 'Administrator'); +INSERT INTO `role` VALUES (NULL,'User'); + +INSERT INTO `usr_user` VALUES (NULL,'admin',1,'100000:3069f2086098a66ec0a859ec7872b09af7866bc7ecafe2bed3ec394454056db2:b5ab4961ae8ad7775b3b568145060fabb76d7bca41c7b535887201f79ee9788a','John Admin',20); +INSERT INTO `usr_extuser` VALUES ((SELECT max(id) FROM `usr_user`), 'admin'); +INSERT INTO `usr_user` VALUES (NULL,'user',2,'100000:3069f2086098a66ec0a859ec7872b09af7866bc7ecafe2bed3ec394454056db2:b5ab4961ae8ad7775b3b568145060fabb76d7bca41c7b535887201f79ee9788a','John User',20); +INSERT INTO `usr_extuser` VALUES ((SELECT max(id) FROM `usr_user`), 'user'); + +INSERT INTO `sch_usr_notification` VALUES (NULL,1,1,1,2,false),(NULL,2,1,1,2,false); +INSERT INTO `sch_usr_notification_email` VALUES (1,1),(2,2); + +INSERT INTO `usr_user_role` VALUES ((select id from usr_user where username='admin'),(select id from role where name='Administrator')); +INSERT INTO `usr_user_role` VALUES ((select id from usr_user where username='admin'),(select id from role where name='User')); +INSERT INTO `usr_user_role` VALUES ((select id from usr_user where username='user'),(select id from role where name='User')); + +INSERT INTO `runtime_properties` (name, value) VALUES ('backend.scheduledPipelines.limit', '5'); +INSERT INTO `runtime_properties` (name, value) VALUES ('run.now.pipeline.priority', '1'); \ No newline at end of file diff --git a/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/data-permissions.sql b/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/data-permissions.sql new file mode 100644 index 0000000000..93e1de2019 --- /dev/null +++ b/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/data-permissions.sql @@ -0,0 +1,124 @@ +-- Update permissions - delete all current permissions and insert latest version +DELETE FROM `user_role_permission`; +DELETE FROM `permission`; +ALTER TABLE `permission` AUTO_INCREMENT = 1; + +-- Insert permissions +INSERT INTO `permission` VALUES (NULL, 'administrator', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.delete', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.edit', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.definePipelineDependencies', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.export', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.exportScheduleRules', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.import', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.importScheduleRules', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.importUserData', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.schedule', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.read', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.runDebug', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.exportDpuData', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.exportDpuJars', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.setVisibility', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.setVisibilityPublicRw', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipelineExecution.delete', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipelineExecution.stop', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.run', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipelineExecution.read', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'scheduleRule.create', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'scheduleRule.delete', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'scheduleRule.edit', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'scheduleRule.read', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'scheduleRule.setPriority', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.create', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.createFromInstance', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.setVisibility', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.delete', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.edit', true); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.export', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.copy', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.read', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'dpuTemplate.showScreen', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'user.management', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.create', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'pipeline.copy', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'runtimeProperties.edit', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'userNotificationSettings.editEmailGlobal', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'userNotificationSettings.editNotificationFrequency', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); +INSERT INTO `permission` VALUES (NULL, 'userNotificationSettings.createPipelineExecutionSettings', false); +INSERT INTO `user_role_permission` values((select id from `role` where name='Administrator'), (SELECT max(id) FROM `permission`)); +INSERT INTO `user_role_permission` values((select id from `role` where name='User'), (SELECT max(id) FROM `permission`)); diff --git a/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/data.sql b/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/data.sql new file mode 100644 index 0000000000..77117c706d --- /dev/null +++ b/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/data.sql @@ -0,0 +1,9 @@ +-- ############################################################## +-- ## Database init script for standard UV installation # +-- ############################################################## + +-- Execute core data SQL script +\. ./data-core.sql + +-- Execute permissions SQL script +\. ./data-permissions.sql diff --git a/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/schema.sql b/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/schema.sql new file mode 100644 index 0000000000..de3b6c6b70 --- /dev/null +++ b/debian/unifiedviews-backend-mysql/src/deb/usr/share/unifiedviews/mysql/schema.sql @@ -0,0 +1,691 @@ +DROP VIEW IF EXISTS `pipeline_view`; +DROP VIEW IF EXISTS `exec_last_view`; +DROP VIEW IF EXISTS `exec_view`; +DROP TABLE IF EXISTS `exec_dataunit_info`; +DROP TABLE IF EXISTS `exec_context_dpu`; +DROP TABLE IF EXISTS `exec_record`; +DROP TABLE IF EXISTS `ppl_open_event`; +DROP TABLE IF EXISTS `exec_pipeline`; +DROP TABLE IF EXISTS `exec_context_pipeline`; +DROP TABLE IF EXISTS `exec_schedule_after`; +DROP TABLE IF EXISTS `ppl_edge`; +DROP TABLE IF EXISTS `ppl_node`; +DROP TABLE IF EXISTS `ppl_graph`; +DROP TABLE IF EXISTS `sch_sch_notification_email`; +DROP TABLE IF EXISTS `sch_sch_notification`; +DROP TABLE IF EXISTS `sch_usr_notification_email`; +DROP TABLE IF EXISTS `sch_usr_notification`; +DROP TABLE IF EXISTS `exec_schedule`; +DROP TABLE IF EXISTS `ppl_ppl_conflicts`; +DROP TABLE IF EXISTS `ppl_model`; +DROP TABLE IF EXISTS `dpu_instance`; +DROP TABLE IF EXISTS `dpu_template`; +DROP TABLE IF EXISTS `ppl_position`; +DROP TABLE IF EXISTS `user_role_permission`; +DROP TABLE IF EXISTS `permission`; +DROP TABLE IF EXISTS `usr_extuser`; +DROP TABLE IF EXISTS `usr_user_role`; +DROP TABLE IF EXISTS `role`; +DROP TABLE IF EXISTS `user_actor`; +DROP TABLE IF EXISTS `usr_user`; +DROP TABLE IF EXISTS `organization`; +DROP TABLE IF EXISTS `sch_email`; +DROP TABLE IF EXISTS `rdf_ns_prefix`; +DROP TABLE IF EXISTS `properties`; +DROP TABLE IF EXISTS `runtime_properties`; + +CREATE TABLE `dpu_instance` +( +-- DPURecord + `id` INTEGER AUTO_INCREMENT, + `name` VARCHAR(1024), + `menu_name` VARCHAR(255), + `use_dpu_description` boolean, + `description` TEXT, + `configuration` LONGBLOB, + `config_valid` boolean NOT NULL, +-- DPUInstaceRecord + `dpu_id` INTEGER, + `use_template_config` BOOLEAN NOT NULL DEFAULT FALSE, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE INDEX `ix_DPU_INSTANCE_dpu_id` ON `dpu_instance` (`dpu_id`); + +CREATE TABLE `dpu_template` +( +-- DPURecord + `id` INTEGER AUTO_INCREMENT, + `name` VARCHAR(1024), + `menu_name` VARCHAR(255), + `use_dpu_description` boolean, + `description` TEXT, + `configuration` LONGBLOB, + `parent_id` INTEGER, + `config_valid` boolean NOT NULL, +-- DPUTemplateRecord + `user_id` INTEGER, + `visibility` SMALLINT, + `type` SMALLINT, + `jar_directory` VARCHAR(255), + `jar_name` VARCHAR(255), + `jar_description` VARCHAR(1024), + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE INDEX `ix_DPU_TEMPLATE_jar_directory` ON `dpu_template` (`jar_directory`); +CREATE INDEX `ix_DPU_TEMPLATE_parent_id` ON `dpu_template` (`parent_id`); +CREATE INDEX `ix_DPU_TEMPLATE_user_id` ON `dpu_template` (`user_id`); +CREATE INDEX `ix_DPU_TEMPLATE_visibility` ON `dpu_template` (`visibility`); + +CREATE TABLE `exec_dataunit_info` +( + `id` INTEGER AUTO_INCREMENT, + `name` VARCHAR(2048), + `idx` INTEGER, + `type` SMALLINT, + `is_input` boolean, + `exec_context_dpu_id` INTEGER, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE INDEX `ix_EXEC_DATAUNIT_INFO_exec_context_dpu_id` ON `exec_dataunit_info` (`exec_context_dpu_id`); + +CREATE TABLE `exec_context_pipeline` +( + `id` INTEGER AUTO_INCREMENT, + `dummy` boolean, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `exec_context_dpu` +( + `id` INTEGER AUTO_INCREMENT, + `exec_context_pipeline_id` INTEGER, + `dpu_instance_id` INTEGER, + `state` SMALLINT, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE INDEX `ix_EXEC_CONTEXT_DPU_exec_context_pipeline_id` ON `exec_context_dpu` (`exec_context_pipeline_id`); +CREATE INDEX `ix_EXEC_CONTEXT_DPU_dpu_instance_id` ON `exec_context_dpu` (`dpu_instance_id`); + +CREATE TABLE `exec_record` +( + `id` INTEGER AUTO_INCREMENT, + `r_time` DATETIME, + `r_type` SMALLINT, + `dpu_id` INTEGER, + `execution_id` INTEGER, + `short_message` VARCHAR(128), + `full_message` TEXT, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE INDEX `ix_EXEC_RECORD_r_time` ON `exec_record` (`r_time`); +CREATE INDEX `ix_EXEC_RECORD_r_type` ON `exec_record` (`r_type`); +CREATE INDEX `ix_EXEC_RECORD_dpu_id` ON `exec_record` (`dpu_id`); +CREATE INDEX `ix_EXEC_RECORD_execution_id` ON `exec_record` (`execution_id`); + +CREATE TABLE `exec_pipeline` +( + `id` INTEGER AUTO_INCREMENT, + `status` INTEGER, + `pipeline_id` INTEGER, + `debug_mode` boolean, + `t_start` DATETIME, + `t_end` DATETIME, + `context_id` INTEGER, + `schedule_id` INTEGER, + `silent_mode` boolean, + `debugnode_id` INTEGER, + `stop` boolean, + `t_last_change` DATETIME, + `owner_id` INTEGER, + `user_actor_id` INTEGER, + `order_number` BIGINT NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE INDEX `ix_EXEC_PIPELINE_status` ON `exec_pipeline` (`status`); +CREATE INDEX `ix_EXEC_PIPELINE_pipeline_id` ON `exec_pipeline` (`pipeline_id`); +CREATE INDEX `ix_EXEC_PIPELINE_debug_mode` ON `exec_pipeline` (`debug_mode`); +-- Virtuoso 7 cannot handle the following index for some reason, see GH-952. +-- CREATE INDEX `ix_EXEC_PIPELINE_t_start` ON `exec_pipeline` (`t_start`); +CREATE INDEX `ix_EXEC_PIPELINE_context_id` ON `exec_pipeline` (`context_id`); +CREATE INDEX `ix_EXEC_PIPELINE_schedule_id` ON `exec_pipeline` (`schedule_id`); +CREATE INDEX `ix_EXEC_PIPELINE_owner_id` ON `exec_pipeline` (`owner_id`); +CREATE INDEX `ix_EXEC_PIPELINE_user_actor_id` ON `exec_pipeline` (`user_actor_id`); + + +CREATE TABLE `exec_schedule` +( + `id` INTEGER AUTO_INCREMENT, + `description` TEXT, + `pipeline_id` INTEGER NOT NULL, + `user_id` INTEGER, + `user_actor_id` INTEGER, + `just_once` boolean, + `enabled` boolean, + `type` SMALLINT, + `first_exec` DATETIME, + `last_exec` DATETIME, + `time_period` INTEGER, + `period_unit` SMALLINT, + `strict_timing` boolean, + `strict_tolerance` INTEGER, + `priority` BIGINT NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- composite index to optimize fetching schedules following pipeline +CREATE INDEX `ix_EXEC_SCHEDULE_pipeline_id_type` ON `exec_schedule` (`pipeline_id`, `type`); +CREATE INDEX `ix_EXEC_SCHEDULE_user_id` ON `exec_schedule` (`user_id`); +CREATE INDEX `ix_EXEC_SCHEDULE_user_actor_id` ON `exec_schedule` (`user_actor_id`); +CREATE INDEX `ix_EXEC_SCHEDULE_enabled` ON `exec_schedule` (`enabled`); +CREATE INDEX `ix_EXEC_SCHEDULE_type` ON `exec_schedule` (`type`); + +CREATE TABLE `exec_schedule_after` +( + `schedule_id` INTEGER, + `pipeline_id` INTEGER, + PRIMARY KEY (`schedule_id`, `pipeline_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `ppl_model` +( + `id` INTEGER AUTO_INCREMENT, + `name` VARCHAR(1024), + `description` TEXT, + `user_id` INTEGER, + `user_actor_id` INTEGER, + `visibility` SMALLINT, + `last_change` DATETIME, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE INDEX `ix_PPL_MODEL_user_id` ON `ppl_model` (`user_id`); +CREATE INDEX `ix_PPL_MODEL_user_actor_id` ON `ppl_model` (`user_actor_id`); + +CREATE TABLE `ppl_ppl_conflicts` +( + `pipeline_id` INTEGER AUTO_INCREMENT, + `pipeline_conflict_id` INTEGER, + PRIMARY KEY (`pipeline_id`, `pipeline_conflict_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE INDEX `ix_PPL_PPL_CONFLICTS_pipeline_id` ON `ppl_ppl_conflicts` (`pipeline_id`); + +CREATE TABLE `ppl_edge` +( + `id` INTEGER AUTO_INCREMENT, + `graph_id` INTEGER, + `node_from_id` INTEGER, + `node_to_id` INTEGER, + `data_unit_name` VARCHAR(2048), + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE INDEX `ix_PPL_EDGE_graph_id` ON `ppl_edge` (`graph_id`); +CREATE INDEX `ix_PPL_EDGE_node_from_id` ON `ppl_edge` (`node_from_id`); +CREATE INDEX `ix_PPL_EDGE_node_to_id` ON `ppl_edge` (`node_to_id`); + +CREATE TABLE `ppl_node` +( + `id` INTEGER AUTO_INCREMENT, + `graph_id` INTEGER, + `instance_id` INTEGER, + `position_id` INTEGER, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE INDEX `ix_PPL_NODE_graph_id` ON `ppl_node` (`graph_id`); +CREATE INDEX `ix_PPL_NODE_instance_id` ON `ppl_node` (`instance_id`); + +CREATE TABLE `ppl_graph` +( + `id` INTEGER AUTO_INCREMENT, + `pipeline_id` INTEGER, + PRIMARY KEY (`id`), + UNIQUE (pipeline_id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE INDEX `ix_PPL_GRAPH_pipeline_id` ON `ppl_graph` (`pipeline_id`); + +CREATE TABLE `ppl_position` +( + `id` INTEGER AUTO_INCREMENT, + `pos_x` INTEGER, + `pos_y` INTEGER, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `runtime_properties` +( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `name` VARCHAR(100) NULL, + `value` VARCHAR(100) NULL, + PRIMARY KEY (`id`), + UNIQUE (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `sch_sch_notification` +( + `id` INTEGER AUTO_INCREMENT, + `schedule_id` INTEGER NOT NULL, + `type_success` SMALLINT, + `type_error` SMALLINT, + `type_started` SMALLINT, + PRIMARY KEY (`id`), + UNIQUE (`schedule_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `sch_usr_notification` +( + `id` INTEGER AUTO_INCREMENT, + `user_id` INTEGER NOT NULL, + `type_success` SMALLINT, + `type_error` SMALLINT, + `type_started` SMALLINT, + `report_not_scheduled` BOOLEAN DEFAULT false, + PRIMARY KEY (`id`), + UNIQUE (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE INDEX `ix_SCH_USR_NOTIFICATION_user_id` ON `sch_usr_notification` (`user_id`); + +CREATE TABLE `sch_email` +( + `id` INTEGER AUTO_INCREMENT, + `email` VARCHAR(255), + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE INDEX `ix_SCH_EMAIL_email` ON `sch_email` (`email`); + +CREATE TABLE `sch_sch_notification_email` +( + `notification_id` INTEGER, + `email_id` INTEGER, + PRIMARY KEY (`notification_id`, `email_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `sch_usr_notification_email` +( + `notification_id` INTEGER AUTO_INCREMENT, + `email_id` INTEGER, + PRIMARY KEY (`notification_id`, `email_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE INDEX `ix_SCH_USR_NOTIFICATION_EMAIL_email_id` ON `sch_usr_notification_email` (`email_id`); + +CREATE TABLE `usr_user` +( + `id` INTEGER AUTO_INCREMENT, + `username` VARCHAR(25) NOT NULL, + `email_id` INTEGER, + `u_password` CHAR(142) NOT NULL, + `full_name` VARCHAR(55), + `table_rows` INTEGER, + PRIMARY KEY (`id`), + UNIQUE (`username`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE INDEX `ix_USR_USER_email_id` ON `usr_user` (`email_id`); + +CREATE TABLE `permission` ( + `id` INTEGER AUTO_INCREMENT, + `name` varchar(142) NOT NULL, + `sharedentityinstancewriterequired` boolean, + PRIMARY KEY (`id`), + UNIQUE (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE INDEX `ix_permission_name` ON `permission` (`name`); + +CREATE TABLE `role` ( + `id` INTEGER AUTO_INCREMENT, + `name` varchar(142) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE INDEX `ix_role_name` ON `role` (`name`); + +CREATE TABLE `user_role_permission` ( + `role_id` INTEGER NOT NULL, + `permission_id` INTEGER NOT NULL, + PRIMARY KEY (`role_id`,`permission_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `usr_user_role` +( + `user_id` INTEGER NOT NULL, + `role_id` INTEGER NOT NULL, + PRIMARY KEY (`user_id`, `role_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `usr_extuser` ( + `id_usr` INTEGER NOT NULL, + `id_extuser` varchar(255) NOT NULL, + PRIMARY KEY (`id_usr`,`id_extuser`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `user_actor` +( + `id` INTEGER AUTO_INCREMENT, + `id_extuser` VARCHAR(255) NOT NULL, + `name` VARCHAR(255) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE (`id_extuser`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `rdf_ns_prefix` +( + `id` INTEGER AUTO_INCREMENT, + `name` VARCHAR(255) NOT NULL, + `uri` VARCHAR(2048) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- Table with timestamps when was the last time users opened pipelines in canvas +CREATE TABLE `ppl_open_event` +( + `id` INTEGER AUTO_INCREMENT, + `pipeline_id` INTEGER NOT NULL, + `user_id` INTEGER NOT NULL, + `opened` DATETIME NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE INDEX `ix_PPL_OPEN_EVENT_pipeline_id` ON `ppl_open_event` (`pipeline_id`); +CREATE INDEX `ix_PPL_OPEN_EVENT_user_id` ON `ppl_open_event` (`user_id`); + +CREATE TABLE `properties` +( + `key` VARCHAR(200) NOT NULL, + `value` VARCHAR(200), + PRIMARY KEY (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- CONSTRAINTS ################################################################# + + +-- Table `dpu_instance` +ALTER TABLE `dpu_instance` +ADD FOREIGN KEY (`dpu_id`) + REFERENCES `dpu_template` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table `dpu_template` +ALTER TABLE `dpu_template` +ADD FOREIGN KEY (`parent_id`) + REFERENCES `dpu_template` (`id`) + ON UPDATE CASCADE ON DELETE SET NULL; + + +-- Table `exec_dataunit_info` +ALTER TABLE `exec_dataunit_info` +ADD FOREIGN KEY (`exec_context_dpu_id`) + REFERENCES `exec_context_dpu` (`id`) + ON UPDATE CASCADE ON DELETE SET NULL; + + +-- Table `exec_context_dpu` +ALTER TABLE `exec_context_dpu` +ADD FOREIGN KEY (`exec_context_pipeline_id`) + REFERENCES `exec_context_pipeline` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE `exec_context_dpu` +ADD FOREIGN KEY (`dpu_instance_id`) + REFERENCES `dpu_instance` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table `exec_record` +ALTER TABLE `exec_record` +ADD FOREIGN KEY (`dpu_id`) + REFERENCES `dpu_instance` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE `exec_record` +ADD FOREIGN KEY (`execution_id`) + REFERENCES `exec_pipeline` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table `exec_pipeline` +ALTER TABLE `exec_pipeline` +ADD FOREIGN KEY (`pipeline_id`) + REFERENCES `ppl_model` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE `exec_pipeline` +ADD FOREIGN KEY (`context_id`) + REFERENCES `exec_context_pipeline` (`id`) + ON UPDATE CASCADE ON DELETE SET NULL; + +ALTER TABLE `exec_pipeline` +ADD FOREIGN KEY (`schedule_id`) + REFERENCES `exec_schedule` (`id`) + ON UPDATE CASCADE ON DELETE SET NULL; + +ALTER TABLE `exec_pipeline` +ADD FOREIGN KEY (`debugnode_id`) + REFERENCES `ppl_node` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE `exec_pipeline` +ADD FOREIGN KEY (`owner_id`) + REFERENCES `usr_user` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE `exec_pipeline` +ADD FOREIGN KEY (`user_actor_id`) + REFERENCES `user_actor` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +-- Table `exec_schedule` +ALTER TABLE `exec_schedule` +ADD FOREIGN KEY (`pipeline_id`) + REFERENCES `ppl_model` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE `exec_schedule` +ADD FOREIGN KEY (`user_id`) + REFERENCES `usr_user` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE `exec_schedule` +ADD FOREIGN KEY (`user_actor_id`) + REFERENCES `user_actor` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +-- Table `exec_schedule_after` +ALTER TABLE `exec_schedule_after` +ADD FOREIGN KEY (`schedule_id`) + REFERENCES `exec_schedule` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE `exec_schedule_after` +ADD FOREIGN KEY (`pipeline_id`) + REFERENCES `ppl_model` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table `ppl_model` +ALTER TABLE `ppl_model` +ADD FOREIGN KEY (`user_id`) + REFERENCES `usr_user` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE `ppl_model` +ADD FOREIGN KEY (`user_actor_id`) + REFERENCES `user_actor` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +-- This constraint is only limited to first 255 characters in column. Larger constraint is only +-- possible with 'innodb_large_prefix' setting on database. +ALTER TABLE ppl_model ADD UNIQUE (name(255)); + +-- Table `ppl_ppl_conflicts` +ALTER TABLE `ppl_ppl_conflicts` +ADD FOREIGN KEY (`pipeline_id`) + REFERENCES `ppl_model` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE `ppl_ppl_conflicts` +ADD FOREIGN KEY (`pipeline_conflict_id`) + REFERENCES `ppl_model` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table `ppl_graph` +ALTER TABLE `ppl_graph` +ADD FOREIGN KEY (`pipeline_id`) + REFERENCES `ppl_model` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table `ppl_node` +ALTER TABLE `ppl_node` +ADD FOREIGN KEY (`graph_id`) + REFERENCES `ppl_graph` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE `ppl_node` +ADD FOREIGN KEY (`instance_id`) + REFERENCES `dpu_instance` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE `ppl_node` +ADD FOREIGN KEY (`position_id`) + REFERENCES `ppl_position` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table `ppl_edge` +ALTER TABLE `ppl_edge` +ADD FOREIGN KEY (`graph_id`) + REFERENCES `ppl_graph` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE `ppl_edge` +ADD FOREIGN KEY (`node_from_id`) + REFERENCES `ppl_node` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE `ppl_edge` +ADD FOREIGN KEY (`node_to_id`) + REFERENCES `ppl_node` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table `sch_sch_notification` +ALTER TABLE `sch_sch_notification` +ADD FOREIGN KEY (`schedule_id`) + REFERENCES `exec_schedule` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table `sch_sch_notification_email` +ALTER TABLE `sch_sch_notification_email` +ADD FOREIGN KEY (`notification_id`) + REFERENCES `sch_sch_notification` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE `sch_sch_notification_email` +ADD FOREIGN KEY (`email_id`) + REFERENCES `sch_email` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table `sch_usr_notification` +ALTER TABLE `sch_usr_notification` +ADD FOREIGN KEY (`user_id`) + REFERENCES `usr_user` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table `sch_usr_notification_email` +ALTER TABLE `sch_usr_notification_email` +ADD FOREIGN KEY (`notification_id`) + REFERENCES `sch_usr_notification` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE `sch_usr_notification_email` +ADD FOREIGN KEY (`email_id`) + REFERENCES `sch_email` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table `usr_user` +ALTER TABLE `usr_user` +ADD FOREIGN KEY (`email_id`) + REFERENCES `sch_email` (`id`) + ON UPDATE CASCADE ON DELETE SET NULL; + +-- Table `usr_user_role` +ALTER TABLE `usr_user_role` +ADD FOREIGN KEY (`user_id`) + REFERENCES `usr_user` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +-- Table `usr_user_role` +ALTER TABLE `usr_user_role` +ADD FOREIGN KEY (`role_id`) + REFERENCES `role` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +-- Table `ppl_open_event` +ALTER TABLE `ppl_open_event` +ADD FOREIGN KEY (`user_id`) + REFERENCES `usr_user` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE `ppl_open_event` +ADD FOREIGN KEY (`pipeline_id`) + REFERENCES `ppl_model` (`id`) + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- TRIGGERS ###################################################### + + +-- BEGIN MYSQL ONLY + +CREATE TRIGGER update_last_change BEFORE UPDATE ON `exec_pipeline` + FOR EACH ROW SET NEW.t_last_change = NOW(); +-- END MYSQL ONLY + +-- TABLE FOR LOGS + +DROP TABLE IF EXISTS `logging`; +CREATE TABLE `logging` +( +-- BEGIN MYSQL ONLY + `id` INTEGER unsigned NOT NULL AUTO_INCREMENT, +-- END MYSQL ONLY + `log_level` INT(11) NOT NULL, + `timestmp` BIGINT NOT NULL, + `logger` VARCHAR(254) NOT NULL, + `message` TEXT, + `dpu` INTEGER, + `execution` INTEGER NOT NULL, + `stack_trace` TEXT, + `relative_id` INTEGER, + PRIMARY KEY (id) +-- BEGIN MYSQL ONLY +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- END MYSQL ONLY + +CREATE INDEX `ix_LOGGING_dpu` ON `logging` (`dpu`); +CREATE INDEX `ix_LOGGIN_execution` ON `logging` (`execution`); +CREATE INDEX `ix_LOGGIN_relative_id` ON `logging` (`relative_id`); + +-- Views. +CREATE VIEW `exec_last_view` AS +SELECT id, pipeline_id, t_end, t_start, status +FROM `exec_pipeline` AS exec +WHERE t_end = (SELECT max(t_end) FROM `exec_pipeline` AS lastExec WHERE exec.pipeline_id = lastExec.pipeline_id); + +CREATE VIEW `pipeline_view` AS +SELECT ppl.id AS id, ppl.name AS name, exec.t_start AS t_start, exec.t_end AS t_end, exec.status AS status, usr.username as usr_name, usr.full_name as usr_full_name, +ppl.visibility AS visibility, actor.name AS user_actor_name FROM `ppl_model` AS ppl +LEFT JOIN `exec_last_view` AS exec ON exec.pipeline_id = ppl.id +LEFT JOIN `usr_user` AS usr ON ppl.user_id = usr.id +LEFT JOIN `user_actor` AS actor ON ppl.user_actor_id = actor.id; + +CREATE VIEW `exec_view` AS +SELECT exec.id AS id, exec.status AS status, ppl.id AS pipeline_id, ppl.name AS pipeline_name, exec.debug_mode AS debug_mode, exec.t_start AS t_start, +exec.t_end AS t_end, exec.schedule_id AS schedule_id, owner.username AS owner_name, owner.full_name AS owner_full_name, exec.stop AS stop, exec.t_last_change AS t_last_change, +actor.name AS user_actor_name FROM `exec_pipeline` AS exec +LEFT JOIN `ppl_model` AS ppl ON ppl.id = exec.pipeline_id +LEFT JOIN `usr_user` AS owner ON owner.id = exec.owner_id +LEFT JOIN `user_actor` AS actor ON actor.id = exec.user_actor_id; diff --git a/debian/unifiedviews-backend-pgsql/pom.xml b/debian/unifiedviews-backend-pgsql/pom.xml new file mode 100644 index 0000000000..05c48f7235 --- /dev/null +++ b/debian/unifiedviews-backend-pgsql/pom.xml @@ -0,0 +1,71 @@ + + 4.0.0 + + + eu.unifiedviews.packages + unifiedviews-packages + 2.2.0-SNAPSHOT + + + eu.unifiedviews.packages + unifiedviews-backend-pgsql + unifiedviews-backend-pgsql + + + + + eu.unifiedviews + backend + 2.1.2 + + + + + + maven.eea.sk + maven.eea.sk-public + http://maven.eea.sk/artifactory/public/ + + + + + + + jdeb + org.vafer + 1.4 + + + package + + jdeb + + + ${debian-package-name} + + + + ${basedir}/src/deb/etc/unifiedviews/backend-config.properties + file + + perm + /etc/unifiedviews + + + + + ${basedir}/src/deb/usr/share/unifiedviews/pgsql + directory + + perm + /usr/share/unifiedviews/pgsql + + + + + + + + + + diff --git a/debian/unifiedviews-backend-pgsql/src/deb/control/.postinst.swp b/debian/unifiedviews-backend-pgsql/src/deb/control/.postinst.swp new file mode 100644 index 0000000000..873d5249ee Binary files /dev/null and b/debian/unifiedviews-backend-pgsql/src/deb/control/.postinst.swp differ diff --git a/debian/unifiedviews-backend-pgsql/src/deb/control/conffiles b/debian/unifiedviews-backend-pgsql/src/deb/control/conffiles new file mode 100644 index 0000000000..9dc7ad5ef8 --- /dev/null +++ b/debian/unifiedviews-backend-pgsql/src/deb/control/conffiles @@ -0,0 +1 @@ +/etc/unifiedviews/backend-config.properties \ No newline at end of file diff --git a/debian/unifiedviews-backend-pgsql/src/deb/control/config b/debian/unifiedviews-backend-pgsql/src/deb/control/config new file mode 100644 index 0000000000..b3822533ce --- /dev/null +++ b/debian/unifiedviews-backend-pgsql/src/deb/control/config @@ -0,0 +1,9 @@ +#!/bin/sh +set -e +. /usr/share/debconf/confmodule + +db_input low backend/pgsql_db_user || true +db_go +db_input low backend/pgsql_db_password || true +db_go + diff --git a/debian/unifiedviews-backend-pgsql/src/deb/control/control b/debian/unifiedviews-backend-pgsql/src/deb/control/control new file mode 100644 index 0000000000..fd8c56fecc --- /dev/null +++ b/debian/unifiedviews-backend-pgsql/src/deb/control/control @@ -0,0 +1,9 @@ +Package: unifiedviews-backend-pgsql +Version: [[debian-package-version]] +Section: java +Priority: extra +Architecture: all +Maintainer: jmc@eea.sk +Depends: unifiedviews-backend-shared (>> 2.1), unifiedviews-backend-shared (<< 2.2), postgresql, debconf (>= 0.5) +Conflicts: unifiedviews-backend-mysql +Description: The postgresql database and settings for unifiedviews's backend. diff --git a/debian/unifiedviews-backend-pgsql/src/deb/control/postinst b/debian/unifiedviews-backend-pgsql/src/deb/control/postinst new file mode 100644 index 0000000000..bb4267d8ab --- /dev/null +++ b/debian/unifiedviews-backend-pgsql/src/deb/control/postinst @@ -0,0 +1,187 @@ +#!/bin/sh +# postinst script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +. /usr/share/debconf/confmodule + +db_creadentials() { + db_get backend/pgsql_db_user + DB_USER=$RET + + db_get backend/pgsql_db_password + DB_PASS=$RET +} + +set_java() { + JAVA_VERSION=`java -version 2>&1 | grep "java version" | awk '{print $3}' | tr -d \" | awk '{split($0, array, ".")} END{print array[2]}'` + echo -n "check java version" + if [ ! $JAVA_VERSION -eq 7 ]; then + JAVA_NAME=`update-java-alternatives -l | grep 7 | cut -d' ' -f1` + if [ -n $JAVA_NAME ] ; then + /usr/sbin/update-java-alternatives --jre-headless --set $JAVA_NAME + echo " - Java version is set to 1.7" + else + echo " ERROR: java 7 is not installed" + fi + + else + echo " - ok" + fi + +} + + +db_up() { + #Check if postgresql is started + /etc/init.d/postgresql status > /dev/null || /etc/init.d/postgresql start >/dev/null 2>&1 + + echo -n "INFO: Waiting for postgresql to be up..." + CPT=0 + TIMEOUT=60 + while ! su - postgres -c "psql -q --output /dev/null -c \"SELECT COUNT(*) FROM pg_catalog.pg_authid\"" >/dev/null 2>&1 + do + echo -n "." + sleep 1 + CPT=$((${CPT}+1)) + if [ ${CPT} -eq ${TIMEOUT} ] + then + echo -e "\nERROR: Connection to PostgreSQL has not been established before timeout. Exiting" + exit 1 + fi + done + echo " Done" +} + + +db_configure() { + dbname="$1" + usrname="$2" + pass="$3" + CHK_PG_DB=$(su - postgres -c "psql -t -c \"select count(1) from pg_catalog.pg_database where datname = '${dbname}'\"") + CHK_PG_USER=$(su - postgres -c "psql -t -c \"select count(1) from pg_user where usename = '${usrname}'\"") + + if [ ${CHK_PG_USER} -eq 0 ] + then + echo -n "INFO: Creating PostgreSQL user..." + su - postgres -c "psql -q -c \"CREATE USER ${usrname} WITH PASSWORD '${DB_PASS}'\"" + echo "Done" + fi + + CHK_PG_ENCODE=$(su - postgres -c " psql template1 -t -c 'SHOW SERVER_ENCODING'") + ENCODING="UTF8" + if [ ! ${CHK_PG_ENCODE} = $ENCODING ]; then + echo "set encoding ${ENCODING} to template1" + su - postgres -c "psql -q -d template1 -c \"UPDATE pg_database SET datistemplate=FALSE WHERE datname='template1' ;\"" + su - postgres -c "psql -q -c \"DROP DATABASE IF EXISTS template1;\"" + su - postgres -c "createdb -O postgres template1 -T template0 -E $ENCODING;" + su - postgres -c "psql -q -d template1 -c \"UPDATE pg_database SET datistemplate=TRUE WHERE datname='template1' ;\"" + fi + + if [ ${CHK_PG_DB} -eq 0 ] + then + echo -n "INFO: Creating PostgreSQL database..." + su - postgres -c "createdb -O ${usrname} ${dbname}" + + su - postgres -c "psql -d ${dbname}" < \ + /usr/share/unifiedviews/pgsql/schema.sql + + su - postgres -c "psql -d ${dbname}" < \ + /usr/share/unifiedviews/pgsql/data-core.sql + + su - postgres -c "psql -d ${dbname}" < \ + /usr/share/unifiedviews/pgsql/data-permissions.sql + + su - postgres -c "psql -q -d ${dbname} -c \"GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO ${usrname};\"" + su - postgres -c "psql -q -d ${dbname} -c \"GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO ${usrname};\"" + echo " Done" + fi + + version=`su - postgres -c "psql -A -t -d unifiedviews -c \"select value from properties WHERE properties.key='UV.Core.version' \""` + if [ "$version" = "001.005.005" ] + then + # set db schema version + su - postgres -c "psql -d ${dbname}" < \ + /usr/share/unifiedviews/pgsql/updates/1.6.0-update.sql + su - postgres -c "psql -q -d ${dbname} -c \"GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO ${usrname};\"" + su - postgres -c "psql -q -d ${dbname} -c \"GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO ${usrname};\"" + fi + + if [ "$version" = "001.006.000" ] + then + # set db schema version + su - postgres -c "psql -d ${dbname}" < \ + /usr/share/unifiedviews/pgsql/updates/2.0.0-update.sql + su - postgres -c "psql -q -d ${dbname} -c \"GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO ${usrname};\"" + su - postgres -c "psql -q -d ${dbname} -c \"GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO ${usrname};\"" + fi + + if [ "$version" = "002.000.000" ] + then + su - postgres -c "psql -d ${dbname}" < \ + /usr/share/unifiedviews/pgsql/updates/2.1.0-core.sql + + su - postgres -c "psql -d ${dbname}" < \ + /usr/share/unifiedviews/pgsql/updates/2.1.0-permissions.sql + su - postgres -c "psql -q -d ${dbname} -c \"GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO ${usrname};\"" + su - postgres -c "psql -q -d ${dbname} -c \"GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO ${usrname};\"" + fi + + # update backend config + sed --in-place \ + -e "s/database.sql.hostname = .*/database.sql.hostname = $address_host/" \ + -e "s/database.sql.port = .*/database.sql.port = 3306/" \ + -e "s/database.sql.user = .*/database.sql.user = $DB_USER/" \ + -e "s/database.sql.password = .*/database.sql.password = $DB_PASS/" \ + /etc/unifiedviews/backend-config.properties +} + + +fix_perms() { + chown unifiedviews:unifiedviews /etc/unifiedviews/backend-config.properties + chown -R unifiedviews:unifiedviews /usr/share/unifiedviews/pgsql +} + + +case "$1" in + configure) + db_creadentials + fix_perms + db_up + set_java + db_configure unifiedviews $DB_USER $DB_PASS + db_stop + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + + ;; +esac + + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/unifiedviews-backend-pgsql/src/deb/control/postrm b/debian/unifiedviews-backend-pgsql/src/deb/control/postrm new file mode 100644 index 0000000000..17f98a2f1f --- /dev/null +++ b/debian/unifiedviews-backend-pgsql/src/deb/control/postrm @@ -0,0 +1,49 @@ +#!/bin/sh +# postrm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + + remove|abort-install|disappear) + echo "DROP DATABASE unifiedviews" + # DROP DATABASE unifiedviews + dbname=unifiedviews + su - postgres -c "psql -q -c \"DROP DATABASE IF EXISTS ${dbname};\"" + ;; + + purge) + ;; + + + upgrade|failed-upgrade|abort-upgrade) + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/unifiedviews-backend-pgsql/src/deb/control/prerm b/debian/unifiedviews-backend-pgsql/src/deb/control/prerm new file mode 100644 index 0000000000..040a82e256 --- /dev/null +++ b/debian/unifiedviews-backend-pgsql/src/deb/control/prerm @@ -0,0 +1,46 @@ +#!/bin/sh +# prerm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + if [ -x "/etc/init.d/unifiedviews-backend" ]; then + invoke-rc.d unifiedviews-backend stop || true + fi + + + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + + +#DEBHELPER# + +exit 0 + + diff --git a/debian/unifiedviews-backend-pgsql/src/deb/control/templates b/debian/unifiedviews-backend-pgsql/src/deb/control/templates new file mode 100644 index 0000000000..31047973b0 --- /dev/null +++ b/debian/unifiedviews-backend-pgsql/src/deb/control/templates @@ -0,0 +1,10 @@ +Template: backend/pgsql_db_user +Type: string +Default: uv +Description: Postgres user for unifiedviews + +Template: backend/pgsql_db_password +Type: password +Default: uv +Description: Postgres user password for unifiedviews + \ No newline at end of file diff --git a/debian/unifiedviews-backend-pgsql/src/deb/etc/unifiedviews/backend-config.properties b/debian/unifiedviews-backend-pgsql/src/deb/etc/unifiedviews/backend-config.properties new file mode 100644 index 0000000000..8dbeddb92b --- /dev/null +++ b/debian/unifiedviews-backend-pgsql/src/deb/etc/unifiedviews/backend-config.properties @@ -0,0 +1,73 @@ +# This is the central configuration for BACKEND of ODCS application. +# +# The key and element characters #, !, =, and : should be properly escaped +# with a preceding backslash to ensure that they are properly loaded. + +# !!! The frontend is configured separately from file +# frontend/src/main/webapp/WEB-INF/config.properties +# use frontend/src/main/webapp/WEB-INF/config.sample.properties as a +# configuration file template. + +# directory where backend log should be stored (should not end with / or \ ) +backend.log.directory = /var/log/unifiedviews/backend/ +# how long should backend keep log history +backend.log.keepDays = 7 + +# General settings (should end with "backend/working") +general.workingdir = /var/cache/unifiedviews/backend/working + +# Backend application configuration +backend.host = 127.0.0.1 +backend.port = 5010 + +# Connection configuration setting for relational database +# for postgresql { +database.sql.driver = org.postgresql.Driver +database.sql.url = jdbc:postgresql://localhost:5432/unifiedviews +database.sql.user = unifiedviews +database.sql.password = unifiedviews +# } + +# for mysql { +#database.sql.driver = com.mysql.jdbc.Driver +#database.sql.url = jdbc:mysql://localhost:3306/unifiedviews?characterEncoding=utf8 +#database.sql.user = unifiedviews +#database.sql.password = unifiedviews +# } + + +# Connection configuration setting for RDF database +# use local rdf platform { +database.rdf.platform = localRDF +# } + +# or use remote rdf platform (sesame) { +#database.rdf.platform = remoteRDF +#database.rdf.url = http://ip6-localhost:8080/openrdf-sesame +#database.rdf.user = +#database.rdf.password = +# } + + + +# Administrator contact email for sending reports and failure notifications +email.enabled = false +email.admin = admin@example.com +# use if email.enabled = true +#email.smtp.host = smtp.server.cz +#email.smtp.port = 25 +#email.smtp.ttl = false +#email.from = odcs@xrg.mff.cuni.cz +#email.authorization = false +# use if email.authorization = true +#email.username = +#email.password = + +# Configuration of DPU modules +module.path = /var/lib/unifiedviews/common +module.backend.expose = sun.misc,sun.io,com.sun.nio.file + +# Language configuration (e.g.: en_US, sk) +locale = en +#type of ownership user|organization +ownership.type=user diff --git a/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/data-core.sql b/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/data-core.sql new file mode 100644 index 0000000000..ed38226435 --- /dev/null +++ b/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/data-core.sql @@ -0,0 +1,21 @@ +delete from "properties"; +delete from "sch_email"; +delete from "usr_user_role"; +delete from "sch_email"; +delete from "sch_usr_notification"; +delete from "sch_usr_notification_email"; +delete from "usr_user"; +delete from "runtime_properties"; +INSERT INTO "properties" VALUES ('UV.Core.version','002.001.000'),('UV.Plugin-DevEnv.version','002.001.000'); +INSERT INTO "sch_email" VALUES (nextval('seq_sch_email'),'admin@example.com'),(nextval('seq_sch_email'),'user@example.com'); +INSERT INTO "role" VALUES (nextval('seq_role'), 'Administrator'),(nextval('seq_role'),'User'); + +INSERT INTO "usr_user" VALUES (nextval('seq_usr_user'),'admin',1,'100000:3069f2086098a66ec0a859ec7872b09af7866bc7ecafe2bed3ec394454056db2:b5ab4961ae8ad7775b3b568145060fabb76d7bca41c7b535887201f79ee9788a','John Admin',20); +INSERT INTO "usr_extuser" VALUES (currval('seq_usr_user'), 'admin'); +INSERT INTO "usr_user" VALUES (nextval('seq_usr_user'),'user',2,'100000:3069f2086098a66ec0a859ec7872b09af7866bc7ecafe2bed3ec394454056db2:b5ab4961ae8ad7775b3b568145060fabb76d7bca41c7b535887201f79ee9788a','John User',20); +INSERT INTO "usr_extuser" VALUES (currval('seq_usr_user'), 'user'); +INSERT INTO "sch_usr_notification" VALUES (nextval('seq_sch_notification'),1,1,1,2),(nextval('seq_sch_notification'),2,1,1,2); +INSERT INTO "sch_usr_notification_email" VALUES (1,1),(2,2); +INSERT INTO "usr_user_role" VALUES (1,1),(1,2),(2,2); +INSERT INTO "runtime_properties" ("id", "name", "value") VALUES (nextval('seq_runtime_properties'), 'backend.scheduledPipelines.limit', '5'); +INSERT INTO "runtime_properties" ("id", "name", "value") VALUES (nextval('seq_runtime_properties'), 'run.now.pipeline.priority', '1'); diff --git a/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/data-permissions.sql b/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/data-permissions.sql new file mode 100644 index 0000000000..6c82a8c67a --- /dev/null +++ b/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/data-permissions.sql @@ -0,0 +1,128 @@ +-- ################################################################################## +-- ## UV permissions initialization script specific for eDemo installation # +-- ## REQUIRES database initialized by data.sql script !!! # +-- ################################################################################## + +-- clear permissions tables +DELETE FROM permission; +ALTER SEQUENCE "seq_permission" RESTART WITH 1; + +-- Insert permissions +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'administrator', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.delete', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.edit', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.definePipelineDependencies', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.export', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.exportScheduleRules', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.import', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.importScheduleRules', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.importUserData', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.schedule', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.read', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.runDebug', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.exportDpuData', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.exportDpuJars', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.setVisibility', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.setVisibilityPublicRw', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipelineExecution.delete', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipelineExecution.stop', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.run', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipelineExecution.read', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'scheduleRule.create', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'scheduleRule.delete', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'scheduleRule.edit', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'scheduleRule.read', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'scheduleRule.setPriority', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.create', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.createFromInstance', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.setVisibility', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.delete', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.edit', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.export', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.copy', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.read', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.showScreen', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'user.management', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.create', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.copy', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'runtimeProperties.edit', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'userNotificationSettings.editEmailGlobal', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'userNotificationSettings.editNotificationFrequency', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'userNotificationSettings.createPipelineExecutionSettings', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); diff --git a/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/schema.sql b/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/schema.sql new file mode 100644 index 0000000000..a54810a1fc --- /dev/null +++ b/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/schema.sql @@ -0,0 +1,727 @@ +DROP SEQUENCE IF EXISTS "seq_dpu_record"; +DROP SEQUENCE IF EXISTS "seq_exec_dataunit_info"; +DROP SEQUENCE IF EXISTS "seq_exec_context_pipeline"; +DROP SEQUENCE IF EXISTS "seq_exec_context_dpu"; +DROP SEQUENCE IF EXISTS "seq_exec_record"; +DROP SEQUENCE IF EXISTS "seq_exec_pipeline"; +DROP SEQUENCE IF EXISTS "seq_exec_schedule"; +DROP SEQUENCE IF EXISTS "seq_ppl_model"; +DROP SEQUENCE IF EXISTS "seq_ppl_edge"; +DROP SEQUENCE IF EXISTS "seq_ppl_node"; +DROP SEQUENCE IF EXISTS "seq_ppl_graph"; +DROP SEQUENCE IF EXISTS "seq_ppl_position"; +DROP SEQUENCE IF EXISTS "seq_runtime_properties"; +DROP SEQUENCE IF EXISTS "seq_sch_notification"; +DROP SEQUENCE IF EXISTS "seq_sch_email"; +DROP SEQUENCE IF EXISTS "seq_usr_user"; +DROP SEQUENCE IF EXISTS "seq_permission"; +DROP SEQUENCE IF EXISTS "seq_role"; +DROP SEQUENCE IF EXISTS "seq_organization"; +DROP SEQUENCE IF EXISTS "seq_rdf_ns_prefix"; +DROP SEQUENCE IF EXISTS "seq_ppl_open_event"; +DROP SEQUENCE IF EXISTS "seq_user_actor"; +DROP VIEW IF EXISTS "pipeline_view"; +DROP VIEW IF EXISTS "exec_last_view"; +DROP VIEW IF EXISTS "exec_view"; +DROP TABLE IF EXISTS "exec_dataunit_info"; +DROP TABLE IF EXISTS "exec_context_dpu"; +DROP TABLE IF EXISTS "exec_record"; +DROP TABLE IF EXISTS "ppl_open_event"; +DROP TABLE IF EXISTS "exec_pipeline"; +DROP TABLE IF EXISTS "exec_context_pipeline"; +DROP TABLE IF EXISTS "exec_schedule_after"; +DROP TABLE IF EXISTS "ppl_edge"; +DROP TABLE IF EXISTS "ppl_node"; +DROP TABLE IF EXISTS "ppl_graph"; +DROP TABLE IF EXISTS "sch_sch_notification_email"; +DROP TABLE IF EXISTS "sch_sch_notification"; +DROP TABLE IF EXISTS "sch_usr_notification_email"; +DROP TABLE IF EXISTS "sch_usr_notification"; +DROP TABLE IF EXISTS "exec_schedule"; +DROP TABLE IF EXISTS "ppl_ppl_conflicts"; +DROP TABLE IF EXISTS "ppl_model"; +DROP TABLE IF EXISTS "dpu_instance"; +DROP TABLE IF EXISTS "dpu_template"; +DROP TABLE IF EXISTS "ppl_position"; +DROP TABLE IF EXISTS "user_role_permission"; +DROP TABLE IF EXISTS "permission"; +DROP TABLE IF EXISTS "usr_extuser"; +DROP TABLE IF EXISTS "usr_user_role"; +DROP TABLE IF EXISTS "role"; +DROP TABLE IF EXISTS "user_actor"; +DROP TABLE IF EXISTS "usr_user"; +DROP TABLE IF EXISTS "organization"; +DROP TABLE IF EXISTS "sch_email"; +DROP TABLE IF EXISTS "rdf_ns_prefix"; +DROP TABLE IF EXISTS "properties"; +DROP TABLE IF EXISTS "runtime_properties"; + +CREATE SEQUENCE "seq_dpu_record" START 1; +CREATE TABLE "dpu_instance" +( +-- DPURecord + "id" INTEGER, + "name" VARCHAR(1024), + "menu_name" VARCHAR(255), + "use_dpu_description" boolean, + "description" TEXT, + "configuration" BYTEA, + "config_valid" boolean, +-- DPUInstaceRecord + "dpu_id" INTEGER, + "use_template_config" boolean NOT NULL DEFAULT FALSE, + PRIMARY KEY ("id") +); +CREATE INDEX "ix_DPU_INSTANCE_dpu_id" ON "dpu_instance" ("dpu_id"); + +CREATE TABLE "dpu_template" +( +-- DPURecord + "id" INTEGER, + "name" VARCHAR(1024), + "menu_name" VARCHAR(255), + "use_dpu_description" boolean, + "description" TEXT, + "configuration" BYTEA, + "parent_id" INTEGER, + "config_valid" boolean NOT NULL, +-- DPUTemplateRecord + "user_id" INTEGER, + "visibility" SMALLINT, + "type" SMALLINT, + "jar_directory" VARCHAR(255), + "jar_name" VARCHAR(255), + "jar_description" VARCHAR(1024), + PRIMARY KEY ("id") +); +CREATE INDEX "ix_DPU_TEMPLATE_jar_directory" ON "dpu_template" ("jar_directory"); +CREATE INDEX "ix_DPU_TEMPLATE_parent_id" ON "dpu_template" ("parent_id"); +CREATE INDEX "ix_DPU_TEMPLATE_user_id" ON "dpu_template" ("user_id"); +CREATE INDEX "ix_DPU_TEMPLATE_visibility" ON "dpu_template" ("visibility"); + +CREATE SEQUENCE "seq_exec_dataunit_info" START 1; +CREATE TABLE "exec_dataunit_info" +( + "id" INTEGER, + "name" VARCHAR(2048), + "idx" INTEGER, + "type" SMALLINT, + "is_input" boolean, + "exec_context_dpu_id" INTEGER, + PRIMARY KEY ("id") +); +CREATE INDEX "ix_EXEC_DATAUNIT_INFO_exec_context_dpu_id" ON "exec_dataunit_info" ("exec_context_dpu_id"); + +CREATE SEQUENCE "seq_exec_context_pipeline" START 1; +CREATE TABLE "exec_context_pipeline" +( + "id" INTEGER, + "dummy" boolean, + PRIMARY KEY ("id") +); + +CREATE SEQUENCE "seq_exec_context_dpu" START 1; +CREATE TABLE "exec_context_dpu" +( + "id" INTEGER, + "exec_context_pipeline_id" INTEGER, + "dpu_instance_id" INTEGER, + "state" SMALLINT, + PRIMARY KEY ("id") +); +CREATE INDEX "ix_EXEC_CONTEXT_DPU_exec_context_pipeline_id" ON "exec_context_dpu" ("exec_context_pipeline_id"); +CREATE INDEX "ix_EXEC_CONTEXT_DPU_dpu_instance_id" ON "exec_context_dpu" ("dpu_instance_id"); + +CREATE SEQUENCE "seq_exec_record" START 1; +CREATE TABLE "exec_record" +( + "id" INTEGER, + "r_time" TIMESTAMP, + "r_type" SMALLINT, + "dpu_id" INTEGER, + "execution_id" INTEGER, + "short_message" VARCHAR(128), + "full_message" TEXT, + PRIMARY KEY ("id") +); +CREATE INDEX "ix_EXEC_RECORD_r_time" ON "exec_record" ("r_time"); +CREATE INDEX "ix_EXEC_RECORD_r_type" ON "exec_record" ("r_type"); +CREATE INDEX "ix_EXEC_RECORD_dpu_id" ON "exec_record" ("dpu_id"); +CREATE INDEX "ix_EXEC_RECORD_execution_id" ON "exec_record" ("execution_id"); + +CREATE SEQUENCE "seq_exec_pipeline" START 1; +CREATE TABLE "exec_pipeline" +( + "id" INTEGER, + "status" INTEGER, + "pipeline_id" INTEGER, + "debug_mode" boolean, + "t_start" TIMESTAMP, + "t_end" TIMESTAMP, + "context_id" INTEGER, + "schedule_id" INTEGER, + "silent_mode" boolean, + "debugnode_id" INTEGER, + "stop" boolean, + "t_last_change" TIMESTAMP, + "owner_id" INTEGER, + "user_actor_id" INTEGER, + "order_number" BIGINT NOT NULL, + PRIMARY KEY ("id") +); +CREATE INDEX "ix_EXEC_PIPELINE_status" ON "exec_pipeline" ("status"); +CREATE INDEX "ix_EXEC_PIPELINE_pipeline_id" ON "exec_pipeline" ("pipeline_id"); +CREATE INDEX "ix_EXEC_PIPELINE_debug_mode" ON "exec_pipeline" ("debug_mode"); +-- Virtuoso 7 cannot handle the following index for some reason, see GH-952. +-- CREATE INDEX "ix_EXEC_PIPELINE_t_start" ON "exec_pipeline" ("t_start"); +CREATE INDEX "ix_EXEC_PIPELINE_context_id" ON "exec_pipeline" ("context_id"); +CREATE INDEX "ix_EXEC_PIPELINE_schedule_id" ON "exec_pipeline" ("schedule_id"); +CREATE INDEX "ix_EXEC_PIPELINE_owner_id" ON "exec_pipeline" ("owner_id"); +CREATE INDEX "ix_EXEC_PIPELINE_user_actor_id" ON "exec_pipeline" ("user_actor_id"); + +CREATE SEQUENCE "seq_exec_schedule" START 1; +CREATE TABLE "exec_schedule" +( + "id" INTEGER, + "description" TEXT, + "pipeline_id" INTEGER NOT NULL, + "user_id" INTEGER, + "user_actor_id" INTEGER, + "just_once" boolean, + "enabled" boolean, + "type" SMALLINT, + "first_exec" TIMESTAMP, + "last_exec" TIMESTAMP, + "time_period" INTEGER, + "period_unit" SMALLINT, + "strict_timing" boolean, + "strict_tolerance" INTEGER, + "priority" BIGINT NOT NULL, + PRIMARY KEY ("id") +); +-- composite index to optimize fetching schedules following pipeline +CREATE INDEX "ix_EXEC_SCHEDULE_pipeline_id_type" ON "exec_schedule" ("pipeline_id", "type"); +CREATE INDEX "ix_EXEC_SCHEDULE_user_id" ON "exec_schedule" ("user_id"); +CREATE INDEX "ix_EXEC_SCHEDULE_user_actor_id" ON "exec_schedule" ("user_actor_id"); +CREATE INDEX "ix_EXEC_SCHEDULE_enabled" ON "exec_schedule" ("enabled"); +CREATE INDEX "ix_EXEC_SCHEDULE_type" ON "exec_schedule" ("type"); + +CREATE TABLE "exec_schedule_after" +( + "schedule_id" INTEGER, + "pipeline_id" INTEGER, + PRIMARY KEY ("schedule_id", "pipeline_id") +); + +CREATE SEQUENCE "seq_ppl_model" START 1; +CREATE TABLE "ppl_model" +( + "id" INTEGER, + "name" VARCHAR(1024) UNIQUE, + "description" TEXT, + "user_id" INTEGER, + "user_actor_id" INTEGER, + "visibility" SMALLINT, + "last_change" TIMESTAMP, + PRIMARY KEY ("id") +); +CREATE INDEX "ix_PPL_MODEL_user_id" ON "ppl_model" ("user_id"); +CREATE INDEX "ix_PPL_MODEL_user_actor_id" ON "ppl_model" ("user_actor_id"); + +CREATE TABLE "ppl_ppl_conflicts" +( + "pipeline_id" INTEGER, + "pipeline_conflict_id" INTEGER, + PRIMARY KEY ("pipeline_id", "pipeline_conflict_id") +); +CREATE INDEX "ix_PPL_PPL_CONFLICTS_pipeline_id" ON "ppl_ppl_conflicts" ("pipeline_id"); + +CREATE SEQUENCE "seq_ppl_edge" START 1; +CREATE TABLE "ppl_edge" +( + "id" INTEGER, + "graph_id" INTEGER, + "node_from_id" INTEGER, + "node_to_id" INTEGER, + "data_unit_name" VARCHAR(2048), + PRIMARY KEY ("id") +); +CREATE INDEX "ix_PPL_EDGE_graph_id" ON "ppl_edge" ("graph_id"); +CREATE INDEX "ix_PPL_EDGE_node_from_id" ON "ppl_edge" ("node_from_id"); +CREATE INDEX "ix_PPL_EDGE_node_to_id" ON "ppl_edge" ("node_to_id"); + +CREATE SEQUENCE "seq_ppl_node" START 1; +CREATE TABLE "ppl_node" +( + "id" INTEGER, + "graph_id" INTEGER, + "instance_id" INTEGER, + "position_id" INTEGER, + PRIMARY KEY ("id") +); +CREATE INDEX "ix_PPL_NODE_graph_id" ON "ppl_node" ("graph_id"); +CREATE INDEX "ix_PPL_NODE_instance_id" ON "ppl_node" ("instance_id"); + +CREATE SEQUENCE "seq_ppl_graph" START 1; +CREATE TABLE "ppl_graph" +( + "id" INTEGER, + "pipeline_id" INTEGER, + PRIMARY KEY ("id"), + UNIQUE (pipeline_id) +); +CREATE INDEX "ix_PPL_GRAPH_pipeline_id" ON "ppl_graph" ("pipeline_id"); + +CREATE SEQUENCE "seq_ppl_position" START 1; +CREATE TABLE "ppl_position" +( + "id" INTEGER, + "pos_x" INTEGER, + "pos_y" INTEGER, + PRIMARY KEY ("id") +); + +CREATE SEQUENCE "seq_runtime_properties" START 1; +CREATE TABLE "runtime_properties" +( + "id" INTEGER NOT NULL, + "name" VARCHAR(100) NULL, + "value" VARCHAR(100) NULL, + PRIMARY KEY ("id"), + UNIQUE ("name") +); + +CREATE SEQUENCE "seq_sch_notification" START 1; +CREATE TABLE "sch_sch_notification" +( + "id" INTEGER, + "schedule_id" INTEGER NOT NULL, + "type_success" SMALLINT, + "type_error" SMALLINT, + "type_started" SMALLINT, + PRIMARY KEY ("id"), + UNIQUE ("schedule_id") +); + +CREATE TABLE "sch_usr_notification" +( + "id" INTEGER, + "user_id" INTEGER NOT NULL, + "type_success" SMALLINT, + "type_error" SMALLINT, + "type_started" SMALLINT, + "report_not_scheduled" BOOLEAN DEFAULT false, + PRIMARY KEY ("id"), + UNIQUE ("user_id") +); +CREATE INDEX "ix_SCH_USR_NOTIFICATION_user_id" ON "sch_usr_notification" ("user_id"); + +CREATE SEQUENCE "seq_sch_email" START 1; +CREATE TABLE "sch_email" +( + "id" INTEGER, + "email" VARCHAR(255), + PRIMARY KEY ("id") +); +CREATE INDEX "ix_SCH_EMAIL_email" ON "sch_email" ("email"); + +CREATE TABLE "sch_sch_notification_email" +( + "notification_id" INTEGER, + "email_id" INTEGER, + PRIMARY KEY ("notification_id", "email_id") +); + +CREATE TABLE "sch_usr_notification_email" +( + "notification_id" INTEGER, + "email_id" INTEGER, + PRIMARY KEY ("notification_id", "email_id") +); +CREATE INDEX "ix_SCH_USR_NOTIFICATION_EMAIL_email_id" ON "sch_usr_notification_email" ("email_id"); + +CREATE SEQUENCE "seq_usr_user" START 1; +CREATE TABLE "usr_user" +( + "id" INTEGER, + "username" VARCHAR(256) NOT NULL, + "email_id" INTEGER, + "u_password" CHAR(256) NOT NULL, + "full_name" VARCHAR(256) NOT NULL, + "table_rows" INTEGER, + PRIMARY KEY ("id"), + UNIQUE ("username") +); +CREATE INDEX "ix_USR_USER_email_id" ON "usr_user" ("email_id"); + +CREATE SEQUENCE "seq_permission" START WITH 1; +CREATE TABLE "permission" ( + "id" INTEGER, + "name" varchar(142) NOT NULL, + "sharedentityinstancewriterequired" boolean, + PRIMARY KEY ("id"), + UNIQUE ("name") +); +CREATE INDEX "ix_permission_name" ON "permission" ("name"); + +CREATE SEQUENCE "seq_role" START WITH 1; +CREATE TABLE "role" ( + "id" INTEGER, + "name" varchar(142) NOT NULL, + PRIMARY KEY ("id"), + UNIQUE ("name") +); +CREATE INDEX "ix_role_name" ON "role" ("name"); + +CREATE TABLE "user_role_permission" ( + "role_id" INTEGER NOT NULL, + "permission_id" INTEGER NOT NULL, + PRIMARY KEY ("role_id","permission_id") +); + +CREATE TABLE "usr_user_role" +( + "user_id" INTEGER NOT NULL, + "role_id" INTEGER NOT NULL, + PRIMARY KEY ("user_id", "role_id") +); + +CREATE TABLE "usr_extuser" ( + "id_usr" INTEGER NOT NULL, + "id_extuser" varchar(256) NOT NULL, + PRIMARY KEY ("id_usr","id_extuser") +); + +CREATE SEQUENCE "seq_user_actor" START 1; +CREATE TABLE "user_actor" +( + "id" INTEGER, + "id_extuser" VARCHAR(256) NOT NULL, + "name" VARCHAR(256) NOT NULL, + PRIMARY KEY ("id"), + UNIQUE ("id_extuser") +); + +CREATE SEQUENCE "seq_rdf_ns_prefix" START 1; +CREATE TABLE "rdf_ns_prefix" +( + "id" INTEGER, + "name" VARCHAR(255) NOT NULL, + "uri" VARCHAR(2048) NOT NULL, + PRIMARY KEY ("id"), + UNIQUE ("name") +); + +-- Table with timestamps when was the last time users opened pipelines in canvas +CREATE SEQUENCE "seq_ppl_open_event" START 1; +CREATE TABLE "ppl_open_event" +( + "id" INTEGER, + "pipeline_id" INTEGER NOT NULL, + "user_id" INTEGER NOT NULL, + "opened" TIMESTAMP NOT NULL, + PRIMARY KEY ("id") +); +CREATE INDEX "ix_PPL_OPEN_EVENT_pipeline_id" ON "ppl_open_event" ("pipeline_id"); +CREATE INDEX "ix_PPL_OPEN_EVENT_user_id" ON "ppl_open_event" ("user_id"); + +CREATE TABLE "properties" +( + "key" VARCHAR(200) NOT NULL, + "value" VARCHAR(200), + PRIMARY KEY ("key") +); + +-- CONSTRAINTS ################################################################# + + +-- Table "dpu_instance" +ALTER TABLE "dpu_instance" +ADD FOREIGN KEY ("dpu_id") + REFERENCES "dpu_template" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table "dpu_template" +ALTER TABLE "dpu_template" +ADD FOREIGN KEY ("parent_id") + REFERENCES "dpu_template" ("id") + ON UPDATE CASCADE ON DELETE SET NULL; + + +-- Table "exec_dataunit_info" +ALTER TABLE "exec_dataunit_info" +ADD FOREIGN KEY ("exec_context_dpu_id") + REFERENCES "exec_context_dpu" ("id") + ON UPDATE CASCADE ON DELETE SET NULL; + + +-- Table "exec_context_dpu" +ALTER TABLE "exec_context_dpu" +ADD FOREIGN KEY ("exec_context_pipeline_id") + REFERENCES "exec_context_pipeline" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE "exec_context_dpu" +ADD FOREIGN KEY ("dpu_instance_id") + REFERENCES "dpu_instance" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table "exec_record" +ALTER TABLE "exec_record" +ADD FOREIGN KEY ("dpu_id") + REFERENCES "dpu_instance" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE "exec_record" +ADD FOREIGN KEY ("execution_id") + REFERENCES "exec_pipeline" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table "exec_pipeline" +ALTER TABLE "exec_pipeline" +ADD FOREIGN KEY ("pipeline_id") + REFERENCES "ppl_model" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE "exec_pipeline" +ADD FOREIGN KEY ("context_id") + REFERENCES "exec_context_pipeline" ("id") + ON UPDATE CASCADE ON DELETE SET NULL; + +ALTER TABLE "exec_pipeline" +ADD FOREIGN KEY ("schedule_id") + REFERENCES "exec_schedule" ("id") + ON UPDATE CASCADE ON DELETE SET NULL; + +ALTER TABLE "exec_pipeline" +ADD FOREIGN KEY ("debugnode_id") + REFERENCES "ppl_node" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE "exec_pipeline" +ADD FOREIGN KEY ("owner_id") + REFERENCES "usr_user" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE "exec_pipeline" +ADD FOREIGN KEY ("user_actor_id") + REFERENCES "user_actor" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +-- Table "exec_schedule" +ALTER TABLE "exec_schedule" +ADD FOREIGN KEY ("pipeline_id") + REFERENCES "ppl_model" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE "exec_schedule" +ADD FOREIGN KEY ("user_id") + REFERENCES "usr_user" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE "exec_schedule" +ADD FOREIGN KEY ("user_actor_id") + REFERENCES "user_actor" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +-- Table "exec_schedule_after" +ALTER TABLE "exec_schedule_after" +ADD FOREIGN KEY ("schedule_id") + REFERENCES "exec_schedule" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE "exec_schedule_after" +ADD FOREIGN KEY ("pipeline_id") + REFERENCES "ppl_model" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table "ppl_model" +ALTER TABLE "ppl_model" +ADD FOREIGN KEY ("user_id") + REFERENCES "usr_user" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE "ppl_model" +ADD FOREIGN KEY ("user_actor_id") + REFERENCES "user_actor" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +-- Table "ppl_ppl_conflicts" +ALTER TABLE "ppl_ppl_conflicts" +ADD FOREIGN KEY ("pipeline_id") + REFERENCES "ppl_model" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE "ppl_ppl_conflicts" +ADD FOREIGN KEY ("pipeline_conflict_id") + REFERENCES "ppl_model" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table "ppl_graph" +ALTER TABLE "ppl_graph" +ADD FOREIGN KEY ("pipeline_id") + REFERENCES "ppl_model" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table "ppl_node" +ALTER TABLE "ppl_node" +ADD FOREIGN KEY ("graph_id") + REFERENCES "ppl_graph" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE "ppl_node" +ADD FOREIGN KEY ("instance_id") + REFERENCES "dpu_instance" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE "ppl_node" +ADD FOREIGN KEY ("position_id") + REFERENCES "ppl_position" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table "ppl_edge" +ALTER TABLE "ppl_edge" +ADD FOREIGN KEY ("graph_id") + REFERENCES "ppl_graph" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE "ppl_edge" +ADD FOREIGN KEY ("node_from_id") + REFERENCES "ppl_node" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE "ppl_edge" +ADD FOREIGN KEY ("node_to_id") + REFERENCES "ppl_node" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table "sch_sch_notification" +ALTER TABLE "sch_sch_notification" +ADD FOREIGN KEY ("schedule_id") + REFERENCES "exec_schedule" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table "sch_sch_notification_email" +ALTER TABLE "sch_sch_notification_email" +ADD FOREIGN KEY ("notification_id") + REFERENCES "sch_sch_notification" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE "sch_sch_notification_email" +ADD FOREIGN KEY ("email_id") + REFERENCES "sch_email" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table "sch_usr_notification" +ALTER TABLE "sch_usr_notification" +ADD FOREIGN KEY ("user_id") + REFERENCES "usr_user" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table "sch_usr_notification_email" +ALTER TABLE "sch_usr_notification_email" +ADD FOREIGN KEY ("notification_id") + REFERENCES "sch_usr_notification" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE "sch_usr_notification_email" +ADD FOREIGN KEY ("email_id") + REFERENCES "sch_email" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + + +-- Table "usr_user" +ALTER TABLE "usr_user" +ADD FOREIGN KEY ("email_id") + REFERENCES "sch_email" ("id") + ON UPDATE CASCADE ON DELETE SET NULL; + + +-- Table "usr_user_role" +ALTER TABLE "usr_user_role" +ADD FOREIGN KEY ("user_id") + REFERENCES "usr_user" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE "usr_user_role" +ADD FOREIGN KEY ("role_id") + REFERENCES "role" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + + ALTER TABLE "user_role_permission" + ADD FOREIGN KEY ("permission_id") + REFERENCES "permission" ("id") + ON DELETE CASCADE ON UPDATE CASCADE; + + ALTER TABLE "user_role_permission" + ADD FOREIGN KEY ("role_id") + REFERENCES "role" ("id") + ON DELETE CASCADE ON UPDATE CASCADE; + + ALTER TABLE "usr_extuser" + ADD FOREIGN KEY ("id_usr") + REFERENCES "usr_user" ("id") + ON DELETE CASCADE ON UPDATE CASCADE; + +-- Table "ppl_open_event" +ALTER TABLE "ppl_open_event" +ADD FOREIGN KEY ("user_id") + REFERENCES "usr_user" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE "ppl_open_event" +ADD FOREIGN KEY ("pipeline_id") + REFERENCES "ppl_model" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + + +DROP TABLE IF EXISTS "logging"; +CREATE TABLE "logging" +( + "id" BIGSERIAL, + "log_level" INTEGER NOT NULL, + "timestmp" BIGINT NOT NULL, + "logger" VARCHAR(254) NOT NULL, + "message" TEXT, + "dpu" INTEGER, + "execution" INTEGER NOT NULL, + "stack_trace" TEXT, + "relative_id" INTEGER, + PRIMARY KEY (id) +); + +CREATE INDEX "ix_LOGGING_dpu" ON "logging" ("dpu"); +CREATE INDEX "ix_LOGGIN_execution" ON "logging" ("execution"); +CREATE INDEX "ix_LOGGIN_relative_id" ON "logging" ("relative_id"); + +-- Views. +CREATE VIEW "exec_last_view" AS +SELECT id, pipeline_id, t_end, t_start, status +FROM "exec_pipeline" AS exec +WHERE t_end = (SELECT max(t_end) FROM "exec_pipeline" AS lastExec WHERE exec.pipeline_id = lastExec.pipeline_id); + +CREATE VIEW "pipeline_view" AS +SELECT ppl.id AS id, ppl.name AS name, exec.t_start AS t_start, exec.t_end AS t_end, exec.status AS status, usr.username as usr_name, usr.full_name as usr_full_name, +ppl.visibility AS visibility, actor.name AS user_actor_name FROM "ppl_model" AS ppl +LEFT JOIN "exec_last_view" AS exec ON exec.pipeline_id = ppl.id +LEFT JOIN "usr_user" AS usr ON ppl.user_id = usr.id +LEFT JOIN "user_actor" AS actor ON ppl.user_actor_id = actor.id; + +CREATE VIEW "exec_view" AS +SELECT exec.id AS id, exec.status AS status, ppl.id AS pipeline_id, ppl.name AS pipeline_name, exec.debug_mode AS debug_mode, exec.t_start AS t_start, +exec.t_end AS t_end, exec.schedule_id AS schedule_id, owner.username AS owner_name, owner.full_name AS owner_full_name, exec.stop AS stop, exec.t_last_change AS t_last_change, +actor.name AS user_actor_name FROM "exec_pipeline" AS exec +LEFT JOIN "ppl_model" AS ppl ON ppl.id = exec.pipeline_id +LEFT JOIN "usr_user" AS owner ON owner.id = exec.owner_id +LEFT JOIN "user_actor" AS actor ON actor.id = exec.user_actor_id; diff --git a/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/updates/1.6.0-update.sql b/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/updates/1.6.0-update.sql new file mode 100644 index 0000000000..c3bda1e9c5 --- /dev/null +++ b/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/updates/1.6.0-update.sql @@ -0,0 +1,5 @@ +-- Update version. +UPDATE "properties" SET "value" = '001.006.000' WHERE "key" = 'UV.Core.version'; +UPDATE "properties" SET "value" = '001.003.000' WHERE "key" = 'UV.Plugin-DevEnv.version'; + +ALTER TABLE ppl_model ADD CONSTRAINT ppl_model_name_constraint UNIQUE(name); diff --git a/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/updates/2.0.0-update.sql b/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/updates/2.0.0-update.sql new file mode 100644 index 0000000000..de40cd1035 --- /dev/null +++ b/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/updates/2.0.0-update.sql @@ -0,0 +1,302 @@ + +DROP VIEW exec_view; + +DROP VIEW pipeline_view; + +CREATE SEQUENCE seq_organization + START WITH 1 + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + +CREATE SEQUENCE seq_permission + START WITH 1 + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + +CREATE SEQUENCE seq_role + START WITH 1 + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + +CREATE TABLE organization ( + id integer NOT NULL, + name character varying(256) NOT NULL +); + +CREATE TABLE permission ( + id integer NOT NULL, + name character varying(142) NOT NULL, + rwonly boolean +); + +CREATE TABLE "role" ( + id integer NOT NULL, + name character varying(142) NOT NULL +); + +CREATE TABLE user_role_permission ( + role_id integer NOT NULL, + permission_id integer NOT NULL +); + +CREATE TABLE usr_extuser ( + id_usr integer NOT NULL, + id_extuser character varying(256) NOT NULL +); + +ALTER TABLE exec_pipeline + ADD COLUMN organization_id integer; + +ALTER TABLE exec_schedule + ADD COLUMN organization_id integer; + +ALTER TABLE ppl_model + ADD COLUMN organization_id integer; + +ALTER TABLE usr_user + ALTER COLUMN username TYPE character varying(256) /* TYPE change - table: usr_user original: character varying(25) new: character varying(256) */, + ALTER COLUMN u_password TYPE character(256) /* TYPE change - table: usr_user original: character(142) new: character(256) */, + ALTER COLUMN full_name TYPE character varying(256) /* TYPE change - table: usr_user original: character varying(55) new: character varying(256) */; + +ALTER TABLE organization + ADD CONSTRAINT organization_pkey PRIMARY KEY (id); + +ALTER TABLE permission + ADD CONSTRAINT permission_pkey PRIMARY KEY (id); + +ALTER TABLE "role" + ADD CONSTRAINT role_pkey PRIMARY KEY (id); + +ALTER TABLE user_role_permission + ADD CONSTRAINT user_role_permission_pkey PRIMARY KEY (role_id, permission_id); + +ALTER TABLE usr_extuser + ADD CONSTRAINT usr_extuser_pkey PRIMARY KEY (id_usr, id_extuser); + +ALTER TABLE exec_pipeline + ADD CONSTRAINT exec_pipeline_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organization(id) ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE exec_schedule + ADD CONSTRAINT exec_schedule_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organization(id) ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE organization + ADD CONSTRAINT organization_name_key UNIQUE (name); + +ALTER TABLE ppl_model + ADD CONSTRAINT ppl_model_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organization(id) ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE permission + ADD CONSTRAINT permission_name_key UNIQUE (name); + +ALTER TABLE "role" + ADD CONSTRAINT role_name_key UNIQUE (name); + +ALTER TABLE user_role_permission + ADD CONSTRAINT user_role_permission_permission_id_fkey FOREIGN KEY (permission_id) REFERENCES permission(id) ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE user_role_permission + ADD CONSTRAINT user_role_permission_role_id_fkey FOREIGN KEY (role_id) REFERENCES role(id) ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE usr_extuser + ADD CONSTRAINT usr_extuser_id_usr_fkey FOREIGN KEY (id_usr) REFERENCES usr_user(id) ON UPDATE CASCADE ON DELETE CASCADE; + + +INSERT INTO "role" VALUES (nextval('seq_role'), 'Administrator'),(nextval('seq_role'),'User'); + +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'administrator', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.delete', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.save', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.edit', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.export', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.exportScheduleRules', false); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.import', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.importScheduleRules', false); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.importUserData', false); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.schedule', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.read', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.runDebug', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.exportDpuData', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.exportDpuJars', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.setVisibilityAtCreate', false); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipelineExecution.delete', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipelineExecution.stop', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.run', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipelineExecution.downloadAllLogs', false); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipelineExecution.read', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipelineExecution.readDpuInputOutputData', false); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipelineExecution.readEvent', false); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipelineExecution.readLog', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipelineExecution.sparqlDpuInputOutputData', false); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'scheduleRule.create', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'scheduleRule.delete', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'scheduleRule.edit', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'scheduleRule.disable', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'scheduleRule.enable', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'scheduleRule.read', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'scheduleRule.execute', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'scheduleRule.setPriority', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.create', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.save', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.setVisibilityAtCreate', false); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.delete', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.edit', true); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.export', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.copy', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.import', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.read', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'user.management', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'user.create', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'user.edit', false); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'user.login', false); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'user.read', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'user.delete', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'role.create', false); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'role.edit', true); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'role.read', false); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'role.delete', true); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.create', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.copy', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'deleteDebugResources', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'runtimeProperties.edit', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'userNotificationSettings.editEmailGlobal', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'userNotificationSettings.editNotificationFrequency', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'userNotificationSettings.createPipelineExecutionSettings', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); + +INSERT INTO "usr_extuser" VALUES ((select id from "usr_user" where username='admin'), 'admin'); +INSERT INTO "usr_extuser" VALUES ((select id from "usr_user" where username='user'), 'user'); + +update "usr_user_role" set role_id=2 where role_id=1; +update "usr_user_role" set role_id=1 where role_id=0; + +ALTER TABLE usr_user_role + ADD CONSTRAINT usr_user_role_role_id_fkey FOREIGN KEY (role_id) REFERENCES role(id) ON UPDATE CASCADE ON DELETE CASCADE; + +CREATE INDEX "ix_EXEC_PIPELINE_organization_id" ON exec_pipeline USING btree (organization_id); + +CREATE INDEX "ix_EXEC_SCHEDULE_organization_id" ON exec_schedule USING btree (organization_id); + +CREATE INDEX ix_organization_name ON organization USING btree (name); + +CREATE INDEX "ix_PPL_MODEL_organization_id" ON ppl_model USING btree (organization_id); + +CREATE INDEX ix_permission_name ON permission USING btree (name); + +CREATE INDEX ix_role_name ON "role" USING btree (name); + +CREATE VIEW exec_view AS + SELECT exec.id, + exec.status, + ppl.id AS pipeline_id, + ppl.name AS pipeline_name, + exec.debug_mode, + exec.t_start, + exec.t_end, + exec.schedule_id, + owner.username AS owner_name, + exec.stop, + exec.t_last_change, + org.name AS org_name + FROM (((exec_pipeline exec + LEFT JOIN ppl_model ppl ON ((ppl.id = exec.pipeline_id))) + LEFT JOIN usr_user owner ON ((owner.id = exec.owner_id))) + LEFT JOIN organization org ON ((exec.organization_id = org.id))); + +CREATE VIEW pipeline_view AS + SELECT ppl.id, + ppl.name, + exec.t_start, + exec.t_end, + exec.status, + usr.username AS usr_name, + org.name AS org_name, + ppl.visibility + FROM (((ppl_model ppl + LEFT JOIN exec_last_view exec ON ((exec.pipeline_id = ppl.id))) + LEFT JOIN usr_user usr ON ((ppl.user_id = usr.id))) + LEFT JOIN organization org ON ((ppl.organization_id = org.id))); + +-- Update version. +UPDATE "properties" SET "value" = '002.000.000' WHERE "key" = 'UV.Core.version'; +UPDATE "properties" SET "value" = '002.000.000' WHERE "key" = 'UV.Plugin-DevEnv.version'; diff --git a/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/updates/2.1.0-core.sql b/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/updates/2.1.0-core.sql new file mode 100644 index 0000000000..c7999df2fd --- /dev/null +++ b/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/updates/2.1.0-core.sql @@ -0,0 +1,82 @@ +-- Update permission table +ALTER TABLE permission RENAME COLUMN rwonly TO sharedEntityInstanceWriteRequired; +-- Update version. +UPDATE "properties" SET "value" = '002.001.000' WHERE "key" = 'UV.Core.version'; +UPDATE "properties" SET "value" = '002.001.000' WHERE "key" = 'UV.Plugin-DevEnv.version'; + +-- Add new columns +ALTER TABLE "dpu_instance" +ADD COLUMN "menu_name" VARCHAR(255); +ALTER TABLE "dpu_template" +ADD COLUMN "menu_name" VARCHAR(255); + +-- Email notifications +ALTER TABLE "sch_sch_notification" +ADD COLUMN "type_started" SMALLINT DEFAULT 2; + +ALTER TABLE "sch_usr_notification" +ADD COLUMN "type_started" SMALLINT DEFAULT 2; + +ALTER TABLE "sch_usr_notification" +ADD COLUMN "report_not_scheduled" boolean DEFAULT false; + +-- full name for user is now mandatory parameter - copy username if missing +UPDATE usr_user SET full_name = username WHERE full_name IS NULL; +ALTER TABLE usr_user ALTER COLUMN full_name SET NOT NULL; + +-- Organizations removed +DROP VIEW pipeline_view; +DROP VIEW exec_view; + +CREATE SEQUENCE "seq_user_actor" START 1; +CREATE TABLE "user_actor" +( + "id" INTEGER, + "id_extuser" VARCHAR(256) NOT NULL, + "name" VARCHAR(256) NOT NULL, + PRIMARY KEY ("id"), + UNIQUE ("id_extuser") +); + +ALTER TABLE exec_pipeline DROP COLUMN organization_id; +ALTER TABLE exec_pipeline ADD COLUMN user_actor_id INTEGER; +CREATE INDEX "ix_EXEC_PIPELINE_actor_id" ON "exec_pipeline" ("user_actor_id"); +ALTER TABLE exec_schedule DROP COLUMN organization_id; +ALTER TABLE exec_schedule ADD COLUMN user_actor_id INTEGER; +CREATE INDEX "ix_EXEC_SCHEDULE_user_actor_id" ON "exec_schedule" ("user_actor_id"); +ALTER TABLE ppl_model DROP COLUMN organization_id; +ALTER TABLE ppl_model ADD COLUMN user_actor_id INTEGER; +CREATE INDEX "ix_PPL_MODEL_user_actor_id" ON "ppl_model" ("user_actor_id"); +DROP TABLE organization; + +-- Constraints +ALTER TABLE "exec_pipeline" +ADD FOREIGN KEY ("user_actor_id") + REFERENCES "user_actor" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE "exec_schedule" +ADD FOREIGN KEY ("user_actor_id") + REFERENCES "user_actor" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE "ppl_model" +ADD FOREIGN KEY ("user_actor_id") + REFERENCES "user_actor" ("id") + ON UPDATE CASCADE ON DELETE CASCADE; + +-- Recreate views +CREATE VIEW "pipeline_view" AS +SELECT ppl.id AS id, ppl.name AS name, exec.t_start AS t_start, exec.t_end AS t_end, exec.status AS status, usr.username as usr_name, usr.full_name as usr_full_name, +ppl.visibility AS visibility, actor.name AS user_actor_name FROM "ppl_model" AS ppl +LEFT JOIN "exec_last_view" AS exec ON exec.pipeline_id = ppl.id +LEFT JOIN "usr_user" AS usr ON ppl.user_id = usr.id +LEFT JOIN "user_actor" AS actor ON ppl.user_actor_id = actor.id; + +CREATE VIEW "exec_view" AS +SELECT exec.id AS id, exec.status AS status, ppl.id AS pipeline_id, ppl.name AS pipeline_name, exec.debug_mode AS debug_mode, exec.t_start AS t_start, +exec.t_end AS t_end, exec.schedule_id AS schedule_id, owner.username AS owner_name, owner.full_name AS owner_full_name, exec.stop AS stop, exec.t_last_change AS t_last_change, +actor.name AS user_actor_name FROM "exec_pipeline" AS exec +LEFT JOIN "ppl_model" AS ppl ON ppl.id = exec.pipeline_id +LEFT JOIN "usr_user" AS owner ON owner.id = exec.owner_id +LEFT JOIN "user_actor" AS actor ON actor.id = exec.user_actor_id; \ No newline at end of file diff --git a/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/updates/2.1.0-permissions.sql b/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/updates/2.1.0-permissions.sql new file mode 100644 index 0000000000..6c82a8c67a --- /dev/null +++ b/debian/unifiedviews-backend-pgsql/src/deb/usr/share/unifiedviews/pgsql/updates/2.1.0-permissions.sql @@ -0,0 +1,128 @@ +-- ################################################################################## +-- ## UV permissions initialization script specific for eDemo installation # +-- ## REQUIRES database initialized by data.sql script !!! # +-- ################################################################################## + +-- clear permissions tables +DELETE FROM permission; +ALTER SEQUENCE "seq_permission" RESTART WITH 1; + +-- Insert permissions +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'administrator', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.delete', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.edit', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.definePipelineDependencies', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.export', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.exportScheduleRules', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.import', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.importScheduleRules', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.importUserData', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.schedule', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.read', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.runDebug', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.exportDpuData', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.exportDpuJars', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.setVisibility', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.setVisibilityPublicRw', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipelineExecution.delete', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipelineExecution.stop', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.run', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipelineExecution.read', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'scheduleRule.create', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'scheduleRule.delete', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'scheduleRule.edit', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'scheduleRule.read', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'scheduleRule.setPriority', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.create', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.createFromInstance', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.setVisibility', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.delete', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.edit', true); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.export', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.copy', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.read', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'dpuTemplate.showScreen', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'user.management', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.create', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'pipeline.copy', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'runtimeProperties.edit', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'userNotificationSettings.editEmailGlobal', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'userNotificationSettings.editNotificationFrequency', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); +INSERT INTO "permission" VALUES (nextval('seq_permission'), 'userNotificationSettings.createPipelineExecutionSettings', false); +INSERT INTO "user_role_permission" values((select id from "role" where name='Administrator'), currval('seq_permission')); +INSERT INTO "user_role_permission" values((select id from "role" where name='User'), currval('seq_permission')); diff --git a/debian/unifiedviews-backend-shared/pom.xml b/debian/unifiedviews-backend-shared/pom.xml new file mode 100644 index 0000000000..d311f4ca61 --- /dev/null +++ b/debian/unifiedviews-backend-shared/pom.xml @@ -0,0 +1,138 @@ + + + 4.0.0 + + + eu.unifiedviews.packages + unifiedviews-packages + 2.2.0-SNAPSHOT + + + eu.unifiedviews.packages + unifiedviews-backend-shared + + unifiedviews-backend-shared + + + + + eu.unifiedviews + backend + 2.1.2 + + + + + + maven.eea.sk + maven.eea.sk-public + http://maven.eea.sk/artifactory/public/ + + + + + unifiedviews-backend + + + org.apache.maven.plugins + maven-dependency-plugin + 2.3 + + + copy-dependencies + package + + copy-dependencies + + + ${project.build.directory}/lib + + runtime + + false + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.3.1 + + + + true + cz.cuni.mff.xrg.odcs.backend.AppEntry + lib/ + + + + + + jdeb + org.vafer + 1.4 + + + package + + jdeb + + + ${debian-package-name} + + + + ${project.build.directory}/${project.build.finalName}.jar + file + + perm + /usr/share/unifiedviews/backend + + + + + ${project.build.directory}/lib + directory + + perm + /usr/share/unifiedviews/backend/lib + + + + + template + + /var/log/unifiedviews/backend + /var/cache/unifiedviews/backend/working + + + perm + + + + + ${basedir}/src/deb/etc/unifiedviews + directory + + perm + /etc/unifiedviews + + + + + ${basedir}/src/deb/var/lib/unifiedviews/common + directory + + perm + /var/lib/unifiedviews/common + + + + + + + + + + diff --git a/debian/unifiedviews-backend-shared/src/deb/control/control b/debian/unifiedviews-backend-shared/src/deb/control/control new file mode 100644 index 0000000000..692c143b03 --- /dev/null +++ b/debian/unifiedviews-backend-shared/src/deb/control/control @@ -0,0 +1,9 @@ +Package: unifiedviews-backend-shared +Version: [[debian-package-version]] +Section: java +Priority: extra +Architecture: all +Maintainer: jmc@eea.sk +Depends: openjdk-7-jre-headless, tomcat7, debconf (>= 0.5) +Conflicts: unifiedviews-backend-shared (<< 2.0.0) +Description: The unifiedviews's backend binaries. diff --git a/debian/unifiedviews-backend-shared/src/deb/control/postinst b/debian/unifiedviews-backend-shared/src/deb/control/postinst new file mode 100644 index 0000000000..6a83e98254 --- /dev/null +++ b/debian/unifiedviews-backend-shared/src/deb/control/postinst @@ -0,0 +1,77 @@ +#!/bin/sh +# postinst script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +set_java() { + JAVA_VERSION=`java -version 2>&1 | grep "java version" | awk '{print $3}' | tr -d \" | awk '{split($0, array, ".")} END{print array[2]}'` + echo -n "check java version" + if [ ! $JAVA_VERSION -eq 7 ]; then + JAVA_NAME=`update-java-alternatives -l | grep 7 | cut -d' ' -f1` + if [ -n $JAVA_NAME ] ; then + /usr/sbin/update-java-alternatives --jre-headless --set $JAVA_NAME + echo " - Java version is set to 1.7" + else + echo " ERROR: java 7 is not installed" + fi + else + echo " - ok" + fi +} +create_credentials() { + echo ">>> create_credentials" + if ! id unifiedviews > /dev/null 2>&1 ; then + adduser --group --system --disabled-password --home /usr/share/unifiedviews unifiedviews + else + echo "user: unifiedviews exists" + fi + echo "<<< create_credentials" +} + +fix_perms() { + chown -R unifiedviews:unifiedviews /etc/unifiedviews + chown -R unifiedviews:unifiedviews /usr/share/unifiedviews + chown -R unifiedviews:unifiedviews /var/log/unifiedviews + chown -R unifiedviews:unifiedviews /var/cache/unifiedviews + chown -R unifiedviews:unifiedviews /var/lib/unifiedviews +} + +case "$1" in + configure) + set_java + create_credentials + fix_perms + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + + ;; +esac + + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/unifiedviews-backend-shared/src/deb/control/postrm b/debian/unifiedviews-backend-shared/src/deb/control/postrm new file mode 100644 index 0000000000..9a55337257 --- /dev/null +++ b/debian/unifiedviews-backend-shared/src/deb/control/postrm @@ -0,0 +1,50 @@ +#!/bin/sh +# postrm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + + remove|abort-install|disappear) + # remove directories + rm -rf /usr/share/unifiedviews + rm -rf /var/lib/unifiedviews + rm -rf /var/log/unifiedviews + # delete user + deluser unifiedviews || true + ;; + + purge) + + ;; + upgrade|failed-upgrade|abort-upgrade) + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/unifiedviews-backend-shared/src/deb/control/prerm b/debian/unifiedviews-backend-shared/src/deb/control/prerm new file mode 100644 index 0000000000..040a82e256 --- /dev/null +++ b/debian/unifiedviews-backend-shared/src/deb/control/prerm @@ -0,0 +1,46 @@ +#!/bin/sh +# prerm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + if [ -x "/etc/init.d/unifiedviews-backend" ]; then + invoke-rc.d unifiedviews-backend stop || true + fi + + + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + + +#DEBHELPER# + +exit 0 + + diff --git a/debian/unifiedviews-backend-shared/src/deb/etc/unifiedviews/backend-config.sample.properties b/debian/unifiedviews-backend-shared/src/deb/etc/unifiedviews/backend-config.sample.properties new file mode 100644 index 0000000000..51d657a17b --- /dev/null +++ b/debian/unifiedviews-backend-shared/src/deb/etc/unifiedviews/backend-config.sample.properties @@ -0,0 +1,77 @@ +# This is the central configuration for BACKEND of ODCS application. +# +# The key and element characters #, !, =, and : should be properly escaped +# with a preceding backslash to ensure that they are properly loaded. + +# !!! The frontend is configured separately from file +# frontend/src/main/webapp/WEB-INF/config.properties +# use frontend/src/main/webapp/WEB-INF/config.sample.properties as a +# configuration file template. + +# directory where backend log should be stored (should not end with / or \ ) +backend.log.directory = {path to directory where backend log should be saved} +# how long should backend keep log history +backend.log.keepDays = 7 + +# General settings (should end with "backend/working") +general.workingdir = {full path to "odcs" (home) dir of the project}/backend/working + +# Backend application configuration +backend.host = 127.0.0.1 +backend.port = 5010 + +# Connection configuration setting for relational database +# for postgresql { +database.sql.driver = org.postgresql.Driver +database.sql.url = jdbc:postgresql://localhost:5432/unifiedviews +database.sql.user = unifiedviews +database.sql.password = unifiedviews +# } + +# for mysql { +#database.sql.driver = com.mysql.jdbc.Driver +#database.sql.url = jdbc:mysql://localhost:3306/unifiedviews?characterEncoding=utf8 +#database.sql.user = unifiedviews +#database.sql.password = unifiedviews +# } + + +# Connection configuration setting for RDF database +# use local rdf platform { +database.rdf.platform = localRDF +# } + +# or use remote rdf platform (sesame) { +#database.rdf.platform = remoteRDF +#database.rdf.url = http://ip6-localhost:8080/openrdf-sesame +#database.rdf.user = +#database.rdf.password = +# } + +# or user virtuoso platform { +#database.rdf.platform = virtuoso +#database.rdf.url = jdbc:virtuoso://localhost:1111/charset=UTF-8/log_enable=2 +#database.rdf.user = dba +#database.rdf.password = dba +# } + +# Administrator contact email for sending reports and failure notifications +email.enabled = false +email.admin = admin@example.com +# use if email.enabled = true +#email.smtp.host = smtp.server.cz +#email.smtp.port = 25 +#email.smtp.ttl = false +#email.from = odcs@xrg.mff.cuni.cz +#email.authorization = false +# use if email.authorization = true +#email.username = +#email.password = + +# Configuration of DPU modules +module.path = {full path to "odcs" (home) dir of the project}/common + +# Language configuration (e.g.: en_US, sk) +locale = sk +#type of ownership user|organization +ownership.type=user diff --git a/debian/unifiedviews-backend-shared/src/deb/etc/unifiedviews/unifiedviews.sample.conf b/debian/unifiedviews-backend-shared/src/deb/etc/unifiedviews/unifiedviews.sample.conf new file mode 100644 index 0000000000..3195196dc1 --- /dev/null +++ b/debian/unifiedviews-backend-shared/src/deb/etc/unifiedviews/unifiedviews.sample.conf @@ -0,0 +1,34 @@ +# System-wide configuration file for unifiedviews services +# This will be sourced by unifiedviews and any secondary service +# Values will be overridden by service-specific configuration +# files in /etc/sysconfig +# +# Use this one to change default values for all services +# Change the service specific ones to affect only one service +# (see, for instance, /etc/sysconfig/unifiedviews) +# +# where backend is located +UNIFIEDVIEWS_BACKEND="/usr/share/unifiedviews/unifiedviews-backend-2.0.0.jar" +# where backend's configuration is located +UNIFIEDVIEWS_BACKEND_CFG="/etc/unifiedviews/backend-config.properties" +# What user should run backend +UNIFIEDVIEWS_USER="unifiedviews" +# Where your java installation lives +#JAVA_HOME="/usr/lib/jvm/java-1.5.0" +# You can pass some parameters to java here if you wish to +#JAVA_OPTS="-Xminf0.1 -Xmaxf0.3" +# Use JAVA_OPTS to set java.library.path for libtcnative.so +#JAVA_OPTS="-Djava.library.path=/usr/lib" +# Cannot resolve user database reference - naming-factory-dbcp +# the real problem is a cnfe that is avoided by configuring +# the -Djavax.sql.DataSource.Factory. This fixes the rpm install. +JAVA_OPTS="${JAVA_OPTS} -DconfigFileLocation=${UNIFIEDVIEWS_BACKEND_CFG}" +UNIFIEDVIEWS_GROUP="${UNIFIEDVIEWS_GROUP:-`id -gn $UNIFIEDVIEWS_USER`}" +# You can change your tomcat locale here +#LANG="en_US" +# Time to wait in seconds, before killing process +SHUTDOWN_WAIT="30" +# Whether to annoy the user with "attempting to shut down" messages or not +SHUTDOWN_VERBOSE=true +# Set the UNIFIEDVIEWS_PID location +UNIFIEDVIEWS_PID="/var/run/unifiedviews-backend.pid" diff --git a/debian/unifiedviews-backend/pom.xml b/debian/unifiedviews-backend/pom.xml new file mode 100644 index 0000000000..760cb134cb --- /dev/null +++ b/debian/unifiedviews-backend/pom.xml @@ -0,0 +1,80 @@ + + + 4.0.0 + + + eu.unifiedviews.packages + unifiedviews-packages + 2.2.0-SNAPSHOT + + + eu.unifiedviews.packages + unifiedviews-backend + unifiedviews-backend + + + + + + + maven-jar-plugin + 2.5 + + + default-jar + never + + unwanted + unwanted + + + + + + jdeb + org.vafer + 1.4 + + + package + + jdeb + + + ${debian-package-name} + + + + ${basedir}/src/deb/etc/init.d/unifiedviews-backend + file + + perm + /etc/init.d + + + + + ${basedir}/src/deb/usr/sbin/run_unifiedviews_backend + file + + perm + /usr/sbin + + + + + ${basedir}/src/deb/etc/unifiedviews/unifiedviews.conf + file + + perm + /etc/unifiedviews + + + + + + + + + + diff --git a/debian/unifiedviews-backend/src/deb/control/conffiles b/debian/unifiedviews-backend/src/deb/control/conffiles new file mode 100644 index 0000000000..d357413d8c --- /dev/null +++ b/debian/unifiedviews-backend/src/deb/control/conffiles @@ -0,0 +1 @@ +/etc/unifiedviews/unifiedviews.conf \ No newline at end of file diff --git a/debian/unifiedviews-backend/src/deb/control/control b/debian/unifiedviews-backend/src/deb/control/control new file mode 100644 index 0000000000..8cf7c3e45a --- /dev/null +++ b/debian/unifiedviews-backend/src/deb/control/control @@ -0,0 +1,8 @@ +Package: unifiedviews-backend +Version: [[debian-package-version]] +Section: java +Priority: extra +Architecture: all +Maintainer: jmc@eea.sk +Depends: unifiedviews-backend-mysql (>> 2.1) | unifiedviews-backend-pgsql (>> 2.1) +Description: The tool uses data processing pipelines for obtaining, processing, and storing RDF data. diff --git a/debian/unifiedviews-backend/src/deb/control/postinst b/debian/unifiedviews-backend/src/deb/control/postinst new file mode 100644 index 0000000000..c3cd28aa54 --- /dev/null +++ b/debian/unifiedviews-backend/src/deb/control/postinst @@ -0,0 +1,57 @@ +#!/bin/sh +# postinst script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +service_backend_restart() { + update-rc.d unifiedviews-backend defaults + + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then + invoke-rc.d unifiedviews-backend restart || true + else + service unifiedviews-backend restart || true + fi +} + +fix_perms() { + chmod +x /etc/init.d/unifiedviews-backend || true + chown unifiedviews:unifiedviews /usr/sbin/run_unifiedviews_backend + chmod +x /usr/sbin/run_unifiedviews_backend || true + chown unifiedviews:unifiedviews /etc/unifiedviews/unifiedviews.conf +} + +case "$1" in + configure) + fix_perms + service_backend_restart + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 \ No newline at end of file diff --git a/debian/unifiedviews-backend/src/deb/control/postrm b/debian/unifiedviews-backend/src/deb/control/postrm new file mode 100644 index 0000000000..ce2aec71ba --- /dev/null +++ b/debian/unifiedviews-backend/src/deb/control/postrm @@ -0,0 +1,50 @@ +#!/bin/sh +# postrm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + + remove|abort-install|disappear) + + update-rc.d unifiedviews-backend remove + + + ;; + + purge) + + + ;; + + upgrade|failed-upgrade|abort-upgrade) + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/unifiedviews-backend/src/deb/control/prerm b/debian/unifiedviews-backend/src/deb/control/prerm new file mode 100644 index 0000000000..040a82e256 --- /dev/null +++ b/debian/unifiedviews-backend/src/deb/control/prerm @@ -0,0 +1,46 @@ +#!/bin/sh +# prerm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + if [ -x "/etc/init.d/unifiedviews-backend" ]; then + invoke-rc.d unifiedviews-backend stop || true + fi + + + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + + +#DEBHELPER# + +exit 0 + + diff --git a/debian/unifiedviews-backend/src/deb/etc/init.d/unifiedviews-backend b/debian/unifiedviews-backend/src/deb/etc/init.d/unifiedviews-backend new file mode 100644 index 0000000000..751725c65f --- /dev/null +++ b/debian/unifiedviews-backend/src/deb/etc/init.d/unifiedviews-backend @@ -0,0 +1,310 @@ +#!/bin/bash +# +# unifiedviews backend +# This file was inspirated by tomcat6 init script +# +### BEGIN INIT INFO +# Provides: unifiedviews-backend +# Required-Start: $local_fs $remote_fs $network +# Required-Stop: $local_fs $remote_fs $network +# Should-Start: $named +# Should-Stop: $named +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start unifiedviews-backend at boot time +# Description: Enable unifiedviews-backend provided by daemon. +### END INIT INFO + + +## Source function library. +#. /etc/rc.d/init.d/functions +# Source LSB function library. +if [ -r /lib/lsb/init-functions ]; then + . /lib/lsb/init-functions +else + exit 1 +fi + +DISTRIB_ID=`lsb_release -i -s 2>/dev/null` + +NAME="$(basename $0)" +unset ISBOOT +if [ "${NAME:0:1}" = "S" -o "${NAME:0:1}" = "K" ]; then + NAME="${NAME:3}" + ISBOOT="1" +fi + +# For SELinux we need to use 'runuser' not 'su' +if [ -x "/sbin/runuser" ]; then + SU="/sbin/runuser -s /bin/sh" +else + SU="/bin/su -s /bin/sh" +fi + +# Get the unifiedviews config (use this for environment specific settings) +UNIFIEDVIEWS_CFG="/etc/unifiedviews/unifiedviews.conf" +if [ -r "$UNIFIEDVIEWS_CFG" ]; then + . $UNIFIEDVIEWS_CFG +fi + + +# Get instance specific config file +if [ -r "/etc/sysconfig/${NAME}" ]; then + . /etc/sysconfig/${NAME} +fi + +# Define which connector port to use +CONNECTOR_PORT="${CONNECTOR_PORT:-8080}" + +# Path to the unifiedviews launch script +UNIFIEDVIEWS_SCRIPT="/usr/sbin/run_unifiedviews_backend" + +# unifiedviews program name +UNIFIEDVIEWS_PROG="${NAME}" + +# Define the unifiedviews username +UNIFIEDVIEWS_USER="${UNIFIEDVIEWS_USER:-unifiedviews}" + +# Define the unifiedviews group +UNIFIEDVIEWS_GROUP="${UNIFIEDVIEWS_GROUP:-`id -gn $UNIFIEDVIEWS_USER`}" + +# Define the unifiedviews log file +UNIFIEDVIEWS_LOG="${UNIFIEDVIEWS_LOG:-/var/log/unifiedviews/backend/${NAME}-initd.log}" + +# Define the pid file name +# If change is needed, use sysconfig instead of here +export UNIFIEDVIEWS_PID="${UNIFIEDVIEWS_PID:-/var/run/${NAME}.pid}" + +find_jdks() +{ + for java_version in 9 8 7 + do + for jvmdir in /usr/lib/jvm/java-${java_version}-openjdk-* \ + /usr/lib/jvm/jdk-${java_version}-oracle-* \ + /usr/lib/jvm/jre-${java_version}-oracle-* + do + if [ -d "${jvmdir}" -a "${jvmdir}" != "/usr/lib/jvm/java-${java_version}-openjdk-common" ] + then + JDK_DIRS="${JDK_DIRS} ${jvmdir}" + fi + done + done + + # Add older non multi arch installations + JDK_DIRS="${JDK_DIRS} /usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun /usr/lib/jvm/java-7-oracle" +} + +# The first existing directory is used for JAVA_HOME (if JAVA_HOME is not +# defined in UNIFIEDVIEWS_CFG) +JDK_DIRS="" +find_jdks + +# Look for the right JVM to use +for jdir in $JDK_DIRS; do + if [ -r "$jdir/bin/java" -a -z "${JAVA_HOME}" ]; then + JAVA_HOME="$jdir" + fi +done +export JAVA_HOME + +RETVAL="0" + +function parseOptions() { + options="" + + if [ -r "/etc/sysconfig/${NAME}" ]; then + options="$options $( + awk '!/^#/ && !/^$/ { ORS=" "; + print "export ", $0, ";" }' \ + /etc/sysconfig/${NAME} + )" + fi + UNIFIEDVIEWS_SCRIPT="$options ${UNIFIEDVIEWS_SCRIPT}" +} + +# rhbz 757632 +function version() { + parseOptions + $SU - $UNIFIEDVIEWS_USER -c "${UNIFIEDVIEWS_SCRIPT} version" >> ${UNIFIEDVIEWS_LOG} 2>&1 || RETVAL="4" +} + +# See how we were called. +function start() { + echo -n "Starting ${UNIFIEDVIEWS_PROG}: " + + if [ -z "$JAVA_HOME" ]; then + log_failure_msg "no JDK found - please set JAVA_HOME" + exit 1 + fi + + if [ "$RETVAL" != "0" ]; then + log_failure_msg + return + fi + + if [ -f "/var/lock/${NAME}" ]; then + if [ -f "${UNIFIEDVIEWS_PID}" ]; then + read kpid < ${UNIFIEDVIEWS_PID} +# if checkpid $kpid 2>&1; then + if [ -d "/proc/${kpid}" ]; then + log_success_msg + if [ "$DISTRIB_ID" = "MandrivaLinux" ]; then + echo + fi + RETVAL="0" + return + fi + fi + fi + # fix permissions on the log and pid files + touch $UNIFIEDVIEWS_PID 2>&1 || RETVAL="4" + if [ "$RETVAL" -eq "0" -a "$?" -eq "0" ]; then + chown ${UNIFIEDVIEWS_USER}:${UNIFIEDVIEWS_GROUP} $UNIFIEDVIEWS_PID + fi + if [ "$?" != "0" ]; then + RETVAL="4" + fi + parseOptions + [ "$RETVAL" -eq "0" ] && $SU - $UNIFIEDVIEWS_USER -c "${UNIFIEDVIEWS_SCRIPT} start" >> ${UNIFIEDVIEWS_LOG} 2>&1 || RETVAL="4" + if [ "$RETVAL" -eq "0" ]; then + log_success_msg + touch /var/lock/${NAME} + else + log_failure_msg "Error code ${RETVAL}" + fi + if [ "$DISTRIB_ID" = "MandrivaLinux" ]; then + echo + fi +} +function stop() { + echo -n "Stopping ${UNIFIEDVIEWS_PROG}: " + if [ -f "/var/lock/${NAME}" ]; then + parseOptions + if [ "$RETVAL" -eq "0" ]; then + touch /var/lock/${NAME} 2>&1 || RETVAL="4" + read kpid < ${UNIFIEDVIEWS_PID} + [ "$RETVAL" -eq "0" ] && ${UNIFIEDVIEWS_SCRIPT} stop >> ${UNIFIEDVIEWS_LOG} 2>&1 || RETVAL="4" + fi + if [ "$RETVAL" -eq "0" ]; then + count="0" + if [ -f "${UNIFIEDVIEWS_PID}" ]; then + read kpid < ${UNIFIEDVIEWS_PID} + until [ "$(ps --pid $kpid | grep -c $kpid)" -eq "0" ] || \ + [ "$count" -gt "$SHUTDOWN_WAIT" ]; do + if [ "$SHUTDOWN_VERBOSE" = "true" ]; then + echo "waiting for processes $kpid to exit" + fi + sleep 1 + let count="${count}+1" + done + if [ "$count" -gt "$SHUTDOWN_WAIT" ]; then + if [ "$SHUTDOWN_VERBOSE" = "true" ]; then + log_warning_msg "killing processes which did not stop after ${SHUTDOWN_WAIT} seconds" + fi + kill -9 $kpid + fi + log_success_msg + fi + rm -f /var/lock/${NAME} ${UNIFIEDVIEWS_PID} + else + log_failure_msg + RETVAL="4" + fi + else + log_success_msg + RETVAL="0" + fi + if [ "$DISTRIB_ID" = "MandrivaLinux" ]; then + echo + fi +} +function status() +{ + checkpidfile + if [ "$RETVAL" -eq "0" ]; then + log_success_msg "${NAME} (pid ${kpid}) is running..." + elif [ "$RETVAL" -eq "1" ]; then + log_failure_msg "PID file exists, but process is not running" + else + checklockfile + if [ "$RETVAL" -eq "2" ]; then + log_failure_msg "${NAME} lockfile exists but process is not running" + else + pid="$(/usr/bin/pgrep -f -d , -u ${UNIFIEDVIEWS_USER} -G ${UNIFIEDVIEWS_GROUP} backend)" + if [ -z "$pid" ]; then + log_success_msg "${NAME} is stopped" + RETVAL="3" + else + log_success_msg "${NAME} (pid ${kpid}) is running..." + echo "run" + RETVAL="0" + fi + fi + fi +} + +function checklockfile() +{ + if [ -f /var/lock/${NAME} ]; then + pid="$(/usr/bin/pgrep -f -d , -u ${UNIFIEDVIEWS_USER} -G ${UNIFIEDVIEWS_GROUP} backend)" +# The lockfile exists but the process is not running + if [ -z "$pid" ]; then + RETVAL="2" + fi + fi +} + +function checkpidfile() +{ + if [ -f "${UNIFIEDVIEWS_PID}" ]; then + read kpid < ${UNIFIEDVIEWS_PID} + if [ -d "/proc/${kpid}" ]; then +# The pid file exists and the process is running + RETVAL="0" + return + else +# The pid file exists but the process is not running + RETVAL="1" + return + fi + else +# pid file does not exist and program is not running + RETVAL="3" + return + fi +} + +function usage() +{ + echo "Usage: $0 {start|stop|restart|status|version}" + RETVAL="2" +} + +# See how we were called. +RETVAL="0" +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + status) + status + ;; + version) + version +# ${UNIFIEDVIEWS_SCRIPT} version + ;; + *) + usage + ;; +esac + +exit $RETVAL + + diff --git a/debian/unifiedviews-backend/src/deb/etc/unifiedviews/unifiedviews.conf b/debian/unifiedviews-backend/src/deb/etc/unifiedviews/unifiedviews.conf new file mode 100644 index 0000000000..d2fc7a256c --- /dev/null +++ b/debian/unifiedviews-backend/src/deb/etc/unifiedviews/unifiedviews.conf @@ -0,0 +1,34 @@ +# System-wide configuration file for unifiedviews services +# This will be sourced by unifiedviews and any secondary service +# Values will be overridden by service-specific configuration +# files in /etc/sysconfig +# +# Use this one to change default values for all services +# Change the service specific ones to affect only one service +# (see, for instance, /etc/sysconfig/unifiedviews) +# +# where backend is located +UNIFIEDVIEWS_BACKEND="/usr/share/unifiedviews/backend/unifiedviews-backend.jar" +# where backend's configuration is located +UNIFIEDVIEWS_BACKEND_CFG="/etc/unifiedviews/backend-config.properties" +# What user should run backend +UNIFIEDVIEWS_USER="unifiedviews" +# Where your java installation lives +#JAVA_HOME="/usr/lib/jvm/java-1.5.0" +# You can pass some parameters to java here if you wish to +#JAVA_OPTS="-Xminf0.1 -Xmaxf0.3" +# Use JAVA_OPTS to set java.library.path for libtcnative.so +#JAVA_OPTS="-Djava.library.path=/usr/lib" +# Cannot resolve user database reference - naming-factory-dbcp +# the real problem is a cnfe that is avoided by configuring +# the -Djavax.sql.DataSource.Factory. This fixes the rpm install. +JAVA_OPTS="${JAVA_OPTS} -DconfigFileLocation=${UNIFIEDVIEWS_BACKEND_CFG}" +UNIFIEDVIEWS_GROUP="${UNIFIEDVIEWS_GROUP:-`id -gn $UNIFIEDVIEWS_USER`}" +# You can change your tomcat locale here +#LANG="en_US" +# Time to wait in seconds, before killing process +SHUTDOWN_WAIT="30" +# Whether to annoy the user with "attempting to shut down" messages or not +SHUTDOWN_VERBOSE=true +# Set the UNIFIEDVIEWS_PID location +UNIFIEDVIEWS_PID="/var/run/unifiedviews-backend.pid" diff --git a/debian/unifiedviews-backend/src/deb/usr/sbin/run_unifiedviews_backend b/debian/unifiedviews-backend/src/deb/usr/sbin/run_unifiedviews_backend new file mode 100644 index 0000000000..938ebb1454 --- /dev/null +++ b/debian/unifiedviews-backend/src/deb/usr/sbin/run_unifiedviews_backend @@ -0,0 +1,120 @@ +#!/bin/bash + + +# Location of jar files on the system +JAVA_LIBDIR=/usr/share/java + +# Location of arch-specific jar files on the system +JNI_LIBDIR=/usr/lib/java + +# Root of all JVM installations +JVM_ROOT=/usr/lib/jvm + +# You can define a system-wide JVM root here if you're not using the +# default one. +# +# If you have the a base JRE package installed +# (e.g. java-1.6.0-openjdk): +#JAVA_HOME=$JVM_ROOT/jre +# +# If you have the a devel JDK package installed +# (e.g. java-1.6.0-openjdk-devel): +#JAVA_HOME=$JVM_ROOT/java + +# Options to pass to the java interpreter +JAVACMD_OPTS= + + +# Set the java virtual machine +set_jvm() { + # use $JAVA_HOME if defined + if [ -n "$JAVA_HOME" ] ; then + return + fi + + # try to find it from java command + + # try javac first, or we might get the location of the jre instead - djw + java=`which javac 2>/dev/null || :` + + # if we don't have the jdk, then maybe we have the jre - djw + if [ -z "$java" ] ; then + java=`which java 2>/dev/null || :` + fi + + if [ -n "$java" ] ; then + while [ -h "$java" ] ; do + java=`readlink $java 2>/dev/null` + done + JAVA_HOME="`dirname $java`/.." + export JAVA_HOME + return + fi + + echo "Can't find java virtual machine, aborting." + exit 1 +} + + +set_javacmd() { + if [ -x "$JAVACMD" ]; then + return + fi + set_jvm + # Add all sorts of jvm layouts here + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + JAVACMD="$JAVA_HOME/jre/sh/java" + elif [ -x "$JAVA_HOME/bin/java" ]; then + JAVACMD="$JAVA_HOME/bin/java" + else + JAVACMD=`which java 2>/dev/null` + fi + + if [ ! -x "$JAVACMD" ]; then + echo "$0: error: Failed to set JAVACMD" + return 1 + fi + + if [ -n "$JAVACMD_OPTS" ]; then + JAVACMD="$JAVACMD $JAVACMD_OPTS" + fi + + return 0 +} + +set_javacmd + +# Get the tomcat config (use this for environment specific settings) +if [ -z "${UNIFIEDVIEWS_MAIN_CFG}" ]; then + UNIFIEDVIEWS_MAIN_CFG="/etc/unifiedviews/unifiedviews.conf" +fi + +if [ -r "$UNIFIEDVIEWS_MAIN_CFG" ]; then + . $UNIFIEDVIEWS_MAIN_CFG +fi + +# Define the unifiedviews username +UNIFIEDVIEWS_USER="${UNIFIEDVIEWS_USER:-root}" + +# Define the unifiedviews group +UNIFIEDVIEWS_GROUP="${UNIFIEDVIEWS_GROUP:-`id -gn $UNIFIEDVIEWS_USER`}" + + +if [ "$1" = "start" ]; then + nohup ${JAVACMD} $JAVA_OPTS -jar "$UNIFIEDVIEWS_BACKEND" & + pid="$!" + if [ ! -z "$UNIFIEDVIEWS_PID" ]; then + echo "$pid" > $UNIFIEDVIEWS_PID + fi + echo $pid > $UNIFIEDVIEWS_PID + exit 0 +elif [ "$1" = "stop" ]; then + read process_id < ${UNIFIEDVIEWS_PID} + # send sigterm + kill -15 ${process_id} + exit 0 + +else + echo "Usage: $0 {start|start-security|stop}" + exit 1 +fi diff --git a/debian/unifiedviews-mysql/pom.xml b/debian/unifiedviews-mysql/pom.xml new file mode 100644 index 0000000000..598dafa0ab --- /dev/null +++ b/debian/unifiedviews-mysql/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + + eu.unifiedviews.packages + unifiedviews-packages + 2.2.0-SNAPSHOT + + + eu.unifiedviews.packages + unifiedviews-mysql + unifiedviews-mysql + + + + + + + + maven-jar-plugin + 2.5 + + + default-jar + never + + unwanted + unwanted + + + + + + jdeb + org.vafer + 1.4 + + + package + + jdeb + + + ${debian-package-name} + + + ${basedir}/src/deb/tmp + directory + + perm + /tmp + + + + + + + + + + diff --git a/debian/unifiedviews-mysql/src/deb/control/conffiles b/debian/unifiedviews-mysql/src/deb/control/conffiles new file mode 100644 index 0000000000..b3b219f721 --- /dev/null +++ b/debian/unifiedviews-mysql/src/deb/control/conffiles @@ -0,0 +1,2 @@ +/tmp/mysql.tmp + diff --git a/debian/unifiedviews-mysql/src/deb/control/control b/debian/unifiedviews-mysql/src/deb/control/control new file mode 100644 index 0000000000..cdef01702f --- /dev/null +++ b/debian/unifiedviews-mysql/src/deb/control/control @@ -0,0 +1,8 @@ +Package: unifiedviews-mysql +Version: [[debian-package-version]] +Section: java +Priority: extra +Architecture: all +Maintainer: jmc@eea.sk +Depends: unifiedviews-backend-mysql (>> 2.1), unifiedviews-backend-mysql (<< 2.2), unifiedviews-backend (>> 2.1), unifiedviews-backend (<< 2.2), unifiedviews-webapp-mysql (>> 2.1), unifiedviews-webapp-mysql (<< 2.2), unifiedviews-webapp (>> 2.1), unifiedviews-webapp (<< 2.2) +Description: The tool uses data processing pipelines for obtaining, processing, and storing RDF data. diff --git a/debian/unifiedviews-mysql/src/deb/tmp/mysql.tmp b/debian/unifiedviews-mysql/src/deb/tmp/mysql.tmp new file mode 100644 index 0000000000..1c2f433de1 --- /dev/null +++ b/debian/unifiedviews-mysql/src/deb/tmp/mysql.tmp @@ -0,0 +1 @@ +tmp \ No newline at end of file diff --git a/debian/unifiedviews-pgsql/pom.xml b/debian/unifiedviews-pgsql/pom.xml new file mode 100644 index 0000000000..d76b895990 --- /dev/null +++ b/debian/unifiedviews-pgsql/pom.xml @@ -0,0 +1,61 @@ + + + 4.0.0 + + + eu.unifiedviews.packages + unifiedviews-packages + 2.2.0-SNAPSHOT + + + eu.unifiedviews.packages + unifiedviews-pgsql + unifiedviews-pgsql + + + + + + + maven-jar-plugin + 2.5 + + + default-jar + never + + unwanted + unwanted + + + + + + jdeb + org.vafer + 1.4 + + + package + + jdeb + + + ${debian-package-name} + + + ${basedir}/src/deb/tmp + directory + + perm + /tmp + + + + + + + + + + diff --git a/debian/unifiedviews-pgsql/src/deb/control/conffiles b/debian/unifiedviews-pgsql/src/deb/control/conffiles new file mode 100644 index 0000000000..45856494a4 --- /dev/null +++ b/debian/unifiedviews-pgsql/src/deb/control/conffiles @@ -0,0 +1,2 @@ +/tmp/pgsql.tmp + diff --git a/debian/unifiedviews-pgsql/src/deb/control/control b/debian/unifiedviews-pgsql/src/deb/control/control new file mode 100644 index 0000000000..19048746bc --- /dev/null +++ b/debian/unifiedviews-pgsql/src/deb/control/control @@ -0,0 +1,8 @@ +Package: unifiedviews-pgsql +Version: [[debian-package-version]] +Section: java +Priority: extra +Architecture: all +Maintainer: jmc@eea.sk +Depends: unifiedviews-backend-pgsql (>> 2.1), unifiedviews-backend-pgsql (<< 2.2), unifiedviews-backend (>> 2.1), unifiedviews-backend (<< 2.2), unifiedviews-webapp-pgsql (>> 2.1), unifiedviews-webapp-pgsql (<< 2.2), unifiedviews-webapp (>> 2.1), unifiedviews-webapp (<< 2.2) +Description: The tool uses data processing pipelines for obtaining, processing, and storing RDF data. diff --git a/debian/unifiedviews-pgsql/src/deb/tmp/pgsql.tmp b/debian/unifiedviews-pgsql/src/deb/tmp/pgsql.tmp new file mode 100644 index 0000000000..1c2f433de1 --- /dev/null +++ b/debian/unifiedviews-pgsql/src/deb/tmp/pgsql.tmp @@ -0,0 +1 @@ +tmp \ No newline at end of file diff --git a/debian/unifiedviews-webapp-mysql/pom.xml b/debian/unifiedviews-webapp-mysql/pom.xml new file mode 100644 index 0000000000..6b2529a032 --- /dev/null +++ b/debian/unifiedviews-webapp-mysql/pom.xml @@ -0,0 +1,60 @@ + + + 4.0.0 + + + eu.unifiedviews.packages + unifiedviews-packages + 2.2.0-SNAPSHOT + + + eu.unifiedviews.packages + unifiedviews-webapp-mysql + unifiedviews-webapp-mysql + + + + + + jdeb + org.vafer + 1.4 + + + package + + jdeb + + + ${debian-package-name} + + + + ${basedir}/src/deb/etc/unifiedviews/frontend-config.properties + file + + perm + /etc/unifiedviews + perm + + + + + ${basedir}/src/deb/usr/share/unifiedviews/tomcat/bin + directory + + perm + /usr/share/unifiedviews/tomcat/bin + + + + + + + + + + + + + diff --git a/debian/unifiedviews-webapp-mysql/src/deb/control/conffiles b/debian/unifiedviews-webapp-mysql/src/deb/control/conffiles new file mode 100644 index 0000000000..0035b3e5d9 --- /dev/null +++ b/debian/unifiedviews-webapp-mysql/src/deb/control/conffiles @@ -0,0 +1,2 @@ +/etc/unifiedviews/frontend-config.properties + diff --git a/debian/unifiedviews-webapp-mysql/src/deb/control/config b/debian/unifiedviews-webapp-mysql/src/deb/control/config new file mode 100644 index 0000000000..9f4fea7a98 --- /dev/null +++ b/debian/unifiedviews-webapp-mysql/src/deb/control/config @@ -0,0 +1,9 @@ +#!/bin/sh +set -e +. /usr/share/debconf/confmodule + +db_input low frontend/mysql_db_user || true +db_go +db_input low frontend/mysql_db_password || true +db_go + diff --git a/debian/unifiedviews-webapp-mysql/src/deb/control/control b/debian/unifiedviews-webapp-mysql/src/deb/control/control new file mode 100644 index 0000000000..6d4e98d682 --- /dev/null +++ b/debian/unifiedviews-webapp-mysql/src/deb/control/control @@ -0,0 +1,11 @@ +Package: unifiedviews-webapp-mysql +Source: unifiedviews-webapp-mysql +Version: [[debian-package-version]] +Section: java +Priority: extra +Architecture: all +Maintainer: jmc@eea.sk +Homepage: https://github.com/UnifiedViews/Core +Depends: unifiedviews-webapp-shared (>> 2.1), unifiedviews-webapp-shared (<< 2.2), mysql-server, debconf (>= 0.5) +Conflicts: unifiedviews-backend-pgsql, unifiedviews-webapp-pgsql +Description: The mysql database and settings for unifiedviews's frontend. diff --git a/debian/unifiedviews-webapp-mysql/src/deb/control/postinst b/debian/unifiedviews-webapp-mysql/src/deb/control/postinst new file mode 100644 index 0000000000..a13f6234c5 --- /dev/null +++ b/debian/unifiedviews-webapp-mysql/src/deb/control/postinst @@ -0,0 +1,77 @@ +#!/bin/sh +# postinst script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +. /usr/share/debconf/confmodule + +db_creadentials(){ + db_get frontend/mysql_db_user + DBA_USER=$RET + + db_get frontend/mysql_db_password + DBA_PASS=$RET + + #update frontend config + sed --in-place \ + -e "s/database.sql.hostname = .*/database.sql.hostname = $address_host/" \ + -e "s/database.sql.port = .*/database.sql.port = 3306/" \ + -e "s/database.sql.user = .*/database.sql.user = $DBA_USER/" \ + -e "s/database.sql.password = .*/database.sql.password = $DBA_PASS/" \ + /etc/unifiedviews/frontend-config.properties +} + + +service_restart() { + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then + invoke-rc.d unifiedviews-frontend restart || true + else + service unifiedviews-frontend restart || true + fi +} + +fix_perms() { + chown -R unifiedviews:unifiedviews /etc/unifiedviews + chown -R unifiedviews:unifiedviews /usr/share/unifiedviews + } + +case "$1" in + configure) + db_creadentials + fix_perms + service_restart + db_stop + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + + diff --git a/debian/unifiedviews-webapp-mysql/src/deb/control/postrm b/debian/unifiedviews-webapp-mysql/src/deb/control/postrm new file mode 100644 index 0000000000..8bdeb44805 --- /dev/null +++ b/debian/unifiedviews-webapp-mysql/src/deb/control/postrm @@ -0,0 +1,51 @@ +#!/bin/sh +# postrm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + + remove|abort-install|disappear) + if [ -e /etc/init.d/unifiedviews-frontend ] ; then + service unifiedviews-frontend start + fi + + + ;; + + purge) + + + ;; + + upgrade|failed-upgrade|abort-upgrade) + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/unifiedviews-webapp-mysql/src/deb/control/prerm b/debian/unifiedviews-webapp-mysql/src/deb/control/prerm new file mode 100644 index 0000000000..216c1907a3 --- /dev/null +++ b/debian/unifiedviews-webapp-mysql/src/deb/control/prerm @@ -0,0 +1,45 @@ +#!/bin/sh +# prerm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + if [ -e /etc/init.d/unifiedviews-frontend ] ; then + service unifiedviews-frontend stop + fi + + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + + +#DEBHELPER# + +exit 0 + + diff --git a/debian/unifiedviews-webapp-mysql/src/deb/control/templates b/debian/unifiedviews-webapp-mysql/src/deb/control/templates new file mode 100644 index 0000000000..8c313a3bc8 --- /dev/null +++ b/debian/unifiedviews-webapp-mysql/src/deb/control/templates @@ -0,0 +1,9 @@ +Template: frontend/mysql_db_user +Type: string +Default: uv +Description: MySQL user for unifiedviews + +Template: frontend/mysql_db_password +Type: password +Default: uv +Description: MySQL user password diff --git a/debian/unifiedviews-webapp-mysql/src/deb/etc/unifiedviews/frontend-config.properties b/debian/unifiedviews-webapp-mysql/src/deb/etc/unifiedviews/frontend-config.properties new file mode 100644 index 0000000000..d1649ed625 --- /dev/null +++ b/debian/unifiedviews-webapp-mysql/src/deb/etc/unifiedviews/frontend-config.properties @@ -0,0 +1,113 @@ +# This is the central configuration for WEB FRONTEND of IntLib application. +# +# This file contains just a sample configuration and is not used by the +# application. Please copy it to WEB-INF/classes/config.properties and customize +# it to meet your needs. +# +# The key and element characters #, !, =, and : should be properly escaped +# with a preceding backslash to ensure that they are properly loaded. + +# string diplayed next to the UV logo in GUI +installation.name = Test + +# directory where frontend log should be stored (should not end with / or \ ) +frontend.log.directory = /var/log/unifiedviews/frontend/ +# how long should frontend keep log history +frontend.log.keepDays = 7 + +frontend.theme = UnifiedViewsTheme + +# General settings (should end with "backend/working") +general.workingdir = /var/cache/unifiedviews/backend/working + +# Backend application configuration +backend.host = 127.0.0.1 +backend.port = 5010 + +# Connection configuration setting for relational database +# for mysql { +database.sql.driver = com.mysql.jdbc.Driver +database.sql.url = jdbc:mysql://localhost:3306/unifiedviews?characterEncoding=utf8 +database.sql.user = unifiedviews +database.sql.password = unifiedviews +} + +# for postgresql { +#database.sql.driver = org.postgresql.Driver +#database.sql.url = jdbc:postgresql://localhost:5432/unifiedviews +#database.sql.user = unifiedviews +#database.sql.password = unifiedviews +# } + + +# Connection configuration setting for RDF database +# use local rdf platform { +database.rdf.platform = localRDF +# } + +# or use remote rdf platform (sesame) { +#database.rdf.platform = remoteRDF +#database.rdf.url = http://ip6-localhost:8080/openrdf-sesame +#database.rdf.user = +#database.rdf.password = +# } + +# or user virtuoso platform { +#database.rdf.platform = virtuoso +#database.rdf.url = jdbc:virtuoso://localhost:1111/charset=UTF-8/log_enable=2 +#database.rdf.user = dba +#database.rdf.password = dba +# } + + +# Administrator contact email for sending reports and failure notifications +email.enabled = false +email.admin = admin@example.com +# use if email.enabled = true +#email.smtp.host = smtp.server.cz +#email.smtp.port = 25 +#email.smtp.ttl = false +#email.from = odcs@xrg.mff.cuni.cz +#email.authorization = false +# use if email.authorization = true +#email.username = +#email.password = + +# Configuration of DPU modules +module.path = /var/lib/unifiedviews/common + +# reserved for developers +# module.frontend.expose = +module.frontend.expose = sun.misc,sun.io,com.sun.nio.file + +# ckan connection configuration +#ckan.location = http://localhost:5000/api/3/action/ +#ckan.api.key = + +# Name of the admin permission which is able to see all entitites (pipelines) +admin.permission=administrator + +# for Single Sign-on { +#in case this property is true you can define relative address in property cas.security.check.url +#cas.behindProxy=false +#URL which needs to be called if the application wants to logout the CAS session +#logout.url=http://192.168.6.73:18080/unifiedviews/cas_logout +#CAS server URL +#cas.server.host=https://192.168.1.8:8443/cas2 +#Callback URL for spring to authenticate the user. +#cas.security.check.url=http://192.168.6.73:18080/unifiedviews/login/cas +#CAS login URL +#cas.login.url=https://192.168.1.8:8443/cas2/login +#CAS logout URL +#cas.logout.url=https://192.168.1.8:8443/cas2/logout?service=http%3A%2F%2F192.168.7.42%3A18080%2Funifiedviews%2F +# } + +#type of ownership user|organization +ownership.type=user +# credentials for Master REST API +master.api.user=master +master.api.password=commander +# Language configuration (e.g.: en_US, sk) +locale = en +# credentials for Master REST API +master.api.user=master diff --git a/debian/unifiedviews-webapp-pgsql/pom.xml b/debian/unifiedviews-webapp-pgsql/pom.xml new file mode 100644 index 0000000000..0a3bbabb1d --- /dev/null +++ b/debian/unifiedviews-webapp-pgsql/pom.xml @@ -0,0 +1,60 @@ + + + 4.0.0 + + + eu.unifiedviews.packages + unifiedviews-packages + 2.2.0-SNAPSHOT + + + eu.unifiedviews.packages + unifiedviews-webapp-pgsql + unifiedviews-webapp-pgsql + + + + + + jdeb + org.vafer + 1.4 + + + package + + jdeb + + + ${debian-package-name} + + + + ${basedir}/src/deb/etc/unifiedviews/frontend-config.properties + file + + perm + /etc/unifiedviews + perm + + + + + ${basedir}/src/deb/usr/share/unifiedviews/tomcat/bin + directory + + perm + /usr/share/unifiedviews/tomcat/bin + + + + + + + + + + + + + diff --git a/debian/unifiedviews-webapp-pgsql/src/deb/control/conffiles b/debian/unifiedviews-webapp-pgsql/src/deb/control/conffiles new file mode 100644 index 0000000000..0035b3e5d9 --- /dev/null +++ b/debian/unifiedviews-webapp-pgsql/src/deb/control/conffiles @@ -0,0 +1,2 @@ +/etc/unifiedviews/frontend-config.properties + diff --git a/debian/unifiedviews-webapp-pgsql/src/deb/control/config b/debian/unifiedviews-webapp-pgsql/src/deb/control/config new file mode 100644 index 0000000000..f213c4392c --- /dev/null +++ b/debian/unifiedviews-webapp-pgsql/src/deb/control/config @@ -0,0 +1,9 @@ +#!/bin/sh +set -e +. /usr/share/debconf/confmodule + +db_input low frontend/pgsql_db_user || true +db_go +db_input low frontend/pgsql_db_password || true +db_go + diff --git a/debian/unifiedviews-webapp-pgsql/src/deb/control/control b/debian/unifiedviews-webapp-pgsql/src/deb/control/control new file mode 100644 index 0000000000..ac553a748c --- /dev/null +++ b/debian/unifiedviews-webapp-pgsql/src/deb/control/control @@ -0,0 +1,11 @@ +Package: unifiedviews-webapp-pgsql +Source: unifiedviews-webapp-pgsql +Version: [[debian-package-version]] +Section: java +Priority: extra +Architecture: all +Maintainer: jmc@eea.sk +Homepage: https://github.com/UnifiedViews/Core +Depends: unifiedviews-webapp-shared (>> 2.1), unifiedviews-webapp-shared (<< 2.2), postgresql, debconf (>= 0.5) +Conflicts: unifiedviews-backend-mysql, unifiedviews-webapp-mysql +Description: The postgresql database and settings for unifiedviews. diff --git a/debian/unifiedviews-webapp-pgsql/src/deb/control/postinst b/debian/unifiedviews-webapp-pgsql/src/deb/control/postinst new file mode 100644 index 0000000000..e785fd52a8 --- /dev/null +++ b/debian/unifiedviews-webapp-pgsql/src/deb/control/postinst @@ -0,0 +1,76 @@ +#!/bin/sh +# postinst script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +. /usr/share/debconf/confmodule + +db_creadentials(){ + db_get frontend/pgsql_db_user + DBA_USER=$RET + + db_get frontend/pgsql_db_password + DBA_PASS=$RET + + #update frontend config + sed --in-place \ + -e "s/database.sql.hostname = .*/database.sql.hostname = $address_host/" \ + -e "s/database.sql.port = .*/database.sql.port = 3306/" \ + -e "s/database.sql.user = .*/database.sql.user = $DBA_USER/" \ + -e "s/database.sql.password = .*/database.sql.password = $DBA_PASS/" \ + /etc/unifiedviews/frontend-config.properties +} + +service_restart() { + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then + invoke-rc.d unifiedviews-frontend restart || true + else + service unifiedviews-frontend restart || true + fi +} + +fix_perms() { + chown -R unifiedviews:unifiedviews /etc/unifiedviews + chown -R unifiedviews:unifiedviews /usr/share/unifiedviews +} + +case "$1" in + configure) + db_creadentials + fix_perms + service_restart + db_stop + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + + diff --git a/debian/unifiedviews-webapp-pgsql/src/deb/control/postrm b/debian/unifiedviews-webapp-pgsql/src/deb/control/postrm new file mode 100644 index 0000000000..f7ca369905 --- /dev/null +++ b/debian/unifiedviews-webapp-pgsql/src/deb/control/postrm @@ -0,0 +1,49 @@ +#!/bin/sh +# postrm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + + remove|abort-install|disappear) + if [ -e /etc/init.d/unifiedviews-frontend ] ; then + service unifiedviews-frontend start + fi + + ;; + + purge) + + ;; + + upgrade|failed-upgrade|abort-upgrade) + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/unifiedviews-webapp-pgsql/src/deb/control/prerm b/debian/unifiedviews-webapp-pgsql/src/deb/control/prerm new file mode 100644 index 0000000000..216c1907a3 --- /dev/null +++ b/debian/unifiedviews-webapp-pgsql/src/deb/control/prerm @@ -0,0 +1,45 @@ +#!/bin/sh +# prerm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + if [ -e /etc/init.d/unifiedviews-frontend ] ; then + service unifiedviews-frontend stop + fi + + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + + +#DEBHELPER# + +exit 0 + + diff --git a/debian/unifiedviews-webapp-pgsql/src/deb/control/templates b/debian/unifiedviews-webapp-pgsql/src/deb/control/templates new file mode 100644 index 0000000000..38d83afaf4 --- /dev/null +++ b/debian/unifiedviews-webapp-pgsql/src/deb/control/templates @@ -0,0 +1,9 @@ +Template: frontend/pgsql_db_user +Type: string +Default: uv +Description: Postgresql user for unifiedviews + +Template: frontend/pgsql_db_password +Type: password +Default: uv +Description: Postgresql user password diff --git a/debian/unifiedviews-webapp-pgsql/src/deb/etc/unifiedviews/frontend-config.properties b/debian/unifiedviews-webapp-pgsql/src/deb/etc/unifiedviews/frontend-config.properties new file mode 100644 index 0000000000..39c4abb931 --- /dev/null +++ b/debian/unifiedviews-webapp-pgsql/src/deb/etc/unifiedviews/frontend-config.properties @@ -0,0 +1,119 @@ +# This is the central configuration for WEB FRONTEND of IntLib application. +# +# This file contains just a sample configuration and is not used by the +# application. Please copy it to WEB-INF/classes/config.properties and customize +# it to meet your needs. +# +# The key and element characters #, !, =, and : should be properly escaped +# with a preceding backslash to ensure that they are properly loaded. + +# string diplayed next to the UV logo in GUI +installation.name = Test + +# directory where frontend log should be stored (should not end with / or \ ) +frontend.log.directory = /var/log/unifiedviews/frontend/ +# how long should frontend keep log history +frontend.log.keepDays = 7 +# Frontend theme. +frontend.theme = UnifiedViewsTheme + +# General settings (should end with "backend/working") +general.workingdir = /var/cache/unifiedviews/backend/working + +# Backend application configuration +backend.host = 127.0.0.1 +backend.port = 5010 + +# Connection configuration setting for relational database +# for postgresql { +database.sql.driver = org.postgresql.Driver +database.sql.url = jdbc:postgresql://localhost:5432/unifiedviews +database.sql.user = unifiedviews +database.sql.password = unifiedviews +# } + +# for mysql { +#database.sql.driver = com.mysql.jdbc.Driver +#database.sql.url = jdbc:mysql://localhost:3306/unifiedviews?characterEncoding=utf8 +#database.sql.user = unifiedviews +#database.sql.password = unifiedviews +# } + +# Connection configuration setting for RDF database +# use local rdf platform { +database.rdf.platform = localRDF +# } + +# or use remote rdf platform (sesame) { +#database.rdf.platform = remoteRDF +#database.rdf.url = http://ip6-localhost:8080/openrdf-sesame +#database.rdf.user = +#database.rdf.password = +# } + +# or user virtuoso platform { +#database.rdf.platform = virtuoso +#database.rdf.url = jdbc:virtuoso://localhost:1111/charset=UTF-8/log_enable=2 +#database.rdf.user = dba +#database.rdf.password = dba +# } + + +# Administrator contact email for sending reports and failure notifications +email.enabled = false +email.admin = admin@example.com +# use if email.enabled = true +#email.smtp.host = smtp.server.cz +#email.smtp.port = 25 +#email.smtp.ttl = false +#email.from = odcs@xrg.mff.cuni.cz +#email.authorization = false +# use if email.authorization = true +#email.username = +#email.password = + +# Configuration of DPU modules +module.path = /var/lib/unifiedviews/common + +# reserved for developers +# module.frontend.expose = +module.frontend.expose = sun.misc,sun.io,com.sun.nio.file + +# ckan connection configuration +#ckan.location = http://localhost:5000/api/3/action/ +#ckan.api.key = + +# Name of the admin permission which is able to see all entitites (pipelines) +admin.permission=administrator + +# for Single Sign-on { + +#in case this property is true you can define relative address in property cas.security.check.url +#cas.behindProxy=false +#URL which needs to be called if the application wants to logout the CAS session +#logout.url=http://192.168.6.73:18080/unifiedviews/cas_logout +#CAS server URL +#cas.server.host=https://192.168.1.8:8443/cas2 +#Callback URL for spring to authenticate the user. +#cas.security.check.url=http://192.168.6.73:18080/unifiedviews/login/cas +#CAS login URL +#cas.login.url=https://192.168.1.8:8443/cas2/login +#CAS logout URL +#cas.logout.url=https://192.168.1.8:8443/cas2/logout?service=http%3A%2F%2F192.168.7.42%3A18080%2Funifiedviews%2F +#CAS attribute containing user name +cas.attributeName.userName = UserName +cas.attributeName.fullName = FormattedName +cas.attributeName.role = Roles +cas.attributeName.actorId = ActorID +cas.attributeName.actorName = ActorFormattedName +# } + +#type of ownership user|organization +ownership.type=user +# credentials for Master REST API +master.api.user=master +master.api.password=commander +# Language configuration (e.g.: en_US, sk) +locale = en +# credentials for Master REST API +master.api.user=master diff --git a/debian/unifiedviews-webapp-shared/pom.xml b/debian/unifiedviews-webapp-shared/pom.xml new file mode 100644 index 0000000000..b2090252c2 --- /dev/null +++ b/debian/unifiedviews-webapp-shared/pom.xml @@ -0,0 +1,219 @@ + + + 4.0.0 + + + eu.unifiedviews.packages + unifiedviews-packages + 2.2.0-SNAPSHOT + + + eu.unifiedviews.packages + unifiedviews-webapp-shared + unifiedviews-webapp-shared + + + + + eu.unifiedviews + frontend + 2.1.2 + war + + + eu.unifiedviews + master + 2.1.2 + war + + + + + + maven.eea.sk + maven.eea.sk-public + http://maven.eea.sk/artifactory/public/ + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.3 + + + unpack + package + + unpack + + + + + eu.unifiedviews + frontend + 2.1.2 + war + true + ${project.build.directory}/frontend + + + ${project.build.directory}/master + eu.unifiedviews + master + 2.1.2 + war + + + false + true + + + + + + + jdeb + org.vafer + 1.4 + + + package + + jdeb + + + ${debian-package-name} + + + + ${project.build.directory}/frontend + directory + + perm + /usr/share/unifiedviews/frontend + + + + + ${project.build.directory}/master + directory + + perm + /usr/share/unifiedviews/master + + + + + ${basedir}/src/deb/etc/init.d/unifiedviews-frontend + file + + perm + /etc/init.d + + + + + ${basedir}/src/deb/etc/unifiedviews/ + directory + + perm + /etc/unifiedviews + + + + + template + + /var/cache/unifiedviews/ + /var/log/unifiedviews/frontend + /usr/share/unifiedviews/webapp + /var/tmp/unifiedviews + /usr/share/unifiedviews/tomcat + + + perm + + + + + + link + /usr/share/unifiedviews/tomcat/conf + /etc/unifiedviews/tomcat + true + + perm + + + + + link + /usr/share/unifiedviews/tomcat/logs + /var/log/unifiedviews/frontend + true + + perm + + + + + link + /usr/share/unifiedviews/tomcat/work + /var/cache/unifiedviews/ + true + + perm + + + + + link + /usr/share/unifiedviews/tomcat/temp + /var/tmp/unifiedviews + true + + perm + + + + + + + + + + + + + + + diff --git a/debian/unifiedviews-webapp-shared/src/deb/control/conffiles b/debian/unifiedviews-webapp-shared/src/deb/control/conffiles new file mode 100644 index 0000000000..0035b3e5d9 --- /dev/null +++ b/debian/unifiedviews-webapp-shared/src/deb/control/conffiles @@ -0,0 +1,2 @@ +/etc/unifiedviews/frontend-config.properties + diff --git a/debian/unifiedviews-webapp-shared/src/deb/control/control b/debian/unifiedviews-webapp-shared/src/deb/control/control new file mode 100644 index 0000000000..0757c0f537 --- /dev/null +++ b/debian/unifiedviews-webapp-shared/src/deb/control/control @@ -0,0 +1,11 @@ +Package: unifiedviews-webapp-shared +Source: unifiedviews-webapp-shared +Version: [[debian-package-version]] +Section: java +Priority: extra +Architecture: all +Maintainer: jmc@eea.sk +Homepage: https://github.com/UnifiedViews/Core +Depends: openjdk-7-jre-headless, tomcat7 +Conflicts: unifiedviews-webapp-shared (<< 2.0.0) +Description: The unifiedviews's frontend binaries. diff --git a/debian/unifiedviews-webapp-shared/src/deb/control/postinst b/debian/unifiedviews-webapp-shared/src/deb/control/postinst new file mode 100644 index 0000000000..b15d3adf7e --- /dev/null +++ b/debian/unifiedviews-webapp-shared/src/deb/control/postinst @@ -0,0 +1,48 @@ +#!/bin/sh +# postinst script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +fix_perms() { + chown -R unifiedviews:unifiedviews /usr/share/unifiedviews/master + chown -R unifiedviews:unifiedviews /etc/unifiedviews + chown -R unifiedviews:unifiedviews /var/cache/unifiedviews + chown -R unifiedviews:unifiedviews /var/log/unifiedviews + chown -R unifiedviews:unifiedviews /var/tmp/unifiedviews + chmod +x /etc/init.d/unifiedviews-frontend || true +} + +case "$1" in + configure) + fix_perms + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 \ No newline at end of file diff --git a/debian/unifiedviews-webapp-shared/src/deb/control/postrm b/debian/unifiedviews-webapp-shared/src/deb/control/postrm new file mode 100644 index 0000000000..1d5b65c2b8 --- /dev/null +++ b/debian/unifiedviews-webapp-shared/src/deb/control/postrm @@ -0,0 +1,52 @@ +#!/bin/sh +# postrm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +case "$1" in + + remove|abort-install|disappear) + update-rc.d unifiedviews-frontend remove + # delete uv-webapp directories + rm -rf /var/cache/unifiedviews + rm -rf /var/log/unifiedviews/frontend + rm -rf /usr/share/unifiedviews/webapp + rm -rf /var/tmp/unifiedviews + rm -rf /usr/share/unifiedviews/tomcat + ;; + + purge) + + ;; + + upgrade|failed-upgrade|abort-upgrade) + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/unifiedviews-webapp-shared/src/deb/control/prerm b/debian/unifiedviews-webapp-shared/src/deb/control/prerm new file mode 100644 index 0000000000..216c1907a3 --- /dev/null +++ b/debian/unifiedviews-webapp-shared/src/deb/control/prerm @@ -0,0 +1,45 @@ +#!/bin/sh +# prerm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + if [ -e /etc/init.d/unifiedviews-frontend ] ; then + service unifiedviews-frontend stop + fi + + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + + +#DEBHELPER# + +exit 0 + + diff --git a/debian/unifiedviews-webapp-shared/src/deb/etc/init.d/unifiedviews-frontend b/debian/unifiedviews-webapp-shared/src/deb/etc/init.d/unifiedviews-frontend new file mode 100644 index 0000000000..0bf563591f --- /dev/null +++ b/debian/unifiedviews-webapp-shared/src/deb/etc/init.d/unifiedviews-frontend @@ -0,0 +1,287 @@ +#!/bin/sh +# +# /etc/init.d/unifiedviews -- startup script for the Tomcat 6 servlet engine +# +# Written by Miquel van Smoorenburg . +# Modified for Debian GNU/Linux by Ian Murdock . +# Modified for Tomcat by Stefan Gybas . +# Modified for Tomcat6 by Thierry Carrez . +# Modified for Tomcat7 by Ernesto Hernandez-Novich . +# Additional improvements by Jason Brittain . +# +### BEGIN INIT INFO +# Provides: unifiedviews-frontend +# Required-Start: $local_fs $remote_fs $network +# Required-Stop: $local_fs $remote_fs $network +# Should-Start: $named +# Should-Stop: $named +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start ODN Solr +# Description: Start the Tomcat servlet engine. +### END INIT INFO + +set -e + +PATH=/bin:/usr/bin:/sbin:/usr/sbin +NAME=unifiedviews-frontend +DESC="Unifiedviews-frontend" +DEFAULT=/etc/default/$NAME +JVM_TMP=/tmp/tomcat7-$NAME-tmp + + + +if [ `id -u` -ne 0 ]; then + echo "You need root privileges to run this script" + exit 1 +fi + +# Make sure tomcat is started with system locale +if [ -r /etc/default/locale ]; then + . /etc/default/locale + export LANG +fi + +. /lib/lsb/init-functions + +if [ -r /etc/default/rcS ]; then + . /etc/default/rcS +fi + + +# The following variables can be overwritten in $DEFAULT + +# Run Tomcat 7 as this user ID and group ID +TOMCAT7_USER=unifiedviews +TOMCAT7_GROUP=unifiedviews + +# this is a work-around until there is a suitable runtime replacement +# for dpkg-architecture for arch:all packages +# this function sets the variable JDK_DIRS +find_jdks() +{ + for java_version in 9 8 7 + do + for jvmdir in /usr/lib/jvm/java-${java_version}-openjdk-* \ + /usr/lib/jvm/jdk-${java_version}-oracle-* \ + /usr/lib/jvm/jre-${java_version}-oracle-* + do + if [ -d "${jvmdir}" -a "${jvmdir}" != "/usr/lib/jvm/java-${java_version}-openjdk-common" ] + then + JDK_DIRS="${JDK_DIRS} ${jvmdir}" + fi + done + done + + # Add older non multi arch installations + JDK_DIRS="${JDK_DIRS} /usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun /usr/lib/jvm/java-7-oracle" +} + +# The first existing directory is used for JAVA_HOME (if JAVA_HOME is not +# defined in $DEFAULT) +JDK_DIRS="" +find_jdks + +# Look for the right JVM to use +for jdir in $JDK_DIRS; do + if [ -r "$jdir/bin/java" -a -z "${JAVA_HOME}" ]; then + JAVA_HOME="$jdir" + fi +done +export JAVA_HOME + +# Directory where the Tomcat 6 binary distribution resides +CATALINA_HOME=/usr/share/tomcat7 + +# Directory for per-instance configuration files and webapps +CATALINA_BASE=/usr/share/unifiedviews/tomcat + +# Use the Java security manager? (yes/no) +TOMCAT7_SECURITY=no + +# Default Java options +# Set java.awt.headless=true if JAVA_OPTS is not set so the +# Xalan XSL transformer can work without X11 display on JDK 1.4+ +# It also looks like the default heap size of 64M is not enough for most cases +# so the maximum heap size is set to 128M +if [ -z "$JAVA_OPTS" ]; then + JAVA_OPTS="-Djava.awt.headless=true -Xmx128M" +fi + +# End of variables that can be overwritten in $DEFAULT + +# overwrite settings from default file +if [ -f "$DEFAULT" ]; then + . "$DEFAULT" +fi + +if [ ! -f "$CATALINA_HOME/bin/bootstrap.jar" ]; then + log_failure_msg "$NAME is not installed" + exit 1 +fi + +if [ -z "$CATALINA_TMPDIR" ]; then + CATALINA_TMPDIR="$JVM_TMP" +fi + +# Set the JSP compiler if set in the tomcat7.default file +if [ -n "$JSP_COMPILER" ]; then + JAVA_OPTS="$JAVA_OPTS -Dbuild.compiler=\"$JSP_COMPILER\"" +fi + +SECURITY="" +if [ "$TOMCAT7_SECURITY" = "yes" ]; then + SECURITY="-security" +fi + +# Define other required variables +CATALINA_PID="/var/run/$NAME.pid" +CATALINA_SH="$CATALINA_HOME/bin/catalina.sh" + +# Look for Java Secure Sockets Extension (JSSE) JARs +if [ -z "${JSSE_HOME}" -a -r "${JAVA_HOME}/jre/lib/jsse.jar" ]; then + JSSE_HOME="${JAVA_HOME}/jre/" +fi + +catalina_sh() { + # Escape any double quotes in the value of JAVA_OPTS + JAVA_OPTS="$(echo $JAVA_OPTS | sed 's/\"/\\\"/g')" + + AUTHBIND_COMMAND="" + if [ "$AUTHBIND" = "yes" -a "$1" = "start" ]; then + AUTHBIND_COMMAND="/usr/bin/authbind --deep /bin/bash -c " + fi + + # Define the command to run Tomcat's catalina.sh as a daemon + # set -a tells sh to export assigned variables to spawned shells. + TOMCAT_SH="set -a; JAVA_HOME=\"$JAVA_HOME\"; source \"$DEFAULT\"; \ + CATALINA_HOME=\"$CATALINA_HOME\"; \ + CATALINA_BASE=\"$CATALINA_BASE\"; \ + JAVA_OPTS=\"$JAVA_OPTS\"; \ + CATALINA_PID=\"$CATALINA_PID\"; \ + CATALINA_TMPDIR=\"$CATALINA_TMPDIR\"; \ + LANG=\"$LANG\"; JSSE_HOME=\"$JSSE_HOME\"; \ + cd \"$CATALINA_BASE\"; \ + \"$CATALINA_SH\" $@" + + if [ "$AUTHBIND" = "yes" -a "$1" = "start" ]; then + TOMCAT_SH="'$TOMCAT_SH'" + fi + + # Run the catalina.sh script as a daemon + set +e + touch "$CATALINA_PID" "$CATALINA_BASE"/logs/catalina.out + chown $TOMCAT7_USER "$CATALINA_PID" "$CATALINA_BASE"/logs/catalina.out + start-stop-daemon --start -b -u "$TOMCAT7_USER" -g "$TOMCAT7_GROUP" \ + -c "$TOMCAT7_USER" -d "$CATALINA_TMPDIR" -p "$CATALINA_PID" \ + -x /bin/bash -- -c "$AUTHBIND_COMMAND $TOMCAT_SH" + status="$?" + set +a -e + return $status +} + +case "$1" in + start) + if [ -z "$JAVA_HOME" ]; then + log_failure_msg "no JDK or JRE found - please set JAVA_HOME" + exit 1 + fi + + if [ ! -d "$CATALINA_BASE/conf" ]; then + log_failure_msg "invalid CATALINA_BASE: $CATALINA_BASE" + exit 1 + fi + + log_daemon_msg "Starting $DESC" "$NAME" + if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \ + --user $TOMCAT7_USER --exec "$JAVA_HOME/bin/java" \ + >/dev/null; then + + # Remove / recreate JVM_TMP directory + rm -rf "$JVM_TMP" + mkdir -p "$JVM_TMP" || { + log_failure_msg "could not create JVM temporary directory" + exit 1 + } + chown $TOMCAT7_USER "$JVM_TMP" + + catalina_sh start $SECURITY + sleep 5 + if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \ + --user $TOMCAT7_USER --exec "$JAVA_HOME/bin/java" \ + >/dev/null; then + if [ -f "$CATALINA_PID" ]; then + rm -f "$CATALINA_PID" + fi + log_end_msg 1 + else + log_end_msg 0 + fi + else + log_progress_msg "(already running)" + log_end_msg 0 + fi + ;; + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + + set +e + if [ -f "$CATALINA_PID" ]; then + start-stop-daemon --stop --pidfile "$CATALINA_PID" \ + --user "$TOMCAT7_USER" \ + --retry=TERM/20/KILL/5 >/dev/null + if [ $? -eq 1 ]; then + log_progress_msg "$DESC is not running but pid file exists, cleaning up" + elif [ $? -eq 3 ]; then + PID="`cat $CATALINA_PID`" + log_failure_msg "Failed to stop $NAME (pid $PID)" + exit 1 + fi + rm -f "$CATALINA_PID" + rm -rf "$JVM_TMP" + else + log_progress_msg "(not running)" + fi + log_end_msg 0 + set -e + ;; + status) + set +e + start-stop-daemon --test --start --pidfile "$CATALINA_PID" \ + --user $TOMCAT7_USER --exec "$JAVA_HOME/bin/java" \ + >/dev/null 2>&1 + if [ "$?" = "0" ]; then + + if [ -f "$CATALINA_PID" ]; then + log_success_msg "$DESC is not running, but pid file exists." + exit 1 + else + log_success_msg "$DESC is not running." + exit 3 + fi + else + log_success_msg "$DESC is running with pid `cat $CATALINA_PID`" + fi + set -e + ;; + restart|force-reload) + if [ -f "$CATALINA_PID" ]; then + $0 stop + sleep 1 + fi + $0 start + ;; + try-restart) + if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \ + --user $TOMCAT7_USER --exec "$JAVA_HOME/bin/java" \ + >/dev/null; then + $0 start + fi + ;; + *) + log_success_msg "Usage: $0 {start|stop|restart|try-restart|force-reload|status}" + exit 1 + ;; +esac + +exit 0 diff --git a/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/frontend-config.sample.properties b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/frontend-config.sample.properties new file mode 100644 index 0000000000..48d40ea7a9 --- /dev/null +++ b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/frontend-config.sample.properties @@ -0,0 +1,109 @@ +# This is the central configuration for WEB FRONTEND of IntLib application. +# +# This file contains just a sample configuration and is not used by the +# application. Please copy it to WEB-INF/classes/config.properties and customize +# it to meet your needs. +# +# The key and element characters #, !, =, and : should be properly escaped +# with a preceding backslash to ensure that they are properly loaded. + +# string diplayed next to the UV logo in GUI +installation.name = Test + +# directory where frontend log should be stored (should not end with / or \ ) +frontend.log.directory = /var/log/unifiedviews/frontend/ +# how long should frontend keep log history +frontend.log.keepDays = 7 +# Frontend theme. +frontend.theme = UnifiedViewsTheme +# General settings (should end with "backend/working") +general.workingdir = /var/lib/unifiedviews/backend/working + +# Backend application configuration +backend.host = 127.0.0.1 +backend.port = 5010 + +# Connection configuration setting for relational database +# for postgresql { +database.sql.driver = org.postgresql.Driver +database.sql.url = jdbc:postgresql://localhost:5432/unifiedviews +database.sql.user = unifiedviews +database.sql.password = unifiedviews +# } + +# for mysql { +#database.sql.driver = com.mysql.jdbc.Driver +#database.sql.url = jdbc:mysql://localhost:3306/unifiedviews?characterEncoding=utf8 +#database.sql.user = unifiedviews +#database.sql.password = unifiedviews +# } +# Connection configuration setting for RDF database +# use local rdf platform { +database.rdf.platform = localRDF +# } + +# or use remote rdf platform (sesame) { +#database.rdf.platform = remoteRDF +#database.rdf.url = http://ip6-localhost:8080/openrdf-sesame +#database.rdf.user = +#database.rdf.password = +# } + +# or user virtuoso platform { +#database.rdf.platform = virtuoso +#database.rdf.url = jdbc:virtuoso://localhost:1111/charset=UTF-8/log_enable=2 +#database.rdf.user = dba +#database.rdf.password = dba +# } + + +# Administrator contact email for sending reports and failure notifications +email.enabled = false +email.admin = admin@example.com +# use if email.enabled = true +#email.smtp.host = smtp.server.cz +#email.smtp.port = 25 +#email.smtp.ttl = false +#email.from = odcs@xrg.mff.cuni.cz +#email.authorization = false +# use if email.authorization = true +#email.username = +#email.password = + +# Configuration of DPU modules +module.path = {full path to "odcs" (home) dir of the project}/common + +# reserved for developers +# module.frontend.expose = +module.frontend.expose = sun.misc,sun.io,com.sun.nio.file + +# ckan connection configuration +#ckan.location = http://localhost:5000/api/3/action/ +#ckan.api.key = + +# Name of the admin permission which is able to see all entitites (pipelines) +admin.permission=administrator + +# for Single Sign-on { +#URL which needs to be called if the application wants to logout the CAS session +#logout.url=http://192.168.6.73:18080/unifiedviews/cas_logout +#CAS server URL +#cas.server.host=https://192.168.1.8:8443/cas2 +#Callback URL for spring to authenticate the user. +#cas.security.check.url=http://192.168.6.73:18080/unifiedviews/login/cas +#CAS login URL +#cas.login.url=https://192.168.1.8:8443/cas2/login +#CAS logout URL +#cas.logout.url=https://192.168.1.8:8443/cas2/logout?service=http%3A%2F%2F192.168.7.42%3A18080%2Funifiedviews%2F +#cas.behindProxy=false +# } + +#type of ownership user|organization +ownership.type=user +# credentials for Master REST API +master.api.user=master +master.api.password=commander +# Language configuration (e.g.: en_US, sk) +locale = sk +# credentials for Master REST API +master.api.user=master diff --git a/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/.keystore b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/.keystore new file mode 100644 index 0000000000..76ae4f9093 Binary files /dev/null and b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/.keystore differ diff --git a/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/Catalina/localhost/master.xml b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/Catalina/localhost/master.xml new file mode 100644 index 0000000000..54cd7d95fb --- /dev/null +++ b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/Catalina/localhost/master.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/Catalina/localhost/unifiedviews.xml b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/Catalina/localhost/unifiedviews.xml new file mode 100644 index 0000000000..ece0220cdd --- /dev/null +++ b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/Catalina/localhost/unifiedviews.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/catalina.properties b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/catalina.properties new file mode 100644 index 0000000000..9352339ac9 --- /dev/null +++ b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/catalina.properties @@ -0,0 +1,120 @@ +# 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. + +# +# List of comma-separated packages that start with or equal this string +# will cause a security exception to be thrown when +# passed to checkPackageAccess unless the +# corresponding RuntimePermission ("accessClassInPackage."+package) has +# been granted. +package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper. +# +# List of comma-separated packages that start with or equal this string +# will cause a security exception to be thrown when +# passed to checkPackageDefinition unless the +# corresponding RuntimePermission ("defineClassInPackage."+package) has +# been granted. +# +# by default, no packages are restricted for definition, and none of +# the class loaders supplied with the JDK call checkPackageDefinition. +# +package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper. + +# +# +# List of comma-separated paths defining the contents of the "common" +# classloader. Prefixes should be used to define what is the repository type. +# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute. +# If left as blank,the JVM system loader will be used as Catalina's "common" +# loader. +# Examples: +# "foo": Add this folder as a class repository +# "foo/*.jar": Add all the JARs of the specified folder as class +# repositories +# "foo/bar.jar": Add bar.jar as a class repository +common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,/var/lib/tomcat7/common/classes,/var/lib/tomcat7/common/*.jar + +# +# List of comma-separated paths defining the contents of the "server" +# classloader. Prefixes should be used to define what is the repository type. +# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute. +# If left as blank, the "common" loader will be used as Catalina's "server" +# loader. +# Examples: +# "foo": Add this folder as a class repository +# "foo/*.jar": Add all the JARs of the specified folder as class +# repositories +# "foo/bar.jar": Add bar.jar as a class repository +server.loader=/var/lib/tomcat7/server/classes,/var/lib/tomcat7/server/*.jar + +# +# List of comma-separated paths defining the contents of the "shared" +# classloader. Prefixes should be used to define what is the repository type. +# Path may be relative to the CATALINA_BASE path or absolute. If left as blank, +# the "common" loader will be used as Catalina's "shared" loader. +# Examples: +# "foo": Add this folder as a class repository +# "foo/*.jar": Add all the JARs of the specified folder as class +# repositories +# "foo/bar.jar": Add bar.jar as a class repository +# Please note that for single jars, e.g. bar.jar, you need the URL form +# starting with file:. +shared.loader=/var/lib/tomcat7/shared/classes,/var/lib/tomcat7/shared/*.jar + +# List of JAR files that should not be scanned for configuration information +# such as web fragments, TLD files etc. It must be a comma separated list of +# JAR file names. +# The JARs listed below include: +# - Tomcat Bootstrap JARs +# - Tomcat API JARs +# - Catalina JARs +# - Jasper JARs +# - Tomcat JARs +# - Common non-Tomcat JARs +# - Sun JDK JARs +# - Apple JDK JARs +tomcat.util.scan.DefaultJarScanner.jarsToSkip=\ +bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,\ +annotations-api.jar,el-api.jar,jsp-api.jar,servlet-api.jar,\ +catalina.jar,catalina-ant.jar,catalina-ha.jar,catalina-tribes.jar,\ +jasper.jar,jasper-el.jar,ecj-*.jar,\ +tomcat-api.jar,tomcat-util.jar,tomcat-coyote.jar,tomcat-dbcp.jar,\ +tomcat-jni.jar,tomcat-spdy.jar,\ +tomcat-i18n-en.jar,tomcat-i18n-es.jar,tomcat-i18n-fr.jar,tomcat-i18n-ja.jar,\ +tomcat-juli-adapters.jar,catalina-jmx-remote.jar,catalina-ws.jar,\ +tomcat-jdbc.jar,\ +commons-beanutils*.jar,commons-codec*.jar,commons-collections*.jar,\ +commons-dbcp*.jar,commons-digester*.jar,commons-fileupload*.jar,\ +commons-httpclient*.jar,commons-io*.jar,commons-lang*.jar,commons-logging*.jar,\ +commons-math*.jar,commons-pool*.jar,\ +jstl.jar,\ +geronimo-spec-jaxrpc*.jar,wsdl4j*.jar,\ +ant.jar,ant-junit*.jar,aspectj*.jar,jmx.jar,h2*.jar,hibernate*.jar,httpclient*.jar,\ +jmx-tools.jar,jta*.jar,log4j*.jar,mail*.jar,slf4j*.jar,\ +xercesImpl.jar,xmlParserAPIs.jar,xml-apis.jar,\ +dnsns.jar,ldapsec.jar,localedata.jar,sunjce_provider.jar,sunmscapi.jar,\ +sunpkcs11.jar,jhall.jar,tools.jar,\ +sunec.jar,zipfs.jar,\ +apple_provider.jar,AppleScriptEngine.jar,CoreAudio.jar,dns_sd.jar,\ +j3daudio.jar,j3dcore.jar,j3dutils.jar,jai_core.jar,jai_codec.jar,\ +mlibwrapper_jai.jar,MRJToolkit.jar,vecmath.jar,\ +junit.jar,junit-*.jar,ant-launcher.jar + +# +# String cache configuration. +tomcat.util.buf.StringCache.byte.enabled=true +#tomcat.util.buf.StringCache.char.enabled=true +#tomcat.util.buf.StringCache.trainThreshold=500000 +#tomcat.util.buf.StringCache.cacheSize=5000 diff --git a/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/context.xml b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/context.xml new file mode 100644 index 0000000000..745bf9537b --- /dev/null +++ b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/context.xml @@ -0,0 +1,35 @@ + + + + + + + WEB-INF/web.xml + + + + + + + + \ No newline at end of file diff --git a/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/logging.properties b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/logging.properties new file mode 100644 index 0000000000..6eeb1814b0 --- /dev/null +++ b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/logging.properties @@ -0,0 +1,49 @@ +# 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. + +handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler + +.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler + +############################################################ +# Handler specific properties. +# Describes specific configuration info for Handlers. +############################################################ + +1catalina.org.apache.juli.FileHandler.level = FINE +1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs +1catalina.org.apache.juli.FileHandler.prefix = catalina. + +2localhost.org.apache.juli.FileHandler.level = FINE +2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs +2localhost.org.apache.juli.FileHandler.prefix = localhost. + +java.util.logging.ConsoleHandler.level = FINE +java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter + +############################################################ +# Facility specific properties. +# Provides extra control for each logger. +############################################################ + +org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO +org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler + +# For example, set the com.xyz.foo logger to only log SEVERE +# messages: +#org.apache.catalina.startup.ContextConfig.level = FINE +#org.apache.catalina.startup.HostConfig.level = FINE +#org.apache.catalina.session.ManagerBase.level = FINE +#org.apache.catalina.core.AprLifecycleListener.level=FINE diff --git a/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/policy.d/01system.policy b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/policy.d/01system.policy new file mode 100644 index 0000000000..8e02c821be --- /dev/null +++ b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/policy.d/01system.policy @@ -0,0 +1,52 @@ +// 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. + +// ============================================================================ +// catalina.corepolicy - Security Policy Permissions for Tomcat 6 +// +// This file contains a default set of security policies to be enforced (by the +// JVM) when Catalina is executed with the "-security" option. In addition +// to the permissions granted here, the following additional permissions are +// granted to the codebase specific to each web application: +// +// * Read access to the document root directory +// +// $Id: catalina.policy 609294 2008-01-06 11:43:46Z markt $ +// ============================================================================ + + +// ========== SYSTEM CODE PERMISSIONS ========================================= + + +// These permissions apply to javac +grant codeBase "file:${java.home}/lib/-" { + permission java.security.AllPermission; +}; + +// These permissions apply to all shared system extensions +grant codeBase "file:${java.home}/jre/lib/ext/-" { + permission java.security.AllPermission; +}; + +// These permissions apply to javac when ${java.home] points at $JAVA_HOME/jre +grant codeBase "file:${java.home}/../lib/-" { + permission java.security.AllPermission; +}; + +// These permissions apply to all shared system extensions when +// ${java.home} points at $JAVA_HOME/jre +grant codeBase "file:${java.home}/lib/ext/-" { + permission java.security.AllPermission; +}; diff --git a/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/policy.d/02debian.policy b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/policy.d/02debian.policy new file mode 100644 index 0000000000..582c47c1c7 --- /dev/null +++ b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/policy.d/02debian.policy @@ -0,0 +1,10 @@ +// These permissions apply to all JARs from Debian packages +grant codeBase "file:/usr/share/java/-" { + permission java.security.AllPermission; +}; +grant codeBase "file:/usr/share/maven-repo/-" { + permission java.security.AllPermission; +}; +grant codeBase "file:/usr/share/ant/lib/-" { + permission java.security.AllPermission; +}; diff --git a/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/policy.d/03catalina.policy b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/policy.d/03catalina.policy new file mode 100644 index 0000000000..2de15182a3 --- /dev/null +++ b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/policy.d/03catalina.policy @@ -0,0 +1,32 @@ +// ========== CATALINA CODE PERMISSIONS ======================================= + + +// These permissions apply to the logging API +grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" { + permission java.util.PropertyPermission "java.util.logging.config.class", "read"; + permission java.util.PropertyPermission "java.util.logging.config.file", "read"; + permission java.lang.RuntimePermission "shutdownHooks"; + permission java.io.FilePermission "${catalina.base}${file.separator}conf${file.separator}logging.properties", "read"; + permission java.util.PropertyPermission "catalina.base", "read"; + permission java.util.logging.LoggingPermission "control"; + permission java.io.FilePermission "${catalina.base}${file.separator}logs", "read, write"; + permission java.io.FilePermission "${catalina.base}${file.separator}logs${file.separator}*", "read, write"; + permission java.lang.RuntimePermission "getClassLoader"; + permission java.lang.RuntimePermission "setContextClassLoader"; + // To enable per context logging configuration, permit read access to the appropriate file. + // Be sure that the logging configuration is secure before enabling such access + // eg for the examples web application: + // permission java.io.FilePermission "${catalina.base}${file.separator}webapps${file.separator}examples${file.separator}WEB-INF${file.separator}classes${file.separator}logging.properties", "read"; +}; + +// These permissions apply to the server startup code +grant codeBase "file:${catalina.home}/bin/bootstrap.jar" { + permission java.security.AllPermission; +}; + +// These permissions apply to the servlet API classes +// and those that are shared across all class loaders +// located in the "lib" directory +grant codeBase "file:${catalina.home}/lib/-" { + permission java.security.AllPermission; +}; diff --git a/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/policy.d/04webapps.policy b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/policy.d/04webapps.policy new file mode 100644 index 0000000000..74af20de66 --- /dev/null +++ b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/policy.d/04webapps.policy @@ -0,0 +1,59 @@ +// ========== WEB APPLICATION PERMISSIONS ===================================== + + +// These permissions are granted by default to all web applications +// In addition, a web application will be given a read FilePermission +// and JndiPermission for all files and directories in its document root. +grant { + // Required for JNDI lookup of named JDBC DataSource's and + // javamail named MimePart DataSource used to send mail + permission java.util.PropertyPermission "java.home", "read"; + permission java.util.PropertyPermission "java.naming.*", "read"; + permission java.util.PropertyPermission "javax.sql.*", "read"; + + // OS Specific properties to allow read access + permission java.util.PropertyPermission "os.name", "read"; + permission java.util.PropertyPermission "os.version", "read"; + permission java.util.PropertyPermission "os.arch", "read"; + permission java.util.PropertyPermission "file.separator", "read"; + permission java.util.PropertyPermission "path.separator", "read"; + permission java.util.PropertyPermission "line.separator", "read"; + + // JVM properties to allow read access + permission java.util.PropertyPermission "java.version", "read"; + permission java.util.PropertyPermission "java.vendor", "read"; + permission java.util.PropertyPermission "java.vendor.url", "read"; + permission java.util.PropertyPermission "java.class.version", "read"; + permission java.util.PropertyPermission "java.specification.version", "read"; + permission java.util.PropertyPermission "java.specification.vendor", "read"; + permission java.util.PropertyPermission "java.specification.name", "read"; + + permission java.util.PropertyPermission "java.vm.specification.version", "read"; + permission java.util.PropertyPermission "java.vm.specification.vendor", "read"; + permission java.util.PropertyPermission "java.vm.specification.name", "read"; + permission java.util.PropertyPermission "java.vm.version", "read"; + permission java.util.PropertyPermission "java.vm.vendor", "read"; + permission java.util.PropertyPermission "java.vm.name", "read"; + + // Required for OpenJMX + permission java.lang.RuntimePermission "getAttribute"; + + // Allow read of JAXP compliant XML parser debug + permission java.util.PropertyPermission "jaxp.debug", "read"; + + // Precompiled JSPs need access to this package. + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime.*"; + + // Example JSPs need those to work properly + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.el"; + permission java.lang.RuntimePermission "accessDeclaredMembers"; + + // Precompiled JSPs need access to this system property. + permission java.util.PropertyPermission "org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER", "read"; + + // java.io.tmpdir should be usable as a temporary file directory + permission java.util.PropertyPermission "java.io.tmpdir", "read"; + permission java.io.FilePermission "${java.io.tmpdir}/-", "read,write,delete"; + +}; diff --git a/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/policy.d/50local.policy b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/policy.d/50local.policy new file mode 100644 index 0000000000..3f15a8d209 --- /dev/null +++ b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/policy.d/50local.policy @@ -0,0 +1,32 @@ +// You can assign additional permissions to particular web applications by +// adding additional "grant" entries here, based on the code base for that +// application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files. +// +// Different permissions can be granted to JSP pages, classes loaded from +// the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/ +// directory, or even to individual jar files in the /WEB-INF/lib/ directory. +// +// For instance, assume that the standard "examples" application +// included a JDBC driver that needed to establish a network connection to the +// corresponding database and used the scrape taglib to get the weather from +// the NOAA web server. You might create a "grant" entries like this: +// +// The permissions granted to the context root directory apply to JSP pages. +// grant codeBase "file:${catalina.base}/webapps/examples/-" { +// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect"; +// permission java.net.SocketPermission "*.noaa.gov:80", "connect"; +// }; +// +// The permissions granted to the context WEB-INF/classes directory +// grant codeBase "file:${catalina.base}/webapps/examples/WEB-INF/classes/-" { +// }; +// +// The permission granted to your JDBC driver +// grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/driver.jar!/-" { +// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect"; +// }; +// The permission granted to the scrape taglib +// grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/scrape.jar!/-" { +// permission java.net.SocketPermission "*.noaa.gov:80", "connect"; +// }; + diff --git a/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/server.xml b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/server.xml new file mode 100644 index 0000000000..601e5dcb33 --- /dev/null +++ b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/server.xml @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/tomcat-users.xml b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/tomcat-users.xml new file mode 100644 index 0000000000..7f022ffa44 --- /dev/null +++ b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/tomcat-users.xml @@ -0,0 +1,36 @@ + + + + + + + diff --git a/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/web.xml b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/web.xml new file mode 100644 index 0000000000..cc8383cbf4 --- /dev/null +++ b/debian/unifiedviews-webapp-shared/src/deb/etc/unifiedviews/tomcat/web.xml @@ -0,0 +1,4283 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + default + org.apache.catalina.servlets.DefaultServlet + + debug + 0 + + + listings + false + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + jsp + org.apache.jasper.servlet.JspServlet + + fork + false + + + xpoweredBy + false + + 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + default + / + + + + + jsp + *.jsp + *.jspx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 30 + + + + + + + + + + + + 123 + application/vnd.lotus-1-2-3 + + + 3dml + text/vnd.in3d.3dml + + + 3g2 + video/3gpp2 + + + 3gp + video/3gpp + + + 7z + application/x-7z-compressed + + + aab + application/x-authorware-bin + + + aac + audio/x-aac + + + aam + application/x-authorware-map + + + aas + application/x-authorware-seg + + + abs + audio/x-mpeg + + + abw + application/x-abiword + + + ac + application/pkix-attr-cert + + + acc + application/vnd.americandynamics.acc + + + ace + application/x-ace-compressed + + + acu + application/vnd.acucobol + + + acutc + application/vnd.acucorp + + + adp + audio/adpcm + + + aep + application/vnd.audiograph + + + afm + application/x-font-type1 + + + afp + application/vnd.ibm.modcap + + + ahead + application/vnd.ahead.space + + + ai + application/postscript + + + aif + audio/x-aiff + + + aifc + audio/x-aiff + + + aiff + audio/x-aiff + + + aim + application/x-aim + + + air + application/vnd.adobe.air-application-installer-package+zip + + + ait + application/vnd.dvb.ait + + + ami + application/vnd.amiga.ami + + + anx + application/annodex + + + apk + application/vnd.android.package-archive + + + application + application/x-ms-application + + + apr + application/vnd.lotus-approach + + + art + image/x-jg + + + asc + application/pgp-signature + + + asf + video/x-ms-asf + + + asm + text/x-asm + + + aso + application/vnd.accpac.simply.aso + + + asx + video/x-ms-asf + + + atc + application/vnd.acucorp + + + atom + application/atom+xml + + + atomcat + application/atomcat+xml + + + atomsvc + application/atomsvc+xml + + + atx + application/vnd.antix.game-component + + + au + audio/basic + + + avi + video/x-msvideo + + + avx + video/x-rad-screenplay + + + aw + application/applixware + + + axa + audio/annodex + + + axv + video/annodex + + + azf + application/vnd.airzip.filesecure.azf + + + azs + application/vnd.airzip.filesecure.azs + + + azw + application/vnd.amazon.ebook + + + bat + application/x-msdownload + + + bcpio + application/x-bcpio + + + bdf + application/x-font-bdf + + + bdm + application/vnd.syncml.dm+wbxml + + + bed + application/vnd.realvnc.bed + + + bh2 + application/vnd.fujitsu.oasysprs + + + bin + application/octet-stream + + + bmi + application/vnd.bmi + + + bmp + image/bmp + + + body + text/html + + + book + application/vnd.framemaker + + + box + application/vnd.previewsystems.box + + + boz + application/x-bzip2 + + + bpk + application/octet-stream + + + btif + image/prs.btif + + + bz + application/x-bzip + + + bz2 + application/x-bzip2 + + + c + text/x-c + + + c11amc + application/vnd.cluetrust.cartomobile-config + + + c11amz + application/vnd.cluetrust.cartomobile-config-pkg + + + c4d + application/vnd.clonk.c4group + + + c4f + application/vnd.clonk.c4group + + + c4g + application/vnd.clonk.c4group + + + c4p + application/vnd.clonk.c4group + + + c4u + application/vnd.clonk.c4group + + + cab + application/vnd.ms-cab-compressed + + + cap + application/vnd.tcpdump.pcap + + + car + application/vnd.curl.car + + + cat + application/vnd.ms-pki.seccat + + + cc + text/x-c + + + cct + application/x-director + + + ccxml + application/ccxml+xml + + + cdbcmsg + application/vnd.contact.cmsg + + + cdf + application/x-cdf + + + cdkey + application/vnd.mediastation.cdkey + + + cdmia + application/cdmi-capability + + + cdmic + application/cdmi-container + + + cdmid + application/cdmi-domain + + + cdmio + application/cdmi-object + + + cdmiq + application/cdmi-queue + + + cdx + chemical/x-cdx + + + cdxml + application/vnd.chemdraw+xml + + + cdy + application/vnd.cinderella + + + cer + application/pkix-cert + + + cgm + image/cgm + + + chat + application/x-chat + + + chm + application/vnd.ms-htmlhelp + + + chrt + application/vnd.kde.kchart + + + cif + chemical/x-cif + + + cii + application/vnd.anser-web-certificate-issue-initiation + + + cil + application/vnd.ms-artgalry + + + cla + application/vnd.claymore + + + class + application/java + + + clkk + application/vnd.crick.clicker.keyboard + + + clkp + application/vnd.crick.clicker.palette + + + clkt + application/vnd.crick.clicker.template + + + clkw + application/vnd.crick.clicker.wordbank + + + clkx + application/vnd.crick.clicker + + + clp + application/x-msclip + + + cmc + application/vnd.cosmocaller + + + cmdf + chemical/x-cmdf + + + cml + chemical/x-cml + + + cmp + application/vnd.yellowriver-custom-menu + + + cmx + image/x-cmx + + + cod + application/vnd.rim.cod + + + com + application/x-msdownload + + + conf + text/plain + + + cpio + application/x-cpio + + + cpp + text/x-c + + + cpt + application/mac-compactpro + + + crd + application/x-mscardfile + + + crl + application/pkix-crl + + + crt + application/x-x509-ca-cert + + + cryptonote + application/vnd.rig.cryptonote + + + csh + application/x-csh + + + csml + chemical/x-csml + + + csp + application/vnd.commonspace + + + css + text/css + + + cst + application/x-director + + + csv + text/csv + + + cu + application/cu-seeme + + + curl + text/vnd.curl + + + cww + application/prs.cww + + + cxt + application/x-director + + + cxx + text/x-c + + + dae + model/vnd.collada+xml + + + daf + application/vnd.mobius.daf + + + dataless + application/vnd.fdsn.seed + + + davmount + application/davmount+xml + + + dcr + application/x-director + + + dcurl + text/vnd.curl.dcurl + + + dd2 + application/vnd.oma.dd2+xml + + + ddd + application/vnd.fujixerox.ddd + + + deb + application/x-debian-package + + + def + text/plain + + + deploy + application/octet-stream + + + der + application/x-x509-ca-cert + + + dfac + application/vnd.dreamfactory + + + dib + image/bmp + + + dic + text/x-c + + + dir + application/x-director + + + dis + application/vnd.mobius.dis + + + dist + application/octet-stream + + + distz + application/octet-stream + + + djv + image/vnd.djvu + + + djvu + image/vnd.djvu + + + dll + application/x-msdownload + + + dmg + application/octet-stream + + + dmp + application/vnd.tcpdump.pcap + + + dms + application/octet-stream + + + dna + application/vnd.dna + + + doc + application/msword + + + docm + application/vnd.ms-word.document.macroenabled.12 + + + docx + application/vnd.openxmlformats-officedocument.wordprocessingml.document + + + dot + application/msword + + + dotm + application/vnd.ms-word.template.macroenabled.12 + + + dotx + application/vnd.openxmlformats-officedocument.wordprocessingml.template + + + dp + application/vnd.osgi.dp + + + dpg + application/vnd.dpgraph + + + dra + audio/vnd.dra + + + dsc + text/prs.lines.tag + + + dssc + application/dssc+der + + + dtb + application/x-dtbook+xml + + + dtd + application/xml-dtd + + + dts + audio/vnd.dts + + + dtshd + audio/vnd.dts.hd + + + dump + application/octet-stream + + + dv + video/x-dv + + + dvb + video/vnd.dvb.file + + + dvi + application/x-dvi + + + dwf + model/vnd.dwf + + + dwg + image/vnd.dwg + + + dxf + image/vnd.dxf + + + dxp + application/vnd.spotfire.dxp + + + dxr + application/x-director + + + ecelp4800 + audio/vnd.nuera.ecelp4800 + + + ecelp7470 + audio/vnd.nuera.ecelp7470 + + + ecelp9600 + audio/vnd.nuera.ecelp9600 + + + ecma + application/ecmascript + + + edm + application/vnd.novadigm.edm + + + edx + application/vnd.novadigm.edx + + + efif + application/vnd.picsel + + + ei6 + application/vnd.pg.osasli + + + elc + application/octet-stream + + + eml + message/rfc822 + + + emma + application/emma+xml + + + eol + audio/vnd.digital-winds + + + eot + application/vnd.ms-fontobject + + + eps + application/postscript + + + epub + application/epub+zip + + + es3 + application/vnd.eszigno3+xml + + + esf + application/vnd.epson.esf + + + et3 + application/vnd.eszigno3+xml + + + etx + text/x-setext + + + exe + application/octet-stream + + + exi + application/exi + + + ext + application/vnd.novadigm.ext + + + ez + application/andrew-inset + + + ez2 + application/vnd.ezpix-album + + + ez3 + application/vnd.ezpix-package + + + f + text/x-fortran + + + f4v + video/x-f4v + + + f77 + text/x-fortran + + + f90 + text/x-fortran + + + fbs + image/vnd.fastbidsheet + + + fcs + application/vnd.isac.fcs + + + fdf + application/vnd.fdf + + + fe_launch + application/vnd.denovo.fcselayout-link + + + fg5 + application/vnd.fujitsu.oasysgp + + + fgd + application/x-director + + + fh + image/x-freehand + + + fh4 + image/x-freehand + + + fh5 + image/x-freehand + + + fh7 + image/x-freehand + + + fhc + image/x-freehand + + + fig + application/x-xfig + + + flac + audio/flac + + + fli + video/x-fli + + + flo + application/vnd.micrografx.flo + + + flv + video/x-flv + + + flw + application/vnd.kde.kivio + + + flx + text/vnd.fmi.flexstor + + + fly + text/vnd.fly + + + fm + application/vnd.framemaker + + + fnc + application/vnd.frogans.fnc + + + for + text/x-fortran + + + fpx + image/vnd.fpx + + + frame + application/vnd.framemaker + + + fsc + application/vnd.fsc.weblaunch + + + fst + image/vnd.fst + + + ftc + application/vnd.fluxtime.clip + + + fti + application/vnd.anser-web-funds-transfer-initiation + + + fvt + video/vnd.fvt + + + fxp + application/vnd.adobe.fxp + + + fxpl + application/vnd.adobe.fxp + + + fzs + application/vnd.fuzzysheet + + + g2w + application/vnd.geoplan + + + g3 + image/g3fax + + + g3w + application/vnd.geospace + + + gac + application/vnd.groove-account + + + gbr + application/rpki-ghostbusters + + + gdl + model/vnd.gdl + + + geo + application/vnd.dynageo + + + gex + application/vnd.geometry-explorer + + + ggb + application/vnd.geogebra.file + + + ggt + application/vnd.geogebra.tool + + + ghf + application/vnd.groove-help + + + gif + image/gif + + + gim + application/vnd.groove-identity-message + + + gmx + application/vnd.gmx + + + gnumeric + application/x-gnumeric + + + gph + application/vnd.flographit + + + gqf + application/vnd.grafeq + + + gqs + application/vnd.grafeq + + + gram + application/srgs + + + gre + application/vnd.geometry-explorer + + + grv + application/vnd.groove-injector + + + grxml + application/srgs+xml + + + gsf + application/x-font-ghostscript + + + gtar + application/x-gtar + + + gtm + application/vnd.groove-tool-message + + + gtw + model/vnd.gtw + + + gv + text/vnd.graphviz + + + gxt + application/vnd.geonext + + + gz + application/x-gzip + + + h + text/x-c + + + h261 + video/h261 + + + h263 + video/h263 + + + h264 + video/h264 + + + hal + application/vnd.hal+xml + + + hbci + application/vnd.hbci + + + hdf + application/x-hdf + + + hh + text/x-c + + + hlp + application/winhlp + + + hpgl + application/vnd.hp-hpgl + + + hpid + application/vnd.hp-hpid + + + hps + application/vnd.hp-hps + + + hqx + application/mac-binhex40 + + + htc + text/x-component + + + htke + application/vnd.kenameaapp + + + htm + text/html + + + html + text/html + + + hvd + application/vnd.yamaha.hv-dic + + + hvp + application/vnd.yamaha.hv-voice + + + hvs + application/vnd.yamaha.hv-script + + + i2g + application/vnd.intergeo + + + icc + application/vnd.iccprofile + + + ice + x-conference/x-cooltalk + + + icm + application/vnd.iccprofile + + + ico + image/x-icon + + + ics + text/calendar + + + ief + image/ief + + + ifb + text/calendar + + + ifm + application/vnd.shana.informed.formdata + + + iges + model/iges + + + igl + application/vnd.igloader + + + igm + application/vnd.insors.igm + + + igs + model/iges + + + igx + application/vnd.micrografx.igx + + + iif + application/vnd.shana.informed.interchange + + + imp + application/vnd.accpac.simply.imp + + + ims + application/vnd.ms-ims + + + in + text/plain + + + ink + application/inkml+xml + + + inkml + application/inkml+xml + + + iota + application/vnd.astraea-software.iota + + + ipfix + application/ipfix + + + ipk + application/vnd.shana.informed.package + + + irm + application/vnd.ibm.rights-management + + + irp + application/vnd.irepository.package+xml + + + iso + application/octet-stream + + + itp + application/vnd.shana.informed.formtemplate + + + ivp + application/vnd.immervision-ivp + + + ivu + application/vnd.immervision-ivu + + + jad + text/vnd.sun.j2me.app-descriptor + + + jam + application/vnd.jam + + + jar + application/java-archive + + + java + text/x-java-source + + + jisp + application/vnd.jisp + + + jlt + application/vnd.hp-jlyt + + + jnlp + application/x-java-jnlp-file + + + joda + application/vnd.joost.joda-archive + + + jpe + image/jpeg + + + jpeg + image/jpeg + + + jpg + image/jpeg + + + jpgm + video/jpm + + + jpgv + video/jpeg + + + jpm + video/jpm + + + js + application/javascript + + + jsf + text/plain + + + json + application/json + + + jspf + text/plain + + + kar + audio/midi + + + karbon + application/vnd.kde.karbon + + + kfo + application/vnd.kde.kformula + + + kia + application/vnd.kidspiration + + + kml + application/vnd.google-earth.kml+xml + + + kmz + application/vnd.google-earth.kmz + + + kne + application/vnd.kinar + + + knp + application/vnd.kinar + + + kon + application/vnd.kde.kontour + + + kpr + application/vnd.kde.kpresenter + + + kpt + application/vnd.kde.kpresenter + + + ksp + application/vnd.kde.kspread + + + ktr + application/vnd.kahootz + + + ktx + image/ktx + + + ktz + application/vnd.kahootz + + + kwd + application/vnd.kde.kword + + + kwt + application/vnd.kde.kword + + + lasxml + application/vnd.las.las+xml + + + latex + application/x-latex + + + lbd + application/vnd.llamagraphics.life-balance.desktop + + + lbe + application/vnd.llamagraphics.life-balance.exchange+xml + + + les + application/vnd.hhe.lesson-player + + + lha + application/octet-stream + + + link66 + application/vnd.route66.link66+xml + + + list + text/plain + + + list3820 + application/vnd.ibm.modcap + + + listafp + application/vnd.ibm.modcap + + + log + text/plain + + + lostxml + application/lost+xml + + + lrf + application/octet-stream + + + lrm + application/vnd.ms-lrm + + + ltf + application/vnd.frogans.ltf + + + lvp + audio/vnd.lucent.voice + + + lwp + application/vnd.lotus-wordpro + + + lzh + application/octet-stream + + + m13 + application/x-msmediaview + + + m14 + application/x-msmediaview + + + m1v + video/mpeg + + + m21 + application/mp21 + + + m2a + audio/mpeg + + + m2v + video/mpeg + + + m3a + audio/mpeg + + + m3u + audio/x-mpegurl + + + m3u8 + application/vnd.apple.mpegurl + + + m4a + audio/mp4 + + + m4b + audio/mp4 + + + m4r + audio/mp4 + + + m4u + video/vnd.mpegurl + + + m4v + video/mp4 + + + ma + application/mathematica + + + mac + image/x-macpaint + + + mads + application/mads+xml + + + mag + application/vnd.ecowin.chart + + + maker + application/vnd.framemaker + + + man + text/troff + + + mathml + application/mathml+xml + + + mb + application/mathematica + + + mbk + application/vnd.mobius.mbk + + + mbox + application/mbox + + + mc1 + application/vnd.medcalcdata + + + mcd + application/vnd.mcd + + + mcurl + text/vnd.curl.mcurl + + + mdb + application/x-msaccess + + + mdi + image/vnd.ms-modi + + + me + text/troff + + + mesh + model/mesh + + + meta4 + application/metalink4+xml + + + mets + application/mets+xml + + + mfm + application/vnd.mfmp + + + mft + application/rpki-manifest + + + mgp + application/vnd.osgeo.mapguide.package + + + mgz + application/vnd.proteus.magazine + + + mid + audio/midi + + + midi + audio/midi + + + mif + application/x-mif + + + mime + message/rfc822 + + + mj2 + video/mj2 + + + mjp2 + video/mj2 + + + mlp + application/vnd.dolby.mlp + + + mmd + application/vnd.chipnuts.karaoke-mmd + + + mmf + application/vnd.smaf + + + mmr + image/vnd.fujixerox.edmics-mmr + + + mny + application/x-msmoney + + + mobi + application/x-mobipocket-ebook + + + mods + application/mods+xml + + + mov + video/quicktime + + + movie + video/x-sgi-movie + + + mp1 + audio/mpeg + + + mp2 + audio/mpeg + + + mp21 + application/mp21 + + + mp2a + audio/mpeg + + + mp3 + audio/mpeg + + + mp4 + video/mp4 + + + mp4a + audio/mp4 + + + mp4s + application/mp4 + + + mp4v + video/mp4 + + + mpa + audio/mpeg + + + mpc + application/vnd.mophun.certificate + + + mpe + video/mpeg + + + mpeg + video/mpeg + + + mpega + audio/x-mpeg + + + mpg + video/mpeg + + + mpg4 + video/mp4 + + + mpga + audio/mpeg + + + mpkg + application/vnd.apple.installer+xml + + + mpm + application/vnd.blueice.multipass + + + mpn + application/vnd.mophun.application + + + mpp + application/vnd.ms-project + + + mpt + application/vnd.ms-project + + + mpv2 + video/mpeg2 + + + mpy + application/vnd.ibm.minipay + + + mqy + application/vnd.mobius.mqy + + + mrc + application/marc + + + mrcx + application/marcxml+xml + + + ms + text/troff + + + mscml + application/mediaservercontrol+xml + + + mseed + application/vnd.fdsn.mseed + + + mseq + application/vnd.mseq + + + msf + application/vnd.epson.msf + + + msh + model/mesh + + + msi + application/x-msdownload + + + msl + application/vnd.mobius.msl + + + msty + application/vnd.muvee.style + + + mts + model/vnd.mts + + + mus + application/vnd.musician + + + musicxml + application/vnd.recordare.musicxml+xml + + + mvb + application/x-msmediaview + + + mwf + application/vnd.mfer + + + mxf + application/mxf + + + mxl + application/vnd.recordare.musicxml + + + mxml + application/xv+xml + + + mxs + application/vnd.triscape.mxs + + + mxu + video/vnd.mpegurl + + + n-gage + application/vnd.nokia.n-gage.symbian.install + + + n3 + text/n3 + + + nb + application/mathematica + + + nbp + application/vnd.wolfram.player + + + nc + application/x-netcdf + + + ncx + application/x-dtbncx+xml + + + ngdat + application/vnd.nokia.n-gage.data + + + nlu + application/vnd.neurolanguage.nlu + + + nml + application/vnd.enliven + + + nnd + application/vnd.noblenet-directory + + + nns + application/vnd.noblenet-sealer + + + nnw + application/vnd.noblenet-web + + + npx + image/vnd.net-fpx + + + nsf + application/vnd.lotus-notes + + + oa2 + application/vnd.fujitsu.oasys2 + + + oa3 + application/vnd.fujitsu.oasys3 + + + oas + application/vnd.fujitsu.oasys + + + obd + application/x-msbinder + + + oda + application/oda + + + + odb + application/vnd.oasis.opendocument.database + + + + odc + application/vnd.oasis.opendocument.chart + + + + odf + application/vnd.oasis.opendocument.formula + + + odft + application/vnd.oasis.opendocument.formula-template + + + + odg + application/vnd.oasis.opendocument.graphics + + + + odi + application/vnd.oasis.opendocument.image + + + + odm + application/vnd.oasis.opendocument.text-master + + + + odp + application/vnd.oasis.opendocument.presentation + + + + ods + application/vnd.oasis.opendocument.spreadsheet + + + + odt + application/vnd.oasis.opendocument.text + + + oga + audio/ogg + + + ogg + audio/ogg + + + ogv + video/ogg + + + + ogx + application/ogg + + + onepkg + application/onenote + + + onetmp + application/onenote + + + onetoc + application/onenote + + + onetoc2 + application/onenote + + + opf + application/oebps-package+xml + + + oprc + application/vnd.palm + + + org + application/vnd.lotus-organizer + + + osf + application/vnd.yamaha.openscoreformat + + + osfpvg + application/vnd.yamaha.openscoreformat.osfpvg+xml + + + otc + application/vnd.oasis.opendocument.chart-template + + + otf + application/x-font-otf + + + + otg + application/vnd.oasis.opendocument.graphics-template + + + + oth + application/vnd.oasis.opendocument.text-web + + + oti + application/vnd.oasis.opendocument.image-template + + + + otp + application/vnd.oasis.opendocument.presentation-template + + + + ots + application/vnd.oasis.opendocument.spreadsheet-template + + + + ott + application/vnd.oasis.opendocument.text-template + + + oxps + application/oxps + + + oxt + application/vnd.openofficeorg.extension + + + p + text/x-pascal + + + p10 + application/pkcs10 + + + p12 + application/x-pkcs12 + + + p7b + application/x-pkcs7-certificates + + + p7c + application/pkcs7-mime + + + p7m + application/pkcs7-mime + + + p7r + application/x-pkcs7-certreqresp + + + p7s + application/pkcs7-signature + + + p8 + application/pkcs8 + + + pas + text/x-pascal + + + paw + application/vnd.pawaafile + + + pbd + application/vnd.powerbuilder6 + + + pbm + image/x-portable-bitmap + + + pcap + application/vnd.tcpdump.pcap + + + pcf + application/x-font-pcf + + + pcl + application/vnd.hp-pcl + + + pclxl + application/vnd.hp-pclxl + + + pct + image/pict + + + pcurl + application/vnd.curl.pcurl + + + pcx + image/x-pcx + + + pdb + application/vnd.palm + + + pdf + application/pdf + + + pfa + application/x-font-type1 + + + pfb + application/x-font-type1 + + + pfm + application/x-font-type1 + + + pfr + application/font-tdpfr + + + pfx + application/x-pkcs12 + + + pgm + image/x-portable-graymap + + + pgn + application/x-chess-pgn + + + pgp + application/pgp-encrypted + + + pic + image/pict + + + pict + image/pict + + + pkg + application/octet-stream + + + pki + application/pkixcmp + + + pkipath + application/pkix-pkipath + + + plb + application/vnd.3gpp.pic-bw-large + + + plc + application/vnd.mobius.plc + + + plf + application/vnd.pocketlearn + + + pls + audio/x-scpls + + + pml + application/vnd.ctc-posml + + + png + image/png + + + pnm + image/x-portable-anymap + + + pnt + image/x-macpaint + + + portpkg + application/vnd.macports.portpkg + + + pot + application/vnd.ms-powerpoint + + + potm + application/vnd.ms-powerpoint.template.macroenabled.12 + + + potx + application/vnd.openxmlformats-officedocument.presentationml.template + + + ppam + application/vnd.ms-powerpoint.addin.macroenabled.12 + + + ppd + application/vnd.cups-ppd + + + ppm + image/x-portable-pixmap + + + pps + application/vnd.ms-powerpoint + + + ppsm + application/vnd.ms-powerpoint.slideshow.macroenabled.12 + + + ppsx + application/vnd.openxmlformats-officedocument.presentationml.slideshow + + + ppt + application/vnd.ms-powerpoint + + + pptm + application/vnd.ms-powerpoint.presentation.macroenabled.12 + + + pptx + application/vnd.openxmlformats-officedocument.presentationml.presentation + + + pqa + application/vnd.palm + + + prc + application/x-mobipocket-ebook + + + pre + application/vnd.lotus-freelance + + + prf + application/pics-rules + + + ps + application/postscript + + + psb + application/vnd.3gpp.pic-bw-small + + + psd + image/vnd.adobe.photoshop + + + psf + application/x-font-linux-psf + + + pskcxml + application/pskc+xml + + + ptid + application/vnd.pvi.ptid1 + + + pub + application/x-mspublisher + + + pvb + application/vnd.3gpp.pic-bw-var + + + pwn + application/vnd.3m.post-it-notes + + + pya + audio/vnd.ms-playready.media.pya + + + pyv + video/vnd.ms-playready.media.pyv + + + qam + application/vnd.epson.quickanime + + + qbo + application/vnd.intu.qbo + + + qfx + application/vnd.intu.qfx + + + qps + application/vnd.publishare-delta-tree + + + qt + video/quicktime + + + qti + image/x-quicktime + + + qtif + image/x-quicktime + + + qwd + application/vnd.quark.quarkxpress + + + qwt + application/vnd.quark.quarkxpress + + + qxb + application/vnd.quark.quarkxpress + + + qxd + application/vnd.quark.quarkxpress + + + qxl + application/vnd.quark.quarkxpress + + + qxt + application/vnd.quark.quarkxpress + + + ra + audio/x-pn-realaudio + + + ram + audio/x-pn-realaudio + + + rar + application/x-rar-compressed + + + ras + image/x-cmu-raster + + + rcprofile + application/vnd.ipunplugged.rcprofile + + + rdf + application/rdf+xml + + + rdz + application/vnd.data-vision.rdz + + + rep + application/vnd.businessobjects + + + res + application/x-dtbresource+xml + + + rgb + image/x-rgb + + + rif + application/reginfo+xml + + + rip + audio/vnd.rip + + + rl + application/resource-lists+xml + + + rlc + image/vnd.fujixerox.edmics-rlc + + + rld + application/resource-lists-diff+xml + + + rm + application/vnd.rn-realmedia + + + rmi + audio/midi + + + rmp + audio/x-pn-realaudio-plugin + + + rms + application/vnd.jcp.javame.midlet-rms + + + rnc + application/relax-ng-compact-syntax + + + roa + application/rpki-roa + + + roff + text/troff + + + rp9 + application/vnd.cloanto.rp9 + + + rpss + application/vnd.nokia.radio-presets + + + rpst + application/vnd.nokia.radio-preset + + + rq + application/sparql-query + + + rs + application/rls-services+xml + + + rsd + application/rsd+xml + + + rss + application/rss+xml + + + rtf + application/rtf + + + rtx + text/richtext + + + s + text/x-asm + + + saf + application/vnd.yamaha.smaf-audio + + + sbml + application/sbml+xml + + + sc + application/vnd.ibm.secure-container + + + scd + application/x-msschedule + + + scm + application/vnd.lotus-screencam + + + scq + application/scvp-cv-request + + + scs + application/scvp-cv-response + + + scurl + text/vnd.curl.scurl + + + sda + application/vnd.stardivision.draw + + + sdc + application/vnd.stardivision.calc + + + sdd + application/vnd.stardivision.impress + + + sdkd + application/vnd.solent.sdkm+xml + + + sdkm + application/vnd.solent.sdkm+xml + + + sdp + application/sdp + + + sdw + application/vnd.stardivision.writer + + + see + application/vnd.seemail + + + seed + application/vnd.fdsn.seed + + + sema + application/vnd.sema + + + semd + application/vnd.semd + + + semf + application/vnd.semf + + + ser + application/java-serialized-object + + + setpay + application/set-payment-initiation + + + setreg + application/set-registration-initiation + + + sfd-hdstx + application/vnd.hydrostatix.sof-data + + + sfs + application/vnd.spotfire.sfs + + + sgl + application/vnd.stardivision.writer-global + + + sgm + text/sgml + + + sgml + text/sgml + + + sh + application/x-sh + + + shar + application/x-shar + + + shf + application/shf+xml + + + + sig + application/pgp-signature + + + silo + model/mesh + + + sis + application/vnd.symbian.install + + + sisx + application/vnd.symbian.install + + + sit + application/x-stuffit + + + sitx + application/x-stuffitx + + + skd + application/vnd.koan + + + skm + application/vnd.koan + + + skp + application/vnd.koan + + + skt + application/vnd.koan + + + sldm + application/vnd.ms-powerpoint.slide.macroenabled.12 + + + sldx + application/vnd.openxmlformats-officedocument.presentationml.slide + + + slt + application/vnd.epson.salt + + + sm + application/vnd.stepmania.stepchart + + + smf + application/vnd.stardivision.math + + + smi + application/smil+xml + + + smil + application/smil+xml + + + smzip + application/vnd.stepmania.package + + + snd + audio/basic + + + snf + application/x-font-snf + + + so + application/octet-stream + + + spc + application/x-pkcs7-certificates + + + spf + application/vnd.yamaha.smaf-phrase + + + spl + application/x-futuresplash + + + spot + text/vnd.in3d.spot + + + spp + application/scvp-vp-response + + + spq + application/scvp-vp-request + + + spx + audio/ogg + + + src + application/x-wais-source + + + sru + application/sru+xml + + + srx + application/sparql-results+xml + + + sse + application/vnd.kodak-descriptor + + + ssf + application/vnd.epson.ssf + + + ssml + application/ssml+xml + + + st + application/vnd.sailingtracker.track + + + stc + application/vnd.sun.xml.calc.template + + + std + application/vnd.sun.xml.draw.template + + + stf + application/vnd.wt.stf + + + sti + application/vnd.sun.xml.impress.template + + + stk + application/hyperstudio + + + stl + application/vnd.ms-pki.stl + + + str + application/vnd.pg.format + + + stw + application/vnd.sun.xml.writer.template + + + sub + text/vnd.dvb.subtitle + + + sus + application/vnd.sus-calendar + + + susp + application/vnd.sus-calendar + + + sv4cpio + application/x-sv4cpio + + + sv4crc + application/x-sv4crc + + + svc + application/vnd.dvb.service + + + svd + application/vnd.svd + + + svg + image/svg+xml + + + svgz + image/svg+xml + + + swa + application/x-director + + + swf + application/x-shockwave-flash + + + swi + application/vnd.aristanetworks.swi + + + sxc + application/vnd.sun.xml.calc + + + sxd + application/vnd.sun.xml.draw + + + sxg + application/vnd.sun.xml.writer.global + + + sxi + application/vnd.sun.xml.impress + + + sxm + application/vnd.sun.xml.math + + + sxw + application/vnd.sun.xml.writer + + + t + text/troff + + + taglet + application/vnd.mynfc + + + tao + application/vnd.tao.intent-module-archive + + + tar + application/x-tar + + + tcap + application/vnd.3gpp2.tcap + + + tcl + application/x-tcl + + + teacher + application/vnd.smart.teacher + + + tei + application/tei+xml + + + teicorpus + application/tei+xml + + + tex + application/x-tex + + + texi + application/x-texinfo + + + texinfo + application/x-texinfo + + + text + text/plain + + + tfi + application/thraud+xml + + + tfm + application/x-tex-tfm + + + thmx + application/vnd.ms-officetheme + + + tif + image/tiff + + + tiff + image/tiff + + + tmo + application/vnd.tmobile-livetv + + + torrent + application/x-bittorrent + + + tpl + application/vnd.groove-tool-template + + + tpt + application/vnd.trid.tpt + + + tr + text/troff + + + tra + application/vnd.trueapp + + + trm + application/x-msterminal + + + tsd + application/timestamped-data + + + tsv + text/tab-separated-values + + + ttc + application/x-font-ttf + + + ttf + application/x-font-ttf + + + ttl + text/turtle + + + twd + application/vnd.simtech-mindmapper + + + twds + application/vnd.simtech-mindmapper + + + txd + application/vnd.genomatix.tuxedo + + + txf + application/vnd.mobius.txf + + + txt + text/plain + + + u32 + application/x-authorware-bin + + + udeb + application/x-debian-package + + + ufd + application/vnd.ufdl + + + ufdl + application/vnd.ufdl + + + ulw + audio/basic + + + umj + application/vnd.umajin + + + unityweb + application/vnd.unity + + + uoml + application/vnd.uoml+xml + + + uri + text/uri-list + + + uris + text/uri-list + + + urls + text/uri-list + + + ustar + application/x-ustar + + + utz + application/vnd.uiq.theme + + + uu + text/x-uuencode + + + uva + audio/vnd.dece.audio + + + uvd + application/vnd.dece.data + + + uvf + application/vnd.dece.data + + + uvg + image/vnd.dece.graphic + + + uvh + video/vnd.dece.hd + + + uvi + image/vnd.dece.graphic + + + uvm + video/vnd.dece.mobile + + + uvp + video/vnd.dece.pd + + + uvs + video/vnd.dece.sd + + + uvt + application/vnd.dece.ttml+xml + + + uvu + video/vnd.uvvu.mp4 + + + uvv + video/vnd.dece.video + + + uvva + audio/vnd.dece.audio + + + uvvd + application/vnd.dece.data + + + uvvf + application/vnd.dece.data + + + uvvg + image/vnd.dece.graphic + + + uvvh + video/vnd.dece.hd + + + uvvi + image/vnd.dece.graphic + + + uvvm + video/vnd.dece.mobile + + + uvvp + video/vnd.dece.pd + + + uvvs + video/vnd.dece.sd + + + uvvt + application/vnd.dece.ttml+xml + + + uvvu + video/vnd.uvvu.mp4 + + + uvvv + video/vnd.dece.video + + + uvvx + application/vnd.dece.unspecified + + + uvvz + application/vnd.dece.zip + + + uvx + application/vnd.dece.unspecified + + + uvz + application/vnd.dece.zip + + + vcard + text/vcard + + + vcd + application/x-cdlink + + + vcf + text/x-vcard + + + vcg + application/vnd.groove-vcard + + + vcs + text/x-vcalendar + + + vcx + application/vnd.vcx + + + vis + application/vnd.visionary + + + viv + video/vnd.vivo + + + vor + application/vnd.stardivision.writer + + + vox + application/x-authorware-bin + + + vrml + model/vrml + + + vsd + application/vnd.visio + + + vsf + application/vnd.vsf + + + vss + application/vnd.visio + + + vst + application/vnd.visio + + + vsw + application/vnd.visio + + + vtu + model/vnd.vtu + + + vxml + application/voicexml+xml + + + w3d + application/x-director + + + wad + application/x-doom + + + wav + audio/x-wav + + + wax + audio/x-ms-wax + + + + wbmp + image/vnd.wap.wbmp + + + wbs + application/vnd.criticaltools.wbs+xml + + + wbxml + application/vnd.wap.wbxml + + + wcm + application/vnd.ms-works + + + wdb + application/vnd.ms-works + + + weba + audio/webm + + + webm + video/webm + + + webp + image/webp + + + wg + application/vnd.pmi.widget + + + wgt + application/widget + + + wks + application/vnd.ms-works + + + wm + video/x-ms-wm + + + wma + audio/x-ms-wma + + + wmd + application/x-ms-wmd + + + wmf + application/x-msmetafile + + + + wml + text/vnd.wap.wml + + + + wmlc + application/vnd.wap.wmlc + + + + wmls + text/vnd.wap.wmlscript + + + + wmlsc + application/vnd.wap.wmlscriptc + + + wmv + video/x-ms-wmv + + + wmx + video/x-ms-wmx + + + wmz + application/x-ms-wmz + + + woff + application/x-font-woff + + + wpd + application/vnd.wordperfect + + + wpl + application/vnd.ms-wpl + + + wps + application/vnd.ms-works + + + wqd + application/vnd.wqd + + + wri + application/x-mswrite + + + wrl + model/vrml + + + wsdl + application/wsdl+xml + + + wspolicy + application/wspolicy+xml + + + wtb + application/vnd.webturbo + + + wvx + video/x-ms-wvx + + + x32 + application/x-authorware-bin + + + x3d + application/vnd.hzn-3d-crossword + + + xap + application/x-silverlight-app + + + xar + application/vnd.xara + + + xbap + application/x-ms-xbap + + + xbd + application/vnd.fujixerox.docuworks.binder + + + xbm + image/x-xbitmap + + + xdf + application/xcap-diff+xml + + + xdm + application/vnd.syncml.dm+xml + + + xdp + application/vnd.adobe.xdp+xml + + + xdssc + application/dssc+xml + + + xdw + application/vnd.fujixerox.docuworks + + + xenc + application/xenc+xml + + + xer + application/patch-ops-error+xml + + + xfdf + application/vnd.adobe.xfdf + + + xfdl + application/vnd.xfdl + + + xht + application/xhtml+xml + + + xhtml + application/xhtml+xml + + + xhvml + application/xv+xml + + + xif + image/vnd.xiff + + + xla + application/vnd.ms-excel + + + xlam + application/vnd.ms-excel.addin.macroenabled.12 + + + xlc + application/vnd.ms-excel + + + xlm + application/vnd.ms-excel + + + xls + application/vnd.ms-excel + + + xlsb + application/vnd.ms-excel.sheet.binary.macroenabled.12 + + + xlsm + application/vnd.ms-excel.sheet.macroenabled.12 + + + xlsx + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + + + xlt + application/vnd.ms-excel + + + xltm + application/vnd.ms-excel.template.macroenabled.12 + + + xltx + application/vnd.openxmlformats-officedocument.spreadsheetml.template + + + xlw + application/vnd.ms-excel + + + xml + application/xml + + + xo + application/vnd.olpc-sugar + + + xop + application/xop+xml + + + xpi + application/x-xpinstall + + + xpm + image/x-xpixmap + + + xpr + application/vnd.is-xpr + + + xps + application/vnd.ms-xpsdocument + + + xpw + application/vnd.intercon.formnet + + + xpx + application/vnd.intercon.formnet + + + xsl + application/xml + + + xslt + application/xslt+xml + + + xsm + application/vnd.syncml+xml + + + xspf + application/xspf+xml + + + xul + application/vnd.mozilla.xul+xml + + + xvm + application/xv+xml + + + xvml + application/xv+xml + + + xwd + image/x-xwindowdump + + + xyz + chemical/x-xyz + + + yang + application/yang + + + yin + application/yin+xml + + + z + application/x-compress + + + Z + application/x-compress + + + zaz + application/vnd.zzazz.deck+xml + + + zip + application/zip + + + zir + application/vnd.zul + + + zirz + application/vnd.zul + + + zmm + application/vnd.handheld-entertainment+xml + + + + + + + + + + + + + + + + + + index.html + index.htm + index.jsp + + + diff --git a/debian/unifiedviews-webapp/pom.xml b/debian/unifiedviews-webapp/pom.xml new file mode 100644 index 0000000000..5407a50fef --- /dev/null +++ b/debian/unifiedviews-webapp/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + + eu.unifiedviews.packages + unifiedviews-packages + 2.2.0-SNAPSHOT + + + eu.unifiedviews.packages + unifiedviews-webapp + unifiedviews-webapp + + + + + + + maven-jar-plugin + 2.5 + + + default-jar + never + + unwanted + unwanted + + + + + + jdeb + org.vafer + 1.4 + + + package + + jdeb + + + ${debian-package-name} + + + ${basedir}/src/deb/tmp + directory + + perm + /tmp + + + + + + + + + + + diff --git a/debian/unifiedviews-webapp/src/deb/control/control b/debian/unifiedviews-webapp/src/deb/control/control new file mode 100644 index 0000000000..5af50a8f3c --- /dev/null +++ b/debian/unifiedviews-webapp/src/deb/control/control @@ -0,0 +1,10 @@ +Package: unifiedviews-webapp +Source: unifiedviews-webapp +Version: [[debian-package-version]] +Section: java +Priority: extra +Architecture: all +Maintainer: jmc@eea.sk +Homepage: https://github.com/UnifiedViews/Core +Depends: unifiedviews-webapp-mysql (>> 2.1) | unifiedviews-webapp-pgsql (>> 2.1), unifiedviews-backend (>> 2.1), unifiedviews-backend (<< 2.2) +Description: The tool uses data processing pipelines for obtaining, processing, and storing RDF data. \ No newline at end of file diff --git a/debian/unifiedviews-webapp/src/deb/control/postinst b/debian/unifiedviews-webapp/src/deb/control/postinst new file mode 100644 index 0000000000..55b3d0b68e --- /dev/null +++ b/debian/unifiedviews-webapp/src/deb/control/postinst @@ -0,0 +1,54 @@ +#!/bin/sh +# postinst script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + + +service_restart() { + update-rc.d unifiedviews-frontend defaults + + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then + invoke-rc.d unifiedviews-frontend restart || true + else + service unifiedviews-frontend restart || true + fi +} + + + +case "$1" in + configure) + service_restart + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 \ No newline at end of file diff --git a/debian/unifiedviews-webapp/src/deb/tmp/webapp.tmp b/debian/unifiedviews-webapp/src/deb/tmp/webapp.tmp new file mode 100644 index 0000000000..6da1a1f536 --- /dev/null +++ b/debian/unifiedviews-webapp/src/deb/tmp/webapp.tmp @@ -0,0 +1 @@ +webapp \ No newline at end of file diff --git a/pom.xml b/pom.xml index e91fbee17a..17eb0354e4 100644 --- a/pom.xml +++ b/pom.xml @@ -271,6 +271,17 @@ + + debian + + false + + + debian + + + + java8