diff options
author | Ralf Mollik | 2017-08-28 15:35:00 +0000 |
---|---|---|
committer | Ralf Mollik | 2017-08-28 15:35:00 +0000 |
commit | f63e4cf01c4ccfa92fa15bba37415958d2053abc (patch) | |
tree | c2a46db957aab768566a71bea7304aeae8e6a507 | |
download | org.eclipse.osbp.preferences-f63e4cf01c4ccfa92fa15bba37415958d2053abc.tar.gz org.eclipse.osbp.preferences-f63e4cf01c4ccfa92fa15bba37415958d2053abc.tar.xz org.eclipse.osbp.preferences-f63e4cf01c4ccfa92fa15bba37415958d2053abc.zip |
parallel ip - initial checkin
Signed-off-by: Ralf Mollik <ramollik@compex-commerce.com>
119 files changed, 15752 insertions, 0 deletions
diff --git a/.project b/.project new file mode 100644 index 0000000..491eecd --- /dev/null +++ b/.project @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.osbp.preferences.aggregator</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.m2e.core.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.sonarlint.eclipse.core.sonarlintBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.m2e.core.maven2Nature</nature> + </natures> +</projectDescription> diff --git a/about.html b/about.html new file mode 100644 index 0000000..64c0598 --- /dev/null +++ b/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 1, 2016</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html>
\ No newline at end of file diff --git a/jenkins.build.config.xml b/jenkins.build.config.xml new file mode 100644 index 0000000..750b2fd --- /dev/null +++ b/jenkins.build.config.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--#======================================================================= --> +<!--# Copyright (c) 2016 - Loetz GmbH&Co.KG --> +<!--# All rights reserved. This program and the accompanying materials --> +<!--# are made available under the terms of the Eclipse Public License v1.0 --> +<!--# which accompanies this distribution, and is available at --> +<!--# http://www.eclipse.org/legal/epl-v10.html --> +<!--# --> +<!--# Contributors: --> +<!--# Christophe Loetz (Loetz GmbH&Co.KG) - initial API and implementation --> +<!--#======================================================================= --> +<!--# Module specific parameters for the Jenkins Job --> +<!--#======================================================================= --> + +<jenkins> + <!-- DO NOT EDIT BELOW THIS LINE --> + <jenkins.build.dependencies> + <jenkins.build.dependency>org.eclipse.osbp.webserver.messagequeue</jenkins.build.dependency> + </jenkins.build.dependencies> +</jenkins> diff --git a/notice.html b/notice.html new file mode 100644 index 0000000..c3d34c3 --- /dev/null +++ b/notice.html @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +<title>Eclipse Foundation Software User Agreement</title> +</head> + +<body lang="EN-US"> +<h2>Eclipse Foundation Software User Agreement</h2> +<p>April 9, 2014</p> + +<h3>Usage Of Content</h3> + +<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS + (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND + CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE + OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR + NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND + CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p> + +<h3>Applicable Licenses</h3> + +<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 + ("EPL"). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. + For purposes of the EPL, "Program" will mean the Content.</p> + +<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code + repository ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").</p> + +<ul> + <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").</li> + <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li> + <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins + and/or Fragments associated with that Feature.</li> + <li>Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.</li> +</ul> + +<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and +Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module +including, but not limited to the following locations:</p> + +<ul> + <li>The top-level (root) directory</li> + <li>Plug-in and Fragment directories</li> + <li>Inside Plug-ins and Fragments packaged as JARs</li> + <li>Sub-directories of the directory named "src" of certain Plug-ins</li> + <li>Feature directories</li> +</ul> + +<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license ("Feature Update License") during the +installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or +inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature. +Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in +that directory.</p> + +<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE +OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p> + +<ul> + <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li> + <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li> + <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li> + <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li> + <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li> +</ul> + +<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please +contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p> + + +<h3>Use of Provisioning Technology</h3> + +<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse + Update Manager ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or + other materials (collectively "Installable Software"). This capability is provided with the intent of allowing such users to + install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a + href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a> + ("Specification").</p> + +<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the + applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology + in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the + Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p> + +<ol> + <li>A series of actions may occur ("Provisioning Process") in which a user may execute the Provisioning Technology + on a machine ("Target Machine") with the intent of installing, extending or updating the functionality of an Eclipse-based + product.</li> + <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be + accessed and copied to the Target Machine.</li> + <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable + Software ("Installable Software Agreement") and such Installable Software Agreement shall be accessed from the Target + Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern + the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such + indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li> +</ol> + +<h3>Cryptography</h3> + +<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to + another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, + possession, or use, and re-export of encryption software, to see if this is permitted.</p> + +<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p> +</body> +</html> diff --git a/org.eclipse.osbp.preferences.feature/.project b/org.eclipse.osbp.preferences.feature/.project new file mode 100644 index 0000000..40209d6 --- /dev/null +++ b/org.eclipse.osbp.preferences.feature/.project @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.osbp.preferences.feature</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.xtext.ui.shared.xtextBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.FeatureBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.m2e.core.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.sonarlint.eclipse.core.sonarlintBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.xtext.ui.shared.xtextNature</nature> + <nature>org.eclipse.m2e.core.maven2Nature</nature> + <nature>org.eclipse.pde.FeatureNature</nature> + </natures> +</projectDescription> diff --git a/org.eclipse.osbp.preferences.feature/LICENSE.txt b/org.eclipse.osbp.preferences.feature/LICENSE.txt new file mode 100644 index 0000000..ff42ad4 --- /dev/null +++ b/org.eclipse.osbp.preferences.feature/LICENSE.txt @@ -0,0 +1,161 @@ +Eclipse Public License -v 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION +OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + +a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and + +b) in the case of each subsequent Contributor: + +i) changes to the Program, and + +ii) additions to the Program; + +where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. +A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone +acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate +modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not +derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of +its Contribution alone or when combined with the Program. + +"Program" means the Contributions distributed in accordance with this Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. + +2. GRANT OF RIGHTS + +a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, +royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute +and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code +form. + +b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, +royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the +Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the +combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such +addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not +apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no +assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity +based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property +rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the +Program, it is Recipient's responsibility to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to +grant the copyright license set forth in this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: + +a) it complies with the terms and conditions of this Agreement; and + +b) its license agreement: + +i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including +warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and +fitness for a particular purpose; + +ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, +incidental and consequential damages, such as lost profits; + +iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any +other party; and + +iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it +in a reasonable manner on or through a medium customarily used for software exchange. + +When the Program is made available in source code form: + +a) it must be made available under this Agreement; and + +b) a copy of this Agreement must be included with each copy of the Program. + +Contributors may not remove or alter any copyright notices contained within the Program. + +Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and +the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes +the Program in a commercial product offering should do so in a manner which does not create potential liability for +other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor +("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") +against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions +brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such +Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The +obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual +property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the +Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may + participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is +then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties +related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. +Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to +those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, +the Commercial Contributor must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for +determining the appropriateness of using and distributing the Program and assumes all risks associated with its +exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance +with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED +HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such +provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such +Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such +litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such +noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution +of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses + granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement +is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish +new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the +right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may +assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the +Agreement will be given a distinguishing version number. The Program (including Contributions) may always be +distributed subject to the version of the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the +new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or +otherwise. All rights in the Program not expressly granted under this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States +of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause +of action arose. Each party waives its rights to a jury trial in any resulting litigation.
\ No newline at end of file diff --git a/org.eclipse.osbp.preferences.feature/about.html b/org.eclipse.osbp.preferences.feature/about.html new file mode 100644 index 0000000..64c0598 --- /dev/null +++ b/org.eclipse.osbp.preferences.feature/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 1, 2016</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html>
\ No newline at end of file diff --git a/org.eclipse.osbp.preferences.feature/build.properties b/org.eclipse.osbp.preferences.feature/build.properties new file mode 100644 index 0000000..b8920ff --- /dev/null +++ b/org.eclipse.osbp.preferences.feature/build.properties @@ -0,0 +1,2 @@ +bin.includes = license.html, epl-v10.html, feature.xml,\ + feature.properties diff --git a/org.eclipse.osbp.preferences.feature/epl-v10.html b/org.eclipse.osbp.preferences.feature/epl-v10.html new file mode 100644 index 0000000..b398acc --- /dev/null +++ b/org.eclipse.osbp.preferences.feature/epl-v10.html @@ -0,0 +1,259 @@ +<!--?xml version="1.0" encoding="ISO-8859-1" ?--> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Eclipse Public License - Version 1.0</title> +<style type="text/css"> + body { + size: 8.5in 11.0in; + margin: 0.25in 0.5in 0.25in 0.5in; + tab-interval: 0.5in; + } + p { + margin-left: auto; + margin-top: 0.5em; + margin-bottom: 0.5em; + } + p.list { + margin-left: 0.5in; + margin-top: 0.05em; + margin-bottom: 0.05em; + } + </style> + +</head> + +<body lang="EN-US"> + +<h2>Eclipse Public License - v 1.0</h2> + +<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE +PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR +DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS +AGREEMENT.</p> + +<p><b>1. DEFINITIONS</b></p> + +<p>"Contribution" means:</p> + +<p class="list">a) in the case of the initial Contributor, the initial +code and documentation distributed under this Agreement, and</p> +<p class="list">b) in the case of each subsequent Contributor:</p> +<p class="list">i) changes to the Program, and</p> +<p class="list">ii) additions to the Program;</p> +<p class="list">where such changes and/or additions to the Program +originate from and are distributed by that particular Contributor. A +Contribution 'originates' from a Contributor if it was added to the +Program by such Contributor itself or anyone acting on such +Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in +conjunction with the Program under their own license agreement, and (ii) +are not derivative works of the Program.</p> + +<p>"Contributor" means any person or entity that distributes +the Program.</p> + +<p>"Licensed Patents" mean patent claims licensable by a +Contributor which are necessarily infringed by the use or sale of its +Contribution alone or when combined with the Program.</p> + +<p>"Program" means the Contributions distributed in accordance +with this Agreement.</p> + +<p>"Recipient" means anyone who receives the Program under +this Agreement, including all Contributors.</p> + +<p><b>2. GRANT OF RIGHTS</b></p> + +<p class="list">a) Subject to the terms of this Agreement, each +Contributor hereby grants Recipient a non-exclusive, worldwide, +royalty-free copyright license to reproduce, prepare derivative works +of, publicly display, publicly perform, distribute and sublicense the +Contribution of such Contributor, if any, and such derivative works, in +source code and object code form.</p> + +<p class="list">b) Subject to the terms of this Agreement, each +Contributor hereby grants Recipient a non-exclusive, worldwide, +royalty-free patent license under Licensed Patents to make, use, sell, +offer to sell, import and otherwise transfer the Contribution of such +Contributor, if any, in source code and object code form. This patent +license shall apply to the combination of the Contribution and the +Program if, at the time the Contribution is added by the Contributor, +such addition of the Contribution causes such combination to be covered +by the Licensed Patents. The patent license shall not apply to any other +combinations which include the Contribution. No hardware per se is +licensed hereunder.</p> + +<p class="list">c) Recipient understands that although each Contributor +grants the licenses to its Contributions set forth herein, no assurances +are provided by any Contributor that the Program does not infringe the +patent or other intellectual property rights of any other entity. Each +Contributor disclaims any liability to Recipient for claims brought by +any other entity based on infringement of intellectual property rights +or otherwise. As a condition to exercising the rights and licenses +granted hereunder, each Recipient hereby assumes sole responsibility to +secure any other intellectual property rights needed, if any. For +example, if a third party patent license is required to allow Recipient +to distribute the Program, it is Recipient's responsibility to acquire +that license before distributing the Program.</p> + +<p class="list">d) Each Contributor represents that to its knowledge it +has sufficient copyright rights in its Contribution, if any, to grant +the copyright license set forth in this Agreement.</p> + +<p><b>3. REQUIREMENTS</b></p> + +<p>A Contributor may choose to distribute the Program in object code +form under its own license agreement, provided that:</p> + +<p class="list">a) it complies with the terms and conditions of this +Agreement; and</p> + +<p class="list">b) its license agreement:</p> + +<p class="list">i) effectively disclaims on behalf of all Contributors +all warranties and conditions, express and implied, including warranties +or conditions of title and non-infringement, and implied warranties or +conditions of merchantability and fitness for a particular purpose;</p> + +<p class="list">ii) effectively excludes on behalf of all Contributors +all liability for damages, including direct, indirect, special, +incidental and consequential damages, such as lost profits;</p> + +<p class="list">iii) states that any provisions which differ from this +Agreement are offered by that Contributor alone and not by any other +party; and</p> + +<p class="list">iv) states that source code for the Program is available +from such Contributor, and informs licensees how to obtain it in a +reasonable manner on or through a medium customarily used for software +exchange.</p> + +<p>When the Program is made available in source code form:</p> + +<p class="list">a) it must be made available under this Agreement; and</p> + +<p class="list">b) a copy of this Agreement must be included with each +copy of the Program.</p> + +<p>Contributors may not remove or alter any copyright notices contained +within the Program.</p> + +<p>Each Contributor must identify itself as the originator of its +Contribution, if any, in a manner that reasonably allows subsequent +Recipients to identify the originator of the Contribution.</p> + +<p><b>4. COMMERCIAL DISTRIBUTION</b></p> + +<p>Commercial distributors of software may accept certain +responsibilities with respect to end users, business partners and the +like. While this license is intended to facilitate the commercial use of +the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create +potential liability for other Contributors. Therefore, if a Contributor +includes the Program in a commercial product offering, such Contributor +("Commercial Contributor") hereby agrees to defend and +indemnify every other Contributor ("Indemnified Contributor") +against any losses, damages and costs (collectively "Losses") +arising from claims, lawsuits and other legal actions brought by a third +party against the Indemnified Contributor to the extent caused by the +acts or omissions of such Commercial Contributor in connection with its +distribution of the Program in a commercial product offering. The +obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In +order to qualify, an Indemnified Contributor must: a) promptly notify +the Commercial Contributor in writing of such claim, and b) allow the +Commercial Contributor to control, and cooperate with the Commercial +Contributor in, the defense and any related settlement negotiations. The +Indemnified Contributor may participate in any such claim at its own +expense.</p> + +<p>For example, a Contributor might include the Program in a commercial +product offering, Product X. That Contributor is then a Commercial +Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance +claims and warranties are such Commercial Contributor's responsibility +alone. Under this section, the Commercial Contributor would have to +defend claims against the other Contributors related to those +performance claims and warranties, and if a court requires any other +Contributor to pay any damages as a result, the Commercial Contributor +must pay those damages.</p> + +<p><b>5. NO WARRANTY</b></p> + +<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS +PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS +OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, +ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY +OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and +distributing the Program and assumes all risks associated with its +exercise of rights under this Agreement , including but not limited to +the risks and costs of program errors, compliance with applicable laws, +damage to or loss of data, programs or equipment, and unavailability or +interruption of operations.</p> + +<p><b>6. DISCLAIMER OF LIABILITY</b></p> + +<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT +NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING +WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR +DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED +HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p> + +<p><b>7. GENERAL</b></p> + +<p>If any provision of this Agreement is invalid or unenforceable under +applicable law, it shall not affect the validity or enforceability of +the remainder of the terms of this Agreement, and without further action +by the parties hereto, such provision shall be reformed to the minimum +extent necessary to make such provision valid and enforceable.</p> + +<p>If Recipient institutes patent litigation against any entity +(including a cross-claim or counterclaim in a lawsuit) alleging that the +Program itself (excluding combinations of the Program with other +software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the +date such litigation is filed.</p> + +<p>All Recipient's rights under this Agreement shall terminate if it +fails to comply with any of the material terms or conditions of this +Agreement and does not cure such failure in a reasonable period of time +after becoming aware of such noncompliance. If all Recipient's rights +under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive.</p> + +<p>Everyone is permitted to copy and distribute copies of this +Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The +Agreement Steward reserves the right to publish new versions (including +revisions) of this Agreement from time to time. No one other than the +Agreement Steward has the right to modify this Agreement. The Eclipse +Foundation is the initial Agreement Steward. The Eclipse Foundation may +assign the responsibility to serve as the Agreement Steward to a +suitable separate entity. Each new version of the Agreement will be +given a distinguishing version number. The Program (including +Contributions) may always be distributed subject to the version of the +Agreement under which it was received. In addition, after a new version +of the Agreement is published, Contributor may elect to distribute the +Program (including its Contributions) under the new version. Except as +expressly stated in Sections 2(a) and 2(b) above, Recipient receives no +rights or licenses to the intellectual property of any Contributor under +this Agreement, whether expressly, by implication, estoppel or +otherwise. All rights in the Program not expressly granted under this +Agreement are reserved.</p> + +<p>This Agreement is governed by the laws of the State of New York and +the intellectual property laws of the United States of America. No party +to this Agreement will bring a legal action under this Agreement more +than one year after the cause of action arose. Each party waives its +rights to a jury trial in any resulting litigation.</p> + + + +</body></html>
\ No newline at end of file diff --git a/org.eclipse.osbp.preferences.feature/feature.properties b/org.eclipse.osbp.preferences.feature/feature.properties new file mode 100644 index 0000000..6d2184c --- /dev/null +++ b/org.eclipse.osbp.preferences.feature/feature.properties @@ -0,0 +1,169 @@ +############################################################################### +# Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany). +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Cristiano Gavião - initial API and implementation +############################################################################### +# feature.properties +# contains externalized strings for feature.xml +# "%foo" in feature.xml corresponds to the key "foo" in this file +# java.io.Properties file (ISO 8859-1 with "\" escapes) +# This file should be translated. + +# "featureName" property - name of the feature +featureName =OSBP Preferences + +# "providerName" property - name of the company that provides the feature +providerName=Eclipse OSBP + +# "description" property - description of the feature +description=This feature provides the bundles for OSBP preferences. + +# "updateSiteName" property - label for the update site +updateSiteName= + +# "copyright" property - text of the "Feature Update Copyright" +copyright=\ +Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) \n\ +All rights reserved. This program and the accompanying materials\n\ +are made available under the terms of the Eclipse Public License v1.0\n\ +which accompanies this distribution, and is available at\n\ +http://www.eclipse.org/legal/epl-v10.html\n\ +\n\ +################ end of copyright property #################################### + +# "licenseURL" property - URL of the "Feature License" +# do not translate value - just change to point to a locale-specific HTML page +licenseURL=license.html + +# "license" property - text of the "Feature Update License" +# should be plain text version of license agreement pointed to be "licenseURL" +license=\ +Eclipse Foundation Software User Agreement\n\ +February 1, 2011\n\ +\n\ +Usage Of Content\n\ +\n\ +THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ +OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ +USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ +AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ +NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ +AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ +AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ +OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ +TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ +OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ +BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ +\n\ +Applicable Licenses\n\ +\n\ +Unless otherwise indicated, all Content made available by the\n\ +Eclipse Foundation is provided to you under the terms and conditions of\n\ +the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\ +provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ +For purposes of the EPL, "Program" will mean the Content.\n\ +\n\ +Content includes, but is not limited to, source code, object code,\n\ +documentation and other files maintained in the Eclipse Foundation source code\n\ +repository ("Repository") in software modules ("Modules") and made available\n\ +as downloadable archives ("Downloads").\n\ +\n\ + - Content may be structured and packaged into modules to facilitate delivering,\n\ + extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ + plug-in fragments ("Fragments"), and features ("Features").\n\ + - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\ + in a directory named "plugins".\n\ + - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ + Each Feature may be packaged as a sub-directory in a directory named "features".\n\ + Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ + numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ + - Features may also include other Features ("Included Features"). Within a Feature, files\n\ + named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ +\n\ +The terms and conditions governing Plug-ins and Fragments should be\n\ +contained in files named "about.html" ("Abouts"). The terms and\n\ +conditions governing Features and Included Features should be contained\n\ +in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ +Licenses may be located in any directory of a Download or Module\n\ +including, but not limited to the following locations:\n\ +\n\ + - The top-level (root) directory\n\ + - Plug-in and Fragment directories\n\ + - Inside Plug-ins and Fragments packaged as JARs\n\ + - Sub-directories of the directory named "src" of certain Plug-ins\n\ + - Feature directories\n\ +\n\ +Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ +Provisioning Technology (as defined below), you must agree to a license ("Feature \n\ +Update License") during the installation process. If the Feature contains\n\ +Included Features, the Feature Update License should either provide you\n\ +with the terms and conditions governing the Included Features or inform\n\ +you where you can locate them. Feature Update Licenses may be found in\n\ +the "license" property of files named "feature.properties" found within a Feature.\n\ +Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\ +terms and conditions (or references to such terms and conditions) that\n\ +govern your use of the associated Content in that directory.\n\ +\n\ +THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\ +TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ +SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ +\n\ + - Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\ + - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ + - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ + - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ + - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\ + - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ +\n\ +IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ +TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\ +is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ +govern that particular Content.\n\ +\n\ +\n\Use of Provisioning Technology\n\ +\n\ +The Eclipse Foundation makes available provisioning software, examples of which include,\n\ +but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\ +the purpose of allowing users to install software, documentation, information and/or\n\ +other materials (collectively "Installable Software"). This capability is provided with\n\ +the intent of allowing such users to install, extend and update Eclipse-based products.\n\ +Information about packaging Installable Software is available at\n\ +http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\ +\n\ +You may use Provisioning Technology to allow other parties to install Installable Software.\n\ +You shall be responsible for enabling the applicable license agreements relating to the\n\ +Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\ +in accordance with the Specification. By using Provisioning Technology in such a manner and\n\ +making it available in accordance with the Specification, you further acknowledge your\n\ +agreement to, and the acquisition of all necessary rights to permit the following:\n\ +\n\ + 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\ + the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\ + extending or updating the functionality of an Eclipse-based product.\n\ + 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\ + Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\ + 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\ + govern the use of the Installable Software ("Installable Software Agreement") and such\n\ + Installable Software Agreement shall be accessed from the Target Machine in accordance\n\ + with the Specification. Such Installable Software Agreement must inform the user of the\n\ + terms and conditions that govern the Installable Software and must solicit acceptance by\n\ + the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\ + indication of agreement by the user, the provisioning Technology will complete installation\n\ + of the Installable Software.\n\ +\n\ +Cryptography\n\ +\n\ +Content may contain encryption software. The country in which you are\n\ +currently may have restrictions on the import, possession, and use,\n\ +and/or re-export to another country, of encryption software. BEFORE\n\ +using any encryption software, please check the country's laws,\n\ +regulations and policies concerning the import, possession, or use, and\n\ +re-export of encryption software, to see if this is permitted.\n\ +\n\ +Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n +########### end of license property ########################################## diff --git a/org.eclipse.osbp.preferences.feature/feature.xml b/org.eclipse.osbp.preferences.feature/feature.xml new file mode 100644 index 0000000..0dbda50 --- /dev/null +++ b/org.eclipse.osbp.preferences.feature/feature.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--#======================================================================= --> +<!--# Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) --> +<!--# All rights reserved. This program and the accompanying materials --> +<!--# are made available under the terms of the Eclipse Public License v1.0 --> +<!--# which accompanies this distribution, and is available at --> +<!--# http://www.eclipse.org/legal/epl-v10.html --> +<!--# --> +<!--# Contributors: --> +<!--# Christophe Loetz (Loetz GmbH&Co.KG) - initial API and implementation --> +<!--#======================================================================= --> + +<feature + id="org.eclipse.osbp.preferences.feature" + label="%featureName" + version="0.9.0.qualifier" + provider-name="%providerName"> + + <description> + %description + </description> + + <copyright> + %copyright + </copyright> + + <license url="%licenseURL"> + %license + </license> + + <plugin + id="org.eclipse.osbp.preferences" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.eclipse.osbp.preferences.ui.page" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + +</feature> diff --git a/org.eclipse.osbp.preferences.feature/license.html b/org.eclipse.osbp.preferences.feature/license.html new file mode 100644 index 0000000..6e579a5 --- /dev/null +++ b/org.eclipse.osbp.preferences.feature/license.html @@ -0,0 +1,164 @@ +<!--?xml version="1.0" encoding="ISO-8859-1" ?--> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Eclipse Foundation Software User Agreement</title> +</head> + +<body lang="EN-US"> +<h2>Eclipse Foundation Software User Agreement</h2> +<p>February 1, 2011</p> + +<h3>Usage Of Content</h3> + +<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS + (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND + CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE + OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR + NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND + CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p> + +<h3>Applicable Licenses</h3> + +<p>Unless otherwise indicated, all Content made available by the Eclipse + Foundation is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 + ("EPL"). A copy of the EPL is provided with this Content and is also + available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. + For purposes of the EPL, "Program" will mean the Content.</p> + +<p>Content includes, but is not limited to, source code, object code, +documentation and other files maintained in the Eclipse Foundation +source code + repository ("Repository") in software modules ("Modules") and made +available as downloadable archives ("Downloads").</p> + +<ul> + <li>Content may be structured and packaged into modules to +facilitate delivering, extending, and upgrading the Content. Typical +modules may include plug-ins ("Plug-ins"), plug-in fragments +("Fragments"), and features ("Features").</li> + <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li> + <li>A Feature is a bundle of one or more Plug-ins and/or +Fragments and associated material. Each Feature may be packaged as a +sub-directory in a directory named "features". Within a Feature, files +named "feature.xml" may contain a list of the names and version numbers +of the Plug-ins + and/or Fragments associated with that Feature.</li> + <li>Features may also include other Features ("Included +Features"). Within a Feature, files named "feature.xml" may contain a +list of the names and version numbers of Included Features.</li> +</ul> + +<p>The terms and conditions governing Plug-ins and Fragments should be +contained in files named "about.html" ("Abouts"). The terms and +conditions governing Features and +Included Features should be contained in files named "license.html" +("Feature Licenses"). Abouts and Feature Licenses may be located in any + directory of a Download or Module +including, but not limited to the following locations:</p> + +<ul> + <li>The top-level (root) directory</li> + <li>Plug-in and Fragment directories</li> + <li>Inside Plug-ins and Fragments packaged as JARs</li> + <li>Sub-directories of the directory named "src" of certain Plug-ins</li> + <li>Feature directories</li> +</ul> + +<p>Note: if a Feature made available by the Eclipse Foundation is +installed using the Provisioning Technology (as defined below), you must + agree to a license ("Feature Update License") during the +installation process. If the Feature contains Included Features, the +Feature Update License should either provide you with the terms and +conditions governing the Included Features or +inform you where you can locate them. Feature Update Licenses may be +found in the "license" property of files named "feature.properties" +found within a Feature. +Such Abouts, Feature Licenses, and Feature Update Licenses contain the +terms and conditions (or references to such terms and conditions) that +govern your use of the associated Content in +that directory.</p> + +<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER +TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. + SOME OF THESE +OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p> + +<ul> + <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li> + <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li> + <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li> + <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li> + <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li> + <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li> +</ul> + +<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND +CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, +or Feature Update License is provided, please +contact the Eclipse Foundation to determine what terms and conditions +govern that particular Content.</p> + + +<h3>Use of Provisioning Technology</h3> + +<p>The Eclipse Foundation makes available provisioning software, +examples of which include, but are not limited to, p2 and the Eclipse + Update Manager ("Provisioning Technology") for the purpose of +allowing users to install software, documentation, information and/or + other materials (collectively "Installable Software"). This +capability is provided with the intent of allowing such users to + install, extend and update Eclipse-based products. Information about +packaging Installable Software is available at <a href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a> + ("Specification").</p> + +<p>You may use Provisioning Technology to allow other parties to install + Installable Software. You shall be responsible for enabling the + applicable license agreements relating to the Installable Software to + be presented to, and accepted by, the users of the Provisioning +Technology + in accordance with the Specification. By using Provisioning +Technology in such a manner and making it available in accordance with +the + Specification, you further acknowledge your agreement to, and the +acquisition of all necessary rights to permit the following:</p> + +<ol> + <li>A series of actions may occur ("Provisioning Process") in +which a user may execute the Provisioning Technology + on a machine ("Target Machine") with the intent of installing, +extending or updating the functionality of an Eclipse-based + product.</li> + <li>During the Provisioning Process, the Provisioning Technology +may cause third party Installable Software or a portion thereof to be + accessed and copied to the Target Machine.</li> + <li>Pursuant to the Specification, you will provide to the user +the terms and conditions that govern the use of the Installable + Software ("Installable Software Agreement") and such Installable +Software Agreement shall be accessed from the Target + Machine in accordance with the Specification. Such Installable +Software Agreement must inform the user of the terms and conditions that + govern + the Installable Software and must solicit acceptance by the end +user in the manner prescribed in such Installable Software Agreement. +Upon such + indication of agreement by the user, the provisioning Technology +will complete installation of the Installable Software.</li> +</ol> + +<h3>Cryptography</h3> + +<p>Content may contain encryption software. The country in which you are + currently may have restrictions on the import, possession, and use, +and/or re-export to + another country, of encryption software. BEFORE using any encryption +software, please check the country's laws, regulations and policies +concerning the import, + possession, or use, and re-export of encryption software, to see if +this is permitted.</p> + +<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p> + + +</body></html>
\ No newline at end of file diff --git a/org.eclipse.osbp.preferences.feature/notice.html b/org.eclipse.osbp.preferences.feature/notice.html new file mode 100644 index 0000000..c3d34c3 --- /dev/null +++ b/org.eclipse.osbp.preferences.feature/notice.html @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +<title>Eclipse Foundation Software User Agreement</title> +</head> + +<body lang="EN-US"> +<h2>Eclipse Foundation Software User Agreement</h2> +<p>April 9, 2014</p> + +<h3>Usage Of Content</h3> + +<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS + (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND + CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE + OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR + NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND + CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p> + +<h3>Applicable Licenses</h3> + +<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 + ("EPL"). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. + For purposes of the EPL, "Program" will mean the Content.</p> + +<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code + repository ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").</p> + +<ul> + <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").</li> + <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li> + <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins + and/or Fragments associated with that Feature.</li> + <li>Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.</li> +</ul> + +<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and +Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module +including, but not limited to the following locations:</p> + +<ul> + <li>The top-level (root) directory</li> + <li>Plug-in and Fragment directories</li> + <li>Inside Plug-ins and Fragments packaged as JARs</li> + <li>Sub-directories of the directory named "src" of certain Plug-ins</li> + <li>Feature directories</li> +</ul> + +<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license ("Feature Update License") during the +installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or +inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature. +Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in +that directory.</p> + +<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE +OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p> + +<ul> + <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li> + <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li> + <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li> + <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li> + <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li> +</ul> + +<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please +contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p> + + +<h3>Use of Provisioning Technology</h3> + +<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse + Update Manager ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or + other materials (collectively "Installable Software"). This capability is provided with the intent of allowing such users to + install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a + href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a> + ("Specification").</p> + +<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the + applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology + in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the + Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p> + +<ol> + <li>A series of actions may occur ("Provisioning Process") in which a user may execute the Provisioning Technology + on a machine ("Target Machine") with the intent of installing, extending or updating the functionality of an Eclipse-based + product.</li> + <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be + accessed and copied to the Target Machine.</li> + <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable + Software ("Installable Software Agreement") and such Installable Software Agreement shall be accessed from the Target + Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern + the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such + indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li> +</ol> + +<h3>Cryptography</h3> + +<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to + another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, + possession, or use, and re-export of encryption software, to see if this is permitted.</p> + +<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p> +</body> +</html> diff --git a/org.eclipse.osbp.preferences.feature/pom.xml b/org.eclipse.osbp.preferences.feature/pom.xml new file mode 100644 index 0000000..e506597 --- /dev/null +++ b/org.eclipse.osbp.preferences.feature/pom.xml @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--#======================================================================= --> +<!--# Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany). --> +<!--# All rights reserved. This program and the accompanying materials --> +<!--# are made available under the terms of the Eclipse Public License v1.0 --> +<!--# which accompanies this distribution, and is available at --> +<!--# http://www.eclipse.org/legal/epl-v10.html --> +<!--# --> +<!--# Contributors: --> +<!--# Christophe Loetz (Loetz GmbH&Co.KG) - Initial implementation API and implementation --> +<!--#======================================================================= --> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.eclipse.osbp.preferences</groupId> + <artifactId>org.eclipse.osbp.preferences.aggregator</artifactId> + <version>0.9.0-SNAPSHOT</version> + </parent> + + <artifactId>org.eclipse.osbp.preferences.feature</artifactId> + <packaging>eclipse-feature</packaging> + + <build> + <plugins> + <plugin> + <groupId>org.eclipse.tycho.extras</groupId> + <artifactId>tycho-source-feature-plugin</artifactId> + <version>${tychoExtrasVersion}</version> + <executions> + <execution> + <id>source-feature</id> + <phase>package</phase> + <goals> + <goal>source-feature</goal> + </goals> + </execution> + </executions> + <configuration> + <labelSuffix> (source)</labelSuffix> + </configuration> + </plugin> + <plugin> + <!-- workaround while bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=398250 + is not fixed --> + <groupId>org.eclipse.tycho</groupId> + <artifactId>tycho-p2-plugin</artifactId> + <version>${tycho-version}</version> + <executions> + <execution> + <id>attached-p2-metadata</id> + <phase>package</phase> + <goals> + <goal>p2-metadata</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-javadoc-plugin</artifactId> + <executions> + <execution> + <id>javadoc-jar</id> + <phase>package</phase> + <goals> + <goal>jar</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <dependencies> + <dependency> + <groupId>org.eclipse.osbp.preferences</groupId> + <artifactId>org.eclipse.osbp.preferences</artifactId> + <version>0.9.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.eclipse.osbp.preferences</groupId> + <artifactId>org.eclipse.osbp.preferences.ui.page</artifactId> + <version>0.9.0-SNAPSHOT</version> + </dependency> + </dependencies> + +</project> diff --git a/org.eclipse.osbp.preferences.feature/src/main/javadoc/README.txt b/org.eclipse.osbp.preferences.feature/src/main/javadoc/README.txt new file mode 100644 index 0000000..831da7e --- /dev/null +++ b/org.eclipse.osbp.preferences.feature/src/main/javadoc/README.txt @@ -0,0 +1 @@ +Resource folder for javadoc resources.
\ No newline at end of file diff --git a/org.eclipse.osbp.preferences.feature/src/overview.html b/org.eclipse.osbp.preferences.feature/src/overview.html new file mode 100644 index 0000000..643202f --- /dev/null +++ b/org.eclipse.osbp.preferences.feature/src/overview.html @@ -0,0 +1,9 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html> +<head> + <title>OSBP Tools Graphical Entity</title> +</head> +<body> +<p>The <b>OSBP Preferences </b>provides the bundles for OSBP preferences.</p> +</body> +</html> diff --git a/org.eclipse.osbp.preferences.ui.page/.project b/org.eclipse.osbp.preferences.ui.page/.project new file mode 100644 index 0000000..d3691bd --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/.project @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.osbp.preferences.ui.page</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.xtext.ui.shared.xtextBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.babel.editor.rbeBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.m2e.core.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.sonarlint.eclipse.core.sonarlintBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.xtext.ui.shared.xtextNature</nature> + <nature>org.eclipse.m2e.core.maven2Nature</nature> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.babel.editor.rbeNature</nature> + </natures> +</projectDescription> diff --git a/org.eclipse.osbp.preferences.ui.page/LICENSE.txt b/org.eclipse.osbp.preferences.ui.page/LICENSE.txt new file mode 100644 index 0000000..ff42ad4 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/LICENSE.txt @@ -0,0 +1,161 @@ +Eclipse Public License -v 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION +OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + +a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and + +b) in the case of each subsequent Contributor: + +i) changes to the Program, and + +ii) additions to the Program; + +where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. +A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone +acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate +modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not +derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of +its Contribution alone or when combined with the Program. + +"Program" means the Contributions distributed in accordance with this Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. + +2. GRANT OF RIGHTS + +a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, +royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute +and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code +form. + +b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, +royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the +Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the +combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such +addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not +apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no +assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity +based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property +rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the +Program, it is Recipient's responsibility to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to +grant the copyright license set forth in this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: + +a) it complies with the terms and conditions of this Agreement; and + +b) its license agreement: + +i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including +warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and +fitness for a particular purpose; + +ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, +incidental and consequential damages, such as lost profits; + +iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any +other party; and + +iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it +in a reasonable manner on or through a medium customarily used for software exchange. + +When the Program is made available in source code form: + +a) it must be made available under this Agreement; and + +b) a copy of this Agreement must be included with each copy of the Program. + +Contributors may not remove or alter any copyright notices contained within the Program. + +Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and +the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes +the Program in a commercial product offering should do so in a manner which does not create potential liability for +other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor +("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") +against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions +brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such +Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The +obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual +property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the +Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may + participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is +then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties +related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. +Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to +those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, +the Commercial Contributor must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for +determining the appropriateness of using and distributing the Program and assumes all risks associated with its +exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance +with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED +HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such +provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such +Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such +litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such +noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution +of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses + granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement +is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish +new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the +right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may +assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the +Agreement will be given a distinguishing version number. The Program (including Contributions) may always be +distributed subject to the version of the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the +new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or +otherwise. All rights in the Program not expressly granted under this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States +of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause +of action arose. Each party waives its rights to a jury trial in any resulting litigation.
\ No newline at end of file diff --git a/org.eclipse.osbp.preferences.ui.page/META-INF/MANIFEST.MF b/org.eclipse.osbp.preferences.ui.page/META-INF/MANIFEST.MF new file mode 100644 index 0000000..c984204 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/META-INF/MANIFEST.MF @@ -0,0 +1,29 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: org.eclipse.osbp.preferences.ui.page +Bundle-SymbolicName: org.eclipse.osbp.preferences.ui.page;singleton:=true +Bundle-Version: 0.9.0.qualifier +Bundle-Activator: org.eclipse.osbp.preferences.ui.page.Activator +Bundle-Vendor: Eclipse OSBP +Import-Package: org.apache.commons.io, + org.apache.commons.lang3;version="3.1.0", + org.osgi.framework;version="1.3.0" +Bundle-ActivationPolicy: lazy +Require-Bundle: org.slf4j.api;bundle-version="1.7.2", + org.apache.commons.lang3, + org.eclipse.jdt.core, + org.eclipse.jface, + org.eclipse.ui, + org.eclipse.xtext.ui;bundle-version="[2.7.3,2.8.0)", + org.eclipse.osbp.preferences;bundle-version="[0.9.0,0.10.0)", + org.eclipse.osbp.webserver.messagequeue;bundle-version="[0.9.0,0.10.0)", + org.eclipse.osbp.gitinfo;bundle-version="[0.9.0,0.10.0)", + org.eclipse.ui.ide, + org.eclipse.ui.workbench, + org.eclipse.core.filesystem;resolution:=optional, + org.apache.felix.utils.osgi;bundle-version="1.8.2" +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Export-Package: org.eclipse.osbp.preferences.ui.component;version="0.9.0", + org.eclipse.osbp.preferences.ui.data;version="0.9.0", + org.eclipse.osbp.preferences.ui.page;version="0.9.0", + org.eclipse.osbp.preferences.ui.utils;version="0.9.0" diff --git a/org.eclipse.osbp.preferences.ui.page/about.html b/org.eclipse.osbp.preferences.ui.page/about.html new file mode 100644 index 0000000..64c0598 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 1, 2016</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html>
\ No newline at end of file diff --git a/org.eclipse.osbp.preferences.ui.page/about.ini b/org.eclipse.osbp.preferences.ui.page/about.ini new file mode 100644 index 0000000..7df671f --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/about.ini @@ -0,0 +1,17 @@ +# about.ini +# contains information about a feature +# java.io.Properties file (ISO 8859-1 with "\" escapes) +# "%key" are externalized strings defined in about.properties +# This file does not need to be translated. + +# Property "aboutText" contains blurb for "About" dialog (translated) +aboutText=%featureText + +# Property "featureImage" contains path to feature image (32x32) +featureImage= + +# Property "appName" contains name of the application (translated) +appName=%featureName + +# Property "welcomePage" contains path to welcome page (special XML-based format) +welcomePage= diff --git a/org.eclipse.osbp.preferences.ui.page/about.mappings b/org.eclipse.osbp.preferences.ui.page/about.mappings new file mode 100644 index 0000000..4511a0a --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/about.mappings @@ -0,0 +1,6 @@ +# about.mappings +# contains fill-ins for about.properties +# java.io.Properties file (ISO 8859-1 with "\" escapes) +# This file does not need to be translated. + +0=qualifier diff --git a/org.eclipse.osbp.preferences.ui.page/about.properties b/org.eclipse.osbp.preferences.ui.page/about.properties new file mode 100644 index 0000000..7d0546d --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/about.properties @@ -0,0 +1,26 @@ +# +# Copyright (c) 2012, 2016 - Loetz GmbH&Co.KG (Heidelberg) +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Christophe Loetz (Loetz GmbH&Co.KG) - initial API and implementation +# + +# NLS_MESSAGEFORMAT_VAR + +featureName=org.eclipse.osbp.preferences.ui.page + +################ blurb property #################################### +featureText=\ +Copyright (c) 2012-2016 - Loetz GmbH&Co.KG \n\ +All rights reserved. This program and the accompanying materials\n\ +are made available under the terms of the Eclipse Public License v1.0\n\ +which accompanies this distribution, and is available at\n\ +http://www.eclipse.org/legal/epl-v10.html\n\ +\n\ +Contributors:\n\ + Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation\n +################ end of blurb property #################################### diff --git a/org.eclipse.osbp.preferences.ui.page/build.properties b/org.eclipse.osbp.preferences.ui.page/build.properties new file mode 100644 index 0000000..a39bb09 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/build.properties @@ -0,0 +1,16 @@ +source.. = src/ +output.. = target/classes/ +bin.includes = about.properties, about.mappings, about.ini, about.html, META-INF/,\ + .,\ + .classpath,\ + .project,\ + .settings/,\ + plugin.xml,\ + license.html,\ + LICENSE.txt,\ + icons/,\ + epl-v10.html +src.includes = about.properties, about.mappings, about.ini, about.html, license.html,\ + LICENSE.txt,\ + icons/,\ + epl-v10.html diff --git a/org.eclipse.osbp.preferences.ui.page/epl-v10.html b/org.eclipse.osbp.preferences.ui.page/epl-v10.html new file mode 100644 index 0000000..b398acc --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/epl-v10.html @@ -0,0 +1,259 @@ +<!--?xml version="1.0" encoding="ISO-8859-1" ?--> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Eclipse Public License - Version 1.0</title> +<style type="text/css"> + body { + size: 8.5in 11.0in; + margin: 0.25in 0.5in 0.25in 0.5in; + tab-interval: 0.5in; + } + p { + margin-left: auto; + margin-top: 0.5em; + margin-bottom: 0.5em; + } + p.list { + margin-left: 0.5in; + margin-top: 0.05em; + margin-bottom: 0.05em; + } + </style> + +</head> + +<body lang="EN-US"> + +<h2>Eclipse Public License - v 1.0</h2> + +<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE +PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR +DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS +AGREEMENT.</p> + +<p><b>1. DEFINITIONS</b></p> + +<p>"Contribution" means:</p> + +<p class="list">a) in the case of the initial Contributor, the initial +code and documentation distributed under this Agreement, and</p> +<p class="list">b) in the case of each subsequent Contributor:</p> +<p class="list">i) changes to the Program, and</p> +<p class="list">ii) additions to the Program;</p> +<p class="list">where such changes and/or additions to the Program +originate from and are distributed by that particular Contributor. A +Contribution 'originates' from a Contributor if it was added to the +Program by such Contributor itself or anyone acting on such +Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in +conjunction with the Program under their own license agreement, and (ii) +are not derivative works of the Program.</p> + +<p>"Contributor" means any person or entity that distributes +the Program.</p> + +<p>"Licensed Patents" mean patent claims licensable by a +Contributor which are necessarily infringed by the use or sale of its +Contribution alone or when combined with the Program.</p> + +<p>"Program" means the Contributions distributed in accordance +with this Agreement.</p> + +<p>"Recipient" means anyone who receives the Program under +this Agreement, including all Contributors.</p> + +<p><b>2. GRANT OF RIGHTS</b></p> + +<p class="list">a) Subject to the terms of this Agreement, each +Contributor hereby grants Recipient a non-exclusive, worldwide, +royalty-free copyright license to reproduce, prepare derivative works +of, publicly display, publicly perform, distribute and sublicense the +Contribution of such Contributor, if any, and such derivative works, in +source code and object code form.</p> + +<p class="list">b) Subject to the terms of this Agreement, each +Contributor hereby grants Recipient a non-exclusive, worldwide, +royalty-free patent license under Licensed Patents to make, use, sell, +offer to sell, import and otherwise transfer the Contribution of such +Contributor, if any, in source code and object code form. This patent +license shall apply to the combination of the Contribution and the +Program if, at the time the Contribution is added by the Contributor, +such addition of the Contribution causes such combination to be covered +by the Licensed Patents. The patent license shall not apply to any other +combinations which include the Contribution. No hardware per se is +licensed hereunder.</p> + +<p class="list">c) Recipient understands that although each Contributor +grants the licenses to its Contributions set forth herein, no assurances +are provided by any Contributor that the Program does not infringe the +patent or other intellectual property rights of any other entity. Each +Contributor disclaims any liability to Recipient for claims brought by +any other entity based on infringement of intellectual property rights +or otherwise. As a condition to exercising the rights and licenses +granted hereunder, each Recipient hereby assumes sole responsibility to +secure any other intellectual property rights needed, if any. For +example, if a third party patent license is required to allow Recipient +to distribute the Program, it is Recipient's responsibility to acquire +that license before distributing the Program.</p> + +<p class="list">d) Each Contributor represents that to its knowledge it +has sufficient copyright rights in its Contribution, if any, to grant +the copyright license set forth in this Agreement.</p> + +<p><b>3. REQUIREMENTS</b></p> + +<p>A Contributor may choose to distribute the Program in object code +form under its own license agreement, provided that:</p> + +<p class="list">a) it complies with the terms and conditions of this +Agreement; and</p> + +<p class="list">b) its license agreement:</p> + +<p class="list">i) effectively disclaims on behalf of all Contributors +all warranties and conditions, express and implied, including warranties +or conditions of title and non-infringement, and implied warranties or +conditions of merchantability and fitness for a particular purpose;</p> + +<p class="list">ii) effectively excludes on behalf of all Contributors +all liability for damages, including direct, indirect, special, +incidental and consequential damages, such as lost profits;</p> + +<p class="list">iii) states that any provisions which differ from this +Agreement are offered by that Contributor alone and not by any other +party; and</p> + +<p class="list">iv) states that source code for the Program is available +from such Contributor, and informs licensees how to obtain it in a +reasonable manner on or through a medium customarily used for software +exchange.</p> + +<p>When the Program is made available in source code form:</p> + +<p class="list">a) it must be made available under this Agreement; and</p> + +<p class="list">b) a copy of this Agreement must be included with each +copy of the Program.</p> + +<p>Contributors may not remove or alter any copyright notices contained +within the Program.</p> + +<p>Each Contributor must identify itself as the originator of its +Contribution, if any, in a manner that reasonably allows subsequent +Recipients to identify the originator of the Contribution.</p> + +<p><b>4. COMMERCIAL DISTRIBUTION</b></p> + +<p>Commercial distributors of software may accept certain +responsibilities with respect to end users, business partners and the +like. While this license is intended to facilitate the commercial use of +the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create +potential liability for other Contributors. Therefore, if a Contributor +includes the Program in a commercial product offering, such Contributor +("Commercial Contributor") hereby agrees to defend and +indemnify every other Contributor ("Indemnified Contributor") +against any losses, damages and costs (collectively "Losses") +arising from claims, lawsuits and other legal actions brought by a third +party against the Indemnified Contributor to the extent caused by the +acts or omissions of such Commercial Contributor in connection with its +distribution of the Program in a commercial product offering. The +obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In +order to qualify, an Indemnified Contributor must: a) promptly notify +the Commercial Contributor in writing of such claim, and b) allow the +Commercial Contributor to control, and cooperate with the Commercial +Contributor in, the defense and any related settlement negotiations. The +Indemnified Contributor may participate in any such claim at its own +expense.</p> + +<p>For example, a Contributor might include the Program in a commercial +product offering, Product X. That Contributor is then a Commercial +Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance +claims and warranties are such Commercial Contributor's responsibility +alone. Under this section, the Commercial Contributor would have to +defend claims against the other Contributors related to those +performance claims and warranties, and if a court requires any other +Contributor to pay any damages as a result, the Commercial Contributor +must pay those damages.</p> + +<p><b>5. NO WARRANTY</b></p> + +<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS +PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS +OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, +ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY +OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and +distributing the Program and assumes all risks associated with its +exercise of rights under this Agreement , including but not limited to +the risks and costs of program errors, compliance with applicable laws, +damage to or loss of data, programs or equipment, and unavailability or +interruption of operations.</p> + +<p><b>6. DISCLAIMER OF LIABILITY</b></p> + +<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT +NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING +WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR +DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED +HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p> + +<p><b>7. GENERAL</b></p> + +<p>If any provision of this Agreement is invalid or unenforceable under +applicable law, it shall not affect the validity or enforceability of +the remainder of the terms of this Agreement, and without further action +by the parties hereto, such provision shall be reformed to the minimum +extent necessary to make such provision valid and enforceable.</p> + +<p>If Recipient institutes patent litigation against any entity +(including a cross-claim or counterclaim in a lawsuit) alleging that the +Program itself (excluding combinations of the Program with other +software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the +date such litigation is filed.</p> + +<p>All Recipient's rights under this Agreement shall terminate if it +fails to comply with any of the material terms or conditions of this +Agreement and does not cure such failure in a reasonable period of time +after becoming aware of such noncompliance. If all Recipient's rights +under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive.</p> + +<p>Everyone is permitted to copy and distribute copies of this +Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The +Agreement Steward reserves the right to publish new versions (including +revisions) of this Agreement from time to time. No one other than the +Agreement Steward has the right to modify this Agreement. The Eclipse +Foundation is the initial Agreement Steward. The Eclipse Foundation may +assign the responsibility to serve as the Agreement Steward to a +suitable separate entity. Each new version of the Agreement will be +given a distinguishing version number. The Program (including +Contributions) may always be distributed subject to the version of the +Agreement under which it was received. In addition, after a new version +of the Agreement is published, Contributor may elect to distribute the +Program (including its Contributions) under the new version. Except as +expressly stated in Sections 2(a) and 2(b) above, Recipient receives no +rights or licenses to the intellectual property of any Contributor under +this Agreement, whether expressly, by implication, estoppel or +otherwise. All rights in the Program not expressly granted under this +Agreement are reserved.</p> + +<p>This Agreement is governed by the laws of the State of New York and +the intellectual property laws of the United States of America. No party +to this Agreement will bring a legal action under this Agreement more +than one year after the cause of action arose. Each party waives its +rights to a jury trial in any resulting litigation.</p> + + + +</body></html>
\ No newline at end of file diff --git a/org.eclipse.osbp.preferences.ui.page/icons/add.gif b/org.eclipse.osbp.preferences.ui.page/icons/add.gif Binary files differnew file mode 100644 index 0000000..252d7eb --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/icons/add.gif diff --git a/org.eclipse.osbp.preferences.ui.page/icons/defaultvalue-no.png b/org.eclipse.osbp.preferences.ui.page/icons/defaultvalue-no.png Binary files differnew file mode 100644 index 0000000..8ba5337 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/icons/defaultvalue-no.png diff --git a/org.eclipse.osbp.preferences.ui.page/icons/defaultvalue-yes.png b/org.eclipse.osbp.preferences.ui.page/icons/defaultvalue-yes.png Binary files differnew file mode 100644 index 0000000..6a4fbe8 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/icons/defaultvalue-yes.png diff --git a/org.eclipse.osbp.preferences.ui.page/icons/delete.gif b/org.eclipse.osbp.preferences.ui.page/icons/delete.gif Binary files differnew file mode 100644 index 0000000..b6922ac --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/icons/delete.gif diff --git a/org.eclipse.osbp.preferences.ui.page/icons/message_error.gif b/org.eclipse.osbp.preferences.ui.page/icons/message_error.gif Binary files differnew file mode 100644 index 0000000..2ff6678 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/icons/message_error.gif diff --git a/org.eclipse.osbp.preferences.ui.page/icons/message_info.gif b/org.eclipse.osbp.preferences.ui.page/icons/message_info.gif Binary files differnew file mode 100644 index 0000000..b484d9b --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/icons/message_info.gif diff --git a/org.eclipse.osbp.preferences.ui.page/icons/message_warning.gif b/org.eclipse.osbp.preferences.ui.page/icons/message_warning.gif Binary files differnew file mode 100644 index 0000000..8e054d0 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/icons/message_warning.gif diff --git a/org.eclipse.osbp.preferences.ui.page/icons/ok.gif b/org.eclipse.osbp.preferences.ui.page/icons/ok.gif Binary files differnew file mode 100644 index 0000000..d5573bb --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/icons/ok.gif diff --git a/org.eclipse.osbp.preferences.ui.page/icons/open.gif b/org.eclipse.osbp.preferences.ui.page/icons/open.gif Binary files differnew file mode 100644 index 0000000..8abf544 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/icons/open.gif diff --git a/org.eclipse.osbp.preferences.ui.page/icons/update.gif b/org.eclipse.osbp.preferences.ui.page/icons/update.gif Binary files differnew file mode 100644 index 0000000..23bb7e0 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/icons/update.gif diff --git a/org.eclipse.osbp.preferences.ui.page/license.html b/org.eclipse.osbp.preferences.ui.page/license.html new file mode 100644 index 0000000..6e579a5 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/license.html @@ -0,0 +1,164 @@ +<!--?xml version="1.0" encoding="ISO-8859-1" ?--> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Eclipse Foundation Software User Agreement</title> +</head> + +<body lang="EN-US"> +<h2>Eclipse Foundation Software User Agreement</h2> +<p>February 1, 2011</p> + +<h3>Usage Of Content</h3> + +<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS + (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND + CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE + OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR + NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND + CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p> + +<h3>Applicable Licenses</h3> + +<p>Unless otherwise indicated, all Content made available by the Eclipse + Foundation is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 + ("EPL"). A copy of the EPL is provided with this Content and is also + available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. + For purposes of the EPL, "Program" will mean the Content.</p> + +<p>Content includes, but is not limited to, source code, object code, +documentation and other files maintained in the Eclipse Foundation +source code + repository ("Repository") in software modules ("Modules") and made +available as downloadable archives ("Downloads").</p> + +<ul> + <li>Content may be structured and packaged into modules to +facilitate delivering, extending, and upgrading the Content. Typical +modules may include plug-ins ("Plug-ins"), plug-in fragments +("Fragments"), and features ("Features").</li> + <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li> + <li>A Feature is a bundle of one or more Plug-ins and/or +Fragments and associated material. Each Feature may be packaged as a +sub-directory in a directory named "features". Within a Feature, files +named "feature.xml" may contain a list of the names and version numbers +of the Plug-ins + and/or Fragments associated with that Feature.</li> + <li>Features may also include other Features ("Included +Features"). Within a Feature, files named "feature.xml" may contain a +list of the names and version numbers of Included Features.</li> +</ul> + +<p>The terms and conditions governing Plug-ins and Fragments should be +contained in files named "about.html" ("Abouts"). The terms and +conditions governing Features and +Included Features should be contained in files named "license.html" +("Feature Licenses"). Abouts and Feature Licenses may be located in any + directory of a Download or Module +including, but not limited to the following locations:</p> + +<ul> + <li>The top-level (root) directory</li> + <li>Plug-in and Fragment directories</li> + <li>Inside Plug-ins and Fragments packaged as JARs</li> + <li>Sub-directories of the directory named "src" of certain Plug-ins</li> + <li>Feature directories</li> +</ul> + +<p>Note: if a Feature made available by the Eclipse Foundation is +installed using the Provisioning Technology (as defined below), you must + agree to a license ("Feature Update License") during the +installation process. If the Feature contains Included Features, the +Feature Update License should either provide you with the terms and +conditions governing the Included Features or +inform you where you can locate them. Feature Update Licenses may be +found in the "license" property of files named "feature.properties" +found within a Feature. +Such Abouts, Feature Licenses, and Feature Update Licenses contain the +terms and conditions (or references to such terms and conditions) that +govern your use of the associated Content in +that directory.</p> + +<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER +TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. + SOME OF THESE +OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p> + +<ul> + <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li> + <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li> + <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li> + <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li> + <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li> + <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li> +</ul> + +<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND +CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, +or Feature Update License is provided, please +contact the Eclipse Foundation to determine what terms and conditions +govern that particular Content.</p> + + +<h3>Use of Provisioning Technology</h3> + +<p>The Eclipse Foundation makes available provisioning software, +examples of which include, but are not limited to, p2 and the Eclipse + Update Manager ("Provisioning Technology") for the purpose of +allowing users to install software, documentation, information and/or + other materials (collectively "Installable Software"). This +capability is provided with the intent of allowing such users to + install, extend and update Eclipse-based products. Information about +packaging Installable Software is available at <a href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a> + ("Specification").</p> + +<p>You may use Provisioning Technology to allow other parties to install + Installable Software. You shall be responsible for enabling the + applicable license agreements relating to the Installable Software to + be presented to, and accepted by, the users of the Provisioning +Technology + in accordance with the Specification. By using Provisioning +Technology in such a manner and making it available in accordance with +the + Specification, you further acknowledge your agreement to, and the +acquisition of all necessary rights to permit the following:</p> + +<ol> + <li>A series of actions may occur ("Provisioning Process") in +which a user may execute the Provisioning Technology + on a machine ("Target Machine") with the intent of installing, +extending or updating the functionality of an Eclipse-based + product.</li> + <li>During the Provisioning Process, the Provisioning Technology +may cause third party Installable Software or a portion thereof to be + accessed and copied to the Target Machine.</li> + <li>Pursuant to the Specification, you will provide to the user +the terms and conditions that govern the use of the Installable + Software ("Installable Software Agreement") and such Installable +Software Agreement shall be accessed from the Target + Machine in accordance with the Specification. Such Installable +Software Agreement must inform the user of the terms and conditions that + govern + the Installable Software and must solicit acceptance by the end +user in the manner prescribed in such Installable Software Agreement. +Upon such + indication of agreement by the user, the provisioning Technology +will complete installation of the Installable Software.</li> +</ol> + +<h3>Cryptography</h3> + +<p>Content may contain encryption software. The country in which you are + currently may have restrictions on the import, possession, and use, +and/or re-export to + another country, of encryption software. BEFORE using any encryption +software, please check the country's laws, regulations and policies +concerning the import, + possession, or use, and re-export of encryption software, to see if +this is permitted.</p> + +<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p> + + +</body></html>
\ No newline at end of file diff --git a/org.eclipse.osbp.preferences.ui.page/notice.html b/org.eclipse.osbp.preferences.ui.page/notice.html new file mode 100644 index 0000000..c3d34c3 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/notice.html @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +<title>Eclipse Foundation Software User Agreement</title> +</head> + +<body lang="EN-US"> +<h2>Eclipse Foundation Software User Agreement</h2> +<p>April 9, 2014</p> + +<h3>Usage Of Content</h3> + +<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS + (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND + CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE + OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR + NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND + CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p> + +<h3>Applicable Licenses</h3> + +<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 + ("EPL"). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. + For purposes of the EPL, "Program" will mean the Content.</p> + +<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code + repository ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").</p> + +<ul> + <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").</li> + <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li> + <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins + and/or Fragments associated with that Feature.</li> + <li>Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.</li> +</ul> + +<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and +Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module +including, but not limited to the following locations:</p> + +<ul> + <li>The top-level (root) directory</li> + <li>Plug-in and Fragment directories</li> + <li>Inside Plug-ins and Fragments packaged as JARs</li> + <li>Sub-directories of the directory named "src" of certain Plug-ins</li> + <li>Feature directories</li> +</ul> + +<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license ("Feature Update License") during the +installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or +inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature. +Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in +that directory.</p> + +<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE +OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p> + +<ul> + <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li> + <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li> + <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li> + <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li> + <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li> +</ul> + +<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please +contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p> + + +<h3>Use of Provisioning Technology</h3> + +<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse + Update Manager ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or + other materials (collectively "Installable Software"). This capability is provided with the intent of allowing such users to + install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a + href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a> + ("Specification").</p> + +<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the + applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology + in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the + Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p> + +<ol> + <li>A series of actions may occur ("Provisioning Process") in which a user may execute the Provisioning Technology + on a machine ("Target Machine") with the intent of installing, extending or updating the functionality of an Eclipse-based + product.</li> + <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be + accessed and copied to the Target Machine.</li> + <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable + Software ("Installable Software Agreement") and such Installable Software Agreement shall be accessed from the Target + Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern + the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such + indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li> +</ol> + +<h3>Cryptography</h3> + +<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to + another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, + possession, or use, and re-export of encryption software, to see if this is permitted.</p> + +<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p> +</body> +</html> diff --git a/org.eclipse.osbp.preferences.ui.page/plugin.properties b/org.eclipse.osbp.preferences.ui.page/plugin.properties new file mode 100644 index 0000000..2df4c12 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/plugin.properties @@ -0,0 +1,2 @@ +pluginName = Product Configuration Page +providerName = Loetz GmbH&Co.KG, 69115 Heidelberg, Germany diff --git a/org.eclipse.osbp.preferences.ui.page/plugin.xml b/org.eclipse.osbp.preferences.ui.page/plugin.xml new file mode 100644 index 0000000..e490f95 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/plugin.xml @@ -0,0 +1,201 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.0"?> + +<plugin> + <!-- any preference pages --> + <extension + point="org.eclipse.ui.preferencePages"> + <page + class="org.eclipse.osbp.preferences.ui.page.PreferencePageMain" + id="org.eclipse.osbp.preferences.ui.page.PreferencePageMain" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="OSBP Application Configuration"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PreferencePageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageAuthentication" + id="org.eclipse.osbp.preferences.ui.page.PreferencePageAuthentication" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Authentication"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PreferencePageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageEmail" + id="org.eclipse.osbp.preferences.ui.page.PreferencePageEmail" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Email"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PreferencePageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageDataSources" + id="org.eclipse.osbp.preferences.ui.page.PreferencePageDataSources" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Data Sources"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PreferencePageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePagePersistenceUnits" + id="org.eclipse.osbp.preferences.ui.page.PreferencePagePersistenceUnits" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="PersistenceUnits"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PreferencePageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageLocalization" + id="org.eclipse.osbp.preferences.ui.page.PreferencePageLocalization" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Localization"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PreferencePageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageServiceCommunication" + id="org.eclipse.osbp.preferences.ui.page.PreferencePageServiceCommunication" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Service Communication"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PreferencePageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageExternalDataSources" + id="org.eclipse.osbp.preferences.ui.page.PreferencePageExternalDataSources" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="External Data Sources"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PreferencePageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageDemo" + id="org.eclipse.osbp.preferences.ui.page.PreferencePageDemo" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Controls"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PreferencePageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageProjectWizard" + id="org.eclipse.osbp.preferences.ui.page.PreferencePageProjectWizard" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Project Wizard"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PreferencePageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageBpmEngine" + id="org.eclipse.osbp.preferences.ui.page.PreferencePageBpmEngine" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Bpm Engine"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PreferencePageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageVerifyDependencies" + id="org.eclipse.osbp.preferences.ui.page.PreferencePageVerifyDependencies" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Verify Dependencies"> + </page> + <!-- + <page + category="org.eclipse.osbp.preferences.ui.page.PreferencePageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageHybridClient" + id="org.eclipse.osbp.preferences.ui.page.PreferencePageHybridClient" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Embedded Web-Client"> + </page> + --> + </extension> + + <!-- any property pages --> + <extension + point="org.eclipse.ui.propertyPages"> + <page + class="org.eclipse.osbp.preferences.ui.page.PreferencePageMain" + id="org.eclipse.osbp.preferences.ui.page.PropertyPageMain" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="OSBP Application Configuration"> + <enabledWhen> + <adapt type="org.eclipse.core.resources.IProject"/> + </enabledWhen> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PropertyPageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageAuthentication" + id="org.eclipse.osbp.preferences.ui.page.PropertyPageAuthentication" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Authentication"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PropertyPageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageEmail" + id="org.eclipse.osbp.preferences.ui.page.PreferencePageEmail" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Email"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PropertyPageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageDataSources" + id="org.eclipse.osbp.preferences.ui.page.PropertyPageDataSources" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Data Sources"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PropertyPageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePagePersistenceUnits" + id="org.eclipse.osbp.preferences.ui.page.PreferencePagePersistenceUnits" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Persistence Units"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PropertyPageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageLocalization" + id="org.eclipse.osbp.preferences.ui.page.PropertyPageLocalization" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Localization"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PropertyPageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageServiceCommunication" + id="org.eclipse.osbp.preferences.ui.page.PropertyPageServiceCommunication" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Service Communication"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PropertyPageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageExternalDataSources" + id="org.eclipse.osbp.preferences.ui.page.PropertyPageExternalDataSources" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="External Data Sources"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PropertyPageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageDemo" + id="org.eclipse.osbp.preferences.ui.page.PropertyPageDemo" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Controls"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PropertyPageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageProjectWizard" + id="org.eclipse.osbp.preferences.ui.page.PropertyPageProjectWizard" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Project Wizard"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PropertyPageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageBpmEngine" + id="org.eclipse.osbp.preferences.ui.page.PropertyPageBpmEngine" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Bpm Engine"> + </page> + <page + category="org.eclipse.osbp.preferences.ui.page.PropertyPageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageVerifyDependencies" + id="org.eclipse.osbp.preferences.ui.page.PreferencePageVerifyDependencies" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Verify Dependencies"> + </page> + <!-- + <page + category="org.eclipse.osbp.preferences.ui.page.PropertyPageMain" + class="org.eclipse.osbp.preferences.ui.page.PreferencePageHybridClient" + id="org.eclipse.osbp.preferences.ui.page.PropertyPageHybridClient" + noicon="platform:/plugin/org.eclipse.osbp.preferences.ui.page/icons/osbp-symbol-16x16-text.png" + name="Embedded Web-Client"> + </page> + --> + </extension> +</plugin> diff --git a/org.eclipse.osbp.preferences.ui.page/pom.xml b/org.eclipse.osbp.preferences.ui.page/pom.xml new file mode 100644 index 0000000..93654c3 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/pom.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--#======================================================================= --> +<!--# Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) --> +<!--# All rights reserved. This program and the accompanying materials --> +<!--# are made available under the terms of the Eclipse Public License v1.0 --> +<!--# which accompanies this distribution, and is available at --> +<!--# http://www.eclipse.org/legal/epl-v10.html --> +<!--# --> +<!--# Contributors: --> +<!--# Christophe Loetz (Loetz GmbH&Co.KG) - initial API and implementation --> +<!--#======================================================================= --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <artifactId>org.eclipse.osbp.preferences.ui.page</artifactId> + <build> + <sourceDirectory>src</sourceDirectory> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.1</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> + </plugin> + </plugins> + </build> + <parent> + <groupId>org.eclipse.osbp.preferences</groupId> + <artifactId>org.eclipse.osbp.preferences.aggregator</artifactId> + <version>0.9.0-SNAPSHOT</version> + <relativePath>..</relativePath> + </parent> + <packaging>eclipse-plugin</packaging> +</project> diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/APreferencePage.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/APreferencePage.java new file mode 100644 index 0000000..9ebfa77 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/APreferencePage.java @@ -0,0 +1,324 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.component; + +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.preference.ComboFieldEditor; +import org.eclipse.jface.preference.FieldEditor; +import org.eclipse.jface.preference.FieldEditorPreferencePage; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.preference.StringFieldEditor; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.JFaceResources; +import org.eclipse.osbp.preferences.Preference; +import org.eclipse.osbp.preferences.ProductConfiguration; +import org.eclipse.osbp.preferences.ui.data.ProductConfigurationStore; +import org.eclipse.osbp.preferences.ui.utils.ConfigurationFileVerifier.ConfigurationFileDescription; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CLabel; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; +import org.eclipse.ui.IWorkbenchPropertyPage; +import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; +import org.eclipse.xtext.ui.editor.preferences.fields.LabelFieldEditor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +abstract public class APreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage, IWorkbenchPropertyPage, IPreferenceCheckStateProvider { + + protected enum PageType { + PREFENCE, + PROPERTY + } + + private static final Logger LOGGER = LoggerFactory.getLogger(ProductConfiguration.class); + + // Online REGEX Tester: http://java-regex-tester.appspot.com/ + public final static String REGEX_URL_XML_FILE = "(file|http|https)://(.)*\\.xml"; + + private final static String I18NPACKAGE = "preferences."; + + private final String fDescription; + private Item[] fItems; + private Button defaultsApplyButton; + protected boolean createDefaultAndApplyButton = true; + protected boolean defaultButtonAvailable = true; + + protected ProductConfigurationStore store; + + private PageType fPageType; + private IAdaptable fAdaptable; + + public final static String DEFAULT_VALUE_NO = "message_info.gif";//"defaultvalue-no.png"; + public final static String DEFAULT_VALUE_YES = "defaultvalue-yes.png"; + + public final static String STATUS_TODO = "open.gif"; + public final static String STATUS_OK = "ok.gif"; + public final static String STATUS_WARNING = "message_warning.gif"; + public final static String STATUS_INFO = "message_info.gif"; + public final static String STATUS_ERROR = "message_error.gif"; + + public final static String ITEM_TO_ADD = "add.gif"; + public final static String ITEM_TO_UPDATE = "update.gif"; + public final static String ITEM_TO_REMOVE = "delete.gif"; + + public static void showLabelDefaultHint(CLabel label, boolean isDefault) { + if (!isDefault) { + label.setImage(APreferencePage.getImage(DEFAULT_VALUE_NO)); + } + else { + label.setImage(APreferencePage.getImage(DEFAULT_VALUE_YES)); + } + } + + @Override + protected void noDefaultAndApplyButton() { + super.noDefaultAndApplyButton(); + createDefaultAndApplyButton = false; + } + + public static Image getImage(String imageName) { + try { + return getImageDesc(imageName).createImage(); + } + catch (Exception e) {} // NOP + return null; + } + + public static ImageDescriptor getImageDesc(String imageName) { + try { + return IDEWorkbenchPlugin.imageDescriptorFromPlugin( + "org.eclipse.osbp.preferences.ui.page", + "/icons/"+imageName);//$NON-NLS-1$ + } + catch (Exception e) {} // NOP + return null; + } + + public APreferencePage(String pageName, String description) { + super(I18NPACKAGE+pageName, GRID); + fPageType = PageType.PREFENCE; + setPreferenceStore(ProductConfigurationStore.instance()); + fDescription = description; + } + + @Override + public void setTitle(String title) { + super.setTitle(title); +// try { +// setImageDescriptor(getImageDesc("osbp-symbol-23x23.png")); +// } +// catch (Exception e) {} // NOP + } + + protected boolean isPageType(PageType pageType) { + return pageType == fPageType; + } + + @Override + public void dispose() { + store.removeProductConfigurationPrefsChangedListener(this); + super.dispose(); + } + + @Override + public void setPreferenceStore(IPreferenceStore store) { + super.setPreferenceStore(store); + this.store = (ProductConfigurationStore) store; + this.store.addProductConfigurationPrefsChangedListener(this); + } + + public void productConfigurationPrefsChanged() { + initialize(); + } + + protected abstract Item[] initializeItems(); + + protected Button getDefaultsApplyButton() { + return defaultsApplyButton; + } + + @Override + protected void contributeButtons(Composite buttonBar) { + if (createDefaultAndApplyButton) { + String[] labels = JFaceResources.getStrings(new String[] { + "defaults", "apply" }); //$NON-NLS-2$//$NON-NLS-1$ + int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); + defaultsApplyButton = new Button(buttonBar, SWT.PUSH); + defaultsApplyButton.setText((labels[0]+" + "+labels[1]).replace("&", "")); + Dialog.applyDialogFont(defaultsApplyButton); + GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); + Point minButtonSize = defaultsApplyButton.computeSize(SWT.DEFAULT, + SWT.DEFAULT, true); + data.widthHint = Math.max(widthHint, minButtonSize.x); + defaultsApplyButton.setLayoutData(data); + defaultsApplyButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + performDefaults(); + performOk(); + } + }); + GridLayout layout = (GridLayout) buttonBar.getLayout(); + layout.numColumns = layout.numColumns + 1; + } + } + + @Override + public void createControl(Composite parent) { + super.createControl(parent); + if (getDefaultsButton() != null) { + getDefaultsButton().setEnabled(defaultButtonAvailable); + } + } + + @Override + public final void createFieldEditors() { + fItems = initializeItems(); + Composite parent = getFieldEditorParent(); + for (Item item : fItems) { + boolean callEnable = true; + boolean enabled = item.fEnabled; + switch (item.fType) { + case BOOLEAN: + item.fEditor = new HookedBooleanFieldEditor(item.fPreference.toString(), item.fLabel, parent); + break; + case DIRECTORY: + item.fEditor = new HookedDirectoryFieldEditor(item.fPreference.toString(), item.fLabel, this, parent); + break; + case INTEGER: + item.fEditor = new HookedIntegerFieldEditor(item.fPreference.toString(), item.fLabel, this, parent); + break; + case LABEL: + item.fEditor = new LabelFieldEditor(item.fLabel, parent); + break; + case MULTILINE: + item.fEditor = new HookedMultilineStringFieldEditor(item.fPreference.toString(), item.fLabel, this, parent); + break; + case SELECT: + item.fEditor = new ComboFieldEditor(item.fPreference.toString(), item.fLabel, item.fNamesValues, parent); + break; + case TABLE: + // https://svn.apache.org/repos/asf/click/tags/clickide-1-6-0/net.sf.clickide/src/net/sf/clickide/preferences/ClickTemplatePreferencePage.java + break; + case TEXT: + case EMAIL: // @TODO: enable email validation + case PASSWORD: // @TODO: enable password "validation" + case SERVER: // @TODO: enable server validation + item.fEditor = new HookedStringFieldEditor(item.fPreference.toString(), item.fLabel, this, parent); + ((HookedStringFieldEditor)item.fEditor).getTextControl(parent).setEditable(enabled); + enabled = true; + break; + case LINK: + item.fEditor = new LinkFieldEditor(item.fPreference.toString(), item.fLabel, parent); + break; + case LIST_ADD_REMOVE: + item.fEditor = new AddRemoveListFieldEditor(item.fPreference.toString(), item.fLabel, item.fNamesValues, parent); + ((AddRemoveListFieldEditor) item.fEditor).setSeperator(item.fSeparator); + break; + case TREE_DATASOURCES: + item.fEditor = new DataSourcesFieldEditor(item.fPreference.toString(), item.fLabel, parent); + defaultButtonAvailable = false; + break; + case TREE_PERSISTENCEUNITS: + item.fEditor = new PersistenceUnitsFieldEditor(item.fPreference.toString(), item.fLabel, parent); + defaultButtonAvailable = false; + break; + case FILE_EDITOR: + item.fEditor = new FileOpenCallEditor(item.fPreference.toString(), item.fLabel, parent); + callEnable = false; + break; + case TREE_PRODUCTCONFIGURATION: + item.fEditor = new ProductConfigurationFieldEditor(item.fPreference.toString(), item.fLabel, parent); + defaultButtonAvailable = false; + break; + } + addField(item.fEditor); + if (callEnable) { + item.fEditor.setEnabled(enabled, parent); + } + } + } + + public FieldEditor getEditor(Preference preference) { + if (fItems != null) { + for (Item item : fItems) { + if (preference.equals(item.fPreference)) { + return item.fEditor; + } + } + } + return null; + } + + public Object getValue(Preference preference) { + FieldEditor editor = getEditor(preference); + Object value = null; + try { + if (editor != null) { + if (editor instanceof StringFieldEditor) { + value = ((StringFieldEditor)editor).getTextControl(getFieldEditorParent()).getText(); + } + } + } + catch (Exception e) { + e.printStackTrace(); + } + return value; + } + + @Override + protected void initialize() { + try { + super.initialize(); + } + catch (IllegalArgumentException iae) { + LOGGER.error("initialize()... ", iae); + } + } + + @Override + public boolean doCheckState(FieldEditor editor, String input) { + return true; + } + + @Override + public final void init(IWorkbench workbench) { + setDescription(fDescription); + } + + @Override + public IAdaptable getElement() { + return fAdaptable; + } + + @Override + public void setElement(IAdaptable element) { + fPageType = PageType.PROPERTY; + fAdaptable = element; + if (element instanceof IJavaProject) { + store.selectOsbpProductProject(((IJavaProject)element).getProject()); + } + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/ATableTreeFieldEditor.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/ATableTreeFieldEditor.java new file mode 100644 index 0000000..805c08e --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/ATableTreeFieldEditor.java @@ -0,0 +1,418 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.component; + +import java.util.Map; + +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.preference.FieldEditor; +import org.eclipse.osbp.preferences.DataSourceConfiguration; +import org.eclipse.osbp.preferences.EnumDatabaseVendor; +import org.eclipse.osbp.preferences.ItemDescription; +import org.eclipse.osbp.preferences.Preference; +import org.eclipse.osbp.preferences.ProductConfigurationPrefs.DDL_GENERATION; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.TableTree; +import org.eclipse.swt.custom.TableTreeEditor; +import org.eclipse.swt.custom.TableTreeItem; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.Text; + +public abstract class ATableTreeFieldEditor extends FieldEditor { + + private final static String DEFAULT_ADD_LABEL = "duplicate"; + private final static String DEFAULT_REMOVE_LABEL = "remove"; + + // The top-level control for the field editor. + private Composite top; + // The list of selected tags. + protected TableTree tableTree; + TableTreeEditor editor; + private Table innerTable; + // The button for adding the contents of + // the available list to the selected list. + private Button add; + // The button for removing the currently-selected list item. + private Button remove; + private final ItemDescription fItemDescription; + protected Label label; + + public ATableTreeFieldEditor( + String name, + String labelText, + Composite parent, + ItemDescription itemDescription) { + super(name, labelText, parent); + fItemDescription = itemDescription; + } + + protected ItemDescription getItemDescription() { + return fItemDescription; + } + + /** + * @see org.eclipse.jface.preference.FieldEditor#doFillIntoGrid + * (Composite, int) + */ + protected void doFillIntoGrid(Composite parent, int numColumns) { + top = parent; + + int buttonWidth = convertHorizontalDLUsToPixels(top, IDialogConstants.BUTTON_WIDTH); + int buttonHeight = convertVerticalDLUsToPixels(top, IDialogConstants.BUTTON_HEIGHT); + + GridData gd = new GridData(GridData.FILL_HORIZONTAL); + gd.horizontalSpan = numColumns; + top.setLayoutData(gd); + + label = getLabelControl(top); + GridData labelData = new GridData(); + labelData.horizontalSpan = numColumns; + label.setLayoutData(labelData); + + tableTree = new TableTree(top, SWT.BORDER | SWT.V_SCROLL | SWT.FILL); + GridData tableTreeData = new GridData(GridData.FILL_HORIZONTAL); + tableTreeData.horizontalSpan = numColumns; + tableTreeData.heightHint = buttonHeight * 15; + tableTree.setLayoutData(tableTreeData); + tableTree.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + selectionChanged(); + } + }); + + editor = new TableTreeEditor(tableTree); + //The editor must have the same size as the cell and must + //not be any smaller than 50 pixels. + editor.horizontalAlignment = SWT.LEFT; + editor.grabHorizontal = true; + editor.minimumWidth = 50; + // editing the second column + final int EDITABLECOLUMN = TableTreeDescribedItem.VALUE; + + tableTree.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + // Clean up any previous editor control + Control oldEditor = editor.getEditor(); + if (oldEditor != null) oldEditor.dispose(); + + // Identify the selected row + TableTreeItem item = (TableTreeItem)e.item; + if (item == null) return; + + // The control that will be the editor must be a child of the Table + Control newEditor; + if ((ATableTreeFieldEditor.this instanceof DataSourcesFieldEditor) && + (item.getText(0).toLowerCase().contains("type"))) { + final Combo comboEditor = new Combo(innerTable, SWT.DROP_DOWN | SWT.READ_ONLY); + newEditor = comboEditor; + String selection = item.getText(EDITABLECOLUMN); + int index = 0; + for (EnumDatabaseVendor vendor : EnumDatabaseVendor.values()) { + String text = vendor.toString(); + comboEditor.add(text); + if (text.equals(selection)) { + comboEditor.select(index); + } + index++; + } + comboEditor.addListener(SWT.Modify, new Listener() { + public void handleEvent(Event e) { + editor.getItem().setText(EDITABLECOLUMN, comboEditor.getText()); + } + }); + } + else if ((ATableTreeFieldEditor.this instanceof PersistenceUnitsFieldEditor) && + (item.getText(0).toLowerCase().contains("source"))) { + final Combo comboEditor = new Combo(innerTable, SWT.DROP_DOWN | SWT.READ_ONLY); + newEditor = comboEditor; + String selection = item.getText(EDITABLECOLUMN); + int index = 0; + String value = getPreferenceStore().getString(Preference.DATASOURCES.toString()); + Map<String, DataSourceConfiguration> dataItems = DataSourceConfiguration.deserialize(value); + for (DataSourceConfiguration dataItem : dataItems.values()) { + String text = dataItem.getName(); + comboEditor.add(text); + if (text.equals(selection)) { + comboEditor.select(index); + } + index++; + } + comboEditor.addListener(SWT.Modify, new Listener() { + public void handleEvent(Event e) { + editor.getItem().setText(EDITABLECOLUMN, comboEditor.getText()); + } + }); + } + else if ((ATableTreeFieldEditor.this instanceof PersistenceUnitsFieldEditor) && + (item.getText(0).toLowerCase().contains("ddl"))) { + final Combo comboEditor = new Combo(innerTable, SWT.DROP_DOWN | SWT.READ_ONLY); + newEditor = comboEditor; + String selection = item.getText(EDITABLECOLUMN); + int index = 0; + for (DDL_GENERATION dataItem : DDL_GENERATION.values()) { + String text = "EclipseLink: "+dataItem.eclipseLink()+" / Hibernate: "+dataItem.hibernate(); + comboEditor.add(text); + if (dataItem.eclipseLink().equals(selection)) { + comboEditor.select(index); + } + index++; + } + comboEditor.addListener(SWT.Modify, new Listener() { + public void handleEvent(Event e) { + editor.getItem().setText(EDITABLECOLUMN, comboEditor.getText().split(" ")[1]); + } + }); + } + else { + final Text textEditor = new Text(innerTable, SWT.NONE); + newEditor = textEditor; + textEditor.setText(item.getText(EDITABLECOLUMN)); + textEditor.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + editor.getItem().setText(EDITABLECOLUMN, textEditor.getText()); + } + }); + textEditor.selectAll(); + } + newEditor.setFocus(); + editor.setEditor(newEditor, item, EDITABLECOLUMN); + } + }); + + // Create the TableTree and set some attributes on the underlying table + innerTable = tableTree.getTable(); + innerTable.setHeaderVisible(false); + innerTable.setLinesVisible(false); + GridData innerTableData = new GridData(GridData.FILL_BOTH); + innerTable.setLayoutData(innerTable); + + // Create the columns, passing the underlying table + (new org.eclipse.swt.widgets.TableColumn(innerTable, SWT.FILL)).setText("Attribute"); + (new org.eclipse.swt.widgets.TableColumn(innerTable, SWT.FILL)).setText("Value"); + (new org.eclipse.swt.widgets.TableColumn(innerTable, SWT.FILL)).setText(""); + + // Create the remove button. + if (hasRemoveButton()) { + remove = new Button(top, SWT.NONE); + remove.setEnabled(false); + remove.setText(DEFAULT_REMOVE_LABEL); + remove.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + remove(); + } + }); + GridData removeData = new GridData(); //GridData.FILL_HORIZONTAL); + removeData.heightHint = buttonHeight; + removeData.widthHint = buttonWidth; + remove.setLayoutData(removeData); + } + + // Create the add button. + if (hasAddButton()) { + add = new Button(top, SWT.NONE); + add.setEnabled(false); + add.setText(DEFAULT_ADD_LABEL); + add.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + add(); + } + }); + GridData addData = new GridData(); //GridData.FILL_HORIZONTAL); + addData.heightHint = buttonHeight; + addData.widthHint = buttonWidth; + add.setLayoutData(addData); + } + } + + abstract protected boolean hasRemoveButton(); + abstract protected boolean hasAddButton(); + + /** + * @see org.eclipse.jface.preference.FieldEditor#doLoad() + */ + protected void doLoad() { + doLoad(getPreferenceStore().getString(getPreferenceName())); + } + + /** + * @see org.eclipse.jface.preference.FieldEditor#doLoadDefault() + */ + protected void doLoadDefault() { + doLoad(getPreferenceStore().getDefaultString(getPreferenceName())); + } + + private void doLoad(String value) { + tableTree.removeAll(); + _doLoad(value, getPreferenceStore().getDefaultString(getPreferenceName())); + org.eclipse.swt.widgets.TableColumn[] columns = innerTable.getColumns(); + for (int i = 0, n = 3; i < n; i++) { + columns[i].pack(); + if (i == TableTreeDescribedItem.HINT) { + columns[i].setWidth(30); + } + else { + columns[i].setWidth(columns[i].getWidth()*2); + } + } + //columns[2].pack(); + //columns[2].setWidth(30); + Control oldEditor = editor.getEditor(); + if (oldEditor != null) { + oldEditor.dispose(); + } +// showDefaultHint(); + } + + abstract protected void _doLoad(String value, String defaults); + + /** + * @see org.eclipse.jface.preference.FieldEditor#doStore() + */ + protected void doStore() { + String s = _doStore(); + if (s != null) { + getPreferenceStore().setValue(getPreferenceName(), s); + doLoad(); + } + } + + abstract protected String _doStore(); + + /** + * @see org.eclipse.jface.preference.FieldEditor#getNumberOfControls() + */ + public int getNumberOfControls() { + // The button composite and the text field. + return 2; + } + + // Adds the string in the text field to the list. + private void add() { + if (tableTree.getSelectionCount() == 1) { + TableTreeItem source = tableTree.getSelection()[0]; + while ((source != null) && (source.getParentItem() != null)) { + source = source.getParentItem(); + } + if (source != null) { + TableTreeDescribedItem.clone(source, "Copy"); + Control oldEditor = editor.getEditor(); + if (oldEditor != null) oldEditor.dispose(); + } +// showDefaultHint(); + } + } + + private void remove() { + if (tableTree.getSelectionCount() == 1) { + TableTreeItem selected = tableTree.getSelection()[0]; + while ((selected != null) && (selected.getParentItem() != null)) { + selected = selected.getParentItem(); + } + if (selected != null) { + selected.dispose(); + Control oldEditor = editor.getEditor(); + if (oldEditor != null) oldEditor.dispose(); + } +// showDefaultHint(); + } + } + + /** + * Sets the label for the button that adds + * the contents of the text field to the list. + */ + public void setAddButtonText(String text) { + if (add != null) { + add.setText(text); + } + } + + /** + * Sets the label for the button that removes + * the selected item from the list. + */ + public void setRemoveButtonText(String text) { + if (remove != null) { + remove.setText(text); + } + } + + // Sets the enablement of the remove button depending + // on the selection in the list. + private void selectionChanged() { + int index = tableTree.getSelectionCount(); + if (add != null) { + add.setEnabled(index == 1); + } + if (remove != null) { + remove.setEnabled((index == 1) && (tableTree.getItemCount() > 1)); + } + } + + /** + * @see org.eclipse.jface.preference.FieldEditor#adjustForNumColumns(int) + */ + protected void adjustForNumColumns(int numColumns) { + ((GridData)top.getLayoutData()).horizontalSpan = numColumns; + } + +// protected void showDefaultHint() { +// TreeSet<String> active = new TreeSet<>(); +// for (String item : _doStore().split(";")) { +// active.add(item); +// } +// TreeSet<String> defaults = new TreeSet<>(); +// for (String item : getPreferenceStore().getDefaultString(getPreferenceName()).split(";")) { +// defaults.add(item); +// } +// APreferencePage.showLabelDefaultHint(label, active.equals(defaults)); +// } + +// @Override +// public Label getLabelControl(Composite parent) { +// if (label == null) { +// label = new CLabel(parent, SWT.LEFT | SWT.RIGHT_TO_LEFT); +// label.setFont(parent.getFont()); +// String text = getLabelText(); +// if (text != null) { +// label.setText(text); +// } +// label.addDisposeListener(new DisposeListener() { +// @Override +// public void widgetDisposed(DisposeEvent event) { +// label = null; +// } +// }); +// } else { +// checkParent(label, parent); +// } +// return null; +// } + +// @Override +// public void setEnabled(boolean enabled, Composite parent) { +// label.setEnabled(enabled); +// } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/AddRemoveListFieldEditor.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/AddRemoveListFieldEditor.java new file mode 100644 index 0000000..33561ff --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/AddRemoveListFieldEditor.java @@ -0,0 +1,413 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.component; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Set; +import java.util.StringTokenizer; +import java.util.TreeSet; + +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.preference.FieldEditor; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CLabel; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.List; + +/** + * A field editor for displaying and storing a list of strings. + * Buttons are provided for adding items to the list and removing + * items from the list. + */ +public class AddRemoveListFieldEditor extends FieldEditor { + private static final String TO_LEFT_SIGN = "<"; //"\u0171"; + private static final String TO_RIGHT_SIGN = ">"; //"\u0187"; + + private static final String DEFAULT_SELECT_LABEL = TO_LEFT_SIGN+" select "+TO_LEFT_SIGN; + private static final String DEFAULT_DESELECT_LABEL = TO_RIGHT_SIGN+" deselect "+TO_RIGHT_SIGN; + private static final String DEFAULT_SEPERATOR = ";"; + + private static final int VERTICAL_DIALOG_UNITS_PER_CHAR = 8; + private static final int HORIZONTAL_DIALOG_UNITS_PER_CHAR = 4; + private static final int LIST_HEIGHT_IN_CHARS = 10; + private static final int LIST_HEIGHT_IN_DLUS = LIST_HEIGHT_IN_CHARS * VERTICAL_DIALOG_UNITS_PER_CHAR; + + // The top-level control for the field editor. + private Composite top; + // The list of selected tags. + private List selectedList; + // The list with available and not selected tags. + private List availableList; + // The button for adding the contents of + // the available list to the selected list. + private Button select; + // The button for removing the currently-selected list item. + private Button deselect; + // The string used to seperate list items + // in a single String representation. + private String seperator = DEFAULT_SEPERATOR; + protected CLabel label; + + private String[][]availableNamesAndValues; + + public AddRemoveListFieldEditor( + String name, + String labelText, + String[][] availableNamesAndValues, + Composite parent) { + super(name, labelText, parent); + this.availableNamesAndValues = availableNamesAndValues; + } + + public AddRemoveListFieldEditor( + String name, + String labelText, + String[][] availableNamesAndValues, + String selectButtonText, + String deselectButtonText, + Composite parent) { + this(name, labelText, availableNamesAndValues, parent); + setSelectButtonText(selectButtonText); + setDeselectButtonText(deselectButtonText); + } + + public void setAvailableNamesAndValues(String[][] availableNamesAndValues) { + this.availableNamesAndValues = availableNamesAndValues; + refreshAvailableList(); + } + + /** + * @see org.eclipse.jface.preference.FieldEditor#adjustForNumColumns(int) + */ + protected void adjustForNumColumns(int numColumns) { + ((GridData)top.getLayoutData()).horizontalSpan = numColumns; + } + + /** + * @see org.eclipse.jface.preference.FieldEditor#doFillIntoGrid + * (Composite, int) + */ + protected void doFillIntoGrid(Composite parent, int numColumns) { + top = parent; + + int buttonWidth = convertHorizontalDLUsToPixels(top, IDialogConstants.BUTTON_WIDTH); + int buttonHeight = convertVerticalDLUsToPixels(top, IDialogConstants.BUTTON_HEIGHT); + + GridData gd = new GridData(GridData.FILL_HORIZONTAL); + gd.horizontalSpan = numColumns; + top.setLayoutData(gd); + + getLabelControl(top); + GridData labelData = new GridData(); + labelData.horizontalSpan = numColumns; + label.setLayoutData(labelData); + + Composite components = new Composite(top, SWT.NONE); + + GridData componentsData = new GridData(); + componentsData.horizontalSpan = numColumns; + componentsData.heightHint = buttonHeight * 10+10; + components.setLayoutData(componentsData); + //components.setBackground(new org.eclipse.swt.graphics.Color(components.getDisplay(), 255,255,255)); + GridLayout componentsLayout = new GridLayout(3, false); + components.setLayout(componentsLayout); + + selectedList = new List(components, SWT.BORDER | SWT.V_SCROLL); + GridData selectedData = new GridData(); + selectedData.heightHint = buttonHeight * 10; + selectedList.setLayoutData(selectedData); + //selectedList.setBackground(new org.eclipse.swt.graphics.Color(components.getDisplay(), 255,0,0)); + + // Create a grid data that takes up the extra + // space in the dialog and spans both columns. + //*GridData selectedListData = new GridData(GridData.FILL_HORIZONTAL); + //*selectedListData.heightHint = convertVerticalDLUsToPixels(selectedList, LIST_HEIGHT_IN_DLUS); + //*selectedListData.horizontalSpan = numColumns; + + //*selectedList.setLayoutData(selectedListData); + selectedList.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + selectedSelectionChanged(); + } + }); + + // Create a composite for the add and remove + // buttons and the input text field. + Composite addRemoveGroup = new Composite(components, SWT.NONE); +// GridData addRemoveData = new GridData(); +// addRemoveData.heightHint = buttonHeight * 10; +// addRemoveGroup.setLayoutData(addRemoveData); + //addRemoveGroup.setBackground(new org.eclipse.swt.graphics.Color(components.getDisplay(), 0,255,0)); + + //*GridData addRemoveData = new GridData(GridData.FILL_HORIZONTAL); + //*addRemoveData.horizontalSpan = numColumns; + //*addRemoveGroup.setLayoutData(addRemoveData); + + GridLayout addRemoveLayout = new GridLayout(); + addRemoveLayout.numColumns = numColumns; + addRemoveLayout.marginHeight = 0; + addRemoveLayout.marginWidth = 0; + addRemoveGroup.setLayout(addRemoveLayout); + addRemoveGroup.setSize(buttonWidth, buttonHeight*2); + + // Create a composite for the add and remove buttons. + Composite buttonGroup = new Composite(addRemoveGroup, SWT.NONE); + //*buttonGroup.setLayoutData(new GridData()); + + GridLayout buttonLayout = new GridLayout(); + buttonLayout.marginHeight = 0; + buttonLayout.marginWidth = 0; + buttonGroup.setLayout(buttonLayout); + + // Create the remove button. + deselect = new Button(buttonGroup, SWT.NONE); + deselect.setEnabled(false); + deselect.setText(DEFAULT_DESELECT_LABEL); + deselect.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + deselect(); + showDefaultHint(); + } + }); + GridData removeData = new GridData(GridData.FILL_HORIZONTAL); + removeData.heightHint = buttonHeight; + removeData.widthHint = buttonWidth; + deselect.setLayoutData(removeData); + + // Create the add button. + select = new Button(buttonGroup, SWT.NONE); + select.setEnabled(false); + select.setText(DEFAULT_SELECT_LABEL); + select.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + select(); + showDefaultHint(); + } + }); + GridData addData = new GridData(GridData.FILL_HORIZONTAL); + addData.heightHint = buttonHeight; + addData.widthHint = buttonWidth; + select.setLayoutData(addData); + + // available list + availableList = new List(components, SWT.BORDER | SWT.V_SCROLL); + GridData availableData = new GridData(); + availableData.heightHint = buttonHeight * 10; + availableList.setLayoutData(availableData); + //availableList.setBackground(new org.eclipse.swt.graphics.Color(components.getDisplay(), 0,0,255)); + + // Create a grid data that takes up the extra + // space in the dialog and spans both columns. + //*GridData availableListData = new GridData(GridData.FILL_HORIZONTAL); + //*availableListData.heightHint = convertVerticalDLUsToPixels(availableList, LIST_HEIGHT_IN_DLUS); + //*availableListData.horizontalSpan = numColumns; + + //*availableList.setLayoutData(availableListData); + availableList.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + availableSelectionChanged(); + } + }); + } + + protected void showDefaultHint() { + String defaults = getPreferenceStore().getDefaultString(getPreferenceName()); + String selected = createListString(selectedList.getItems()); + APreferencePage.showLabelDefaultHint(label, defaults.equals(selected)); + } + + @Override + public Label getLabelControl(Composite parent) { + if (label == null) { + label = new CLabel(parent, SWT.LEFT | SWT.RIGHT_TO_LEFT); + label.setFont(parent.getFont()); + String text = getLabelText(); + if (text != null) { + label.setText(text); + } + label.addDisposeListener(new DisposeListener() { + @Override + public void widgetDisposed(DisposeEvent event) { + label = null; + } + }); + } else { + checkParent(label, parent); + } + return null; + } + + @Override + public void setEnabled(boolean enabled, Composite parent) { + label.setEnabled(enabled); + } + + /** + * @see org.eclipse.jface.preference.FieldEditor#doLoad() + */ + protected void doLoad() { + String items = getPreferenceStore().getString(getPreferenceName()); + setList(items); + showDefaultHint(); + } + + /** + * @see org.eclipse.jface.preference.FieldEditor#doLoadDefault() + */ + protected void doLoadDefault() { + String items = getPreferenceStore().getDefaultString(getPreferenceName()); + setList(items); + showDefaultHint(); + } + + // Parses the string into seperate list items and adds them to the list. + private void setList(String items) { + String[] itemArray = parseString(items); + selectedList.setItems(itemArray); + } + + /** + * @see org.eclipse.jface.preference.FieldEditor#doStore() + */ + protected void doStore() { + String s = createListString(selectedList.getItems()); + if (s != null) + getPreferenceStore().setValue(getPreferenceName(), s); + } + + /** + * @see org.eclipse.jface.preference.FieldEditor#getNumberOfControls() + */ + public int getNumberOfControls() { + // The button composite and the text field. + return 2; + } + + // Adds the string in the text field to the list. + private void select() { + Set<String> items = new TreeSet<String>(); + items.addAll(Arrays.asList(selectedList.getItems())); + items.addAll(Arrays.asList(availableList.getSelection())); + selectedList.removeAll(); + for (String addItem : items) { + selectedList.add(addItem); + } + refreshAvailableList(); + } + + private void deselect() { + Set<String> items = new TreeSet<String>(); + items.addAll(Arrays.asList(selectedList.getItems())); + items.removeAll(Arrays.asList(selectedList.getSelection())); + selectedList.removeAll(); + for (String addItem : items) { + selectedList.add(addItem); + } + refreshAvailableList(); + } + + private void refreshAvailableList() { + java.util.List<String> ignoreItems = Arrays.asList(selectedList.getItems()); + availableList.removeAll(); + for (int idx = 0; idx < availableNamesAndValues.length; idx++) { + String addItem = availableNamesAndValues[idx][1]; + if ((addItem != null) && !ignoreItems.contains(addItem)) { + availableList.add(addItem); + } + } + selectedList.deselectAll(); + availableList.deselectAll(); + select.setEnabled(false); + deselect.setEnabled(false); + } + + /** + * Sets the label for the button that adds + * the contents of the text field to the list. + */ + public void setSelectButtonText(String text) { + select.setText(text); + } + + /** + * Sets the label for the button that removes + * the selected item from the list. + */ + public void setDeselectButtonText(String text) { + deselect.setText(text); + } + + /** + * Sets the string that seperates items in the list when the + * list is stored as a single String in the preference store. + */ + public void setSeperator(String seperator) { + this.seperator = seperator; + } + + /** + * Creates the single String representation of the list + * that is stored in the preference store. + */ + private String createListString(String[] items) { + StringBuffer path = new StringBuffer("");//$NON-NLS-1$ + for (int i = 0; i < items.length; i++) { + if (i > 0) { + path.append(seperator); + } + path.append(items[i]); + } + return path.toString(); + } + + /** + * Parses the single String representation of the list + * into an array of list items. + */ + private String[] parseString(String stringList) { + StringTokenizer st = + new StringTokenizer(stringList, seperator); //$NON-NLS-1$ + ArrayList v = new ArrayList(); + while (st.hasMoreElements()) { + v.add(st.nextElement()); + } + return (String[])v.toArray(new String[v.size()]); + } + + // Sets the enablement of the remove button depending + // on the selection in the list. + private void selectedSelectionChanged() { + int index = selectedList.getSelectionIndex(); + deselect.setEnabled(index >= 0); + availableList.deselectAll(); + select.setEnabled(false); + } + + // Sets the enablement of the remove button depending + // on the selection in the list. + private void availableSelectionChanged() { + int index = availableList.getSelectionIndex(); + select.setEnabled(index >= 0); + selectedList.deselectAll(); + deselect.setEnabled(false); + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/DataSourcesFieldEditor.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/DataSourcesFieldEditor.java new file mode 100644 index 0000000..6e13924 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/DataSourcesFieldEditor.java @@ -0,0 +1,77 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.component; + +import java.util.Map; +import java.util.TreeMap; + +import org.eclipse.swt.custom.TableTreeItem; +import org.eclipse.swt.widgets.Composite; + +import org.eclipse.osbp.preferences.DataSourceConfiguration; +import org.eclipse.osbp.preferences.EnumDatabaseVendor; +import org.eclipse.osbp.preferences.IItemDescribed; +import org.eclipse.osbp.preferences.ItemDescription; +import org.eclipse.osbp.preferences.PersistenceUnitConfiguration; +import org.eclipse.osbp.preferences.DataSourceConfiguration.DataSourceItemDescription; +import org.eclipse.osbp.preferences.PersistenceUnitConfiguration.PersistenceUnitItemDescription; + +public class DataSourcesFieldEditor extends ATableTreeFieldEditor { + + public DataSourcesFieldEditor(String name, String labelText, + Composite parent) { + super( + name, labelText, parent, + DataSourceItemDescription.INSTANCE); + } + + @Override + protected void _doLoad(String value, String defaults) { + Map<String, DataSourceConfiguration> dataItems = DataSourceConfiguration.deserialize(value); + Map<String, DataSourceConfiguration> defaultItems = DataSourceConfiguration.deserialize(defaults); + for (DataSourceConfiguration dataItem : dataItems.values()) { + new TableTreeDescribedItem(this, dataItem, defaultItems.get(dataItem.getName())); + } + } + + @Override + protected String _doStore() { + Map<String, DataSourceConfiguration> dataItems = new TreeMap<String, DataSourceConfiguration>(); + for (TableTreeItem treeItem : tableTree.getItems()) { + if (treeItem instanceof IItemDescribed) { + IItemDescribed describedItem = (IItemDescribed) treeItem; + DataSourceConfiguration dataItem = new DataSourceConfiguration( + describedItem.getName(), + EnumDatabaseVendor.byName(describedItem.getValue(DataSourceItemDescription.DATABASE_TYPE), "", ""), + describedItem.getValue(DataSourceItemDescription.SERVER_NAME), + ItemDescription.parseInt(describedItem.getValue(DataSourceItemDescription.SERVER_PORT), -1), + describedItem.getValue(DataSourceItemDescription.DATABASE_NAME), + describedItem.getValue(DataSourceItemDescription.DATABASE_USER), + describedItem.getValue(DataSourceItemDescription.DATABASE_PASSWORD) + ); + dataItems.put(dataItem.getName(), dataItem); + } + } + return DataSourceConfiguration.serialize(dataItems.values()); + } + + @Override + protected boolean hasRemoveButton() { + return true; + } + + @Override + protected boolean hasAddButton() { + return true; + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/FileOpenCallEditor.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/FileOpenCallEditor.java new file mode 100644 index 0000000..979291d --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/FileOpenCallEditor.java @@ -0,0 +1,132 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.component; + +import java.io.File; + +import org.eclipse.core.filesystem.EFS; +import org.eclipse.core.filesystem.IFileStore; +import org.eclipse.jface.preference.FieldEditor; +import org.eclipse.jface.util.Assert; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.FocusAdapter; +import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.KeyAdapter; +import org.eclipse.swt.events.KeyEvent; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.ide.IDE; +import org.eclipse.ui.internal.ide.dialogs.IFileStoreFilter; + +public class FileOpenCallEditor extends FieldEditor { + + private boolean isValid; + private String oldValue; + private String compTitle; + private Label title; + private Button fileOpenButton; + + protected FileOpenCallEditor() { + } + + public FileOpenCallEditor(String name, String labelText, Composite parent) { + init(name, labelText); + createControl(parent); + } + + protected boolean checkState() { + return true; + } + + protected boolean doCheckState() { + return true; + } + + @Override + protected void doFillIntoGrid(Composite parent, int numColumns) { + title = new Label(parent, SWT.UP); + title.setFont(parent.getFont()); + title.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); + title.setVisible(false); + + fileOpenButton = new Button(parent, SWT.PUSH); + GridData gd = new GridData(GridData.FILL_HORIZONTAL); + gd.widthHint = 100; + fileOpenButton.setLayoutData(gd); + fileOpenButton.setFont(parent.getFont()); + fileOpenButton.setText(getLabelText()); + fileOpenButton.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + String fileName = getPreferenceStore().getString(getPreferenceName()); + File fileToOpen = new File(fileName); + + if (fileToOpen.exists() && fileToOpen.isFile()) { + IFileStore fileStore = EFS.getLocalFileSystem().getStore(fileToOpen.toURI()); + IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + try { + IDE.openEditorOnFileStore( page, fileStore ); + } + catch (PartInitException e1) { + e1.printStackTrace(); + } + } + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + } + + @Override + protected void doLoad() { + } + + @Override + protected void doLoadDefault() { + } + + @Override + protected void doStore() { + } + + @Override + public int getNumberOfControls() { + return 2; + } + + public String getStringValue() { + return null; + } + + @Override + public boolean isValid() { + return true; + } + + @Override + protected void adjustForNumColumns(int numColumns) { + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/HookedBooleanFieldEditor.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/HookedBooleanFieldEditor.java new file mode 100644 index 0000000..0d7276d --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/HookedBooleanFieldEditor.java @@ -0,0 +1,101 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.component; + +import org.eclipse.jface.preference.BooleanFieldEditor; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CLabel; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.KeyEvent; +import org.eclipse.swt.events.KeyListener; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; + +public class HookedBooleanFieldEditor extends BooleanFieldEditor { + + protected CLabel label; + + public HookedBooleanFieldEditor(String name, String label, Composite parent) { + super(name, label, SEPARATE_LABEL, parent); + } + + @Override + protected void doFillIntoGrid(Composite parent, int numColumns) { + super.doFillIntoGrid(parent, numColumns); + getChangeControl(parent).addKeyListener(new KeyListener() { + @Override + public void keyReleased(KeyEvent e) { + } + @Override + public void keyPressed(KeyEvent e) { + showDefaultHint(); + } + }); + getChangeControl(parent).addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + showDefaultHint(); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + } + + protected void showDefaultHint() { + APreferencePage.showLabelDefaultHint(label, getBooleanValue() == getPreferenceStore().getDefaultBoolean(getPreferenceName())); + } + + @Override + public Label getLabelControl(Composite parent) { + if (label == null) { + label = new CLabel(parent, SWT.LEFT | SWT.RIGHT_TO_LEFT); + label.setFont(parent.getFont()); + String text = getLabelText(); + if (text != null) { + label.setText(text); + } + label.addDisposeListener(new DisposeListener() { + @Override + public void widgetDisposed(DisposeEvent event) { + label = null; + } + }); + } else { + checkParent(label, parent); + } + return null; + } + + @Override + public void setEnabled(boolean enabled, Composite parent) { + label.setEnabled(enabled); + } + + @Override + protected void doLoad() { + super.doLoad(); + showDefaultHint(); + } + + @Override + protected void doLoadDefault() { + super.doLoadDefault(); + showDefaultHint(); + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/HookedDirectoryFieldEditor.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/HookedDirectoryFieldEditor.java new file mode 100644 index 0000000..7b71c19 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/HookedDirectoryFieldEditor.java @@ -0,0 +1,95 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.component; + +import org.eclipse.jface.preference.DirectoryFieldEditor; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CLabel; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; + +public class HookedDirectoryFieldEditor extends DirectoryFieldEditor { + + private final IPreferenceCheckStateProvider fCheckStateProvider; + protected CLabel label; + + public HookedDirectoryFieldEditor(String preference, String label, IPreferenceCheckStateProvider checkStateProvider, Composite parent) { + super(preference, label, parent); + fCheckStateProvider = checkStateProvider; + } + + @Override + protected boolean doCheckState() { + if (fCheckStateProvider != null) { + return fCheckStateProvider.doCheckState(this, getTextControl().getText()); + } + return super.doCheckState(); + } + + @Override + protected void doFillIntoGrid(Composite parent, int numColumns) { + super.doFillIntoGrid(parent, numColumns); + getTextControl().addModifyListener(new ModifyListener() { + @Override + public void modifyText(ModifyEvent e) { + showDefaultHint(); + } + }); + } + + protected void showDefaultHint() { + APreferencePage.showLabelDefaultHint(label, getStringValue().equals(getPreferenceStore().getDefaultString(getPreferenceName()))); + } + + @Override + public Label getLabelControl(Composite parent) { + if (label == null) { + label = new CLabel(parent, SWT.LEFT | SWT.RIGHT_TO_LEFT); + label.setFont(parent.getFont()); + String text = getLabelText(); + if (text != null) { + label.setText(text); + } + label.addDisposeListener(new DisposeListener() { + @Override + public void widgetDisposed(DisposeEvent event) { + label = null; + } + }); + } else { + checkParent(label, parent); + } + return null; + } + + @Override + public void setEnabled(boolean enabled, Composite parent) { + label.setEnabled(enabled); + } + + @Override + protected void doLoad() { + super.doLoad(); + showDefaultHint(); + } + + @Override + protected void doLoadDefault() { + super.doLoadDefault(); + showDefaultHint(); + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/HookedIntegerFieldEditor.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/HookedIntegerFieldEditor.java new file mode 100644 index 0000000..7ed615b --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/HookedIntegerFieldEditor.java @@ -0,0 +1,98 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.component; + +import org.eclipse.jface.preference.IntegerFieldEditor; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.osbp.preferences.ProductConfigurationDefaultPrefs; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CLabel; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; + +public class HookedIntegerFieldEditor extends IntegerFieldEditor { + + private final IPreferenceCheckStateProvider fCheckStateProvider; + protected CLabel label; + + public HookedIntegerFieldEditor(String preference, String label, IPreferenceCheckStateProvider checkStateProvider, Composite parent) { + super(preference, label, parent); + fCheckStateProvider = checkStateProvider; + } + + @Override + protected boolean doCheckState() { + if (fCheckStateProvider != null) { + return fCheckStateProvider.doCheckState(this, getTextControl().getText()); + } + return super.doCheckState(); + } + + @Override + protected void doFillIntoGrid(Composite parent, int numColumns) { + super.doFillIntoGrid(parent, numColumns); + getTextControl().addModifyListener(new ModifyListener() { + @Override + public void modifyText(ModifyEvent e) { + showDefaultHint(); + } + }); + } + + protected void showDefaultHint() { + APreferencePage.showLabelDefaultHint(label, getIntValue() == getPreferenceStore().getDefaultInt(getPreferenceName())); + } + + @Override + public Label getLabelControl(Composite parent) { + if (label == null) { + label = new CLabel(parent, SWT.LEFT | SWT.RIGHT_TO_LEFT); + label.setFont(parent.getFont()); + String text = getLabelText(); + if (text != null) { + label.setText(text); + } + label.addDisposeListener(new DisposeListener() { + @Override + public void widgetDisposed(DisposeEvent event) { + label = null; + } + }); + } else { + checkParent(label, parent); + } + return null; + } + + @Override + public void setEnabled(boolean enabled, Composite parent) { + label.setEnabled(enabled); + } + + @Override + protected void doLoad() { + super.doLoad(); + showDefaultHint(); + } + + @Override + protected void doLoadDefault() { + super.doLoadDefault(); + showDefaultHint(); + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/HookedMultilineStringFieldEditor.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/HookedMultilineStringFieldEditor.java new file mode 100644 index 0000000..ed49e64 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/HookedMultilineStringFieldEditor.java @@ -0,0 +1,315 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.component; + +import org.eclipse.jface.preference.FieldEditor; +import org.eclipse.jface.util.Assert; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.FocusAdapter; +import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.KeyAdapter; +import org.eclipse.swt.events.KeyEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; + +public class HookedMultilineStringFieldEditor extends FieldEditor { + + private final IPreferenceCheckStateProvider fCheckStateProvider; + +// private static final String ERROR_MESSAGE = "Multiline.error.message"; //$NON-NLS-1$ + public static final int VALIDATE_ON_KEY_STROKE = 0; + public static final int VALIDATE_ON_FOCUS_LOST = 1; + public static int UNLIMITED = -1; + + private boolean isValid; + private String oldValue; + private String compTitle; + private Label title; + private Text textField; + private int widthInChars = 120; + private int textLimit = UNLIMITED; + private String errorMessage; + private boolean emptyStringAllowed = true; + private int validateStrategy = VALIDATE_ON_KEY_STROKE; + + protected HookedMultilineStringFieldEditor() { + fCheckStateProvider = null; + } + + public HookedMultilineStringFieldEditor(String name, String labelText, int width, int strategy, IPreferenceCheckStateProvider checkStateProvider, Composite parent) { + fCheckStateProvider = checkStateProvider; + init(name, labelText); + widthInChars = width; + setValidateStrategy(strategy); + isValid = false; + errorMessage = "error"; + createControl(parent); + } + + public HookedMultilineStringFieldEditor(String name, String labelText, int width, IPreferenceCheckStateProvider checkStateProvider, Composite parent) { + this(name, labelText, width, VALIDATE_ON_KEY_STROKE, checkStateProvider, parent); + this.compTitle = labelText; + } + + public HookedMultilineStringFieldEditor(String name, String labelText, IPreferenceCheckStateProvider checkStateProvider, Composite parent) { + this(name, labelText, UNLIMITED, checkStateProvider, parent); + } + + @Override + public void setEnabled(boolean enabled, Composite parent) { + super.setEnabled(enabled, parent); + if (textField != null) { + textField.setEditable(enabled); + } + } + + @Override + protected void adjustForNumColumns(int numColumns) { + GridData gd = (GridData) textField.getLayoutData(); + gd.horizontalSpan = numColumns - 1; + // We only grab excess space if we have to + // If another field editor has more columns then + // we assume it is setting the width. + gd.grabExcessHorizontalSpace = gd.horizontalSpan == 1; + } + + protected boolean checkState() { + + boolean result = false; + String txt = ""; + + if( textField != null ) + txt = textField.getText(); + + result = !txt.trim().isEmpty() || emptyStringAllowed; + + // call hook for subclasses + result = result && doCheckState(); + + if (result) + clearErrorMessage(); + else + showErrorMessage(errorMessage); + + return result; + } + + protected boolean doCheckState() { + if (fCheckStateProvider != null) { + return fCheckStateProvider.doCheckState(this, getTextControl().getText()); + } + return true; + } + + @Override + protected void doFillIntoGrid(Composite parent, int numColumns) { + + title = new Label(parent, SWT.UP); + title.setFont(parent.getFont()); + this.compTitle = getLabelText(); + title.setText(this.compTitle); + title.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); + + textField = getTextControl(parent); + GridData gd = new GridData(GridData.FILL_HORIZONTAL); + gd.widthHint = 100; + gd.heightHint = 500; + textField.setLayoutData(gd); + + } + + @Override + protected void doLoad() { + if (textField != null) { + String value = getPreferenceStore().getString(getPreferenceName()); + textField.setText(value); + oldValue = value; + } + } + + @Override + protected void doLoadDefault() { + if (textField != null) { + String value = getPreferenceStore().getDefaultString( + getPreferenceName()); + textField.setText(value); + } + valueChanged(); + } + + @Override + protected void doStore() { + getPreferenceStore().setValue(getPreferenceName(), textField.getText()); + } + + public String getErrorMessage() { + return errorMessage; + } + + @Override + public int getNumberOfControls() { + return 2; + } + + public String getStringValue() { + if (textField != null) + return textField.getText(); + else + return getPreferenceStore().getString(getPreferenceName()); + } + + protected Text getTextControl() { + return textField; + } + + public Text getTextControl(Composite parent) { + if (textField == null) { + textField = new Text(parent, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER + | SWT.WRAP); + textField.setFont(parent.getFont()); + switch (validateStrategy) { + case VALIDATE_ON_KEY_STROKE: + textField.addKeyListener(new KeyAdapter() { + @Override + public void keyPressed(KeyEvent e) { + valueChanged(); + } + }); + + textField.addFocusListener(new FocusAdapter() { + @Override + public void focusGained(FocusEvent e) { + refreshValidState(); + } + + @Override + public void focusLost(FocusEvent e) { + clearErrorMessage(); + } + }); + break; + case VALIDATE_ON_FOCUS_LOST: + textField.addKeyListener(new KeyAdapter() { + @Override + public void keyPressed(KeyEvent e) { + clearErrorMessage(); + } + }); + textField.addFocusListener(new FocusAdapter() { + @Override + public void focusGained(FocusEvent e) { + refreshValidState(); + } + + @Override + public void focusLost(FocusEvent e) { + valueChanged(); + clearErrorMessage(); + } + }); + break; + default: + Assert.isTrue(false, "Unknown validate strategy"); //$NON-NLS-1$ + } + textField.addDisposeListener(new DisposeListener() { + @Override + public void widgetDisposed(DisposeEvent event) { + textField = null; + } + }); + if (textLimit > 0) { // Only set limits above 0 - see SWT spec + textField.setTextLimit(textLimit); + } + } else { + checkParent(textField, parent); + } + return textField; + } + + public boolean isEmptyStringAllowed() { + return emptyStringAllowed; + } + + @Override + public boolean isValid() { + return isValid; + } + + @Override + protected void refreshValidState() { + isValid = checkState(); + } + + public void setEmptyStringAllowed(boolean b) { + emptyStringAllowed = b; + } + + public void setErrorMessage(String message) { + errorMessage = message; + } + + @Override + public void setFocus() { + if (textField != null) { + textField.setFocus(); + } + } + + public void setStringValue(String value) { + if (textField != null) { + if (value == null) + value = ""; //$NON-NLS-1$ + oldValue = textField.getText(); + if (!oldValue.equals(value)) { + textField.setText(value); + valueChanged(); + } + } + } + + public void setTextLimit(int limit) { + textLimit = limit; + if (textField != null) + textField.setTextLimit(limit); + } + + public void setValidateStrategy(int value) { + Assert.isTrue(value == VALIDATE_ON_FOCUS_LOST + || value == VALIDATE_ON_KEY_STROKE); + validateStrategy = value; + } + + public void showErrorMessage() { + showErrorMessage(errorMessage); + } + + protected void valueChanged() { + setPresentsDefaultValue(false); + boolean oldState = isValid; + refreshValidState(); + + if (isValid != oldState) + fireStateChanged(IS_VALID, oldState, isValid); + + String newValue = textField.getText(); + if (!newValue.equals(oldValue)) { + fireValueChanged(VALUE, oldValue, newValue); + oldValue = newValue; + } + } + +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/HookedStringFieldEditor.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/HookedStringFieldEditor.java new file mode 100644 index 0000000..3e8dba4 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/HookedStringFieldEditor.java @@ -0,0 +1,95 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.component; + +import org.eclipse.jface.preference.StringFieldEditor; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CLabel; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; + +public class HookedStringFieldEditor extends StringFieldEditor { + + private final IPreferenceCheckStateProvider fCheckStateProvider; + protected CLabel label; + + public HookedStringFieldEditor(String preference, String label, IPreferenceCheckStateProvider checkStateProvider, Composite parent) { + super(preference, label, parent); + fCheckStateProvider = checkStateProvider; + } + + @Override + protected boolean doCheckState() { + if (fCheckStateProvider != null) { + return fCheckStateProvider.doCheckState(this, getTextControl().getText()); + } + return super.doCheckState(); + } + + @Override + protected void doFillIntoGrid(Composite parent, int numColumns) { + super.doFillIntoGrid(parent, numColumns); + getTextControl().addModifyListener(new ModifyListener() { + @Override + public void modifyText(ModifyEvent e) { + showDefaultHint(); + } + }); + } + + protected void showDefaultHint() { + APreferencePage.showLabelDefaultHint(label, getStringValue().equals(getPreferenceStore().getDefaultString(getPreferenceName()))); + } + + @Override + public Label getLabelControl(Composite parent) { + if (label == null) { + label = new CLabel(parent, SWT.LEFT | SWT.RIGHT_TO_LEFT); + label.setFont(parent.getFont()); + String text = getLabelText(); + if (text != null) { + label.setText(text); + } + label.addDisposeListener(new DisposeListener() { + @Override + public void widgetDisposed(DisposeEvent event) { + label = null; + } + }); + } else { + checkParent(label, parent); + } + return null; + } + + @Override + public void setEnabled(boolean enabled, Composite parent) { + label.setEnabled(enabled); + } + + @Override + protected void doLoad() { + super.doLoad(); + showDefaultHint(); + } + + @Override + protected void doLoadDefault() { + super.doLoadDefault(); + showDefaultHint(); + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/IPreferenceCheckStateProvider.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/IPreferenceCheckStateProvider.java new file mode 100644 index 0000000..4778ed1 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/IPreferenceCheckStateProvider.java @@ -0,0 +1,24 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.component; + +import org.eclipse.jface.preference.FieldEditor; + +public interface IPreferenceCheckStateProvider { + /** + * @param preference + * @param input + * @return true if the input for the preference is allowed + */ + public boolean doCheckState(FieldEditor editor, String input); +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/Item.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/Item.java new file mode 100644 index 0000000..b48f539 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/Item.java @@ -0,0 +1,62 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.component; + +import org.eclipse.jface.preference.FieldEditor; + +import org.eclipse.osbp.preferences.Preference; + +public class Item { + protected final Preference fPreference; + protected final String fLabel; + protected final Type fType; + protected final boolean fEnabled; + protected FieldEditor fEditor; + protected final String[][] fNamesValues; + protected final String fSeparator; + + public Item(String label) { + this(Type.LABEL, null, label); + } + + public Item(Type type, Preference preference, String label) { + this(type, preference, label, true); + } + + public Item(Type type, Preference preference, String label, String[][] namesValues) { + this(type, preference, label, true, namesValues); + } + + public Item(Type type, Preference preference, String label, String[][] namesValues, String separator) { + this(type, preference, label, true, namesValues, separator); + } + + public Item(Type type, Preference preference, String label, boolean enabled) { + this(type, preference, label, enabled, null); + } + + public Item(Type type, Preference preference, String label, boolean enabled, String[][] namesValues) { + this(type, preference, label, enabled, namesValues, " "); + } + + public Item(Type type, Preference preference, String label, boolean enabled, String[][] namesValues, String separator) { + fPreference = preference; + fLabel = label; + fType = type; + fEnabled = enabled; + fNamesValues = namesValues; + fSeparator = separator; + } + +// public FieldEditor +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/LinkFieldEditor.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/LinkFieldEditor.java new file mode 100644 index 0000000..c6eb29d --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/LinkFieldEditor.java @@ -0,0 +1,121 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.component; + +import java.awt.Desktop; +import java.io.File; +import java.net.URI; + +import org.eclipse.core.filesystem.EFS; +import org.eclipse.core.filesystem.IFileStore; +import org.eclipse.jface.preference.FieldEditor; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Link; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.ide.IDE; + +public class LinkFieldEditor extends FieldEditor { + + public class WebLinkListener implements Listener { + + @Override + public void handleEvent(Event event) { + try { + Desktop.getDesktop().browse(new URI(event.text)); + } + catch (Exception e) { + e.printStackTrace(); + } + } + } + + private boolean isValid; + private String oldValue; + private String compTitle; + private Label title; + private Link urlLink; + + protected LinkFieldEditor() { + } + + public LinkFieldEditor(String name, String labelText, Composite parent) { + init(name, labelText); + createControl(parent); + } + + protected boolean checkState() { + return true; + } + + protected boolean doCheckState() { + return true; + } + + @Override + protected void doFillIntoGrid(Composite parent, int numColumns) { + title = new Label(parent, SWT.UP); + title.setFont(parent.getFont()); + title.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); + title.setVisible(false); + + urlLink = new Link(parent, SWT.NONE); + GridData gd = new GridData(GridData.FILL_HORIZONTAL); + gd.widthHint = 100; + urlLink.setLayoutData(gd); + urlLink.setFont(parent.getFont()); + //urlLink.setText(getPreferenceStore().getString(getPreferenceName())); + urlLink.addListener(SWT.Selection, new WebLinkListener()); + urlLink.setEnabled(true); + } + + @Override + protected void doLoad() { + urlLink.setText(getPreferenceStore().getString(getPreferenceName())); + } + + @Override + protected void doLoadDefault() { + } + + @Override + protected void doStore() { + } + + @Override + public int getNumberOfControls() { + return 2; + } + + public String getStringValue() { + return null; + } + + @Override + public boolean isValid() { + return true; + } + + @Override + protected void adjustForNumColumns(int numColumns) { + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/PersistenceUnitsFieldEditor.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/PersistenceUnitsFieldEditor.java new file mode 100644 index 0000000..9aeec03 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/PersistenceUnitsFieldEditor.java @@ -0,0 +1,78 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.component; + +import java.util.Map; +import java.util.TreeMap; + +import org.eclipse.osbp.preferences.IItemDescribed; +import org.eclipse.osbp.preferences.ItemDescription; +import org.eclipse.osbp.preferences.PersistenceUnitConfiguration; +import org.eclipse.osbp.preferences.PersistenceUnitConfiguration.PersistenceUnitItemDescription; +import org.eclipse.swt.custom.TableTreeItem; +import org.eclipse.swt.widgets.Composite; + +public class PersistenceUnitsFieldEditor extends ATableTreeFieldEditor { + + public PersistenceUnitsFieldEditor(String name, String labelText, + Composite parent) { + super( + name, labelText, parent, + PersistenceUnitItemDescription.INSTANCE); + } + + @Override + protected void _doLoad(String value, String defaults) { + Map<String, PersistenceUnitConfiguration> dataItems = PersistenceUnitConfiguration.deserialize(value); + Map<String, PersistenceUnitConfiguration> defaultItems = PersistenceUnitConfiguration.deserialize(defaults); + for (PersistenceUnitConfiguration dataItem : dataItems.values()) { + new TableTreeDescribedItem(this, dataItem, defaultItems.get(dataItem.getName())); + } + } + + @Override + protected String _doStore() { + Map<String, PersistenceUnitConfiguration> dataItems = new TreeMap<String, PersistenceUnitConfiguration>(); + for (TableTreeItem treeItem : tableTree.getItems()) { + if (treeItem instanceof IItemDescribed) { + IItemDescribed describedItem = (IItemDescribed) treeItem; + PersistenceUnitConfiguration dataItem = new PersistenceUnitConfiguration( + describedItem.getName(), + describedItem.getValue(PersistenceUnitItemDescription.JNDI_NAME), + ItemDescription.parseBoolean(describedItem.getValue(PersistenceUnitItemDescription.DEPLOY_ON_STARTUP), true), + ItemDescription.parseBoolean(describedItem.getValue(PersistenceUnitItemDescription.QUERY_CACHE), true), + describedItem.getValue(PersistenceUnitItemDescription.BATCH_WRITING), + ItemDescription.parseInt(describedItem.getValue(PersistenceUnitItemDescription.BATCH_WRITING_SIZE), 0), + ItemDescription.parseBoolean(describedItem.getValue(PersistenceUnitItemDescription.CACHE_STATEMENTS), true), + ItemDescription.parseInt(describedItem.getValue(PersistenceUnitItemDescription.CACHE_STATEMENTS_SIZE), 0), + describedItem.getValue(PersistenceUnitItemDescription.LOGGING_LEVEL), + describedItem.getValue(PersistenceUnitItemDescription.DDL_GENERATION), + describedItem.getValue(PersistenceUnitItemDescription.PERSISTENCE_XML_PATH), + describedItem.getValue(PersistenceUnitItemDescription.WEAVING) + ); + dataItems.put(dataItem.getName(), dataItem); + } + } + return PersistenceUnitConfiguration.serialize(dataItems.values()); + } + + @Override + protected boolean hasRemoveButton() { + return true; + } + + @Override + protected boolean hasAddButton() { + return true; + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/ProductConfigurationFieldEditor.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/ProductConfigurationFieldEditor.java new file mode 100644 index 0000000..01eb75c --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/ProductConfigurationFieldEditor.java @@ -0,0 +1,59 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.component; + +import org.eclipse.core.resources.IProject; +import org.eclipse.osbp.preferences.ui.data.ProductConfigurationStore; +import org.eclipse.osbp.preferences.ui.utils.ApplicationProjectInspector; +import org.eclipse.osbp.preferences.ui.utils.ConfigurationFileVerifier.ConfigurationFileDescription; +import org.eclipse.osbp.preferences.ui.utils.ManifestFileVerifier; +import org.eclipse.swt.widgets.Composite; + +public class ProductConfigurationFieldEditor extends ATableTreeFieldEditor { + + public ProductConfigurationFieldEditor(String name, String labelText, Composite parent) { + super(name, labelText, parent, ConfigurationFileDescription.INSTANCE); + } + + @Override + protected void _doLoad(String value, String defaults) { + IProject productProject = ((ProductConfigurationStore)getPreferenceStore()).getProject(); + String productFileName = ((ProductConfigurationStore)getPreferenceStore()).getProductFileName(); + if ((productProject != null) && !productFileName.isEmpty()) { + ApplicationProjectInspector inspector = new ApplicationProjectInspector(productProject, productFileName); + if (inspector.isApplicationProject()) { + new TableTreeDescribedItem(this, inspector.getProductConfigurations(), null); + new TableTreeDescribedItem(this, inspector.getProductPlugins(), null); + new TableTreeDescribedItem(this, inspector.getProductManifest(), null); + for (ManifestFileVerifier bundle : inspector.getManifestVerifiers()) { + new TableTreeDescribedItem(this, bundle, null); + } + } + } + } + + @Override + protected String _doStore() { + return null; + } + + @Override + protected boolean hasRemoveButton() { + return false; + } + + @Override + protected boolean hasAddButton() { + return false; + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/TableTreeDescribedItem.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/TableTreeDescribedItem.java new file mode 100644 index 0000000..1be3c26 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/TableTreeDescribedItem.java @@ -0,0 +1,124 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.component; + +import org.eclipse.osbp.preferences.AItemDescribed; +import org.eclipse.osbp.preferences.AItemDescribed.SubItem; +import org.eclipse.osbp.preferences.IItemDescribed; +import org.eclipse.osbp.preferences.ItemDescription; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.TableTreeItem; + +public class TableTreeDescribedItem extends TableTreeItem implements IItemDescribed { + + private final ATableTreeFieldEditor fParent; + + private final static int ATTRIBUTE = 0; + protected final static int VALUE = 2; + protected final static int HINT = 1; + + public TableTreeDescribedItem(ATableTreeFieldEditor parent, AItemDescribed dataItem, AItemDescribed defaultItem) { + this(parent); + ItemDescription description = fParent.getItemDescription(); + if (dataItem.getRowName() == null) { + setText(ATTRIBUTE, description.getRowName()); + } + else { + setText(ATTRIBUTE, dataItem.getRowName()); + } + setText(VALUE, dataItem.getName()); + String[] columnNames = description.getColumnNames(); + if (dataItem.getSubItems() != null) { + for (SubItem subItem : dataItem.getSubItems()) { + TableTreeItem attribute = new TableTreeItem(this, SWT.NONE); + attribute.setText(ATTRIBUTE, subItem.getAction()); + attribute.setText(VALUE, subItem.getInformation()); + attribute.setImage(HINT, APreferencePage.getImage(subItem.getIcon())); + } + setImage(HINT, APreferencePage.getImage(dataItem.getIconName())); + } + else { + if (columnNames.length > 0) { + boolean isDefault = defaultItem != null; + for (int idx = 0; idx<columnNames.length; idx++) { + TableTreeItem attribute = new TableTreeItem(this, SWT.NONE); + attribute.setText(ATTRIBUTE, columnNames[idx]); + attribute.setText(VALUE, dataItem.getValue(columnNames[idx])); + if (defaultItem != null && dataItem.getValue(columnNames[idx]).equals(defaultItem.getValue(columnNames[idx]))) { + attribute.setImage(HINT, APreferencePage.getImage(APreferencePage.DEFAULT_VALUE_YES)); + } + else { + isDefault = false; + attribute.setImage(HINT, APreferencePage.getImage(APreferencePage.DEFAULT_VALUE_NO)); + } + } + setImage(HINT, APreferencePage.getImage(isDefault ? APreferencePage.DEFAULT_VALUE_YES : APreferencePage.DEFAULT_VALUE_NO)); + } + } + } + + public static TableTreeDescribedItem clone(TableTreeItem source, String postfix) { + TableTreeDescribedItem cloned = null; + if (source instanceof TableTreeDescribedItem) { + TableTreeDescribedItem sourceItem = (TableTreeDescribedItem) source; + ItemDescription description = sourceItem.fParent.getItemDescription(); + cloned = new TableTreeDescribedItem(sourceItem.fParent); + cloned.setText(ATTRIBUTE, description.getRowName()); + cloned.setText(VALUE, sourceItem.getText(VALUE)+postfix); + cloned.setImage(HINT, APreferencePage.getImage(APreferencePage.DEFAULT_VALUE_NO)); + String[] columnNames = description.getColumnNames(); + for (int idx = 0; idx<columnNames.length; idx++) { + TableTreeItem sourceAttribute = sourceItem.getItem(idx); + TableTreeItem cloneAttribute = new TableTreeItem(cloned, SWT.NONE); + cloneAttribute.setText(ATTRIBUTE, columnNames[idx]); + cloneAttribute.setText(VALUE, sourceAttribute.getText(VALUE)); + cloneAttribute.setImage(HINT, APreferencePage.getImage(APreferencePage.DEFAULT_VALUE_NO)); + } + } + return cloned; + } + + public TableTreeDescribedItem(ATableTreeFieldEditor parent) { + super(parent.tableTree, SWT.NONE); + fParent = parent; + } + + @Override + public String getName() { + return getText(VALUE); + } + + @Override + @Deprecated + public void setName(String name) { + // NOP + } + + @Override + public String getValue(String attribute) { + ItemDescription description = fParent.getItemDescription(); + String[] columnNames = description.getColumnNames(); + for (int idx = 0; idx<columnNames.length; idx++) { + if (columnNames[idx].equals(attribute)) { + return getItem(idx).getText(VALUE); + } + } + return null; + } + + @Override + @Deprecated + public void setValue(String attribute, String value) { + // NOP + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/Type.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/Type.java new file mode 100644 index 0000000..f1d81f3 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/component/Type.java @@ -0,0 +1,33 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.component; + +public enum Type { + BOOLEAN, + DIRECTORY, + EMAIL, + FILE_EDITOR, + INTEGER, + LABEL, + LINK, + LIST_ADD_REMOVE, + MULTILINE, + PASSWORD, + SELECT, + SERVER, + TABLE, + TEXT, + TREE_DATASOURCES, + TREE_PERSISTENCEUNITS, + TREE_PRODUCTCONFIGURATION, +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/data/ProductConfigurationStore.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/data/ProductConfigurationStore.java new file mode 100644 index 0000000..bfb55f2 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/data/ProductConfigurationStore.java @@ -0,0 +1,642 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.data; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; +import java.util.stream.Stream; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.preferences.IScopeContext; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.util.IPropertyChangeListener; +import org.eclipse.osbp.preferences.DataSourceConfiguration; +import org.eclipse.osbp.preferences.IProductConfigurationPrefs; +import org.eclipse.osbp.preferences.LocaleUtils; +import org.eclipse.osbp.preferences.PersistenceUnitConfiguration; +import org.eclipse.osbp.preferences.Preference; +import org.eclipse.osbp.preferences.ProductConfiguration; +import org.eclipse.osbp.preferences.ProductConfigurationDefaultPrefs; +import org.eclipse.osbp.preferences.ProductConfigurationPrefs; +import org.eclipse.osbp.preferences.ui.component.APreferencePage; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ProductConfigurationStore implements IPreferenceStore { + + private static final Logger LOGGER = LoggerFactory.getLogger(ProductConfigurationStore.class); + private static ProductConfigurationStore sInstance; + private static Map<String,IProject> osbpProductProjects = new TreeMap<>(); + private static Map<String,IProject> availableProductProjects = new TreeMap<>(); + + private ProductConfigurationPrefs prefs; + private final IProductConfigurationPrefs defaultPrefs; + + private Set<APreferencePage> prefsChangedListener = new HashSet<>(); + + public static Map<String,IProject> getAvailableApplicationProjects() { + return getAvailableApplicationProjects(false); + } + + public static Map<String,IProject> getAvailableApplicationProjects(boolean reload) { + boolean initial = (reload || osbpProductProjects.isEmpty() || sInstance == null); + if (initial) { + availableProductProjects.clear(); + for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) { + if (project.isOpen()) { + IResource resource = ProductConfigurationPrefs.getPrefsFile(project); + if ((resource != null) && resource.exists()) { + availableProductProjects.put(project.getName(), project); + } + } + } + osbpProductProjects.clear(); + osbpProductProjects.putAll(availableProductProjects); + osbpProductProjects.put(ProductConfiguration.WORKSPACE_NAME, null); + } + return availableProductProjects; + } + + public static String[][] getProjectNames() { + getAvailableApplicationProjects(); + String[][] namesValues = new String[osbpProductProjects.size()][2]; + namesValues[0][0] = ProductConfiguration.WORKSPACE_NAME; + namesValues[0][1] = ProductConfiguration.WORKSPACE_NAME; + int i = 1; + for (String name : osbpProductProjects.keySet()) { + if (!name.equals(ProductConfiguration.WORKSPACE_NAME)) { + namesValues[i][0] = name; + namesValues[i][1] = name; + i++; + } + } + return namesValues; + } + + public ProductConfigurationPrefs getProductConfigurationPrefs() { + return prefs; + } + + public IProject getProject() { + return prefs.getProject(); + } + + private boolean showLanguageSelectInRespectiveLocaleOnPages() { + return false; // showLanguageSelectInRespectiveLocale(); + } + + public void sortLocalesOnDisplayNameOnPages(Locale[] locales) { + LocaleUtils.sortLocalesOnDisplayName(locales, showLanguageSelectInRespectiveLocaleOnPages()); + } + + private void setProductConfigurationPrefs(ProductConfigurationPrefs prefs) { + LOGGER.error(prefs.getInformation()+" # now actual product configuration"); + this.prefs = prefs; + this.prefs.forceReloadConfiguration(); + for (APreferencePage listener : prefsChangedListener) { + listener.productConfigurationPrefsChanged(); + } + } + + public void addProductConfigurationPrefsChangedListener(APreferencePage listener) { + prefsChangedListener.add(listener); + } + + public void removeProductConfigurationPrefsChangedListener(APreferencePage listener) { + prefsChangedListener.remove(listener); + if (prefsChangedListener.isEmpty()) { + sInstance = null; + } + } + + public final boolean isWorkspaceSelected() { + if (prefs != null) { + return ProductConfiguration.WORKSPACE_NAME.equals(prefs.getName()); + } + else { + return true; + } + } + + + public final void selectOsbpProductProject(IProject project) { + if (osbpProductProjects.containsValue(project)) { + selectOsbpProductProject(project.getName()); + } + else { + selectOsbpProductProject(ProductConfiguration.WORKSPACE_NAME); + } + } + + public final void selectOsbpProductProject(String name) { + IProject project = osbpProductProjects.get(name); + IScopeContext scopeContext = null; + ProductConfigurationPrefs prefs = null; + if (project != null) { + scopeContext = new ProductProjectScope(project); + } + if (scopeContext instanceof ProductProjectScope) { + prefs = new ProductConfigurationPrefs(name, scopeContext, project); + } + else if (scopeContext != null) { + prefs = new ProductConfigurationPrefs(name, scopeContext); + } + if (prefs != null) { + setProductConfigurationPrefs(prefs); + } + else { + setProductConfigurationPrefs(ProductConfiguration.prefs()); + } + } + + public final static ProductConfigurationStore instance() { + getProjectNames(); + if (sInstance == null) { + sInstance = new ProductConfigurationStore(ProductConfiguration.prefs()); + } + return sInstance; + } + + protected ProductConfigurationStore(ProductConfigurationPrefs prefs) { + defaultPrefs = new ProductConfigurationDefaultPrefs(); + this.prefs = prefs; + } + + public String[][] getDataSourcesSelectItems() { + String[] dataSourceNames = new TreeSet<String>(prefs.getDataSourceNames()).toArray(new String[0]); + String[][] namesValues = new String[dataSourceNames.length][2]; + for (int i = 0; i < dataSourceNames.length; i++) { + namesValues[i][0] = dataSourceNames[i]; + namesValues[i][1] = dataSourceNames[i]; + } + return namesValues; + } + + @Override + public boolean getBoolean(String name) { + return getBoolean(prefs, name); + } + + private boolean getBoolean(IProductConfigurationPrefs prefsUsed, String name) { + switch (Preference.by(name)) { + case LOCALIZATION_AUTOCREATE: return prefsUsed.willLanguagesAutocreate(); +// case LOCALIZATION_AUTOTRANSLATE: return prefsUsed.isLanguagesAutotranslate(); + case LOCALIZATION_SHOW_SELECT_IN_RESPECTIVE_LOCALE: return prefsUsed.showLanguageSelectInRespectiveLocale(); + case AUTHENTICATION_AUTOLOGIN: return prefsUsed.hasAutoLogin(); + case AUTHENTICATION_ENCRYPT_PASSWORDS: return prefsUsed.hasEncryptPasswords(); + case AUTHENTICATION_NO_REMEMBER_ME: return prefsUsed.hasNoRememberMe(); + case AUTHENTICATION_VIA_USERNAME: return prefsUsed.getIdentifyByUsername(); + case EMAIL_SSL_ON_CONNECT: return prefsUsed.isEmailUseSslOnConnect(); + case DEMO_TOOLS_LANGUAGE: return prefsUsed.hasDemoToolsLanguage(); + case DEMO_TOOLS_STRATEGY: return prefsUsed.hasDemoToolsStrategy(); + case DEMO_TOOLS_THEME: return prefsUsed.hasDemoToolsTheme(); + case DEMO_TOOLS_PRINTSERVICE: return prefsUsed.hasToolsPrintService(); + case PROJECT_WIZARD_ABSOLUTE_LOCATION: return prefsUsed.projectWizardUsesAbsoluteLocation(); + case BPM_ENGINE_HIBERNATE_SHOW_SQL: return prefsUsed.isBpmEngineHibernateShowSql(); + case BPM_ENGINE_HIBERNATE_FORMAT_SQL: return prefsUsed.isBpmEngineHibernateFormatSql(); + } + LOGGER.error("no Product Configuration boolean attribute "+name+" found"); + return false; + } + + @Override + public void setValue(String name, boolean value) { + switch (Preference.by(name)) { + case LOCALIZATION_AUTOCREATE: prefs.setLanguagesAutocreate(value); return; +// case LOCALIZATION_AUTOTRANSLATE: prefs.setLanguagesAutotranslate(value);return; + case LOCALIZATION_SHOW_SELECT_IN_RESPECTIVE_LOCALE: prefs.setShowLanguageSelectInRespectiveLocale(value); return; + case AUTHENTICATION_AUTOLOGIN: prefs.setAutoLogin(value); return; + case AUTHENTICATION_ENCRYPT_PASSWORDS: prefs.setEncryptPasswords(value); return; + case AUTHENTICATION_NO_REMEMBER_ME: prefs.setNoRememberMe(value); return; + case AUTHENTICATION_VIA_USERNAME: prefs.setIdentifyByUsername(value); return; + case EMAIL_SSL_ON_CONNECT: prefs.setEmailUseSslOnConnect(value); return; + case DEMO_TOOLS_LANGUAGE: prefs.setDemoToolsLanguage(value); return; + case DEMO_TOOLS_STRATEGY: prefs.setDemoToolsStrategy(value); return; + case DEMO_TOOLS_THEME: prefs.setDemoToolsTheme(value); return; + case DEMO_TOOLS_PRINTSERVICE: prefs.setToolsPrintService(value); return; + case PROJECT_WIZARD_ABSOLUTE_LOCATION: prefs.setProjectWizardUsingAbsoluteLocation(value); return; + case BPM_ENGINE_HIBERNATE_SHOW_SQL: prefs.setBpmEngineHibernateShowSql(value); return; + case BPM_ENGINE_HIBERNATE_FORMAT_SQL: prefs.setBpmEngineHibernateFormatSql(value); return; + } + LOGGER.error("no Product Configuration boolean attribute "+name+" found, could not set "+value); + } + + @Override + public int getInt(String name) { + return getInt(prefs, name); + } + + private int getInt(IProductConfigurationPrefs prefsUsed, String name) { + switch (Preference.by(name)) { + case ACTIVEMQ_BROKER_PORT: return prefsUsed.getActiveMqBrokerServerPort(); + case BPM_ENGINE_PORT: return prefsUsed.getBpmServerPort(); + case BPM_ENGINE_TIMEOUT: return prefsUsed.getBpmResponseTimeout(); + case EMAIL_SMTP_PORT: return prefsUsed.getEmailSmtpPort(); + case DTO_REALM_PORTAL_ID: return prefsUsed.getDtoRealmPortalId(); + case LDAP_REALM_PORTAL_ID: return prefsUsed.getLdapRealmPortalId(); + case AUTHENTICATION_MAX_LOGIN_ATTEMPS: return prefsUsed.getMaxLoginAttempts(); + case HYBRID_AUTH_SERVICE_PORT: return prefsUsed.getAuthRESTfulPort(); + case HYBRID_REFRESH_PERSPECTIVE_ACTIVE: return prefsUsed.getHybridRefresherMilliSecsActive(); + case HYBRID_REFRESH_PERSPECTIVE_INACTIVE: return prefsUsed.getHybridRefresherMilliSecsInactive(); + case BPM_ENGINE_HIBERNATE_MAX_FETCH_DEPTH: return prefsUsed.getBpmEngineHibernateMaxFetchDepth(); + } + LOGGER.error("no Product Configuration integer attribute "+name+" found"); + return 0; + } + + @Override + public void setValue(String name, int value) { + switch (Preference.by(name)) { + case ACTIVEMQ_BROKER_PORT: prefs.setActiveMqBrokerServerPort(value); return; + case BPM_ENGINE_PORT: prefs.setBpmServerPort(value); return; + case BPM_ENGINE_TIMEOUT: prefs.setBpmResponseTimeout(value); return; + case EMAIL_SMTP_PORT: prefs.setEmailSmtpPort(value); return; + case DTO_REALM_PORTAL_ID: prefs.setDtoRealmPortalId(value); return; + case LDAP_REALM_PORTAL_ID: prefs.setLdapRealmPortalId(value); return; + case AUTHENTICATION_MAX_LOGIN_ATTEMPS: prefs.setMaxLoginAttempts(value); return; + case HYBRID_AUTH_SERVICE_PORT: prefs.setAuthRESTfulApiPort(value); return; + case HYBRID_REFRESH_PERSPECTIVE_ACTIVE: prefs.setHybridRefresherMilliSecsActive(value); return; + case HYBRID_REFRESH_PERSPECTIVE_INACTIVE: prefs.setHybridRefresherMilliSecsInactive(value); return; + case BPM_ENGINE_HIBERNATE_MAX_FETCH_DEPTH: prefs.setBpmEngineHibernateMaxFetchDepth(value); return; + } + LOGGER.error("no Product Configuration integer attribute "+name+" found, could not set "+value); + } + + public String getString(Preference preference) { + return getString(preference.toString()); + } + + @Override + public String getString(String name) { + return getString(prefs, name); + } + + private String getDesktopUrlPath(String businessBundleClassName) { + return getUrlPath(businessBundleClassName, false); + } + + private String getMobileUrlPath(String businessBundleClassName) { + return getUrlPath(businessBundleClassName, true); + } + + private final static String JETTY_PARAMETER_PORT = "-Dorg.eclipse.osbp.ecview.jetty.port="; + private final static String JETTY_PARAMETER_PATH = "-Dorg.eclipse.osbp.ecview.jetty.contextpath="; + + private String getUrlPath(String businessBundleClassName, boolean asMobile) { + String urlPath = ""; + if ((businessBundleClassName != null) && !businessBundleClassName.isEmpty()) { + IPath path = prefs.getProjectPath(); + if (path != null) { + path = path.append(businessBundleClassName+".product"); + File file = path.toFile(); + if (file.exists() && file.isFile()) { + try { + String content; + InputStream fisSourceFile = new FileInputStream(file); + content = IOUtils.toString(fisSourceFile, "UTF-8"); + if (content != null) { + content = content.replace("\r", " "); + content = content.replace("\n", " "); + content = content.replace("\n", " "); + String portNo = ""; + String baseUrl = ""; + if (content.contains(JETTY_PARAMETER_PORT)) { + portNo = content.substring(content.indexOf(JETTY_PARAMETER_PORT)+JETTY_PARAMETER_PORT.length()).split(" ")[0]; + } + if (content.contains(JETTY_PARAMETER_PATH)) { + baseUrl = content.substring(content.indexOf(JETTY_PARAMETER_PATH)+JETTY_PARAMETER_PATH.length()).split(" ")[0]; + } + if (!portNo.isEmpty() && !baseUrl.isEmpty()) { + urlPath = "localhost:"+portNo+baseUrl; + } + } + } + catch (Exception e) {} + } + } + } + if (!urlPath.isEmpty() && asMobile) { + urlPath += "mobile"; + } + return urlPath; + } + + public String getProductFileName() { + String businessBundleClassName = prefs.getBusinessBundleClassNameReadOnly(); + if (!businessBundleClassName.isEmpty()) { + businessBundleClassName += ".product"; + } + return businessBundleClassName; + } + + private String getString(IProductConfigurationPrefs prefsUsed, String name) { + switch (Preference.by(name)) { + case FILE_LOCATION: return prefs.getPreferencesFile(); + case FILE_EDITOR: return prefs.getPreferencesFile(); + case FILE_NAME: return ProductConfigurationPrefs.PRODUCT_PREFERENCES; + case PRODUCT_FILE: { + String businessBundleClassName = prefs.getBusinessBundleClassNameReadOnly(); + if (!businessBundleClassName.isEmpty()) { + businessBundleClassName += ".product"; + } + return businessBundleClassName; + } + case DESKTOP_URL_PATH: return getDesktopUrlPath(prefs.getBusinessBundleClassNameReadOnly()); + case MOBILE_URL_PATH: return getMobileUrlPath(prefs.getBusinessBundleClassNameReadOnly()); + case SHOW_PRODUCT_CONFIGURATION: return prefs.getName(); + case SELECT_PRODUCT_CONFIGURATION: return prefs.getName(); + // + case ACTIVEMQ_BROKER_SERVER: return prefsUsed.getActiveMqBrokerServerName(); + case BPM_ENGINE_SERVER: return prefsUsed.getBpmServerIp(); + case BPM_ENGINE_HIBERNATE_SCHEMA_NAME: return prefsUsed.getBpmEngineHibernateSchemaName(prefsUsed.getBpmEnginePersistenceUnit()); + case EMAIL_SERVER: return prefsUsed.getEmailServerIp(); + case AUTHENTICATION_ADMIN_EMAIL: return prefsUsed.getAdminEmail(); + case AUTHENTICATION_ADMIN_USERNAME: return prefsUsed.getAdminEmailUsername(); + case AUTHENTICATION_ADMIN_PASSWORD: return prefsUsed.getAdminEmailPassword(); + case AUTHENTICATION_ORGANIZATION_ID: return prefsUsed.getAuthenticationOrganizationId(); +// case DATASOURCE_AUTHENTICATION: return prefsUsed.getDataSourceNameForAuthentication(); +// case DATASOURCE_BLOB: return prefsUsed.getDataSourceNameForBLOB(); +// case DATASOURCE_BPM: return prefsUsed.getDataSourceNameForBPM(); +// case DATASOURCE_BUSINESSDATA: return prefsUsed.getDataSourceNameForBusinessData(); + case EXCHANGE_RATES_EURO_BASED_DAILY: return prefsUsed.getEuroXRefRatesURLDaily(); + case EXCHANGE_RATES_EURO_BASED_PREVIOUS: return prefsUsed.getEuroXRefRatesURLPrevious(); + case JAVA_POS_CONFIGURATION: return prefsUsed.getJavaPosConfiguration(); + case FILE_CONTENT: { + Stream<String> lines=null; + try { + lines = Files.lines(Paths.get(getString(Preference.FILE_LOCATION), ".settings", getString(Preference.FILE_NAME)+".prefs")); + return StringUtils.join(lines.toArray(), "\r\n"); + } catch (IOException e) { + return ""; + } finally { + if( lines != null) + lines.close(); + } + } +// case LOCALIZATION_GOOGLE_API_KEY: return prefsUsed.getLanguagesGoogleApiKey(); +// case LOCALIZATION_GOOGLE_HTTP_REFERRER: return prefsUsed.getLanguagesGoogleHttpReferrer(); + case LOCALIZATION_SUPPORTED_LANGUAGES: { + HashSet<Locale> helper = new HashSet<>(); + for (Locale locale : prefsUsed.getLanguages().values()) { + if (locale != null) { + helper.add(locale); + } + } + Locale[] locales = helper.toArray(new Locale[0]); + sortLocalesOnDisplayNameOnPages(locales); + String retcode = null; + for (Locale locale : locales) { + if (locale != null) { + if (retcode == null) { + retcode = getLanguageDisplayName(locale, showLanguageSelectInRespectiveLocaleOnPages()); + } + else { + retcode += CONFIGURATION_ITEM_SEPARATOR+getLanguageDisplayName(locale, showLanguageSelectInRespectiveLocaleOnPages()); + } + } + } + return retcode; + } + case DATASOURCES: return DataSourceConfiguration.serialize(prefsUsed.getDataSources()); + case PERSISTENCE_UNITS: return PersistenceUnitConfiguration.serialize(prefsUsed.getPersistenceUnits()); + case LDAP_CONTEXT_FACTORY_URL: return prefsUsed.getLdapContextFactoryUrl(); + case LDAP_USER_DN_TEMPLATE: return prefsUsed.getLdapUserDnTemplate(); + } + LOGGER.error("no Product Configuration string attribute "+name+" found"); + return ""; + } + + public final String getLanguageDisplayName(Locale locale) { + return getLanguageDisplayName(locale, prefs.showLanguageSelectInRespectiveLocale()); + } + + public final String getLanguageDisplayName(Locale locale, boolean showLanguageSelectInRespectiveLocale) { + return LocaleUtils.getDisplayName(locale, showLanguageSelectInRespectiveLocale)+" "+LANGUAGE_DESCRIPTION_SEPARATOR+" "+locale.toString(); + } + + public final static String CONFIGURATION_ITEM_SEPARATOR = ";"; + public final static String LANGUAGE_DESCRIPTION_SEPARATOR = "="; + + @Override + public void setValue(String name, String value) { + switch (Preference.by(name)) { + case SHOW_PRODUCT_CONFIGURATION: /* NOOP */ return; + case SELECT_PRODUCT_CONFIGURATION: selectOsbpProductProject(value); return; + case ACTIVEMQ_BROKER_SERVER: prefs.setActiveMqBrokerServerName(value); return; + case BPM_ENGINE_SERVER: prefs.setBpmServerIp(value); return; + case BPM_ENGINE_HIBERNATE_SCHEMA_NAME: prefs.setBpmEngineHibernateSchemaName(value); return; + case EMAIL_SERVER: prefs.setEmailServerIp(value); return; + case AUTHENTICATION_ADMIN_EMAIL: prefs.setAdminEmail(value); return; + case AUTHENTICATION_ADMIN_USERNAME: prefs.setAdminEmailUsername(value); return; + case AUTHENTICATION_ADMIN_PASSWORD: prefs.setAdminEmailPassword(value); return; + case AUTHENTICATION_ORGANIZATION_ID: prefs.setAuthenticationOrganizationId(value); return; + //case AUTHENTICATION_LDAP_DN_TEMPLATE: break; + //case AUTHENTICATION_LDAP_SERVER: break; +// case DATASOURCE_AUTHENTICATION: prefs.setDataSourceForAuthentication(value); return; +// case DATASOURCE_BLOB: prefs.setDataSourceForBLOB(value); return; +// case DATASOURCE_BPM: prefs.setDataSourceForBPM(value); return; +// case DATASOURCE_BUSINESSDATA: prefs.setDataSourceForBusinessData(value); return; + case EXCHANGE_RATES_EURO_BASED_DAILY: prefs.setEuroForeignExchangeReferenceRatesURLDaily(value); return; + case EXCHANGE_RATES_EURO_BASED_PREVIOUS: prefs.setEuroForeignExchangeReferenceRatesURLPrevious(value); return; + case JAVA_POS_CONFIGURATION: prefs.setJavaPosConfiguration(value); return; + case FILE_CONTENT: return; + case FILE_LOCATION: return; + case FILE_NAME: return; +// case LOCALIZATION_GOOGLE_API_KEY: prefs.setLanguagesGoogleApiKey(value); return; +// case LOCALIZATION_GOOGLE_HTTP_REFERRER: prefs.setLanguagesGoogleHttpReferrer(value); return; + case LOCALIZATION_SUPPORTED_LANGUAGES: { + Map<String, Locale> locales = new HashMap<String, Locale>(); + String[] localesISO = value.split(CONFIGURATION_ITEM_SEPARATOR); + for(String localeISO : localesISO) { + try { + Locale locale = null; + String[] lParts = localeISO.split(LANGUAGE_DESCRIPTION_SEPARATOR)[1].trim().split("_"); + if (lParts.length == 1) { + locale = new Locale(lParts[0]); + } else if (lParts.length == 2) { + locale = new Locale(lParts[0], lParts[1]); + } else if (lParts.length == 3) { + locale = new Locale(lParts[0], lParts[1], lParts[2]); + } + locales.put(localeISO, locale); + } + catch (Exception e) { + LOGGER.error("could not set lanuage "+localeISO, e); + } + } + prefs.setLanguages(locales); + return; + } + case DATASOURCES: prefs.setDataSources(DataSourceConfiguration.deserialize(value)); return; + case PERSISTENCE_UNITS: prefs.setPersistenceUnits(PersistenceUnitConfiguration.deserialize(value)); return; + case LDAP_CONTEXT_FACTORY_URL: prefs.setLdapContextFactoryUrl(value); return; + case LDAP_USER_DN_TEMPLATE: prefs.setLdapUserDnTemplate(value); return; + } + LOGGER.error("no Product Configuration string attribute "+name+" found, could not set "+value); + } + + // --- unused methods --- + + @Override + public void addPropertyChangeListener(IPropertyChangeListener listener) { + // TODO Auto-generated method stub + } + + @Override + public boolean contains(String name) { + // TODO Auto-generated method stub + return false; + } + + @Override + public void firePropertyChangeEvent(String name, Object oldValue, Object newValue) { + // TODO Auto-generated method stub + } + + @Override + public boolean getDefaultBoolean(String name) { + return getBoolean(defaultPrefs, name); + } + + @Override + public double getDefaultDouble(String name) { + LOGGER.error("no Product Configuration integer attribute "+name+" found"); + return 0; + } + + @Override + public float getDefaultFloat(String name) { + LOGGER.error("no Product Configuration integer attribute "+name+" found"); + return 0; + } + + @Override + public int getDefaultInt(String name) { + return getInt(defaultPrefs, name); + } + + @Override + public long getDefaultLong(String name) { + LOGGER.error("no Product Configuration integer attribute "+name+" found"); + return 0; + } + + @Override + public String getDefaultString(String name) { + return getString(defaultPrefs, name); + } + + @Override + public double getDouble(String name) { + LOGGER.error("no Product Configuration integer attribute "+name+" found"); + return 0; + } + + @Override + public float getFloat(String name) { + LOGGER.error("no Product Configuration integer attribute "+name+" found"); + return 0; + } + + @Override + public long getLong(String name) { + LOGGER.error("no Product Configuration integer attribute "+name+" found"); + return 0; + } + + @Override + public boolean isDefault(String name) { + return false; + } + + @Override + public boolean needsSaving() { + return false; + } + + @Override + public void putValue(String name, String value) { + // TODO Auto-generated method stub + } + + @Override + public void removePropertyChangeListener(IPropertyChangeListener listener) { + // TODO Auto-generated method stub + } + + @Override + public void setDefault(String name, double value) { + // TODO Auto-generated method stub + } + + @Override + public void setDefault(String name, float value) { + // TODO Auto-generated method stub + } + + @Override + public void setDefault(String name, int value) { + // TODO Auto-generated method stub + } + + @Override + public void setDefault(String name, long value) { + // TODO Auto-generated method stub + } + + @Override + public void setDefault(String name, String defaultObject) { + // TODO Auto-generated method stub + } + + @Override + public void setDefault(String name, boolean value) { + // TODO Auto-generated method stub + } + + @Override + public void setToDefault(String name) { + // TODO Auto-generated method stub + } + + @Override + public void setValue(String name, double value) { + // TODO Auto-generated method stub + } + + @Override + public void setValue(String name, float value) { + // TODO Auto-generated method stub + } + + @Override + public void setValue(String name, long value) { + // TODO Auto-generated method stub + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/data/ProductProjectScope.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/data/ProductProjectScope.java new file mode 100644 index 0000000..65bb024 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/data/ProductProjectScope.java @@ -0,0 +1,143 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.data; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import org.eclipse.core.internal.resources.ProjectPreferences; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.preferences.IEclipsePreferences; +import org.eclipse.core.runtime.preferences.IScopeContext; +import org.osgi.service.prefs.BackingStoreException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.eclipse.osbp.preferences.ProductConfigurationPrefs; + +public final class ProductProjectScope implements IScopeContext { + + private static final Logger LOGGER = LoggerFactory.getLogger(ProductProjectScope.class); + + /** + * String constant (value of <code>"project"</code>) used for the + * scope name for this preference scope. + */ + public static final String SCOPE = "project"; //$NON-NLS-1$ + + private IProject context; + + /** + * Create and return a new project scope for the given project. The given + * project must not be <code>null</code>. + * + * @param context the project + * @exception IllegalArgumentException if the project is <code>null</code> + */ + public ProductProjectScope(IProject context) { + super(); + if (context == null) + throw new IllegalArgumentException(); + this.context = context; + } + + /* + * @see org.eclipse.core.runtime.preferences.IScopeContext#getLocation() + */ + public IPath getLocation() { + IProject project = ((IResource) context).getProject(); + IResource resource = ProductConfigurationPrefs.getPrefsFile(project); + if (resource == null) { + IPath location = project.getLocation(); + return location == null ? null : location.append(ProductConfigurationPrefs.PREFERENCES_FULL_PATH); + } + else { + return resource.getLocation(); + } + } + + /* + * @see org.eclipse.core.runtime.IScopeContext#getNode(java.lang.String) + */ + public IEclipsePreferences getNode(String qualifier) { + IEclipsePreferences preference = null; + if (qualifier == null) + throw new IllegalArgumentException(); + preference = (IEclipsePreferences) Platform.getPreferencesService().getRootNode().node(SCOPE).node(context.getName()).node(qualifier); + IFile prefsFile = null; + if (context instanceof IProject) { + IResource resource = ProductConfigurationPrefs.getPrefsFile((IProject)context); + if (resource instanceof IFile) { + prefsFile = (IFile) resource; + } + } + if (prefsFile == null) { + prefsFile = context.getFile(new Path(ProductConfigurationPrefs.PREFERENCES_FULL_PATH)); + } + if (prefsFile instanceof IFile) { + try { + Class<?> preferenceClass = preference.getClass(); + Method getLoadLevel = preferenceClass.getDeclaredMethod("getLoadLevel"); + getLoadLevel.setAccessible(true); + ProjectPreferences loadLevelInstance = (ProjectPreferences) getLoadLevel.invoke(preference); + Class<?>loadLevelClass = loadLevelInstance.getClass(); + Field fileField = loadLevelClass.getDeclaredField("file"); + fileField.setAccessible(true); + IFile activeFile = (IFile) fileField.get(loadLevelInstance); + if ((activeFile == null) || !activeFile.getFullPath().toOSString().equals(prefsFile.getFullPath().toOSString())) { + fileField.set(loadLevelInstance, prefsFile); + preference.sync(); + LOGGER.info("set preference file to: "+prefsFile.getFullPath().toOSString()); + } + } + catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException | BackingStoreException | NoSuchMethodException | SecurityException | InvocationTargetException x) { + LOGGER.error("exception while trying to check and set preference file", x); + } + } + return preference; + } + + /* + * @see org.eclipse.core.runtime.preferences.IScopeContext#getName() + */ + public String getName() { + return SCOPE; + } + + /* (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ + public boolean equals(Object obj) { + if (this == obj) + return true; + if (!super.equals(obj)) + return false; + if (!(obj instanceof ProductProjectScope)) + return false; + ProductProjectScope other = (ProductProjectScope) obj; + return context.equals(other.context); + } + + /* (non-Javadoc) + * @see java.lang.Object#hashCode() + */ + public int hashCode() { + return super.hashCode() + context.getFullPath().hashCode(); + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/Activator.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/Activator.java new file mode 100644 index 0000000..e699f59 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/Activator.java @@ -0,0 +1,46 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.page; + +import org.eclipse.osbp.gitinfo.Loginfo; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + + +public class Activator implements BundleActivator { + + private static BundleContext context; + + static BundleContext getContext() { + return context; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + Loginfo li = new Loginfo(); + li.print( Activator.class.getCanonicalName(), Activator.class.getClassLoader()); + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + } + +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageAuthentication.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageAuthentication.java new file mode 100644 index 0000000..8608c70 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageAuthentication.java @@ -0,0 +1,49 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.page; + +import org.eclipse.osbp.preferences.Preference; +import org.eclipse.osbp.preferences.ui.component.APreferencePage; +import org.eclipse.osbp.preferences.ui.component.Item; +import org.eclipse.osbp.preferences.ui.component.Type; + +public class PreferencePageAuthentication extends APreferencePage { + + public PreferencePageAuthentication() { + super( + "authentication", + "Configuration to Authentication Services" + ); + } + + @Override + protected Item[] initializeItems() { + return new Item[] { + new Item(Type.TEXT, Preference.SHOW_PRODUCT_CONFIGURATION, "Product Configuration", false), + new Item(""), + new Item(Type.TEXT, Preference.AUTHENTICATION_ORGANIZATION_ID, "Organization ID"), + new Item(""), + new Item(Type.BOOLEAN, Preference.AUTHENTICATION_AUTOLOGIN, "Enable Automatic sign-in"), + new Item(Type.BOOLEAN, Preference.AUTHENTICATION_NO_REMEMBER_ME, "Disable rememer-me function"), + new Item(Type.BOOLEAN, Preference.AUTHENTICATION_VIA_USERNAME, "Identify by username"), + new Item(Type.INTEGER, Preference.AUTHENTICATION_MAX_LOGIN_ATTEMPS, "Max. failed login attemps"), + new Item(Type.BOOLEAN, Preference.AUTHENTICATION_ENCRYPT_PASSWORDS, "Enable encryption of uncrypted passwords"), + //new Item(""), + //new Item(Type.INTEGER, Preference.DTO_REALM_PORTAL_ID, "DTO realm portal id"), + new Item(""), + //new Item(Type.INTEGER, Preference.LDAP_REALM_PORTAL_ID, "LDAP realm portal id"), + new Item(Type.TEXT, Preference.LDAP_CONTEXT_FACTORY_URL, "LDAP context factory url"), + new Item(Type.TEXT, Preference.LDAP_USER_DN_TEMPLATE, "LDAP user dn template"), + }; + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageBpmEngine.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageBpmEngine.java new file mode 100644 index 0000000..f115ff5 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageBpmEngine.java @@ -0,0 +1,46 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.page; + +import org.eclipse.osbp.preferences.IProductConfigurationPrefs; +import org.eclipse.osbp.preferences.Preference; +import org.eclipse.osbp.preferences.ui.component.APreferencePage; +import org.eclipse.osbp.preferences.ui.component.Item; +import org.eclipse.osbp.preferences.ui.component.Type; + +public class PreferencePageBpmEngine extends APreferencePage { + + public PreferencePageBpmEngine() { + super( + "bpmEngine", + "bpm engine" + ); + } + + @Override + protected Item[] initializeItems() { + return new Item[] { + new Item(Type.TEXT, Preference.SHOW_PRODUCT_CONFIGURATION, "Product Configuration", false), + new Item(""), + new Item("Bpm Engine Settings"), + new Item(Type.SERVER, Preference.BPM_ENGINE_SERVER, "Server Name or IP"), + new Item(Type.INTEGER, Preference.BPM_ENGINE_PORT, "Port (default="+IProductConfigurationPrefs.DEFAULT_PORT_BPM_ENGINE+")"), + new Item(Type.INTEGER, Preference.BPM_ENGINE_TIMEOUT, "Timeout in msec"), + new Item("Hibernate Settings"), + new Item(Type.TEXT, Preference.BPM_ENGINE_HIBERNATE_SCHEMA_NAME, "Schema Name"), + new Item(Type.BOOLEAN, Preference.BPM_ENGINE_HIBERNATE_SHOW_SQL, "Show SQL"), + new Item(Type.BOOLEAN, Preference.BPM_ENGINE_HIBERNATE_FORMAT_SQL, "Format SQL"), + new Item(Type.INTEGER, Preference.BPM_ENGINE_HIBERNATE_MAX_FETCH_DEPTH, "Max fetch depth"), + }; + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageDataSources.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageDataSources.java new file mode 100644 index 0000000..dd89ca5 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageDataSources.java @@ -0,0 +1,41 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.page; + +import org.eclipse.osbp.preferences.Preference; +import org.eclipse.osbp.preferences.ui.component.APreferencePage; +import org.eclipse.osbp.preferences.ui.component.Item; +import org.eclipse.osbp.preferences.ui.component.Type; + +public class PreferencePageDataSources extends APreferencePage { + + public PreferencePageDataSources() { + super( + "dataSources", + "accessible internal data sources" + ); + } + + @Override + protected Item[] initializeItems() { + return new Item[] { + new Item(Type.TEXT, Preference.SHOW_PRODUCT_CONFIGURATION, "Product Configuration", false), + new Item(""), + new Item(Type.TREE_DATASOURCES, Preference.DATASOURCES, "JNDI Data Sources"), +// new Item(""), +// new Item("Assignments"), +// new Item(Type.SELECT, Preference.DATASOURCE_PRODUCTION, "production data source", store.getDataSourcesSelectItems()), +// new Item(Type.SELECT, Preference.DATASOURCE_BPM, "data source for BPM", store.getDataSourcesSelectItems()), + }; + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageDemo.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageDemo.java new file mode 100644 index 0000000..a583229 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageDemo.java @@ -0,0 +1,40 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ + package org.eclipse.osbp.preferences.ui.page; + +import org.eclipse.osbp.preferences.Preference; +import org.eclipse.osbp.preferences.ui.component.APreferencePage; +import org.eclipse.osbp.preferences.ui.component.Item; +import org.eclipse.osbp.preferences.ui.component.Type; + +public class PreferencePageDemo extends APreferencePage { + + public PreferencePageDemo() { + super( + "demo", + "Configuration of demo settings" + ); + } + + @Override + protected Item[] initializeItems() { + return new Item[] { + new Item(Type.TEXT, Preference.SHOW_PRODUCT_CONFIGURATION, "Product Configuration", false), + new Item(""), + new Item(Type.BOOLEAN, Preference.DEMO_TOOLS_THEME, "Enable theme selection"), + new Item(Type.BOOLEAN, Preference.DEMO_TOOLS_STRATEGY, "Enable layout-strategy selection"), + new Item(Type.BOOLEAN, Preference.DEMO_TOOLS_LANGUAGE, "Enable language/country selection"), + new Item(Type.BOOLEAN, Preference.DEMO_TOOLS_PRINTSERVICE, "Enable print service selection"), + }; + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageEmail.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageEmail.java new file mode 100644 index 0000000..54a4dab --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageEmail.java @@ -0,0 +1,44 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.page; + +import org.eclipse.osbp.preferences.IProductConfigurationPrefs; +import org.eclipse.osbp.preferences.Preference; +import org.eclipse.osbp.preferences.ui.component.APreferencePage; +import org.eclipse.osbp.preferences.ui.component.Item; +import org.eclipse.osbp.preferences.ui.component.Type; + +public class PreferencePageEmail extends APreferencePage { + + public PreferencePageEmail() { + super( + "email", + "Configuration of Email services" + ); + } + + @Override + protected Item[] initializeItems() { + return new Item[] { + new Item(Type.TEXT, Preference.SHOW_PRODUCT_CONFIGURATION, "Product Configuration", false), + new Item(""), + new Item(Type.SERVER, Preference.EMAIL_SERVER, "Server Name or IP"), + new Item(Type.INTEGER, Preference.EMAIL_SMTP_PORT, "SMTP Port (default="+IProductConfigurationPrefs.DEFAULT_PORT_EMAIL_SMTP+")"), + new Item(Type.BOOLEAN, Preference.EMAIL_SSL_ON_CONNECT, "SSL on connect"), + new Item(""), + new Item(Type.EMAIL, Preference.AUTHENTICATION_ADMIN_EMAIL, "Administrator Email Address"), + new Item(Type.TEXT, Preference.AUTHENTICATION_ADMIN_USERNAME, "Administrator Email Username"), + new Item(Type.PASSWORD, Preference.AUTHENTICATION_ADMIN_PASSWORD, "Administrator Email Password"), + }; + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageExternalDataSources.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageExternalDataSources.java new file mode 100644 index 0000000..5189717 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageExternalDataSources.java @@ -0,0 +1,55 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.page; + +import java.util.regex.Pattern; + +import org.eclipse.jface.preference.FieldEditor; + +import org.eclipse.osbp.preferences.Preference; +import org.eclipse.osbp.preferences.ui.component.APreferencePage; +import org.eclipse.osbp.preferences.ui.component.Item; +import org.eclipse.osbp.preferences.ui.component.Type; + +public class PreferencePageExternalDataSources extends APreferencePage { + + public PreferencePageExternalDataSources() { + super( + "externalDataSources", + "external data sources" + ); + } + + @Override + protected Item[] initializeItems() { + return new Item[] { + new Item(Type.TEXT, Preference.SHOW_PRODUCT_CONFIGURATION, "Product Configuration", false), + new Item(""), + new Item("URL for external XML file provider for Euro based exchange rates"), + new Item(Type.TEXT, Preference.EXCHANGE_RATES_EURO_BASED_PREVIOUS, "All historic"), + new Item(Type.TEXT, Preference.EXCHANGE_RATES_EURO_BASED_DAILY, "Actual day"), + new Item("JavaPOS"), + new Item(Type.TEXT, Preference.JAVA_POS_CONFIGURATION, "Configuration"), + }; + } + + @Override + public boolean doCheckState(FieldEditor editor, String input) { + switch (Preference.by(editor.getPreferenceName())) { + case EXCHANGE_RATES_EURO_BASED_DAILY: + case EXCHANGE_RATES_EURO_BASED_PREVIOUS: + return Pattern.matches(REGEX_URL_XML_FILE, input); + } + return true; + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageHybridClient.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageHybridClient.java new file mode 100644 index 0000000..f610dbd --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageHybridClient.java @@ -0,0 +1,43 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.page; + +import org.eclipse.osbp.preferences.Preference; +import org.eclipse.osbp.preferences.ui.component.APreferencePage; +import org.eclipse.osbp.preferences.ui.component.Item; +import org.eclipse.osbp.preferences.ui.component.Type; + +public class PreferencePageHybridClient extends APreferencePage { + + public PreferencePageHybridClient() { + super( + "hybridclient", + "Configuration needed, when OSBP is embedded inside a Web-Client:" + ); + } + + @Override + protected Item[] initializeItems() { + return new Item[] { + new Item(Type.TEXT, Preference.SHOW_PRODUCT_CONFIGURATION, "Product Configuration", false), + new Item(""), + new Item(Type.INTEGER, Preference.HYBRID_AUTH_SERVICE_PORT, "Auth-Service-Port"), + new Item("This port is provided, when the Web-Client has to connect to the same authentication service."), + new Item(""), + new Item("Refreshing the application list in the Web-Client in milliseconds on an ..."), + new Item(Type.INTEGER, Preference.HYBRID_REFRESH_PERSPECTIVE_ACTIVE, "...active perspective"), + new Item(Type.INTEGER, Preference.HYBRID_REFRESH_PERSPECTIVE_INACTIVE, "...inactive perspective") + }; + } + +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageLocalization.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageLocalization.java new file mode 100644 index 0000000..bb02599 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageLocalization.java @@ -0,0 +1,93 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.page; + +import java.util.HashSet; +import java.util.Locale; + +import org.eclipse.osbp.preferences.Preference; +import org.eclipse.osbp.preferences.ProductConfiguration; +import org.eclipse.osbp.preferences.ui.component.APreferencePage; +import org.eclipse.osbp.preferences.ui.component.AddRemoveListFieldEditor; +import org.eclipse.osbp.preferences.ui.component.Item; +import org.eclipse.osbp.preferences.ui.component.Type; +import org.eclipse.osbp.preferences.ui.data.ProductConfigurationStore; + +public class PreferencePageLocalization extends APreferencePage { + + public PreferencePageLocalization() { + super( + "localization", + "localization" + ); + } + + protected String[][] getAvailableLanguages() { + Locale[] locales; + if (store.isWorkspaceSelected()) { + locales = Locale.getAvailableLocales(); + } + else { + HashSet<Locale> helper = new HashSet<>(); + for (Locale locale : ProductConfiguration.getLanguages().values()) { + if (locale != null) { + helper.add(locale); + } + } + locales = helper.toArray(new Locale[0]); + } + String[][] retcode = new String[locales.length][2]; + // --- sort by display name used in the respective locale, if it is configured --- + store.sortLocalesOnDisplayNameOnPages(locales); + int idx = 0; + for (Locale locale : locales) { +// String loc = locale.getLanguage(); +// if (locale.getCountry().length() > 0) { +// loc += "_" + locale.getCountry(); +// } else if (locale.getVariant().length() > 0) { +// loc += "_" + locale.getVariant(); +// } + String loc = locale.toString(); + if (!loc.isEmpty()) { + retcode[idx][0] = loc; + retcode[idx][1] = store.getLanguageDisplayName(locale, false); + } + idx++; + } + return retcode; + } + + @Override + public void initialize() { + super.initialize(); + AddRemoveListFieldEditor languages = (AddRemoveListFieldEditor)getEditor(Preference.LOCALIZATION_SUPPORTED_LANGUAGES); + if (languages != null) { + languages.setAvailableNamesAndValues(getAvailableLanguages()); + } + } + + @Override + protected Item[] initializeItems() { + return new Item[] { + new Item(Type.TEXT, Preference.SHOW_PRODUCT_CONFIGURATION, "Product Configuration", false), + new Item(""), + new Item(Type.BOOLEAN, Preference.LOCALIZATION_AUTOCREATE, "Extract I18N Properties"), + // new Item(Type.BOOLEAN, Preference.LOCALIZATION_AUTOTRANSLATE, "Use Google Translator"), + new Item(Type.BOOLEAN, Preference.LOCALIZATION_SHOW_SELECT_IN_RESPECTIVE_LOCALE, "Display locale selection in respective locale"), + // new Item(Type.TEXT, Preference.LOCALIZATION_GOOGLE_API_KEY, "Google API Key"), + // new Item(Type.TEXT, Preference.LOCALIZATION_GOOGLE_HTTP_REFERRER, "Google HTTP Referrer"), + new Item(""), + new Item(Type.LIST_ADD_REMOVE, Preference.LOCALIZATION_SUPPORTED_LANGUAGES, "Supported Languages", getAvailableLanguages(), ProductConfigurationStore.CONFIGURATION_ITEM_SEPARATOR), + }; + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageMain.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageMain.java new file mode 100644 index 0000000..2e7a8d1 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageMain.java @@ -0,0 +1,91 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.page; + +import org.eclipse.jface.preference.FieldEditor; +import org.eclipse.jface.util.PropertyChangeEvent; +import org.eclipse.osbp.preferences.Preference; +import org.eclipse.osbp.preferences.ui.component.APreferencePage; +import org.eclipse.osbp.preferences.ui.component.Item; +import org.eclipse.osbp.preferences.ui.component.Type; +import org.eclipse.swt.widgets.Composite; + +public class PreferencePageMain extends APreferencePage { + + public PreferencePageMain() { + super( + "main", + "Summary of the OSBP Product Configuration:" + ); + //noDefaultAndApplyButton(); + } + + @Override + protected Item[] initializeItems() { + Item configuration; + if (isPageType(PageType.PREFENCE)) { + configuration = new Item(Type.SELECT, Preference.SELECT_PRODUCT_CONFIGURATION, "Product Configuration", store.getProjectNames()); + } + else { + configuration = new Item(Type.TEXT, Preference.SHOW_PRODUCT_CONFIGURATION, "Product Configuration", false); + } + return new Item[] { + configuration, + new Item(Type.TEXT, Preference.FILE_LOCATION, "File Location", false), + new Item(Type.FILE_EDITOR, Preference.FILE_EDITOR, "Open File", true), + new Item(Type.TEXT, Preference.PRODUCT_FILE, "Product File", false), + new Item(Type.TEXT, Preference.DESKTOP_URL_PATH, "Desktop Url Path", false), + new Item(Type.TEXT, Preference.MOBILE_URL_PATH, "Mobile Url Path", false) + }; + } + + @Override + public void createControl(Composite parent) { + super.createControl(parent); + if (getApplyButton() != null) { + getApplyButton().setEnabled(false); + } + if (getDefaultsButton() != null) { + getDefaultsButton().setEnabled(false); + } + } + + @Override + protected void performDefaults() { + super.performDefaults(); + } + + @Override + public boolean performOk() { + boolean retcode = super.performOk(); + if (getApplyButton() != null) { + getApplyButton().setEnabled(false); + } + if (getDefaultsButton() != null) { + getDefaultsButton().setEnabled(false); + } + return retcode; + } + + @Override + public void propertyChange(PropertyChangeEvent event) { + super.propertyChange(event); + if (event.getSource() instanceof FieldEditor) { + if (getEditor(Preference.SELECT_PRODUCT_CONFIGURATION) == event.getSource()) { + if (event.getNewValue() instanceof String) { + store.selectOsbpProductProject((String) event.getNewValue()); + } + } + } + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePagePersistenceUnits.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePagePersistenceUnits.java new file mode 100644 index 0000000..ec86d44 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePagePersistenceUnits.java @@ -0,0 +1,41 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.page; + +import org.eclipse.osbp.preferences.Preference; +import org.eclipse.osbp.preferences.ui.component.APreferencePage; +import org.eclipse.osbp.preferences.ui.component.Item; +import org.eclipse.osbp.preferences.ui.component.Type; + +public class PreferencePagePersistenceUnits extends APreferencePage { + + public PreferencePagePersistenceUnits() { + super( + "persistenceUnits", + "accessible internal data sources" + ); + } + + @Override + protected Item[] initializeItems() { + return new Item[] { + new Item(Type.TEXT, Preference.SHOW_PRODUCT_CONFIGURATION, "Product Configuration", false), + new Item(""), + new Item(Type.TREE_PERSISTENCEUNITS, Preference.PERSISTENCE_UNITS, "Persistence Units"), +// new Item(""), +// new Item("Assignments"), +// new Item(Type.SELECT, Preference.DATASOURCE_PRODUCTION, "production data source", store.getDataSourcesSelectItems()), +// new Item(Type.SELECT, Preference.DATASOURCE_BPM, "data source for BPM", store.getDataSourcesSelectItems()), + }; + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageProjectWizard.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageProjectWizard.java new file mode 100644 index 0000000..bfea88f --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageProjectWizard.java @@ -0,0 +1,37 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ + package org.eclipse.osbp.preferences.ui.page; + +import org.eclipse.osbp.preferences.Preference; +import org.eclipse.osbp.preferences.ui.component.APreferencePage; +import org.eclipse.osbp.preferences.ui.component.Item; +import org.eclipse.osbp.preferences.ui.component.Type; + +public class PreferencePageProjectWizard extends APreferencePage { + + public PreferencePageProjectWizard() { + super( + "projectwizard", + "Configuration of project Wizard settings" + ); + } + + @Override + protected Item[] initializeItems() { + return new Item[] { + new Item(Type.TEXT, Preference.SHOW_PRODUCT_CONFIGURATION, "Product Configuration", false), + new Item(""), + new Item(Type.BOOLEAN, Preference.PROJECT_WIZARD_ABSOLUTE_LOCATION, "Project Wizard uses absolute location"), + }; + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageServiceCommunication.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageServiceCommunication.java new file mode 100644 index 0000000..6648c6f --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageServiceCommunication.java @@ -0,0 +1,82 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.page; + +import org.eclipse.jface.preference.FieldEditor; + +import org.eclipse.osbp.preferences.*; +import org.eclipse.osbp.preferences.ui.component.APreferencePage; +import org.eclipse.osbp.preferences.ui.component.Item; +import org.eclipse.osbp.preferences.ui.component.Type; +import org.eclipse.osbp.preferences.ui.utils.CheckStateServerName; +import org.eclipse.osbp.webserver.messagequeue.CXMqConnection; + +public class PreferencePageServiceCommunication extends APreferencePage { + + public PreferencePageServiceCommunication() { + super( + "serviceCommunication", + "service communications" + ); + } + + @Override + protected Item[] initializeItems() { + return new Item[] { + new Item(Type.TEXT, Preference.SHOW_PRODUCT_CONFIGURATION, "Product Configuration", false), + new Item(""), + new Item("Service Communication Server ActiveMQ Broker"), + new Item(Type.TEXT, Preference.ACTIVEMQ_BROKER_SERVER, "Server Name or IP"), + new Item(Type.INTEGER, Preference.ACTIVEMQ_BROKER_PORT, "Port (default="+IProductConfigurationPrefs.DEFAULT_PORT_ACTIVE_MQ_BROKER_SERVICE+")") + }; + } + + @Override + public boolean doCheckState(FieldEditor editor, String input) { + switch (Preference.by(editor.getPreferenceName())) { + case ACTIVEMQ_BROKER_PORT: + Object brokerHost = getValue(Preference.ACTIVEMQ_BROKER_SERVER); + if (brokerHost instanceof String) { + int brokerPort = ItemDescription.parseInt(input, 0); + if (!CXMqConnection.checkValidBroker((String) brokerHost, brokerPort)) { + String errorMessage = "ActiveMQ Broker not responding"; + setErrorMessage(errorMessage); + return false; + } + } + } + return super.doCheckState(editor, input); + } + + @Override + public boolean performOk() { + Object brokerHost = getValue(Preference.ACTIVEMQ_BROKER_SERVER); + Object sbrokerPort = getValue(Preference.ACTIVEMQ_BROKER_PORT); + if (brokerHost instanceof String) { + String errorMessage = CheckStateServerName.doCheckState((String)brokerHost, 5000); + if (errorMessage != null) { + setErrorMessage(errorMessage); + return false; + } + int brokerPort = ItemDescription.parseInt((String)sbrokerPort, 0); + if (!CXMqConnection.checkValidBroker((String) brokerHost, brokerPort)) { + errorMessage = "ActiveMQ Broker not responding"; + setErrorMessage(errorMessage); + return true; + } + } + return super.performOk(); + } + + +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageVerifyDependencies.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageVerifyDependencies.java new file mode 100644 index 0000000..ca39db6 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/page/PreferencePageVerifyDependencies.java @@ -0,0 +1,71 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.page; + +import java.util.ArrayList; + +import org.apache.commons.lang3.reflect.FieldUtils; +import org.eclipse.jface.preference.FieldEditor; +import org.eclipse.osbp.preferences.Preference; +import org.eclipse.osbp.preferences.ui.component.APreferencePage; +import org.eclipse.osbp.preferences.ui.component.Item; +import org.eclipse.osbp.preferences.ui.component.Type; +import org.eclipse.osbp.preferences.ui.data.ProductConfigurationStore; + +public class PreferencePageVerifyDependencies extends APreferencePage { + + public PreferencePageVerifyDependencies() { + super( + "verifyDependencies", + "verifyDependencies" + ); + noDefaultAndApplyButton(); + } + + @Override + protected Item[] initializeItems() { + return new Item[] { + new Item(Type.TEXT, Preference.SHOW_PRODUCT_CONFIGURATION, "Product Configuration", false), + new Item(""), + new Item(Type.TREE_PRODUCTCONFIGURATION, Preference.PRODUCTCONFIGURATION, "Product Bundle Configuration"), + }; + } + + protected void refresh() { + // force reload the of product preferences + ProductConfigurationStore.instance().getProductConfigurationPrefs().forceReloadConfiguration(); + try { + // load any contained field editors, to force re-verifying the configuration files + Object value = FieldUtils.readField(this, "fields", true); + if ((value instanceof ArrayList<?>) && !((ArrayList<?>)value).isEmpty()) { + for (FieldEditor editor : (ArrayList<FieldEditor>)value) { + editor.load(); + } + } + } + catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + + /** + * every time the property page gets visible - again - the configuration files will verification will be refreshed. + */ + @Override + public void setVisible(boolean visible) { + if (!getControl().isVisible() && visible) { + refresh(); + } + super.setVisible(visible); + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/ApplicationProjectInspector.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/ApplicationProjectInspector.java new file mode 100644 index 0000000..d6cf647 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/ApplicationProjectInspector.java @@ -0,0 +1,233 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.utils; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Collection; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.osbp.preferences.AItemDescribed; + +public class ApplicationProjectInspector { + + private static final String WIZARD_CONFIGURATION_FILE = "model.wizard"; + private static final String PRODUCT_POSTFIX = ".product"; + + private final IProject applicationProject; + private final String applicationFileName; + private ProductFilePluginsVerifier productPlugins = null; + private ProductFileConfigurationsVerifier productConfigurations = null; + private ManifestFileVerifier productManifest = null; + Map<String,ManifestFileVerifier> manifestVerifiers = null; + + private static String extractProjectName(IProject project) { + String name = project.getName(); + if (name.endsWith(PRODUCT_POSTFIX)) { + name = name.substring(0, name.length()-PRODUCT_POSTFIX.length()); + } + if (name.contains(".")) { + name = name.substring(name.lastIndexOf(".")+1); + } + return name; + } + + public ApplicationProjectInspector(IProject productProject) { + this(productProject, extractProjectName(productProject)); + } + + public ApplicationProjectInspector(IProject applicationProject, String applicationFileName) { + this.applicationProject = applicationProject; + this.applicationFileName = applicationFileName; + } + + public IProject getApplicationProject() { + return applicationProject; + } + + public boolean isApplicationProject() { + initialize(); + if (productManifest.getFactoryModel().size() > 0) { + return true; + } + for (ManifestFileVerifier verifier : manifestVerifiers.values()) { + if (verifier.getFactoryModel().size() > 0) { + return true; + } + } + return false; + } + + public boolean isTemplateFragmentProject() { + initialize(); + return productManifest.isFragmentOfHost("org.eclipse.osbp.wizard.ui"); + } + + public ProductFilePluginsVerifier getProductPlugins() { + initialize(); + return productPlugins; + } + + public AItemDescribed getProductConfigurations() { + initialize(); + return productConfigurations; + } + + public ManifestFileVerifier getProductManifest() { + initialize(); + return productManifest; + } + + public Collection<ManifestFileVerifier> getManifestVerifiers() { + initialize(); + return manifestVerifiers.values(); + } + + private void initialize() { + if (manifestVerifiers == null) { + productPlugins = new ProductFilePluginsVerifier(applicationProject, applicationFileName); + productConfigurations = new ProductFileConfigurationsVerifier(applicationProject, applicationFileName); + productManifest = new ManifestFileVerifier(applicationProject); + manifestVerifiers = new TreeMap<>(); + getPluginBundleManifests(manifestVerifiers, productPlugins, productConfigurations); + getRequireBundleManifests(manifestVerifiers, productManifest); + } + } + + /** + * @param verifiers the target map, which will contain all relevant verifiers verifying specific manifest files + * @param productVerifiers a list product file verifiers, which will be inspected for required model bundles, which will be inspected themselves recursively + */ + private void getPluginBundleManifests(Map<String,ManifestFileVerifier> verifiers, ProductFileVerifier... productVerifiers) { + Set<String> requireBundle = null; + for (ProductFileVerifier verifier : productVerifiers) { + if (requireBundle == null) { + requireBundle = new TreeSet<String>(verifier.getPluginBundles().keySet()); + } + else { + requireBundle.addAll(verifier.getPluginBundles().keySet()); + } + } + for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) { + if (project.isOpen()) { + ManifestFileVerifier manifest = new ManifestFileVerifier(project); + if (manifest.getFactoryModel().size() > 0) { + if (requireBundle.contains(manifest.getSymbolicName())) { + if (!verifiers.containsKey(manifest.getSymbolicName())) { + verifiers.put(manifest.getSymbolicName(), manifest); + getRequireBundleManifests(verifiers, manifest); + } + } + } + } + } + } + + /** + * @param verifiers the target map, which will contain all relevant verifiers verifying specific manifest files + * @param rootManifest a single model bundle manifest verifier, who will be inspected for required model bundles, which will be inspected themselves recursively + */ + private void getRequireBundleManifests(Map<String,ManifestFileVerifier> verifiers, ManifestFileVerifier rootManifest) { + Set<String> requireBundle = rootManifest.getRequireBundle(); + for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) { + if (project.isOpen()) { + ManifestFileVerifier manifest = new ManifestFileVerifier(project); + if (manifest.getFactoryModel().size() > 0) { + String symbolicName = manifest.getSymbolicName(); + if (requireBundle.contains(symbolicName)) { + if (!verifiers.containsKey(symbolicName)) { + verifiers.put(symbolicName, manifest); + getRequireBundleManifests(verifiers, manifest); + } + } + } + } + } + } + + /** + * @param findProject the project to be found + * @return true if the project is contained by the application project + */ + public boolean contains(IProject findProject) { + if (applicationProject.equals(findProject)) { + return true; + } + initialize(); + for (ManifestFileVerifier verifier : manifestVerifiers.values()) { + if (verifier.getProject().equals(findProject)) { + return true; + } + } + return false; + } + + /** + * @param findProject the project to be found + * @return true if the project is contained by the application project + */ + public IProject getProject(String projectPattern) { + if (applicationProject.getName().endsWith(projectPattern)) { + return applicationProject; + } + initialize(); + for (ManifestFileVerifier verifier : manifestVerifiers.values()) { + if (verifier.getProject().getName().endsWith(projectPattern)) { + return verifier.getProject(); + } + } + return null; + } + + /** + * @return true if the wizard configuration file exists + */ + public boolean hasBeenGeneratedViaWizard() { + return applicationProject.findMember(WIZARD_CONFIGURATION_FILE) != null; + } + + /** + * @return true if the wizard configuration file exists + */ + public Properties loadWizardConfigurationProperties() { + Properties properties = new Properties(); + InputStream input = null; + try { + //getClass().getClassLoader().getResourceAsStream("config.properties"); + input = ((IFile)applicationProject.findMember(WIZARD_CONFIGURATION_FILE)).getContents(); + // load a properties file + properties.load(input); + } + catch (IOException | CoreException ex) { + ex.printStackTrace(); + } finally { + if (input != null) { + try { + input.close(); + } + catch (IOException e) { + e.printStackTrace(); + } + } + } + return properties; + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/CheckStateServerName.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/CheckStateServerName.java new file mode 100644 index 0000000..25f2865 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/CheckStateServerName.java @@ -0,0 +1,39 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.utils; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.UnknownHostException; + +public class CheckStateServerName { + + public static String doCheckState(String servername, int timeoutMilliSecs) { + try { + InetAddress address = InetAddress.getByName(servername); +// System.out.println("Name: " + address.getHostName()); +// System.out.println("Addr: " + address.getHostAddress()); +// System.out.println("Reach: " + address.isReachable(3000)); + if (!address.isReachable(timeoutMilliSecs)) { + return servername+" not reachable in "+timeoutMilliSecs+" milliseconds"; + } + return null; + } + catch (UnknownHostException e) { + return "Unable to lookup "+servername; + } + catch (IOException e) { + return "Unable to reach "+servername; + } + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/ConfigurationFileVerifier.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/ConfigurationFileVerifier.java new file mode 100644 index 0000000..ee5a086 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/ConfigurationFileVerifier.java @@ -0,0 +1,111 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.utils; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.resources.IProject; +import org.eclipse.osbp.preferences.AItemDescribed; +import org.eclipse.osbp.preferences.ItemDescription; +import org.eclipse.osbp.preferences.ui.component.APreferencePage; + +/** + * Abstract class for any existing configuration file verifier. + * The class implements all necessary interfaces to be displayed in a property page. + */ +public abstract class ConfigurationFileVerifier extends AItemDescribed { + + /** Message: no problems found! */ + protected final static String MSG_NO_PROBLEMS_FOUND = "- No problems found."; + + /** TODO: Message for any verifier, which has functionality to be implemented! */ + @Deprecated + protected final static String MSG_TO_BE_IMPLEMENTED = "- To be implemented!"; + + /** <b>the</b> OSBP product project to be verified */ + protected final IProject project; + + /** icon name for the icon to be displayed to symbolize the result of verification */ + protected String iconName; + + /** list of found problematic items */ + protected List<SubItem> subItems; + + /** + * description of the table tree columns + */ + public static final class ConfigurationFileDescription extends ItemDescription { + + public static final ConfigurationFileDescription INSTANCE = new ConfigurationFileDescription(); + + private static final String ROW_NAME = "Configuration"; + + protected ConfigurationFileDescription() { + super(ROW_NAME); + } + } + + /** + * The relevant information will be loaded corresponding of the type of configuration file. + * @param project <b>the</b> OSBP product project to be verified + */ + public ConfigurationFileVerifier(IProject project) { + super(ConfigurationFileDescription.INSTANCE); + this.project = project; + iconName = APreferencePage.STATUS_TODO; + subItems = new ArrayList<AItemDescribed.SubItem>(); + } + + public IProject getProject() { + return project; + } + + @Override + public String getIconName() { + return iconName; + } + + @Override + public SubItem[] getSubItems() { + return subItems.toArray(new SubItem[0]); + } + + @Override + @Deprecated + protected String _serialize() { + return null; + } + + @Override + @Deprecated + protected AItemDescribed _deserialize(String serialized) { + return null; + } + + @Override + @Deprecated + public void setName(String name) { + } + + @Override + @Deprecated + public String getValue(String attribute) { + return null; + } + + @Override + @Deprecated + public void setValue(String attribute, String value) { + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/ManifestFileVerifier.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/ManifestFileVerifier.java new file mode 100644 index 0000000..0b05bb4 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/ManifestFileVerifier.java @@ -0,0 +1,144 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.utils; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.Set; +import java.util.TreeSet; +import java.util.jar.Attributes; +import java.util.jar.Manifest; + +import org.apache.felix.utils.manifest.Clause; +import org.apache.felix.utils.manifest.Parser; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IPath; + +/** + * Class for each block of information inside a <code>/META-INF/MANIFEST.MF</code> configuration file. + * <br> + * The file will be loaded via <code>java.util.jar.Manifest</code> and utilities from <code>org.apache.felix.utils.manifest.*</code>. + */ +public class ManifestFileVerifier extends ConfigurationFileVerifier { + + private final static String MANIFEST_MF_PATH = "/META-INF/MANIFEST.MF"; + private final static String SYMBOLIC_NAME = "Bundle-SymbolicName"; + private final static String REQUIRE_BUNDLE = "Require-Bundle"; + private final static String IMPORT_PACKAGE = "Import-Package"; + private final static String FACTORY_MODEL = "Factory-Model"; + private final static String FRAGMENT_HOST = "Fragment-Host"; + + private final Attributes attributes; + private final String rowName; + private final String nodeName; + + public ManifestFileVerifier(IProject project) { + super(project); + IPath relativeFilePath = project.getFile(MANIFEST_MF_PATH).getProjectRelativePath(); + IPath locationFilePath = project.getFile(MANIFEST_MF_PATH).getLocation(); + Attributes attributes = null; + if (project.exists(relativeFilePath)) { + try { + Manifest manifest = new Manifest(new FileInputStream(new File(locationFilePath.toOSString()))); + attributes = manifest.getMainAttributes(); + } + catch (IOException e) { + e.printStackTrace(); + } + } + this.attributes = attributes; + + String hint = ""; + if ((getAttributeValue(FACTORY_MODEL) != null) && !getAttributeValue(FACTORY_MODEL).isEmpty()) { + hint = " - models: "+getAttributeValue(FACTORY_MODEL); + rowName = "Model manifest"; + } + else { + rowName = "Product manifest"; + } + nodeName = "TODO: "+project.getName()+MANIFEST_MF_PATH+hint; + } + + /** + * @return the symbolic name without the possible postfix defining a <code>singleton</code>. + */ + public String getSymbolicName() { + return getAttributeValue(SYMBOLIC_NAME).replace(";singleton:=true", ""); + } + + /** + * @param fragmentHostName name of the requested bundle host + * @return true if the project is a fragment of the given bundle host + */ + public boolean isFragmentOfHost(String fragmentHostName) { + return + (getAttributeValue(FRAGMENT_HOST) != null) && + ( + // either starts with the hostname following with some more information + getAttributeValue(FRAGMENT_HOST).startsWith(fragmentHostName+";") + || + // or equals the hostname without any more information + getAttributeValue(FRAGMENT_HOST).equals(fragmentHostName) + ); + } + + protected Set<String> getImportPackage() { + return getAttributeValues(IMPORT_PACKAGE); + } + + public Set<String> getRequireBundle() { + return getAttributeValues(REQUIRE_BUNDLE); + } + + public Set<String> getFactoryModel() { + return getAttributeValues(FACTORY_MODEL); + } + + /** + * Some attributes contain a set of single items, like <code>Import-Package</code>, <code>Require-Bundle</code>, and <code>Factory-Model</code>. + * @param attribute the name of the attribute to be loaded + * @return set of single items, which will be extracted via utilities from <code>org.apache.felix.utils.manifest.*</code> + */ + private Set<String> getAttributeValues(String attribute) { + TreeSet<String> values = new TreeSet<String>(); + String value = getAttributeValue(attribute); + try { + Clause[] clauses = Parser.parseHeader(value); + for (Clause clause : clauses) { + values.add(clause.getName()); + } + } + catch (IllegalArgumentException ia) {} + return values; + } + + private String getAttributeValue(String attribute) { + if (attributes == null) { + return ""; + } + else { + return attributes.getValue(attribute); + } + } + + @Override + public String getName() { + return nodeName; + } + + @Override + public String getRowName() { + return rowName; + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/ProductFileConfigurationsVerifier.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/ProductFileConfigurationsVerifier.java new file mode 100644 index 0000000..61f5b23 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/ProductFileConfigurationsVerifier.java @@ -0,0 +1,48 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.utils; + +import java.util.Map; + +import org.eclipse.core.resources.IProject; +import org.eclipse.osbp.preferences.ProductFileBase; +import org.eclipse.osbp.preferences.ProductFileConfigurations; +import org.eclipse.osbp.preferences.ui.data.ProductConfigurationStore; + +/** + * Class to verify all <configurations> inside a <code>*.product</code> configuration file. + */ +public class ProductFileConfigurationsVerifier extends ProductFileVerifier { + + public ProductFileConfigurationsVerifier(IProject project, String productFileName) { + super( + project, + productFileName, + new ProductFileConfigurations(ProductConfigurationStore.instance().getProductConfigurationPrefs()), + project.getName()+"/"+productFileName + ); + } + + /** + * Get all <product><configurations><plugin> items with <code>id="???"</code> as id + */ + @Override + public Map<String,Map<String,String>> getPluginBundles() { + return ProductFileBase.getValues(document, "product/configurations", "plugin", "id"); + } + + @Override + public String getRowName() { + return "Product configurations ..."; + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/ProductFilePluginsVerifier.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/ProductFilePluginsVerifier.java new file mode 100644 index 0000000..539f632 --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/ProductFilePluginsVerifier.java @@ -0,0 +1,48 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.utils; + +import java.util.Map; + +import org.eclipse.core.resources.IProject; +import org.eclipse.osbp.preferences.ProductFileBase; +import org.eclipse.osbp.preferences.ProductFilePlugins; +import org.eclipse.osbp.preferences.ui.data.ProductConfigurationStore; + +/** + * Class to verify all <plugins> inside a <code>*.product</code> configuration file. + */ +public class ProductFilePluginsVerifier extends ProductFileVerifier { + + public ProductFilePluginsVerifier(IProject project, String productFileName) { + super( + project, + productFileName, + new ProductFilePlugins(ProductConfigurationStore.instance().getProductConfigurationPrefs()), + project.getName()+"/"+productFileName + ); + } + + /** + * Get all <product><plugins><plugin> items with <code>id="???"</code> as id + */ + @Override + public Map<String,Map<String,String>> getPluginBundles() { + return ProductFileBase.getValues(document, "product/plugins", "plugin", "id"); + } + + @Override + public String getRowName() { + return "Product plugins ..."; + } +} diff --git a/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/ProductFileVerifier.java b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/ProductFileVerifier.java new file mode 100644 index 0000000..3e526ba --- /dev/null +++ b/org.eclipse.osbp.preferences.ui.page/src/org/eclipse/osbp/preferences/ui/utils/ProductFileVerifier.java @@ -0,0 +1,113 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences.ui.utils; + +import java.io.File; +import java.io.IOException; +import java.util.Map; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IPath; +import org.eclipse.osbp.preferences.ProductFileBase; +import org.eclipse.osbp.preferences.ui.component.APreferencePage; +import org.w3c.dom.Document; +import org.xml.sax.SAXException; + +/** + * Abstract class for each block of information inside a <code>*.product</code> configuration file. + * <br> + * The file will be loaded via <code>javax.xml.parser</code>. + */ +abstract public class ProductFileVerifier extends ConfigurationFileVerifier { + + protected String productFileName; + protected ProductFileBase base; + protected String nodeName; + protected Document document; + + public ProductFileVerifier(IProject project, String productFileName, ProductFileBase base, String nodeName) { + super(project); + this.productFileName = productFileName; + this.base = base; + this.nodeName = nodeName; + iconName = APreferencePage.STATUS_OK; + Document document = null; + try { + IPath relativeFilePath = project.getFile(productFileName).getProjectRelativePath(); + IPath locationFilePath = project.getFile(productFileName).getLocation(); + if (project.exists(relativeFilePath)) { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = factory.newDocumentBuilder(); + document = builder.parse(new File(locationFilePath.toOSString())); + } + } + catch (IOException | ParserConfigurationException | SAXException e) { + e.printStackTrace(); + } + this.document = document; + Map<String, Map<String, String>> actual = getPluginBundles(); + verifyNecessary("required", actual, base.getRequiredAsMap()); + verifyNecessary("recommended", actual, base.getRecommendedAsMap()); + verifyDeprecated("deprecated", actual, base.getDeprecatedAsMap()); + } + + abstract public Map<String,Map<String,String>> getPluginBundles(); + + /** + * For every violation found a subitem will be generated. + * @param type type of necessity as string + * @param actual map with information about all actual configured bundles + * @param target map with information about all necessary bundles to be configured + */ + protected void verifyNecessary(String type, Map<String, Map<String, String>> actual, Map<String, Map<String, String>> target) { + for (String id : target.keySet()) { + if (!actual.containsKey(id)) { + iconName = APreferencePage.STATUS_ERROR; + subItems.add(new SubItem("add missing "+type, base.serialize(id, target.get(id)), APreferencePage.ITEM_TO_ADD)); + } + else if (!actual.get(id).equals(target.get(id))) { + iconName = APreferencePage.STATUS_ERROR; + subItems.add(new SubItem("replace existing "+type, base.serialize(id, target.get(id)), APreferencePage.ITEM_TO_UPDATE)); + } + } + } + + /** + * For every violation found a subitem will be generated. + * @param type type of unnecessity as string + * @param actual map with information about all actual configured bundles + * @param deprecated map with information about all deprecated bundles to be de-configured + */ + protected void verifyDeprecated(String type, Map<String, Map<String, String>> actual, Map<String, Map<String, String>> deprecated) { + for (String id : actual.keySet()) { + if (deprecated.containsKey(id)) { + iconName = APreferencePage.STATUS_ERROR; + subItems.add(new SubItem("remove existing "+type, base.serialize(id, actual.get(id)), APreferencePage.ITEM_TO_REMOVE)); + } + } + } + + @Override + public String getName() { + return nodeName; + } + + @Override + public SubItem[] getSubItems() { + return subItems.toArray(new SubItem[0]); + } +} diff --git a/org.eclipse.osbp.preferences/.project b/org.eclipse.osbp.preferences/.project new file mode 100644 index 0000000..9ed6191 --- /dev/null +++ b/org.eclipse.osbp.preferences/.project @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.osbp.preferences</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.xtext.ui.shared.xtextBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.babel.editor.rbeBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.sonarlint.eclipse.core.sonarlintBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.m2e.core.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.sonarlint.eclipse.core.sonarlintNature</nature> + <nature>org.eclipse.xtext.ui.shared.xtextNature</nature> + <nature>org.eclipse.m2e.core.maven2Nature</nature> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.babel.editor.rbeNature</nature> + </natures> +</projectDescription> diff --git a/org.eclipse.osbp.preferences/LICENSE.txt b/org.eclipse.osbp.preferences/LICENSE.txt new file mode 100644 index 0000000..ff42ad4 --- /dev/null +++ b/org.eclipse.osbp.preferences/LICENSE.txt @@ -0,0 +1,161 @@ +Eclipse Public License -v 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION +OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + +a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and + +b) in the case of each subsequent Contributor: + +i) changes to the Program, and + +ii) additions to the Program; + +where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. +A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone +acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate +modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not +derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of +its Contribution alone or when combined with the Program. + +"Program" means the Contributions distributed in accordance with this Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. + +2. GRANT OF RIGHTS + +a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, +royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute +and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code +form. + +b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, +royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the +Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the +combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such +addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not +apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. + +c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no +assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity +based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property +rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the +Program, it is Recipient's responsibility to acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to +grant the copyright license set forth in this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: + +a) it complies with the terms and conditions of this Agreement; and + +b) its license agreement: + +i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including +warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and +fitness for a particular purpose; + +ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, +incidental and consequential damages, such as lost profits; + +iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any +other party; and + +iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it +in a reasonable manner on or through a medium customarily used for software exchange. + +When the Program is made available in source code form: + +a) it must be made available under this Agreement; and + +b) a copy of this Agreement must be included with each copy of the Program. + +Contributors may not remove or alter any copyright notices contained within the Program. + +Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and +the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes +the Program in a commercial product offering should do so in a manner which does not create potential liability for +other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor +("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") +against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions +brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such +Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The +obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual +property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the +Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may + participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is +then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties +related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. +Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to +those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, +the Commercial Contributor must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for +determining the appropriateness of using and distributing the Program and assumes all risks associated with its +exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance +with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED +HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such +provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such +Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such +litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such +noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution +of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses + granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement +is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish +new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the +right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may +assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the +Agreement will be given a distinguishing version number. The Program (including Contributions) may always be +distributed subject to the version of the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the +new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or +otherwise. All rights in the Program not expressly granted under this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States +of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause +of action arose. Each party waives its rights to a jury trial in any resulting litigation.
\ No newline at end of file diff --git a/org.eclipse.osbp.preferences/META-INF/MANIFEST.MF b/org.eclipse.osbp.preferences/META-INF/MANIFEST.MF new file mode 100644 index 0000000..b33895c --- /dev/null +++ b/org.eclipse.osbp.preferences/META-INF/MANIFEST.MF @@ -0,0 +1,30 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: org.eclipse.osbp.preferences +Bundle-SymbolicName: org.eclipse.osbp.preferences +Bundle-Version: 0.9.0.qualifier +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Export-Package: org.eclipse.osbp.preferences;version="0.9.0" +Import-Package: javax.transaction, + org.apache.commons.io, + org.apache.commons.lang3;version="3.1.0", + org.apache.log4j, + org.eclipse.core.internal.resources, + org.eclipse.core.resources, + org.eclipse.persistence.config;version="2.6.0", + org.eclipse.persistence.sessions;version="2.6.1", + org.osgi.framework;version="1.6.0", + org.osgi.service.jdbc +Require-Bundle: org.slf4j.api;bundle-version="1.7.2", + org.eclipse.equinox.preferences, + javax.annotation;bundle-version="[1.1.0,1.2.0)", + javax.inject;bundle-version="1.0.0", + org.eclipse.core.runtime, + org.eclipse.osbp.gitinfo;bundle-version="[0.9.0,0.10.0)", + com.google.guava, + org.eclipse.xtext.xbase.lib, + org.eclipse.xtend.lib, + org.eclipse.xtend.lib.macro, + org.eclipse.persistence.core +Bundle-Vendor: Eclipse OSBP +Bundle-Activator: org.eclipse.osbp.preferences.Activator diff --git a/org.eclipse.osbp.preferences/about.html b/org.eclipse.osbp.preferences/about.html new file mode 100644 index 0000000..64c0598 --- /dev/null +++ b/org.eclipse.osbp.preferences/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 1, 2016</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html>
\ No newline at end of file diff --git a/org.eclipse.osbp.preferences/about.ini b/org.eclipse.osbp.preferences/about.ini new file mode 100644 index 0000000..7df671f --- /dev/null +++ b/org.eclipse.osbp.preferences/about.ini @@ -0,0 +1,17 @@ +# about.ini +# contains information about a feature +# java.io.Properties file (ISO 8859-1 with "\" escapes) +# "%key" are externalized strings defined in about.properties +# This file does not need to be translated. + +# Property "aboutText" contains blurb for "About" dialog (translated) +aboutText=%featureText + +# Property "featureImage" contains path to feature image (32x32) +featureImage= + +# Property "appName" contains name of the application (translated) +appName=%featureName + +# Property "welcomePage" contains path to welcome page (special XML-based format) +welcomePage= diff --git a/org.eclipse.osbp.preferences/about.mappings b/org.eclipse.osbp.preferences/about.mappings new file mode 100644 index 0000000..4511a0a --- /dev/null +++ b/org.eclipse.osbp.preferences/about.mappings @@ -0,0 +1,6 @@ +# about.mappings +# contains fill-ins for about.properties +# java.io.Properties file (ISO 8859-1 with "\" escapes) +# This file does not need to be translated. + +0=qualifier diff --git a/org.eclipse.osbp.preferences/about.properties b/org.eclipse.osbp.preferences/about.properties new file mode 100644 index 0000000..e26e5ce --- /dev/null +++ b/org.eclipse.osbp.preferences/about.properties @@ -0,0 +1,26 @@ +# +# Copyright (c) 2012, 2016 - Loetz GmbH&Co.KG (Heidelberg) +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Christophe Loetz (Loetz GmbH&Co.KG) - initial API and implementation +# + +# NLS_MESSAGEFORMAT_VAR + +featureName=org.eclipse.osbp.preferences + +################ blurb property #################################### +featureText=\ +Copyright (c) 2012-2016 - Loetz GmbH&Co.KG \n\ +All rights reserved. This program and the accompanying materials\n\ +are made available under the terms of the Eclipse Public License v1.0\n\ +which accompanies this distribution, and is available at\n\ +http://www.eclipse.org/legal/epl-v10.html\n\ +\n\ +Contributors:\n\ + Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation\n +################ end of blurb property #################################### diff --git a/org.eclipse.osbp.preferences/build.properties b/org.eclipse.osbp.preferences/build.properties new file mode 100644 index 0000000..070f974 --- /dev/null +++ b/org.eclipse.osbp.preferences/build.properties @@ -0,0 +1,15 @@ +source.. = src/,\ + xtend-gen/ +output.. = target/classes/ +bin.includes = about.properties, about.mappings, about.ini, about.html, META-INF/,\ + .,\ + .classpath,\ + .project,\ + .settings/,\ + xml/,\ + license.html,\ + LICENSE.txt,\ + epl-v10.html +src.includes = about.properties, about.mappings, about.ini, about.html, license.html,\ + LICENSE.txt,\ + epl-v10.html diff --git a/org.eclipse.osbp.preferences/epl-v10.html b/org.eclipse.osbp.preferences/epl-v10.html new file mode 100644 index 0000000..b398acc --- /dev/null +++ b/org.eclipse.osbp.preferences/epl-v10.html @@ -0,0 +1,259 @@ +<!--?xml version="1.0" encoding="ISO-8859-1" ?--> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Eclipse Public License - Version 1.0</title> +<style type="text/css"> + body { + size: 8.5in 11.0in; + margin: 0.25in 0.5in 0.25in 0.5in; + tab-interval: 0.5in; + } + p { + margin-left: auto; + margin-top: 0.5em; + margin-bottom: 0.5em; + } + p.list { + margin-left: 0.5in; + margin-top: 0.05em; + margin-bottom: 0.05em; + } + </style> + +</head> + +<body lang="EN-US"> + +<h2>Eclipse Public License - v 1.0</h2> + +<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE +PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR +DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS +AGREEMENT.</p> + +<p><b>1. DEFINITIONS</b></p> + +<p>"Contribution" means:</p> + +<p class="list">a) in the case of the initial Contributor, the initial +code and documentation distributed under this Agreement, and</p> +<p class="list">b) in the case of each subsequent Contributor:</p> +<p class="list">i) changes to the Program, and</p> +<p class="list">ii) additions to the Program;</p> +<p class="list">where such changes and/or additions to the Program +originate from and are distributed by that particular Contributor. A +Contribution 'originates' from a Contributor if it was added to the +Program by such Contributor itself or anyone acting on such +Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in +conjunction with the Program under their own license agreement, and (ii) +are not derivative works of the Program.</p> + +<p>"Contributor" means any person or entity that distributes +the Program.</p> + +<p>"Licensed Patents" mean patent claims licensable by a +Contributor which are necessarily infringed by the use or sale of its +Contribution alone or when combined with the Program.</p> + +<p>"Program" means the Contributions distributed in accordance +with this Agreement.</p> + +<p>"Recipient" means anyone who receives the Program under +this Agreement, including all Contributors.</p> + +<p><b>2. GRANT OF RIGHTS</b></p> + +<p class="list">a) Subject to the terms of this Agreement, each +Contributor hereby grants Recipient a non-exclusive, worldwide, +royalty-free copyright license to reproduce, prepare derivative works +of, publicly display, publicly perform, distribute and sublicense the +Contribution of such Contributor, if any, and such derivative works, in +source code and object code form.</p> + +<p class="list">b) Subject to the terms of this Agreement, each +Contributor hereby grants Recipient a non-exclusive, worldwide, +royalty-free patent license under Licensed Patents to make, use, sell, +offer to sell, import and otherwise transfer the Contribution of such +Contributor, if any, in source code and object code form. This patent +license shall apply to the combination of the Contribution and the +Program if, at the time the Contribution is added by the Contributor, +such addition of the Contribution causes such combination to be covered +by the Licensed Patents. The patent license shall not apply to any other +combinations which include the Contribution. No hardware per se is +licensed hereunder.</p> + +<p class="list">c) Recipient understands that although each Contributor +grants the licenses to its Contributions set forth herein, no assurances +are provided by any Contributor that the Program does not infringe the +patent or other intellectual property rights of any other entity. Each +Contributor disclaims any liability to Recipient for claims brought by +any other entity based on infringement of intellectual property rights +or otherwise. As a condition to exercising the rights and licenses +granted hereunder, each Recipient hereby assumes sole responsibility to +secure any other intellectual property rights needed, if any. For +example, if a third party patent license is required to allow Recipient +to distribute the Program, it is Recipient's responsibility to acquire +that license before distributing the Program.</p> + +<p class="list">d) Each Contributor represents that to its knowledge it +has sufficient copyright rights in its Contribution, if any, to grant +the copyright license set forth in this Agreement.</p> + +<p><b>3. REQUIREMENTS</b></p> + +<p>A Contributor may choose to distribute the Program in object code +form under its own license agreement, provided that:</p> + +<p class="list">a) it complies with the terms and conditions of this +Agreement; and</p> + +<p class="list">b) its license agreement:</p> + +<p class="list">i) effectively disclaims on behalf of all Contributors +all warranties and conditions, express and implied, including warranties +or conditions of title and non-infringement, and implied warranties or +conditions of merchantability and fitness for a particular purpose;</p> + +<p class="list">ii) effectively excludes on behalf of all Contributors +all liability for damages, including direct, indirect, special, +incidental and consequential damages, such as lost profits;</p> + +<p class="list">iii) states that any provisions which differ from this +Agreement are offered by that Contributor alone and not by any other +party; and</p> + +<p class="list">iv) states that source code for the Program is available +from such Contributor, and informs licensees how to obtain it in a +reasonable manner on or through a medium customarily used for software +exchange.</p> + +<p>When the Program is made available in source code form:</p> + +<p class="list">a) it must be made available under this Agreement; and</p> + +<p class="list">b) a copy of this Agreement must be included with each +copy of the Program.</p> + +<p>Contributors may not remove or alter any copyright notices contained +within the Program.</p> + +<p>Each Contributor must identify itself as the originator of its +Contribution, if any, in a manner that reasonably allows subsequent +Recipients to identify the originator of the Contribution.</p> + +<p><b>4. COMMERCIAL DISTRIBUTION</b></p> + +<p>Commercial distributors of software may accept certain +responsibilities with respect to end users, business partners and the +like. While this license is intended to facilitate the commercial use of +the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create +potential liability for other Contributors. Therefore, if a Contributor +includes the Program in a commercial product offering, such Contributor +("Commercial Contributor") hereby agrees to defend and +indemnify every other Contributor ("Indemnified Contributor") +against any losses, damages and costs (collectively "Losses") +arising from claims, lawsuits and other legal actions brought by a third +party against the Indemnified Contributor to the extent caused by the +acts or omissions of such Commercial Contributor in connection with its +distribution of the Program in a commercial product offering. The +obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In +order to qualify, an Indemnified Contributor must: a) promptly notify +the Commercial Contributor in writing of such claim, and b) allow the +Commercial Contributor to control, and cooperate with the Commercial +Contributor in, the defense and any related settlement negotiations. The +Indemnified Contributor may participate in any such claim at its own +expense.</p> + +<p>For example, a Contributor might include the Program in a commercial +product offering, Product X. That Contributor is then a Commercial +Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance +claims and warranties are such Commercial Contributor's responsibility +alone. Under this section, the Commercial Contributor would have to +defend claims against the other Contributors related to those +performance claims and warranties, and if a court requires any other +Contributor to pay any damages as a result, the Commercial Contributor +must pay those damages.</p> + +<p><b>5. NO WARRANTY</b></p> + +<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS +PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS +OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, +ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY +OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and +distributing the Program and assumes all risks associated with its +exercise of rights under this Agreement , including but not limited to +the risks and costs of program errors, compliance with applicable laws, +damage to or loss of data, programs or equipment, and unavailability or +interruption of operations.</p> + +<p><b>6. DISCLAIMER OF LIABILITY</b></p> + +<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT +NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING +WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR +DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED +HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p> + +<p><b>7. GENERAL</b></p> + +<p>If any provision of this Agreement is invalid or unenforceable under +applicable law, it shall not affect the validity or enforceability of +the remainder of the terms of this Agreement, and without further action +by the parties hereto, such provision shall be reformed to the minimum +extent necessary to make such provision valid and enforceable.</p> + +<p>If Recipient institutes patent litigation against any entity +(including a cross-claim or counterclaim in a lawsuit) alleging that the +Program itself (excluding combinations of the Program with other +software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the +date such litigation is filed.</p> + +<p>All Recipient's rights under this Agreement shall terminate if it +fails to comply with any of the material terms or conditions of this +Agreement and does not cure such failure in a reasonable period of time +after becoming aware of such noncompliance. If all Recipient's rights +under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive.</p> + +<p>Everyone is permitted to copy and distribute copies of this +Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The +Agreement Steward reserves the right to publish new versions (including +revisions) of this Agreement from time to time. No one other than the +Agreement Steward has the right to modify this Agreement. The Eclipse +Foundation is the initial Agreement Steward. The Eclipse Foundation may +assign the responsibility to serve as the Agreement Steward to a +suitable separate entity. Each new version of the Agreement will be +given a distinguishing version number. The Program (including +Contributions) may always be distributed subject to the version of the +Agreement under which it was received. In addition, after a new version +of the Agreement is published, Contributor may elect to distribute the +Program (including its Contributions) under the new version. Except as +expressly stated in Sections 2(a) and 2(b) above, Recipient receives no +rights or licenses to the intellectual property of any Contributor under +this Agreement, whether expressly, by implication, estoppel or +otherwise. All rights in the Program not expressly granted under this +Agreement are reserved.</p> + +<p>This Agreement is governed by the laws of the State of New York and +the intellectual property laws of the United States of America. No party +to this Agreement will bring a legal action under this Agreement more +than one year after the cause of action arose. Each party waives its +rights to a jury trial in any resulting litigation.</p> + + + +</body></html>
\ No newline at end of file diff --git a/org.eclipse.osbp.preferences/license.html b/org.eclipse.osbp.preferences/license.html new file mode 100644 index 0000000..6e579a5 --- /dev/null +++ b/org.eclipse.osbp.preferences/license.html @@ -0,0 +1,164 @@ +<!--?xml version="1.0" encoding="ISO-8859-1" ?--> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Eclipse Foundation Software User Agreement</title> +</head> + +<body lang="EN-US"> +<h2>Eclipse Foundation Software User Agreement</h2> +<p>February 1, 2011</p> + +<h3>Usage Of Content</h3> + +<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS + (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND + CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE + OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR + NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND + CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p> + +<h3>Applicable Licenses</h3> + +<p>Unless otherwise indicated, all Content made available by the Eclipse + Foundation is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 + ("EPL"). A copy of the EPL is provided with this Content and is also + available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. + For purposes of the EPL, "Program" will mean the Content.</p> + +<p>Content includes, but is not limited to, source code, object code, +documentation and other files maintained in the Eclipse Foundation +source code + repository ("Repository") in software modules ("Modules") and made +available as downloadable archives ("Downloads").</p> + +<ul> + <li>Content may be structured and packaged into modules to +facilitate delivering, extending, and upgrading the Content. Typical +modules may include plug-ins ("Plug-ins"), plug-in fragments +("Fragments"), and features ("Features").</li> + <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li> + <li>A Feature is a bundle of one or more Plug-ins and/or +Fragments and associated material. Each Feature may be packaged as a +sub-directory in a directory named "features". Within a Feature, files +named "feature.xml" may contain a list of the names and version numbers +of the Plug-ins + and/or Fragments associated with that Feature.</li> + <li>Features may also include other Features ("Included +Features"). Within a Feature, files named "feature.xml" may contain a +list of the names and version numbers of Included Features.</li> +</ul> + +<p>The terms and conditions governing Plug-ins and Fragments should be +contained in files named "about.html" ("Abouts"). The terms and +conditions governing Features and +Included Features should be contained in files named "license.html" +("Feature Licenses"). Abouts and Feature Licenses may be located in any + directory of a Download or Module +including, but not limited to the following locations:</p> + +<ul> + <li>The top-level (root) directory</li> + <li>Plug-in and Fragment directories</li> + <li>Inside Plug-ins and Fragments packaged as JARs</li> + <li>Sub-directories of the directory named "src" of certain Plug-ins</li> + <li>Feature directories</li> +</ul> + +<p>Note: if a Feature made available by the Eclipse Foundation is +installed using the Provisioning Technology (as defined below), you must + agree to a license ("Feature Update License") during the +installation process. If the Feature contains Included Features, the +Feature Update License should either provide you with the terms and +conditions governing the Included Features or +inform you where you can locate them. Feature Update Licenses may be +found in the "license" property of files named "feature.properties" +found within a Feature. +Such Abouts, Feature Licenses, and Feature Update Licenses contain the +terms and conditions (or references to such terms and conditions) that +govern your use of the associated Content in +that directory.</p> + +<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER +TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. + SOME OF THESE +OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p> + +<ul> + <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li> + <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li> + <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li> + <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li> + <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li> + <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li> +</ul> + +<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND +CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, +or Feature Update License is provided, please +contact the Eclipse Foundation to determine what terms and conditions +govern that particular Content.</p> + + +<h3>Use of Provisioning Technology</h3> + +<p>The Eclipse Foundation makes available provisioning software, +examples of which include, but are not limited to, p2 and the Eclipse + Update Manager ("Provisioning Technology") for the purpose of +allowing users to install software, documentation, information and/or + other materials (collectively "Installable Software"). This +capability is provided with the intent of allowing such users to + install, extend and update Eclipse-based products. Information about +packaging Installable Software is available at <a href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a> + ("Specification").</p> + +<p>You may use Provisioning Technology to allow other parties to install + Installable Software. You shall be responsible for enabling the + applicable license agreements relating to the Installable Software to + be presented to, and accepted by, the users of the Provisioning +Technology + in accordance with the Specification. By using Provisioning +Technology in such a manner and making it available in accordance with +the + Specification, you further acknowledge your agreement to, and the +acquisition of all necessary rights to permit the following:</p> + +<ol> + <li>A series of actions may occur ("Provisioning Process") in +which a user may execute the Provisioning Technology + on a machine ("Target Machine") with the intent of installing, +extending or updating the functionality of an Eclipse-based + product.</li> + <li>During the Provisioning Process, the Provisioning Technology +may cause third party Installable Software or a portion thereof to be + accessed and copied to the Target Machine.</li> + <li>Pursuant to the Specification, you will provide to the user +the terms and conditions that govern the use of the Installable + Software ("Installable Software Agreement") and such Installable +Software Agreement shall be accessed from the Target + Machine in accordance with the Specification. Such Installable +Software Agreement must inform the user of the terms and conditions that + govern + the Installable Software and must solicit acceptance by the end +user in the manner prescribed in such Installable Software Agreement. +Upon such + indication of agreement by the user, the provisioning Technology +will complete installation of the Installable Software.</li> +</ol> + +<h3>Cryptography</h3> + +<p>Content may contain encryption software. The country in which you are + currently may have restrictions on the import, possession, and use, +and/or re-export to + another country, of encryption software. BEFORE using any encryption +software, please check the country's laws, regulations and policies +concerning the import, + possession, or use, and re-export of encryption software, to see if +this is permitted.</p> + +<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p> + + +</body></html>
\ No newline at end of file diff --git a/org.eclipse.osbp.preferences/notice.html b/org.eclipse.osbp.preferences/notice.html new file mode 100644 index 0000000..c3d34c3 --- /dev/null +++ b/org.eclipse.osbp.preferences/notice.html @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +<title>Eclipse Foundation Software User Agreement</title> +</head> + +<body lang="EN-US"> +<h2>Eclipse Foundation Software User Agreement</h2> +<p>April 9, 2014</p> + +<h3>Usage Of Content</h3> + +<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS + (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND + CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE + OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR + NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND + CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p> + +<h3>Applicable Licenses</h3> + +<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 + ("EPL"). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. + For purposes of the EPL, "Program" will mean the Content.</p> + +<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code + repository ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").</p> + +<ul> + <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").</li> + <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li> + <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins + and/or Fragments associated with that Feature.</li> + <li>Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.</li> +</ul> + +<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and +Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module +including, but not limited to the following locations:</p> + +<ul> + <li>The top-level (root) directory</li> + <li>Plug-in and Fragment directories</li> + <li>Inside Plug-ins and Fragments packaged as JARs</li> + <li>Sub-directories of the directory named "src" of certain Plug-ins</li> + <li>Feature directories</li> +</ul> + +<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license ("Feature Update License") during the +installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or +inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature. +Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in +that directory.</p> + +<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE +OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p> + +<ul> + <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li> + <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li> + <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li> + <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li> + <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li> +</ul> + +<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please +contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p> + + +<h3>Use of Provisioning Technology</h3> + +<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse + Update Manager ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or + other materials (collectively "Installable Software"). This capability is provided with the intent of allowing such users to + install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a + href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a> + ("Specification").</p> + +<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the + applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology + in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the + Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p> + +<ol> + <li>A series of actions may occur ("Provisioning Process") in which a user may execute the Provisioning Technology + on a machine ("Target Machine") with the intent of installing, extending or updating the functionality of an Eclipse-based + product.</li> + <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be + accessed and copied to the Target Machine.</li> + <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable + Software ("Installable Software Agreement") and such Installable Software Agreement shall be accessed from the Target + Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern + the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such + indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li> +</ol> + +<h3>Cryptography</h3> + +<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to + another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, + possession, or use, and re-export of encryption software, to see if this is permitted.</p> + +<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p> +</body> +</html> diff --git a/org.eclipse.osbp.preferences/pom.xml b/org.eclipse.osbp.preferences/pom.xml new file mode 100644 index 0000000..1d37457 --- /dev/null +++ b/org.eclipse.osbp.preferences/pom.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--#======================================================================= --> +<!--# Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) --> +<!--# All rights reserved. This program and the accompanying materials --> +<!--# are made available under the terms of the Eclipse Public License v1.0 --> +<!--# which accompanies this distribution, and is available at --> +<!--# http://www.eclipse.org/legal/epl-v10.html --> +<!--# --> +<!--# Contributors: --> +<!--# Christophe Loetz (Loetz GmbH&Co.KG) - initial API and implementation --> +<!--#======================================================================= --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.eclipse.osbp.preferences</groupId> + <artifactId>org.eclipse.osbp.preferences.aggregator</artifactId> + <version>0.9.0-SNAPSHOT</version> + <relativePath>..</relativePath> + </parent> + <artifactId>org.eclipse.osbp.preferences</artifactId> + <build> + <sourceDirectory>src</sourceDirectory> + <plugins> + </plugins> + </build> + <packaging>eclipse-plugin</packaging> +</project> diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/AItemDescribed.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/AItemDescribed.java new file mode 100644 index 0000000..f9576f5 --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/AItemDescribed.java @@ -0,0 +1,58 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences; + +public abstract class AItemDescribed implements IItemDescribed { + + public class SubItem { + protected final String action; + protected final String information; + protected final String icon; + + public SubItem(String action, String information, String icon) { + this.action = action; + this.information = information; + this.icon = icon; + } + + public String getAction() { + return action; + } + + public String getInformation() { + return information; + } + + public String getIcon() { + return icon; + } + } + +// private final ItemDescription fDescription; // NOSONAR + protected static final String VALUE_SEPARATOR = ":"; + protected static final String ITEM_SEPARATOR = ";"; + + public AItemDescribed(ItemDescription description) { +// fDescription = description; // NOSONAR + } + + protected abstract String _serialize(); // NOSONAR + + protected abstract AItemDescribed _deserialize(String serialized); // NOSONAR + + public abstract SubItem[] getSubItems(); + + public abstract String getIconName(); + + public abstract String getRowName(); +} diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/AbstractConfigurationFileBase.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/AbstractConfigurationFileBase.java new file mode 100644 index 0000000..032483c --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/AbstractConfigurationFileBase.java @@ -0,0 +1,93 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * Abstract dependencies for all relevant OSBP product & model bundle configuration files. + * <br> + * There are three types of dependencies for each type of configuration file + * <ul> + * <li>required dependencies - these are essential for the OSBP product & model bundle</li> + * <li>recommended dependencies - these are not essential for the OSBP product & model bundle</li> + * <li>deprecated dependencies - these are dependencies, which existed in the past, but have been removed later on</li> + * </ul> + */ +public abstract class AbstractConfigurationFileBase { + + /** + * @return map of required dependencies; with the id as map key and attributes map as map value + */ + abstract Map<String,Map<String,String>> getRequiredAsMap(); + + /** + * @return string with required dependencies separated by newline characters + */ + abstract String getRequiredAsString(); + + /** + * @return map of recommended dependencies; with the id as map key and attributes map as map value + */ + abstract Map<String,Map<String,String>> getRecommendedAsMap(); + + /** + * @return string with recommended dependencies separated by newline characters + */ + abstract String getRecommendedAsString(); + + /** + * @return map of deprecated dependencies; with the id as map key and attributes map as map value + */ + abstract Map<String,Map<String,String>> getDeprecatedAsMap(); + + /** + * @return string with deprecated dependencies separated by newline characters + */ + abstract String getDeprecatedAsString(); + + /** + * @param asString the <i>pure</i> string, which has to be prepared + * @return the prepared string, the preparation may be different for the different types of configuration files + */ + abstract String prepareSerialized(String asString); + + /** + * @param asString serialized string with dependencies separated by newline characters + * @return deserialized as map of dependencies; with the id as map key and attributes map as map value + */ + abstract Map<String,Map<String,String>> deserialize(String asString); + + /** + * @param attributes deserialized map of dependencies; with the id as map key and attributes map as map value + * @return serialized as string with dependencies separated by newline characters + */ + abstract String serialize(String id, Map<String,String> attributes); + + /** + * @param asString list of configurations as string separated by newline characters + * @return string with any duplicate lines removed + */ + protected String removeDuplicates(String asString) { + String[] lines = asString.split("\n"); + List<String> items = new ArrayList<String>(); + for (String line : lines) { + if (!items.contains(line.trim())) { + items.add(line.trim()); + } + } + return String.join("\n", items); + } +} diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/Activator.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/Activator.java new file mode 100644 index 0000000..721ed8f --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/Activator.java @@ -0,0 +1,45 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ + package org.eclipse.osbp.preferences; + +import org.eclipse.osbp.gitinfo.Loginfo; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator implements BundleActivator { + + private static BundleContext context; + + static BundleContext getContext() { + return context; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext bundleContext) throws Exception { + Loginfo li = new Loginfo(); + li.print( Activator.class.getCanonicalName(), Activator.class.getClassLoader()); + Activator.context = bundleContext; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + } + +} diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ConfigurationException.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ConfigurationException.java new file mode 100644 index 0000000..f061888 --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ConfigurationException.java @@ -0,0 +1,46 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences; + +import java.util.HashSet; +import java.util.Set; + + + +/** + * Helper exception class for exceptions while reading product configuration + */ +public class ConfigurationException extends Exception { + + private static final long serialVersionUID = 745070392618501822L; + private final Set<Exception> fExceptions; + + protected ConfigurationException(Set<Exception> exceptions) { + fExceptions = exceptions; + } + + protected ConfigurationException(Exception exception) { + fExceptions = new HashSet<>(); + fExceptions.add(exception); + } + + @Override + public String getLocalizedMessage() { + String result = super.getLocalizedMessage(); + result += "\nCaused by following exception(s):"; + for (Exception e : fExceptions) { + result += "\n"+e.getClass().getCanonicalName()+" - "+e.getLocalizedMessage(); + } + return result; + } +} diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/DataSourceConfiguration.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/DataSourceConfiguration.java new file mode 100644 index 0000000..f380e54 --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/DataSourceConfiguration.java @@ -0,0 +1,365 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences; + +import java.util.Collection; +import java.util.Map; +import java.util.Properties; +import java.util.TreeMap; + +import org.osgi.service.jdbc.DataSourceFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + + +/** + * Helper class containing DataSource configuration data needed for JPA and JDBC + */ +public class DataSourceConfiguration extends AItemDescribed { + + private static final Logger LOGGER = LoggerFactory.getLogger(DataSourceConfiguration.class); + + public static final class DataSourceItemDescription extends ItemDescription { + + public static final DataSourceItemDescription INSTANCE = new DataSourceItemDescription(); + + private static final String ROW_NAME = "JNDI Data Source"; + public static final String DATABASE_TYPE = "Database Type"; + public static final String DRIVER_CLASS = "Driver Class"; + public static final String SERVER_NAME = "Server Name"; + public static final String SERVER_PORT = "Server Port"; + public static final String DATABASE_NAME = "Database Name"; + public static final String DATABASE_USER = "Database User"; + public static final String DATABASE_PASSWORD = "Database Password"; // NOSONAR + + protected DataSourceItemDescription() { + super(ROW_NAME, + DATABASE_TYPE, Type.DatabaseType, + DRIVER_CLASS, Type.String, + SERVER_NAME, Type.String, + SERVER_PORT, Type.Integer, + DATABASE_NAME, Type.String, + DATABASE_USER, Type.String, + DATABASE_PASSWORD, Type.String + ); + } + } + + private String fName; + private EnumDatabaseVendor fDataBaseVendor; + private String fDriverVendor; + private String fDriverType; + private String fDriverClass; + private String fServerName; + private int fServerPort; + private String fDatabaseName; + private String fDatabaseUser; + private String fDatabasePass; + private String fJdbcUrlFormat; + + private static final DataSourceConfiguration WORKER = new DataSourceConfiguration(); + + private DataSourceConfiguration() { + super(DataSourceItemDescription.INSTANCE); + fName = null; + fDataBaseVendor = null; + fDriverVendor = null; + fDriverType = null; + fDriverClass = null; + fServerName = null; + fServerPort = 0; + fDatabaseName = null; + fDatabaseUser = null; + fDatabasePass = null; + fJdbcUrlFormat = null; + } + + public DataSourceConfiguration( + String name, + EnumDatabaseVendor dataBaseVendor, + String serverName, int serverPort, + String databaseName, String databaseUser, String databasePass) { + this( + name, + dataBaseVendor, + dataBaseVendor.getDriverVendor(), + dataBaseVendor.getDriverType(), + dataBaseVendor.getDriverClass(), + serverName, serverPort, + databaseName, databaseUser, databasePass, + null + ); + } + + protected DataSourceConfiguration( // NOSONAR + String name, + EnumDatabaseVendor dataBaseVendor, + String driverVendor, String driverType, String driverClass, + String serverName, int serverPort, + String databaseName, String databaseUser, String databasePass, + String jdbcUrlFormat) { + super(DataSourceItemDescription.INSTANCE); + fName = name; + fDataBaseVendor = dataBaseVendor; + fDriverVendor = (driverVendor == null || driverVendor.isEmpty()) ? dataBaseVendor.getDriverVendor() : driverVendor; + fDriverType = (driverType == null || driverType.isEmpty()) ? dataBaseVendor.getDriverType() : driverType; + fDriverClass = (driverClass == null || driverClass.isEmpty()) ? dataBaseVendor.getDriverClass() : driverClass; + fServerName = (serverName == null ? "" : serverName); + fServerPort = (serverPort < 0 ? 0 : serverPort); + fDatabaseName = databaseName; + fDatabaseUser = databaseUser; + fDatabasePass = databasePass; + fJdbcUrlFormat = jdbcUrlFormat; + } + + @Override + public String getName() { + return fName; + } + + @Override + public void setName(String name) { + fName = name; + } + + @Override + public String getValue(String attribute) { // NOSONAR + switch (attribute) { // NOSONAR + case DataSourceItemDescription.DATABASE_TYPE: return fDataBaseVendor.toString(); + case DataSourceItemDescription.DRIVER_CLASS: return fDriverClass; + case DataSourceItemDescription.SERVER_NAME: return fServerName; + case DataSourceItemDescription.SERVER_PORT: return ((Integer)fServerPort).toString(); + case DataSourceItemDescription.DATABASE_NAME: return fDatabaseName; + case DataSourceItemDescription.DATABASE_USER: return fDatabaseUser; + case DataSourceItemDescription.DATABASE_PASSWORD: return fDatabasePass; + } + return null; + } + + @Override + public void setValue(String attribute, String value) { + switch (attribute) { // NOSONAR + case DataSourceItemDescription.DATABASE_TYPE: { // NOSONAR + fDataBaseVendor = EnumDatabaseVendor.byName(value, value, value); + fDriverVendor = fDataBaseVendor.getDriverVendor(); + fDriverType = fDataBaseVendor.getDriverType(); + fDriverClass = fDataBaseVendor.getDriverClass(); + break; + } + case DataSourceItemDescription.DRIVER_CLASS: { // NOSONAR + fDriverClass = value; + break; + } + case DataSourceItemDescription.SERVER_NAME: { // NOSONAR + fServerName = value; + break; + } + case DataSourceItemDescription.SERVER_PORT: { // NOSONAR + fServerPort = ItemDescription.parseInt(value, fServerPort); + break; + } + case DataSourceItemDescription.DATABASE_NAME: { // NOSONAR + fDatabaseName = value; + break; + } + case DataSourceItemDescription.DATABASE_USER: { // NOSONAR + fDatabaseUser = value; + break; + } + case DataSourceItemDescription.DATABASE_PASSWORD: { // NOSONAR + fDatabasePass = value; + break; + } + } + } + + /** + * @return the name of the jdbc driver class + */ + public String getDriverClass() { + return fDriverClass; + } + + public String getDriverVendor() { + return fDriverVendor; + } + + public String getDriverType() { + return fDriverType; + } + + public String getServerName() { + return fServerName; + } + + public int getServerPort() { + return fServerPort; + } + + public String getDatabaseName() { + return fDatabaseName; + } + + public String getDatabaseUser() { + return fDatabaseUser; + } + + public String getDatabasePass() { + return fDatabasePass; // NOSONAR + } + + public EnumDatabaseVendor getDatabaseVendor() { + return fDataBaseVendor; + } + + public String getDefaultBatchWriting() { + if (fDataBaseVendor != null) { + return fDataBaseVendor.getPersistenceBatchWriting(); + } + return null; + } + + public String getDefaultSchemaName() { + switch (fDataBaseVendor) { // NOSONAR + case H2_IN_MEMORY: + return "h2memory"; + case H2_LOCAL_FILE: + return "h2localfile"; + case MYSQL: + return getDatabaseName(); + case ORACLE: + return getDatabaseUser(); + case DERBY_IN_MEMORY: + return "APP"; + case DERBY_LOCAL_FILE: + return "APP"; + case DERBY_CLIENT: + return getDatabaseUser(); + } + return null; + } + + /** + * @return the properties needed to define a DataSource + */ + protected Properties getDataSourceProperties() { + Properties properties = new Properties(); + if (fDriverType != null && fDriverType.length() > 0) { + setDataSourceProperty(properties, "driverType", fDriverType); + } + setDataSourceProperty(properties, DataSourceFactory.JDBC_SERVER_NAME, fServerName); + setDataSourceProperty(properties, DataSourceFactory.JDBC_PORT_NUMBER, ((Integer)fServerPort).toString()); + setDataSourceProperty(properties, DataSourceFactory.JDBC_DATABASE_NAME, fDatabaseName); + setDataSourceProperty(properties, DataSourceFactory.JDBC_USER, fDatabaseUser); + setDataSourceProperty(properties, DataSourceFactory.JDBC_PASSWORD, fDatabasePass); + setDataSourceProperty(properties, DataSourceFactory.JDBC_URL, fDataBaseVendor.jdbcUrl(fDriverVendor, fDriverType, fServerName, fServerPort, fDatabaseName, fJdbcUrlFormat)); + return properties; + } + + private void setDataSourceProperty(Properties properties, String key, String value) { + if (fDataBaseVendor.supportsPropertyKey(key)) { + properties.put(key, value); + } + else { + LOGGER.debug("ignoring unsupported property key '"+key+"' for driver vendor "+fDataBaseVendor.name()); + } + } + + /** + * @return the properties needed to define a JPA connection + */ + protected Properties getJpaProperties() { + Properties properties = new Properties(); + properties.put("javax.persistence.jdbc.driver" , getDriverClass()); + properties.put("javax.persistence.jdbc.url" , fDataBaseVendor.jdbcUrl(fDriverVendor, fDriverType, fServerName, fServerPort, fDatabaseName, fJdbcUrlFormat)); + properties.put("javax.persistence.jdbc.user" , fDatabaseUser); + properties.put("javax.persistence.jdbc.password", fDatabasePass); + return properties; + } + + @Override + protected String _serialize() { + return fName + +VALUE_SEPARATOR+fDataBaseVendor.toString() + +VALUE_SEPARATOR+fDriverVendor + +VALUE_SEPARATOR+fDriverType + +VALUE_SEPARATOR+fDriverClass + +VALUE_SEPARATOR+fServerName + +VALUE_SEPARATOR+fServerPort + +VALUE_SEPARATOR+fDatabaseName + +VALUE_SEPARATOR+fDatabaseUser + +VALUE_SEPARATOR+fDatabasePass + +VALUE_SEPARATOR+(fJdbcUrlFormat == null ? "" : fJdbcUrlFormat) + ; + } + + @Override + protected AItemDescribed _deserialize(String serialized) { + String[] tokens = serialized.split(VALUE_SEPARATOR); + String vendorName = tokens[1]; + String driverVendor = tokens[2]; + String dataBaseName = (tokens.length < 8) ? "" : tokens[7]; + return new DataSourceConfiguration( // NOSONAR + tokens[0], + EnumDatabaseVendor.byName(vendorName, driverVendor, dataBaseName), + tokens[2], + tokens[3], + tokens[4], + tokens[5], + ItemDescription.parseInt(tokens[6], 0), + dataBaseName, + (tokens.length < 9) ? "" : tokens[8], + (tokens.length < 10) ? "" : tokens[9], + (tokens.length < 11) || tokens[10].isEmpty() ? null : tokens[10] + ); + } + + public static String serialize(Collection<DataSourceConfiguration> dataSources) { + String retcode = null; + for (DataSourceConfiguration datasource : dataSources) { + if (retcode == null) { + retcode = datasource._serialize(); + } + else { + retcode += ITEM_SEPARATOR+datasource._serialize(); + } + } + return retcode; + } + + public static Map<String, DataSourceConfiguration> deserialize(String value) { + Map<String, DataSourceConfiguration> dataSources = new TreeMap<>(); + String[] datasourceItems = value.split(ITEM_SEPARATOR); + for(String datasourceItem : datasourceItems) { + DataSourceConfiguration dataSource = (DataSourceConfiguration) WORKER._deserialize(datasourceItem); + dataSources.put(dataSource.getName(), dataSource); + } + return dataSources; + } + + @Override + public SubItem[] getSubItems() { + return null; + } + + @Override + public String getIconName() { + return null; + } + + @Override + public String getRowName() { + return null; + } +} diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/DtoConfiguration.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/DtoConfiguration.java new file mode 100644 index 0000000..6fa6a0f --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/DtoConfiguration.java @@ -0,0 +1,41 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ + package org.eclipse.osbp.preferences; + +public class DtoConfiguration implements IShiroConfiguration { + private final String fName; + private final int fPortalId; + + public DtoConfiguration(String className, int portalId) { + fName = className; + fPortalId = portalId; + } + + @Override + public String getName() { + return fName; + } + + public int getPortalId() { + return fPortalId; + } + + @Override + public String getShiroConfiguration(String realmName) { + String retcode; + retcode = realmName+" = "+fName+INI_NEWLINE; + retcode += realmName+".portalId = "+fPortalId+INI_NEWLINE; + return retcode; + } + +} diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/EnumDatabaseVendor.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/EnumDatabaseVendor.java new file mode 100644 index 0000000..57550ca --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/EnumDatabaseVendor.java @@ -0,0 +1,440 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +class VARIABLE { // NOSONAR + protected static final String VENDOR = "%%VENDOR%%"; + protected static final String TYPE = "%%TYPE%%"; + protected static final String SERVER = "%%SERVER%%"; + protected static final String PORT = "%%PORT%%"; + protected static final String DATABASE = "%%DATABASE%%"; + protected static final String USERHOME = "%%USERHOME%%"; +} + +public enum EnumDatabaseVendor { + /*... + // http://hsqldb.org/doc/src/org/hsqldb/jdbc/JDBCDriver.html + // http://hsqldb.org/doc/guide/dbproperties-chapt.html + HSQLDB_IN_MEMORY ("hsqldb", "", "org.hsqldb.jdbc.JDBCDriver", + "jdbc:hsqldb:mem:"+VARIABLE.DATABASE + // http://h2database.com/html/features.html#execute_sql_on_connection + +";INIT=" + // create schema on initial startup + // http://hsqldb.org/doc/2.0/guide/databaseobjects-chapt.html#dbc_schemas_schema_objects + // http://www.hsqldb.org/doc/guide/ch09.html#N11DB1 + //+"ALTER SCHEMA PUBLIC RENAME TO "+VARIABLE.DATABASE + //+"CREATE SCHEMA IF NOT EXISTS "+VARIABLE.DATABASE + // SEPARATOR between multipe SQL commandos + //+"\\;" + // use this schema as default + +"SET SCHEMA "+VARIABLE.DATABASE + // SEPARATOR between multipe SQL commandos + +"", + "JDBC", + "driverType, URL, description, logWriter, loginTimeout, password, passwordChars, url, user" + ), + // http://www.h2database.com/html/features.html#database_url + HSQLDB_LOCAL_FILE ("hsqldb", "", "org.hsqldb.jdbc.JDBCDriver", + "jdbc:hsqldb:file:"+VARIABLE.USERHOME+"/"+VARIABLE.DATABASE + // http://h2database.com/html/features.html#execute_sql_on_connection + +";INIT=" + // create schema on initial startup + // http://hsqldb.org/doc/2.0/guide/databaseobjects-chapt.html#dbc_schemas_schema_objects + // http://www.hsqldb.org/doc/guide/ch09.html#N11DB1 + //+"ALTER SCHEMA PUBLIC RENAME TO "+VARIABLE.DATABASE + //+"CREATE SCHEMA IF NOT EXISTS "+VARIABLE.DATABASE + // SEPARATOR between multipe SQL commandos + //+"\\;" + // use this schema as default + +"SET SCHEMA "+VARIABLE.DATABASE + // SEPARATOR between multipe SQL commandos + +"", + "JDBC", + "driverType, URL, description, logWriter, loginTimeout, password, passwordChars, url, user" + ), + */ + DERBY_IN_MEMORY (true, "derby", "", "org.apache.derby.jdbc.EmbeddedDriver", + "jdbc:derby:memory:"+VARIABLE.DATABASE + // https://db.apache.org/derby/docs/10.8/devguide/cdevdvlp17453.html + // https://db.apache.org/derby/docs/10.8/devguide/cdevdvlpinmemdb.html + // https://db.apache.org/derby/docs/10.8/devguide/cdevdvlp40653.html + +";create=true" + +"", + "JDBC", + "driverType, URL, description, logWriter, loginTimeout, password, passwordChars, url, user", + "org.hibernate.dialect.DerbyTenSevenDialect", + " <plugin id=\"org.eclipse.gemini.dbaccess.derby\" autoStart=\"true\" startLevel=\"2\" />", + " <plugin id=\"org.eclipse.gemini.dbaccess.derby\"/>\n"+ + " <plugin id=\"org.apache.derby\"/>", + "id int", + "uuid String" + ) { + @Override + public String applySqlSpecifications(String sqlStatement) { + return sqlStatement.replace(ONE_ROW_ONE_COLUMN_TABLE, ONE_ROW_ONE_COLUMN_TABLE_DERBY); + } + }, + // https://db.apache.org/derby/papers/DerbyTut/embedded_intro.html + // https://db.apache.org/derby/integrate/plugin_help/derby_app.html + DERBY_LOCAL_FILE (false, "derby", "", "org.apache.derby.jdbc.EmbeddedDriver", + "jdbc:derby:directory:"+VARIABLE.USERHOME+"/"+VARIABLE.DATABASE + // https://db.apache.org/derby/docs/10.8/devguide/cdevdvlp17453.html + // https://db.apache.org/derby/docs/10.8/devguide/cdevdvlpinmemdb.html + // https://db.apache.org/derby/docs/10.8/devguide/cdevdvlp40653.html + +";create=true" + +"", + "JDBC", + "driverType, URL, description, logWriter, loginTimeout, password, passwordChars, url, user", + "org.hibernate.dialect.DerbyTenSevenDialect", + " <plugin id=\"org.eclipse.gemini.dbaccess.derby\" autoStart=\"true\" startLevel=\"2\" />", + " <plugin id=\"org.eclipse.gemini.dbaccess.derby\"/>\n"+ + " <plugin id=\"org.apache.derby\"/>", + "id int", + "uuid String" + ) { + @Override + public String applySqlSpecifications(String sqlStatement) { + return sqlStatement.replace(ONE_ROW_ONE_COLUMN_TABLE, ONE_ROW_ONE_COLUMN_TABLE_DERBY); + } + }, + // https://karussell.wordpress.com/2009/06/09/hibernate-cfg-xml-settings-for-derby-oracle-and-h2/ + // https://db.apache.org/derby/integrate/plugin_help/derby_app.html + DERBY_CLIENT (false, "derby", "", "org.apache.derby.jdbc.ClientDriver", + "jdbc:derby://"+VARIABLE.SERVER+":"+VARIABLE.PORT+"/"+VARIABLE.DATABASE+";create=true", + "JDBC", + "driverType, URL, description, logWriter, loginTimeout, password, passwordChars, url, user", + "org.hibernate.dialect.DerbyDialect", + " <plugin id=\"org.eclipse.gemini.dbaccess.derby\" autoStart=\"true\" startLevel=\"2\" />", + " <plugin id=\"org.eclipse.gemini.dbaccess.derby\"/>\n"+ + " <plugin id=\"org.apache.derby\"/>", + "id int", + "uuid String" + ) { + @Override + public String applySqlSpecifications(String sqlStatement) { + return sqlStatement.replace(ONE_ROW_ONE_COLUMN_TABLE, ONE_ROW_ONE_COLUMN_TABLE_DERBY); + } + }, + // http://www.h2database.com/html/features.html#in_memory_databases + H2_IN_MEMORY (true, "h2", "", "org.h2.Driver", + "jdbc:h2:mem:"+VARIABLE.DATABASE + // http://h2database.com/html/features.html#execute_sql_on_connection + +";LOCK_MODE=0" + +";INIT=" + // create schema on initial startup + +"CREATE SCHEMA IF NOT EXISTS "+VARIABLE.DATABASE + // SEPARATOR between multipe SQL commandos + +"\\;" + // use this schema as default + +"SET SCHEMA "+VARIABLE.DATABASE + // SEPARATOR between multipe SQL commandos + +"\\;" + // ??? set autocommit to false due to own implemented commit statements ?!? + +"SET AUTOCOMMIT=FALSE" + // http://h2database.com/html/features.html#auto_mixed_mode + // H2 can't mix memory AND AUTO-SERVER - +";AUTO_SERVER=TRUE" + // http://h2database.com/html/features.html#in_memory_databases + +";DB_CLOSE_DELAY=-1" + +"", + "JDBC", + "driverType, URL, description, logWriter, loginTimeout, password, passwordChars, url, user", + "org.hibernate.dialect.H2Dialect", + " <plugin id=\"org.eclipse.gemini.dbaccess.h2\" autoStart=\"true\" startLevel=\"2\" />", + " <plugin id=\"org.eclipse.gemini.dbaccess.h2\"/>\n"+ + " <plugin id=\"org.h2\"/>\n"+ + " <plugin id=\"org.ops4j.pax.jdbc.h2\"/>", + /** do NOT use <code>int</code> for id in H2, because table SEQUENCE doesn't exist also discussed at http://stackoverflow.com/questions/9909893/jpa-how-to-annotate-id-so-its-autoincrements-without-sequence-table */ + "/** do NOT use <code>int</code> for id in H2, because table SEQUENCE doesn't exist */ uuid String", + "uuid String" + ) { + @Override + public String applySqlSpecifications(String sqlStatement) { + return sqlStatement.replace(ONE_ROW_ONE_COLUMN_TABLE, ONE_ROW_ONE_COLUMN_TABLE_H2); + } + /** + * in H2 there are no schema names! + */ + @Override + public String applySchemaNameSpecifications(String schemaName) { + return null; + } + }, + // http://www.h2database.com/html/features.html#database_url + H2_LOCAL_FILE (false, "h2", "", "org.h2.Driver", + "jdbc:h2:file:"+VARIABLE.USERHOME+"/"+VARIABLE.DATABASE + // http://h2database.com/html/features.html#execute_sql_on_connection + +";LOCK_MODE=0" + +";INIT=" + // create schema on initial startup + +"CREATE SCHEMA IF NOT EXISTS "+VARIABLE.DATABASE + // SEPARATOR between multipe SQL commandos + +"\\;" + // use this schema as default + +"SET SCHEMA "+VARIABLE.DATABASE + // SEPARATOR between multipe SQL commandos + +"\\;" + // ??? set autocommit to false due to own implemented commit statements ?!? + +"SET AUTOCOMMIT=FALSE" + // http://h2database.com/html/features.html#auto_mixed_mode + +";AUTO_SERVER=TRUE" + +"", + "JDBC", + "driverType, URL, description, logWriter, loginTimeout, password, passwordChars, url, user", + "org.hibernate.dialect.H2Dialect", + " <plugin id=\"org.eclipse.gemini.dbaccess.h2\" autoStart=\"true\" startLevel=\"2\" />", + " <plugin id=\"org.eclipse.gemini.dbaccess.h2\"/>\n"+ + " <plugin id=\"org.h2\"/>\n"+ + " <plugin id=\"org.ops4j.pax.jdbc.h2\"/>", + /** do NOT use <code>int</code> for id in H2, because table SEQUENCE doesn't exist also discussed at http://stackoverflow.com/questions/9909893/jpa-how-to-annotate-id-so-its-autoincrements-without-sequence-table */ + "/** do NOT use <code>int</code> for id in H2, because table SEQUENCE doesn't exist */ uuid String", + "uuid String" + ) { + @Override + public String applySqlSpecifications(String sqlStatement) { + return sqlStatement.replace(ONE_ROW_ONE_COLUMN_TABLE, ONE_ROW_ONE_COLUMN_TABLE_H2); + } + /** + * in H2 there are no schema names! + */ + @Override + public String applySchemaNameSpecifications(String schemaName) { + return "APP"; + } + }, + // see samples + // - http://dev.mysql.com/doc/connector-j/en/connector-j-usagenotes-connect-drivermanager.html + // - http://www.mkyong.com/jdbc/how-to-connect-to-mysql-with-jdbc-driver-java/ + // - http://www.vogella.com/tutorials/MySQLJava/article.html + MYSQL (false, "mysql", "thin", "com.mysql.jdbc.Driver", + "jdbc:"+VARIABLE.VENDOR+"://"+VARIABLE.SERVER+":"+VARIABLE.PORT+"/"+VARIABLE.DATABASE, + "JDBC", + "URL, allowLoadLocalInfile, allowMasterDownConnections, allowMultiQueries, allowNanAndInf, allowUrlInLocalInfile, alwaysSendSetIsolation, authenticationPlugins, autoClosePStmtStreams, autoDeserialize, autoGenerateTestcaseScript, autoReconnect, autoReconnectForConnectionPools, autoReconnectForPools, autoSlowLog, blobsAreStrings, cacheCallableStatements, cacheCallableStmts, cachePrepStmts, cachePreparedStatements, cacheResultSetMetadata, cacheServerConfiguration, callableStatementCacheSize, callableStmtCacheSize, capitalizeDBMDTypes, capitalizeTypeNames, characterEncoding, characterSetResults, clientCertificateKeyStorePassword, clientCertificateKeyStoreType, clientCertificateKeyStoreUrl, clientInfoProvider, clobCharacterEncoding, clobberStreamingResults, compensateOnDuplicateKeyUpdateCounts, connectTimeout, connectionAttributes, connectionCollation, connectionLifecycleInterceptors, continueBatchOnError, createDatabaseIfNotExist, databaseName, defaultAuthenticationPlugin, defaultFetchSize, detectCustomCollations, detectServerPreparedStmts, disabledAuthenticationPlugins, disconnectOnExpiredPasswords, dontTrackOpenResources, dumpMetadataOnColumnNotFound, dumpQueriesOnException, dynamicCalendars, elideSetAutoCommits, emptyStringsConvertToZero, emulateLocators, emulateUnsupportedPstmts, enablePacketDebug, enableQueryTimeouts, encoding, exceptionInterceptors, explainSlowQueries, failOverReadOnly, functionsNeverReturnBlobs, gatherPerfMetrics, gatherPerformanceMetrics, generateSimpleParameterMetadata, getProceduresReturnsFunctions, holdResultsOpenOverStatementClose, ignoreNonTxTables, includeInnodbStatusInDeadlockExceptions, includeThreadDumpInDeadlockExceptions, includeThreadNamesAsStatementComment, initialTimeout, interactiveClient, isInteractiveClient, jdbcCompliantTruncation, jdbcCompliantTruncationForReads, largeRowSizeThreshold, loadBalanceAutoCommitStatementRegex, loadBalanceAutoCommitStatementThreshold, loadBalanceBlacklistTimeout, loadBalanceConnectionGroup, loadBalanceEnableJMX, loadBalanceExceptionChecker, loadBalancePingTimeout, loadBalanceSQLExceptionSubclassFailover, loadBalanceSQLStateFailover, loadBalanceStrategy, loadBalanceValidateConnectionOnSwapServer, localSocketAddress, logSlowQueries, logWriter, logXaCommands, logger, loggerClassName, loginTimeout, maintainTimeStats, maxAllowedPacket, maxQuerySizeToLog, maxReconnects, maxRows, metadataCacheSize, netTimeoutForStreamingResults, noAccessToProcedureBodies, noDatetimeStringSync, noTimezoneConversionForTimeType, nullCatalogMeansCurrent, nullNamePatternMatchesAll, overrideSupportsIntegrityEnhancementFacility, packetDebugBufferSize, padCharsWithSpace, paranoid, parseInfoCacheFactory, password, passwordCharacterEncoding, pedantic, pinGlobalTxToPhysicalConnection, populateInsertRowWithDefaultValues, port, portNumber, prepStmtCacheSize, prepStmtCacheSqlLimit, preparedStatementCacheSize, preparedStatementCacheSqlLimit, processEscapeCodesForPrepStmts, profileSQL, profileSql, profilerEventHandler, propertiesTransform, propertiesViaRef, queriesBeforeRetryMaster, queryTimeoutKillsConnection, reconnectAtTxEnd, relaxAutoCommit, replicationEnableJMX, reportMetricsIntervalMillis, requireSSL, resourceId, resultSetSizeThreshold, retainStatementAfterResultSetClose, retriesAllDown, rewriteBatchedStatements, rollbackOnPooledClose, roundRobinLoadBalance, runningCTS13, secondsBeforeRetryMaster, selfDestructOnPingMaxOperations, selfDestructOnPingSecondsLifetime, serverConfigCacheFactory, serverName, serverTimezone, sessionVariables, slowQueryThresholdMillis, slowQueryThresholdNanos, socketFactory, socketFactoryClassName, socketTimeout, statementInterceptors, strictFloatingPoint, strictUpdates, tcpKeepAlive, tcpNoDelay, tcpRcvBuf, tcpSndBuf, tcpTrafficClass, tinyInt1isBit, traceProtocol, transformedBitIsBoolean, treatUtilDateAsTimestamp, trustCertificateKeyStorePassword, trustCertificateKeyStoreType, trustCertificateKeyStoreUrl, ultraDevHack, url, useAffectedRows, useBlobToStoreUTF8OutsideBMP, useColumnNamesInFindColumn, useCompression, useConfigs, useCursorFetch, useDirectRowUnpack, useDynamicCharsetInfo, useFastDateParsing, useFastIntParsing, useGmtMillisForDatetimes, useHostsInPrivileges, useInformationSchema, useJDBCCompliantTimezoneShift, useJvmCharsetConverters, useLegacyDatetimeCode, useLocalSessionState, useLocalTransactionState, useNanosForElapsedTime, useOldAliasMetadataBehavior, useOldUTF8Behavior, useOnlyServerErrorMessages, useReadAheadInput, useSSL, useSSPSCompatibleTimezoneShift, useServerPrepStmts, useServerPreparedStmts, useSqlStateCodes, useStreamLengthsInPrepStmts, useTimezone, useUltraDevWorkAround, useUnbufferedInput, useUnicode, useUsageAdvisor, user, utf8OutsideBmpExcludedColumnNamePattern, utf8OutsideBmpIncludedColumnNamePattern, verifyServerCertificate, yearIsDateType, zeroDateTimeBehavior", + "org.hibernate.dialect.MySQLDialect", + " <plugin id=\"org.eclipse.gemini.dbaccess.mysql\" autoStart=\"true\" startLevel=\"2\" />", + " <plugin id=\"com.mysql.jdbc\"/>\n"+ + " <plugin id=\"org.eclipse.gemini.dbaccess.mysql\"/>", + "id int", + "uuid String" + ) { + @Override + public String applySqlSpecifications(String sqlStatement) { + return sqlStatement.replace(ONE_ROW_ONE_COLUMN_TABLE, ONE_ROW_ONE_COLUMN_TABLE_MYSQL); + } + }, + ORACLE (false, "oracle", "thin", "oracle.jdbc.OracleDriver", + "jdbc:"+VARIABLE.VENDOR+":"+VARIABLE.TYPE+":@"+VARIABLE.SERVER+":"+VARIABLE.PORT+":"+VARIABLE.DATABASE, + "Oracle-JDBC", + null, + "org.hibernate.dialect.Oracle10gDialect", + " <plugin id=\"org.eclipse.gemini.dbaccess.oracle\" autoStart=\"true\" startLevel=\"2\" />", + " <plugin id=\"oracleJdbc.osgi\"/>\n"+ + " <plugin id=\"org.eclipse.gemini.dbaccess.oracle\"/>", + "id int", + "uuid String" + ) { + @Override + public String applySqlSpecifications(String sqlStatement) { + return sqlStatement.replace(ONE_ROW_ONE_COLUMN_TABLE, ONE_ROW_ONE_COLUMN_TABLE_ORACLE); + } + }; + + private final boolean fIsInMemory; + private final String fDriverVendor; + private final String fDriverType; + private final String fDriverClass; + private final String fJdbcUrlFormat; + private final String fPersistenceBatchWriting; + private final String fHibernateDialect; + private final String fProductPlugins; + private final String fProductConfigurations; + private final String fEntityPropertyBaseID; + private final String fEntityPropertyBaseUUID; + private final List<String> fPropertyKeys; + + private EnumDatabaseVendor(boolean isInMemory, String driverVendor, String driverType, String driverClass, String jdbcUrlFormat, String persistenceBatchWriting, String propertyKeys, String hibernateDialect, String productConfigurations, String productPlugins, String entityPropertyBaseID, String entityPropertyBaseUUID) { + fIsInMemory = isInMemory; + fDriverVendor = driverVendor; + fDriverType = driverType; + fDriverClass = driverClass; + fJdbcUrlFormat = jdbcUrlFormat; + fPersistenceBatchWriting = persistenceBatchWriting; + fPropertyKeys = new ArrayList<>(); + if (propertyKeys != null) { + for (String propertyKey : propertyKeys.split(",")) { + fPropertyKeys.add(propertyKey.trim()); + } + } + fHibernateDialect = hibernateDialect; + fProductPlugins = productPlugins; + fProductConfigurations = productConfigurations; + fEntityPropertyBaseID = entityPropertyBaseID; + fEntityPropertyBaseUUID = entityPropertyBaseUUID; + } + + private static boolean equalsIgnoreCase(String s1, String s2) { + s1 = s1.replaceAll("_IN_", "").replaceAll("_", ""); // NOSONAR + s2 = s2.replaceAll("_IN_", "").replaceAll("_", ""); // NOSONAR + return s1.equalsIgnoreCase(s2); + } + + public static String getNecessaryPlugins(Set<EnumDatabaseVendor> vendors) { + ArrayList<String> result = new ArrayList<String>(); + for (EnumDatabaseVendor vendor : vendors) { + result.add(vendor.getProductPlugins()); + } + return String.join("\n", result); + } + + public static String getUnnecessaryPlugins(Set<EnumDatabaseVendor> vendors) { + ArrayList<String> result = new ArrayList<String>(); + for (EnumDatabaseVendor vendor : values()) { + if (!vendors.contains(vendor)) { + result.add(vendor.getProductPlugins()); + } + } + return String.join("\n", result); + } + + public static String getNecessaryConfigurations(Set<EnumDatabaseVendor> vendors) { + ArrayList<String> result = new ArrayList<String>(); + for (EnumDatabaseVendor vendor : vendors) { + result.add(vendor.getProductConfigurations()); + } + return String.join("\n", result); + } + + public static String getUnnecessaryConfigurations(Set<EnumDatabaseVendor> vendors) { + ArrayList<String> result = new ArrayList<String>(); + for (EnumDatabaseVendor vendor : values()) { + if (!vendors.contains(vendor)) { + result.add(vendor.getProductConfigurations()); + } + } + return String.join("\n", result); + } + + public static EnumDatabaseVendor byName(String vendorName) { // NOSONAR + return byName(vendorName, vendorName, vendorName); + } + + public static EnumDatabaseVendor byName(String vendorName, String driverVendor, String dataBaseName) { // NOSONAR + for (EnumDatabaseVendor step : values()) { + if (equalsIgnoreCase(step.name(), vendorName) || equalsIgnoreCase(step.fDriverVendor, vendorName)) { + return step; + } + } + for (EnumDatabaseVendor step : values()) { + if (equalsIgnoreCase(step.name(), dataBaseName) || equalsIgnoreCase(step.fDriverVendor, dataBaseName)) { + return step; + } + if (equalsIgnoreCase(step.name(), driverVendor) || equalsIgnoreCase(step.fDriverVendor, driverVendor)) { + return step; + } + } + return ORACLE; + } + + public static final String ONE_ROW_ONE_COLUMN_TABLE = "{{ONE_ROW_ONE_COLUMN_TABLE}}"; + public static final String ONE_ROW_ONE_COLUMN_TABLE_DERBY = "SYSIBM.SYSDUMMY1"; + public static final String ONE_ROW_ONE_COLUMN_TABLE_H2 = "DUAL"; + public static final String ONE_ROW_ONE_COLUMN_TABLE_MYSQL = "DUAL"; + public static final String ONE_ROW_ONE_COLUMN_TABLE_ORACLE = "DUAL"; + + /** + * @param sqlStatement + * @return applied vendor specific SQL statement + */ + abstract public String applySqlSpecifications(String sqlStatement); + + public String applySchemaNameSpecifications(String schemaName) { + return schemaName; + } + + public boolean isInMemory() { + return fIsInMemory; + } + + public String getDriverVendor() { + return fDriverVendor; + } + + public String getDriverType() { + return fDriverType; + } + + public String getDriverClass() { + return fDriverClass; + } + + public String getHibernateDialect() { + return fHibernateDialect; + } + + public String getProductPlugins() { + return fProductPlugins; + } + + public String getProductConfigurations() { + return fProductConfigurations; + } + + public String getEntityPropertyBaseID() { + return fEntityPropertyBaseID; + } + + public String getEntityPropertyBaseUUID() { + return fEntityPropertyBaseUUID; + } + + public String getPersistenceBatchWriting() { + return fPersistenceBatchWriting; + } + + public String jdbcUrl(String driverVendor, String driverType, String serverName, int serverPort, String databaseName, String jdbUrlFormat) { + if ((driverVendor == null) || driverVendor.trim().isEmpty()) { + driverVendor = fDriverVendor; // NOSONAR + } + if ((driverType == null) || driverType.trim().isEmpty()) { + driverType = fDriverType; // NOSONAR + } + if (serverName == null) { + serverName = "???"; // NOSONAR + } + if (serverPort == 0) { + serverPort = -1; // NOSONAR + } + String format = ((jdbUrlFormat != null) && !jdbUrlFormat.isEmpty()) ? jdbUrlFormat : fJdbcUrlFormat; + String retcode = format // NOSONAR + .replaceAll(VARIABLE.VENDOR, driverVendor) + .replaceAll(VARIABLE.TYPE, driverType) + .replaceAll(VARIABLE.SERVER, serverName) + .replaceAll(VARIABLE.PORT, ((Integer)serverPort).toString()) + .replaceAll(VARIABLE.DATABASE, databaseName) + .replaceAll(VARIABLE.USERHOME, System.getProperty("user.home").replace(java.io.File.separator,"/")) + ; + return retcode; + } + + public boolean supportsPropertyKey(String key) { + if (fPropertyKeys.isEmpty()) { + return true; + } + else { + return fPropertyKeys.contains(key); + } + } +} diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/IItemDescribed.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/IItemDescribed.java new file mode 100644 index 0000000..9db1095 --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/IItemDescribed.java @@ -0,0 +1,24 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences; + +public interface IItemDescribed { + + public abstract String getName(); + + public abstract void setName(String name); + + public abstract String getValue(String attribute); + + public abstract void setValue(String attribute, String value); +} diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/IProductConfigurationPrefs.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/IProductConfigurationPrefs.java new file mode 100644 index 0000000..0c15276 --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/IProductConfigurationPrefs.java @@ -0,0 +1,153 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences; + +import java.util.Collection; +import java.util.Locale; +import java.util.Map; + +import org.eclipse.core.resources.IProject; + +public interface IProductConfigurationPrefs { + + public static int DEFAULT_PORT_ACTIVE_MQ_BROKER_SERVICE = 61616; + public static int DEFAULT_PORT_BPM_ENGINE = 9123; + public static int DEFAULT_PORT_EMAIL_SMTP = 25; + + public abstract IProject getProject(); + + public abstract String getBusinessBundleClassNameReadOnly(); + + /** + * @return name of the server running the BPM Service.<br>Use {@link ProductConfiguration#isServerReasonable(String)} to check if the name is reasonable. + */ + public abstract String getBpmServerIp(); + + public abstract int getBpmServerPort(); + + public abstract int getBpmResponseTimeout(); + + public abstract String getEuroXRefRatesURLDaily(); + + public abstract String getEuroXRefRatesURLPrevious(); + + /** + * @return name of the server running the ActiveMQ Broker Service.<br>Use {@link ProductConfiguration#isServerReasonable(String)} to check if the name is reasonable. + */ + public abstract String getActiveMqBrokerServerName(); + + public abstract int getActiveMqBrokerServerPort(); + + public abstract int getHybridRefresherMilliSecsActive(); + + public abstract int getHybridRefresherMilliSecsInactive(); + +// public abstract String getDataSourceNameForAuthentication(); +// +// public abstract String getDataSourceNameForBLOB(); +// +// public abstract String getDataSourceNameForBPM(); +// +// public abstract String getDataSourceNameForBusinessData(); + + public abstract int getAuthRESTfulPort(); + + public abstract boolean hasAutoLogin(); + + public abstract boolean hasEncryptPasswords(); + + public abstract boolean hasNoRememberMe(); + + public abstract int getDtoRealmPortalId(); + + public abstract int getLdapRealmPortalId(); + + public abstract String getLdapContextFactoryUrl(); + + public abstract String getLdapUserDnTemplate(); + + /** + * @return administrator email when login depends on email adress. default = admin@support.com + */ + public abstract String getAdminEmail(); + + /** + * @return administrator email username to authenticate against the email server. + */ + public abstract String getAdminEmailUsername(); + + /** + * <b>Please be aware, that the password is stored as <u>plain-text</u> right now!</b> + * @return administrator email password to authenticate against the email server. + */ + public abstract String getAdminEmailPassword(); + + public abstract int getMaxLoginAttempts(); + + public abstract String getProtocolDatasource(); + + public abstract String getProtocolUnit(); + + public abstract boolean getIdentifyByUsername(); + + public abstract Map<String, Locale> getLanguages(); + + public abstract boolean isLanguagesAutotranslate(); + + public abstract boolean willLanguagesAutocreate(); + + public abstract boolean isUomoMetricUnit(); + + public abstract boolean showLanguageSelectInRespectiveLocale(); + + public abstract String getLanguagesGoogleHttpReferrer(); + + public abstract String getLanguagesGoogleApiKey(); + + public abstract boolean hasToolsPrintService(); + + public abstract boolean hasDemoToolsTheme(); + + public abstract boolean hasDemoToolsStrategy(); + + public abstract boolean hasDemoToolsLanguage(); + + public abstract boolean projectWizardUsesAbsoluteLocation(); + + public abstract Collection<DataSourceConfiguration> getDataSources(); + + public abstract Collection<PersistenceUnitConfiguration> getPersistenceUnits(); + + public abstract boolean isBpmEngineHibernateShowSql(); + + public abstract boolean isBpmEngineHibernateFormatSql(); + + public abstract String getBpmEnginePersistenceUnit(); + + public abstract String getBpmEngineHibernateSchemaName(String persistenceUnit); + + public abstract int getBpmEngineHibernateMaxFetchDepth(); + + public abstract String getAuthenticationOrganizationId(); + + /** + * @return name of the server running email service.<br>Use {@link ProductConfiguration#isServerReasonable(String)} to check if the name is reasonable. + */ + public abstract String getEmailServerIp(); + + public abstract int getEmailSmtpPort(); + + public abstract boolean isEmailUseSslOnConnect(); + + public abstract String getJavaPosConfiguration(); +} diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/IShiroConfiguration.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/IShiroConfiguration.java new file mode 100644 index 0000000..96a42a4 --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/IShiroConfiguration.java @@ -0,0 +1,19 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ + package org.eclipse.osbp.preferences; + +public interface IShiroConfiguration { + static final String INI_NEWLINE = "\r\n"; + String getName(); + String getShiroConfiguration(String realmName); +} diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ItemDescription.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ItemDescription.java new file mode 100644 index 0000000..98632b8 --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ItemDescription.java @@ -0,0 +1,68 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences; + +import java.util.LinkedHashMap; +import java.util.Map; + +public class ItemDescription { + + private final String fRowName; + private final Map<String, Type> fColumns; + + public enum Type { + DatabaseType, // NOSONAR + Integer, // NOSONAR + String, // NOSONAR + Boolean, // NOSONAR + }; + + public ItemDescription(String rowName, Object... columnAttributes) { + fRowName = rowName; + fColumns = new LinkedHashMap<>(); + for (int idx = 0; idx < columnAttributes.length/2; idx++) { + fColumns.put((String)columnAttributes[idx*2], (Type)columnAttributes[idx*2+1]); + } + } + + public static boolean parseBoolean(String text, boolean deflt) { + try { + return Boolean.parseBoolean(text); + } + catch (Exception e) { // NOSONAR + return deflt; + } + } + + public static int parseInt(String text, int deflt) { + try { + return Integer.parseInt(text); + } + catch (Exception e) { // NOSONAR + return deflt; + } + + } + + public String getRowName() { + return fRowName; + } + + public String[] getColumnNames() { + return fColumns.keySet().toArray(new String[0]); + } + + public Type getColumnType(String columnName) { + return fColumns.get(columnName); + } +} diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/LdapConfiguration.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/LdapConfiguration.java new file mode 100644 index 0000000..9588fea --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/LdapConfiguration.java @@ -0,0 +1,66 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences; + + + +/** + * Helper class containing LDAP configuration data needed for Shiro + */ +public class LdapConfiguration implements IShiroConfiguration { + private final String fName; + private final int fPortalId; + private final String fUrl; + private final String fTemplate; + + protected LdapConfiguration(String className, int portalId, String url, String template) { + fName = className; + fPortalId = portalId; + fUrl = url; + fTemplate = template; + } + + /** + * @return the logical Shiro authentication realm + */ + @Override + public String getName() { + return fName; + } + + public int getPortalId() { + return fPortalId; + } + + public String getUrl() { + return fUrl; + } + + public String getTemplate() { + return fTemplate; + } + + /** + * @return the corresponding INI string for this authentication realm needed for Shiro + */ + @Override + public String getShiroConfiguration(String realmName) { + String retcode; + retcode = realmName+" = "+fName+INI_NEWLINE; + retcode += realmName+".userDnTemplate = "+fTemplate+INI_NEWLINE; + retcode += realmName+".contextFactory.url = "+fUrl+INI_NEWLINE; + retcode += realmName+".portalId = "+fPortalId+INI_NEWLINE; + return retcode; + } + +} diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/LocaleUtils.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/LocaleUtils.java new file mode 100644 index 0000000..9f15a18 --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/LocaleUtils.java @@ -0,0 +1,67 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences; + +import java.util.Arrays; +import java.util.Comparator; +import java.util.Locale; + +public class LocaleUtils { + + private LocaleUtils() { + } + + /** + * @param locale + * @param displayByRespectiveLocale true, if the locale itself should be used to get the display name + * @return the display name for the given locale + */ + public static String getDisplayName(Locale locale, boolean displayByRespectiveLocale) { + + String displayName = displayByRespectiveLocale ? + locale.getDisplayLanguage(locale) : + locale.getDisplayLanguage(); + + if (locale.getLanguage().length()>0 && locale.getCountry().length()>0){ + + displayName = displayName + " " + ( displayByRespectiveLocale ? + locale.getDisplayCountry(locale) : + locale.getDisplayCountry() ); + + if (locale.getVariant().length()>0) { + + displayName = displayName + " " + ( displayByRespectiveLocale ? + locale.getDisplayVariant(locale): + locale.getDisplayVariant() ); + } + } + + return displayName; + } + + /** + * @param locales the array of locales, that should be sorted + * @param displayByRespectiveLocale true, if the locale itself should be used to get the display name for sorting + */ + public static void sortLocalesOnDisplayName(Locale[] locales, final boolean displayByRespectiveLocale) { + Comparator<Locale> localeComparator = (locale1, locale2) -> { + String locale1Name = displayByRespectiveLocale ? locale1.getDisplayName(locale1) : locale1.getDisplayName(); + String locale2Name = displayByRespectiveLocale ? locale2.getDisplayName(locale2) : locale2.getDisplayName(); + return locale1Name.compareTo(locale2Name); + }; + Arrays.sort(locales, localeComparator); + } + +} + + diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/PersistenceUnitConfiguration.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/PersistenceUnitConfiguration.java new file mode 100644 index 0000000..4a50d25 --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/PersistenceUnitConfiguration.java @@ -0,0 +1,338 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences; + +import java.util.Collection; +import java.util.Map; +import java.util.Properties; +import java.util.TreeMap; + +import javax.sql.CommonDataSource; +import javax.sql.DataSource; +import javax.sql.XADataSource; + +import org.eclipse.osbp.preferences.ProductConfigurationPrefs.DDL_GENERATION; +import org.eclipse.persistence.config.PersistenceUnitProperties; +import org.eclipse.persistence.config.SessionCustomizer; +import org.eclipse.persistence.sessions.Session; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class PersistenceUnitConfiguration extends AItemDescribed { + + private static final Logger LOGGER = LoggerFactory.getLogger(PersistenceUnitConfiguration.class); + private static final PersistenceUnitConfiguration WORKER = new PersistenceUnitConfiguration(); + + public static final class PersistenceUnitItemDescription extends ItemDescription { + + public static final PersistenceUnitItemDescription INSTANCE = new PersistenceUnitItemDescription(); + + private static final String ROW_NAME = "Persistence Unit"; + public static final String JNDI_NAME = "JNDI Data Source"; + public static final String DDL_GENERATION = "DDL Generation"; + public static final String BATCH_WRITING = "Batch Writing"; + public static final String DEPLOY_ON_STARTUP = "Deploy on Startup"; + public static final String QUERY_CACHE = "Query Cache"; + public static final String BATCH_WRITING_SIZE = "Batch Writing Size"; + public static final String CACHE_STATEMENTS = "Cache Statements"; + public static final String CACHE_STATEMENTS_SIZE = "Cache Statements Size"; + public static final String LOGGING_LEVEL = "Logging Level"; + public static final String PERSISTENCE_XML_PATH = "Persistence XML Path"; + public static final String WEAVING = "Weaving"; + + protected PersistenceUnitItemDescription() { + super(ROW_NAME, JNDI_NAME, Type.Integer, DDL_GENERATION, Type.String, BATCH_WRITING, Type.String, + DEPLOY_ON_STARTUP, Type.Boolean, QUERY_CACHE, Type.Boolean, BATCH_WRITING_SIZE, Type.Integer, CACHE_STATEMENTS, + Type.Boolean, CACHE_STATEMENTS_SIZE, Type.Integer, LOGGING_LEVEL, Type.String, PERSISTENCE_XML_PATH, Type.String, + WEAVING, Type.String); + } + } + + private String name; + private String jndiName; + private Boolean deployOnStartup; + private Boolean queryCache; + private String batchWriting; + private Integer batchWritingSize; + private Boolean cacheStatements; + private Integer cacheStatementsSize; + private String loggingLevel; + private String ddlGeneration; + private String persistenceXMLPath; + private String weaving; + + public static final boolean DEPLOY_ON_STARTUP = true; + public static final boolean QUERY_CACHE = true; + public static final int BATCH_WRITING_SIZE = 1000; + public static final boolean CACHE_STATEMENTS = true; + public static final int CACHE_STATEMENTS_SIZE = 200; + public static final String LOGGING_LEVEL = "off"; + public static final String PERSISTENCE_XML_PATH = PersistenceUnitProperties.ECLIPSELINK_PERSISTENCE_XML_DEFAULT; + public static final String WEAVING = "static"; // NOSONAR + + public PersistenceUnitConfiguration(String name, String jndiName, String batchWriting, String ddlGeneration) { + this(name, jndiName, DEPLOY_ON_STARTUP, QUERY_CACHE, batchWriting, BATCH_WRITING_SIZE, CACHE_STATEMENTS, + CACHE_STATEMENTS_SIZE, LOGGING_LEVEL, ddlGeneration, PERSISTENCE_XML_PATH, WEAVING); + } // NOSONAR + + public PersistenceUnitConfiguration(String name, String jndiName, + boolean deployOnStartup, boolean queryCache, String batchWriting, int batchWritingSize, boolean cacheStatements, + int cacheStatementsSize, String loggingLevel, String ddlGeneration, String persistenceXMLPath, String pweaving) { + super(PersistenceUnitItemDescription.INSTANCE); + this.name = name; + this.jndiName = (jndiName == null || jndiName.isEmpty()) ? name : jndiName; + this.deployOnStartup = deployOnStartup; + this.queryCache = queryCache; + this.batchWriting = batchWriting; + this.batchWritingSize = batchWritingSize; + this.cacheStatements = cacheStatements; + this.cacheStatementsSize = cacheStatementsSize; + this.loggingLevel = (loggingLevel == null || loggingLevel.isEmpty()) ? LOGGING_LEVEL : loggingLevel; + this.ddlGeneration = (ddlGeneration == null || ddlGeneration.isEmpty()) ? DDL_GENERATION.UPDATE.eclipseLink() : ddlGeneration; + this.persistenceXMLPath = (persistenceXMLPath == null || persistenceXMLPath.isEmpty()) ? PERSISTENCE_XML_PATH : persistenceXMLPath; + this.weaving = (pweaving == null || pweaving.isEmpty()) ? WEAVING : pweaving; + } + + private PersistenceUnitConfiguration() { + super(PersistenceUnitItemDescription.INSTANCE); + this.name = "noname"; + this.jndiName = "njndioname"; + this.deployOnStartup = false; + this.queryCache = false; + this.batchWriting = "nobatchWriting"; + this.batchWritingSize = 0; + this.cacheStatements = false; + this.cacheStatementsSize = 0; + this.loggingLevel = null; + this.ddlGeneration = null; + this.persistenceXMLPath = null; + this.weaving = null; + } + + @Override + public String getName() { + return name; + } + + @Override + public void setName(String name) { + this.name = name; + } + + @Override + public String getValue(String attribute) { // NOSONAR + switch (attribute) { // NOSONAR + case PersistenceUnitItemDescription.JNDI_NAME: + return jndiName; + case PersistenceUnitItemDescription.DDL_GENERATION: + return ddlGeneration; + case PersistenceUnitItemDescription.BATCH_WRITING: + return batchWriting; + case PersistenceUnitItemDescription.DEPLOY_ON_STARTUP: + return Boolean.toString(deployOnStartup); + case PersistenceUnitItemDescription.QUERY_CACHE: + return Boolean.toString(queryCache); + case PersistenceUnitItemDescription.BATCH_WRITING_SIZE: + return Integer.toString(batchWritingSize); + case PersistenceUnitItemDescription.CACHE_STATEMENTS: + return Boolean.toString(cacheStatements); + case PersistenceUnitItemDescription.CACHE_STATEMENTS_SIZE: + return Integer.toString(cacheStatementsSize); + case PersistenceUnitItemDescription.LOGGING_LEVEL: + return loggingLevel; + case PersistenceUnitItemDescription.PERSISTENCE_XML_PATH: + return persistenceXMLPath; + case PersistenceUnitItemDescription.WEAVING: + return weaving; + } + return null; + } + + @Override + public void setValue(String attribute, String value) { // NOSONAR + switch (attribute) { // NOSONAR + case PersistenceUnitItemDescription.JNDI_NAME: + jndiName = value; + return; // NOSONAR + case PersistenceUnitItemDescription.DDL_GENERATION: + ddlGeneration = value; + return; // NOSONAR + case PersistenceUnitItemDescription.BATCH_WRITING: + batchWriting = value; + return; // NOSONAR + case PersistenceUnitItemDescription.DEPLOY_ON_STARTUP: + deployOnStartup = ItemDescription.parseBoolean(value, deployOnStartup); + return; // NOSONAR + case PersistenceUnitItemDescription.QUERY_CACHE: + queryCache = ItemDescription.parseBoolean(value, queryCache); + return; // NOSONAR + case PersistenceUnitItemDescription.BATCH_WRITING_SIZE: + batchWritingSize = ItemDescription.parseInt(value, batchWritingSize); + return; // NOSONAR + case PersistenceUnitItemDescription.CACHE_STATEMENTS: + cacheStatements = ItemDescription.parseBoolean(value, cacheStatements); + return; // NOSONAR + case PersistenceUnitItemDescription.CACHE_STATEMENTS_SIZE: + cacheStatementsSize = ItemDescription.parseInt(value, cacheStatementsSize); + return; // NOSONAR + case PersistenceUnitItemDescription.LOGGING_LEVEL: + loggingLevel = value; + return; // NOSONAR + case PersistenceUnitItemDescription.PERSISTENCE_XML_PATH: + persistenceXMLPath = value; + return; // NOSONAR + case PersistenceUnitItemDescription.WEAVING: + weaving = value; + return; // NOSONAR + } + } + + public String getJndiName() { + return jndiName; + } + + public Boolean getDeployOnStartup() { + return deployOnStartup; + } + + public Boolean getQueryCache() { + return queryCache; + } + + public String getBatchWriting() { + return batchWriting; + } + + public Integer getBatchWritingSize() { + return batchWritingSize; + } + + public Boolean getCacheStatements() { + return cacheStatements; + } + + public Integer getCacheStatementsSize() { + return cacheStatementsSize; + } + + public String getLoggingLevel() { + return loggingLevel; + } + + public String getDdlGeneration() { + return ddlGeneration; + } + + public String getPersistenceXMLPath() { + return persistenceXMLPath; + } + + public String getWeaving() { + return weaving; + } + + protected Properties getPersistenceUnitProperties(CommonDataSource dataSource, ClassLoader classLoader) { + Properties properties = new Properties(); + if (dataSource instanceof XADataSource) { + properties.put(PersistenceUnitProperties.JTA_DATASOURCE, (XADataSource) dataSource); + } else if (dataSource instanceof DataSource) { + properties.put(PersistenceUnitProperties.NON_JTA_DATASOURCE, (DataSource) dataSource); + } else { + LOGGER.error("no suitable datasource found"); + } + // optimizations + properties.put(PersistenceUnitProperties.DEPLOY_ON_STARTUP, deployOnStartup.toString()); + properties.put(PersistenceUnitProperties.QUERY_CACHE, queryCache.toString()); + // values are: JDBC, Buffered, Oracle-JDBC, <custom-class>, None + properties.put(PersistenceUnitProperties.BATCH_WRITING, batchWriting); + properties.put(PersistenceUnitProperties.BATCH_WRITING_SIZE, batchWritingSize.toString()); + properties.put(PersistenceUnitProperties.CACHE_STATEMENTS, cacheStatements.toString()); + properties.put(PersistenceUnitProperties.CACHE_STATEMENTS_SIZE, cacheStatementsSize.toString()); + // values are: OFF, DEBUG, INFO, ERROR + properties.put(PersistenceUnitProperties.LOGGING_LEVEL, loggingLevel); + // values are: create-tables, drop-tables, drop-and-create-tables, + // drop-and-create-tables, create-or-extend-tables, none + properties.put(PersistenceUnitProperties.DDL_GENERATION, ddlGeneration); + properties.put(PersistenceUnitProperties.CLASSLOADER, classLoader); + properties.put(PersistenceUnitProperties.ECLIPSELINK_PERSISTENCE_XML, persistenceXMLPath); + properties.put(PersistenceUnitProperties.WEAVING, weaving); + properties.put(PersistenceUnitProperties.SESSION_CUSTOMIZER, CustomCustomizer.class.getName()); + return properties; + } + + @Override + protected String _serialize() { + return name + VALUE_SEPARATOR + jndiName + VALUE_SEPARATOR + deployOnStartup + VALUE_SEPARATOR + + queryCache + VALUE_SEPARATOR + batchWriting + VALUE_SEPARATOR + batchWritingSize + VALUE_SEPARATOR + cacheStatements + + VALUE_SEPARATOR + cacheStatementsSize + VALUE_SEPARATOR + loggingLevel + VALUE_SEPARATOR + ddlGeneration + + VALUE_SEPARATOR + persistenceXMLPath + VALUE_SEPARATOR + weaving; + } + + @Override + protected AItemDescribed _deserialize(String serialized) { + String[] tokens = serialized.split(VALUE_SEPARATOR); + return new PersistenceUnitConfiguration(tokens[0], tokens[1], ItemDescription.parseBoolean(tokens[2], true), + ItemDescription.parseBoolean(tokens[3], true), tokens[4], ItemDescription.parseInt(tokens[5], 0), + ItemDescription.parseBoolean(tokens[6], true), ItemDescription.parseInt(tokens[7], 0), tokens[8], tokens[9], tokens[10], + tokens[11]); + } + + public static String serialize(Collection<PersistenceUnitConfiguration> persistenceUnits) { + String retcode = null; + if (persistenceUnits == null) { + retcode = ""; + } else { + for (PersistenceUnitConfiguration persistenceUnit : persistenceUnits) { + if (retcode == null) { + retcode = persistenceUnit._serialize(); + } else { + retcode += ITEM_SEPARATOR + persistenceUnit._serialize(); + } + } + } + return retcode; + } + + public static Map<String, PersistenceUnitConfiguration> deserialize(String value) { + Map<String, PersistenceUnitConfiguration> persistenceUnits = new TreeMap<>(); + String[] persistenceUnitItems = value.split(ITEM_SEPARATOR); + for (String persistenceUnitItem : persistenceUnitItems) { + PersistenceUnitConfiguration persistenceUnit = (PersistenceUnitConfiguration) WORKER._deserialize(persistenceUnitItem); + persistenceUnits.put(persistenceUnit.getName(), persistenceUnit); + } + return persistenceUnits; + } + + @Override + public String getIconName() { + return null; + } + + @Override + public SubItem[] getSubItems() { + return null; + } + + @Override + public String getRowName() { + return null; + } + + public static class CustomCustomizer implements SessionCustomizer { + + @Override + public void customize(Session session) throws Exception { + } + } + +} diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/Preference.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/Preference.java new file mode 100644 index 0000000..57830cb --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/Preference.java @@ -0,0 +1,91 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences; + + +public enum Preference { + // selected preference + SELECT_PRODUCT_CONFIGURATION, + SHOW_PRODUCT_CONFIGURATION, + // values for preferences + ACTIVEMQ_BROKER_PORT, + ACTIVEMQ_BROKER_SERVER, + AUTHENTICATION_LDAP_CLIENTID, + AUTHENTICATION_LDAP_DN_TEMPLATE, + AUTHENTICATION_LDAP_PORT, + AUTHENTICATION_LDAP_SERVER, + AUTHENTICATION_ADMIN_EMAIL, + AUTHENTICATION_ADMIN_USERNAME, + AUTHENTICATION_ADMIN_PASSWORD, + AUTHENTICATION_AUTOLOGIN, + AUTHENTICATION_ORGANIZATION_ID, + AUTHENTICATION_ENCRYPT_PASSWORDS, + AUTHENTICATION_NO_REMEMBER_ME, + AUTHENTICATION_MAX_LOGIN_ATTEMPS, + AUTHENTICATION_VIA_USERNAME, + EMAIL_SERVER, + EMAIL_SMTP_PORT, + EMAIL_SSL_ON_CONNECT, + BPM_ENGINE_PORT, + BPM_ENGINE_SERVER, + BPM_ENGINE_TIMEOUT, + BPM_ENGINE_HIBERNATE_SCHEMA_NAME, + BPM_ENGINE_HIBERNATE_SHOW_SQL, + BPM_ENGINE_HIBERNATE_FORMAT_SQL, + BPM_ENGINE_HIBERNATE_MAX_FETCH_DEPTH, + DATASOURCES, + PRODUCTCONFIGURATION, +// DATASOURCE_AUTHENTICATION, +// DATASOURCE_BLOB, +// DATASOURCE_BPM, +// DATASOURCE_BUSINESSDATA, + DTO_REALM_PORTAL_ID, + EXCHANGE_RATES_EURO_BASED_DAILY, + EXCHANGE_RATES_EURO_BASED_PREVIOUS, + FILE_CONTENT, + FILE_EDITOR, + FILE_LOCATION, + FILE_NAME, + HYBRID_AUTH_SERVICE_PORT, + HYBRID_REFRESH_PERSPECTIVE_ACTIVE, + HYBRID_REFRESH_PERSPECTIVE_INACTIVE, + JAVA_POS_CONFIGURATION, + LDAP_CONTEXT_FACTORY_URL, + LDAP_REALM_PORTAL_ID, + LDAP_USER_DN_TEMPLATE, + LOCALIZATION_AUTOCREATE, +// LOCALIZATION_AUTOTRANSLATE, + LOCALIZATION_SHOW_SELECT_IN_RESPECTIVE_LOCALE, +// LOCALIZATION_GOOGLE_API_KEY, +// LOCALIZATION_GOOGLE_HTTP_REFERRER, + LOCALIZATION_SUPPORTED_LANGUAGES, + PERSISTENCE_UNITS, + DEMO_TOOLS_THEME, + DEMO_TOOLS_STRATEGY, + DEMO_TOOLS_LANGUAGE, + DEMO_TOOLS_PRINTSERVICE, + PROJECT_WIZARD_ABSOLUTE_LOCATION, + PRODUCT_FILE, + DESKTOP_URL_PATH, + MOBILE_URL_PATH + ; + + public static Preference by(String name) { + for (Preference preference : values()) { + if (preference.toString().equalsIgnoreCase(name)) { + return preference; + } + } + return null; + } +} diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfiguration.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfiguration.java new file mode 100644 index 0000000..3927ed5 --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfiguration.java @@ -0,0 +1,453 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences; + +import java.util.Locale; +import java.util.Map; +import java.util.Properties; +import java.util.Set; + +import javax.sql.CommonDataSource; + +import org.eclipse.osbp.preferences.ProductConfigurationPrefs.DDL_GENERATION; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Access to the Product Configuration!<br> + * <i>For now empty configuration data will be <u>auto-generated to hit out + * internal development configuration</u>!</i> + */ +public class ProductConfiguration { + + public static final String SHIRO_DTO_REALM = ProductConfigurationPrefs.SHIRO_DTO_REALM; + public static final String SHIRO_LDAP_REALM = "LDAPRealm"; + public static final String SHIRO_STATIC_REALM = "StaticRealm"; + public static final String WORKSPACE_NAME = "Workspace"; + + @SuppressWarnings("unused") + private static final Logger LOGGER = LoggerFactory.getLogger(ProductConfiguration.class); + private static ProductConfigurationPrefs workspacePrefs = null; + private static ProductConfigurationPrefs activePrefs = null; + + public static ProductConfigurationPrefs workspacePrefs() { + if (workspacePrefs == null) { + workspacePrefs = new ProductConfigurationPrefs(WORKSPACE_NAME, new ProductInstanceScope(), true, null); + } + return workspacePrefs; + } + + public static ProductConfigurationPrefs prefs() { + if (activePrefs == null) { + activePrefs = workspacePrefs(); + } + return activePrefs; + } + + /** + * sets the flag, that the configuration has to be reloaded. Deregisters all + * watchers/listeners on preference changes due to preference dialog and + * file modification + */ + @SuppressWarnings("unused") + private static void forceReloadConfiguration() { // NOSONAR + prefs().forceReloadConfiguration(); + } + + /** + * @return <ul><li><code>false</code>, if the server name or ip is defintively non-reasonable.</li><li><code>true</code> otherwise, but it <b>does not guarantee</b> an existing or reachable server name or ip address</li></ul> + */ + public static boolean isServerReasonable(String serverNameOrIp) { + if (serverNameOrIp.contains("<") || serverNameOrIp.contains(">")) { + return false; + } + return true; + } + + /** + * @see http://www.ecb.europa.eu/stats/exchange/eurofxref/html/index.en.html + * @return URL to server with the daily Euro Foreign Exchange Reference + * Rates + */ + public static String getEuroXRefRatesURLDaily() { + return prefs().getEuroXRefRatesURLDaily(); + } + + /** + * @see http://www.ecb.europa.eu/stats/exchange/eurofxref/html/index.en.html + * @return URL to server with the previous Euro Foreign Exchange Reference + * Rates + */ + public static String getEuroXRefRatesURLPrevious() { + return prefs().getEuroXRefRatesURLPrevious(); + } + + /** + * see {@link IProductConfigurationPrefs#getEmailServerIp()} + */ + public static String getActiveMqBrokerServerName() { + return prefs().getActiveMqBrokerServerName(); + } + + /** + * see {@link IProductConfigurationPrefs#getActiveMqBrokerServerPort()} + */ + public static int getActiveMqBrokerServerPort() { + return prefs().getActiveMqBrokerServerPort(); + } + + /** + * @return milliseconds for refresher in an active hybrid ccng view + */ + public static int getHybridRefresherMilliSecsActive() { + return prefs().getHybridRefresherMilliSecsActive(); + } + + /** + * @return milliseconds for refresher in an inactive hybrid ccng view + */ + public static int getHybridRefresherMilliSecsInactive() { + return prefs().getHybridRefresherMilliSecsInactive(); + } + + /** + * @return list of name of all defined DataSources + */ + public static Set<String> getDataSourceNames() { + return prefs().getDataSourceNames(); + } + +// /** +// * @return the name of the bpm DataSource +// */ +// public static String getDataSourceNameForAuthentication() { +// return prefs().getDataSourceNameForAuthentication(); +// } +// +// /** +// * @return the name of the bpm DataSource +// */ +// public static String getDataSourceNameForBLOB() { +// return prefs().getDataSourceNameForBLOB(); +// } +// +// /** +// * @return the name of the bpm DataSource +// */ +// public static String getDataSourceNameForBPM() { +// return prefs().getDataSourceNameForBPM(); +// } +// +// /** +// * @return the name of the active DataSource +// */ +// public static String getDataSourceNameForBusinessData() { +// return prefs().getDataSourceNameForBusinessData(); +// } + + /** + * @param jndiName + * the requested DataSource + * @return the properties to define a DataSource + */ + public static Properties getDataSourceProperties(String jndiName) { + return prefs().getDataSourceProperties(jndiName); + } + + public static DataSourceConfiguration getDataSource(String jndiName) { + return prefs().getDataSource(jndiName); + } + + /** + * @param jndiName + * the requested DataSource + * @return name of the JDBC driver class + */ + public static String getDataSourceDriverClass(String jndiName) { + return prefs().getDataSourceDriverClass(jndiName); + } + + /** + * @param jndiName + * the requested DataSource + * @return the properties to define a JPA connection + */ + public static Properties getJpaProperties(String jndiName) { + return prefs().getJpaProperties(jndiName); + } + + /** + * @return list of name of all defined DataSources + */ +// public static Set<EnumDatabaseVendor> getNecessaryDataBaseVendors(Set<String> jndiNames) { +// return prefs().getNecessaryDataBaseVendors(jndiNames); +// } + + /** + * @return list of name of all defined DataSources + */ + public static Set<String> getPersistenceUnitNames() { + return prefs().getPersistenceUnitNames(); + } + + /** + * @return JNDI name for the given persistence unit + */ + public static String getPersistenceUnitJndiName(String persistenceUnitName) { + return prefs().getPersistenceUnitJndiName(persistenceUnitName); + } + + public static String getPersistenceUnitHibernateDialect(String persistenceUnitName) { + return prefs().getPersistenceUnitHibernateDialect(persistenceUnitName); + } + + public static String getJndiNameHibernateDialect(String jndiName) { + return prefs().getJndiNameHibernateDialect(jndiName); + } + + public static String getPersistenceUnitParameterizedEclipseLinkDdlGeneration(String persistenceUnitName) { + return prefs().getPersistenceUnitParameterizedEclipseLinkDdlGeneration(persistenceUnitName); + } + + /** + * @param persistenceUnitName + * @return + */ + public static String getPersistenceUnitEffectiveEclipseLinkDdlGeneration(String persistenceUnitName) { + return prefs().getPersistenceUnitEffectiveEclipseLinkDdlGeneration(persistenceUnitName); + } + + /** + * @param persistenceUnitName + * @return + */ + public static String getPersistenceUnitEffectiveHibernateDdlGeneration(String persistenceUnitName) { + return DDL_GENERATION.hibernate(prefs().getPersistenceUnitEffectiveEclipseLinkDdlGeneration(persistenceUnitName)); + } + + /** + * @param jndiName + * the requested DataSource + * @return the properties to define a DataSource + */ + public static Properties getPersistenceUnitProperties( + String persistenceUnitName, CommonDataSource dataSource, ClassLoader classLoader) { + return prefs().getPersistenceUnitProperties(persistenceUnitName, dataSource, classLoader); + } + + public static final String getAuthenticationOrganizationId() { + return prefs().getAuthenticationOrganizationId(); + } + + /** + * @return port of the RESTful authentication API, needed by the hybrid + * WebClient cxauth + */ + public static final int getAuthRESTfulPort() { + return prefs().getAuthRESTfulPort(); + } + + /** + * @return decide remember-me function performs an auto-login or not + */ + public static final boolean hasAutoLogin() { + return prefs().hasAutoLogin(); + } + + /** + * @return automatically encrypt non-encrypted passwords in userAccount + */ + public static final boolean hasEncryptPasswords() { + return prefs().hasEncryptPasswords(); + } + + /** + * @return hide remember-me function if true + */ + public static final boolean hasNoRememberMe() { + return prefs().hasNoRememberMe(); + } + + /** + * @return administrator email when login depends on email adress. default = admin@support.com + */ + public static final String getAdminEmail() { + return prefs().getAdminEmail(); + } + + public static final String getAdminEmailUsername() { + return prefs().getAdminEmailUsername(); + } + + public static final String getAdminEmailPassword() { + return prefs().getAdminEmailPassword(); + } + + /** + * @return maximum failed login attempts + */ + public static final int getMaxLoginAttempts() { + return prefs().getMaxLoginAttempts(); + } + + public static final String getProtocolDatasource() { + return prefs().getProtocolDatasource(); + } + + public static final String getProtocolUnit() { + return prefs().getProtocolUnit(); + } + + public static final boolean getIdentifyByUsername() { + return prefs().getIdentifyByUsername(); + } + + /** + * @return the corresponding INI string for all authentication realms needed + * for Shiro + */ + public static final String getShiroConfiguration(String staticRealmClassName) { + return prefs().getShiroConfiguration(staticRealmClassName); + } + + public static String getLocation() { + return prefs().getLocation(); + } + + public static Map<String, Locale> getLanguages() { + return prefs().getLanguages(); + } + + public static boolean isLanguagesAutotranslate() { + return prefs().isLanguagesAutotranslate(); + } + + public static boolean willLanguagesAutocreate() { + return prefs().willLanguagesAutocreate(); + } + + public static boolean isUomoMetricUnit() { + return prefs().isUomoMetricUnit(); + } + + public static boolean showLanguageSelectInRespectiveLocale() { + return prefs().showLanguageSelectInRespectiveLocale(); + } + + public static String getLanguagesGoogleHttpReferrer() { + return prefs().getLanguagesGoogleHttpReferrer(); + } + + public static String getLanguagesGoogleApiKey() { + return prefs().getLanguagesGoogleApiKey(); + } + + /** + * @param generator class of the requested mock data generator + * @return either null, if no entry is set, or the timestamp as String + */ + public static String isMockDataGeneratorDone(Object generator) { + return prefs().isMockDataGeneratorDone(generator); + } + + public static void setMockDataGeneratorDone(Object generator) { + prefs().setMockDataGeneratorDone(generator); + } + + public static String getBusinessBundleClassNameReadOnly() { + return prefs().getBusinessBundleClassNameReadOnly(); + } + + public static String getBpmServerIp() { + return prefs().getBpmServerIp(); + } + + /** + * see {@link IProductConfigurationPrefs#getBpmServerPort()} + */ + public static int getBpmServerPort() { + return prefs().getBpmServerPort(); + } + + public static int getBpmResponseTimeout() { + return prefs().getBpmResponseTimeout(); + } + + public static boolean isBpmEngineHibernateShowSql() { + return prefs().isBpmEngineHibernateShowSql(); + } + + public static boolean isBpmEngineHibernateFormatSql() { + return prefs().isBpmEngineHibernateFormatSql(); + } + + public static int getBpmEngineHibernateMaxFetchDepth() { + return prefs().getBpmEngineHibernateMaxFetchDepth(); + } + + public static String getBpmEnginePersistenceUnit() { + return prefs().getBpmEnginePersistenceUnit(); + } + + public static String getBpmEngineHibernateSchemaName(String persistenceUnit) { + return prefs().getBpmEngineHibernateSchemaName(persistenceUnit); + } + + /** + * @return show theme tool control if true + */ + public static boolean hasDemoToolsTheme() { + return prefs().hasDemoToolsTheme(); + } + + /** + * @return show strategy tool control if true + */ + public static boolean hasDemoToolsStrategy() { + return prefs().hasDemoToolsStrategy(); + } + + /** + * @return show langauge tool control if true + */ + public static boolean hasDemoToolsLanguage() { + return prefs().hasDemoToolsLanguage(); + } + + public static boolean hasToolsPrintService() { + return prefs().hasToolsPrintService(); + } + + public static boolean projectWizardUsesAbsoluteLocation() { + return prefs().projectWizardUsesAbsoluteLocation(); + } + + /** + * see {@link IProductConfigurationPrefs#getEmailServerIp()} + */ + public static String getEmailServerIp() { + return prefs().getEmailServerIp(); + } + + public static int getEmailSmtpPort() { + return prefs().getEmailSmtpPort(); + } + + public static boolean isEmailUseSslOnConnect() { + return prefs().isEmailUseSslOnConnect(); + } + + public static String getJavaPosConfiguration() { + return prefs().getJavaPosConfiguration(); + } +} diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfigurationDefaultPrefs.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfigurationDefaultPrefs.java new file mode 100644 index 0000000..a992fd5 --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfigurationDefaultPrefs.java @@ -0,0 +1,591 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.TreeMap; + +import org.eclipse.core.resources.IProject; +import org.eclipse.persistence.config.PersistenceUnitProperties; + +/** + * Access to the Product Configuration!<br> + * <i>For now empty configuration data will be <u>auto-generated to hit out + * internal development configuration</u>!</i> + */ +public class ProductConfigurationDefaultPrefs implements IProductConfigurationPrefs { + + public final static String BPM_ENGINE_PERSISTENCE_UNIT = "bpm"; + + public String getBusinessBundleClassNameReadOnly() { + return ""; + } + + private Map<String, DataSourceConfiguration> dataSources = new HashMap<>(); + private Map<String, PersistenceUnitConfiguration> persistenceUnits = new HashMap<>(); + + public ProductConfigurationDefaultPrefs() { + initializeIfNotExists ("oracle", "oracle", //ProductConfigurationPrefs.DATASOURCE_FOR_BUSINESSDATA, + EnumDatabaseVendor.ORACLE, "<ip-or-host>", 1521, "<database>", "<username>", "<password>"); + /* === datasource using a MySQL database === */ + initializeIfNotExists ("mysql", null, + EnumDatabaseVendor.MYSQL, "<ip-or-host>", 3306, "<database>", "<username>", ""); + /* === datasource using a H2 in-Memory database === */ + initializeIfNotExists (ProductConfigurationPrefs.DEFAULT_H2MEMORY_DATASOURCE, null, + EnumDatabaseVendor.H2_IN_MEMORY, null, -1, "H2MEMORY", "H2MEMORY", "H2MEMORY"); // NOSONAR + /* === datasource using a H2 local-file database === */ + initializeIfNotExists (ProductConfigurationPrefs.DEFAULT_H2LOCALFILE_DATASOURCE, null, + EnumDatabaseVendor.H2_LOCAL_FILE, null, -1, "H2LOCALFILE", "H2LOCALFILE", "H2LOCALFILE"); + /* === datasource using a Derby in-Memory database === */ + initializeIfNotExists (ProductConfigurationPrefs.DEFAULT_DERBYMEMORY_DATASOURCE, null, + EnumDatabaseVendor.DERBY_IN_MEMORY, null, -1, "DERBYMEMORY", "DERBYMEMORY", "DERBYMEMORY"); + /* === datasource using a Derby local-file database === */ + initializeIfNotExists (ProductConfigurationPrefs.DEFAULT_DERBYLOCALFILE_DATASOURCE, null, + EnumDatabaseVendor.DERBY_LOCAL_FILE, null, -1, "DERBYLOCALFILE", "DERBYLOCALFILE", "DERBYLOCALFILE"); + /* === datasource using a Derby database === */ + initializeIfNotExists (ProductConfigurationPrefs.DEFAULT_DERBYSERVER_DATASOURCE, null, + EnumDatabaseVendor.DERBY_CLIENT, "<ip-or-host>", 1527, "<database>", "<username>", "<password>"); + + // --- generate reasonable default preferences for development product + initializeIfNotExists (ProductConfigurationPrefs.PERSISTENCE_UNIT_AUTHENTICATION, + ProductConfigurationPrefs.DEFAULT_DATASOURCE_FOR_AUTHENTICATION, true, true, + null, 1000, + true, 200, + "off", "create-or-extend-tables", // NOSONAR + PersistenceUnitProperties.ECLIPSELINK_PERSISTENCE_XML_DEFAULT); + initializeIfNotExists (ProductConfigurationPrefs.PERSISTENCE_UNIT_BLOB, + ProductConfigurationPrefs.DEFAULT_DATASOURCE_FOR_BLOB, true, true, + null, 1000, + true, 200, + "off", "create-or-extend-tables", + PersistenceUnitProperties.ECLIPSELINK_PERSISTENCE_XML_DEFAULT); + initializeIfNotExists (ProductConfigurationPrefs.PERSISTENCE_UNIT_BPM, + ProductConfigurationPrefs.DEFAULT_DATASOURCE_FOR_BPM, true, true, + null, 1000, + true, 200, + "off", "update", + PersistenceUnitProperties.ECLIPSELINK_PERSISTENCE_XML_DEFAULT); + initializeIfNotExists (ProductConfigurationPrefs.PERSISTENCE_UNIT_BUSINESSDATA, + ProductConfigurationPrefs.DEFAULT_DATASOURCE_FOR_BUSINESSDATA, true, true, + null, 1000, + true, 200, + "off", "create-or-extend-tables", + PersistenceUnitProperties.ECLIPSELINK_PERSISTENCE_XML_DEFAULT); + } + + private void initializeIfNotExists( + String dataSource, String dataSourceConsumer, EnumDatabaseVendor vendor, + String serverName, int serverPort, + String database, String username, String password) { + String vendorName = vendor.name(); + String driverVendor = vendor.getDriverVendor(); + String driverType = vendor.getDriverType(); + String driverClass = vendor.getDriverClass(); + if (!driverClass.isEmpty() && + !database.isEmpty() && !username.isEmpty()) { + DataSourceConfiguration configuration = new DataSourceConfiguration( + dataSource, + vendor, + driverVendor, driverType, driverClass, + serverName, + serverPort, + database, username, password, + ""); + dataSources.put(dataSource, configuration); + } + } + + private void initializeIfNotExists(String persistenceUnit, + String dataSource, boolean deployOnStartup, boolean queryCache, + String batchWriting, int batchWritingSize, boolean cacheStatements, int cacheStatementsSize, + String loggingLevel, String dllGeneration, String xmlPath) { // NOSONAR + DataSourceConfiguration dataSourceConfiguration = dataSources.get(dataSource); + if ((batchWriting == null) && (dataSourceConfiguration != null)) { + batchWriting = dataSourceConfiguration.getDefaultBatchWriting(); + } + PersistenceUnitConfiguration configuration = new PersistenceUnitConfiguration( + persistenceUnit, + dataSource, deployOnStartup, + queryCache, batchWriting, batchWritingSize, + cacheStatements, cacheStatementsSize, loggingLevel, + dllGeneration, xmlPath, "static"); + persistenceUnits.put(persistenceUnit, configuration); + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getBpmServerIp() + */ + @Override + public String getBpmServerIp() { + return "127.0.0.1"; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getBpmServerPort() + */ + @Override + public int getBpmServerPort() { + return DEFAULT_PORT_BPM_ENGINE; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getBpmResponseTimeout() + */ + @Override + public int getBpmResponseTimeout() { + return 10000; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getEuroXRefRatesURLDaily() + */ + @Override + public String getEuroXRefRatesURLDaily() { + return "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getEuroXRefRatesURLPrevious() + */ + @Override + public String getEuroXRefRatesURLPrevious() { + return "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.xml"; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getActiveMqBrokerServerName() + */ + @Override + public String getActiveMqBrokerServerName() { + return "<ActiveMqBrokerServerIp>"; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getActiveMqBrokerServerPort() + */ + @Override + public int getActiveMqBrokerServerPort() { + return DEFAULT_PORT_ACTIVE_MQ_BROKER_SERVICE; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getHybridRefresherMilliSecsActive() + */ + @Override + public int getHybridRefresherMilliSecsActive() { + return 2000; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getHybridRefresherMilliSecsInactive() + */ + @Override + public int getHybridRefresherMilliSecsInactive() { + return 10000; + } + +// public Collection<DataSourceConfiguration> getDataSources() { +// return dataSources.values(); +// } + +// public Set<String> getDataSourceNames() { +// return dataSources.keySet(); +// } + +// /* (non-Javadoc) +// * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getDataSourceNameForAuthentication() +// */ +// @Override +// public String getDataSourceNameForAuthentication() { +// return ProductConfigurationPrefs.DEFAULT_DATASOURCE_FOR_AUTHENTICATION; +// } +// +// /* (non-Javadoc) +// * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getDataSourceNameForBLOB() +// */ +// @Override +// public String getDataSourceNameForBLOB() { +// return ProductConfigurationPrefs.DEFAULT_DATASOURCE_FOR_BLOB; +// } +// +// /* (non-Javadoc) +// * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getDataSourceNameForBPM() +// */ +// @Override +// public String getDataSourceNameForBPM() { +// return ProductConfigurationPrefs.DEFAULT_DATASOURCE_FOR_BPM; +// } +// +// /* (non-Javadoc) +// * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getDataSourceNameForBusinessData() +// */ +// @Override +// public String getDataSourceNameForBusinessData() { +// return ProductConfigurationPrefs.DEFAULT_DATASOURCE_FOR_BUSINESSDATA; +// } + +// public Properties getDataSourceProperties(String jndiName) { +// DataSourceConfiguration jndi = getDataSource(jndiName); +// return (jndi == null) ? null : jndi.getDataSourceProperties(); +// } + +// public DataSourceConfiguration getDataSource(String jndiName) { +// return dataSources.get(jndiName); +// } + +// public String getDataSourceDriverClass(String jndiName) { +// DataSourceConfiguration jndi = dataSources.get(jndiName); +// return (jndi == null) ? null : jndi.getDriverClass(); +// } + +// public Properties getJpaProperties(String jndiName) { +// DataSourceConfiguration jndi = dataSources.get(jndiName); +// return (jndi == null) ? null : jndi.getJpaProperties(); +// } + +// public Collection<PersistenceUnitConfiguration> getPersistenceUnits() { +// return persistenceUnits.values(); +// } + +// public Set<String> getPersistenceUnitNames() { +// return persistenceUnits.keySet(); +// } + +// public String getPersistenceUnitJndiName(String persistenceUnitName) { +// return persistenceUnits.get(persistenceUnitName).getJndiName(); +// } + +// public String getPersistenceUnitSchemaName(String persistenceUnitName) { +// return persistenceUnits.get(persistenceUnitName).getSchemaName(); +// } + +// public String getPersistenceUnitHibernateDialect(String persistenceUnitName) { +// return getJndiNameHibernateDialect(getPersistenceUnitJndiName(persistenceUnitName)); +// } + +// public String getJndiNameHibernateDialect(String jndiName) { +// DataSourceConfiguration jndi = dataSources.get(jndiName); +// return (jndi == null) ? null : jndi.getDatabaseVendor().getHibernateDialect(); +// } + +// public Properties getPersistenceUnitProperties( +// String persistenceUnitName, CommonDataSource dataSource, ClassLoader classLoader) { +// if (persistenceUnits.containsKey(persistenceUnitName)) { +// return persistenceUnits.get(persistenceUnitName) +// .getPersistenceUnitProperties(dataSource, classLoader); +// } +// return null; +// } + + public final String getAuthenticationOrganizationId() { + return "FoodMart"; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getAuthRESTfulPort() + */ + @Override + public final int getAuthRESTfulPort() { + return 8554; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#hasAutoLogin() + */ + @Override + public final boolean hasAutoLogin() { + return false; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#hasEncryptPasswords() + */ + @Override + public final boolean hasEncryptPasswords() { + return true; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#hasNoRememberMe() + */ + @Override + public final boolean hasNoRememberMe() { + return false; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getDtoRealmPortalId() + */ + @Override + public final int getDtoRealmPortalId() { + return 1; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getLdapRealmPortalId() + */ + @Override + public final int getLdapRealmPortalId() { + return 1; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getLdapContextFactoryUrl() + */ + @Override + public final String getLdapContextFactoryUrl() { + return "ldap://<ldapserver>:389"; // NOSONAR + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getLdapUserDnTemplate() + */ + @Override + public final String getLdapUserDnTemplate() { + return "cn={0},ou=users,dc=<organisation>,dc=<countrycode>"; // NOSONAR + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getAdminEmail() + */ + @Override + public final String getAdminEmail() { + return "admin@support.com"; + } + + @Override + public final String getAdminEmailUsername() { + return ""; + } + + @Override + public final String getAdminEmailPassword() { + return ""; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getMaxLoginAttempts() + */ + @Override + public final int getMaxLoginAttempts() { + return 3; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getProtocolDatasource() + */ + @Override + public final String getProtocolDatasource() { + return ""; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getProtocolUnit() + */ + @Override + public final String getProtocolUnit() { + return ""; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getIdentifyByUsername() + */ + @Override + public final boolean getIdentifyByUsername() { + return true; + } + +// public final String getShiroConfiguration(String staticRealmClassName) { +// String mainSection = "[main]" + IShiroConfiguration.INI_NEWLINE; +// String realms = ""; +// if (!shiros.containsKey(ProductConfiguration.SHIRO_STATIC_REALM)) { +// shiros.put(ProductConfiguration.SHIRO_STATIC_REALM, new StaticConfiguration(staticRealmClassName, 1)); +// } +// for (String name : shiros.keySet()) { +// mainSection += shiros.get(name).getShiroConfiguration(name); +// if (!realms.isEmpty()) { +// realms += ","; +// } +// realms += "$" + name; +// } +// mainSection += "securityManager.realms = " + realms + IShiroConfiguration.INI_NEWLINE; +// return mainSection; +// } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getLanguages() + */ + @Override + public Map<String, Locale> getLanguages() { + Map<String, Locale> languages = new TreeMap<>(); + Locale[] supported = new Locale[] { + Locale.GERMAN, + Locale.ENGLISH, + Locale.FRENCH, + new Locale("de", "AT"), + Locale.US + }; + for (Locale locale : supported) { + languages.put(locale.toString(), locale); + } + return languages; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#isLanguagesAutotranslate() + */ + @Override + public boolean isLanguagesAutotranslate() { + return false; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#willLanguagesAutocreate() + */ + @Override + public boolean willLanguagesAutocreate() { + return true; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#isUomoMetricUnit() + */ + @Override + public boolean isUomoMetricUnit() { + return true; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#showLanguageSelectInRespectiveLocale() + */ + @Override + public boolean showLanguageSelectInRespectiveLocale() { + return true; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getLanguagesGoogleHttpReferrer() + */ + @Override + public String getLanguagesGoogleHttpReferrer() { + return ""; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#getLanguagesGoogleApiKey() + */ + @Override + public String getLanguagesGoogleApiKey() { + return ""; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#hasDemoToolsTheme() + */ + @Override + public final boolean hasDemoToolsTheme() { + return true; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#hasDemoToolsStrategy() + */ + @Override + public final boolean hasDemoToolsStrategy() { + return true; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#hasDemoToolsLanguage() + */ + @Override + public final boolean hasDemoToolsLanguage() { + return true; + } + + @Override + public boolean hasToolsPrintService() { + return true; + } + + /* (non-Javadoc) + * @see org.eclipse.osbp.preferences.IProductConfigurationPrefs#projectWizardUsesAbsoluteLocation() + */ + @Override + public final boolean projectWizardUsesAbsoluteLocation() { + return true; + } + + @Override + public Collection<DataSourceConfiguration> getDataSources() { + return dataSources.values(); + } + + @Override + public Collection<PersistenceUnitConfiguration> getPersistenceUnits() { + return persistenceUnits.values(); + } + + @Override + public boolean isBpmEngineHibernateShowSql() { + return false; + } + + @Override + public boolean isBpmEngineHibernateFormatSql() { + return false; + } + + @Override + public int getBpmEngineHibernateMaxFetchDepth() { + return 3; + } + + @Override + public String getBpmEnginePersistenceUnit() { + return BPM_ENGINE_PERSISTENCE_UNIT; + } + + @Override + public String getBpmEngineHibernateSchemaName(String persistenceUnit) { + return "BPM"; + } + + @Override + public IProject getProject() { + return null; + } + + @Override + public String getEmailServerIp() { + return "<EmailServerIp>"; + } + + @Override + public int getEmailSmtpPort() { + return DEFAULT_PORT_EMAIL_SMTP; + } + + @Override + public boolean isEmailUseSslOnConnect() { + return false; + } + + @Override + public String getJavaPosConfiguration() { + return ""; + } +} diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfigurationPrefs.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfigurationPrefs.java new file mode 100644 index 0000000..a79db46 --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductConfigurationPrefs.java @@ -0,0 +1,2059 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences; + +import java.io.File; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Comparator; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; + +import javax.sql.CommonDataSource; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; +import org.eclipse.core.internal.preferences.EclipsePreferences; +import org.eclipse.core.internal.preferences.InstancePreferences; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IWorkspace; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.preferences.ConfigurationScope; +import org.eclipse.core.runtime.preferences.IEclipsePreferences; +import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener; +import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; +import org.eclipse.core.runtime.preferences.IPreferenceNodeVisitor; +import org.eclipse.core.runtime.preferences.IScopeContext; +import org.eclipse.persistence.config.PersistenceUnitProperties; +import org.osgi.service.prefs.BackingStoreException; +import org.osgi.service.prefs.Preferences; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +class StringComparator implements Comparator<String> { + @Override + public int compare(String arg0, String arg1) { + return arg0.compareTo(arg1); + } +} + +/** + * Access to the Product Configuration!<br> + * <i>For now empty configuration data will be <u>auto-generated to hit our + * internal development configuration</u>!</i> + */ +public class ProductConfigurationPrefs implements IProductConfigurationPrefs { + + public static enum DDL_GENERATION { + CREATE ("create-tables", "create"), + DROP_CREATE ("drop-and-create-tables", "create"), + UPDATE ("create-or-extend-tables", "update"), + NONE ("none", "validate"); + + private final String eclipseLink; + private final String hibernate; + + private DDL_GENERATION(String eclipseLink, String hibernate) { + this.eclipseLink = eclipseLink; + this.hibernate = hibernate; + } + + public String eclipseLink() { + return eclipseLink; + } + + public String hibernate() { + return hibernate; + } + + public static String hibernate(String eclipseLink) { + for (DDL_GENERATION step : values()) { + if (step.eclipseLink.equals(eclipseLink)) { + return step.hibernate; + } + } + return NONE.hibernate; + } + } + + public Set<EnumDatabaseVendor> getNecessaryDataBaseVendors() { + TreeSet<EnumDatabaseVendor> result = new TreeSet<EnumDatabaseVendor>(); + for (String pu : getPersistenceUnitNames()) { + addNecessaryDataBaseVendor(result, getPersistenceUnitJndiName(pu)); + } + return result; + } + + public Set<EnumDatabaseVendor> getNecessaryDataBaseVendors(String... jndiNames) { + TreeSet<EnumDatabaseVendor> result = new TreeSet<EnumDatabaseVendor>(); + for (String jndiName : jndiNames) { + addNecessaryDataBaseVendor(result, jndiName); + } + return result; + } + +// public Set<EnumDatabaseVendor> getNecessaryDataBaseVendors(Collection<String> jndiNames) { +// return getNecessaryDataBaseVendors(jndiNames.toArray(new String[0])); +// } + +// public Set<EnumDatabaseVendor> getNecessaryDataBaseVendors(String... jndiNames) { +// TreeSet<EnumDatabaseVendor> result = new TreeSet<EnumDatabaseVendor>(); +// for (String jndiName : jndiNames) { +// addNecessaryDataBaseVendor(result, jndiName); +// } +// return result; +// } + + private void addNecessaryDataBaseVendor(TreeSet<EnumDatabaseVendor> result, String jndiName) { + DataSourceConfiguration ds = getDataSource(jndiName); + if (ds != null) { + result.add(ds.getDatabaseVendor()); + } + } + + /* ========================= variables =========================== */ + + private String businessBundleClassNameReadOnly; + private String euroForeignExchangeReferenceRatesURLDaily; + private String euroForeignExchangeReferenceRatesURLPrevious; + private int authRESTfulApiPort = 0; + private int maxLoginAttempts = 0; + private String protocolDatasource; + private String protocolUnit; + private boolean identifyByUsername = true; + private boolean autoLogin = false; + private boolean encryptPasswords = true; + private boolean noRememberMe = false; + private String adminEmail = ""; + private String adminEmailUsername = ""; + private String adminEmailPassword = ""; + private String activeMqBrokerServerName; + private int activeMqBrokerServerPort; + private int hybridRefresherMilliSecsActive; + private int hybridRefresherMilliSecsInactive; + private Map<String, IShiroConfiguration> shiros = new HashMap<>(); + private String dataSourceForAuthentication = DEFAULT_DATASOURCE_FOR_AUTHENTICATION; + private String dataSourceForBLOB = DEFAULT_DATASOURCE_FOR_BLOB; + private String dataSourceForBPM = DEFAULT_DATASOURCE_FOR_BPM; + private String dataSourceForBusinessData = DEFAULT_DATASOURCE_FOR_BUSINESSDATA; + private Map<String, DataSourceConfiguration> dataSources = new HashMap<>(); + private Map<String, PersistenceUnitConfiguration> persistenceUnits = new HashMap<>(); + private Map<String, Locale> languages = new TreeMap<>(new StringComparator()); + private boolean languagesAutotranslate; + private boolean languagesAutocreate; + private boolean uomoMetricUnit; + private boolean showLanguageSelectInRespectiveLocale; + private String languagesGoogleHttpReferrer; + private String languagesGoogleApiKey; + private String bpmServerIp; + private int bpmServerPort; + private int bpmResponseTimeout; + private boolean bpmHibernateShowSql; + private boolean bpmHibernateFormatSql; + private int bpmHibernateMaxFetchDepth; + private String bpmHibernateSchemaName; + private boolean demoToolsTheme; + private boolean demoToolsStrategy; + private boolean demoToolsLanguage; + private boolean demoToolsPrintService; + private boolean projectWizardAbsoluteLocation; + + /* ========================= internal utilities =========================== */ + + public static final String PREFERENCES_PATH = "/.metadata/.plugins/org.eclipse.core.runtime/"+EclipsePreferences.DEFAULT_PREFERENCES_DIRNAME+"/"; + public static final String PRODUCT_PREFERENCES = "org.eclipse.osbp.production"; + public static final String PREFERENCES_FULL_PATH = PREFERENCES_PATH+PRODUCT_PREFERENCES+"."+EclipsePreferences.PREFS_FILE_EXTENSION; + + private static final Logger LOGGER = LoggerFactory.getLogger(ProductConfigurationPrefs.class); + private boolean forceInitialize = true; + private final IScopeContext scopeContext; + /** listener triggered by preference changed due to user actions inside preference dialog */ + private final IPreferenceChangeListener preferenceChangedListener; + private final IProject project; + private final String name; + + private final IProductConfigurationPrefs defaultPrefs; + private String authenticationOrganizationId; + private String emailServerIp; + private Integer emailSmtpPort; + private Boolean emailUseSslOnConnect; + private String javaPosConfiguration; + + public static final String BUSINESS_BUNDLE_CLASS_NAME = "BUSINESS_BUNDLE_CLASS_NAME_read_only"; + + /* ========================= languages initializer =========================== */ + + private static final String LANGUAGES_NODE = "languages"; + private static final String LANGUAGES_SUPPORTED = "languages.supported"; + private static final String LANGUAGES_AUTOTRANSLATE = "languages.autotranslate"; + private static final String LANGUAGES_AUTOCREATE = "languages.autocreate"; + private static final String LANGUAGES_SHOW_SELECT_IN_RESPECTIVE_LOCALE = "lanuages.selectInRespectiveLocales"; + // See: + // http://code.google.com/apis/language/translate/v2/getting_started.html + private static final String LANGUAGES_GOOGLE_HTTP_REFERRER = "languages.google_http_referrer"; + private static final String LANGUAGES_GOOGLE_API_KEY = "languages.google_api_key"; + + private static final String LANGUAGES_LANGUAGE = "language"; + private static final String LANGUAGES_COUNTRY = "country"; + private static final String LANGUAGES_VARIANT = "variant"; + + /* ========================= uomounit initializer =========================== */ + + private static final String UOMOUNIT_NODE = "uomoUnits"; + + private static final String UOMOUNIT_METRIC = "uomoUnitMetric"; + + /* ========================= xref rates initializer =========================== */ + + private static final String EURO_X_REF_URL_NODE = "euroxrefurl"; + private static final String EURO_X_REF_URL_DAILY = "daily"; + private static final String EURO_X_REF_URL_PREVIOUS = "previous"; + + /* ========================= JavaPOS initializer =========================== */ + + private static final String JAVA_POS_NODE = "javaPOS"; + private static final String JAVA_POS_CONFIGURATION = "javaPosConfiguration"; + + /* ========================= authentication initializer =========================== */ + + public static final String AUTHENTICATION_NODE = "authentication"; + private static final String AUTH_RESTFUL_PORT = "authRESTfulPort"; + private static final String AUTHENTICATION_AUTOLOGIN = "autoLogin"; + private static final String AUTHENTICATION_ORGANIZATION_ID = "organizationId"; + public static final String AUTHENTICATION_ENCRYPT_PASSWORDS = "encryptPasswords"; + private static final String AUTHENTICATION_HIDE_REMEMBER_ME = "noRememberMe"; + private static final String AUTHENTICATION_ADMIN_EMAIL_ACCOUNT = "adminEmail"; + private static final String AUTHENTICATION_ADMIN_EMAIL_USERNAME = "adminEmailUsername"; + private static final String AUTHENTICATION_ADMIN_EMAIL_PASSWORD = "adminEmailPassword"; + + /* ========================= email initializer =========================== */ + + public static final String EMAIL_NODE = "emailService"; + private static final String EMAIL_SERVER_IP = "serverIp"; + private static final String EMAIL_SMTP_PORT = "smtpPort"; + private static final String EMAIL_USE_SSL_ON_CONNECT = "sslOnConnect"; + + /* ========================= authentication initializer =========================== */ + + private static final String ACTIVEMQBROKER_NODE = "activeMqBroker"; + private static final String ACTIVEMQBROKER_SERVER = "server"; + private static final String ACTIVEMQBROKER_PORT = "port"; + + /* ========================= hybrid connection initializer =========================== */ + + private static final String HYBRID_NODE = "hybrid"; + private static final String HYBRID_REFRESHER_MILLISECS_ACTIVE = "refresherMilliSecsActive"; + private static final String HYBRID_REFRESHER_MILLISECS_INACTIVE = "refresherMilliSecsInactive"; + /* ========================= hybrid connection initializer =========================== */ + + public static final String SHIRO_NODE = "shiro"; + public static final String SHIRO_DTO_REALM = "DTORealm"; + public static final String SHIRO_LDAP_REALM = "LDAPRealm"; + public static final String SHIRO_MAX_LOGIN_ATTEMPTS = "maxLoginAttempts"; + public static final String SHIRO_PROTOCOL_DATASOURCE = "datasource"; + public static final String SHIRO_PROTOCOL_UNIT = "persistenceunit"; + public static final String SHIRO_IDENTIFY_BY_USERNAME = "identifyByUsername"; + + public static final String SHIRO_DTO_REALM_CLASS = "org.eclipse.osbp.authentication.shiro.extensions.DTORealm"; + public static final String SHIRO_LDAP_REALM_CLASS = "org.eclipse.osbp.authentication.shiro.extensions.LDAPRealm"; + + private static final String DTO_PORTAL_ID = "portalId"; + private static final String LDAP_PORTAL_ID = "portalId"; + private static final String LDAP_URL = "contextFactoryUrl"; + private static final String LDAP_USERDNTEMPLATE = "userDnTemplate"; + + /* ========================= data source initializer =========================== */ + + public static final String DEFAULT_H2MEMORY_DATASOURCE = "h2memory"; + public static final String DEFAULT_H2LOCALFILE_DATASOURCE = "h2localfile"; + + public static final String DEFAULT_DERBYLOCALFILE_DATASOURCE = "derbylocalfile"; + public static final String DEFAULT_DERBYMEMORY_DATASOURCE = "derbymemory"; + public static final String DEFAULT_DERBYSERVER_DATASOURCE = "derbyserver"; + + private static final String DEFAULT_INITIAL_DATASOURCE = "oracle"; // DEFAULT_H2MEMORY_DATASOURCE; // "oracle"; + + public static final String DEFAULT_DATASOURCE_FOR_AUTHENTICATION = DEFAULT_INITIAL_DATASOURCE; + public static final String DEFAULT_DATASOURCE_FOR_BLOB = DEFAULT_INITIAL_DATASOURCE; + public static final String DEFAULT_DATASOURCE_FOR_BPM = DEFAULT_INITIAL_DATASOURCE; + public static final String DEFAULT_DATASOURCE_FOR_BUSINESSDATA = DEFAULT_INITIAL_DATASOURCE; + + private static final String DATASOURCE_NODE = "datasource"; +// public static final String DATASOURCE_FOR_AUTHENTICATION = "datasource.authentication"; +// public static final String DATASOURCE_FOR_BLOB = "datasource.blob"; +// public static final String DATASOURCE_FOR_BPM = "datasource.bpm"; +// public static final String DATASOURCE_FOR_BUSINESSDATA = "datasource.businessdata"; + private static final String DATASOURCE_ENUM_ITEM = "enum.item"; + private static final String DATASOURCE_DRIVER_VENDOR = "driver.vendor"; + private static final String DATASOURCE_DRIVER_TYPE = "driver.type"; + private static final String DATASOURCE_DRIVER_CLASS = "driver.class"; + private static final String DATASOURCE_SERVER_NAME = "server.name"; + private static final String DATASOURCE_SERVER_PORT = "server.port"; + private static final String DATASOURCE_DATABASE_NAME = "database.name"; + private static final String DATASOURCE_DATABASE_USER = "database.user"; + private static final String DATASOURCE_DATABASE_PASS = "database.pass"; + private static final String DATASOURCE_JDBC_URL_FORMAT = "database.jdbcUrlFormat"; + + /* ========================= bpm unit initializer =========================== */ + + public static final String BPM_NODE = "bpmEngine"; + private static final String BPM_SERVER_IP = "serverIp"; + private static final String BPM_SERVER_PORT = "serverPort"; + private static final String BPM_RESPONSE_TIMEOUT = "responseTimeout"; + private static final String BPM_HIBERNATE_SHOW_SQL = "hibernateShowSql"; + private static final String BPM_HIBERNATE_FORMAT_SQL = "hibernateFormatSql"; + private static final String BPM_HIBERNATE_MAX_FETCH_DEPTH = "hibernateMaxFetchDepth"; + private static final String BPM_HIBERNATE_SCHEMA_NAME = "hibernateSchemaName"; + + /* ========================= persistence unit initializer =========================== */ + + public static final String PERSISTENCE_UNIT_AUTHENTICATION = "authentication"; + public static final String PERSISTENCE_UNIT_BLOB = "blob"; + public static final String PERSISTENCE_UNIT_BPM = "bpm"; + public static final String PERSISTENCE_UNIT_BUSINESSDATA = "businessdata"; + + private static final String PERSISTENCE_NODE = "persistenceUnit"; + private static final String PERSISTENCE_DATASOURCE = "jndiName"; + private static final String PERSISTENCE_DEPLOYONSTARTUP = "deployOnStartup"; + private static final String PERSISTENCE_QUERYCACHE = "queryCache"; + private static final String PERSISTENCE_BATCHWRITING = "batchWriting"; + private static final String PERSISTENCE_BATCHWRITINGSIZE = "batchWritingSize"; + private static final String PERSISTENCE_CACHESTATEMENTS = "cacheStatements"; + private static final String PERSISTENCE_CACHESTATEMENTSSIZE = "cacheStatementsSize"; + private static final String PERSISTENCE_LOGGINGLEVEL = "loggingLevel"; + private static final String PERSISTENCE_DDLGENERATION = "ddlGeneration"; + private static final String PERSISTENCE_PERSISTENCEXMLPATH = "persistenceXMLPath"; + private static final String PERSISTENCE_WEAVING = "weaving"; + + /* ========================= image bundle initializer =========================== */ + + private static final String IMAGES_NODE = "images"; + private static final String IMAGES_BUNDLE_ID = "bundle.id"; + private static final String IMAGES_RELATIVE_PATH = "relative.path"; + + /* ========================= mock data generator initializer =========================== */ + + private static final String MOCK_DATA_GENERATORS_DONE = "mockDataGeneratorsDone"; + /* ========================= project wizard initializer =========================== */ + + private static final String PROJECT_WIZARD_NODE = "projectWizard"; + private static final String PROJECT_WIZARD_ABSOLUTE_LOCATION = "absoluteLocation"; + /* ========================= demo settings initializer =========================== */ + private static final String DEMO_NODE = "demo"; + private static final String DEMO_TOOLS_THEME = "demoToolsTheme"; + private static final String DEMO_TOOLS_STRATEGY = "demoToolsStrategy"; + private static final String DEMO_TOOLS_LANGUAGE = "demoToolsLanguage"; + private static final String DEMO_TOOLS_PRINTSERVICE = "toolsPrintService"; + + public ProductConfigurationPrefs(String name, IScopeContext scopeContext, boolean watchRegister, IProject project) { + defaultPrefs = new ProductConfigurationDefaultPrefs(); + this.scopeContext = scopeContext; + this.name = name; + this.project = project; + if (watchRegister) { + preferenceChangedListener = new IPreferenceChangeListener() { + @Override + public void preferenceChange(PreferenceChangeEvent event) { + forceReloadConfiguration(); + } + }; + } + else { + preferenceChangedListener = null; + } + LOGGER.trace(getInformation()+" # constructed"); + } + + public ProductConfigurationPrefs(String name, IScopeContext scopeContext, IProject project) { + this(name, scopeContext, false, project); + } + + public ProductConfigurationPrefs(String name, IScopeContext scopeContext) { + this(name, scopeContext, false, null); + } + + public IProject getProject() { + if (project instanceof IProject) { + return project; + } + else { + return null; + } + } + + public IPath getProjectPath() { + if (getProject() instanceof IProject) { + return getProject().getLocation(); + } + else { + return null; + } + } + + public static String getCloneWorkspaceProductConfiguration() { + Set<String> serialized = new TreeSet<>(); + serialize(ProductConfiguration.workspacePrefs().getProductPreferences(), "", serialized); + Set<String> result = new TreeSet<>(); + for (String item : serialized) { + if (!item.startsWith("persistenceUnit") && + !item.startsWith("datasource.") && + !item.startsWith("shiro/datasource") && + !item.startsWith("shiro/persistenceunit") + ) { + result.add(item); + } + } + return StringUtils.join(result, "\n"); + } + + private static void serialize(Preferences node, String prefix, Set<String> result) { + if (node != null) { + try { + for (String child : node.childrenNames()) { + serialize(node.node(child), prefix+child+"/", result); + } + for (String key : node.keys()) { + result.add(prefix+key+"="+node.get(key, "").replace("=", "\\=").replace(":", "\\:")); + } + } + catch (BackingStoreException e) { + LOGGER.error("serializing product configuration", e); + } + } + } + + public static IResource getPrefsFile(IProject project) { + IResource prefsFile = project.findMember(PREFERENCES_FULL_PATH); + try { + for (IResource resource : project.members()) { + if ((resource instanceof IFile) && "product".equals(resource.getFileExtension())) { + try { + String[] tokens = IOUtils.toString(((IFile)resource).getContents()).split("-DproductConfigurationFile="); + if (tokens.length > 1) { + String filePath = tokens[1].replace('\r', ' ').replace('\n', ' ').replace('\t', ' ').split(" ")[0].replace("DEFAULTFILE", PREFERENCES_FULL_PATH); + File handle = new File(filePath); + if (handle.exists()) { + String fileName = handle.getAbsolutePath(); + IWorkspace space = ResourcesPlugin.getWorkspace(); + IWorkspaceRoot root=space.getRoot(); + try { // NOSONAR + IFile[] resources = root.findFilesForLocationURI(new File(fileName).toURI()); + if (resources != null) { + prefsFile = resources[0]; + break; + } + } + catch (Exception e) { // NOSONAR + } // NOSONAR + } + } + } catch (IOException e) { + e.printStackTrace(); // NOSONAR + } + } // NOSONAR + } + } + catch (CoreException e) { // NOSONAR + e.printStackTrace(); // NOSONAR + } + return prefsFile; + } + + + + public String getName() { + return name; + } + + /* ========================= getters =========================== */ + + /** + * @see http://www.ecb.europa.eu/stats/exchange/eurofxref/html/index.en.html + * @return URL to server with the daily Euro Foreign Exchange Reference + * Rates + */ + public String getEuroXRefRatesURLDaily() { + initialize(); + return euroForeignExchangeReferenceRatesURLDaily; + } + + /** + * @see http://www.ecb.europa.eu/stats/exchange/eurofxref/html/index.en.html + * @return URL to server with the previous Euro Foreign Exchange Reference + * Rates + */ + public String getEuroXRefRatesURLPrevious() { + initialize(); + return euroForeignExchangeReferenceRatesURLPrevious; + } + + /** + * @return name of the server running the ActiveMQ Broker Service + */ + public String getActiveMqBrokerServerName() { + initialize(); + return activeMqBrokerServerName; + } + + /** + * @return port of the server running the ActiveMQ Broker Service + */ + public int getActiveMqBrokerServerPort() { + initialize(); + return activeMqBrokerServerPort; + } + + /** + * @return milliseconds for refresher in an active hybrid ccng view + */ + public int getHybridRefresherMilliSecsActive() { + initialize(); + return hybridRefresherMilliSecsActive; + } + + /** + * @return milliseconds for refresher in an inactive hybrid ccng view + */ + public int getHybridRefresherMilliSecsInactive() { + initialize(); + return hybridRefresherMilliSecsInactive; + } + + /** + * @return list of name of all defined DataSources + */ + public Collection<DataSourceConfiguration> getDataSources() { + initialize(); + return dataSources.values(); + } + + /** + * @return list of name of all defined DataSources + */ + public Set<String> getDataSourceNames() { + initialize(); + return dataSources.keySet(); + } + +// /** +// * @return the name of the active DataSource +// */ +// public String getDataSourceNameForAuthentication() { +// initialize(); +// return dataSourceForAuthentication; +// } +// +// /** +// * @return the name of the active DataSource +// */ +// public String getDataSourceNameForBLOB() { +// initialize(); +// return dataSourceForBLOB; +// } +// +// /** +// * @return the name of the bpm DataSource +// */ +// public String getDataSourceNameForBPM() { +// initialize(); +// return dataSourceForBPM; +// } +// +// /** +// * @return the name of the bpm DataSource +// */ +// public String getDataSourceNameForBusinessData() { +// initialize(); +// return dataSourceForBusinessData; +// } + + /** + * @param jndiName + * the requested DataSource + * @return the properties to define a DataSource + */ + public Properties getDataSourceProperties(String jndiName) { + DataSourceConfiguration jndi = getDataSource(jndiName); + return (jndi == null) ? null : jndi.getDataSourceProperties(); + } + + public DataSourceConfiguration getDataSource(String jndiName) { + try { + initializeDataSources(); + } + catch (Exception e) { // NOSONAR + e.printStackTrace(); // NOSONAR + } + return dataSources.get(jndiName); + } + + /** + * @param jndiName + * the requested DataSource + * @return name of the JDBC driver class + */ + public EnumDatabaseVendor getDataSourceDatabaseVendor(String jndiName) { + initialize(); + DataSourceConfiguration jndi = dataSources.get(jndiName); + return (jndi == null) ? null : jndi.getDatabaseVendor(); + } + + /** + * @param jndiName + * the requested DataSource + * @return name of the JDBC driver class + */ + public String getDataSourceDriverClass(String jndiName) { + initialize(); + DataSourceConfiguration jndi = dataSources.get(jndiName); + return (jndi == null) ? null : jndi.getDriverClass(); + } + + /** + * @param jndiName + * the requested DataSource + * @return the properties to define a JPA connection + */ + public Properties getJpaProperties(String jndiName) { + initialize(); + DataSourceConfiguration jndi = dataSources.get(jndiName); + return (jndi == null) ? null : jndi.getJpaProperties(); + } + + /** + * @return list of name of all defined DataSources + */ + public Collection<PersistenceUnitConfiguration> getPersistenceUnits() { + initialize(); + return persistenceUnits.values(); + } + + /** + * @return list of name of all defined DataSources + */ + public Set<String> getPersistenceUnitNames() { + initialize(); + return persistenceUnits.keySet(); + } + + /** + * @return JNDI name for the given persistence unit + */ + public String getPersistenceUnitJndiName(String persistenceUnitName) { + initialize(); + return persistenceUnits.get(persistenceUnitName).getJndiName(); + } + + public String getPersistenceUnitHibernateDialect(String persistenceUnitName) { + return getJndiNameHibernateDialect(getPersistenceUnitJndiName(persistenceUnitName)); + } + + public String getJndiNameHibernateDialect(String jndiName) { + initialize(); + DataSourceConfiguration jndi = dataSources.get(jndiName); + return (jndi == null) ? null : jndi.getDatabaseVendor().getHibernateDialect(); + } + + /** + * Gets the paramterized ddl generation flag for the given persistence unit. + * + * @param persistenceUnitName the persistence unit name + * @return the ddl generation flag + */ + public String getPersistenceUnitParameterizedEclipseLinkDdlGeneration(String persistenceUnitName) { + return persistenceUnits.get(persistenceUnitName).getDdlGeneration(); + } + + /** + * Gets the effective ddl generation flag for the given persistence unit. + * <br> + * If an in-memory database is used, always <code>create-tables</code> will be returned. + * + * @param persistenceUnitName the persistence unit name + * @return the ddl generation flag + */ + public String getPersistenceUnitEffectiveEclipseLinkDdlGeneration(String persistenceUnitName) { + EnumDatabaseVendor vendor = getDataSourceDatabaseVendor(getPersistenceUnitJndiName(persistenceUnitName)); + if (vendor.isInMemory()) { + return DDL_GENERATION.CREATE.eclipseLink; + } + else { + switch (vendor) { + default: + return getPersistenceUnitParameterizedEclipseLinkDdlGeneration(persistenceUnitName); + } + } + } + + /** + * @param jndiName + * the requested DataSource + * @return the properties to define a DataSource + */ + public Properties getPersistenceUnitProperties( + String persistenceUnitName, CommonDataSource dataSource, ClassLoader classLoader) { + initialize(); + if (persistenceUnits.containsKey(persistenceUnitName)) { + return persistenceUnits.get(persistenceUnitName) + .getPersistenceUnitProperties(dataSource, classLoader); + } + return null; + } + + @Override + public String getAuthenticationOrganizationId() { + initialize(); + return authenticationOrganizationId; + } + + /** + * @return port of the RESTful authentication API, needed by the hybrid + * WebClient cxauth + */ + public final int getAuthRESTfulPort() { + initialize(); + return authRESTfulApiPort; + } + + /** + * @return decide remember-me function performs an auto-login or not + */ + public final boolean hasAutoLogin() { + initialize(); + return autoLogin; + } + + /** + * @return automatically encrypt non-encrypted passwords in userAccount + */ + public final boolean hasEncryptPasswords() { + initialize(); + return encryptPasswords; + } + + /** + * @return hide remember-me function if true + */ + public final boolean hasNoRememberMe() { + initialize(); + return noRememberMe; + } + + public final int getDtoRealmPortalId() { + initialize(); + try { + DtoConfiguration configuration = (DtoConfiguration) getShiroRealmConfiguration(SHIRO_DTO_REALM); + return configuration.getPortalId(); + } + catch (Exception e) { // NOSONAR + e.printStackTrace(); // NOSONAR + } + return 1; + } + + public final int getLdapRealmPortalId() { + initialize(); + try { + LdapConfiguration configuration = (LdapConfiguration) getShiroRealmConfiguration(SHIRO_LDAP_REALM); + return configuration.getPortalId(); + } + catch (Exception e) { // NOSONAR + e.printStackTrace(); // NOSONAR + } + return 1; + } + + public final String getLdapContextFactoryUrl() { + initialize(); + try { + LdapConfiguration configuration = (LdapConfiguration) getShiroRealmConfiguration(SHIRO_LDAP_REALM); + return configuration.getUrl(); + } + catch (Exception e) { // NOSONAR + e.printStackTrace(); // NOSONAR + } + return "ldap://<ldapserver>:389"; + } + + public final String getLdapUserDnTemplate() { + initialize(); + try { + LdapConfiguration configuration = (LdapConfiguration) getShiroRealmConfiguration(SHIRO_LDAP_REALM); + return configuration.getTemplate(); + } + catch (Exception e) { // NOSONAR + e.printStackTrace(); // NOSONAR + } + return "cn={0},ou=users,dc=<organisation>,dc=<countrycode>"; + } + + @Override + public final String getAdminEmail() { + initialize(); + return adminEmail; + } + + @Override + public final String getAdminEmailUsername() { + initialize(); + return adminEmailUsername; + } + + @Override + public final String getAdminEmailPassword() { + initialize(); + return adminEmailPassword; + } + + /** + * @return maximum failed login attempts + */ + public final int getMaxLoginAttempts() { + initialize(); + return maxLoginAttempts; + } + + public final String getProtocolDatasource() { + initialize(); + return protocolDatasource; + } + + public final String getProtocolUnit() { + initialize(); + return protocolUnit; + } + + public final boolean getIdentifyByUsername() { + initialize(); + return identifyByUsername; + } + + /** + * @return the corresponding INI string for all authentication realms needed + * for Shiro + */ + public final String getShiroConfiguration(String staticRealmClassName) { + initialize(); + String mainSection = "[main]" + IShiroConfiguration.INI_NEWLINE; + String realms = ""; + if (!shiros.containsKey(ProductConfiguration.SHIRO_STATIC_REALM)) { + shiros.put(ProductConfiguration.SHIRO_STATIC_REALM, new StaticConfiguration(staticRealmClassName, 1)); + } + for (String name : shiros.keySet()) { + mainSection += shiros.get(name).getShiroConfiguration(name); + if (!realms.isEmpty()) { + realms += ","; + } + realms += "$" + name; + } + mainSection += "securityManager.realms = " + realms + IShiroConfiguration.INI_NEWLINE; + return mainSection; + } + + + public String getPreferencesFile() { + if (getProductPreferences() instanceof InstancePreferences) { + InstancePreferences instance = (InstancePreferences)getProductPreferences(); + Class<?> instanceClass = instance.getClass(); + try { + Method getLocation = instanceClass.getDeclaredMethod("getLocation"); + getLocation.setAccessible(true); + IPath location = (IPath) getLocation.invoke(instance); + return location.toOSString(); + } + catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NullPointerException e) { + e.printStackTrace(); + } + } + return getLocation(); + } + + public String getLocation() { + IPath path = scopeContext.getLocation(); + if (path == null) { + path = ConfigurationScope.INSTANCE.getLocation(); + } + if (path == null) { + return null; + } + else { + return path.toOSString(); + } + } + + public Map<String, Locale> getLanguages() { + initialize(); + return languages; + } + + public boolean isLanguagesAutotranslate() { + initialize(); + return languagesAutotranslate; + } + + public boolean willLanguagesAutocreate() { + initialize(); + return languagesAutocreate; + } + + public boolean isUomoMetricUnit() { + initialize(); + return uomoMetricUnit; + } + + public boolean showLanguageSelectInRespectiveLocale() { + initialize(); + return showLanguageSelectInRespectiveLocale; + } + + public String getLanguagesGoogleHttpReferrer() { + initialize(); + return languagesGoogleHttpReferrer; + } + + public String getLanguagesGoogleApiKey() { + initialize(); + return languagesGoogleApiKey; + } + + /** + * @return show theme tool control if true + */ + public final boolean hasDemoToolsTheme() { + initialize(); + return demoToolsTheme; + } + + /** + * @return show strategy tool control if true + */ + public final boolean hasDemoToolsStrategy() { + initialize(); + return demoToolsStrategy; + } + + /** + * @return show langauge tool control if true + */ + public final boolean hasDemoToolsLanguage() { + initialize(); + return demoToolsLanguage; + } + + /** + * @return show print service tool control if true + */ + public final boolean hasToolsPrintService() { + initialize(); + return demoToolsPrintService; + } + + /** + * @return use absolute location for project wizard if true + */ + public final boolean projectWizardUsesAbsoluteLocation() { + initialize(); + return projectWizardAbsoluteLocation; + } + + /* ========================= setters =========================== */ + + public void setEuroForeignExchangeReferenceRatesURLDaily( + String euroForeignExchangeReferenceRatesURLDaily) { + this.euroForeignExchangeReferenceRatesURLDaily = put(EURO_X_REF_URL_NODE, EURO_X_REF_URL_DAILY, + euroForeignExchangeReferenceRatesURLDaily); + } + + public void setEuroForeignExchangeReferenceRatesURLPrevious( + String euroForeignExchangeReferenceRatesURLPrevious) { + this.euroForeignExchangeReferenceRatesURLPrevious = put(EURO_X_REF_URL_NODE, EURO_X_REF_URL_PREVIOUS, + euroForeignExchangeReferenceRatesURLPrevious); + } + + public void setAuthenticationOrganizationId(String value) { + authenticationOrganizationId = put(AUTHENTICATION_NODE, AUTHENTICATION_ORGANIZATION_ID, value); + } + + public void setAuthRESTfulApiPort(int authRESTfulApiPort) { + this.authRESTfulApiPort = put(AUTHENTICATION_NODE, AUTH_RESTFUL_PORT, authRESTfulApiPort); + } + + public void setAutoLogin(boolean autoLogin) { + this.autoLogin = put(AUTHENTICATION_NODE, AUTHENTICATION_AUTOLOGIN, autoLogin); + } + + public void setEncryptPasswords(boolean encryptPasswords) { + this.encryptPasswords = put(AUTHENTICATION_NODE, AUTHENTICATION_ENCRYPT_PASSWORDS, encryptPasswords); + } + + public void setNoRememberMe(boolean noRememberMe) { + this.noRememberMe = put(AUTHENTICATION_NODE, AUTHENTICATION_HIDE_REMEMBER_ME, noRememberMe); + } + + public void setAdminEmail(String adminEmail) { + this.adminEmail = put(AUTHENTICATION_NODE, AUTHENTICATION_ADMIN_EMAIL_ACCOUNT, adminEmail); + } + + public void setAdminEmailUsername(String value) { + this.adminEmailUsername = put(AUTHENTICATION_NODE, AUTHENTICATION_ADMIN_EMAIL_USERNAME, value); + } + + /** + * <b>Please be aware, that the password is stored as <u>plain-text</u> right now!</b> + * @param value the new administrator email password used to authenticate against the email server + */ + public void setAdminEmailPassword(String value) { + this.adminEmailPassword = put(AUTHENTICATION_NODE, AUTHENTICATION_ADMIN_EMAIL_PASSWORD, value); + } + + public void setMaxLoginAttempts(int maxLoginAttempts) { + this.maxLoginAttempts = put(SHIRO_NODE, SHIRO_MAX_LOGIN_ATTEMPTS, maxLoginAttempts); + } + + public void setDtoRealmPortalId(int dtoRealmPortalId) { + put(SHIRO_NODE, SHIRO_DTO_REALM_CLASS, DTO_PORTAL_ID, dtoRealmPortalId); + } + + public void setLdapRealmPortalId(int ldapRealmPortalId) { + put(SHIRO_NODE, SHIRO_LDAP_REALM_CLASS, LDAP_PORTAL_ID, ldapRealmPortalId); + } + + public void setLdapContextFactoryUrl(String url) { + put(SHIRO_NODE, SHIRO_LDAP_REALM_CLASS, LDAP_URL, url); + } + + public void setLdapUserDnTemplate(String template) { + put(SHIRO_NODE, SHIRO_LDAP_REALM_CLASS, LDAP_USERDNTEMPLATE, template); + } + + public void setProtocolDatasource(String datasource) { + this.protocolDatasource = put(SHIRO_NODE, SHIRO_PROTOCOL_DATASOURCE, datasource); + } + + public void setProtocolUnit(String protocolUnit) { + this.protocolUnit = put(SHIRO_NODE, SHIRO_PROTOCOL_UNIT, protocolUnit); + } + + public void setIdentifyByUsername(boolean identifyByUsername) { + this.identifyByUsername = put(SHIRO_NODE, SHIRO_IDENTIFY_BY_USERNAME, identifyByUsername); + } + + public void setActiveMqBrokerServerName( + String activeMqBrokerServerName) { + this.activeMqBrokerServerName = put(ACTIVEMQBROKER_NODE, ACTIVEMQBROKER_SERVER, + activeMqBrokerServerName); + } + + public void setActiveMqBrokerServerPort(int activeMqBrokerServerPort) { + if (activeMqBrokerServerPort < 1) { + activeMqBrokerServerPort = defaultPrefs.getActiveMqBrokerServerPort(); + } + this.activeMqBrokerServerPort = put(ACTIVEMQBROKER_NODE, ACTIVEMQBROKER_PORT, + activeMqBrokerServerPort); + } + + public void setHybridRefresherMilliSecsActive( + int hybridRefresherMilliSecsActive) { + this.hybridRefresherMilliSecsActive = put(HYBRID_NODE, HYBRID_REFRESHER_MILLISECS_ACTIVE, + hybridRefresherMilliSecsActive); + } + + public void setHybridRefresherMilliSecsInactive( + int hybridRefresherMilliSecsInactive) { + this.hybridRefresherMilliSecsInactive = put(HYBRID_NODE, HYBRID_REFRESHER_MILLISECS_INACTIVE, + hybridRefresherMilliSecsInactive); + } + + public void setRealms(Map<String, IShiroConfiguration> configs) { + this.shiros = configs; + Preferences realms = getNode(SHIRO_NODE); + if (realms != null) { + for (String name : shiros.keySet()) { + Preferences realm = realms.node(name); + if (configs.get(name) instanceof DtoConfiguration) { + } + else if (configs.get(name) instanceof LdapConfiguration) { + put(realm, LDAP_PORTAL_ID, ((LdapConfiguration) shiros.get(name)).getPortalId()); + put(realm, LDAP_URL, ((LdapConfiguration) shiros.get(name)).getUrl()); + put(realm, LDAP_USERDNTEMPLATE, ((LdapConfiguration) shiros.get(name)).getTemplate()); + } + } + try { + realms.flush(); + } + catch (BackingStoreException e) { // NOSONAR + LOGGER.error(e.getLocalizedMessage()); + } + } + } + +// public void setDataSourceForAuthentication(String dataSource) { +// this.dataSourceForAuthentication = put((String)null, DATASOURCE_FOR_AUTHENTICATION, dataSource); +// } +// +// public void setDataSourceForBLOB(String dataSource) { +// this.dataSourceForBLOB = put((String)null, DATASOURCE_FOR_BLOB, dataSource); +// } +// +// public void setDataSourceForBPM(String dataSource) { +// this.dataSourceForBPM = put((String)null, DATASOURCE_FOR_BPM, dataSource); +// } +// +// public void setDataSourceForBusinessData(String dataSource) { +// this.dataSourceForBusinessData = put((String)null, DATASOURCE_FOR_BUSINESSDATA, dataSource); +// } + + public void setDataSources(Map<String, DataSourceConfiguration> dataSources) { + forceReloadConfiguration(); + this.dataSources = dataSources; + Preferences datasourceNode = getNode(DATASOURCE_NODE); + clear(datasourceNode); + if (datasourceNode != null) { + for (String dataSourceName : dataSources.keySet()) { + Preferences dataSource = datasourceNode.node(dataSourceName); + DataSourceConfiguration dsc = dataSources.get(dataSourceName); + put(dataSource, DATASOURCE_ENUM_ITEM, dsc.getDatabaseVendor().name()); + put(dataSource, DATASOURCE_DRIVER_VENDOR, dsc.getDriverVendor()); + put(dataSource, DATASOURCE_DRIVER_TYPE, dsc.getDriverType()); + put(dataSource, DATASOURCE_DRIVER_CLASS, dsc.getDriverClass()); + put(dataSource, DATASOURCE_SERVER_NAME, dsc.getServerName()); + put(dataSource, DATASOURCE_SERVER_PORT, dsc.getServerPort()); + put(dataSource, DATASOURCE_DATABASE_NAME, dsc.getDatabaseName()); + put(dataSource, DATASOURCE_DATABASE_USER, dsc.getDatabaseUser()); + put(dataSource, DATASOURCE_DATABASE_PASS, dsc.getDatabasePass()); + } + try { + datasourceNode.flush(); + } + catch (BackingStoreException e) { // NOSONAR + LOGGER.error(e.getLocalizedMessage()); + } + } + } + + public void setPersistenceUnits(Map<String, PersistenceUnitConfiguration> persistenceUnits) { + forceReloadConfiguration(); + Preferences root = getProductPreferences(); + Preferences pus = getProductPreferencesNode(PERSISTENCE_NODE); + clear(pus); + for (PersistenceUnitConfiguration persistenceUnit : persistenceUnits.values()) { + try { + initializeIfNotExists(true, root, pus, + persistenceUnit.getName(), + persistenceUnit.getJndiName(), + persistenceUnit.getDeployOnStartup(), + persistenceUnit.getQueryCache(), + persistenceUnit.getBatchWriting(), + persistenceUnit.getBatchWritingSize(), + persistenceUnit.getCacheStatements(), + persistenceUnit.getCacheStatementsSize(), + persistenceUnit.getLoggingLevel(), + persistenceUnit.getDdlGeneration(), + persistenceUnit.getPersistenceXMLPath()); + } + catch (Exception e) { // NOSONAR + LOGGER.error(e.getLocalizedMessage()); + } + } + } + + public void setLanguages(Collection<Locale> languages) { + try { + this.languages = new TreeMap<>(); + int lSize = languages.size(); + Preferences languagesNode = getNode(LANGUAGES_NODE); + clear(languagesNode); + if (languagesNode != null) { + int index = 0; + for (Locale locale : languages) { + this.languages.put(locale.toString(), locale); + index++; + Preferences language = languagesNode.node(Integer.toString(index)); + put(language, LANGUAGES_LANGUAGE, locale.getLanguage()); + put(language, LANGUAGES_COUNTRY, locale.getCountry()); + put(language, LANGUAGES_VARIANT, locale.getVariant()); + } + languagesNode.flush(); + } + put((String)null, LANGUAGES_SUPPORTED, lSize); + } + catch (Exception e) { // NOSONAR + LOGGER.error(e.getLocalizedMessage()); + } + } + + public void setLanguages(Map<String, Locale> languages) { + setLanguages(languages.values()); + } + + public void setLanguagesAutotranslate(boolean languagesAutotranslate) { + this.languagesAutotranslate = put((String)null, LANGUAGES_AUTOTRANSLATE, languagesAutotranslate); + } + + public void setLanguagesAutocreate(boolean languagesAutocreate) { + this.languagesAutocreate = put((String)null, LANGUAGES_AUTOCREATE, languagesAutocreate); + } + + public void setShowLanguageSelectInRespectiveLocale( + boolean showLanguageSelectInRespectiveLocale) { + this.showLanguageSelectInRespectiveLocale = put((String)null, LANGUAGES_SHOW_SELECT_IN_RESPECTIVE_LOCALE, + showLanguageSelectInRespectiveLocale); + } + + public void setLanguagesGoogleHttpReferrer( + String languagesGoogleHttpReferrer) { + this.languagesGoogleHttpReferrer = put((String)null, LANGUAGES_GOOGLE_HTTP_REFERRER, + languagesGoogleHttpReferrer); + } + + public void setLanguagesGoogleApiKey(String languagesGoogleApiKey) { + this.languagesGoogleApiKey = put((String)null, LANGUAGES_GOOGLE_API_KEY, languagesGoogleApiKey); + } + + public String getBusinessBundleClassNameReadOnly() { + initialize(); + return businessBundleClassNameReadOnly; + } + + public String getBpmServerIp() { + initialize(); + return bpmServerIp; + } + + public int getBpmServerPort() { + initialize(); + return bpmServerPort; + } + + public int getBpmResponseTimeout() { + initialize(); + return bpmResponseTimeout; + } + + public void setBpmServerIp(String bpmServerIp) { + this.bpmServerIp = put(BPM_NODE, BPM_SERVER_IP, bpmServerIp); + } + + public void setBpmServerPort(int bpmServerPort) { + if (bpmServerPort < 1) { + bpmServerPort = defaultPrefs.getBpmServerPort(); + } + this.bpmServerPort = put(BPM_NODE, BPM_SERVER_PORT, bpmServerPort); + } + + public void setBpmResponseTimeout(int bpmResponseTimeout) { + this.bpmResponseTimeout = put(BPM_NODE, BPM_RESPONSE_TIMEOUT, bpmResponseTimeout); + } + + public void setDemoToolsTheme(boolean demoToolsTheme) { + this.demoToolsTheme = put(DEMO_NODE, DEMO_TOOLS_THEME, demoToolsTheme); + } + + public void setDemoToolsStrategy(boolean demoToolsStrategy) { + this.demoToolsStrategy = put(DEMO_NODE, DEMO_TOOLS_STRATEGY, demoToolsStrategy); + } + + public void setDemoToolsLanguage(boolean demoToolsLanguage) { + this.demoToolsLanguage = put(DEMO_NODE, DEMO_TOOLS_LANGUAGE, demoToolsLanguage); + } + + public void setToolsPrintService(boolean demoToolsPrintService) { + this.demoToolsPrintService = put(DEMO_NODE, DEMO_TOOLS_PRINTSERVICE, demoToolsPrintService); + } + + public void setProjectWizardUsingAbsoluteLocation(boolean projectWizardAbsoluteLocation) { + this.projectWizardAbsoluteLocation = put(PROJECT_WIZARD_NODE, PROJECT_WIZARD_ABSOLUTE_LOCATION, projectWizardAbsoluteLocation); + } + + private IEclipsePreferences applyCustomizedPreferenceDirectory(IEclipsePreferences preference) { +// if (project != null) { +// if (preference instanceof ProjectPreferences) { +// IResource prefsFile = getPrefsFile(project); +// if (prefsFile instanceof IFile) { +// try { +// Class<?> preferenceClass = preference.getClass(); +// Method getLoadLevel = preferenceClass.getDeclaredMethod("getLoadLevel"); +// getLoadLevel.setAccessible(true); +// ProjectPreferences loadLevelInstance = (ProjectPreferences) getLoadLevel.invoke(preference); +// Class<?>loadLevelClass = loadLevelInstance.getClass(); +// Field fileField = loadLevelClass.getDeclaredField("file"); +// fileField.setAccessible(true); +// IFile activeFile = (IFile) fileField.get(loadLevelInstance); +// if ((activeFile == null) || !activeFile.getFullPath().toOSString().equals(prefsFile.getFullPath().toOSString())) { +// fileField.set(loadLevelInstance, prefsFile); +// preference.sync(); +// forceReloadConfiguration(); +// } +// } +// catch (NoSuchFieldException x) { +// x.printStackTrace(); +// } +// catch (IllegalArgumentException x) { +// x.printStackTrace(); +// } +// catch (IllegalAccessException x) { +// x.printStackTrace(); +// } +// catch (BackingStoreException e) { +// e.printStackTrace(); +// } +// catch (NoSuchMethodException e) { +// e.printStackTrace(); +// } +// catch (SecurityException e) { +// e.printStackTrace(); +// } +// catch (InvocationTargetException e) { +// e.printStackTrace(); +// } +// } +// } +// } + return preference; + } + + protected IEclipsePreferences getProductPreferences() { + if (project != null) { +// IPreferencesService service = Platform.getPreferencesService(); +// Preferences root = service.getRootNode(); +// Preferences myInstanceNode = root.node(project.getName()).node(InstanceScope.SCOPE).node(PRODUCT_PREFERENCES); +// return (IEclipsePreferences) myInstanceNode; +//??? return applyCustomizedPreferenceDirectory((IEclipsePreferences) scopeContext.getNode(InstanceScope.SCOPE).node(PRODUCT_PREFERENCES)); + return applyCustomizedPreferenceDirectory((IEclipsePreferences) scopeContext.getNode(PRODUCT_PREFERENCES)); + } + else { + return scopeContext.getNode(PRODUCT_PREFERENCES); + } + } + + protected IEclipsePreferences getProductPreferencesNode(String nodeName) { + return applyCustomizedPreferenceDirectory((IEclipsePreferences) getProductPreferences().node(nodeName)); + } + + private Preferences getNode(String nodeName) { + if (nodeName == null) { + return getProductPreferences(); + } + else { + return getProductPreferencesNode(nodeName); + } + } + + private void clear(Preferences node) { + try { + for (String child : node.childrenNames()) { + clear(node.node(child)); + } + for (String key : node.keys()) { + node.put(key, ""); + } + node.clear(); + node.flush(); + } + catch (BackingStoreException e) { + LOGGER.error("clearing node "+node.absolutePath(), e); + } + } + + private String put(Preferences node, String key, String value) { + if ((node != null) && (key != null) && !key.isEmpty()) { + if (!value.equals(node.get(key, ""))) { + try { + forceReloadConfiguration(); + node.put(key, value); + node.flush(); + registerWatch(); + } + catch (Exception e) { // NOSONAR + LOGGER.error("node " + node.name() + " and key " + key // NOSONAR + + " could not be set or flushed because " + + e.getLocalizedMessage()); + } + } + } + else { + LOGGER.error("node " + (node != null?node.name():"null") + " and key " + key + + " are no valid arguments"); + } + return value; + } + + private String put(String nodeName, String subNodeName, String key, String value) { + return put(getNode(nodeName).node(subNodeName), key, value); + } + + private String put(String nodeName, String key, String value) { + return put(getNode(nodeName), key, value); + } + + private Boolean put(String nodeName, String key, Boolean value) { + put(nodeName, key, value.toString()); + return value; + } + + private Integer put(Preferences node, String key, Integer value) { + put(node, key, value.toString()); + return value; + } + + private Integer put(String nodeName, String subNodeName, String key, Integer value) { + put(nodeName, subNodeName, key, value.toString()); + return value; + } + + private Integer put(String nodeName, String key, Integer value) { + put(nodeName, key, value.toString()); + return value; + } + +// private Double put(String nodeName, String key, Double value) { +// put(nodeName, key, value.toString()); +// return value; +// } + + /** + * sets the flag, that the configuration has to be reloaded. Deregisters all + * watchers/listeners on preference changes due to preference dialog and + * file modification + */ + public void forceReloadConfiguration() { + forceInitialize = true; + deregisterWatch(); + } + + /** + * Deregisters all watchers/listeners on preference changes due to + * preference dialog and file modification + */ + protected void deregisterWatch() { + if (preferenceChangedListener != null) { + try { + getProductPreferences().accept(new IPreferenceNodeVisitor() { + @Override + public boolean visit(IEclipsePreferences node) + throws BackingStoreException { + node.removePreferenceChangeListener(preferenceChangedListener); + return true; + } + }); + } + catch (BackingStoreException e) { + LOGGER.info("deregistering file watch thread", e); + } + } + } + + /** + * Registers all watchers/listeners on preference changes due to preference + * dialog and file modification + */ + protected void registerWatch() { + if (preferenceChangedListener != null) { + try { + getProductPreferences().accept(new IPreferenceNodeVisitor() { + @Override + public boolean visit(IEclipsePreferences node) + throws BackingStoreException { + node.addPreferenceChangeListener(preferenceChangedListener); + return true; + } + }); + } + catch (BackingStoreException e) { + LOGGER.error("registering file watch thread", e); + } + } + } + + + /* ========================= mock data generator state =========================== */ + + /** + * @param generator class of the requested mock data generator + * @return either null, if no entry is set, or the timestamp as String + */ + public String isMockDataGeneratorDone(Object generator) { + return getMockDataGeneratorsDoneNode().get(mockDataGeneratorToKey(generator), null); + } + + public void setMockDataGeneratorDone(Object generator) { + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss-SSS"); + String timeStamp = dateFormat.format(new Date(System.currentTimeMillis())); + put(MOCK_DATA_GENERATORS_DONE, mockDataGeneratorToKey(generator), timeStamp); + } + + private String mockDataGeneratorToKey(Object generator) { + return generator.getClass().getCanonicalName(); + } + + private Preferences getMockDataGeneratorsDoneNode() { + return getProductPreferencesNode(MOCK_DATA_GENERATORS_DONE); + } + + + /* ========================= main initializer =========================== */ + + public String getInformation() { + return getName()+" @ "+scopeContext.getName()+" @ "+getLocation(); + } + + private void initialize() { // NOSONAR + Set<Exception> exceptions = new HashSet<>(); + // --- (re)load the configuration if something has changed or it has not + // been loaded by now --- + if (forceInitialize || (authRESTfulApiPort < 1)) { + LOGGER.trace(getInformation()+" # initialize"); + deregisterWatch(); + try { + initializeReadOnly(); + } catch (Exception e) { + exceptions.add(e); + } + try { + initializeAuthentication(); + } catch (Exception e) { + exceptions.add(e); + } + try { + initializeEmail(); + } catch (Exception e) { + exceptions.add(e); + } + try { + initializeActiveMqBroker(); + } catch (Exception e) { + exceptions.add(e); + } + try { + initializeHybridConnection(); + } catch (Exception e) { + exceptions.add(e); + } + try { + initializeRealms(); + } catch (Exception e) { + exceptions.add(e); + } + try { + initializeDataSources(); + } catch (Exception e) { + exceptions.add(e); + } + try { + initializePersistenceUnits(); + } catch (Exception e) { + exceptions.add(e); + } + try { + initializeEuroXRefRates(); + } catch (Exception e) { + exceptions.add(e); + } + try { + initializeJavPOS(); + } catch (Exception e) { + exceptions.add(e); + } + try { + initializeLanguages(); + } catch (Exception e) { + exceptions.add(e); + } + try { + initializeUomoUnits(); + } catch (Exception e) { + exceptions.add(e); + } + try { + initializeBPM(); + } catch (Exception e) { + exceptions.add(e); + } + try { + initializeDemo(); + } catch (Exception e) { + exceptions.add(e); + } + try { + initializeProjectWizard(); + } catch (Exception e) { + exceptions.add(e); + } + if (!exceptions.isEmpty()) { + Exception e = new ConfigurationException(exceptions); + LOGGER.error("exceptions caught while reading configuration", e); + System.exit(0); // NOSONAR + } + forceInitialize = false; + registerWatch(); + } + } + + + private void initializeLanguages() throws Exception { + Preferences root = getProductPreferences(); + int languagesSupported = root.getInt(LANGUAGES_SUPPORTED, 0); + if (languagesSupported < 1) { + setLanguages(defaultPrefs.getLanguages()); + } + Preferences languagesNode = getProductPreferencesNode(LANGUAGES_NODE); + // --- read all preferences --- + languagesAutotranslate = root.getBoolean(LANGUAGES_AUTOTRANSLATE, defaultPrefs.isLanguagesAutotranslate()); + languagesAutocreate = root.getBoolean(LANGUAGES_AUTOCREATE, defaultPrefs.willLanguagesAutocreate()); + showLanguageSelectInRespectiveLocale = root.getBoolean(LANGUAGES_SHOW_SELECT_IN_RESPECTIVE_LOCALE, defaultPrefs.showLanguageSelectInRespectiveLocale()); + languagesGoogleHttpReferrer = root.get(LANGUAGES_GOOGLE_HTTP_REFERRER, defaultPrefs.getLanguagesGoogleHttpReferrer()); + languagesGoogleApiKey = root.get(LANGUAGES_GOOGLE_API_KEY, defaultPrefs.getLanguagesGoogleApiKey()); + languagesSupported = root.getInt(LANGUAGES_SUPPORTED, 0); + for (int i = 0; i < languagesSupported; i++) { + Preferences language = languagesNode.node(Integer.toString(i + 1)); + List<String> languageParts = new ArrayList<>(); + languageParts.add(language.get(LANGUAGES_LANGUAGE, "")); + if (language.get(LANGUAGES_VARIANT, "").length() > 0) { + languageParts.add(language.get(LANGUAGES_VARIANT, "")); + } + if (language.get(LANGUAGES_COUNTRY, "").length() > 0) { + languageParts.add(language.get(LANGUAGES_COUNTRY, "")); + } + Locale locale = null; + if (languageParts.size() == 1) { + locale = new Locale(languageParts.get(0)); + } else if (languageParts.size() == 2) { + locale = new Locale(languageParts.get(0), languageParts.get(1)); + } else if (languageParts.size() == 3) { + locale = new Locale(languageParts.get(0), languageParts.get(1), + languageParts.get(2)); + } + languages.put(StringUtils.join(languageParts, "_"), locale); + } + languages.put("default", null); + } + + + private void initializeUomoUnits() throws Exception { + Preferences uomounitsNode = getProductPreferencesNode(UOMOUNIT_NODE); + // --- read all preferences --- + uomoMetricUnit = uomounitsNode.getBoolean(UOMOUNIT_METRIC, defaultPrefs.isUomoMetricUnit()); + } + + private void initializeEuroXRefRates() throws Exception { + Preferences euroXRefURL = getProductPreferencesNode(EURO_X_REF_URL_NODE); + // --- read all preferences --- + euroForeignExchangeReferenceRatesURLDaily = euroXRefURL.get(EURO_X_REF_URL_DAILY, defaultPrefs.getEuroXRefRatesURLDaily()); + euroForeignExchangeReferenceRatesURLPrevious = euroXRefURL.get(EURO_X_REF_URL_PREVIOUS, defaultPrefs.getEuroXRefRatesURLPrevious()); + } + + private void initializeJavPOS() throws Exception { + Preferences javaPos = getProductPreferencesNode(JAVA_POS_NODE); + // --- read all preferences --- + javaPosConfiguration = javaPos.get(JAVA_POS_CONFIGURATION, defaultPrefs.getJavaPosConfiguration()); + } + + private void initializeReadOnly() throws Exception { + Preferences readOnly = getProductPreferences(); + businessBundleClassNameReadOnly = readOnly.get(BUSINESS_BUNDLE_CLASS_NAME, ""); + } + + private void initializeAuthentication() throws Exception { + Preferences authentication = getProductPreferencesNode(AUTHENTICATION_NODE); + authenticationOrganizationId = authentication.get(AUTHENTICATION_ORGANIZATION_ID, defaultPrefs.getAuthenticationOrganizationId()); + autoLogin = authentication.getBoolean(AUTHENTICATION_AUTOLOGIN, defaultPrefs.hasAutoLogin()); + encryptPasswords = authentication.getBoolean(AUTHENTICATION_ENCRYPT_PASSWORDS, defaultPrefs.hasEncryptPasswords()); + noRememberMe = authentication.getBoolean(AUTHENTICATION_HIDE_REMEMBER_ME, defaultPrefs.hasNoRememberMe()); + // --- read all preferences --- + authRESTfulApiPort = authentication.getInt(AUTH_RESTFUL_PORT, defaultPrefs.getAuthRESTfulPort()); + } + + private void initializeActiveMqBroker() throws Exception { + Preferences activeMqBroker = getProductPreferencesNode(ACTIVEMQBROKER_NODE); + // --- read all preferences --- + activeMqBrokerServerName = activeMqBroker.get(ACTIVEMQBROKER_SERVER, defaultPrefs.getActiveMqBrokerServerName()); + activeMqBrokerServerPort = activeMqBroker.getInt(ACTIVEMQBROKER_PORT, 0); + if (activeMqBrokerServerPort < 1) { + activeMqBrokerServerPort = defaultPrefs.getActiveMqBrokerServerPort(); + } + } + + private void initializeHybridConnection() throws Exception { + Preferences hybridConnection = getProductPreferencesNode(HYBRID_NODE); + // --- read all preferences --- + hybridRefresherMilliSecsActive = hybridConnection.getInt(HYBRID_REFRESHER_MILLISECS_ACTIVE, defaultPrefs.getHybridRefresherMilliSecsActive()); + hybridRefresherMilliSecsInactive = hybridConnection.getInt(HYBRID_REFRESHER_MILLISECS_INACTIVE, defaultPrefs.getHybridRefresherMilliSecsInactive()); + } + + private void initializeRealms() throws Exception { + Preferences realms = getProductPreferencesNode(SHIRO_NODE); + maxLoginAttempts = realms.getInt(SHIRO_MAX_LOGIN_ATTEMPTS, defaultPrefs.getMaxLoginAttempts()); + protocolDatasource = realms.get(SHIRO_PROTOCOL_DATASOURCE, defaultPrefs.getProtocolDatasource()); + protocolUnit = realms.get(SHIRO_PROTOCOL_UNIT, defaultPrefs.getProtocolUnit()); + identifyByUsername = realms.getBoolean(SHIRO_IDENTIFY_BY_USERNAME, defaultPrefs.getIdentifyByUsername()); + + // --- generate reasonable default preferences for development product + if (realms.childrenNames().length == 0) { + Preferences dtoRealm = realms.node(SHIRO_DTO_REALM_CLASS); + dtoRealm.putInt(DTO_PORTAL_ID, defaultPrefs.getDtoRealmPortalId()); + + Preferences ldapRealm = realms.node(SHIRO_LDAP_REALM_CLASS); + ldapRealm.putInt(LDAP_PORTAL_ID, defaultPrefs.getLdapRealmPortalId()); + ldapRealm.put(LDAP_URL, defaultPrefs.getLdapContextFactoryUrl()); + ldapRealm.put(LDAP_USERDNTEMPLATE, defaultPrefs.getLdapUserDnTemplate()); + realms.flush(); + } + // --- read all preferences --- + for (String iname : realms.childrenNames()) { + Preferences realm = realms.node(iname); + if (iname.contains("DTO")) { + int portalId = realm.getInt(DTO_PORTAL_ID, defaultPrefs.getDtoRealmPortalId()); + DtoConfiguration configuration = new DtoConfiguration(iname, portalId); + shiros.put(SHIRO_DTO_REALM, configuration); + } + else if (iname.contains("LDAP")) { + int portalId = realm.getInt(LDAP_PORTAL_ID, defaultPrefs.getLdapRealmPortalId()); + String userDnTemplate = realm.get(LDAP_USERDNTEMPLATE, defaultPrefs.getLdapUserDnTemplate()); + String contextFactoryUrl = realm.get(LDAP_URL, defaultPrefs.getLdapContextFactoryUrl()); + if ((portalId > 0) && (portalId < 1000) // NOSONAR + && !userDnTemplate.isEmpty() + && !contextFactoryUrl.isEmpty() + && !contextFactoryUrl.contains("<") + && !contextFactoryUrl.contains(">")) { + LdapConfiguration configuration = new LdapConfiguration( + iname, portalId, contextFactoryUrl, userDnTemplate); + shiros.put(SHIRO_LDAP_REALM, configuration); + } + } + } + } + + public IShiroConfiguration getShiroRealmConfiguration(String key) { + return shiros.get(key); + } + + private void initializeIfNotExists(Preferences root, Preferences dataSourcesPrefs, // NOSONAR + String dataSource, String dataSourceConsumer, EnumDatabaseVendor vendor, + String serverName, int serverPort, + String database, String username, String password) throws Exception { + if (!dataSourcesPrefs.nodeExists(dataSource)) { + Preferences dataSourcePref = dataSourcesPrefs.node(dataSource); + if ((dataSourceConsumer != null) && !dataSourceConsumer.isEmpty()) { + root.put(dataSourceConsumer, dataSource); + } + put(dataSourcePref, DATASOURCE_ENUM_ITEM, vendor.name()); + put(dataSourcePref, DATASOURCE_DRIVER_VENDOR, vendor.getDriverVendor()); + put(dataSourcePref, DATASOURCE_DRIVER_TYPE, vendor.getDriverType()); + put(dataSourcePref, DATASOURCE_DRIVER_CLASS, vendor.getDriverClass()); + if ((serverName != null) && !serverName.isEmpty()) { + put(dataSourcePref, DATASOURCE_SERVER_NAME, serverName); + } + if (serverPort >= 0) { + put(dataSourcePref, DATASOURCE_SERVER_PORT, serverPort); + } + put(dataSourcePref, DATASOURCE_DATABASE_NAME, database); + put(dataSourcePref, DATASOURCE_DATABASE_USER, username); + put(dataSourcePref, DATASOURCE_DATABASE_PASS, password); + dataSourcesPrefs.flush(); + root.flush(); + } + } + + private void initializeDataSources() throws Exception { + Preferences root = getProductPreferences(); + Preferences dataSourcesPrefs = getProductPreferencesNode(DATASOURCE_NODE); + /* === datasource using a Oracle database === */ + initializeIfNotExists (root, dataSourcesPrefs, "oracle", "oracle", //DATASOURCE_FOR_BUSINESSDATA, + EnumDatabaseVendor.ORACLE, "<ip-or-host>", 1521, "<database>", "<username>", "<password>"); // NOSONAR + /* === datasource using a MySQL database === */ + initializeIfNotExists (root, dataSourcesPrefs, "mysql", null, + EnumDatabaseVendor.MYSQL, "<ip-or-host>", 3306, "<database>", "<username>", ""); + /* === datasource using a H2 in-Memory database === */ + initializeIfNotExists (root, dataSourcesPrefs, DEFAULT_H2MEMORY_DATASOURCE, null, + EnumDatabaseVendor.H2_IN_MEMORY, null, -1, "H2MEMORY", "H2MEMORY", "H2MEMORY"); // NOSONAR + /* === datasource using a H2 local-file database === */ + initializeIfNotExists (root, dataSourcesPrefs, DEFAULT_H2LOCALFILE_DATASOURCE, null, + EnumDatabaseVendor.H2_LOCAL_FILE, null, -1, "H2LOCALFILE", "H2LOCALFILE", "H2LOCALFILE"); + /* === datasource using a Derby in-Memory database === */ + initializeIfNotExists (root, dataSourcesPrefs, DEFAULT_DERBYMEMORY_DATASOURCE, null, + EnumDatabaseVendor.DERBY_IN_MEMORY, null, -1, "DERBYMEMORY", "DERBYMEMORY", "DERBYMEMORY"); + /* === datasource using a Derby local-file database === */ + initializeIfNotExists (root, dataSourcesPrefs, DEFAULT_DERBYLOCALFILE_DATASOURCE, null, + EnumDatabaseVendor.DERBY_LOCAL_FILE, null, -1, "DERBYLOCALFILE", "DERBYLOCALFILE", "DERBYLOCALFILE"); + /* === datasource using a Derby database === */ + initializeIfNotExists (root, dataSourcesPrefs, DEFAULT_DERBYSERVER_DATASOURCE, null, + EnumDatabaseVendor.DERBY_CLIENT, "<ip-or-host>", 1527, "<database>", "<username>", "<password>"); + /* + // http://www.hsqldb.org/doc/1.8/guide/guide.html#N106CC + initializeIfNotExists (root, dataSourcesPrefs, "hsqldbmemory", null, + EnumDatabaseVendor.HSQLDB_IN_MEMORY, null, -1, "PUBLIC", "SA", ""); + initializeIfNotExists (root, dataSourcesPrefs, "hsqldblocalfile", null, + EnumDatabaseVendor.HSQLDB_LOCAL_FILE, null, -1, "PUBLIC", "SA", ""); + */ + // TODO ... QUICK FIX --- + + // --- read all preferences --- +// dataSourceForAuthentication = root.get(DATASOURCE_FOR_AUTHENTICATION, defaultPrefs.getDataSourceNameForAuthentication()); +// dataSourceForBLOB = root.get(DATASOURCE_FOR_BLOB, defaultPrefs.getDataSourceNameForBLOB()); +// dataSourceForBPM = root.get(DATASOURCE_FOR_BPM, defaultPrefs.getDataSourceNameForBPM()); +// dataSourceForBusinessData = root.get(DATASOURCE_FOR_BUSINESSDATA, defaultPrefs.getDataSourceNameForBusinessData()); + for (String dataSourceName : dataSourcesPrefs.childrenNames()) { + Preferences dataSource = dataSourcesPrefs.node(dataSourceName); + String vendorName = dataSource.get(DATASOURCE_ENUM_ITEM, ""); + String driverVendor = dataSource.get(DATASOURCE_DRIVER_VENDOR, ""); + String databaseName = dataSource.get(DATASOURCE_DATABASE_NAME, ""); + EnumDatabaseVendor vendor = EnumDatabaseVendor.byName(vendorName, driverVendor, databaseName); + String driverType = dataSource.get(DATASOURCE_DRIVER_TYPE, ""); + String driverClass = dataSource.get(DATASOURCE_DRIVER_CLASS, ""); + String serverName = dataSource.get(DATASOURCE_SERVER_NAME, ""); + int serverPort = dataSource.getInt(DATASOURCE_SERVER_PORT, 0); + String databaseUser = dataSource.get(DATASOURCE_DATABASE_USER, ""); + String databasePass = dataSource.get(DATASOURCE_DATABASE_PASS, ""); + String jdbcUrlFormat = dataSource.get(DATASOURCE_JDBC_URL_FORMAT, null); + if (!driverClass.isEmpty() && + !databaseName.isEmpty() && !databaseUser.isEmpty()) { + DataSourceConfiguration configuration = new DataSourceConfiguration( + dataSourceName, + vendor, + driverVendor, driverType, driverClass, serverName, + serverPort, databaseName, databaseUser, databasePass, + jdbcUrlFormat); + dataSources.put(dataSourceName, configuration); + } + } + } + + private void initializeEmail() throws Exception { + Preferences authentication = getProductPreferencesNode(AUTHENTICATION_NODE); + adminEmail = authentication.get(AUTHENTICATION_ADMIN_EMAIL_ACCOUNT, defaultPrefs.getAdminEmail()); + adminEmailUsername = authentication.get(AUTHENTICATION_ADMIN_EMAIL_USERNAME, defaultPrefs.getAdminEmailUsername()); + adminEmailPassword = authentication.get(AUTHENTICATION_ADMIN_EMAIL_PASSWORD, defaultPrefs.getAdminEmailPassword()); + Preferences email = getProductPreferencesNode(EMAIL_NODE); + emailServerIp = email.get(EMAIL_SERVER_IP, defaultPrefs.getEmailServerIp()); + emailSmtpPort = email.getInt(EMAIL_SMTP_PORT, 0); + if (emailSmtpPort < 1) { + emailSmtpPort = defaultPrefs.getEmailSmtpPort(); + } + emailUseSslOnConnect = email.getBoolean(EMAIL_USE_SSL_ON_CONNECT, defaultPrefs.isEmailUseSslOnConnect()); + } + + private void initializeBPM() throws Exception { + Preferences bpm = getProductPreferencesNode(BPM_NODE); + bpmServerIp = bpm.get(BPM_SERVER_IP, defaultPrefs.getBpmServerIp()); + bpmServerPort = bpm.getInt(BPM_SERVER_PORT, 0); + if (bpmServerPort < 1) { + bpmServerPort = defaultPrefs.getBpmServerPort(); + } + bpmResponseTimeout = bpm.getInt(BPM_RESPONSE_TIMEOUT, defaultPrefs.getBpmResponseTimeout()); + bpmHibernateShowSql = bpm.getBoolean(BPM_HIBERNATE_SHOW_SQL, defaultPrefs.isBpmEngineHibernateShowSql()); + bpmHibernateFormatSql = bpm.getBoolean(BPM_HIBERNATE_FORMAT_SQL, defaultPrefs.isBpmEngineHibernateFormatSql()); + bpmHibernateMaxFetchDepth = bpm.getInt(BPM_HIBERNATE_MAX_FETCH_DEPTH, defaultPrefs.getBpmEngineHibernateMaxFetchDepth()); + bpmHibernateSchemaName = bpm.get(BPM_HIBERNATE_SCHEMA_NAME, defaultPrefs.getBpmEngineHibernateSchemaName(defaultPrefs.getBpmEnginePersistenceUnit())); + } + + private void initializeIfNotExists(boolean force, Preferences root, Preferences pus, String persistenceUnit, + String dataSource, boolean deployOnStartup, boolean queryCache, + String batchWriting, int batchWritingSize, boolean cacheStatements, int cacheStatementsSize, + String loggingLevel, String dllGeneration, String xmlPath) throws Exception { // NOSONAR + if (force || !pus.nodeExists(persistenceUnit)) { + DataSourceConfiguration dataSourceConfiguration = getDataSource(dataSource); + Preferences pu = pus.node(persistenceUnit); + pu.put (PERSISTENCE_DATASOURCE, dataSource); + pu.putBoolean (PERSISTENCE_DEPLOYONSTARTUP, deployOnStartup); + pu.putBoolean (PERSISTENCE_QUERYCACHE, queryCache); + if (batchWriting == null) { + batchWriting = dataSourceConfiguration.getDefaultBatchWriting(); + } + pu.put (PERSISTENCE_BATCHWRITING, batchWriting); + pu.putInt (PERSISTENCE_BATCHWRITINGSIZE, batchWritingSize); + pu.putBoolean (PERSISTENCE_CACHESTATEMENTS, cacheStatements); + pu.putInt (PERSISTENCE_CACHESTATEMENTSSIZE, cacheStatementsSize); + pu.put (PERSISTENCE_LOGGINGLEVEL, loggingLevel); + pu.put (PERSISTENCE_DDLGENERATION, dllGeneration); + pu.put (PERSISTENCE_PERSISTENCEXMLPATH, xmlPath); + pus.flush(); + root.flush(); + } + } + + private void initializePersistenceUnits() throws Exception { + Preferences root = getProductPreferences(); + Preferences pus = getProductPreferencesNode(PERSISTENCE_NODE); + + // --- generate reasonable default preferences for development product + initializeIfNotExists (false, root, pus, PERSISTENCE_UNIT_AUTHENTICATION, + dataSourceForAuthentication, true, true, + null, 1000, + true, 200, + "off", "create-or-extend-tables", // NOSONAR + PersistenceUnitProperties.ECLIPSELINK_PERSISTENCE_XML_DEFAULT); + initializeIfNotExists (false, root, pus, PERSISTENCE_UNIT_BLOB, + dataSourceForBLOB, true, true, + null, 1000, + true, 200, + "off", "create-or-extend-tables", + PersistenceUnitProperties.ECLIPSELINK_PERSISTENCE_XML_DEFAULT); + initializeIfNotExists (false, root, pus, PERSISTENCE_UNIT_BPM, + dataSourceForBPM, true, true, + null, 1000, + true, 200, + "off", "none", + PersistenceUnitProperties.ECLIPSELINK_PERSISTENCE_XML_DEFAULT); + initializeIfNotExists (false, root, pus, PERSISTENCE_UNIT_BUSINESSDATA, + dataSourceForBusinessData, true, true, + null, 1000, + true, 200, + "off", "create-or-extend-tables", + PersistenceUnitProperties.ECLIPSELINK_PERSISTENCE_XML_DEFAULT); + + // --- read all preferences --- + for (String persistenceUnitName : pus.childrenNames()) { + Preferences pu = pus.node(persistenceUnitName); + String jndiName = pu.get(PERSISTENCE_DATASOURCE, ""); + boolean deployOnStartup = pu.getBoolean(PERSISTENCE_DEPLOYONSTARTUP, PersistenceUnitConfiguration.DEPLOY_ON_STARTUP); + boolean queryCache = pu.getBoolean(PERSISTENCE_QUERYCACHE, PersistenceUnitConfiguration.QUERY_CACHE); + String batchWriting = pu.get(PERSISTENCE_BATCHWRITING, "JDBC"); + int batchWritingSize = pu.getInt(PERSISTENCE_BATCHWRITINGSIZE, PersistenceUnitConfiguration.BATCH_WRITING_SIZE); + boolean cacheStatements = pu.getBoolean(PERSISTENCE_CACHESTATEMENTS, PersistenceUnitConfiguration.CACHE_STATEMENTS); + int cacheStatementSize = pu.getInt(PERSISTENCE_CACHESTATEMENTSSIZE, PersistenceUnitConfiguration.CACHE_STATEMENTS_SIZE); + String loggingLevel = pu.get(PERSISTENCE_LOGGINGLEVEL, PersistenceUnitConfiguration.LOGGING_LEVEL); + String ddlGeneration = pu.get(PERSISTENCE_DDLGENERATION, DDL_GENERATION.UPDATE.eclipseLink()); + String persistenceXMLPath = pu.get(PERSISTENCE_PERSISTENCEXMLPATH, PersistenceUnitProperties.ECLIPSELINK_PERSISTENCE_XML_DEFAULT); + String weaving = pu.get(PERSISTENCE_WEAVING, "static"); + PersistenceUnitConfiguration configuration = new PersistenceUnitConfiguration( + persistenceUnitName, + jndiName, deployOnStartup, + queryCache, batchWriting, batchWritingSize, + cacheStatements, cacheStatementSize, loggingLevel, + ddlGeneration, persistenceXMLPath, weaving); + persistenceUnits.put(persistenceUnitName, configuration); + } + } + + private void initializeProjectWizard() throws Exception { + Preferences projectWizard = getProductPreferencesNode(PROJECT_WIZARD_NODE); + // --- read all preferences --- + projectWizardAbsoluteLocation = projectWizard.getBoolean(PROJECT_WIZARD_ABSOLUTE_LOCATION, defaultPrefs.projectWizardUsesAbsoluteLocation()); + } + + private void initializeDemo() throws Exception { + Preferences demo = getProductPreferencesNode(DEMO_NODE); + demoToolsTheme = demo.getBoolean(DEMO_TOOLS_THEME, defaultPrefs.hasDemoToolsTheme()); + demoToolsStrategy = demo.getBoolean(DEMO_TOOLS_STRATEGY, defaultPrefs.hasDemoToolsStrategy()); + demoToolsLanguage = demo.getBoolean(DEMO_TOOLS_LANGUAGE, defaultPrefs.hasDemoToolsLanguage()); + demoToolsPrintService = demo.getBoolean(DEMO_TOOLS_PRINTSERVICE, defaultPrefs.hasToolsPrintService()); + } + + public void setBpmEngineHibernateShowSql(boolean value) { + bpmHibernateShowSql = put(BPM_NODE, BPM_HIBERNATE_SHOW_SQL, value); + } + + public void setBpmEngineHibernateFormatSql(boolean value) { + bpmHibernateFormatSql = put(BPM_NODE, BPM_HIBERNATE_FORMAT_SQL, value); + } + + public void setBpmEngineHibernateMaxFetchDepth(int value) { + bpmHibernateMaxFetchDepth = put(BPM_NODE, BPM_HIBERNATE_MAX_FETCH_DEPTH, value); + } + + public void setBpmEngineHibernateSchemaName(String value) { + bpmHibernateSchemaName = put(BPM_NODE, BPM_HIBERNATE_SCHEMA_NAME, value); + } + + @Override + public boolean isBpmEngineHibernateShowSql() { + initialize(); + return bpmHibernateShowSql; + } + + @Override + public boolean isBpmEngineHibernateFormatSql() { + initialize(); + return bpmHibernateFormatSql; + } + + @Override + public int getBpmEngineHibernateMaxFetchDepth() { + initialize(); + return bpmHibernateMaxFetchDepth; + } + + @Override + public String getBpmEnginePersistenceUnit() { + return ProductConfigurationDefaultPrefs.BPM_ENGINE_PERSISTENCE_UNIT; + } + + @Override + public String getBpmEngineHibernateSchemaName(String persistenceUnit) { + initialize(); + EnumDatabaseVendor vendor = getDataSourceDatabaseVendor(getPersistenceUnitJndiName(persistenceUnit)); + if (vendor != null) { + return vendor.applySchemaNameSpecifications(bpmHibernateSchemaName); + } + return bpmHibernateSchemaName; + } + + @Override + public String getEmailServerIp() { + initialize(); + return emailServerIp; + } + + @Override + public int getEmailSmtpPort() { + initialize(); + return emailSmtpPort; + } + + @Override + public boolean isEmailUseSslOnConnect() { + initialize(); + return emailUseSslOnConnect; + } + + public void setEmailServerIp(String emailServerIp) { + this.emailServerIp = put(EMAIL_NODE, EMAIL_SERVER_IP, emailServerIp); + } + + public void setEmailSmtpPort(int emailSmtpPort) { + if (emailSmtpPort < 1) { + emailSmtpPort = defaultPrefs.getEmailSmtpPort(); + } + this.emailSmtpPort = put(EMAIL_NODE, EMAIL_SMTP_PORT, emailSmtpPort); + } + + public void setEmailUseSslOnConnect(boolean emailUseSslOnConnect) { + this.emailUseSslOnConnect = put(EMAIL_NODE, EMAIL_USE_SSL_ON_CONNECT, emailUseSslOnConnect); + } + + public void setJavaPosConfiguration(String value) { + this.javaPosConfiguration = put(JAVA_POS_NODE, JAVA_POS_CONFIGURATION, value); + } + + @Override + public String getJavaPosConfiguration() { + return javaPosConfiguration; + } +} diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductFileBase.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductFileBase.java new file mode 100644 index 0000000..ed569f1 --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductFileBase.java @@ -0,0 +1,142 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences; + +import java.io.IOException; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.Attr; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + * Dependencies for the OSBP product bundle <code>*.product</code> file. + */ +public abstract class ProductFileBase extends AbstractConfigurationFileBase { + + /** + * @param document document containing the attributes to be extracted + * @param path root xml path to be extracted + * @param nodes nodes name inside the path to be extracted + * @param idkey name of the node attribute, which should be used as id + * @return map of values with the id as map key and attributes map as map value + */ + public static Map<String,Map<String,String>> getValues(Document document, String path, String nodes, String idkey) { + Map<String,Map<String,String>> results = new TreeMap<String,Map<String,String>>(); + if (document != null) { + String[] paths = path.split("/"); + Element parent = (Element)document.getElementsByTagName(paths[0]).item(0); + for (int i=1; i<paths.length && (parent != null); i++) { + parent = (Element)parent.getElementsByTagName(paths[i]).item(0); + } + if (parent != null) { + NodeList children = parent.getElementsByTagName(nodes); + for (int i=0; i<children.getLength(); i++) { + Element child = (Element)children.item(i); + String id = child.getAttribute(idkey); + if ((id != null) && !id.isEmpty()) { + NamedNodeMap childAttributes = child.getAttributes(); + Map<String,String> attributes = new TreeMap<String,String>(); + for (int a=0; a<childAttributes.getLength(); a++) { + try { + Attr childAttribute = (Attr)childAttributes.item(a); + String key = childAttribute.getName(); + String value = childAttribute.getValue(); + attributes.put(key, value); + } + catch (Exception e) { + } + } + results.put(id, attributes); + } + } + } + } + return results; + } + + /** set of necessary data base vendors defined by the product preferences */ + protected final Set<EnumDatabaseVendor> necessaryDataBaseVendors; + + public ProductFileBase(ProductConfigurationPrefs prefs) { + necessaryDataBaseVendors = prefs.getNecessaryDataBaseVendors(); + } + + public ProductFileBase(ProductConfigurationPrefs prefs, String... jndiNames) { + necessaryDataBaseVendors = prefs.getNecessaryDataBaseVendors(jndiNames); + } + + @Override + public final Map<String, Map<String, String>> getRequiredAsMap() { + return deserialize(getRequiredAsString()); + } + + @Override + public final Map<String, Map<String, String>> getRecommendedAsMap() { + return deserialize(getRecommendedAsString()); + } + + @Override + public final Map<String, Map<String, String>> getDeprecatedAsMap() { + Map<String, Map<String, String>> deprecated = deserialize(getDeprecatedAsString()); + for (String id : getRequiredAsMap().keySet()) { + if (deprecated.containsKey(id)) { + deprecated.remove(id); + } + } + for (String id : getRecommendedAsMap().keySet()) { + if (deprecated.containsKey(id)) { + deprecated.remove(id); + } + } + return deprecated; + } + + @Override + public final String serialize(String id, Map<String,String> attributes) { + ArrayList<String> result = new ArrayList<String>(); + for (String key : attributes.keySet()) { + if (!"id".equals(key)) { + result.add(" "+key+"=\""+attributes.get(key)+"\""); + } + } + return "<plugin id=\""+id+"\""+String.join("", result)+"/>"; + } + + @Override + public Map<String, Map<String, String>> deserialize(String asString) { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + try { + DocumentBuilder builder = factory.newDocumentBuilder(); + InputSource source = new InputSource(new StringReader("<root>"+asString+"</root>")); + Document document = builder.parse(source); + return getValues(document, "root", "plugin", "id"); + } + catch (ParserConfigurationException | SAXException | IOException e) { + e.printStackTrace(); + } + return null; + } +} diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductFileConfigurations.xtend b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductFileConfigurations.xtend new file mode 100644 index 0000000..636b0ef --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductFileConfigurations.xtend @@ -0,0 +1,84 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences + +/** + * <configurations> dependencies for the OSBP product bundle <code>*.product</code> file. + */ +public class ProductFileConfigurations extends ProductFileBase { + + new(ProductConfigurationPrefs prefs) { + super(prefs) + } + + new(ProductConfigurationPrefs prefs, String... jndiNames) { + super(prefs, jndiNames) + } + + override getDeprecatedAsString() { + prepareSerialized( + ''' +${{UNNECESSARY_DATA_BASE_VENDOR_CONFIGURATIONS}} + <plugin id="org.drools.api" autoStart="true" startLevel="4" /> + <plugin id="org.eclipse.osbp.authentication.ui" autoStart="true" startLevel="0" /> + <plugin id="net.osbee.bpm" autoStart="true" startLevel="5" /> + <plugin id="net.osbee.mobile.vaadin.ecview.servlet.mobile" autoStart="true" startLevel="0" /> + ''') + } + + override getRequiredAsString() { + prepareSerialized( + ''' +${{NECESSARY_DATA_BASE_VENDOR_CONFIGURATIONS}} + <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" /> + <plugin id="org.eclipse.e4.ui.services" autoStart="false" startLevel="1" /> + <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" /> + <plugin id="org.eclipse.equinox.coordinator" autoStart="true" startLevel="0" /> + <plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="1" /> + <plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="0" /> + <plugin id="org.eclipse.osbp.dsl.dto.lib" autoStart="true" startLevel="0" /> + <plugin id="org.eclipse.osbp.dsl.metadata.service" autoStart="true" startLevel="3" /> + <plugin id="org.eclipse.osbp.ecview.extension.strategy" autoStart="true" startLevel="0" /> + <plugin id="org.eclipse.osbp.ecview.jetty.manager" autoStart="true" startLevel="0" /> + <plugin id="org.eclipse.osbp.fork.gemini.naming" autoStart="true" startLevel="3" /> + <plugin id="org.eclipse.osbp.osgi.hybrid.api" autoStart="true" startLevel="0" /> + <plugin id="org.eclipse.osbp.persistence" autoStart="true" startLevel="0" /> + <plugin id="org.eclipse.osbp.runtime.ecore.bundlespace" autoStart="true" startLevel="0" /> + <plugin id="org.eclipse.osbp.runtime.event" autoStart="true" startLevel="0" /> + <plugin id="org.eclipse.osbp.runtime.jsr303.validation" autoStart="true" startLevel="4" /> + <plugin id="org.eclipse.osbp.runtime.typeprovider.bundlespace" autoStart="true" startLevel="0" /> + <plugin id="org.eclipse.osbp.utils.entitymock.dbfill.ui" autoStart="true" startLevel="0" /> + <plugin id="org.eclipse.osgi" autoStart="true" startLevel="-1" /> + ''') + } + + override getRecommendedAsString() { + prepareSerialized( + ''' + <plugin id="net.osbee.mobile.vaadin.ecview.servlet.mobile" autoStart="true" startLevel="0" /> + ''') + } + + override prepareSerialized(String asString) { + removeDuplicates(asString + .replace( + "${{NECESSARY_DATA_BASE_VENDOR_CONFIGURATIONS}}", + EnumDatabaseVendor.getNecessaryConfigurations(necessaryDataBaseVendors) + ) + .replace( + "${{UNNECESSARY_DATA_BASE_VENDOR_CONFIGURATIONS}}", + EnumDatabaseVendor.getUnnecessaryConfigurations(necessaryDataBaseVendors) + ) + ) + } +}
\ No newline at end of file diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductFilePlugins.xtend b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductFilePlugins.xtend new file mode 100644 index 0000000..033151a --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductFilePlugins.xtend @@ -0,0 +1,538 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences + +/** + * <plugins> dependencies for the OSBP product bundle <code>*.product</code> file. + */ +public class ProductFilePlugins extends ProductFileBase { + + new(ProductConfigurationPrefs prefs) { + super(prefs) + } + + new(ProductConfigurationPrefs prefs, String... jndiNames) { + super(prefs, jndiNames) + } + + override getDeprecatedAsString() { + prepareSerialized( + ''' +${{UNNECESSARY_DATA_BASE_VENDOR_PLUGINS}} + <plugin id="com.google.protobuf"/> + <plugin id="com.springsource.javax.jms"/> + <plugin id="org.eclipse.osbp.dsl.semantic.common"/> + <plugin id="org.eclipse.osbp.dsl.semantic.common.edit"/> + <plugin id="org.eclipse.osbp.dsl.semantic.dto"/> + <plugin id="org.eclipse.osbp.dsl.semantic.entity"/> + <plugin id="org.eclipse.osbp.dsl.semantic.entity.edit"/> + <plugin id="org.eclipse.osbp.dsl.semantic.service"/> + <plugin id="org.eclipse.osbp.ecview.vaadin.servlet.mobile"/> + <plugin id="org.eclipse.osbp.mobile.vaadin.touchkit.osgi"/> + <plugin id="org.eclipse.osbp.utils.mobile.ui"/> + <plugin id="org.eclipse.osbp.vaaclipse.vaadin.addon.contextmenu"/> + <plugin id="org.eclipse.osbp.vaaclipse.vaadin.addon.dndlayout"/> + ''') + } + + override getRequiredAsString() { + prepareSerialized( + ''' + <plugin id="OpenCSV"/> + <plugin id="activemq-all-osgi-5.9.0"/> + <plugin id="animator.osgi"/> + <plugin id="ca.ecliptical.pde.ds.lib"/> + <plugin id="ch.qos.logback.classic"/> + <plugin id="ch.qos.logback.core"/> + <plugin id="ch.qos.logback.slf4j" fragment="true"/> + <plugin id="com.google.api.translate.osgi"/> + <plugin id="com.google.guava"/> + <plugin id="com.google.gwt.thirdparty.guava"/> + <plugin id="com.google.gwt.thirdparty.streamhtmlparser"/> + <plugin id="com.google.inject"/> + <plugin id="com.google.inject.assistedinject" fragment="true"/> + <plugin id="com.ibm.icu"/> + <plugin id="com.jcraft.jsch"/> + <plugin id="com.lowagie.text"/> + <plugin id="javax.jms"/> + <plugin id="com.springsource.org.antlr.runtime"/> + <plugin id="com.springsource.org.codehaus.commons.compiler"/> + <plugin id="com.springsource.org.codehaus.janino"/> + <plugin id="com.sun.mail.javax.mail"/> + <plugin id="com.vaadin.client"/> + <plugin id="com.vaadin.client-compiled"/> + <plugin id="com.vaadin.external.atmosphere.runtime"/> + <plugin id="com.vaadin.external.org.slf4j"/> + <plugin id="com.vaadin.push"/> + <plugin id="com.vaadin.sass-compiler"/> + <plugin id="com.vaadin.server"/> + <plugin id="com.vaadin.shared"/> + <plugin id="com.vaadin.theme-compiler"/> + <plugin id="com.vaadin.themes"/> + <plugin id="commons-vfs-osgi"/> + <plugin id="contextmenu.osgi"/> + <plugin id="dCharts.osgi"/> + <plugin id="dragdroplayouts.osgi"/> + <plugin id="dom.osgi"/> + <plugin id="dragdroplayouts.osgi"/> + <plugin id="easyuploads.osgi"/> + <plugin id="filteringtable.osgi"/> + <plugin id="groovy-all"/> + <plugin id="iban4j"/> + <plugin id="jackrabbit-jcr-commons-osgi"/> + <plugin id="jackrabbit-webdav-osgi"/> + <plugin id="jackson-core-asl"/> + <plugin id="java-cup.osgi"/> + <plugin id="javax.annotation"/> + <plugin id="javax.el"/> + <plugin id="javax.inject"/> + <plugin id="javax.jcr"/> + <plugin id="javax.persistence"/> + <plugin id="javax.servlet"/> + <plugin id="javax.transaction" fragment="true"/> + <plugin id="javax.validation.api"/> + <plugin id="javax.ws.rs.jsr311-api"/> + <plugin id="javax.wsdl"/> + <plugin id="javax.xml"/> + <plugin id="javax.xml.stream"/> + <plugin id="jaxen"/> + <plugin id="joda-time"/> + <plugin id="mondrian.osgi"/> + <plugin id="multifileupload.osgi"/> + <plugin id="net.osbee.vaaclipse.designer"/> + <plugin id="net.osbee.vaadin.designer"/> + <plugin id="olap4j-xmla.osgi"/> + <plugin id="olap4j.osgi"/> + <plugin id="org.antlr.runtime"/> + <plugin id="org.apache.ant"/> + <plugin id="org.apache.batik.bridge"/> + <plugin id="org.apache.batik.css"/> + <plugin id="org.apache.batik.dom"/> + <plugin id="org.apache.batik.dom.svg"/> + <plugin id="org.apache.batik.ext.awt"/> + <plugin id="org.apache.batik.parser"/> + <plugin id="org.apache.batik.svggen"/> + <plugin id="org.apache.batik.transcoder"/> + <plugin id="org.apache.batik.util"/> + <plugin id="org.apache.batik.util.gui"/> + <plugin id="org.apache.batik.xml"/> + <plugin id="org.apache.bval.org.apache.bval.bundle"/> + <plugin id="org.apache.commons.beanutils"/> + <plugin id="org.apache.commons.cli"/> + <plugin id="org.apache.commons.codec"/> + <plugin id="org.apache.commons.collections"/> + <plugin id="org.apache.commons.compress"/> + <plugin id="org.apache.commons.dbcp"/> + <plugin id="org.apache.commons.digester"/> + <plugin id="org.apache.commons.discovery"/> + <plugin id="org.apache.commons.email"/> + <plugin id="org.apache.commons.exec"/> + <plugin id="org.apache.commons.httpclient"/> + <plugin id="org.apache.commons.io"/> + <plugin id="org.apache.commons.jexl"/> + <plugin id="org.apache.commons.lang"/> + <plugin id="org.apache.commons.lang3"/> + <plugin id="org.apache.commons.logging"/> + <plugin id="org.apache.commons.math"/> + <plugin id="org.apache.commons.math3"/> + <plugin id="org.apache.commons.net"/> + <plugin id="org.apache.commons.pool"/> + <plugin id="org.apache.commons.vfs"/> + <plugin id="org.apache.commons.validator"/> + <plugin id="org.apache.cxf.cxf-core"/> + <plugin id="org.apache.cxf.cxf-rt-bindings-soap"/> + <plugin id="org.apache.cxf.cxf-rt-bindings-xml"/> + <plugin id="org.apache.cxf.cxf-rt-databinding-jaxb"/> + <plugin id="org.apache.cxf.cxf-rt-frontend-jaxws"/> + <plugin id="org.apache.cxf.cxf-rt-frontend-simple"/> + <plugin id="org.apache.cxf.cxf-rt-transports-http"/> + <plugin id="org.apache.cxf.cxf-rt-wsdl"/> + <plugin id="org.apache.felix.gogo.command"/> + <plugin id="org.apache.felix.gogo.runtime"/> + <plugin id="org.apache.felix.gogo.shell"/> + <plugin id="org.apache.httpcomponents.httpclient"/> + <plugin id="org.apache.httpcomponents.httpcore"/> + <plugin id="org.apache.log4j"/> + <plugin id="org.apache.pdfbox.fontbox"/> + <plugin id="org.apache.pdfbox"/> + <plugin id="org.apache.servicemix.bundles.jexcelapi"/> + <plugin id="org.apache.servicemix.bundles.wsdl4j"/> + <plugin id="org.apache.servicemix.bundles.xpp3"/> + <plugin id="org.apache.ws.xmlschema.core"/> + <plugin id="org.apache.xerces"/> + <plugin id="org.apache.xml.resolver"/> + <plugin id="org.apache.xml.serializer"/> + <plugin id="org.drools.api"/> + <plugin id="org.eclipse.birt.core"/> + <plugin id="org.eclipse.birt.data"/> + <plugin id="org.eclipse.birt.data.aggregation"/> + <plugin id="org.eclipse.birt.report.data.adapter"/> + <plugin id="org.eclipse.birt.report.engine"/> + <plugin id="org.eclipse.birt.report.engine.emitter.html"/> + <plugin id="org.eclipse.birt.report.engine.emitter.pdf"/> + <plugin id="org.eclipse.birt.report.engine.fonts"/> + <plugin id="org.eclipse.birt.report.engine.script.javascript"/> + <plugin id="org.eclipse.birt.report.model"/> + <plugin id="org.eclipse.bpmn2"/> + <plugin id="org.eclipse.bpmn2.edit"/> + <plugin id="org.eclipse.compare.core"/> + <plugin id="org.eclipse.core.commands"/> + <plugin id="org.eclipse.core.contenttype"/> + <plugin id="org.eclipse.core.databinding"/> + <plugin id="org.eclipse.core.databinding.beans"/> + <plugin id="org.eclipse.core.databinding.observable"/> + <plugin id="org.eclipse.core.databinding.property"/> + <plugin id="org.eclipse.core.expressions"/> + <plugin id="org.eclipse.core.filebuffers"/> + <plugin id="org.eclipse.core.filesystem"/> + <plugin id="org.eclipse.core.jobs"/> + <plugin id="org.eclipse.core.resources"/> + <plugin id="org.eclipse.core.runtime"/> + <plugin id="org.eclipse.core.runtime.compatibility.registry" fragment="true"/> + <plugin id="org.eclipse.core.variables"/> + <plugin id="org.eclipse.datatools.connectivity"/> + <plugin id="org.eclipse.datatools.connectivity.oda"/> + <plugin id="org.eclipse.datatools.connectivity.oda.consumer"/> + <plugin id="org.eclipse.datatools.connectivity.oda.design"/> + <plugin id="org.eclipse.datatools.connectivity.oda.profile"/> + <plugin id="org.eclipse.debug.core"/> + <plugin id="org.eclipse.e4.core.commands"/> + <plugin id="org.eclipse.e4.core.contexts"/> + <plugin id="org.eclipse.e4.core.di"/> + <plugin id="org.eclipse.e4.core.di.extensions"/> + <plugin id="org.eclipse.e4.core.services" version="1.2.1.v20140808-1251"/> + <plugin id="org.eclipse.e4.ui.di"/> + <plugin id="org.eclipse.e4.ui.model.workbench"/> + <plugin id="org.eclipse.e4.ui.model.workbench.edit"/> + <plugin id="org.eclipse.e4.ui.services"/> + <plugin id="org.eclipse.e4.ui.workbench"/> + <plugin id="org.eclipse.emf.codegen"/> + <plugin id="org.eclipse.emf.codegen.ecore"/> + <plugin id="org.eclipse.emf.codegen.ecore.xtext"/> + <plugin id="org.eclipse.emf.common"/> + <plugin id="org.eclipse.emf.databinding"/> + <plugin id="org.eclipse.emf.databinding.edit"/> + <plugin id="org.eclipse.emf.ecore"/> + <plugin id="org.eclipse.emf.ecore.change"/> + <plugin id="org.eclipse.emf.ecore.change.edit"/> + <plugin id="org.eclipse.emf.ecore.edit"/> + <plugin id="org.eclipse.emf.ecore.xcore"/> + <plugin id="org.eclipse.emf.ecore.xcore.lib"/> + <plugin id="org.eclipse.emf.ecore.xmi"/> + <plugin id="org.eclipse.emf.edit"/> + <plugin id="org.eclipse.emf.mwe.core"/> + <plugin id="org.eclipse.emf.mwe.utils"/> + <plugin id="org.eclipse.emf.mwe2.runtime"/> + <plugin id="org.eclipse.equinox.app"/> + <plugin id="org.eclipse.equinox.bidi"/> + <plugin id="org.eclipse.equinox.common"/> + <plugin id="org.eclipse.equinox.console"/> + <plugin id="org.eclipse.equinox.coordinator"/> + <plugin id="org.eclipse.equinox.ds"/> + <plugin id="org.eclipse.equinox.event"/> + <plugin id="org.eclipse.equinox.http.registry"/> + <plugin id="org.eclipse.equinox.http.servlet"/> + <plugin id="org.eclipse.equinox.preferences"/> + <plugin id="org.eclipse.equinox.registry"/> + <plugin id="org.eclipse.equinox.security"/> + <plugin id="org.eclipse.equinox.util"/> + <plugin id="org.eclipse.gemini.dbaccess.util"/> + <plugin id="org.eclipse.help"/> + <plugin id="org.eclipse.jdt.compiler.apt" fragment="true"/> + <plugin id="org.eclipse.jdt.compiler.tool" fragment="true"/> + <plugin id="org.eclipse.jdt.core"/> + <plugin id="org.eclipse.jdt.debug"/> + <plugin id="org.eclipse.jdt.launching"/> + <plugin id="org.eclipse.jetty.continuation"/> + <plugin id="org.eclipse.jetty.http"/> + <plugin id="org.eclipse.jetty.io"/> + <plugin id="org.eclipse.jetty.security"/> + <plugin id="org.eclipse.jetty.server"/> + <plugin id="org.eclipse.jetty.servlet"/> + <plugin id="org.eclipse.jetty.util"/> + <plugin id="org.eclipse.jetty.websocket"/> + <plugin id="org.eclipse.osbp.authentication"/> + <plugin id="org.eclipse.osbp.authentication.ui"/> + <plugin id="org.eclipse.osbp.bpm.api"/> + <plugin id="org.eclipse.osbp.bpmn2.ecore"/> + <plugin id="org.eclipse.osbp.commons"/> + <plugin id="org.eclipse.osbp.dsl.common.xtext"/> + <plugin id="org.eclipse.osbp.dsl.datatype.lib"/> + <plugin id="org.eclipse.osbp.dsl.datatype.xtext"/> + <plugin id="org.eclipse.osbp.dsl.dto.lib"/> + <plugin id="org.eclipse.osbp.dsl.dto.xtext"/> + <plugin id="org.eclipse.osbp.dsl.entity.xtext"/> + <plugin id="org.eclipse.osbp.dsl.metadata.service"/> + <plugin id="org.eclipse.osbp.dsl.mwe"/> + <plugin id="org.eclipse.osbp.dsl.xtext.builder.participant"/> + <plugin id="org.eclipse.osbp.dsl.xtext.lazyresolver"/> + <plugin id="org.eclipse.osbp.dsl.xtext.lazyresolver.api"/> + <plugin id="org.eclipse.osbp.e4extension"/> + <plugin id="org.eclipse.osbp.e4modelextension"/> + <plugin id="org.eclipse.osbp.ecview.core.common"/> + <plugin id="org.eclipse.osbp.ecview.core.common.editparts.emf"/> + <plugin id="org.eclipse.osbp.ecview.core.common.model"/> + <plugin id="org.eclipse.osbp.ecview.core.common.model.edit"/> + <plugin id="org.eclipse.osbp.ecview.core.databinding.beans"/> + <plugin id="org.eclipse.osbp.ecview.core.databinding.emf"/> + <plugin id="org.eclipse.osbp.ecview.core.emf.api"/> + <plugin id="org.eclipse.osbp.ecview.core.extension.editparts"/> + <plugin id="org.eclipse.osbp.ecview.core.extension.editparts.emf"/> + <plugin id="org.eclipse.osbp.ecview.core.extension.model"/> + <plugin id="org.eclipse.osbp.ecview.core.extension.model.edit"/> + <plugin id="org.eclipse.osbp.ecview.core.ui.presentation.common"/> + <plugin id="org.eclipse.osbp.ecview.core.util.emf"/> + <plugin id="org.eclipse.osbp.ecview.dsl"/> + <plugin id="org.eclipse.osbp.ecview.dsl.lib"/> + <plugin id="org.eclipse.osbp.ecview.extension.api"/> + <plugin id="org.eclipse.osbp.ecview.extension.editparts"/> + <plugin id="org.eclipse.osbp.ecview.extension.editparts.emf"/> + <plugin id="org.eclipse.osbp.ecview.extension.grid.editparts"/> + <plugin id="org.eclipse.osbp.ecview.extension.grid.editparts.emf"/> + <plugin id="org.eclipse.osbp.ecview.extension.grid.model"/> + <plugin id="org.eclipse.osbp.ecview.extension.grid.model.edit"/> + <plugin id="org.eclipse.osbp.ecview.extension.grid.presentation"/> + <plugin id="org.eclipse.osbp.ecview.extension.grid.presentation.clientside"/> + <plugin id="org.eclipse.osbp.ecview.extension.model"/> + <plugin id="org.eclipse.osbp.ecview.extension.model.edit"/> + <plugin id="org.eclipse.osbp.ecview.extension.presentation.vaadin"/> + <plugin id="org.eclipse.osbp.ecview.extension.services"/> + <plugin id="org.eclipse.osbp.ecview.extension.strategy"/> + <plugin id="org.eclipse.osbp.ecview.extension.widgetset"/> + <plugin id="org.eclipse.osbp.ecview.jetty.manager"/> + <plugin id="org.eclipse.osbp.ecview.uisemantics"/> + <plugin id="org.eclipse.osbp.ecview.xtext.builder.participant"/> + <plugin id="org.eclipse.osbp.ecview.xtext.builder.participant.i18n"/> + <plugin id="org.eclipse.osbp.eventbroker"/> + <plugin id="org.eclipse.osbp.filter"/> + <plugin id="org.eclipse.osbp.fork.gemini.naming"/> + <plugin id="org.eclipse.osbp.fork.vaadin.addon.maskedtextfield"/> + <plugin id="org.eclipse.osbp.gitinfo"/> + <plugin id="org.eclipse.osbp.i18n.common"/> + <plugin id="org.eclipse.osbp.infogrid.api"/> + <plugin id="org.eclipse.osbp.infogrid.ecview"/> + <plugin id="org.eclipse.osbp.infogrid.model"/> + <plugin id="org.eclipse.osbp.infogrid.services"/> + <plugin id="org.eclipse.osbp.infogrid.vaaclipse"/> + <plugin id="org.eclipse.osbp.infogrid.vaadin"/> + <plugin id="org.eclipse.osbp.mobile.vaadin.ecview.api"/> + <plugin id="org.eclipse.osbp.mobile.vaadin.ecview.editparts"/> + <plugin id="org.eclipse.osbp.mobile.vaadin.ecview.editparts.emf"/> + <plugin id="org.eclipse.osbp.mobile.vaadin.ecview.model"/> + <plugin id="org.eclipse.osbp.mondrian"/> + <plugin id="org.eclipse.osbp.mondrian.api"/> + <plugin id="org.eclipse.osbp.osgi.hybrid.api"/> + <plugin id="org.eclipse.osbp.osgi.hybrid.api.runtime"/> + <plugin id="org.eclipse.osbp.persistence"/> + <plugin id="org.eclipse.osbp.preferences"/> + <plugin id="org.eclipse.osbp.runtime.common"/> + <plugin id="org.eclipse.osbp.runtime.designer.api"/> + <plugin id="org.eclipse.osbp.runtime.ecore.bundlespace"/> + <plugin id="org.eclipse.osbp.runtime.event"/> + <plugin id="org.eclipse.osbp.runtime.jsr303.validation"/> + <plugin id="org.eclipse.osbp.runtime.systemextension" fragment="true"/> + <plugin id="org.eclipse.osbp.runtime.typeprovider.bundlespace"/> + <plugin id="org.eclipse.osbp.runtime.web.atmosphere.fragment" fragment="true"/> + <plugin id="org.eclipse.osbp.runtime.web.common"/> + <plugin id="org.eclipse.osbp.runtime.web.ecview.presentation.vaadin"/> + <plugin id="org.eclipse.osbp.runtime.web.vaadin.common"/> + <plugin id="org.eclipse.osbp.runtime.web.vaadin.components"/> + <plugin id="org.eclipse.osbp.runtime.web.vaadin.components.widget"/> + <plugin id="org.eclipse.osbp.runtime.web.vaadin.databinding"/> + <plugin id="org.eclipse.osbp.runtime.web.vaadin.widgetset"/> + <plugin id="org.eclipse.osbp.themes"/> + <plugin id="org.eclipse.osbp.ui.api"/> + <plugin id="org.eclipse.osbp.ui.common"/> + <plugin id="org.eclipse.osbp.user"/> + <plugin id="org.eclipse.osbp.utils"/> + <plugin id="org.eclipse.osbp.utils.blob"/> + <plugin id="org.eclipse.osbp.utils.bpmn"/> + <plugin id="org.eclipse.osbp.utils.entitymock.dbfill.ui"/> + <plugin id="org.eclipse.osbp.utils.functionnormalizer"/> + <plugin id="org.eclipse.osbp.utils.img"/> + <plugin id="org.eclipse.osbp.utils.js"/> + <plugin id="org.eclipse.osbp.utils.themes.ui"/> + <plugin id="org.eclipse.osbp.utils.ui"/> + <plugin id="org.eclipse.osbp.vaaclipse.additions"/> + <plugin id="org.eclipse.osbp.vaaclipse.addons.app"/> + <plugin id="org.eclipse.osbp.vaaclipse.addons.application"/> + <plugin id="org.eclipse.osbp.vaaclipse.addons.common"/> + <plugin id="org.eclipse.osbp.vaaclipse.addons.common.api"/> + <plugin id="org.eclipse.osbp.vaaclipse.addons.ecview"/> + <plugin id="org.eclipse.osbp.vaaclipse.addons.ecview.lib"/> + <plugin id="org.eclipse.osbp.vaaclipse.addons.keybinding"/> + <plugin id="org.eclipse.osbp.vaaclipse.addons.perspective"/> + <plugin id="org.eclipse.osbp.vaaclipse.addons.problems"/> + <plugin id="org.eclipse.osbp.vaaclipse.addons.softwarefactory"/> + <plugin id="org.eclipse.osbp.vaaclipse.api"/> + <plugin id="org.eclipse.osbp.vaaclipse.behaviour"/> + <plugin id="org.eclipse.osbp.vaaclipse.behaviour.source"/> + <plugin id="org.eclipse.osbp.vaaclipse.common.ecview"/> + <plugin id="org.eclipse.osbp.vaaclipse.common.ecview.api"/> + <plugin id="org.eclipse.osbp.vaaclipse.contributions"/> + <plugin id="org.eclipse.osbp.vaaclipse.emf"/> + <plugin id="org.eclipse.osbp.vaaclipse.emf.addon"/> + <plugin id="org.eclipse.osbp.vaaclipse.emf.api"/> + <plugin id="org.eclipse.osbp.vaaclipse.presentation"/> + <plugin id="org.eclipse.osbp.vaaclipse.publicapi"/> + <plugin id="org.eclipse.osbp.vaaclipse.resources" fragment="true"/> + <plugin id="org.eclipse.osbp.vaaclipse.theme"/> + <plugin id="org.eclipse.osbp.vaaclipse.ui.preferences.addon"/> + <plugin id="org.eclipse.osbp.vaaclipse.ui.preferences.model"/> + <plugin id="org.eclipse.osbp.vaaclipse.util"/> + <plugin id="org.eclipse.osbp.vaaclipse.widgets"/> + <plugin id="org.eclipse.osbp.vaaclipse.widgetset.default"/> + <plugin id="org.eclipse.osbp.vaadin"/> + <plugin id="org.eclipse.osbp.vaadin.addons.absolutelayout"/> + <plugin id="org.eclipse.osbp.vaadin.addons.designer.overlay"/> + <plugin id="org.eclipse.osbp.vaadin.addons.suggesttext"/> + <plugin id="org.eclipse.osbp.vaadin.emf"/> + <plugin id="org.eclipse.osbp.vaadin.emf.api"/> + <plugin id="org.eclipse.osbp.vaadin.widgetset"/> + <plugin id="org.eclipse.osbp.webserver.messagequeue"/> + <plugin id="org.eclipse.osbp.xtext.action"/> + <plugin id="org.eclipse.osbp.xtext.addons"/> + <plugin id="org.eclipse.osbp.xtext.authorizationdsl"/> + <plugin id="org.eclipse.osbp.xtext.basic"/> + <plugin id="org.eclipse.osbp.xtext.blip"/> + <plugin id="org.eclipse.osbp.xtext.builder.metadata.services"/> + <plugin id="org.eclipse.osbp.xtext.builder.types.bundles"/> + <plugin id="org.eclipse.osbp.xtext.builder.types.loader.api"/> + <plugin id="org.eclipse.osbp.xtext.builder.types.loader.runtime"/> + <plugin id="org.eclipse.osbp.xtext.builder.xbase.setups"/> + <plugin id="org.eclipse.osbp.xtext.chart"/> + <plugin id="org.eclipse.osbp.xtext.cubedsl"/> + <plugin id="org.eclipse.osbp.xtext.datainterchange"/> + <plugin id="org.eclipse.osbp.xtext.datainterchange.common"/> + <plugin id="org.eclipse.osbp.xtext.datamart.common"/> + <plugin id="org.eclipse.osbp.xtext.datamartdsl"/> + <plugin id="org.eclipse.osbp.xtext.dialogdsl"/> + <plugin id="org.eclipse.osbp.xtext.entitymock"/> + <plugin id="org.eclipse.osbp.xtext.functionlibrary.common"/> + <plugin id="org.eclipse.osbp.xtext.functionlibrary.common.api"/> + <plugin id="org.eclipse.osbp.xtext.functionlibrarydsl"/> + <plugin id="org.eclipse.osbp.xtext.functionlibrarydsl.provider"/> + <plugin id="org.eclipse.osbp.xtext.gridsource"/> + <plugin id="org.eclipse.osbp.xtext.i18n"/> + <plugin id="org.eclipse.osbp.xtext.menu"/> + <plugin id="org.eclipse.osbp.xtext.messagedsl"/> + <plugin id="org.eclipse.osbp.xtext.organizationdsl"/> + <plugin id="org.eclipse.osbp.xtext.perspective"/> + <plugin id="org.eclipse.osbp.xtext.reportdsl"/> + <plugin id="org.eclipse.osbp.xtext.reportdsl.oda.datamart"/> + <plugin id="org.eclipse.osbp.xtext.strategy"/> + <plugin id="org.eclipse.osbp.xtext.table"/> + <plugin id="org.eclipse.osbp.xtext.table.common"/> + <plugin id="org.eclipse.osbp.xtext.topologydsl"/> + <plugin id="org.eclipse.osgi"/> + <plugin id="org.eclipse.osgi.compatibility.state" fragment="true"/> + <plugin id="org.eclipse.osgi.services"/> + <plugin id="org.eclipse.osgi.util"/> + <plugin id="org.eclipse.persistence.antlr"/> + <plugin id="org.eclipse.persistence.asm"/> + <plugin id="org.eclipse.persistence.core"/> + <plugin id="org.eclipse.persistence.jpa"/> + <plugin id="org.eclipse.persistence.jpa.jpql"/> + <plugin id="org.eclipse.text"/> + <plugin id="org.eclipse.uomo.core"/> + <plugin id="org.eclipse.uomo.ucum"/> + <plugin id="org.eclipse.uomo.ui"/> + <plugin id="org.eclipse.uomo.units"/> + <plugin id="org.eclipse.uomo.util"/> + <plugin id="org.eclipse.uomo.xml"/> + <plugin id="org.eclipse.xpand"/> + <plugin id="org.eclipse.xsd"/> + <plugin id="org.eclipse.xsd.edit"/> + <plugin id="org.eclipse.xtend"/> + <plugin id="org.eclipse.xtend.lib"/> + <plugin id="org.eclipse.xtend.lib.macro"/> + <plugin id="org.eclipse.xtend.typesystem.emf"/> + <plugin id="org.eclipse.xtext"/> + <plugin id="org.eclipse.xtext.common.types"/> + <plugin id="org.eclipse.xtext.common.types.edit"/> + <plugin id="org.eclipse.xtext.ecore"/> + <plugin id="org.eclipse.xtext.generator"/> + <plugin id="org.eclipse.xtext.util"/> + <plugin id="org.eclipse.xtext.xbase"/> + <plugin id="org.eclipse.xtext.xbase.lib"/> + <plugin id="org.freemarker.freemarker"/> + <plugin id="org.glassfish.javax.json"/> + <plugin id="org.hamcrest.core"/> + <plugin id="org.jivesoftware.smack"/> + <plugin id="org.joda.convert"/> + <plugin id="org.joda.money"/> + <plugin id="org.json"/> + <plugin id="org.jsoup"/> + <plugin id="org.junit"/> + <plugin id="org.milyn.smooks.osgi"/> + <plugin id="org.mozilla.javascript"/> + <plugin id="org.mvel2"/> + <plugin id="org.objectweb.asm"/> + <plugin id="org.restlet"/> + <plugin id="org.slf4j.api"/> + <plugin id="org.unitsofmeasurement.unit-api"/> + <plugin id="org.vaadin.addons.vaadin-grid-util"/> + <plugin id="org.w3c.css.sac"/> + <plugin id="org.w3c.dom.events"/> + <plugin id="org.w3c.dom.smil"/> + <plugin id="org.w3c.dom.svg"/> + <plugin id="org.w3c.flute"/> + <plugin id="org.w3c.sac"/> + <plugin id="org.xmlpull"/> + <plugin id="org.yaml.snakeyaml"/> + <plugin id="osgi.enterprise"/> + <plugin id="osgi.sun"/> + <plugin id="overlays.osgi"/> + <plugin id="popupbutton.osgi"/> + <plugin id="refresher.osgi"/> + <plugin id="sizereporter.osgi"/> + <plugin id="xstream"/> +${{NECESSARY_DATA_BASE_VENDOR_PLUGINS}} + ''') + } + + override getRecommendedAsString() { + prepareSerialized( + ''' + <plugin id="net.osbee.bpm"/> + <plugin id="net.osbee.mobile.vaadin.ecview.presentation"/> + <plugin id="net.osbee.mobile.vaadin.ecview.servlet.mobile"/> + <plugin id="net.osbee.mobile.vaadin.touchkit.osgi"/> + <plugin id="net.osbee.mobile.vaadin.utils"/> + <plugin id="net.osbee.mobile.vaadin.widgetset"/> + <plugin id="net.osbee.organization.permissions"/> + <plugin id="net.osbee.utils.js"/> + <plugin id="net.osbee.vaaclipse.designer"/> + <plugin id="net.osbee.vaadin.designer"/> + <plugin id="net.osbee.xtext.cubedsl"/> + <plugin id="net.osbee.xtext.cubedsl.services"/> + <plugin id="net.osbee.xtext.organizationdsl"/> + <plugin id="net.osbee.xtext.organizationdsl.api"/> + <plugin id="net.osbee.xtext.organizationdsl.services"/> + <plugin id="net.osbee.xtext.organizationdsl.vaaclipse"/> + ''') + } + + override prepareSerialized(String asString) { + removeDuplicates(asString + .replace( + "${{NECESSARY_DATA_BASE_VENDOR_PLUGINS}}", + EnumDatabaseVendor.getNecessaryPlugins(necessaryDataBaseVendors) + ) + .replace( + "${{UNNECESSARY_DATA_BASE_VENDOR_PLUGINS}}", + EnumDatabaseVendor.getUnnecessaryPlugins(necessaryDataBaseVendors) + ) + ) + } +}
\ No newline at end of file diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductInstanceScope.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductInstanceScope.java new file mode 100644 index 0000000..267ff49 --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/ProductInstanceScope.java @@ -0,0 +1,97 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import org.eclipse.core.internal.preferences.AbstractScope; +import org.eclipse.core.internal.preferences.InstancePreferences; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.preferences.IEclipsePreferences; +import org.eclipse.core.runtime.preferences.InstanceScope; +import org.osgi.service.prefs.BackingStoreException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public final class ProductInstanceScope extends AbstractScope { + + private static final Logger LOGGER = LoggerFactory.getLogger(ProductInstanceScope.class); + + public static final String SCOPE = InstanceScope.SCOPE; + + private static final String DEFAULT_FILE = "DEFAULTFILE"; + + private final String productConfigurationFile; + + /** + * Create and return a new project scope for the given project. The given + * project must not be <code>null</code>. + * + * @exception IllegalArgumentException if the project is <code>null</code> + */ + public ProductInstanceScope() { + String property = System.getProperty("productConfigurationFile"); + productConfigurationFile = property == null ? null : property.replaceAll(DEFAULT_FILE, ProductConfigurationPrefs.PREFERENCES_FULL_PATH); + } + + /* + * @see org.eclipse.core.runtime.preferences.IScopeContext#getLocation() + */ + @Override + public IPath getLocation() { + return productConfigurationFile == null ? null : new Path(productConfigurationFile); + } + + /* + * @see org.eclipse.core.runtime.IScopeContext#getNode(java.lang.String) + */ + @Override + public IEclipsePreferences getNode(String qualifier) { + if (qualifier == null) + throw new IllegalArgumentException(); + IEclipsePreferences preference = super.getNode(qualifier); + if (productConfigurationFile != null) { + try { + Class<?> preferenceClass = preference.getClass(); + Method getLoadLevel = preferenceClass.getDeclaredMethod("getLoadLevel"); + getLoadLevel.setAccessible(true); + InstancePreferences loadLevelInstance = (InstancePreferences) getLoadLevel.invoke(preference); + Class<?>loadLevelClass = loadLevelInstance.getClass(); + Field locationField = loadLevelClass.getDeclaredField("location"); + locationField.setAccessible(true); + IPath activeLocation = (IPath) locationField.get(loadLevelInstance); + if ((activeLocation == null) || !activeLocation.toOSString().equals(getLocation().toOSString())) { + locationField.set(loadLevelInstance, getLocation()); + preference.sync(); + LOGGER.info("set preference file to: "+getLocation().toOSString()); + } + preference.sync(); + } + catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException | BackingStoreException | NoSuchMethodException | SecurityException | InvocationTargetException x) { + LOGGER.error("exception while trying to check and set preference file", x); + } + } + return preference; + } + + /* + * @see org.eclipse.core.runtime.preferences.IScopeContext#getName() + */ + @Override + public String getName() { + return SCOPE; + } +} diff --git a/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/StaticConfiguration.java b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/StaticConfiguration.java new file mode 100644 index 0000000..5b23352 --- /dev/null +++ b/org.eclipse.osbp.preferences/src/org/eclipse/osbp/preferences/StaticConfiguration.java @@ -0,0 +1,41 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ + package org.eclipse.osbp.preferences; + +public class StaticConfiguration implements IShiroConfiguration { + private final String fName; + private final int fPortalId; + + public StaticConfiguration(String className, int portalId) { + fName = className; + fPortalId = portalId; + } + + @Override + public String getName() { + return fName; + } + + public int getPortalId() { + return fPortalId; + } + + @Override + public String getShiroConfiguration(String realmName) { + String retcode; + retcode = realmName+" = "+fName+INI_NEWLINE; + retcode += realmName+".portalId = "+fPortalId+INI_NEWLINE; + return retcode; + } + +} diff --git a/org.eclipse.osbp.preferences/xml/Blob.xml b/org.eclipse.osbp.preferences/xml/Blob.xml new file mode 100644 index 0000000..fc2d5b3 --- /dev/null +++ b/org.eclipse.osbp.preferences/xml/Blob.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<blob> + <mimeTypes mimeVersion="1.0" contentTransferEncoding="8bit"> + <contentType>text/plain</contentType> + <contentType>image/jpeg</contentType> + <contentType>audio/basic</contentType> + <contentType>video/mpeg</contentType> + </mimeTypes> + <attributes> + <size/> + <resolution/> + </attributes> + <normalizer> + <resolution id="small">16x16</resolution> + <resolution id="mid">64x64</resolution> + <resolution id="portrait">64x128</resolution> + <resolution id="unnormalized">unknown</resolution> + </normalizer> +</blob>
\ No newline at end of file diff --git a/org.eclipse.osbp.preferences/xtend-gen/org/eclipse/osbp/preferences/ProductFileConfigurations.java b/org.eclipse.osbp.preferences/xtend-gen/org/eclipse/osbp/preferences/ProductFileConfigurations.java new file mode 100644 index 0000000..9b6514c --- /dev/null +++ b/org.eclipse.osbp.preferences/xtend-gen/org/eclipse/osbp/preferences/ProductFileConfigurations.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences; + +import org.eclipse.osbp.preferences.EnumDatabaseVendor; +import org.eclipse.osbp.preferences.ProductConfigurationPrefs; +import org.eclipse.osbp.preferences.ProductFileBase; +import org.eclipse.xtend2.lib.StringConcatenation; + +/** + * <configurations> dependencies for the OSBP product bundle <code>*.product</code> file. + */ +@SuppressWarnings("all") +public class ProductFileConfigurations extends ProductFileBase { + public ProductFileConfigurations(final ProductConfigurationPrefs prefs) { + super(prefs); + } + + public ProductFileConfigurations(final ProductConfigurationPrefs prefs, final String... jndiNames) { + super(prefs, jndiNames); + } + + public String getDeprecatedAsString() { + StringConcatenation _builder = new StringConcatenation(); + _builder.append("${{UNNECESSARY_DATA_BASE_VENDOR_CONFIGURATIONS}}"); + _builder.newLine(); + _builder.append("\t\t"); + _builder.append("<plugin id=\"org.drools.api\" autoStart=\"true\" startLevel=\"4\" />"); + _builder.newLine(); + _builder.append("\t\t"); + _builder.append("<plugin id=\"org.eclipse.osbp.authentication.ui\" autoStart=\"true\" startLevel=\"0\" />"); + _builder.newLine(); + _builder.append("\t\t"); + _builder.append("<plugin id=\"net.osbee.bpm\" autoStart=\"true\" startLevel=\"5\" />"); + _builder.newLine(); + _builder.append("\t\t"); + _builder.append("<plugin id=\"net.osbee.mobile.vaadin.ecview.servlet.mobile\" autoStart=\"true\" startLevel=\"0\" />"); + _builder.newLine(); + return this.prepareSerialized(_builder.toString()); + } + + public String getRequiredAsString() { + StringConcatenation _builder = new StringConcatenation(); + _builder.append("${{NECESSARY_DATA_BASE_VENDOR_CONFIGURATIONS}}"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.core.runtime\" autoStart=\"true\" startLevel=\"0\" />"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.e4.ui.services\" autoStart=\"false\" startLevel=\"1\" />"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.equinox.common\" autoStart=\"true\" startLevel=\"2\" />"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.equinox.coordinator\" autoStart=\"true\" startLevel=\"0\" />"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.equinox.ds\" autoStart=\"true\" startLevel=\"1\" />"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.equinox.event\" autoStart=\"true\" startLevel=\"0\" />"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.dsl.dto.lib\" autoStart=\"true\" startLevel=\"0\" />"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.dsl.metadata.service\" autoStart=\"true\" startLevel=\"3\" />"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.extension.strategy\" autoStart=\"true\" startLevel=\"0\" />"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.jetty.manager\" autoStart=\"true\" startLevel=\"0\" />"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.fork.gemini.naming\" autoStart=\"true\" startLevel=\"3\" />"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.osgi.hybrid.api\" autoStart=\"true\" startLevel=\"0\" />"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.persistence\" autoStart=\"true\" startLevel=\"0\" />"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.runtime.ecore.bundlespace\" autoStart=\"true\" startLevel=\"0\" />"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.runtime.event\" autoStart=\"true\" startLevel=\"0\" />"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.runtime.jsr303.validation\" autoStart=\"true\" startLevel=\"4\" />"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.runtime.typeprovider.bundlespace\" autoStart=\"true\" startLevel=\"0\" />"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.utils.entitymock.dbfill.ui\" autoStart=\"true\" startLevel=\"0\" />"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osgi\" autoStart=\"true\" startLevel=\"-1\" />"); + _builder.newLine(); + return this.prepareSerialized(_builder.toString()); + } + + public String getRecommendedAsString() { + StringConcatenation _builder = new StringConcatenation(); + _builder.append("<plugin id=\"net.osbee.mobile.vaadin.ecview.servlet.mobile\" autoStart=\"true\" startLevel=\"0\" />"); + _builder.newLine(); + return this.prepareSerialized(_builder.toString()); + } + + public String prepareSerialized(final String asString) { + String _necessaryConfigurations = EnumDatabaseVendor.getNecessaryConfigurations(this.necessaryDataBaseVendors); + String _replace = asString.replace( + "${{NECESSARY_DATA_BASE_VENDOR_CONFIGURATIONS}}", _necessaryConfigurations); + String _unnecessaryConfigurations = EnumDatabaseVendor.getUnnecessaryConfigurations(this.necessaryDataBaseVendors); + String _replace_1 = _replace.replace( + "${{UNNECESSARY_DATA_BASE_VENDOR_CONFIGURATIONS}}", _unnecessaryConfigurations); + return this.removeDuplicates(_replace_1); + } +} diff --git a/org.eclipse.osbp.preferences/xtend-gen/org/eclipse/osbp/preferences/ProductFilePlugins.java b/org.eclipse.osbp.preferences/xtend-gen/org/eclipse/osbp/preferences/ProductFilePlugins.java new file mode 100644 index 0000000..d60d6dd --- /dev/null +++ b/org.eclipse.osbp.preferences/xtend-gen/org/eclipse/osbp/preferences/ProductFilePlugins.java @@ -0,0 +1,1478 @@ +/** + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ +package org.eclipse.osbp.preferences; + +import org.eclipse.osbp.preferences.EnumDatabaseVendor; +import org.eclipse.osbp.preferences.ProductConfigurationPrefs; +import org.eclipse.osbp.preferences.ProductFileBase; +import org.eclipse.xtend2.lib.StringConcatenation; + +/** + * <plugins> dependencies for the OSBP product bundle <code>*.product</code> file. + */ +@SuppressWarnings("all") +public class ProductFilePlugins extends ProductFileBase { + public ProductFilePlugins(final ProductConfigurationPrefs prefs) { + super(prefs); + } + + public ProductFilePlugins(final ProductConfigurationPrefs prefs, final String... jndiNames) { + super(prefs, jndiNames); + } + + public String getDeprecatedAsString() { + StringConcatenation _builder = new StringConcatenation(); + _builder.append("${{UNNECESSARY_DATA_BASE_VENDOR_PLUGINS}}"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.google.protobuf\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.springsource.javax.jms\"/>"); + _builder.newLine(); + _builder.append("\t\t"); + _builder.append("<plugin id=\"org.eclipse.osbp.dsl.semantic.common\"/>"); + _builder.newLine(); + _builder.append("\t\t"); + _builder.append("<plugin id=\"org.eclipse.osbp.dsl.semantic.common.edit\"/>"); + _builder.newLine(); + _builder.append("\t\t"); + _builder.append("<plugin id=\"org.eclipse.osbp.dsl.semantic.dto\"/>"); + _builder.newLine(); + _builder.append("\t\t"); + _builder.append("<plugin id=\"org.eclipse.osbp.dsl.semantic.entity\"/>"); + _builder.newLine(); + _builder.append("\t\t"); + _builder.append("<plugin id=\"org.eclipse.osbp.dsl.semantic.entity.edit\"/>"); + _builder.newLine(); + _builder.append("\t\t"); + _builder.append("<plugin id=\"org.eclipse.osbp.dsl.semantic.service\"/>"); + _builder.newLine(); + _builder.append("\t\t"); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.vaadin.servlet.mobile\"/>"); + _builder.newLine(); + _builder.append("\t\t"); + _builder.append("<plugin id=\"org.eclipse.osbp.mobile.vaadin.touchkit.osgi\"/>"); + _builder.newLine(); + _builder.append("\t\t"); + _builder.append("<plugin id=\"org.eclipse.osbp.utils.mobile.ui\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.vaadin.addon.contextmenu\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.vaadin.addon.dndlayout\"/>"); + _builder.newLine(); + return this.prepareSerialized(_builder.toString()); + } + + public String getRequiredAsString() { + StringConcatenation _builder = new StringConcatenation(); + _builder.append(" "); + _builder.append("<plugin id=\"OpenCSV\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"activemq-all-osgi-5.9.0\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"animator.osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"ca.ecliptical.pde.ds.lib\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"ch.qos.logback.classic\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"ch.qos.logback.core\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"ch.qos.logback.slf4j\" fragment=\"true\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.google.api.translate.osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.google.guava\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.google.gwt.thirdparty.guava\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.google.gwt.thirdparty.streamhtmlparser\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.google.inject\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.google.inject.assistedinject\" fragment=\"true\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.ibm.icu\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.jcraft.jsch\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.lowagie.text\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"javax.jms\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.springsource.org.antlr.runtime\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.springsource.org.codehaus.commons.compiler\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.springsource.org.codehaus.janino\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.sun.mail.javax.mail\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.vaadin.client\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.vaadin.client-compiled\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.vaadin.external.atmosphere.runtime\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.vaadin.external.org.slf4j\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.vaadin.push\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.vaadin.sass-compiler\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.vaadin.server\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.vaadin.shared\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.vaadin.theme-compiler\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"com.vaadin.themes\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"commons-vfs-osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"contextmenu.osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"dCharts.osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"dragdroplayouts.osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"dom.osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"dragdroplayouts.osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"easyuploads.osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"filteringtable.osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"groovy-all\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"iban4j\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"jackrabbit-jcr-commons-osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"jackrabbit-webdav-osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"jackson-core-asl\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"java-cup.osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"javax.annotation\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"javax.el\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"javax.inject\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"javax.jcr\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"javax.persistence\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"javax.servlet\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"javax.transaction\" fragment=\"true\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"javax.validation.api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"javax.ws.rs.jsr311-api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"javax.wsdl\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"javax.xml\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"javax.xml.stream\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"jaxen\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"joda-time\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"mondrian.osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"multifileupload.osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"net.osbee.vaaclipse.designer\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"net.osbee.vaadin.designer\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"olap4j-xmla.osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"olap4j.osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.antlr.runtime\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.ant\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.batik.bridge\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.batik.css\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.batik.dom\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.batik.dom.svg\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.batik.ext.awt\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.batik.parser\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.batik.svggen\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.batik.transcoder\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.batik.util\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.batik.util.gui\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.batik.xml\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.bval.org.apache.bval.bundle\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.beanutils\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.cli\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.codec\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.collections\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.compress\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.dbcp\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.digester\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.discovery\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.email\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.exec\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.httpclient\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.io\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.jexl\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.lang\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.lang3\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.logging\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.math\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.math3\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.net\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.pool\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.vfs\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.commons.validator\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.cxf.cxf-core\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.cxf.cxf-rt-bindings-soap\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.cxf.cxf-rt-bindings-xml\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.cxf.cxf-rt-databinding-jaxb\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.cxf.cxf-rt-frontend-jaxws\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.cxf.cxf-rt-frontend-simple\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.cxf.cxf-rt-transports-http\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.cxf.cxf-rt-wsdl\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.felix.gogo.command\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.felix.gogo.runtime\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.felix.gogo.shell\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.httpcomponents.httpclient\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.httpcomponents.httpcore\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.log4j\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.pdfbox.fontbox\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.pdfbox\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.servicemix.bundles.jexcelapi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.servicemix.bundles.wsdl4j\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.servicemix.bundles.xpp3\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.ws.xmlschema.core\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.xerces\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.xml.resolver\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.apache.xml.serializer\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.drools.api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.birt.core\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.birt.data\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.birt.data.aggregation\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.birt.report.data.adapter\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.birt.report.engine\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.birt.report.engine.emitter.html\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.birt.report.engine.emitter.pdf\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.birt.report.engine.fonts\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.birt.report.engine.script.javascript\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.birt.report.model\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.bpmn2\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.bpmn2.edit\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.compare.core\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.core.commands\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.core.contenttype\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.core.databinding\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.core.databinding.beans\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.core.databinding.observable\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.core.databinding.property\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.core.expressions\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.core.filebuffers\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.core.filesystem\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.core.jobs\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.core.resources\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.core.runtime\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.core.runtime.compatibility.registry\" fragment=\"true\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.core.variables\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.datatools.connectivity\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.datatools.connectivity.oda\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.datatools.connectivity.oda.consumer\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.datatools.connectivity.oda.design\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.datatools.connectivity.oda.profile\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.debug.core\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.e4.core.commands\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.e4.core.contexts\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.e4.core.di\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.e4.core.di.extensions\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.e4.core.services\" version=\"1.2.1.v20140808-1251\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.e4.ui.di\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.e4.ui.model.workbench\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.e4.ui.model.workbench.edit\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.e4.ui.services\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.e4.ui.workbench\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.emf.codegen\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.emf.codegen.ecore\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.emf.codegen.ecore.xtext\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.emf.common\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.emf.databinding\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.emf.databinding.edit\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.emf.ecore\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.emf.ecore.change\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.emf.ecore.change.edit\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.emf.ecore.edit\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.emf.ecore.xcore\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.emf.ecore.xcore.lib\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.emf.ecore.xmi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.emf.edit\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.emf.mwe.core\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.emf.mwe.utils\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.emf.mwe2.runtime\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.equinox.app\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.equinox.bidi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.equinox.common\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.equinox.console\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.equinox.coordinator\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.equinox.ds\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.equinox.event\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.equinox.http.registry\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.equinox.http.servlet\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.equinox.preferences\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.equinox.registry\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.equinox.security\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.equinox.util\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.gemini.dbaccess.util\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.help\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.jdt.compiler.apt\" fragment=\"true\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.jdt.compiler.tool\" fragment=\"true\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.jdt.core\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.jdt.debug\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.jdt.launching\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.jetty.continuation\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.jetty.http\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.jetty.io\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.jetty.security\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.jetty.server\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.jetty.servlet\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.jetty.util\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.jetty.websocket\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.authentication\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.authentication.ui\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.bpm.api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.bpmn2.ecore\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.commons\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.dsl.common.xtext\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.dsl.datatype.lib\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.dsl.datatype.xtext\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.dsl.dto.lib\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.dsl.dto.xtext\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.dsl.entity.xtext\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.dsl.metadata.service\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.dsl.mwe\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.dsl.xtext.builder.participant\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.dsl.xtext.lazyresolver\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.dsl.xtext.lazyresolver.api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.e4extension\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.e4modelextension\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.core.common\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.core.common.editparts.emf\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.core.common.model\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.core.common.model.edit\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.core.databinding.beans\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.core.databinding.emf\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.core.emf.api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.core.extension.editparts\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.core.extension.editparts.emf\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.core.extension.model\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.core.extension.model.edit\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.core.ui.presentation.common\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.core.util.emf\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.dsl\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.dsl.lib\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.extension.api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.extension.editparts\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.extension.editparts.emf\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.extension.grid.editparts\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.extension.grid.editparts.emf\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.extension.grid.model\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.extension.grid.model.edit\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.extension.grid.presentation\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.extension.grid.presentation.clientside\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.extension.model\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.extension.model.edit\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.extension.presentation.vaadin\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.extension.services\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.extension.strategy\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.extension.widgetset\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.jetty.manager\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.uisemantics\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.xtext.builder.participant\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ecview.xtext.builder.participant.i18n\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.eventbroker\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.filter\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.fork.gemini.naming\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.fork.vaadin.addon.maskedtextfield\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.gitinfo\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.i18n.common\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.infogrid.api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.infogrid.ecview\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.infogrid.model\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.infogrid.services\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.infogrid.vaaclipse\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.infogrid.vaadin\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.mobile.vaadin.ecview.api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.mobile.vaadin.ecview.editparts\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.mobile.vaadin.ecview.editparts.emf\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.mobile.vaadin.ecview.model\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.mondrian\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.mondrian.api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.osgi.hybrid.api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.osgi.hybrid.api.runtime\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.persistence\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.preferences\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.runtime.common\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.runtime.designer.api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.runtime.ecore.bundlespace\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.runtime.event\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.runtime.jsr303.validation\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.runtime.systemextension\" fragment=\"true\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.runtime.typeprovider.bundlespace\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.runtime.web.atmosphere.fragment\" fragment=\"true\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.runtime.web.common\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.runtime.web.ecview.presentation.vaadin\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.runtime.web.vaadin.common\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.runtime.web.vaadin.components\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.runtime.web.vaadin.components.widget\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.runtime.web.vaadin.databinding\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.runtime.web.vaadin.widgetset\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.themes\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ui.api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.ui.common\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.user\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.utils\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.utils.blob\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.utils.bpmn\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.utils.entitymock.dbfill.ui\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.utils.functionnormalizer\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.utils.img\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.utils.js\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.utils.themes.ui\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.utils.ui\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.additions\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.addons.app\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.addons.application\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.addons.common\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.addons.common.api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.addons.ecview\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.addons.ecview.lib\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.addons.keybinding\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.addons.perspective\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.addons.problems\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.addons.softwarefactory\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.behaviour\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.behaviour.source\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.common.ecview\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.common.ecview.api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.contributions\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.emf\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.emf.addon\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.emf.api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.presentation\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.publicapi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.resources\" fragment=\"true\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.theme\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.ui.preferences.addon\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.ui.preferences.model\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.util\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.widgets\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaaclipse.widgetset.default\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaadin\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaadin.addons.absolutelayout\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaadin.addons.designer.overlay\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaadin.addons.suggesttext\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaadin.emf\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaadin.emf.api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.vaadin.widgetset\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.webserver.messagequeue\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.action\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.addons\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.authorizationdsl\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.basic\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.blip\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.builder.metadata.services\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.builder.types.bundles\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.builder.types.loader.api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.builder.types.loader.runtime\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.builder.xbase.setups\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.chart\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.cubedsl\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.datainterchange\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.datainterchange.common\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.datamart.common\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.datamartdsl\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.dialogdsl\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.entitymock\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.functionlibrary.common\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.functionlibrary.common.api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.functionlibrarydsl\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.functionlibrarydsl.provider\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.gridsource\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.i18n\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.menu\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.messagedsl\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.organizationdsl\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.perspective\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.reportdsl\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.reportdsl.oda.datamart\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.strategy\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.table\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.table.common\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osbp.xtext.topologydsl\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osgi.compatibility.state\" fragment=\"true\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osgi.services\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.osgi.util\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.persistence.antlr\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.persistence.asm\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.persistence.core\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.persistence.jpa\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.persistence.jpa.jpql\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.text\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.uomo.core\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.uomo.ucum\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.uomo.ui\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.uomo.units\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.uomo.util\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.uomo.xml\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.xpand\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.xsd\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.xsd.edit\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.xtend\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.xtend.lib\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.xtend.lib.macro\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.xtend.typesystem.emf\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.xtext\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.xtext.common.types\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.xtext.common.types.edit\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.xtext.ecore\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.xtext.generator\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.xtext.util\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.xtext.xbase\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.eclipse.xtext.xbase.lib\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.freemarker.freemarker\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.glassfish.javax.json\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.hamcrest.core\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.jivesoftware.smack\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.joda.convert\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.joda.money\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.json\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.jsoup\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.junit\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.milyn.smooks.osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.mozilla.javascript\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.mvel2\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.objectweb.asm\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.restlet\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.slf4j.api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.unitsofmeasurement.unit-api\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.vaadin.addons.vaadin-grid-util\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.w3c.css.sac\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.w3c.dom.events\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.w3c.dom.smil\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.w3c.dom.svg\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.w3c.flute\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.w3c.sac\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.xmlpull\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"org.yaml.snakeyaml\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"osgi.enterprise\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"osgi.sun\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"overlays.osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"popupbutton.osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"refresher.osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"sizereporter.osgi\"/>"); + _builder.newLine(); + _builder.append(" "); + _builder.append("<plugin id=\"xstream\"/>"); + _builder.newLine(); + _builder.append("${{NECESSARY_DATA_BASE_VENDOR_PLUGINS}}"); + _builder.newLine(); + return this.prepareSerialized(_builder.toString()); + } + + public String getRecommendedAsString() { + StringConcatenation _builder = new StringConcatenation(); + _builder.append("<plugin id=\"net.osbee.bpm\"/>"); + _builder.newLine(); + _builder.append("<plugin id=\"net.osbee.mobile.vaadin.ecview.presentation\"/>"); + _builder.newLine(); + _builder.append("<plugin id=\"net.osbee.mobile.vaadin.ecview.servlet.mobile\"/>"); + _builder.newLine(); + _builder.append("<plugin id=\"net.osbee.mobile.vaadin.touchkit.osgi\"/>"); + _builder.newLine(); + _builder.append("<plugin id=\"net.osbee.mobile.vaadin.utils\"/>"); + _builder.newLine(); + _builder.append("<plugin id=\"net.osbee.mobile.vaadin.widgetset\"/>"); + _builder.newLine(); + _builder.append("<plugin id=\"net.osbee.organization.permissions\"/>"); + _builder.newLine(); + _builder.append("<plugin id=\"net.osbee.utils.js\"/>"); + _builder.newLine(); + _builder.append("<plugin id=\"net.osbee.vaaclipse.designer\"/>"); + _builder.newLine(); + _builder.append("<plugin id=\"net.osbee.vaadin.designer\"/>"); + _builder.newLine(); + _builder.append("<plugin id=\"net.osbee.xtext.cubedsl\"/>"); + _builder.newLine(); + _builder.append("<plugin id=\"net.osbee.xtext.cubedsl.services\"/>"); + _builder.newLine(); + _builder.append("<plugin id=\"net.osbee.xtext.organizationdsl\"/>"); + _builder.newLine(); + _builder.append("<plugin id=\"net.osbee.xtext.organizationdsl.api\"/>"); + _builder.newLine(); + _builder.append("<plugin id=\"net.osbee.xtext.organizationdsl.services\"/>"); + _builder.newLine(); + _builder.append("<plugin id=\"net.osbee.xtext.organizationdsl.vaaclipse\"/>"); + _builder.newLine(); + return this.prepareSerialized(_builder.toString()); + } + + public String prepareSerialized(final String asString) { + String _necessaryPlugins = EnumDatabaseVendor.getNecessaryPlugins(this.necessaryDataBaseVendors); + String _replace = asString.replace( + "${{NECESSARY_DATA_BASE_VENDOR_PLUGINS}}", _necessaryPlugins); + String _unnecessaryPlugins = EnumDatabaseVendor.getUnnecessaryPlugins(this.necessaryDataBaseVendors); + String _replace_1 = _replace.replace( + "${{UNNECESSARY_DATA_BASE_VENDOR_PLUGINS}}", _unnecessaryPlugins); + return this.removeDuplicates(_replace_1); + } +} @@ -0,0 +1,97 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--#======================================================================= --> +<!--# Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany). --> +<!--# All rights reserved. This program and the accompanying materials --> +<!--# are made available under the terms of the Eclipse Public License v1.0 --> +<!--# which accompanies this distribution, and is available at --> +<!--# http://www.eclipse.org/legal/epl-v10.html --> +<!--# --> +<!--# Contributors: --> +<!--# Christophe Loetz (Loetz GmbH&Co.KG) - Initial implementation API and implementation --> +<!--#======================================================================= --> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.eclipse.osbp.releng.maven</groupId> + <artifactId>org.eclipse.osbp.releng.maven.parent.tycho</artifactId> + <version>0.9.0-SNAPSHOT</version> + <relativePath/> + </parent> + + <groupId>org.eclipse.osbp.preferences</groupId> + <artifactId>org.eclipse.osbp.preferences.aggregator</artifactId> + <version>0.9.0-SNAPSHOT</version> + <packaging>pom</packaging> + + <url>${osbp.site.repository.url}</url> + <scm> + <url>${osbp.scm.url}</url> + <connection>${osbp.scm.connection}</connection> + <developerConnection>${osbp.scm.connection.dev}</developerConnection> + <tag>HEAD</tag> + </scm> + <distributionManagement> + <site> + <id>gh-pages</id> + <name>OSBP GitHub Pages</name> + <url>${distribution.site.url}</url> + </site> + </distributionManagement> + + <properties> + <osbp.gitrepo.name>${project.groupId}</osbp.gitrepo.name> + </properties> + + <modules> + + <module>org.eclipse.osbp.preferences</module> + <module>org.eclipse.osbp.preferences.ui.page</module> + <module>org.eclipse.osbp.preferences.feature</module> + </modules> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>target-platform-configuration</artifactId> + <version>${tycho-version}</version> + <configuration> + <resolver>p2</resolver> + <pomDependencies>consider</pomDependencies> + <environments> + <environment> + <os>win32</os> + <ws>win32</ws> + <arch>x86_64</arch> + </environment> + <environment> + <os>linux</os> + <ws>gtk</ws> + <arch>x86</arch> + </environment> + <environment> + <os>linux</os> + <ws>gtk</ws> + <arch>x86_64</arch> + </environment> + <environment> + <os>macosx</os> + <ws>cocoa</ws> + <arch>x86_64</arch> + </environment> + </environments> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> +</project> |