├── LICENSE ├── README.md ├── ServerConfigurations.iml ├── ServerConfigurations.ipr ├── agent ├── ServerConfigurations-agent.iml └── src │ ├── META-INF │ └── build-agent-plugin-ServerConfigurations.xml │ └── ServerConfigurations │ └── agent │ └── AgentListener.java ├── bin ├── README.md ├── ServerConfigurations.zip ├── ServerConfigurations_jre6_tc9.zip ├── ServerConfigurations_jre7_tc9.zip └── ServerConfigurations_tc9.zip ├── build.properties ├── build.xml ├── common ├── ServerConfigurations-common.iml └── src │ └── ServerConfigurations │ └── common │ └── Util.java ├── lib-compile ├── asm4-all.jar └── javac2.jar ├── root.iml ├── server ├── ServerConfigurations-server.iml ├── resources │ └── buildServerResources │ │ ├── AdminConfigurationEditPage.jsp │ │ ├── AdminConfigurationsListPage.jsp │ │ ├── AdminPage.jsp │ │ ├── AdminTemplateEditPage.jsp │ │ ├── EditProjectConfigurationEditPage.jsp │ │ ├── EditProjectConfigurationsListPage.jsp │ │ ├── EditProjectPage.jsp │ │ ├── ErrorPage.jsp │ │ ├── css │ │ └── ServerConfigurationsAdminPage.css │ │ └── js │ │ └── ServerConfigurationsAdminPage.js └── src │ ├── META-INF │ └── build-server-plugin-ServerConfigurations.xml │ └── ServerConfigurations │ └── server │ ├── AdminConfiguration │ ├── AdminPage.java │ ├── Controller.java │ ├── PropertiesType.java │ ├── ServerConfiguration.java │ ├── ServerConfigurationProperty.java │ ├── ServerConfigurations.java │ ├── Template.java │ └── TemplateProperty.java │ ├── BuildLogFilter.java │ ├── ParametersPreprocessor.java │ ├── ProjectConfiguration │ ├── Controller.java │ ├── EditProjectPage.java │ ├── ProjectConfiguration.java │ ├── ProjectConfigurations.java │ └── SettingsFactory.java │ ├── PropertiesProvider.java │ ├── ServerListener.java │ └── ServerUtil.java ├── serverconfigurations.xml ├── teamcity-common.xml └── teamcity-plugin.xml /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright 2015 JetBrains s.r.o. 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Server Configurations for TeamCity 2 | ================================== 3 | 4 | This plugin helps you store and use server configurations with list of parameters (addresses, ports, credentials, etc). 5 | 6 | Features: 7 | 8 | * Create server configuration templates within administration screen 9 | * Create server configuration by choosing template and filling template parameters 10 | * Attach server configuration to your projects and use all parameters in build configurations 11 | * Change server configurations in your projects to use another parameters without any reconfiguration 12 | * Server configurations are inherited from parent projects to all child projects 13 | * Attach different server configurations in your project to different branches 14 | 15 | 16 | Configure template 17 | ------------------------- 18 | ![Template configuration](https://www.evernote.com/shard/s1/sh/b495670e-cb22-4174-9d2a-9cf79bbaa978/d32edfb3dc96849e9e2f73870c7fb656/res/5a928c8a-afb3-495a-8d24-666bb69edacb/skitch.png?resizeSmall&width=832) 19 | 20 | Configure some server configurations 21 | -------------------------------------------------- 22 | ![Server configuration](https://www.evernote.com/shard/s1/sh/a8b92fae-3fb1-4ae6-912b-870e0e95394a/866500c1d6ae3c874a3ee91eaee67717/res/9d78e170-37c1-459c-a396-011f873a4777/skitch.png?resizeSmall&width=832) 23 | 24 | Attach server configuration to project 25 | ------------------------------------------------- 26 | ![Project configuration](https://www.evernote.com/shard/s1/sh/a9dd537b-1d2f-4748-bcd1-7ed8eca4d34d/49768cf8709fc114a4ea6bd8597568a5/res/545b992f-7b4d-45f4-8356-cb32057f0671/skitch.png?resizeSmall&width=832) 27 | ![Project configuration](https://www.evernote.com/shard/s1/sh/3e0f88e9-7b3f-4d29-9c71-611788127976/08ff0710028278b21874a1c0908ecd3d/res/3fe566f8-d429-412d-a631-ec28e3ffebe8/skitch.png?resizeSmall&width=832) 28 | 29 | Use parameters in build configurations 30 | --------------------------------------------------- 31 | Parameters will be available in build configurations with selected prefix. Password values will be hidden from parameters list and build log. 32 | 33 | ![Parameters usage](https://www.evernote.com/shard/s1/sh/f5a411aa-54c1-404b-8768-008a58c2ca37/18134bad3eeb6c5cfc4f5e831c96f6b6/res/6cda0af6-159c-4795-99d2-300cb5c5e064/skitch.png?resizeSmall&width=832) -------------------------------------------------------------------------------- /ServerConfigurations.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /ServerConfigurations.ipr: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | $PROJECT_DIR$/out/artifacts/ServerConfigurations_common_jar 12 | 13 | 14 | 15 | 16 | 17 | $PROJECT_DIR$/out/artifacts/unpacked_plugin 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | $PROJECT_DIR$/out/artifacts/final_plugin_package 52 | 53 | 54 | 55 | 56 | 57 | $TeamCityDataDirectory$/plugins 58 | 59 | 60 | 61 | 62 | 63 | 64 | 66 | 67 | 94 | 95 | 96 | 102 | 103 | 104 | 105 | 106 | 108 | 109 | 111 | 112 | 114 | 115 | 116 | 118 | 119 | 122 | 123 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 558 | 560 | 561 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 663 | 664 | 665 | 670 | 671 | 672 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | -------------------------------------------------------------------------------- /agent/ServerConfigurations-agent.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | file://$MODULE_DIR$/src/META-INF/build-agent-plugin-ServerConfigurations.xml 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /agent/src/META-INF/build-agent-plugin-ServerConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /agent/src/ServerConfigurations/agent/AgentListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2015 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ServerConfigurations.agent; 18 | 19 | import jetbrains.buildServer.agent.*; 20 | import jetbrains.buildServer.log.Loggers; 21 | import jetbrains.buildServer.util.EventDispatcher; 22 | import org.jetbrains.annotations.NotNull; 23 | import ServerConfigurations.common.Util; 24 | 25 | import java.util.Iterator; 26 | import java.util.Map; 27 | 28 | /** 29 | * Created by IIIEII on 27.05.15. 30 | */ 31 | public class AgentListener extends AgentLifeCycleAdapter { 32 | public AgentListener(@NotNull EventDispatcher dispatcher) { 33 | dispatcher.addListener(this); 34 | } 35 | 36 | @Override 37 | public void agentInitialized(@NotNull final BuildAgent agent) { 38 | Loggers.AGENT.info("Plugin '" + Util.PLUGIN_NAME + "'. is running."); 39 | } 40 | 41 | @Override 42 | public void beforeRunnerStart(@NotNull 43 | BuildRunnerContext runner) { 44 | Iterator paramIter = runner.getConfigParameters().entrySet().iterator(); 45 | while(paramIter.hasNext()) { 46 | Map.Entry param = (Map.Entry)paramIter.next(); 47 | if (param.getValue().matches("^%secure:configuration\\.password[^%]+%$")) { 48 | runner.addConfigParameter(param.getKey(), runner.getConfigParameters().get(param.getValue().substring(1, param.getValue().length() - 1))); 49 | } 50 | } 51 | paramIter = runner.getBuildParameters().getEnvironmentVariables().entrySet().iterator(); 52 | while(paramIter.hasNext()) { 53 | Map.Entry param = (Map.Entry)paramIter.next(); 54 | if (param.getValue().matches("^%secure:configuration\\.password[^%]+%$")) { 55 | runner.addEnvironmentVariable(param.getKey(), runner.getConfigParameters().get(param.getValue().substring(1, param.getValue().length() - 1))); 56 | } 57 | } 58 | paramIter = runner.getBuildParameters().getSystemProperties().entrySet().iterator(); 59 | while(paramIter.hasNext()) { 60 | Map.Entry param = (Map.Entry)paramIter.next(); 61 | if (param.getValue().matches("^%secure:configuration\\.password[^%]+%$")) { 62 | runner.addSystemProperty(param.getKey(), runner.getConfigParameters().get(param.getValue().substring(1, param.getValue().length() - 1))); 63 | } 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /bin/README.md: -------------------------------------------------------------------------------- 1 | | File | Description | 2 | | --- | --- | 3 | | bin/ServerConfigurations.zip | this version works with Teamcity >=10 and Java 1.8 | 4 | | bin/ServerConfigurations_jre6_tc9.zip | this version works with Teamcity <=9 and Java 1.6 | 5 | | bin/ServerConfigurations_jre7_tc9.zip | this version works with Teamcity <=9 and Java 1.7 | 6 | | bin/ServerConfigurations_tc9.zip | this version works with Teamcity <=9 and Java 1.8 | -------------------------------------------------------------------------------- /bin/ServerConfigurations.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IIIEII/ServerConfigurations/2cda8b58ae6f89c36f70da146a0f8c13de5cb2a6/bin/ServerConfigurations.zip -------------------------------------------------------------------------------- /bin/ServerConfigurations_jre6_tc9.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IIIEII/ServerConfigurations/2cda8b58ae6f89c36f70da146a0f8c13de5cb2a6/bin/ServerConfigurations_jre6_tc9.zip -------------------------------------------------------------------------------- /bin/ServerConfigurations_jre7_tc9.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IIIEII/ServerConfigurations/2cda8b58ae6f89c36f70da146a0f8c13de5cb2a6/bin/ServerConfigurations_jre7_tc9.zip -------------------------------------------------------------------------------- /bin/ServerConfigurations_tc9.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IIIEII/ServerConfigurations/2cda8b58ae6f89c36f70da146a0f8c13de5cb2a6/bin/ServerConfigurations_tc9.zip -------------------------------------------------------------------------------- /build.properties: -------------------------------------------------------------------------------- 1 | #Path to unpacked .tar.gz distribution or installed .exe distribution of TeamCity 2 | # for example: 3 | #path.variable.teamcitydistribution=C\:/TeamCity71 4 | 5 | # Path to TeamCity Data Directory to deploy the plugin to 6 | #path.variable.teamcitydatadirectory=C\:/TeamCity71/.BuildServer -------------------------------------------------------------------------------- /build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /common/ServerConfigurations-common.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /common/src/ServerConfigurations/common/Util.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2010 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ServerConfigurations.common; 18 | 19 | /** 20 | * Example server and agent shared class 21 | */ 22 | public class Util { 23 | public final static String PLUGIN_NAME = "ServerConfigurations"; 24 | } 25 | -------------------------------------------------------------------------------- /lib-compile/asm4-all.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IIIEII/ServerConfigurations/2cda8b58ae6f89c36f70da146a0f8c13de5cb2a6/lib-compile/asm4-all.jar -------------------------------------------------------------------------------- /lib-compile/javac2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IIIEII/ServerConfigurations/2cda8b58ae6f89c36f70da146a0f8c13de5cb2a6/lib-compile/javac2.jar -------------------------------------------------------------------------------- /root.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /server/ServerConfigurations-server.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | file://$MODULE_DIR$/src/META-INF/build-server-plugin-ServerConfigurations.xml 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /server/resources/buildServerResources/AdminConfigurationEditPage.jsp: -------------------------------------------------------------------------------- 1 | <%@ include file="/include.jsp" %> 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

17 | 18 | 19 | Edit server configuration 20 | 21 | 22 | New server configuration 23 | 24 | 25 |

26 | 27 |
28 | 29 | 30 | 31 | 42 | 43 | 44 | 45 | 46 | 47 | ServerConfigurations.saveServerConfiguration(event, function success() { 48 | BS.openUrl(event, '${pluginUrl}&action=edit&name=' + encodeURIComponent($('name').value)); 49 | }, function failure() { 50 | $('templateName').setSelectValue(0); 51 | }); 52 | 53 | 54 | var index = $('templateName').selectedIndex; 55 | if (confirm('Are you sure you want to change template?')) { 56 | ServerConfigurations.saveServerConfiguration(event, null, function failure() { 57 | $('templateName').setSelectValue(0); 58 | }); 59 | } else { 60 | $('templateName').setSelectValue(index); 61 | } 62 | 63 | 64 | 65 | 66 | 80 | 81 |
32 | 33 | 34 | 36 | 37 | 38 | 39 | 40 | 41 |
67 | 68 | -- Select template -- 69 | 70 | 73 | 74 | 75 | 76 |
Choose server configuration template. Parameters of configuration will be 77 | changed to parameters from template. 78 |
79 |
82 | 83 |

Configuration parameters

84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 96 | 112 | 113 | 114 |
KeyValue
93 | 94 |
Value will be available in build configuration as %{some_prefix}.${property.name}%
95 |
97 | 98 | 99 | 100 | 101 | 104 | 105 | 106 | 109 | 110 | 111 |
115 |
116 | 119 | 121 | 122 | 124 |
125 |
126 |
127 | 128 |
-------------------------------------------------------------------------------- /server/resources/buildServerResources/AdminConfigurationsListPage.jsp: -------------------------------------------------------------------------------- 1 | <%@ include file="/include.jsp" %> 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 |

Server Configurations

11 | 12 | 15 |
16 | 17 | 18 | There are no server configurations. 19 | 20 | 21 | 22 | 23 | Configuration Name 24 | Template 25 | 26 | 27 | ${pluginUrl}&action=edit&name= 28 | ?action=delete&name= 29 | BS.openUrl(event, '${confEditUrl}'); return false; 30 | 31 | 32 | 33 | 34 | Edit 35 | 36 | 37 | Delete 38 | 39 | 40 | 41 | 42 | 43 | 44 |
45 | 46 |

Templates

47 | 48 | 51 |
52 | 53 | 54 | There are no server configuration templates. 55 | 56 | 57 | 58 | 59 | Template Name 60 | Properties Count 61 | 62 | 63 | ${pluginUrl}&action=editTemplate&name= 64 | ?action=deleteTemplate&name= 65 | BS.openUrl(event, '${templEditUrl}'); return false; 66 | 67 | 68 | 69 | 70 | Edit 71 | 72 | 73 | Delete 74 | 75 | 76 | 77 | 78 | 79 | 80 |
81 | 82 |
-------------------------------------------------------------------------------- /server/resources/buildServerResources/AdminPage.jsp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/resources/buildServerResources/AdminTemplateEditPage.jsp: -------------------------------------------------------------------------------- 1 | <%@ include file="/include.jsp" %> 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

17 | 18 | 19 | Edit server configuration template 20 | 21 | 22 | New server configuration template 23 | 24 | 25 |

26 | 27 |
28 | 29 | 30 | 31 | 42 | 43 |
32 | 33 | 34 | 36 | 37 | 38 | 39 | 40 | 41 |
44 | 45 |

Template parameters

46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 57 | 62 | 66 | 67 | 68 | 69 | 70 | 73 | 74 |
KeyType
55 | 56 | 58 | 59 | 60 | 61 | 63 | Delete 65 |
71 | Add 72 |
75 |
76 | 77 | 78 | 79 | return ServerConfigurations.saveTemplate(event, function success() { 80 | BS.openUrl(event, '${pluginUrl}&action=editTemplate&name=' + encodeURIComponent($('name').value)); 81 | }); 82 | 83 | 84 | return ServerConfigurations.saveTemplate(event); 85 | 86 | 87 | 88 | 90 | 92 | 93 | 95 |
96 | 101 |
102 |
103 | 104 |
-------------------------------------------------------------------------------- /server/resources/buildServerResources/EditProjectConfigurationEditPage.jsp: -------------------------------------------------------------------------------- 1 | <%@ include file="/include.jsp"%> 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 25 | 26 | 27 | 28 | 32 | 33 | 34 | 35 | 44 | 45 | 46 |
22 | 23 |
All server configuration parameters names will be prefixed with this string (e.g. %{some_prefix}.domain.name%).
24 |
29 | 30 |
Apply server configuration parameters only for build configurations in this branches.
31 |
36 | 37 | -- Select server configuration -- 38 | 39 | 40 | 41 | 42 |
Choose server configuration. All parameters will be available in build configurations.
43 |
47 |
48 | 49 | 50 | 51 | return ServerConfigurations.saveProjectServerConfiguration(event, function success() { 52 | BS.openUrl(event, '${pluginUrl}&action=edit&prefix=' + encodeURIComponent($('prefix').value)); 53 | }); 54 | 55 | 56 | return ServerConfigurations.saveProjectServerConfiguration(event); 57 | 58 | 59 | 60 | 63 | 65 | 66 | 67 | 68 |
69 |
70 | 71 |
72 | 73 |
-------------------------------------------------------------------------------- /server/resources/buildServerResources/EditProjectConfigurationsListPage.jsp: -------------------------------------------------------------------------------- 1 | <%@ include file="/include.jsp"%> 2 | 3 | <%-- 4 | ~ Copyright 2000-2015 JetBrains s.r.o. 5 | ~ 6 | ~ Licensed under the Apache License, Version 2.0 (the "License"); 7 | ~ you may not use this file except in compliance with the License. 8 | ~ You may obtain a copy of the License at 9 | ~ 10 | ~ http://www.apache.org/licenses/LICENSE-2.0 11 | ~ 12 | ~ Unless required by applicable law or agreed to in writing, software 13 | ~ distributed under the License is distributed on an "AS IS" BASIS, 14 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ~ See the License for the specific language governing permissions and 16 | ~ limitations under the License. 17 | --%> 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 |

Server configurations

27 |
This page contains server configurations defined in the current project. Parameters from server configurations could be used in any build configuration with desired prefix (e.g. %{some_prefix}.domain.name%).
28 | 31 |
32 | 33 | 34 | There are no server configurations in this project. 35 | 36 | 37 | 38 | 39 | Parameters Prefix 40 | Branch Filter 41 | Configuration Name 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | BS.openUrl(event, '${confEditUrl}'); return false; 56 | 57 | 58 | 59 | 60 | 61 | Edit 62 | 63 | 64 | Delete 65 | 66 | 67 | 68 | 69 | 70 | 71 |
72 |
-------------------------------------------------------------------------------- /server/resources/buildServerResources/EditProjectPage.jsp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/resources/buildServerResources/ErrorPage.jsp: -------------------------------------------------------------------------------- 1 | <%@ include file="/include.jsp"%> 2 | 3 | 4 | 5 | 6 | 7 |
8 | 10 |
-------------------------------------------------------------------------------- /server/resources/buildServerResources/css/ServerConfigurationsAdminPage.css: -------------------------------------------------------------------------------- 1 | .serverConfigurations h2 { 2 | margin-bottom: 10px; 3 | } 4 | 5 | .serverConfigurations .runnerFormTable { 6 | margin-bottom: 20px; 7 | } 8 | 9 | .serverConfigurations .runnerFormTable tr *:first-child { 10 | width:372px; 11 | } 12 | 13 | .serverConfigurations input[type=text], .serverConfigurations input[type=password], .serverConfigurations select { 14 | width: 372px; 15 | } -------------------------------------------------------------------------------- /server/resources/buildServerResources/js/ServerConfigurationsAdminPage.js: -------------------------------------------------------------------------------- 1 | var ServerConfigurations = { 2 | getFunction: function (buttonName, formName, paramsList, messageComponentName, componentName) { 3 | return function (event, success, failure) { 4 | $(buttonName).disabled = 'true'; 5 | BS.Util.show($('saving')); 6 | BS.ajaxRequest($(formName).action, { 7 | parameters: ServerConfigurations.getParams(paramsList), 8 | onComplete: function (transport) { 9 | if (transport.responseXML) { 10 | BS.XMLResponse.processErrors(transport.responseXML, { 11 | onProfilerProblemError: function (elem) { 12 | alert(elem.firstChild.nodeValue); 13 | } 14 | }); 15 | } 16 | $j('.successMessage').remove(); 17 | $(messageComponentName).refresh(); 18 | if (transport.status == 500) { 19 | $(buttonName).disabled = ''; 20 | BS.Util.hide($('saving')); 21 | if (failure && typeof failure == 'function') { 22 | failure(event); 23 | } 24 | } else { 25 | if (success && typeof success == 'function') { 26 | success(event); 27 | } else { 28 | $(componentName).refresh(); 29 | } 30 | } 31 | } 32 | } 33 | ); 34 | return false; 35 | } 36 | }, 37 | getParams: function (list) { 38 | var names = list.split(","); 39 | var params = {}; 40 | for (var i = 0; i < names.length; i++) { 41 | var name = names[i].trim(); 42 | if (name.substr(-2) == "[]") { 43 | name = name.substr(0, name.length - 2); 44 | params[name] = $j("[name='" + name + "']").map(function (i, el) { 45 | return el.value 46 | }).toArray(); 47 | } else { 48 | if ($(name)) { 49 | params[name] = $(name).value; 50 | } 51 | } 52 | } 53 | return params; 54 | } 55 | }; 56 | ServerConfigurations.saveTemplate = ServerConfigurations.getFunction( 57 | 'templateSaveButton', 58 | 'templateForm', 59 | 'name,initialName,key[],type[]', 60 | 'templateMessageComponent', 61 | 'templateComponent' 62 | ); 63 | ServerConfigurations.saveServerConfiguration = ServerConfigurations.getFunction( 64 | 'serverConfigurationSaveButton', 65 | 'serverConfigurationForm', 66 | 'initialName,name,templateName,key[],value[],changed[]', 67 | 'serverConfigurationMessageComponent', 68 | 'serverConfigurationComponent' 69 | ); 70 | ServerConfigurations.saveProjectServerConfiguration = ServerConfigurations.getFunction( 71 | 'serverConfigurationSaveButton', 72 | 'serverConfigurationForm', 73 | 'initialPrefix,initialBranchFilter,prefix,name,branchFilter', 74 | 'serverConfigurationMessageComponent', 75 | 'serverConfigurationComponent' 76 | ); 77 | ServerConfigurations.changeConfigurationParameter = function(event) { 78 | $j('.successMessage').remove(); 79 | $j(event.target).closest('tr').find('[name=changed]').val('true'); 80 | return false; 81 | }; 82 | ServerConfigurations.deleteTemplateParameter = function(event) { 83 | $j(event.target).closest('tr').remove(); 84 | return false; 85 | }; 86 | ServerConfigurations.addTemplateParameter = function(event) { 87 | $j('').append( 88 | $j(''), 89 | $j('').append($j('#typesSelect').clone().removeAttr('id').attr('name', 'type').show()), 90 | $j('Delete') 91 | ).insertBefore($j(event.target).closest('tr')); 92 | return false; 93 | }; -------------------------------------------------------------------------------- /server/src/META-INF/build-server-plugin-ServerConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /server/src/ServerConfigurations/server/AdminConfiguration/AdminPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2015 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ServerConfigurations.server.AdminConfiguration; 18 | 19 | import ServerConfigurations.common.Util; 20 | import jetbrains.buildServer.serverSide.SBuildServer; 21 | import jetbrains.buildServer.serverSide.auth.Permission; 22 | import jetbrains.buildServer.web.openapi.*; 23 | 24 | import org.jetbrains.annotations.NotNull; 25 | 26 | import javax.servlet.http.HttpServletRequest; 27 | 28 | import java.util.ArrayList; 29 | 30 | /** 31 | * Created by IIIEII on 27.05.15. 32 | */ 33 | public class AdminPage extends jetbrains.buildServer.controllers.admin.AdminPage { 34 | 35 | private static final String AFTER_PAGE_ID = "auth"; 36 | private static final String BEFORE_PAGE_ID = "email"; 37 | private static final String PAGE = "AdminPage.jsp"; 38 | 39 | private static final String TAB_TITLE = "Server Configurations"; 40 | 41 | public AdminPage(@NotNull SBuildServer server, 42 | @NotNull PagePlaces pagePlaces, 43 | @NotNull PluginDescriptor descriptor) { 44 | super(pagePlaces); 45 | setPluginName(Util.PLUGIN_NAME); 46 | setIncludeUrl(descriptor.getPluginResourcesPath(PAGE)); 47 | addCssFile(descriptor.getPluginResourcesPath("css/ServerConfigurationsAdminPage.css")); 48 | addJsFile(descriptor.getPluginResourcesPath("js/ServerConfigurationsAdminPage.js")); 49 | addCssFile("/css/forms.css"); 50 | setTabTitle(TAB_TITLE); 51 | ArrayList after = new ArrayList(); 52 | after.add(AFTER_PAGE_ID); 53 | ArrayList before = new ArrayList(); 54 | before.add(BEFORE_PAGE_ID); 55 | setPosition(PositionConstraint.between(after, before)); 56 | register(); 57 | } 58 | 59 | @Override 60 | public boolean isAvailable(@NotNull HttpServletRequest request) { 61 | return super.isAvailable(request) && checkHasGlobalPermission(request, Permission.CHANGE_SERVER_SETTINGS); 62 | } 63 | 64 | @NotNull 65 | public String getGroup() { 66 | return SERVER_RELATED_GROUP; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /server/src/ServerConfigurations/server/AdminConfiguration/Controller.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2015 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ServerConfigurations.server.AdminConfiguration; 18 | 19 | import ServerConfigurations.common.Util; 20 | import ServerConfigurations.server.ProjectConfiguration.ProjectConfigurations; 21 | import jetbrains.buildServer.controllers.BaseController; 22 | import jetbrains.buildServer.log.Loggers; 23 | import jetbrains.buildServer.serverSide.ProjectManager; 24 | import jetbrains.buildServer.serverSide.SBuildServer; 25 | import jetbrains.buildServer.serverSide.ServerPaths; 26 | import jetbrains.buildServer.serverSide.auth.AccessDeniedException; 27 | import jetbrains.buildServer.serverSide.auth.AuthUtil; 28 | import jetbrains.buildServer.serverSide.settings.ProjectSettingsManager; 29 | import jetbrains.buildServer.users.SUser; 30 | import jetbrains.buildServer.web.openapi.PluginDescriptor; 31 | import jetbrains.buildServer.web.openapi.WebControllerManager; 32 | import jetbrains.buildServer.web.util.SessionUser; 33 | import jetbrains.buildServer.web.util.WebAuthUtil; 34 | import org.jetbrains.annotations.NotNull; 35 | import org.springframework.web.servlet.ModelAndView; 36 | 37 | import javax.servlet.http.HttpServletRequest; 38 | import javax.servlet.http.HttpServletResponse; 39 | import java.io.File; 40 | import java.io.FileOutputStream; 41 | import java.io.FileReader; 42 | import java.io.IOException; 43 | import java.util.*; 44 | 45 | import com.thoughtworks.xstream.XStream; 46 | import org.springframework.web.servlet.view.RedirectView; 47 | 48 | /** 49 | * Created by IIIEII on 27.05.15. 50 | */ 51 | public class Controller extends BaseController { 52 | 53 | public static final String CONFIGURATIONS_TAG = "configurations"; 54 | public static final String CONFIGURATION_TAG = "configuration"; 55 | public static final String CONFIGURATION_TEMPLATE_TAG = "templateName"; 56 | public static final String CONFIGURATION_NAME_TAG = "name"; 57 | public static final String CONFIGURATION_PROPS_TAG = "properties"; 58 | public static final String CONFIGURATION_PROP_TAG = "property"; 59 | public static final String CONFIGURATION_PROP_NAME_TAG = "name"; 60 | public static final String CONFIGURATION_PROP_TYPE_TAG = "type"; 61 | public static final String CONFIGURATION_PROP_VALUE_TAG = "value"; 62 | 63 | public static final String TEMPLATES_TAG = "templates"; 64 | public static final String TEMPLATE_TAG = "template"; 65 | public static final String TEMPLATE_NAME_TAG = "name"; 66 | public static final String TEMPLATE_PROPS_TAG = "properties"; 67 | public static final String TEMPLATE_PROP_TAG = "templateProperty"; 68 | public static final String TEMPLATE_PROP_NAME_TAG = "name"; 69 | public static final String TEMPLATE_PROP_TYPE_TAG = "type"; 70 | 71 | private static final String CONTROLLER_PATH = "/admin/configureServerConfigurations.html"; 72 | private static final String CONFIG_FILE = "serverConfigurations.xml"; 73 | private static final String LIST_PAGE = "AdminConfigurationsListPage.jsp"; 74 | private static final String EDIT_PAGE = "AdminConfigurationEditPage.jsp"; 75 | private static final String EDIT_TEMPL_PAGE = "AdminTemplateEditPage.jsp"; 76 | private static final String ERROR_PAGE = "ErrorPage.jsp"; 77 | private String configFilePath; 78 | private String listPagePath; 79 | private String editPagePath; 80 | private String editTemplPagePath; 81 | private String errorPagePath; 82 | public static ServerConfigurations configurations; 83 | private final ProjectManager myProjectManager; 84 | private ProjectSettingsManager projectSettingsManager; 85 | 86 | public Controller(@NotNull SBuildServer server, 87 | @NotNull PluginDescriptor descriptor, 88 | @NotNull ServerPaths serverPaths, 89 | @NotNull WebControllerManager manager, 90 | @NotNull ServerConfigurations configurations, 91 | @NotNull final ProjectManager projectManager, 92 | @NotNull ProjectSettingsManager projectSettingsManager) throws IOException { 93 | manager.registerController(CONTROLLER_PATH, this); 94 | Controller.configurations = configurations; 95 | this.myProjectManager = projectManager; 96 | this.projectSettingsManager = projectSettingsManager; 97 | this.configFilePath = (new File(serverPaths.getConfigDir(), CONFIG_FILE)).getCanonicalPath(); 98 | this.listPagePath = descriptor.getPluginResourcesPath(LIST_PAGE); 99 | this.editPagePath = descriptor.getPluginResourcesPath(EDIT_PAGE); 100 | this.editTemplPagePath = descriptor.getPluginResourcesPath(EDIT_TEMPL_PAGE); 101 | this.errorPagePath = descriptor.getPluginResourcesPath(ERROR_PAGE); 102 | } 103 | 104 | @Override 105 | public ModelAndView doHandle(HttpServletRequest request, HttpServletResponse response) { 106 | try { 107 | SUser user = SessionUser.getUser(request); 108 | if (this.isAvailable(user)) { 109 | 110 | String action = request.getParameter("action"); 111 | if(action == null || action.trim().length() == 0) 112 | action = "list"; 113 | else 114 | action = action.trim(); 115 | boolean isPost = this.isPost(request); 116 | 117 | if(action.equals("list")) { // List configurations and templates 118 | 119 | loadConfiguration(); //TODO: remove(DEBUG!!!) 120 | 121 | ModelAndView modelAndView = new ModelAndView(this.listPagePath); 122 | modelAndView.getModel().put("pluginName", Util.PLUGIN_NAME); 123 | modelAndView.getModel().put("controllerPath", CONTROLLER_PATH); 124 | modelAndView.getModel().put(CONFIGURATIONS_TAG, Controller.configurations.getConfigurationsList()); 125 | modelAndView.getModel().put(TEMPLATES_TAG, Controller.configurations.getTemplatesList()); 126 | return modelAndView; 127 | 128 | } else if (action.equals("edit")) { // Edit configuration form 129 | 130 | String configurationName = request.getParameter("name"); 131 | if (configurationName != null) { 132 | ServerConfiguration configuration = Controller.configurations.getConfigurationByName(configurationName); 133 | if (configuration != null) { 134 | configuration.setTemplateName(configuration.getTemplateName()); 135 | this.saveConfiguration(); 136 | ModelAndView modelAndView = new ModelAndView(this.editPagePath); 137 | modelAndView.getModel().put("pluginName", Util.PLUGIN_NAME); 138 | modelAndView.getModel().put("controllerPath", CONTROLLER_PATH); 139 | modelAndView.getModel().put(TEMPLATES_TAG, Controller.configurations.getTemplatesList()); 140 | for (Map.Entry entry : configuration.getConfigurationMap().entrySet()) { 141 | modelAndView.getModel().put(entry.getKey(), entry.getValue()); 142 | } 143 | return modelAndView; 144 | } else { 145 | getOrCreateMessages(request).addMessage("serverConfigurationMessage", "Cannot find server configuration with name '" + configurationName + "'"); 146 | } 147 | } 148 | return new ModelAndView(this.errorPagePath); 149 | 150 | } else if (action.equals("new")) { // Create new configuration form 151 | 152 | ModelAndView modelAndView = new ModelAndView(this.editPagePath); 153 | modelAndView.getModel().put("pluginName", Util.PLUGIN_NAME); 154 | modelAndView.getModel().put("controllerPath", CONTROLLER_PATH); 155 | modelAndView.getModel().put(TEMPLATES_TAG, Controller.configurations.getTemplatesList()); 156 | return modelAndView; 157 | 158 | } else if (action.equals("save") && isPost) { // Save configuration 159 | 160 | // Check required fields 161 | if (!this.hasRequestParameter(request, "name") && !this.hasRequestParameter(request, "initialName")) { 162 | return this.sendError(request, response, "Name field cannot be empty"); 163 | } 164 | if (!this.hasRequestParameter(request, "templateName")) { 165 | return this.sendError(request, response, "Template field cannot be empty"); 166 | } 167 | if (this.hasRequestParameter(request, "name") && this.hasRequestParameter(request, "initialName")) { 168 | return this.sendError(request, response, "Cannot change name for configuration"); 169 | } 170 | // Find/create configuration 171 | ServerConfiguration serverConfiguration = null; 172 | if (!this.hasRequestParameter(request, "initialName")) { 173 | if (Controller.configurations.getConfigurationByName(request.getParameter("name")) != null) { 174 | return this.sendError(request, response, "There is another configuration with such name, please choose another"); 175 | } else { 176 | serverConfiguration = new ServerConfiguration(); 177 | serverConfiguration.setName(request.getParameter("name")); 178 | Controller.configurations.setConfiguration(serverConfiguration); 179 | } 180 | } else { 181 | serverConfiguration = Controller.configurations.getConfigurationByName(request.getParameter("initialName")); 182 | } 183 | // Set configuration data 184 | serverConfiguration.setTemplateName(request.getParameter("templateName")); 185 | String[] propKeys = request.getParameterMap().get("key"); 186 | String[] propValues = request.getParameterMap().get("value"); 187 | String[] propChanged = request.getParameterMap().get("changed"); 188 | if (propKeys != null && propValues != null && propChanged != null) { 189 | Map properties = new LinkedHashMap(); 190 | for (Integer i = 0; i < propKeys.length; i++) { 191 | if (propValues.length > i && propChanged.length > i && propChanged[i].equals("true")) { 192 | properties.put(propKeys[i], propValues[i]); 193 | } 194 | } 195 | serverConfiguration.setProperties(properties); 196 | } else { 197 | serverConfiguration.clearProperties(); 198 | } 199 | this.saveConfiguration(); 200 | return this.sendMessage(request, response, "Server configuration saved successfully"); 201 | 202 | } else if (action.equals("delete")) { // Delete configuration 203 | 204 | String configurationName = request.getParameter("name"); 205 | 206 | for (String projectId : this.myProjectManager.getProjectIds()) { 207 | ProjectConfigurations projectSettings = (ProjectConfigurations) this.projectSettingsManager.getSettings(projectId, Util.PLUGIN_NAME); 208 | if (projectSettings.getConfigurationByName(configurationName) != null) { 209 | getOrCreateMessages(request).addMessage("serverConfigurationMessage", "You cannot delete this server configuration, it is used in projects"); 210 | return new ModelAndView(new RedirectView("/admin/admin.html?item=" + Util.PLUGIN_NAME, true)); 211 | } 212 | } 213 | 214 | ServerConfiguration serverConfiguration = Controller.configurations.getConfigurationByName(configurationName); 215 | Controller.configurations.deleteConfiguration(serverConfiguration); 216 | this.saveConfiguration(); 217 | return new ModelAndView(new RedirectView("/admin/admin.html?item=" + Util.PLUGIN_NAME, true)); 218 | 219 | } else if (action.equals("newTemplate")) { // New template form 220 | 221 | ModelAndView modelAndView = new ModelAndView(this.editTemplPagePath); 222 | modelAndView.getModel().put("pluginName", Util.PLUGIN_NAME); 223 | modelAndView.getModel().put("controllerPath", CONTROLLER_PATH); 224 | modelAndView.getModel().put("types", Arrays.asList(PropertiesType.values())); 225 | return modelAndView; 226 | 227 | } else if (action.equals("editTemplate")) { // Edit template form 228 | 229 | String templateName = request.getParameter("name"); 230 | if (templateName != null) { 231 | Template template = Controller.configurations.getTemplateByName(templateName); 232 | if (template != null) { 233 | ModelAndView modelAndView = new ModelAndView(this.editTemplPagePath); 234 | modelAndView.getModel().put("pluginName", Util.PLUGIN_NAME); 235 | modelAndView.getModel().put("controllerPath", CONTROLLER_PATH); 236 | modelAndView.getModel().put("types", Arrays.asList(PropertiesType.values())); 237 | for (Map.Entry entry : template.getTemplateMap().entrySet()) { 238 | modelAndView.getModel().put(entry.getKey(), entry.getValue()); 239 | } 240 | return modelAndView; 241 | } else { 242 | getOrCreateMessages(request).addMessage("serverConfigurationMessage", "Cannot find template with name '" + templateName + "'"); 243 | } 244 | } 245 | return new ModelAndView(this.errorPagePath); 246 | 247 | } else if (action.equals("saveTemplate") && isPost) { // Save template 248 | 249 | // Check required fields 250 | if (!this.hasRequestParameter(request, "name") && !this.hasRequestParameter(request, "initialName")) { 251 | return this.sendError(request, response, "Name field cannot be empty"); 252 | } 253 | if (this.hasRequestParameter(request, "name") && this.hasRequestParameter(request, "initialName")) { 254 | return this.sendError(request, response, "Cannot change name for template"); 255 | } 256 | String[] propNames = request.getParameterMap().get("key"); 257 | String[] propTypes = request.getParameterMap().get("type"); 258 | if (propNames != null) { 259 | for (Integer i = 0; i < propNames.length; i++) { 260 | if (propNames[i].trim().equals("")) { 261 | return this.sendError(request, response, "Property name field cannot be empty"); 262 | } 263 | } 264 | } 265 | // Find/create template 266 | Template template = null; 267 | if (this.hasRequestParameter(request, "initialName")) { 268 | template = Controller.configurations.getTemplateByName(request.getParameter("initialName")); 269 | } else { 270 | template = new Template(); 271 | template.setName(request.getParameter("name")); 272 | Controller.configurations.setTemplate(template); 273 | } 274 | // Set template data 275 | template.clearProperties(); 276 | if (propNames != null && propTypes != null) { 277 | for (Integer i = 0; i < propNames.length; i++) { 278 | if (propTypes.length > i) 279 | template.setProperty(propNames[i], PropertiesType.valueOf(propTypes[i])); 280 | } 281 | } 282 | this.saveConfiguration(); 283 | return this.sendMessage(request, response, "Template saved successfully"); 284 | 285 | } else if (action.equals("deleteTemplate")) { // Delete template 286 | 287 | String templateName = request.getParameter("name"); 288 | 289 | for (ServerConfiguration configuration : configurations.getConfigurations()) { 290 | if (configuration.getTemplateName().equals(templateName)) { 291 | getOrCreateMessages(request).addMessage("serverConfigurationMessage", "You cannot delete this template, it is used in server configurations"); 292 | return new ModelAndView(new RedirectView("/admin/admin.html?item=" + Util.PLUGIN_NAME, true)); 293 | } 294 | } 295 | 296 | Template template = Controller.configurations.getTemplateByName(templateName); 297 | Controller.configurations.deleteTemplate(template); 298 | this.saveConfiguration(); 299 | return new ModelAndView(new RedirectView("/admin/admin.html?item=" + Util.PLUGIN_NAME, true)); 300 | 301 | } 302 | } else { 303 | WebAuthUtil.addAccessDeniedMessage( 304 | request, new AccessDeniedException( 305 | user, 306 | "You must be an System Administrator or Global ProjectConfiguration Administrator to manage server configurations." 307 | ) 308 | ); 309 | return null; 310 | } 311 | } catch (Exception e) { 312 | Loggers.SERVER.error(Util.PLUGIN_NAME + ": Could not handle request", e); 313 | } 314 | 315 | return null; 316 | } 317 | 318 | private ModelAndView sendError(HttpServletRequest request, HttpServletResponse response, String errorMessage) throws IOException { 319 | return this.sendMessage(request, response, 500, errorMessage); 320 | } 321 | 322 | private ModelAndView sendMessage(HttpServletRequest request, HttpServletResponse response, int statusCode, String message) throws IOException { 323 | getOrCreateMessages(request).addMessage("serverConfigurationMessage", message); 324 | response.sendError(statusCode); 325 | return null; 326 | } 327 | 328 | private ModelAndView sendMessage(HttpServletRequest request, HttpServletResponse response, String errorMessage) throws IOException { 329 | return this.sendMessage(request, response, 200, errorMessage); 330 | } 331 | 332 | private boolean hasRequestParameter(HttpServletRequest request, String name) { 333 | return (request.getParameter(name) != null && request.getParameter(name).trim().length() > 0); 334 | } 335 | 336 | public void initialise() { 337 | try { 338 | File file = new File(this.configFilePath); 339 | if (file.exists()) { 340 | this.loadConfiguration(); 341 | } else { 342 | this.saveConfiguration(); 343 | } 344 | } catch (Exception e) { 345 | Loggers.SERVER.error(Util.PLUGIN_NAME + ": Could not load configuration", e); 346 | } 347 | } 348 | 349 | public void loadConfiguration() throws IOException { 350 | XStream xstream = new XStream(); 351 | xstream.setClassLoader(Controller.configurations.getClass().getClassLoader()); 352 | xstream.setClassLoader(ServerConfiguration.class.getClassLoader()); 353 | xstream.setClassLoader(ServerConfigurationProperty.class.getClassLoader()); 354 | xstream.setClassLoader(Template.class.getClassLoader()); 355 | xstream.setClassLoader(TemplateProperty.class.getClassLoader()); 356 | xstream.processAnnotations(ServerConfigurations.class); 357 | FileReader fileReader = new FileReader(this.configFilePath); 358 | ServerConfigurations configurations = (ServerConfigurations) xstream.fromXML(fileReader); 359 | fileReader.close(); 360 | 361 | // Copy the values, because we need it on the original shared (bean), 362 | // which is a singleton 363 | if (configurations.getConfigurations() != null) { 364 | for (ServerConfiguration configuration : configurations.getConfigurations()) { 365 | Controller.configurations.setConfiguration(configuration); 366 | } 367 | } 368 | if (configurations.getTemplates() != null) { 369 | for (Template template: configurations.getTemplates()) { 370 | Controller.configurations.setTemplate(template); 371 | } 372 | } 373 | saveConfiguration(); 374 | } 375 | 376 | public void saveConfiguration() throws IOException { 377 | XStream xstream = new XStream(); 378 | xstream.processAnnotations(Controller.configurations.getClass()); 379 | File file = new File(this.configFilePath); 380 | file.createNewFile(); 381 | FileOutputStream fileOutputStream = new FileOutputStream(file); 382 | xstream.toXML(Controller.configurations, fileOutputStream); 383 | fileOutputStream.flush(); 384 | fileOutputStream.close(); 385 | } 386 | 387 | private boolean isAvailable(@NotNull SUser user) { 388 | return AuthUtil.isSystemAdmin(user) || AuthUtil.hasPermissionToManageAllProjects(user); 389 | } 390 | 391 | private boolean isAvailable(@NotNull HttpServletRequest request) { 392 | SUser user = SessionUser.getUser(request); 393 | return this.isAvailable(user); 394 | } 395 | 396 | private String join(String[] arr, String glue) { 397 | String result = ""; 398 | for (Integer i = 0; i < arr.length; i++) { 399 | result += arr[i]; 400 | if (i < arr.length - 1) 401 | result += glue; 402 | } 403 | return result; 404 | } 405 | 406 | } 407 | -------------------------------------------------------------------------------- /server/src/ServerConfigurations/server/AdminConfiguration/PropertiesType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2015 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ServerConfigurations.server.AdminConfiguration; 18 | 19 | /** 20 | * Created by IIIEII on 02.06.15. 21 | */ 22 | public enum PropertiesType { 23 | STRING, 24 | PASSWORD, 25 | } 26 | 27 | -------------------------------------------------------------------------------- /server/src/ServerConfigurations/server/AdminConfiguration/ServerConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2015 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ServerConfigurations.server.AdminConfiguration; 18 | 19 | import com.thoughtworks.xstream.annotations.XStreamAlias; 20 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 21 | 22 | import java.util.ArrayList; 23 | import java.util.LinkedHashMap; 24 | import java.util.List; 25 | import java.util.Map; 26 | 27 | /** 28 | * Created by IIIEII on 27.05.15. 29 | */ 30 | @XStreamAlias(Controller.CONFIGURATION_TAG) 31 | public class ServerConfiguration { 32 | 33 | @XStreamAlias(Controller.CONFIGURATION_NAME_TAG) 34 | private String name = null; 35 | 36 | @XStreamAlias(Controller.CONFIGURATION_TEMPLATE_TAG) 37 | private String templateName = null; 38 | 39 | @XStreamImplicit 40 | private List properties = new ArrayList(); 41 | 42 | public String getName() { 43 | return this.name; 44 | } 45 | 46 | public void setName(String name) { 47 | this.name = name; 48 | } 49 | 50 | public String getTemplateName() { 51 | return templateName; 52 | } 53 | public Template getTemplate() { 54 | return Controller.configurations.getTemplateByName(templateName); 55 | } 56 | public void setTemplateName(String templateName) { 57 | this.templateName = templateName; 58 | this.syncTemplateProperties(); 59 | } 60 | private void syncTemplateProperties() { 61 | Template template = this.getTemplate(); 62 | if (template != null) { 63 | List propsToRemove = new ArrayList(); 64 | for (ServerConfigurationProperty property : this.getProperties() ) { 65 | if (template.getPropertyByName(property.getName()) == null) { 66 | propsToRemove.add(property); 67 | } 68 | } 69 | for (ServerConfigurationProperty property : propsToRemove) { 70 | this.getProperties().remove(property); 71 | } 72 | for (TemplateProperty templateProperty : template.getProperties()) { 73 | if (this.getPropertyByName(templateProperty.getName()) == null) { 74 | this.setProperty(templateProperty.getName(), "", templateProperty.getType()); 75 | } 76 | } 77 | } 78 | } 79 | 80 | public List getProperties() { 81 | if (this.properties == null) 82 | this.properties = new ArrayList(); 83 | return this.properties; 84 | } 85 | public ServerConfigurationProperty getPropertyByName(String name) { 86 | for (ServerConfigurationProperty property : this.getProperties()) { 87 | if (property.getName().contentEquals(name)) { 88 | return property; 89 | } 90 | } 91 | return null; 92 | } 93 | public void setProperties(List properties) { 94 | Template template = this.getTemplate(); 95 | if (template != null) { 96 | if (properties != null) { 97 | for (ServerConfigurationProperty property : properties) { 98 | TemplateProperty templateProperty = template.getPropertyByName(property.getName()); 99 | if (templateProperty != null) { 100 | this.setProperty(property.getName(), property.getValue(templateProperty.getType()), templateProperty.getType()); 101 | } else { 102 | this.setProperty(property.getName(), property.getValue(PropertiesType.STRING), PropertiesType.STRING); 103 | } 104 | } 105 | } 106 | } 107 | } 108 | public void setProperties(Map properties) { 109 | Template template = this.getTemplate(); 110 | if (template != null) { 111 | if (properties != null) { 112 | for (Map.Entry property : properties.entrySet()) { 113 | TemplateProperty templateProperty = template.getPropertyByName(property.getKey()); 114 | if (templateProperty != null) { 115 | this.setProperty(property.getKey(), property.getValue(), templateProperty.getType()); 116 | } else { 117 | this.setProperty(property.getKey(), property.getValue(), PropertiesType.STRING); 118 | } 119 | } 120 | } 121 | } 122 | } 123 | public void setProperty(String name, String value, PropertiesType type) { 124 | ServerConfigurationProperty property = this.getPropertyByName(name); 125 | if (property != null) { 126 | property.setValue(value, type); 127 | } else { 128 | property = new ServerConfigurationProperty(name, value, type); 129 | this.getProperties().add(property); 130 | } 131 | } 132 | public String getPropertyValue(String name, PropertiesType type) { 133 | ServerConfigurationProperty property = this.getPropertyByName(name); 134 | if (property == null) { 135 | return null; 136 | } 137 | return property.getValue(type); 138 | } 139 | public void clearProperties() { 140 | this.getProperties().clear(); 141 | } 142 | 143 | public Map getConfigurationMap() { 144 | return getConfigurationMap(false); 145 | } 146 | 147 | public Map getConfigurationMap(Boolean withPasswords) { 148 | Template template = Controller.configurations.getTemplateByName(templateName); 149 | Map configuration = new LinkedHashMap(); 150 | configuration.put(Controller.CONFIGURATION_NAME_TAG, name); 151 | if (template != null) { 152 | configuration.put(Controller.CONFIGURATION_TEMPLATE_TAG, templateName); 153 | List propertiesList = new ArrayList(); 154 | for (ServerConfigurationProperty property : this.getProperties()) { 155 | Map propertyMap = new LinkedHashMap(); 156 | TemplateProperty templateProperty = template.getPropertyByName(property.getName()); 157 | if (templateProperty != null) { 158 | propertyMap.put(Controller.CONFIGURATION_PROP_NAME_TAG, property.getName()); 159 | propertyMap.put(Controller.CONFIGURATION_PROP_TYPE_TAG, templateProperty.getType().toString()); 160 | if (templateProperty.getType().equals(PropertiesType.PASSWORD)) { 161 | propertyMap.put(Controller.CONFIGURATION_PROP_VALUE_TAG, withPasswords ? this.getPropertyValue(property.getName(), templateProperty.getType()) : ""); 162 | } else { 163 | propertyMap.put(Controller.CONFIGURATION_PROP_VALUE_TAG, this.getPropertyValue(property.getName(), templateProperty.getType())); 164 | } 165 | } 166 | propertiesList.add(propertyMap); 167 | } 168 | configuration.put(Controller.CONFIGURATION_PROPS_TAG, propertiesList); 169 | } 170 | return configuration; 171 | } 172 | } 173 | -------------------------------------------------------------------------------- /server/src/ServerConfigurations/server/AdminConfiguration/ServerConfigurationProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2015 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ServerConfigurations.server.AdminConfiguration; 18 | 19 | import ServerConfigurations.server.ServerUtil; 20 | import com.thoughtworks.xstream.annotations.XStreamAlias; 21 | 22 | import java.util.LinkedHashMap; 23 | import java.util.Map; 24 | 25 | /** 26 | * Created by IIIEII on 02.06.15. 27 | */ 28 | @XStreamAlias(Controller.CONFIGURATION_PROP_TAG) 29 | public class ServerConfigurationProperty { 30 | 31 | @XStreamAlias(Controller.CONFIGURATION_PROP_NAME_TAG) 32 | private String name = null; 33 | 34 | @XStreamAlias(Controller.CONFIGURATION_PROP_VALUE_TAG) 35 | private String value = null; 36 | 37 | public ServerConfigurationProperty(String name, String value, PropertiesType type) { 38 | this.name = name; 39 | this.setValue(value, type); 40 | } 41 | 42 | public String getName() { 43 | return name; 44 | } 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | public String getValue(PropertiesType type) { 50 | if (type.equals(PropertiesType.PASSWORD)) { 51 | return ServerUtil.decrypt(value); 52 | } 53 | return value; 54 | } 55 | public void setValue(String value, PropertiesType type) { 56 | if (type.equals(PropertiesType.PASSWORD)) { 57 | this.value = ServerUtil.encrypt(value); 58 | } else { 59 | this.value = value; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /server/src/ServerConfigurations/server/AdminConfiguration/ServerConfigurations.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000-2015 JetBrains s.r.o. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ServerConfigurations.server.AdminConfiguration; 18 | 19 | import com.thoughtworks.xstream.annotations.XStreamAlias; 20 | import com.thoughtworks.xstream.annotations.XStreamImplicit; 21 | 22 | import java.util.ArrayList; 23 | import java.util.List; 24 | import java.util.Map; 25 | 26 | /** 27 | * Created by IIIEII on 27.05.15. 28 | */ 29 | @XStreamAlias(Controller.CONFIGURATIONS_TAG) 30 | public class ServerConfigurations { 31 | 32 | @XStreamImplicit 33 | private List configurations = new ArrayList(); 34 | 35 | @XStreamImplicit 36 | private List