diff --git a/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generate-archive-vdb-action.png b/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generate-archive-vdb-action.png new file mode 100644 index 0000000000..84a1a65524 Binary files /dev/null and b/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generate-archive-vdb-action.png differ diff --git a/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generate-dynamic-vdb-action.png b/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generate-dynamic-vdb-action.png new file mode 100644 index 0000000000..bfc7b76e13 Binary files /dev/null and b/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generate-dynamic-vdb-action.png differ diff --git a/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generate-dynamic-vdb-page-1.png b/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generate-dynamic-vdb-page-1.png new file mode 100644 index 0000000000..7059e1b3ca Binary files /dev/null and b/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generate-dynamic-vdb-page-1.png differ diff --git a/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generate-dynamic-vdb-page-2.png b/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generate-dynamic-vdb-page-2.png new file mode 100644 index 0000000000..80353e6e5b Binary files /dev/null and b/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generate-dynamic-vdb-page-2.png differ diff --git a/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generate-vdb-archive-page-1.png b/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generate-vdb-archive-page-1.png new file mode 100644 index 0000000000..f826bf5ede Binary files /dev/null and b/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generate-vdb-archive-page-1.png differ diff --git a/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generate-vdb-archive-page-2.png b/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generate-vdb-archive-page-2.png new file mode 100644 index 0000000000..467923eac1 Binary files /dev/null and b/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generate-vdb-archive-page-2.png differ diff --git a/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generated-vdb-and-models-from-xml.png b/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generated-vdb-and-models-from-xml.png new file mode 100644 index 0000000000..9594267030 Binary files /dev/null and b/documentation/guides/Teiid_Designer_User_Guide/en-US/images/screencaps/generated-vdb-and-models-from-xml.png differ diff --git a/documentation/guides/Teiid_Designer_User_Guide/en-US/managing-vdbs.xml b/documentation/guides/Teiid_Designer_User_Guide/en-US/managing-vdbs.xml index a1c39c2425..1e47c4fdd4 100644 --- a/documentation/guides/Teiid_Designer_User_Guide/en-US/managing-vdbs.xml +++ b/documentation/guides/Teiid_Designer_User_Guide/en-US/managing-vdbs.xml @@ -350,5 +350,97 @@ +
+ Working with Dynamic VDBs + This section desribes the Designer features which allow generating a VDB archive with XMI models from existing dynamic + VDBs (*-vdb.xml) files and generating dynamic VDBs from existing VDB archives. +
+ Generate VDB Archive + To generate a VDB archive and models from a dynamic vdb (*-vdb.xml) file in your workspace: + + + Step 1 - Import (or drag and drop) a dynamic vdb file into a model project or folder + + + + Step 2 - Select the dynamic vdb file in the Model Explorer, then + right-click and select the Modeling > Generate Archive VDB and Models action. + + + + + + + + + Step 3 - The first page of thw wizard will show the Dynamic VDB Contents + Verify the contents and click Next > + + + + + + + + + Step 4 - On the second page, specify details and options for yor VDB archive + including actual VDB name, VDB archive file name and target location (project or folder). + Click Generate to create the VDB archive and associated models in your target location. + Then click Finish + + + + + + + + + The generated VDB and XMI models will now be visible in the Model Explorer view. + + + + + +
+
+ Generate Dynamic VDB + To generate a dynamic VDB from a VDB archive (*.vdb) in your workspace: + + + Step 1 - Select a VDB archive file in the Model Explorer, then + right-click and select the Modeling > Generate Dynamic VDB action. + + + + + + + + + Step 2 - The first page of thw wizard will show the selected VDB archive file information. + You can also set the VDB name adn version as well as specify the target location and actual file name (*-vdb.xml). + Click Next > + + + + + + + + + Step 3 - On the second page, click the Generate button. The + XML contents will be displayed in the viewer which represents the same basic metadata from the origional VDB. + Click Generate to create the VDB archive and associated models in your target location. + Then click Finish to save the XML string to the file specified in Step 2. + + + + + + + + +
+
diff --git a/documentation/guides/Teiid_Designer_User_Guide/en-US/master.xml b/documentation/guides/Teiid_Designer_User_Guide/en-US/master.xml index f8400ca732..cb4d77497a 100644 --- a/documentation/guides/Teiid_Designer_User_Guide/en-US/master.xml +++ b/documentation/guides/Teiid_Designer_User_Guide/en-US/master.xml @@ -20,15 +20,9 @@ Teiid Designer User Guide -<<<<<<< HEAD - 9.2.0 + 9.2.1 - 9.2.0 -======= - 9.0.3 - - 9.0.3 ->>>>>>> 9.0.x + 9.2.1 1 diff --git a/documentation/guides/Teiid_Designer_User_Guide/en-US/testmodels.xml b/documentation/guides/Teiid_Designer_User_Guide/en-US/testmodels.xml index dd9eb954aa..24147be065 100644 --- a/documentation/guides/Teiid_Designer_User_Guide/en-US/testmodels.xml +++ b/documentation/guides/Teiid_Designer_User_Guide/en-US/testmodels.xml @@ -503,6 +503,13 @@ create a Teiid Connection Profile specific for that VDB, open the Database Development perspective and create a connection to your VDB. Continue with Step's 2 and 3 above. + + You can deploy a dynamic VDB to the server, but the + VDB may end up being INACTIVE if any referenced data source (JNDI name) is not already be deployed. + Dynamic VDBs do not contain enough connection or data source information to automatically + find and/or deploy a data source. + + If you do not have a Teiid instance defined or your default Teiid instance is disconnected, the following dialog will be displayed diff --git a/documentation/guides/Teiid_Designer_User_Guide/pom.xml b/documentation/guides/Teiid_Designer_User_Guide/pom.xml index 6a47896374..15b536c49f 100644 --- a/documentation/guides/Teiid_Designer_User_Guide/pom.xml +++ b/documentation/guides/Teiid_Designer_User_Guide/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.jboss.tools ${docname}-${translation} - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT jdocbook ${bookname}-(${translation}) diff --git a/features/org.teiid.datatools.connectivity.feature/feature.xml b/features/org.teiid.datatools.connectivity.feature/feature.xml index 60aa0b2109..69df928289 100644 --- a/features/org.teiid.datatools.connectivity.feature/feature.xml +++ b/features/org.teiid.datatools.connectivity.feature/feature.xml @@ -15,7 +15,7 @@ diff --git a/features/org.teiid.datatools.connectivity.feature/pom.xml b/features/org.teiid.datatools.connectivity.feature/pom.xml index 38ed723d61..f41852994f 100644 --- a/features/org.teiid.datatools.connectivity.feature/pom.xml +++ b/features/org.teiid.datatools.connectivity.feature/pom.xml @@ -9,6 +9,6 @@ org.jboss.tools org.teiid.datatools.connectivity.feature - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-feature diff --git a/features/org.teiid.designer.feature/feature.xml b/features/org.teiid.designer.feature/feature.xml index bdccd35bf5..24c4aeb99b 100644 --- a/features/org.teiid.designer.feature/feature.xml +++ b/features/org.teiid.designer.feature/feature.xml @@ -9,7 +9,7 @@ @@ -38,7 +38,7 @@ ws="gtk"/> diff --git a/features/org.teiid.designer.feature/pom.xml b/features/org.teiid.designer.feature/pom.xml index c9c3146010..881ae8196c 100644 --- a/features/org.teiid.designer.feature/pom.xml +++ b/features/org.teiid.designer.feature/pom.xml @@ -8,6 +8,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.feature - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-feature diff --git a/features/org.teiid.designer.crypto.dummy.feature/.project b/features/org.teiid.designer.library.feature/.project similarity index 86% rename from features/org.teiid.designer.crypto.dummy.feature/.project rename to features/org.teiid.designer.library.feature/.project index e01748fd06..103014d68d 100644 --- a/features/org.teiid.designer.crypto.dummy.feature/.project +++ b/features/org.teiid.designer.library.feature/.project @@ -1,6 +1,6 @@ - org.teiid.designer.crypto.dummy.feature + org.teiid.designer.library.feature diff --git a/features/org.teiid.designer.crypto.dummy.feature/AUTHORS.txt b/features/org.teiid.designer.library.feature/AUTHORS.txt similarity index 100% rename from features/org.teiid.designer.crypto.dummy.feature/AUTHORS.txt rename to features/org.teiid.designer.library.feature/AUTHORS.txt diff --git a/features/org.teiid.designer.crypto.dummy.feature/LEGAL.txt b/features/org.teiid.designer.library.feature/LEGAL.txt similarity index 100% rename from features/org.teiid.designer.crypto.dummy.feature/LEGAL.txt rename to features/org.teiid.designer.library.feature/LEGAL.txt diff --git a/features/org.teiid.designer.crypto.dummy.feature/build.properties b/features/org.teiid.designer.library.feature/build.properties similarity index 100% rename from features/org.teiid.designer.crypto.dummy.feature/build.properties rename to features/org.teiid.designer.library.feature/build.properties diff --git a/features/org.teiid.designer.crypto.dummy.feature/feature.properties b/features/org.teiid.designer.library.feature/feature.properties similarity index 90% rename from features/org.teiid.designer.crypto.dummy.feature/feature.properties rename to features/org.teiid.designer.library.feature/feature.properties index 08fbefdeb6..3d154babde 100644 --- a/features/org.teiid.designer.crypto.dummy.feature/feature.properties +++ b/features/org.teiid.designer.library.feature/feature.properties @@ -14,10 +14,10 @@ # Feature Information Page properties -description = The Teiid DataTools Connectivity Feature provides connectivity to Teiid to browse metadata and execute SQL in a DataTools context. +description = Provides miscellaneous plugins and fragments correcting deficiences with libraries depended on by Teiid Designer. # "featureName" property - name of the feature -featureName=Teiid DataTools Connectivity Feature +featureName=Teiid Designer Library Feature # "providerName" property - name of the company that provides the feature providerName=JBoss by Red Hat diff --git a/features/org.teiid.designer.crypto.dummy.feature/feature.xml b/features/org.teiid.designer.library.feature/feature.xml similarity index 70% rename from features/org.teiid.designer.crypto.dummy.feature/feature.xml rename to features/org.teiid.designer.library.feature/feature.xml index 325dd8fe42..1095a8abb3 100644 --- a/features/org.teiid.designer.crypto.dummy.feature/feature.xml +++ b/features/org.teiid.designer.library.feature/feature.xml @@ -1,8 +1,8 @@ @@ -22,10 +22,11 @@ diff --git a/features/org.teiid.designer.crypto.dummy.feature/license.html b/features/org.teiid.designer.library.feature/license.html similarity index 100% rename from features/org.teiid.designer.crypto.dummy.feature/license.html rename to features/org.teiid.designer.library.feature/license.html diff --git a/features/org.teiid.designer.crypto.dummy.feature/pom.xml b/features/org.teiid.designer.library.feature/pom.xml similarity index 82% rename from features/org.teiid.designer.crypto.dummy.feature/pom.xml rename to features/org.teiid.designer.library.feature/pom.xml index 7389f11fe8..39cafb78cf 100644 --- a/features/org.teiid.designer.crypto.dummy.feature/pom.xml +++ b/features/org.teiid.designer.library.feature/pom.xml @@ -7,7 +7,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs 0.0.4-SNAPSHOT org.jboss.tools - org.teiid.designer.crypto.dummy.feature - 9.2.0-SNAPSHOT + org.teiid.designer.library.feature + 9.2.1-SNAPSHOT eclipse-feature diff --git a/features/org.teiid.designer.runtime.feature/feature.xml b/features/org.teiid.designer.runtime.feature/feature.xml index 748daefc00..125139f76f 100644 --- a/features/org.teiid.designer.runtime.feature/feature.xml +++ b/features/org.teiid.designer.runtime.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/org.teiid.designer.runtime.feature/pom.xml b/features/org.teiid.designer.runtime.feature/pom.xml index e81162042b..609c617538 100644 --- a/features/org.teiid.designer.runtime.feature/pom.xml +++ b/features/org.teiid.designer.runtime.feature/pom.xml @@ -8,6 +8,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.runtime.feature - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-feature diff --git a/features/org.teiid.designer.teiid.client.feature/feature.xml b/features/org.teiid.designer.teiid.client.feature/feature.xml index 56ca514f43..52ffa905e3 100644 --- a/features/org.teiid.designer.teiid.client.feature/feature.xml +++ b/features/org.teiid.designer.teiid.client.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/org.teiid.designer.teiid.client.feature/pom.xml b/features/org.teiid.designer.teiid.client.feature/pom.xml index 356e9cdf2a..83f9ec9f0b 100644 --- a/features/org.teiid.designer.teiid.client.feature/pom.xml +++ b/features/org.teiid.designer.teiid.client.feature/pom.xml @@ -8,6 +8,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.teiid.client.feature - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-feature diff --git a/features/org.teiid.designer.test.feature/feature.xml b/features/org.teiid.designer.test.feature/feature.xml index b10232d08b..8c009679b6 100644 --- a/features/org.teiid.designer.test.feature/feature.xml +++ b/features/org.teiid.designer.test.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/org.teiid.designer.test.feature/pom.xml b/features/org.teiid.designer.test.feature/pom.xml index 1cd464ac30..f3e2477996 100644 --- a/features/org.teiid.designer.test.feature/pom.xml +++ b/features/org.teiid.designer.test.feature/pom.xml @@ -8,6 +8,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.test.feature - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-feature diff --git a/features/pom.xml b/features/pom.xml index 7c4847b602..23f031b51c 100644 --- a/features/pom.xml +++ b/features/pom.xml @@ -14,7 +14,7 @@ pom - org.teiid.designer.crypto.dummy.feature + org.teiid.designer.library.feature org.teiid.designer.teiid.client.feature org.teiid.designer.feature org.teiid.designer.test.feature @@ -41,8 +41,8 @@ - + @@ -67,6 +67,7 @@ + diff --git a/plugins/crypto/org.teiid.designer.bc.dummy/.classpath b/plugins/crypto/org.teiid.designer.bc.dummy/.classpath deleted file mode 100644 index 098194ca4b..0000000000 --- a/plugins/crypto/org.teiid.designer.bc.dummy/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/plugins/crypto/org.teiid.designer.bc.dummy/.project b/plugins/crypto/org.teiid.designer.bc.dummy/.project deleted file mode 100644 index 2c8e871144..0000000000 --- a/plugins/crypto/org.teiid.designer.bc.dummy/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.teiid.designer.bc.dummy - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/plugins/crypto/org.teiid.designer.bc.dummy/COPYRIGHT.txt b/plugins/crypto/org.teiid.designer.bc.dummy/COPYRIGHT.txt deleted file mode 100644 index 47fe775315..0000000000 --- a/plugins/crypto/org.teiid.designer.bc.dummy/COPYRIGHT.txt +++ /dev/null @@ -1,4 +0,0 @@ -Portions Copyright (C) 2008-2015 Red Hat, Inc. -Portions Copyright (C) 2000-2007 MetaMatrix, Inc. -Portions Copyright (c) 2000, 2003, 2008 IBM Corporation and others. -Portions Copyright (c) 1997-2000 Sun Microsystems, Inc. \ No newline at end of file diff --git a/plugins/crypto/org.teiid.designer.bc.dummy/LICENSE-lgpl-2.1.txt b/plugins/crypto/org.teiid.designer.bc.dummy/LICENSE-lgpl-2.1.txt deleted file mode 100644 index 5ab7695ab8..0000000000 --- a/plugins/crypto/org.teiid.designer.bc.dummy/LICENSE-lgpl-2.1.txt +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/plugins/crypto/org.teiid.designer.bc.dummy/META-INF/MANIFEST.MF b/plugins/crypto/org.teiid.designer.bc.dummy/META-INF/MANIFEST.MF deleted file mode 100644 index dba0230d64..0000000000 --- a/plugins/crypto/org.teiid.designer.bc.dummy/META-INF/MANIFEST.MF +++ /dev/null @@ -1,13 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.teiid.designer.bc.dummy;singleton:=true -Bundle-Version: 9.2.0.qualifier -Bundle-Vendor: %pluginProvider -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Bundle-Localization: plugin -Bundle-ActivationPolicy: lazy -Require-Bundle: org.apache.commons.codec -Export-Package: org.bouncycastle.asn1, - org.bouncycastle.x509.extension - diff --git a/plugins/crypto/org.teiid.designer.bc.dummy/build.properties b/plugins/crypto/org.teiid.designer.bc.dummy/build.properties deleted file mode 100644 index 7f4769c3d7..0000000000 --- a/plugins/crypto/org.teiid.designer.bc.dummy/build.properties +++ /dev/null @@ -1,9 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - COPYRIGHT.txt,\ - LICENSE-lgpl-2.1.txt,\ - plugin.properties -src.includes = COPYRIGHT.txt,\ - LICENSE-lgpl-2.1.txt \ No newline at end of file diff --git a/plugins/crypto/org.teiid.designer.bc.dummy/pom.xml b/plugins/crypto/org.teiid.designer.bc.dummy/pom.xml deleted file mode 100644 index 1cc7694a86..0000000000 --- a/plugins/crypto/org.teiid.designer.bc.dummy/pom.xml +++ /dev/null @@ -1,26 +0,0 @@ - - 4.0.0 - - org.jboss.tools.teiid.plugins - crypto - 0.0.4-SNAPSHOT - - org.jboss.tools - org.teiid.designer.bc.dummy - 9.2.0-SNAPSHOT - eclipse-plugin - - - - org.eclipse.tycho - tycho-compiler-plugin - ${tychoVersion} - - 1.7 - 1.7 - - - - - diff --git a/plugins/crypto/org.teiid.designer.bc.dummy/src/org/bouncycastle/asn1/ASN1Object.java b/plugins/crypto/org.teiid.designer.bc.dummy/src/org/bouncycastle/asn1/ASN1Object.java deleted file mode 100644 index 2e73a9582c..0000000000 --- a/plugins/crypto/org.teiid.designer.bc.dummy/src/org/bouncycastle/asn1/ASN1Object.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. -* -* See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing. -* -* See the AUTHORS.txt file distributed with this work for a full listing of individual contributors. -*/ -package org.bouncycastle.asn1; - -import org.apache.commons.codec.binary.Hex; - -/** - * - */ -public class ASN1Object { - - private byte[] content; - - /** - * @param content - */ - public ASN1Object(byte[] content) { - this.content = content; - } - - @Override - public String toString() { - if (content == null) - return new String(); - - return new String(Hex.encodeHex(content)); - } -} diff --git a/plugins/crypto/org.teiid.designer.bc.dummy/src/org/bouncycastle/x509/extension/X509ExtensionUtil.java b/plugins/crypto/org.teiid.designer.bc.dummy/src/org/bouncycastle/x509/extension/X509ExtensionUtil.java deleted file mode 100644 index 76e6801df7..0000000000 --- a/plugins/crypto/org.teiid.designer.bc.dummy/src/org/bouncycastle/x509/extension/X509ExtensionUtil.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. -* -* See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing. -* -* See the AUTHORS.txt file distributed with this work for a full listing of individual contributors. -*/ -package org.bouncycastle.x509.extension; - -import org.bouncycastle.asn1.ASN1Object; - -/** - * - */ -public class X509ExtensionUtil { - - public static ASN1Object fromExtensionValue(byte[] content) { - return new ASN1Object(content); - } -} diff --git a/plugins/crypto/pom.xml b/plugins/crypto/pom.xml deleted file mode 100644 index 0230709571..0000000000 --- a/plugins/crypto/pom.xml +++ /dev/null @@ -1,18 +0,0 @@ - - 4.0.0 - - org.jboss.tools.teiid - plugins - 0.0.4-SNAPSHOT - - org.jboss.tools.teiid.plugins - crypto - teiid.plugins.crypto - 0.0.4-SNAPSHOT - pom - - org.teiid.designer.bc.dummy - - diff --git a/plugins/org.teiid.core.designer/META-INF/MANIFEST.MF b/plugins/org.teiid.core.designer/META-INF/MANIFEST.MF index 69c049fee8..5a68149fab 100644 --- a/plugins/org.teiid.core.designer/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.core.designer/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.core.designer;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.core.designer.CoreModelerPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.core.designer/pom.xml b/plugins/org.teiid.core.designer/pom.xml index 60baf3e378..69a04ec3c4 100644 --- a/plugins/org.teiid.core.designer/pom.xml +++ b/plugins/org.teiid.core.designer/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.core.designer - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.core.designer/src/org/teiid/core/designer/util/StringUtilities.java b/plugins/org.teiid.core.designer/src/org/teiid/core/designer/util/StringUtilities.java index 1d955b135b..654878d6aa 100644 --- a/plugins/org.teiid.core.designer/src/org/teiid/core/designer/util/StringUtilities.java +++ b/plugins/org.teiid.core.designer/src/org/teiid/core/designer/util/StringUtilities.java @@ -474,6 +474,62 @@ public static void main(String[] args) { System.out.println(" START NAME = " + startName + " UNIQUE NAME = " + newName); } + /** + * Compares two strings lexicographically. + * The comparison is based on the Unicode value of each character in + * the strings. + * @param str1 + * @param str2 + * + * @return the value 0 if the str1 is equal to str2; + * a value less than 0 if str1 + * is lexicographically less than str2; + * and a value greater than 0 if str1 is + * lexicographically greater than str2. + */ + public static int compare(char[] str1, char[] str2) { + int len1 = str1.length; + int len2 = str2.length; + int n = Math.min(len1, len2); + int i = 0; + while (n-- != 0) { + char c1 = str1[i]; + char c2 = str2[i++]; + if (c1 != c2) { + return c1 - c2; + } + } + return len1 - len2; + } + + /** + * Returns the length of the common prefix between s1 and s2. + * @param s1 + * @param s2 + * @return length of the prefix + */ + public static int prefixLength(char[] s1, char[] s2) { + int len = 0; + int max = Math.min(s1.length, s2.length); + for (int i = 0; i < max && s1[i] == s2[i]; ++i) + ++len; + return len; + } + + /** + * Returns the length of the common prefix between s1 and s2. + * @param s1 + * @param s2 + * @return length of the prefix + */ + public static int prefixLength(String s1, String s2) { + int len = 0; + int max = Math.min(s1.length(), s2.length()); + for (int i = 0; i < max && s1.charAt(i) == s2.charAt(i); ++i) + ++len; + return len; + } + private StringUtilities() { } } diff --git a/plugins/org.teiid.datatools.connectivity.model/META-INF/MANIFEST.MF b/plugins/org.teiid.datatools.connectivity.model/META-INF/MANIFEST.MF index b36804ddc0..da82f04c30 100644 --- a/plugins/org.teiid.datatools.connectivity.model/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.datatools.connectivity.model/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.datatools.connectivity.model;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-ClassPath: . Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.datatools.connectivity.model/pom.xml b/plugins/org.teiid.datatools.connectivity.model/pom.xml index f285e941b7..ee87026dff 100644 --- a/plugins/org.teiid.datatools.connectivity.model/pom.xml +++ b/plugins/org.teiid.datatools.connectivity.model/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.datatools.connectivity.model - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.datatools.connectivity.ui.flatfile/META-INF/MANIFEST.MF b/plugins/org.teiid.datatools.connectivity.ui.flatfile/META-INF/MANIFEST.MF index 6709ea561e..7c58ec2a22 100644 --- a/plugins/org.teiid.datatools.connectivity.ui.flatfile/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.datatools.connectivity.ui.flatfile/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginProvider Bundle-SymbolicName: org.teiid.datatools.connectivity.ui.flatfile;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Fragment-Host: org.eclipse.datatools.connectivity.oda.flatfile.ui;bundle-version="[3.1.7,4.0.0)" Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-Localization: plugin diff --git a/plugins/org.teiid.datatools.connectivity.ui.flatfile/pom.xml b/plugins/org.teiid.datatools.connectivity.ui.flatfile/pom.xml index f352baf59d..860b98d05d 100644 --- a/plugins/org.teiid.datatools.connectivity.ui.flatfile/pom.xml +++ b/plugins/org.teiid.datatools.connectivity.ui.flatfile/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.datatools.connectivity.ui.flatfile - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.datatools.connectivity.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.datatools.connectivity.ui/META-INF/MANIFEST.MF index 710c5b320b..44b3922a4c 100644 --- a/plugins/org.teiid.datatools.connectivity.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.datatools.connectivity.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.teiid.datatools.connectivity.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.datatools.connectivity.ui.Activator Bundle-Vendor: %pluginProvider Require-Bundle: org.eclipse.ui;bundle-version="[3.106.1,4.0.0)", diff --git a/plugins/org.teiid.datatools.connectivity.ui/pom.xml b/plugins/org.teiid.datatools.connectivity.ui/pom.xml index 52d5a51282..cf17fa29ac 100644 --- a/plugins/org.teiid.datatools.connectivity.ui/pom.xml +++ b/plugins/org.teiid.datatools.connectivity.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.datatools.connectivity.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.datatools.connectivity/META-INF/MANIFEST.MF b/plugins/org.teiid.datatools.connectivity/META-INF/MANIFEST.MF index edc007f523..c807cc7edb 100644 --- a/plugins/org.teiid.datatools.connectivity/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.datatools.connectivity/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.teiid.datatools.connectivity;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.datatools.connectivity.Activator Bundle-Vendor: %pluginProvider Require-Bundle: org.eclipse.ui;bundle-version="[3.106.1,4.0.0)", diff --git a/plugins/org.teiid.datatools.connectivity/pom.xml b/plugins/org.teiid.datatools.connectivity/pom.xml index 371c74b826..405bf03008 100644 --- a/plugins/org.teiid.datatools.connectivity/pom.xml +++ b/plugins/org.teiid.datatools.connectivity/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.datatools.connectivity - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.datatools.connectivity/src/org/teiid/datatools/connectivity/security/impl/EquinoxSecureStorageProvider.java b/plugins/org.teiid.datatools.connectivity/src/org/teiid/datatools/connectivity/security/impl/EquinoxSecureStorageProvider.java index 52e0a7e8be..90f05b61f8 100644 --- a/plugins/org.teiid.datatools.connectivity/src/org/teiid/datatools/connectivity/security/impl/EquinoxSecureStorageProvider.java +++ b/plugins/org.teiid.datatools.connectivity/src/org/teiid/datatools/connectivity/security/impl/EquinoxSecureStorageProvider.java @@ -11,6 +11,8 @@ import java.net.URLEncoder; import java.util.Arrays; import java.util.List; + +import org.eclipse.core.runtime.Assert; import org.eclipse.equinox.security.storage.EncodingUtils; import org.eclipse.equinox.security.storage.ISecurePreferences; import org.eclipse.equinox.security.storage.SecurePreferencesFactory; @@ -103,4 +105,12 @@ private ISecurePreferences getNode(String nodeKey) throws Exception { return root.node(encoded); } + + @Override + public void removeFromSecureStorage(String nodeKey) throws Exception { + Assert.isNotNull(nodeKey); + ISecurePreferences node = getNode(nodeKey); + node.removeNode(); + } + } diff --git a/plugins/org.teiid.designer.advisor.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.advisor.ui/META-INF/MANIFEST.MF index e45e74489c..c399f7dce1 100644 --- a/plugins/org.teiid.designer.advisor.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.advisor.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.advisor.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.advisor.ui.AdvisorUiPlugin Bundle-Vendor: %pluginProvider Require-Bundle: org.eclipse.ui;bundle-version="[3.106.1,4.0.0)", diff --git a/plugins/org.teiid.designer.advisor.ui/cheatsheets/subsheets/join-two-sources.xml b/plugins/org.teiid.designer.advisor.ui/cheatsheets/subsheets/join-two-sources.xml index 3eb2701e56..6261fb38b7 100644 --- a/plugins/org.teiid.designer.advisor.ui/cheatsheets/subsheets/join-two-sources.xml +++ b/plugins/org.teiid.designer.advisor.ui/cheatsheets/subsheets/join-two-sources.xml @@ -38,7 +38,7 @@ + param1="org.teiid.designer.defineViewTable"/> diff --git a/plugins/org.teiid.designer.advisor.ui/pom.xml b/plugins/org.teiid.designer.advisor.ui/pom.xml index efcd15e5a3..8b9eb6a94f 100644 --- a/plugins/org.teiid.designer.advisor.ui/pom.xml +++ b/plugins/org.teiid.designer.advisor.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.advisor.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.advisor.ui/src/org/teiid/designer/advisor/ui/AdvisorUiConstants.java b/plugins/org.teiid.designer.advisor.ui/src/org/teiid/designer/advisor/ui/AdvisorUiConstants.java index 02c7f3504a..c1b12a37a9 100644 --- a/plugins/org.teiid.designer.advisor.ui/src/org/teiid/designer/advisor/ui/AdvisorUiConstants.java +++ b/plugins/org.teiid.designer.advisor.ui/src/org/teiid/designer/advisor/ui/AdvisorUiConstants.java @@ -154,7 +154,6 @@ interface COMMAND_IDS { String NEW_MODEL_MED = "org.teiid.designer.newModelMEDCommand"; //$NON-NLS-1$ String NEW_OBJECT_BASE_TABLE = "org.teiid.designer.newObjectBaseTable"; //$NON-NLS-1$ - String NEW_OBJECT_VIEW_TABLE = "org.teiid.designer.newObjectViewTable"; //$NON-NLS-1$ String DEFINE_VIEW_TABLE = "org.teiid.designer.defineViewTable"; //$NON-NLS-1$ String DEFINE_VIEW_PROCEDURE = "org.teiid.designer.defineViewProcedure"; //$NON-NLS-1$ String NEW_OBJECT_REST_PROCEDURE = "org.teiid.designer.newObjectRestProcedure"; //$NON-NLS-1$ diff --git a/plugins/org.teiid.designer.advisor.ui/src/org/teiid/designer/advisor/ui/actions/AdvisorActionFactory.java b/plugins/org.teiid.designer.advisor.ui/src/org/teiid/designer/advisor/ui/actions/AdvisorActionFactory.java index 19ead98d8d..c00aab8f0e 100644 --- a/plugins/org.teiid.designer.advisor.ui/src/org/teiid/designer/advisor/ui/actions/AdvisorActionFactory.java +++ b/plugins/org.teiid.designer.advisor.ui/src/org/teiid/designer/advisor/ui/actions/AdvisorActionFactory.java @@ -306,11 +306,6 @@ static void loadHandlers() { COMMAND_LABELS.DEFINE_TEIID_MODEL_PROJECT, COMMAND_LABELS_SHORT.DEFINE_TEIID_MODEL_PROJECT, COMMAND_DESC.DEFINE_TEIID_MODEL_PROJECT); - addActionHandler( - COMMAND_IDS.NEW_OBJECT_VIEW_TABLE, - COMMAND_LABELS.NEW_OBJECT_VIEW_TABLE, - COMMAND_LABELS_SHORT.NEW_OBJECT_VIEW_TABLE, - COMMAND_DESC.NEW_OBJECT_VIEW_TABLE); addActionHandler( COMMAND_IDS.DEFINE_VIEW_TABLE, COMMAND_LABELS.DEFINE_VIEW_TABLE, @@ -836,10 +831,6 @@ public static String getImageId(String id) { return Images.REFRESH_TEIID_SERVER; } - if( id.equalsIgnoreCase(COMMAND_IDS.NEW_OBJECT_VIEW_TABLE)) { - return Images.NEW_VIRTUAL_TABLE_ICON; - } - if( id.equalsIgnoreCase(COMMAND_IDS.DEFINE_VIEW_TABLE)) { return Images.NEW_VIRTUAL_TABLE_ICON; } diff --git a/plugins/org.teiid.designer.compare.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.compare.ui/META-INF/MANIFEST.MF index dd3a0fd428..d6c34a86e2 100644 --- a/plugins/org.teiid.designer.compare.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.compare.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.compare.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.compare.ui.UiPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.compare.ui/pom.xml b/plugins/org.teiid.designer.compare.ui/pom.xml index 0f53876652..ae66c6b099 100644 --- a/plugins/org.teiid.designer.compare.ui/pom.xml +++ b/plugins/org.teiid.designer.compare.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.compare.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.compare/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.compare/META-INF/MANIFEST.MF index e361b45178..1a529baea9 100644 --- a/plugins/org.teiid.designer.compare/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.compare/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.compare;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.compare.ModelerComparePlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.compare/pom.xml b/plugins/org.teiid.designer.compare/pom.xml index 9e2ec7b7fb..31584f3398 100644 --- a/plugins/org.teiid.designer.compare/pom.xml +++ b/plugins/org.teiid.designer.compare/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.compare - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.core.xslt/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.core.xslt/META-INF/MANIFEST.MF index 35ec62ccff..a0973b9949 100644 --- a/plugins/org.teiid.designer.core.xslt/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.core.xslt/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.core.xslt;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.core.xslt.CoreXsltPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.core.xslt/pom.xml b/plugins/org.teiid.designer.core.xslt/pom.xml index dbe01e55b4..a79cdbf753 100644 --- a/plugins/org.teiid.designer.core.xslt/pom.xml +++ b/plugins/org.teiid.designer.core.xslt/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.core.xslt - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.core/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.core/META-INF/MANIFEST.MF index 55da58d6bd..a28a7489d3 100644 --- a/plugins/org.teiid.designer.core/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.core;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.core.ModelerCore Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.core/pom.xml b/plugins/org.teiid.designer.core/pom.xml index 4b655db095..f8c016adcb 100644 --- a/plugins/org.teiid.designer.core/pom.xml +++ b/plugins/org.teiid.designer.core/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.core - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.core/src/org/teiid/designer/core/builder/ModelBuildUtil.java b/plugins/org.teiid.designer.core/src/org/teiid/designer/core/builder/ModelBuildUtil.java index c7a3e8ce61..63dce498e9 100644 --- a/plugins/org.teiid.designer.core/src/org/teiid/designer/core/builder/ModelBuildUtil.java +++ b/plugins/org.teiid.designer.core/src/org/teiid/designer/core/builder/ModelBuildUtil.java @@ -17,8 +17,6 @@ import java.util.List; import java.util.Map; import java.util.Set; - -import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; @@ -36,9 +34,11 @@ import org.teiid.core.designer.plugin.PluginUtilities; import org.teiid.core.designer.util.CoreArgCheck; import org.teiid.core.designer.util.Stopwatch; +import org.teiid.core.designer.util.StringConstants; import org.teiid.designer.core.ModelerCore; import org.teiid.designer.core.container.Container; import org.teiid.designer.core.container.DuplicateResourceException; +import org.teiid.designer.core.index.BlockIndexException; import org.teiid.designer.core.index.ModelIndexer; import org.teiid.designer.core.index.ModelSearchIndexer; import org.teiid.designer.core.index.ResourceIndexer; @@ -304,15 +304,55 @@ public static void indexResource( IProgressMonitor monitor, final String sTask = ModelerCore.Util.getString("ModelBuildUtil.Creating_{0}_for_{1}_1", indexer.getIndexType(), iResource.getFullPath()); //$NON-NLS-1$ //System.out.println("[ModelBuildUtil.indexResource TaskName is: " + sTask ); //$NON-NLS-1$ monitor.setTaskName(sTask); + + Throwable throwable = null; try { final Stopwatch totalWatch = new Stopwatch(); totalWatch.start(); indexer.indexResource(iResource, false, true); totalWatch.stop(); + } catch (final ModelerCoreException e) { + throwable = e.getCause() != null ? e.getCause() : e; } catch (final Throwable e) { - ModelerCore.Util.log(IStatus.ERROR, - e, - ModelerCore.Util.getString("ModelBuilder.Error_indexing_model_resource_3", iResource.getFullPath())); //$NON-NLS-1$ + throwable = e; + } + + if (throwable == null) + return; + + // + // Something went wrong so create a problem marker on the resource + // + + StringBuffer buf = new StringBuffer(ModelerCore.Util.getString("ModelBuilder.Error_indexing_model_resource_3", iResource.getName())); //$NON-NLS-1$ + buf.append(StringConstants.SPACE).append(StringConstants.COLON).append(StringConstants.NEW_LINE); + buf.append(throwable.getLocalizedMessage()); + + try { + IMarker[] markers = iResource.findMarkers(IMarker.PROBLEM, false, IResource.DEPTH_ONE); + if (markers != null) { + for (IMarker marker : markers) { + if (buf.toString().equals(marker.getAttribute(IMarker.MESSAGE))) + return; // A duplicate so already recorded + } + } + + IMarker marker = iResource.createMarker(IMarker.PROBLEM); + marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR); + marker.setAttribute(IMarker.MESSAGE, buf.toString()); + + String location = iResource.getLocation().toOSString(); + if (throwable instanceof BlockIndexException) { + BlockIndexException ex = (BlockIndexException) throwable; + location = ex.getWord(); + } + + marker.setAttribute(IMarker.LOCATION, location); + + ModelerCore.Util.log(IStatus.ERROR, throwable, buf.toString()); + + } catch (CoreException ex) { + ModelerCore.Util.log(IStatus.ERROR, ex, "Failed to create a problem marker on the resource"); //$NON-NLS-1$ } } diff --git a/plugins/org.teiid.designer.core/src/org/teiid/designer/core/extension/EmfModelObjectExtensionAssistant.java b/plugins/org.teiid.designer.core/src/org/teiid/designer/core/extension/EmfModelObjectExtensionAssistant.java index 09086616dd..5f393faf07 100644 --- a/plugins/org.teiid.designer.core/src/org/teiid/designer/core/extension/EmfModelObjectExtensionAssistant.java +++ b/plugins/org.teiid.designer.core/src/org/teiid/designer/core/extension/EmfModelObjectExtensionAssistant.java @@ -598,4 +598,10 @@ public boolean supportsMyNamespace( Object modelObject ) throws Exception { return ModelExtensionUtils.isSupportedNamespace(modelResource, getNamespacePrefix()); } + @Override + public boolean supportsProperty(Object modelObject, String propId) + throws Exception { + return getPropertyDefinition(modelObject, propId) != null; + } + } diff --git a/plugins/org.teiid.designer.datatools.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.datatools.ui/META-INF/MANIFEST.MF index 13ed3fe567..cfa54461b0 100644 --- a/plugins/org.teiid.designer.datatools.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.datatools.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.datatools.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.datatools.ui.DatatoolsUiPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.datatools.ui/pom.xml b/plugins/org.teiid.designer.datatools.ui/pom.xml index 87217a29e9..ee5085bc13 100644 --- a/plugins/org.teiid.designer.datatools.ui/pom.xml +++ b/plugins/org.teiid.designer.datatools.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.datatools.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.datatools/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.datatools/META-INF/MANIFEST.MF index 652c971e98..e9a1e8ca95 100644 --- a/plugins/org.teiid.designer.datatools/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.datatools/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.datatools;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.datatools.DatatoolsPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.datatools/pom.xml b/plugins/org.teiid.designer.datatools/pom.xml index bb98b80a2f..9f1638728b 100644 --- a/plugins/org.teiid.designer.datatools/pom.xml +++ b/plugins/org.teiid.designer.datatools/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.datatools - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.ddl.importer.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.ddl.importer.ui/META-INF/MANIFEST.MF index ea9bc66897..de509c425c 100644 --- a/plugins/org.teiid.designer.ddl.importer.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.ddl.importer.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.teiid.designer.ddl.importer.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.ddl.importer.ui.DdlImporterUiPlugin Bundle-Vendor: %Bundle-Vendor Require-Bundle: org.teiid.designer.ddl.importer;bundle-version="[9.0.2,10.0.0)", diff --git a/plugins/org.teiid.designer.ddl.importer.ui/pom.xml b/plugins/org.teiid.designer.ddl.importer.ui/pom.xml index 4dcdc9b6c4..051bdc9d62 100644 --- a/plugins/org.teiid.designer.ddl.importer.ui/pom.xml +++ b/plugins/org.teiid.designer.ddl.importer.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.ddl.importer.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.ddl.importer.ui/src/org/teiid/designer/ddl/importer/ui/DdlImportDifferencesPage.java b/plugins/org.teiid.designer.ddl.importer.ui/src/org/teiid/designer/ddl/importer/ui/DdlImportDifferencesPage.java index 0904578cfd..8fdd29d7af 100644 --- a/plugins/org.teiid.designer.ddl.importer.ui/src/org/teiid/designer/ddl/importer/ui/DdlImportDifferencesPage.java +++ b/plugins/org.teiid.designer.ddl.importer.ui/src/org/teiid/designer/ddl/importer/ui/DdlImportDifferencesPage.java @@ -378,7 +378,7 @@ class CheckboxTreeLabelProvider extends LabelProvider { private final Image PROCEDURE_IMG = UiPlugin.getDefault().getImage(UiConstants.Images.PROCEDURE_ICON); private final Image INDEX_IMG = UiPlugin.getDefault().getImage(UiConstants.Images.INDEX_ICON); private final Image VIEW_TABLE_IMG = UiPlugin.getDefault().getImage(UiConstants.Images.VIRTUAL_TABLE_ICON); - + private final Image VIRTUAL_PROCEDURE_IMG = UiPlugin.getDefault().getImage(UiConstants.Images.VIRTUAL_PROCEDURE_ICON); @Override public Image getImage( final Object node ) { @@ -397,6 +397,9 @@ public Image getImage( final Object node ) { } return VIEW_IMG; } else if(type==RelationalConstants.TYPES.PROCEDURE) { + if( importer.modelType() == ModelType.VIRTUAL_LITERAL) { + return VIRTUAL_PROCEDURE_IMG; + } return PROCEDURE_IMG; } else if(type==RelationalConstants.TYPES.INDEX) { return INDEX_IMG; diff --git a/plugins/org.teiid.designer.ddl.importer/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.ddl.importer/META-INF/MANIFEST.MF index 2d748658d3..5dd7a7c562 100644 --- a/plugins/org.teiid.designer.ddl.importer/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.ddl.importer/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.teiid.designer.ddl.importer;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.ddl.importer.DdlImporterPlugin Bundle-Vendor: %Bundle-Vendor Require-Bundle: org.teiid.designer.compare;bundle-version="[9.0.2,10.0.0)", diff --git a/plugins/org.teiid.designer.ddl.importer/pom.xml b/plugins/org.teiid.designer.ddl.importer/pom.xml index c7d8f6201d..58a243562b 100644 --- a/plugins/org.teiid.designer.ddl.importer/pom.xml +++ b/plugins/org.teiid.designer.ddl.importer/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.ddl.importer - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.ddl.importer/src/org/teiid/designer/ddl/importer/DdlImporter.java b/plugins/org.teiid.designer.ddl.importer/src/org/teiid/designer/ddl/importer/DdlImporter.java index 3e9b2e4173..d6663f9ccf 100644 --- a/plugins/org.teiid.designer.ddl.importer/src/org/teiid/designer/ddl/importer/DdlImporter.java +++ b/plugins/org.teiid.designer.ddl.importer/src/org/teiid/designer/ddl/importer/DdlImporter.java @@ -13,6 +13,7 @@ import java.util.Collection; import java.util.List; import java.util.Properties; + import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; @@ -22,6 +23,7 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.Path; import org.eclipse.emf.ecore.EObject; @@ -51,6 +53,7 @@ import org.teiid.designer.metamodels.relational.Procedure; import org.teiid.designer.metamodels.relational.RelationalPackage; import org.teiid.designer.metamodels.relational.View; +import org.teiid.designer.metamodels.relational.extension.RestModelExtensionAssistant; import org.teiid.designer.relational.compare.DifferenceGenerator; import org.teiid.designer.relational.compare.DifferenceReport; import org.teiid.designer.relational.model.RelationalModel; @@ -209,6 +212,7 @@ public void importDdl(String ddl, IProgressMonitor monitor, int totalWork, Prope importManager.setRelationalModel(model); RelationalModel targetRelationalModel = importManager.getObjectFactory().createRelationalModel(model); + targetRelationalModel.setModelType(importManager.getModelType().getValue()); importManager.setProgressMonitor(monitor); @@ -354,6 +358,13 @@ public void save(IProgressMonitor monitor, int totalWork ) throws Exception { modelAnnotation.setPrimaryMetamodelUri(RelationalPackage.eNS_URI); modelAnnotation.setModelType(importManager.getModelType()); } + + if( importManager.getModelType() == ModelType.VIRTUAL_LITERAL) { + RestModelExtensionAssistant.getRestAssistant().applyMedIfNecessary(model.getCorrespondingResource()); + } + model.save(new NullProgressMonitor(), true); + + // Let's save the model, then apply extension properties for relational and rest? // Update the model, based on difference report importStatus = EmfModelGenerator.INSTANCE.execute(diffReport, model, monitor, totalWork); diff --git a/plugins/org.teiid.designer.ddl.importer/src/org/teiid/designer/ddl/importer/TeiidDDLConstants.java b/plugins/org.teiid.designer.ddl.importer/src/org/teiid/designer/ddl/importer/TeiidDDLConstants.java index f23ab5d6f9..04ec098feb 100644 --- a/plugins/org.teiid.designer.ddl.importer/src/org/teiid/designer/ddl/importer/TeiidDDLConstants.java +++ b/plugins/org.teiid.designer.ddl.importer/src/org/teiid/designer/ddl/importer/TeiidDDLConstants.java @@ -68,5 +68,7 @@ public interface TeiidDDLConstants { public String DDL_IMPORT_FILTER_CONSTRAINTS = "ddlImport_filterConstraints"; //$NON-NLS-1$ public String DDL_IMPORT_TABLE_UPDATABLE_OVERRIDE = "ddlImport_table_updatable_override"; //$NON-NLS-1$ + public static final String RETURNS = "RETURNS"; //$NON-NLS-1$ + } diff --git a/plugins/org.teiid.designer.ddl.importer/src/org/teiid/designer/ddl/importer/node/EmfModelGenerator.java b/plugins/org.teiid.designer.ddl.importer/src/org/teiid/designer/ddl/importer/node/EmfModelGenerator.java index ea1f229209..d049507a5d 100644 --- a/plugins/org.teiid.designer.ddl.importer/src/org/teiid/designer/ddl/importer/node/EmfModelGenerator.java +++ b/plugins/org.teiid.designer.ddl.importer/src/org/teiid/designer/ddl/importer/node/EmfModelGenerator.java @@ -188,13 +188,15 @@ public IStatus execute(DifferenceReport diffReport, ModelResource targetModelRes createPrimaryKey(pk, table, targetModelResource); } } - if(!fkList.isEmpty()) { - for( DeferredPair item : fkList ) { - RelationalForeignKey fk = (RelationalForeignKey)item.getRelationalReference(); + + if(!ucList.isEmpty()) { + for( DeferredPair item : ucList ) { + RelationalUniqueConstraint uc = (RelationalUniqueConstraint)item.getRelationalReference(); BaseTable table = (BaseTable)item.getEObject(); - createForeignKey(fk, table, targetModelResource); + createUniqueConstraint(uc, table, targetModelResource); } } + if(!apList.isEmpty()) { for( DeferredPair item : apList ) { RelationalAccessPattern ap = (RelationalAccessPattern)item.getRelationalReference(); @@ -202,18 +204,21 @@ public IStatus execute(DifferenceReport diffReport, ModelResource targetModelRes createAccessPattern(ap, table, targetModelResource); } } - if(!ucList.isEmpty()) { - for( DeferredPair item : ucList ) { - RelationalUniqueConstraint uc = (RelationalUniqueConstraint)item.getRelationalReference(); - BaseTable table = (BaseTable)item.getEObject(); - createUniqueConstraint(uc, table, targetModelResource); - } - } + if(!indexList.isEmpty()) { for( RelationalIndex index : indexList ) { createIndex(index, targetModelResource); } } + + if(!fkList.isEmpty()) { + for( DeferredPair item : fkList ) { + RelationalForeignKey fk = (RelationalForeignKey)item.getRelationalReference(); + BaseTable table = (BaseTable)item.getEObject(); + createForeignKey(fk, table, targetModelResource); + } + } + progressMonitor.worked(workUnit); // 5) Process all 'deferred' operations - Extension properties and descriptions... @@ -293,7 +298,10 @@ public EObject createObject( RelationalReference relationalRef, ModelResource mo } break; case TYPES.TABLE: { if( relationalRef instanceof RelationalViewTable ) { - newEObject = VIEW_MODEL_FACTORY.buildObject(relationalRef, modelResource, new NullProgressMonitor()); +// newEObject = VIEW_MODEL_FACTORY.buildObject(relationalRef, modelResource, new NullProgressMonitor()); + newEObject = createBaseTable(relationalRef, modelResource); + modelResource.getEmfResource().getContents().add(newEObject); + VIEW_MODEL_FACTORY.addTransformation((BaseTable)newEObject, (RelationalViewTable)relationalRef); } else { newEObject = createBaseTable(relationalRef, modelResource); modelResource.getEmfResource().getContents().add(newEObject); @@ -304,12 +312,12 @@ public EObject createObject( RelationalReference relationalRef, ModelResource mo modelResource.getEmfResource().getContents().add(newEObject); } break; case TYPES.PROCEDURE: { - if (relationalRef instanceof RelationalViewProcedure) { - newEObject = VIEW_MODEL_FACTORY.buildObject(relationalRef, modelResource, new NullProgressMonitor()); - } else { - newEObject = createProcedure(relationalRef, modelResource); - modelResource.getEmfResource().getContents().add(newEObject); - } + if( relationalRef instanceof RelationalViewProcedure ) { + newEObject = VIEW_MODEL_FACTORY.buildObject(relationalRef, modelResource, new NullProgressMonitor()); + } else { + newEObject = createProcedure(relationalRef, modelResource); + modelResource.getEmfResource().getContents().add(newEObject); + } } break; case TYPES.INDEX: { @@ -806,7 +814,7 @@ public EObject createForeignKey( RelationalReference ref, BaseTable baseTable, M if( fkTable != null && ukRefName != null ) { if( fkTable.getPrimaryKey() != null && fkTable.getPrimaryKey().getName().equalsIgnoreCase(ukRefName)) { foreignKey.setUniqueKey(fkTable.getPrimaryKey()); - } else if( fkTable.getUniqueConstraints().isEmpty() ) { + } else if( ! fkTable.getUniqueConstraints().isEmpty() ) { for( Object key : fkTable.getUniqueConstraints()) { String keyName = this.getModelEditor().getName((UniqueKey)key); if( keyName.equalsIgnoreCase(ukRefName) ) { @@ -1211,7 +1219,9 @@ private void setPropertyValue(ModelObjectExtensionAssistant assistant, EObject e } try { - assistant.setPropertyValue(eObject, namespacedId, propValue); + if( assistant.supportsProperty(eObject, propId) ) { + assistant.setPropertyValue(eObject, namespacedId, propValue); + } } catch (Exception ex) { RelationalPlugin.Util.log(IStatus.ERROR,ex, NLS.bind(Messages.emfModelGenerator_errorSettingPropertyValue, namespacedId)); diff --git a/plugins/org.teiid.designer.ddl.importer/src/org/teiid/designer/ddl/importer/node/StandardImporter.java b/plugins/org.teiid.designer.ddl.importer/src/org/teiid/designer/ddl/importer/node/StandardImporter.java index 0ace2dffb6..11af1f845d 100644 --- a/plugins/org.teiid.designer.ddl.importer/src/org/teiid/designer/ddl/importer/node/StandardImporter.java +++ b/plugins/org.teiid.designer.ddl.importer/src/org/teiid/designer/ddl/importer/node/StandardImporter.java @@ -558,6 +558,37 @@ protected RelationalProcedure createProcedure( AstNode procedureNode, Relational return procedure; } + + /** + * Create a RelationalProcedure + * @param procedureNode the AstNode for the procedure + * @param model the RelationalModel + * @return the RelationalProcedure + * + * @throws Exception + */ + protected RelationalProcedure createViewProcedure( AstNode procedureNode, RelationalModel model) throws Exception { + RelationalProcedure procedure = getFactory().createViewProcedure(); + Info info = createInfo(procedureNode, model); + if (info.getSchema() == null) + model.addChild(procedure); + else { + info.getSchema().getProcedures().add(procedure); + procedure.setParent(info.getSchema()); + } + + initialize(procedure, procedureNode, info.getName()); + // TODO: determine how to handle Procedure StatementOption + // TODO: determine how to handle Procedure Statement + + if (procedureNode.getProperty(StandardDdlLexicon.DATATYPE_NAME) != null) { + RelationalProcedureResultSet result = getFactory().createProcedureResultSet(); + procedure.setResultSet(result); + initialize(result, procedureNode); + } + + return procedure; + } /** * Perform the import diff --git a/plugins/org.teiid.designer.ddl.importer/src/org/teiid/designer/ddl/importer/node/TeiidDdlImporter.java b/plugins/org.teiid.designer.ddl.importer/src/org/teiid/designer/ddl/importer/node/TeiidDdlImporter.java index ffc4df8f4b..71212888bf 100644 --- a/plugins/org.teiid.designer.ddl.importer/src/org/teiid/designer/ddl/importer/node/TeiidDdlImporter.java +++ b/plugins/org.teiid.designer.ddl.importer/src/org/teiid/designer/ddl/importer/node/TeiidDdlImporter.java @@ -38,6 +38,8 @@ import org.teiid.designer.extension.ExtensionPlugin; import org.teiid.designer.extension.definition.ModelExtensionDefinition; import org.teiid.designer.extension.registry.ModelExtensionRegistry; +import org.teiid.designer.metamodels.core.ModelType; +import org.teiid.designer.metamodels.relational.DirectionKind; import org.teiid.designer.relational.model.RelationalAccessPattern; import org.teiid.designer.relational.model.RelationalColumn; import org.teiid.designer.relational.model.RelationalForeignKey; @@ -71,13 +73,17 @@ public class TeiidDdlImporter extends StandardImporter { private static final String NS_TEIID_JPA = "teiid_jpa"; //$NON-NLS-1$ private static final String NS_DESIGNER_ODATA = "odata"; //$NON-NLS-1$ private static final String NS_DESIGNER_WEBSERVICE= "ws"; //$NON-NLS-1$ - private static final String NS_DESIGNER_MONGO = "mongo"; //$NON-NLS-1$ + private static final String NS_DESIGNER_MONGO = "mongodb"; //$NON-NLS-1$ private static final String NS_DESIGNER_SALESFORCE = "salesforce"; //$NON-NLS-1$ private static final String NS_DESIGNER_RELATIONAL = "relational"; //$NON-NLS-1$ private static final String NS_DESIGNER_ACCUMULO = "accumulo"; //$NON-NLS-1$ private static final String NS_DESIGNER_EXCEL = "excel"; //$NON-NLS-1$ private static final String NS_DESIGNER_JPA = "jpa2"; //$NON-NLS-1$ + private static final String REST_COLON_PREFIX= "REST:"; //$NON-NLS-1$ + private static final String REST_URI = "URI"; //$NON-NLS-1$ + private static final String REST_METHOD = "METHOD"; //$NON-NLS-1$ + private static final String REST_CHARSET = "CHARSET"; //$NON-NLS-1$ // Added to address TEIID-3629 private static final String SF_PROPNAME_CALCULATED_BAD = "calculated"; //$NON-NLS-1$ private static final String SF_PROPNAME_CALCULATED_GOOD = "Calculated"; //$NON-NLS-1$ @@ -194,124 +200,252 @@ protected String getTeiidDataTypeName(String datatype) throws Exception { private void createConstraint(AstNode constraintNode, RelationalTable table, RelationalModel model, Collection allRefs) throws CoreException { String type = constraintNode.getProperty(TeiidDdlLexicon.Constraint.TYPE).toString(); - boolean primaryKeyConstraint = false; - boolean uniqueConstraint = false; - boolean accessPatternConstraint = false; - boolean foreignKeyConstraint = false; - boolean indexConstraint = false; + RelationalReference key = null; if (DdlConstants.PRIMARY_KEY.equals(type)) { - key = getFactory().createPrimaryKey(); - initialize(key, constraintNode); - table.setPrimaryKey((RelationalPrimaryKey)key); - primaryKeyConstraint = true; + createPrimaryKey(constraintNode, table, allRefs); + key = table.getPrimaryKey(); } else if (DdlConstants.INDEX.equals(type)) { // TODO need to process teiidddl:expression property - key = getFactory().createIndex(); - initialize(key, constraintNode); - model.addChild(key); - indexConstraint = true; + key = createIndex(constraintNode, table, allRefs); } else if (DdlConstants.UNIQUE.equals(type)) { - key = getFactory().createUniqueConstraint(); - initialize(key, constraintNode); - table.getUniqueConstraints().add((RelationalUniqueConstraint)key); - uniqueConstraint = true; + key = createUniqueConstraint(constraintNode, table, allRefs); } else if (TeiidDdlConstants.TeiidNonReservedWord.ACCESSPATTERN.toDdl().equals(type)) { - key = getFactory().createAccessPattern(); - initialize(key, constraintNode); - table.getAccessPatterns().add((RelationalAccessPattern)key); - accessPatternConstraint = true; + key = createAccessPattern(constraintNode, table, allRefs); } else if (DdlConstants.FOREIGN_KEY.equals(type)) { - key = getFactory().createForeignKey(); - initializeFK(table.getForeignKeys(), (RelationalForeignKey)key, constraintNode); - table.getForeignKeys().add((RelationalForeignKey)key); - foreignKeyConstraint = true; + key = createForeignKey(constraintNode, table, allRefs); } else { assert false : "Unexpected constraint type of '" + type + "'"; //$NON-NLS-1$ //$NON-NLS-2$ } + + // Find all the Option properties + List optionNodes = new ArrayList(); + List children = constraintNode.getChildren(); + for(AstNode child: children) { + if(is(child, StandardDdlLexicon.TYPE_STATEMENT_OPTION)) { + optionNodes.add(child); + } + } + + // process the Column Options + if( ! optionNodes.isEmpty() ) { + processOptions(optionNodes,key); + } + } + + private boolean columnsMatch(List columns_1, Collection columns_2) { + if( columns_1 == null && columns_2 == null ) return true; + + if( columns_1 == null || columns_2 == null ) return false; + + // Neither can be NULL + if( columns_1.size() != columns_2.size() ) return false; + + // Size is the same + for( AstNode colOuter_1 : columns_1) { + boolean foundIt = false; + String columnName = colOuter_1.getName(); + for( RelationalColumn colInner_2 : columns_2) { + if( columnName.equals(colInner_2.getName()) ) { + foundIt = true; + } + } + + if( !foundIt ) return false; + } + + return true; + } + + @Override + protected void createPrimaryKey(AstNode node, RelationalTable table, Collection allRefs) throws CoreException { + RelationalPrimaryKey key = getFactory().createPrimaryKey(); + table.setPrimaryKey(key); + initialize(key, node); + // process referenced columns multi-valued property - Object temp = constraintNode.getProperty(TeiidDdlLexicon.Constraint.REFERENCES); - List references = (List)temp; + List references = (List)node.getProperty(TeiidDdlLexicon.Constraint.REFERENCES); + + for (AstNode ref : references) { + try { + RelationalColumn column = find(RelationalColumn.class, ref, table, allRefs); + key.getColumns().add(column); + } catch (EntityNotFoundException error) { + addProgressMessage(error.getMessage()); + } + } + } + + private RelationalReference createUniqueConstraint(AstNode constraintNode, RelationalTable table, Collection allRefs) throws CoreException { + RelationalUniqueConstraint constraint = getFactory().createUniqueConstraint(); + initialize(constraint, constraintNode); + table.addUniqueConstraint(constraint); + + // process referenced columns multi-valued property + List references = (List)constraintNode.getProperty(TeiidDdlLexicon.Constraint.REFERENCES); for (AstNode ref : references) { try { RelationalColumn col = find(RelationalColumn.class, ref, table, allRefs); if(col!=null) { - if (primaryKeyConstraint) { - ((RelationalPrimaryKey)key).getColumns().add(col); - } else if (uniqueConstraint) { - ((RelationalUniqueConstraint)key).getColumns().add(col); - } else if (accessPatternConstraint) { - ((RelationalAccessPattern)key).getColumns().add(col); - } else if (foreignKeyConstraint) { - ((RelationalForeignKey)key).getColumns().add(col); - } else if (indexConstraint) { - ((RelationalIndex)key).getColumns().add(col); - }else { - assert false : "Unexpected constraint type of '" + type + "'"; //$NON-NLS-1$ //$NON-NLS-2$ - } + constraint.getColumns().add(col); } } catch (EntityNotFoundException error) { addProgressMessage(error.getMessage()); } } + + return constraint; + } + + private RelationalReference createAccessPattern(AstNode constraintNode, RelationalTable table, Collection allRefs) throws CoreException { + RelationalAccessPattern constraint = getFactory().createAccessPattern(); + initialize(constraint, constraintNode); + table.addAccessPattern(constraint); + + // process referenced columns multi-valued property + List references = (List)constraintNode.getProperty(TeiidDdlLexicon.Constraint.REFERENCES); - // special processing for foreign key - if (foreignKeyConstraint) { - RelationalForeignKey foreignKey = (RelationalForeignKey)key; + for (AstNode ref : references) { + try { + RelationalColumn col = find(RelationalColumn.class, ref, table, allRefs); + if(col!=null) { + constraint.getColumns().add(col); + } + } catch (EntityNotFoundException error) { + addProgressMessage(error.getMessage()); + } + } + + return constraint; + } + + private RelationalReference createIndex(AstNode constraintNode, RelationalTable table, Collection allRefs) throws CoreException { + RelationalIndex constraint = getFactory().createIndex(); + initialize(constraint, constraintNode); + table.addIndex(constraint); + + // process referenced columns multi-valued property + List references = (List)constraintNode.getProperty(TeiidDdlLexicon.Constraint.REFERENCES); - AstNode tableRefNode = (AstNode)constraintNode.getProperty(TeiidDdlLexicon.Constraint.TABLE_REFERENCE); - if(tableRefNode==null) { - addProgressMessage(DdlImporterI18n.FK_TABLE_REF_NOT_FOUND_MSG+" '"+foreignKey.getName()+"'"); //$NON-NLS-1$ //$NON-NLS-2$ - return; + for (AstNode ref : references) { + try { + RelationalColumn col = find(RelationalColumn.class, ref, table, allRefs); + if(col!=null) { + constraint.getColumns().add(col); + } + } catch (EntityNotFoundException error) { + addProgressMessage(error.getMessage()); } + } + return constraint; + } + + private RelationalReference createForeignKey(AstNode constraintNode, RelationalTable table, Collection allRefs) throws CoreException { + RelationalForeignKey foreignKey = getFactory().createForeignKey(); + initializeFK(table.getForeignKeys(), foreignKey, constraintNode); + table.addForeignKey(foreignKey); + + // process referenced columns multi-valued property + List references = (List)constraintNode.getProperty(TeiidDdlLexicon.Constraint.REFERENCES); + + for (AstNode ref : references) { try { - RelationalTable tableRef = find(RelationalTable.class, tableRefNode, null, allRefs); - RelationalPrimaryKey tableRefPrimaryKey = tableRef.getPrimaryKey(); - Collection primaryKeyColumns = tableRef.getColumns(); - // check to see if foreign table columns are referenced - Object tempRefColumns = constraintNode.getProperty(TeiidDdlLexicon.Constraint.TABLE_REFERENCE_REFERENCES); - - List foreignTableColumnNodes = (tempRefColumns==null) ? Collections.emptyList() : (List)tempRefColumns; - int numPKColumns = primaryKeyColumns.size(); - int numFKColumns = foreignTableColumnNodes.size(); - - //TODO: Can we just set PK object on the FK, instead of the Names??? - if( foreignTableColumnNodes.isEmpty() ) { - if(tableRefPrimaryKey!=null) { - foreignKey.setUniqueKeyName(tableRefPrimaryKey.getName()); - foreignKey.setUniqueKeyTableName(tableRef.getName()); - } - } else if( numPKColumns == numFKColumns ) { - //TODO: not sure what this is doing - for(AstNode fTableColumn : foreignTableColumnNodes) { - find(RelationalColumn.class, fTableColumn, tableRef, allRefs); - } - foreignKey.setUniqueKeyName(tableRefPrimaryKey.getName()); - foreignKey.setUniqueKeyTableName(tableRef.getName()); - } else { - foreignKey.setUniqueKeyName(tableRefPrimaryKey.getName()); - foreignKey.setUniqueKeyTableName(tableRef.getName()); + RelationalColumn col = find(RelationalColumn.class, ref, table, allRefs); + if(col!=null) { + foreignKey.getColumns().add(col); } } catch (EntityNotFoundException error) { addProgressMessage(error.getMessage()); } } - // Find all the Option properties - List optionNodes = new ArrayList(); - List children = constraintNode.getChildren(); - for(AstNode child: children) { - if(is(child, StandardDdlLexicon.TYPE_STATEMENT_OPTION)) { - optionNodes.add(child); + AstNode tableRefNode = (AstNode)constraintNode.getProperty(TeiidDdlLexicon.Constraint.TABLE_REFERENCE); + if(tableRefNode==null) { + addProgressMessage(DdlImporterI18n.FK_TABLE_REF_NOT_FOUND_MSG + " '"+ foreignKey.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ + return foreignKey; + } + + try { + RelationalTable tableRef = find(RelationalTable.class, tableRefNode, null, allRefs); + + // Note that a REFERENCE table can have either a PK reference or a Unique Constraint reference. + // So get the RelationalReference object for each + + RelationalPrimaryKey tableRefPrimaryKey = tableRef.getPrimaryKey(); + RelationalUniqueConstraint tableRefUC = null; + if( ! tableRef.getUniqueConstraints().isEmpty() ) { + tableRefUC = tableRef.getUniqueConstraints().iterator().next(); + } + + // check to see if foreign table columns are referenced + Object tempRefColumns = constraintNode.getProperty(TeiidDdlLexicon.Constraint.TABLE_REFERENCE_REFERENCES); + + // Create list of AstNode's + List foreignTableColumnNodes = (tempRefColumns==null) ? Collections.emptyList() : (List)tempRefColumns; + + // Get number of columns that are referenced + int numFKTableReferenceColumns = foreignTableColumnNodes.size(); + if( numFKTableReferenceColumns == 0 ) { + if(tableRefPrimaryKey!=null) { + foreignKey.setUniqueKeyName(tableRefPrimaryKey.getName()); + foreignKey.setUniqueKeyTableName(tableRef.getName()); + } else if( tableRefUC != null ) { + foreignKey.setUniqueKeyName(tableRefUC.getName()); + foreignKey.setUniqueKeyTableName(tableRef.getName()); + } + // That's all we can do, there are no references + return foreignKey; } + + + int numPKColumns = 0; + if( tableRefPrimaryKey != null ) { + numPKColumns = tableRefPrimaryKey.getColumns().size(); + } + int numUCColumns = 0; + if( tableRefUC != null ) { + numUCColumns = tableRefUC.getColumns().size(); + } + boolean constraintWasPK = false; + + // there are referenced columns in FK. + // Check if #PK columns matches + if( numFKTableReferenceColumns == numPKColumns ) { + // Check PK to see if the columns are found and match + // Assumes UC and PK can't reference the same keys + + // Need to compare the foreignTableColumnNodes (AstNode's) against the PK column names + + boolean columnsMatch = columnsMatch(foreignTableColumnNodes, tableRefPrimaryKey.getColumns()); + if( columnsMatch ) { + foreignKey.setUniqueKeyName(tableRefPrimaryKey.getName()); + foreignKey.setUniqueKeyTableName(tableRef.getName()); + constraintWasPK = true; + } + } + if( ! constraintWasPK ) { + if( numUCColumns == numFKTableReferenceColumns ) { + // Check UC to see if the columns are found and match + // Assumes UC and PK can't reference the same keys + boolean columnsMatch = columnsMatch(foreignTableColumnNodes, tableRefUC.getColumns()); + if( columnsMatch ) { + foreignKey.setUniqueKeyName(tableRefUC.getName()); + foreignKey.setUniqueKeyTableName(tableRef.getName()); + } + } else { + foreignKey.setUniqueKeyName(tableRefPrimaryKey.getName()); + foreignKey.setUniqueKeyTableName(tableRef.getName()); + } + } + } catch (EntityNotFoundException error) { + addProgressMessage(error.getMessage()); } - // process the Column Options - processOptions(optionNodes,key); + return foreignKey; } @Override @@ -352,24 +486,24 @@ protected RelationalColumn createColumn(AstNode node, RelationalTable table) thr @Override protected void setDataType(AstNode node, RelationalColumn column) throws Exception { String datatype = node.getProperty(StandardDdlLexicon.DATATYPE_NAME).toString(); -// column.setNativeType(datatype); String teiidType = getTeiidDataTypeName(datatype); - column.setDatatype(teiidType); + if( teiidType.toUpperCase().equals(TYPES_UPPER.INTEGER)) { + column.setDatatype(TYPES_UPPER.INT.toLowerCase()); + } else { + column.setDatatype(teiidType); + } - // Datatype length + // Data type length Object prop = node.getProperty(StandardDdlLexicon.DATATYPE_LENGTH); if (prop != null) { column.setLength(Integer.parseInt(prop.toString())); } else { // Length is not provided for type 'string', use the default length specified in preferences... - //String dtName = ModelerCore.getWorkspaceDatatypeManager().getName(type); - if(teiidType != null) { - if( teiidType.equalsIgnoreCase(STRING_TYPENAME)) { - column.setLength(ModelerCore.getTransformationPreferences().getDefaultStringLength()); - } else if( teiidType.equalsIgnoreCase(CHAR_TYPENAME) ) { - column.setLength(1); - } + if( teiidType.equalsIgnoreCase(STRING_TYPENAME)) { + column.setLength(ModelerCore.getTransformationPreferences().getDefaultStringLength()); + } else if( teiidType.equalsIgnoreCase(CHAR_TYPENAME) ) { + column.setLength(1); } } @@ -434,6 +568,12 @@ protected RelationalProcedure createProcedure(AstNode procedureNode, RelationalM return procedure; } + /** + * @param procedureNode + * @param model + * @return procedure + * @throws Exception + */ protected RelationalProcedure createVirtualProcedure(AstNode procedureNode, RelationalModel model) throws Exception { RelationalViewProcedure procedure = getFactory().createViewProcedure(); Info info = createInfo(procedureNode, model); @@ -470,10 +610,10 @@ protected RelationalProcedure createVirtualProcedure(AstNode procedureNode, Rela } } } else if(is(child, TeiidDdlLexicon.CreateProcedure.RESULT_DATA_TYPE)) { - RelationalProcedureResultSet result = getFactory().createProcedureResultSet(); - procedure.setResultSet(result); - initialize(result, procedureNode); - createColumn(child,result); + // Add a parameter with RETURN direction + RelationalParameter param = createProcedureParameter(child, procedure); + param.setDirection(DirectionKind.RETURN_LITERAL.toString()); + param.setName(TeiidDDLConstants.RETURNS); } else if(is(child, StandardDdlLexicon.TYPE_STATEMENT_OPTION)) { procOptionNodes.add(child); } @@ -637,7 +777,7 @@ protected Map createObject(AstNode node, Relational // Statement Options } else if (is(child, StandardDdlLexicon.TYPE_STATEMENT_OPTION)) { optionNodes.add(child); - // Contraints + // Constraints } else if (is(child, TeiidDdlLexicon.Constraint.TABLE_ELEMENT) || is(child, TeiidDdlLexicon.Constraint.FOREIGN_KEY_CONSTRAINT) || is(child, TeiidDdlLexicon.Constraint.INDEX_CONSTRAINT)) { @@ -657,7 +797,7 @@ protected Map createObject(AstNode node, Relational || is(node, TeiidDdlLexicon.CreateProcedure.FUNCTION_STATEMENT)) { String modelType = (String)node.getProperty(TeiidDdlLexicon.SchemaElement.TYPE); if( modelType != null ) { - if( modelType.equalsIgnoreCase("VIRTUAL")) { + if( modelType.equalsIgnoreCase(ModelType.VIRTUAL_LITERAL.toString())) { createVirtualProcedure(node, model); } else { createProcedure(node, model); @@ -1089,7 +1229,23 @@ private void processTeiidExtensionOptions(List optionNodes, RelationalR } String optionValueStr = (String)optionValue; if(!CoreStringUtil.isEmpty(optionValueStr)) { - relationalEntity.addExtensionProperty(optionName, optionValueStr); + if( relationalEntity instanceof RelationalViewProcedure ) { + RelationalViewProcedure proc = (RelationalViewProcedure)relationalEntity; + // If REST property for Virtual Procedures.. process separately + if( optionName.startsWith(REST_COLON_PREFIX) ) { + if( optionName.toUpperCase().endsWith(REST_URI)) { + proc.setRestUri(optionValueStr); + } else if( optionName.toUpperCase().endsWith(REST_METHOD)) { + proc.setRestMethod(optionValueStr); + } else if( optionName.toUpperCase().endsWith(REST_CHARSET)) { + proc.setRestCharSet(optionValueStr); + } else { + relationalEntity.addExtensionProperty(optionName, optionValueStr); + } + } + } else { + relationalEntity.addExtensionProperty(optionName, optionValueStr); + } } } nodeIter.remove(); @@ -1106,9 +1262,10 @@ private void removeRedundantConstraints(RelationalModel model) { if( pk != null ) { Collection constraints = ((RelationalTable) child).getUniqueConstraints(); for( RelationalUniqueConstraint uc : constraints ) { - boolean same = true; + boolean same = false; if( pk.getColumns().size() == uc.getColumns().size() ) { // need to check all columns + same = true; for(RelationalColumn col : pk.getColumns()) { if( !uc.getColumns().contains(col) ) { same = false; diff --git a/plugins/org.teiid.designer.ddl.spi/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.ddl.spi/META-INF/MANIFEST.MF index 698136ed7a..60593946f6 100644 --- a/plugins/org.teiid.designer.ddl.spi/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.ddl.spi/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.ddl.spi;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %pluginProvider Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.ddl.spi/pom.xml b/plugins/org.teiid.designer.ddl.spi/pom.xml index 5faf6733f7..1ea2c15b8a 100644 --- a/plugins/org.teiid.designer.ddl.spi/pom.xml +++ b/plugins/org.teiid.designer.ddl.spi/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.ddl.spi - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.ddl/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.ddl/META-INF/MANIFEST.MF index 6801e32e6b..d84375cf74 100644 --- a/plugins/org.teiid.designer.ddl/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.ddl/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.ddl;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.ddl.DdlPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.ddl/pom.xml b/plugins/org.teiid.designer.ddl/pom.xml index 9d99e7a45a..27082a497a 100644 --- a/plugins/org.teiid.designer.ddl/pom.xml +++ b/plugins/org.teiid.designer.ddl/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.ddl - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.diagram.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.diagram.ui/META-INF/MANIFEST.MF index 2995700b78..97264baa61 100644 --- a/plugins/org.teiid.designer.diagram.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.diagram.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.diagram.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.diagram.ui.DiagramUiPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.diagram.ui/pom.xml b/plugins/org.teiid.designer.diagram.ui/pom.xml index f61f981882..323cddd004 100644 --- a/plugins/org.teiid.designer.diagram.ui/pom.xml +++ b/plugins/org.teiid.designer.diagram.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.diagram.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.dqp.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.dqp.ui/META-INF/MANIFEST.MF index f238bd7371..cbb6c8dc69 100644 --- a/plugins/org.teiid.designer.dqp.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.dqp.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.dqp.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.runtime.ui.DqpUiPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.dqp.ui/icons/full/ctool16/show-vdb-errors.png b/plugins/org.teiid.designer.dqp.ui/icons/full/ctool16/show-vdb-errors.png new file mode 100644 index 0000000000..5cbe699b90 Binary files /dev/null and b/plugins/org.teiid.designer.dqp.ui/icons/full/ctool16/show-vdb-errors.png differ diff --git a/plugins/org.teiid.designer.dqp.ui/pom.xml b/plugins/org.teiid.designer.dqp.ui/pom.xml index 957acdc043..fcce4319ef 100644 --- a/plugins/org.teiid.designer.dqp.ui/pom.xml +++ b/plugins/org.teiid.designer.dqp.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.dqp.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/DqpUiConstants.java b/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/DqpUiConstants.java index e12f772af5..68e3d19e8b 100644 --- a/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/DqpUiConstants.java +++ b/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/DqpUiConstants.java @@ -130,6 +130,7 @@ interface Images { public static final String DYNAMIC_VDB = PC.OBJ16 + "dynamic-vdb.png"; //$NON-NLS-1$ public static final String DDL_VDB = PC.OBJ16 + "ddl-vdb.png"; //$NON-NLS-1$ public static final String STANDARD_VDB = PC.OBJ16 + "standard-vdb.png"; //$NON-NLS-1$ + public static final String SHOW_VDB_ERRORS = PC.CTOOL16 + "show-vdb-errors.png"; //$NON-NLS-1$ } /** diff --git a/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/connection/CreateDataSourceWizard.java b/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/connection/CreateDataSourceWizard.java index 5f51e13285..6742167f11 100644 --- a/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/connection/CreateDataSourceWizard.java +++ b/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/connection/CreateDataSourceWizard.java @@ -20,7 +20,6 @@ import org.eclipse.jface.viewers.ITableLabelProvider; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; @@ -92,7 +91,6 @@ private static String getString( final String id, // private TeiidDataSource teiidDataSource; String dataSourceName; - private WizardPage wizardPage; Combo modelsCombo; Button useModelCheckBox; Combo connectionProfilesCombo; @@ -408,7 +406,7 @@ public void widgetSelected( final SelectionEvent event ) { } if (profileWorker.getProfiles().isEmpty() && !hasModelResources) { - wizardPage.setErrorMessage(getString("noConnectionDataError.message")); //$NON-NLS-1$ + setErrorMessage(getString("noConnectionDataError.message")); //$NON-NLS-1$ } else { setConnectionProperties(); } diff --git a/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/connection/VdbDataSourceInfo.java b/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/connection/VdbDataSourceInfo.java index 4d9b199da5..32366c6d26 100644 --- a/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/connection/VdbDataSourceInfo.java +++ b/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/connection/VdbDataSourceInfo.java @@ -141,7 +141,7 @@ public void setPassThroughAuthentication(boolean passThroughAuthentication) { public String getUrl() { StringBuilder sb = new StringBuilder(); sb.append(TEIID_JDBC_URL_PREFIX).append(this.vdbName); - String host = this.teiidServer.getTeiidJdbcInfo().getHostProvider().getHost(); + String host = this.teiidServer.getTeiidJdbcInfo().getHost(); String port = this.teiidServer.getTeiidJdbcInfo().getPort(); String protocol = this.teiidServer.getTeiidJdbcInfo().isSecure() ? SECURE_PROTOCOL : PROTOCOL; sb.append(protocol).append(COLON).append(DELIMITER).append(host).append(COLON).append(port); diff --git a/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/i18n.properties b/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/i18n.properties index e8afe42c71..d6cfd0aeb9 100644 --- a/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/i18n.properties +++ b/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/i18n.properties @@ -107,6 +107,10 @@ TeiidServerActionProvider.enablePreviewMenuItem=Enable Preview TeiidServerActionProvidererrorClearingPreviewVdbs = Error deleting preview VDBs on server : {0} TeiidServerActionProvider.errorClearingPreviewDataSources = Error deleting preview data sources on server : {0} TeiidServerActionProvider.clearPreviewArtifacts = Clear Preview Artifacts +TeiidServerActionProvider.problemShowingDeployedVdbErrors=Problems showing errors for deployed VDB {0} +TeiidServerActionProvider.showVdbErrorsAction=Show VDB Errors +TeiidServerActionProvider.deployedVdbHasErrorsTitle=VDB Errors +TeiidServerActionProvider.deployedVdbHasErrorsMessage=The deployed VDB "{0}" has the following errors ########## ParameterInputDialog ########## ClearPreviewArtifactsOptionsDialog.title=Clear Preview Artifact Options diff --git a/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/server/editor/TeiidServerEditor.java b/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/server/editor/TeiidServerEditor.java index 01065207ec..34be8fd967 100644 --- a/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/server/editor/TeiidServerEditor.java +++ b/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/server/editor/TeiidServerEditor.java @@ -21,8 +21,6 @@ import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jface.layout.GridLayoutFactory; import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; @@ -54,6 +52,7 @@ import org.eclipse.wst.server.ui.internal.command.ServerCommand; import org.eclipse.wst.server.ui.internal.editor.ServerEditorPartInput; import org.eclipse.wst.server.ui.internal.editor.ServerResourceCommandManager; +import org.jboss.ide.eclipse.as.core.server.internal.JBossServer; import org.teiid.core.designer.util.CoreStringUtil; import org.teiid.core.designer.util.StringUtilities; import org.teiid.designer.core.loading.ComponentLoadingManager; @@ -161,11 +160,18 @@ public void run() { switch (event.getEventType()) { case REFRESH: case UPDATE: - refreshDisplayValues(); + // Put the refesh on Swt thread + Runnable runnable = new Runnable() { + @Override + public void run() { + refreshDisplayValues(teiidServer.getTeiidAdminInfo().getPassword(), + teiidServer.getTeiidJdbcInfo().getPassword()); + } + }; + UiUtil.runInSwtThread(runnable, true); break; case REMOVE: disposeContents(); - manageLoad(new Properties()); break; case DEFAULT: case ADD: @@ -231,7 +237,7 @@ public void serverChanged(IServer server) { if (! parentServer.equals(server)) return; - refreshDisplayValues(); + refreshDisplayValues(teiidServer.getTeiidAdminInfo().getPassword(), teiidServer.getTeiidJdbcInfo().getPassword()); } }; @@ -292,17 +298,25 @@ public void run() { getServerManager().addListener(excutionConfigListener); + String adminPWD = null; + String jdbcPWD = null; + try { TeiidServerAdapterFactory adapterFactory = new TeiidServerAdapterFactory(); - if (parentServer.getServerState() == IServer.STATE_STARTED) + if (parentServer.getServerState() == IServer.STATE_STARTED) { // If server is started we can be more adventurous in what to display since we can ask // the server whether teiid has been installed. teiidServer = adapterFactory.adaptServer(parentServer, ServerOptions.ADD_TO_REGISTRY); - else { + adminPWD = teiidServer.getTeiidAdminInfo().getPassword(); + jdbcPWD = teiidServer.getTeiidJdbcInfo().getPassword(); + } else { // Cannot ask a lot except whether the server is a JBoss Server teiidServer = adapterFactory.adaptServer(parentServer, ServerOptions.NO_CHECK_CONNECTION, ServerOptions.ADD_TO_REGISTRY); + // password may still be a passToken only + adminPWD = teiidServer.getTeiidAdminInfo().getPassword(); + jdbcPWD = teiidServer.getTeiidJdbcInfo().getPassword(); } } catch (Exception ex) { ErrorHandler.toExceptionDialog(ex); @@ -320,6 +334,18 @@ public void run() { } form.reflow(true); + if( teiidServer != null ) { + final String aPWD = adminPWD; + final String jPWD = jdbcPWD; + // Put the refesh on Swt thread + Runnable runnable = new Runnable() { + @Override + public void run() { + refreshDisplayValues(aPWD, jPWD); + } + }; + UiUtil.runInSwtThread(runnable, true); + } } }; @@ -590,10 +616,12 @@ private void execute(ServerCommand command) { commandManager.execute(command); } - private void refreshDisplayValues() { + private void refreshDisplayValues(final String adminPWD, final String jdbcPWD) { if (teiidServer == null || form.isDisposed()) return; + if( hostNameLabel.isDisposed() ) return; + hostNameLabel.setText(teiidServer.getHost()); String versionValue = teiidServer.getServerVersion().toString(); if(! versionValueCombo.getText().equals(versionValue)){ @@ -605,14 +633,14 @@ private void refreshDisplayValues() { ITeiidAdminInfo teiidAdminInfo = teiidServer.getTeiidAdminInfo(); ITeiidJdbcInfo teiidJdbcInfo = teiidServer.getTeiidJdbcInfo(); - + if( isSevenServer() ) { if (adminUserNameText != null) { setIfDifferent(adminUserNameText, teiidAdminInfo.getUsername() != null ? teiidAdminInfo.getUsername() : EMPTY_STRING); } if (adminPasswdText != null) { - setIfDifferent(adminPasswdText, teiidAdminInfo.getPassword() != null ? teiidAdminInfo.getPassword() : EMPTY_STRING); + setIfDifferent(adminPasswdText, adminPWD != null ? adminPWD : EMPTY_STRING); } String portValue = teiidAdminInfo.getPort() != null ? teiidAdminInfo.getPort() : EMPTY_STRING; @@ -628,7 +656,7 @@ private void refreshDisplayValues() { } setIfDifferent(jdbcUserNameText, teiidJdbcInfo.getUsername() != null ? teiidJdbcInfo.getUsername() : EMPTY_STRING); - setIfDifferent(jdbcPasswdText, teiidJdbcInfo.getPassword() != null ? teiidJdbcInfo.getPassword() : EMPTY_STRING); + setIfDifferent(jdbcPasswdText, jdbcPWD != null ? jdbcPWD : EMPTY_STRING); if( isSevenServer() ) { String portValue = teiidJdbcInfo.getPort() != null ? teiidJdbcInfo.getPort() : EMPTY_STRING; @@ -729,19 +757,30 @@ public void doSave(IProgressMonitor monitor) { } // ========================================================================= - ITeiidServer newTeiidServer = teiidServerFactory.createTeiidServer( - newTeiidServerVersion, - getServerManager(), - teiidServer.getParent(), - teiidServer.getTeiidAdminInfo().getPort(), - adminUserNameText != null ? adminUserNameText.getText() : teiidServer.getTeiidAdminInfo().getUsername(), - adminPasswdText != null ? adminPasswdText.getText() : teiidServer.getTeiidAdminInfo().getPassword(), - finalJdbcPort, // <<<<<<<<< DETERMINED ABOVE - jdbcUserNameText.getText(), - jdbcPasswdText.getText(), - serverOptions.toArray(new ServerOptions[0])); - - teiidServer.update(newTeiidServer); + String adminUname = null; + String adminPwd = null; + if( isSevenServer() ) { + adminUname = adminUserNameText != null ? adminUserNameText.getText() : teiidServer.getTeiidAdminInfo().getUsername(); + adminPwd = adminPasswdText != null ? adminPasswdText.getText() : teiidServer.getTeiidAdminInfo().getPassword(); + } else { + JBossServer jb = (JBossServer) teiidServer.getParent().loadAdapter(JBossServer.class, null); + adminUname = jb.getUsername(); + adminPwd = jb.getPassword(); + } + + teiidServer.getTeiidAdminInfo().setAll( + teiidServer.getTeiidAdminInfo().getHost(), + teiidServer.getTeiidAdminInfo().getPort(), + adminUname, + adminPwd, + teiidServer.getTeiidAdminInfo().isSecure()); + + teiidServer.getTeiidJdbcInfo().setAll( + teiidServer.getTeiidAdminInfo().getHost(), + finalJdbcPort, + jdbcUserNameText.getText(), + jdbcPasswdText.getText(), + teiidServer.getTeiidAdminInfo().isSecure()); dirty = false; firePropertyChange(IEditorPart.PROP_DIRTY); diff --git a/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/views/TeiidServerActionProvider.java b/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/views/TeiidServerActionProvider.java index 77568e48e2..126094bf41 100644 --- a/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/views/TeiidServerActionProvider.java +++ b/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/views/TeiidServerActionProvider.java @@ -55,6 +55,7 @@ import org.teiid.designer.runtime.ui.views.content.DataSourcesFolder; import org.teiid.designer.ui.common.eventsupport.SelectionUtilities; import org.teiid.designer.ui.common.util.UiUtil; +import org.teiid.designer.ui.common.widget.ListMessageDialog; /** * @since 8.0 @@ -112,6 +113,8 @@ public class TeiidServerActionProvider extends CommonActionProvider { private IAction clearPreviewArtifactsAction; private Action createVdbDataSourceAction; + + private Action showVdbErrorsAction; private final TeiidServerPreviewOptionContributor previewOptionContributor; @@ -277,7 +280,7 @@ public void run() { this.executeVdbAction.setEnabled(true); // the shell used for dialogs that the actions display - Shell shell = this.actionSite.getViewSite().getShell(); + final Shell shell = this.actionSite.getViewSite().getShell(); // the reconnect action tries to ping a selected server this.refreshAction = new RefreshServerAction(); viewer.addSelectionChangedListener(this.refreshAction); @@ -396,6 +399,34 @@ public void run() { this.createVdbDataSourceAction.setToolTipText(getString("createDataSourceAction.tooltip")); //$NON-NLS-1$ this.createVdbDataSourceAction.setEnabled(true); + + this.showVdbErrorsAction = new Action(getString("showVdbErrorsAction")) { //$NON-NLS-1$ + @Override + public void run() { + List selectedObjs = getSelectedObjects(); + for (Object obj : selectedObjs) { + ITeiidVdb vdb = RuntimeAssistant.adapt(obj, ITeiidVdb.class); + ITeiidServer teiidServer = RuntimeAssistant.getServerFromSelection(selectionProvider.getSelection()); + + if (teiidServer != null && teiidServer.isConnected()) { + try { + List errors = vdb.getValidityErrors(); + ListMessageDialog.openError(shell, getString("deployedVdbHasErrorsTitle"), null, //$NON-NLS-1$ + getString("deployedVdbHasErrorsMessage", vdb.getName()), errors, null, true); //$NON-NLS-1$ + } catch (Exception e) { + DqpUiConstants.UTIL.log(IStatus.WARNING, + e, + getString("problemShowingDeployedVdbErrors", vdb.getName())); //$NON-NLS-1$ + } + } + } + + } + }; + + this.showVdbErrorsAction.setImageDescriptor(DqpUiPlugin.getDefault().getImageDescriptor(DqpUiConstants.Images.SHOW_VDB_ERRORS)); + this.showVdbErrorsAction.setEnabled(true); + // the edit action is only enabled when one server is selected this.setDefaultServerAction = new SetDefaultServerAction(); viewer.addSelectionChangedListener(this.setDefaultServerAction); @@ -502,6 +533,9 @@ public void fillContextMenu(IMenuManager manager) { this.executeVdbAction.setEnabled(teiidVdb.isActive()); manager.add(this.executeVdbAction); manager.add(this.createVdbDataSourceAction); + if( ! teiidVdb.getValidityErrors().isEmpty() ) { + manager.add(this.showVdbErrorsAction); + } manager.add(new Separator()); manager.add(this.undeployVdbAction); manager.add(new Separator()); diff --git a/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/wizards/webservices/util/WarArchiveUtil.java b/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/wizards/webservices/util/WarArchiveUtil.java index b0cefa4996..388285dd4d 100644 --- a/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/wizards/webservices/util/WarArchiveUtil.java +++ b/plugins/org.teiid.designer.dqp.ui/src/org/teiid/designer/runtime/ui/wizards/webservices/util/WarArchiveUtil.java @@ -293,7 +293,7 @@ public static String getRestMethod( Procedure procedure ) { .getModelExtensionAssistant(NAMESPACE_PROVIDER.getNamespacePrefix()); restMethod = assistant.getPropertyValue(procedure, RestModelExtensionConstants.PropertyIds.REST_METHOD); - if (CoreStringUtil.isEmpty(restMethod.trim())) { + if (restMethod != null && CoreStringUtil.isEmpty(restMethod.trim())) { // try old way restMethod = (String)ANNOTATION_HELPER.getPropertyValueAnyCase(procedure, ModelObjectAnnotationHelper.EXTENDED_PROPERTY_NAMESPACE diff --git a/plugins/org.teiid.designer.dqp/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.dqp/META-INF/MANIFEST.MF index e2904bdf89..cf1f81e725 100644 --- a/plugins/org.teiid.designer.dqp/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.dqp/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.dqp;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.runtime.DqpPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.dqp/pom.xml b/plugins/org.teiid.designer.dqp/pom.xml index 2e9b59f23f..01f62f84d1 100644 --- a/plugins/org.teiid.designer.dqp/pom.xml +++ b/plugins/org.teiid.designer.dqp/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.dqp - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidAdminInfo.java b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidAdminInfo.java index 24ae293d6d..52a79255a0 100644 --- a/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidAdminInfo.java +++ b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidAdminInfo.java @@ -1,6 +1,7 @@ package org.teiid.designer.runtime; import static org.teiid.designer.runtime.DqpPlugin.Util; + import org.teiid.datatools.connectivity.ConnectivityUtil; import org.teiid.datatools.connectivity.spi.ISecureStorageProvider; import org.teiid.designer.runtime.spi.ITeiidAdminInfo; @@ -21,12 +22,26 @@ public class TeiidAdminInfo extends TeiidConnectionInfo implements ITeiidAdminIn * @param secure true if a secure connection should be used * @see #validate() */ - public TeiidAdminInfo( String port, + public TeiidAdminInfo( String host, + String port, String username, ISecureStorageProvider secureStorageProvider, String password, boolean secure ) { - super(port, username, secureStorageProvider, password, secure); + super(host, port, username, secureStorageProvider, password, secure); + /* + * Password must be set last since it relies on getUrl() which is built from + * the other properties. + * + * When restoring from TeiidServerManager, the new TeiidConnectionInfo + * will have a pass token for newer models and password for older models + * so diverge at this point to ensure both situations are handled. + * + */ + + if( password != null ) { + setPassword(password); + } } @Override @@ -42,8 +57,7 @@ protected String getPasswordKey() { @SuppressWarnings( "javadoc" ) @Override public ITeiidAdminInfo clone() { - TeiidAdminInfo cloned = new TeiidAdminInfo(getPort(), getUsername(), getSecureStorageProvider(), getPassword(), isSecure()); - cloned.setHostProvider(getHostProvider()); + TeiidAdminInfo cloned = new TeiidAdminInfo(getHost(), getPort(), getUsername(), getSecureStorageProvider(), getPassword(), isSecure()); return cloned; } diff --git a/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidConnectionInfo.java b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidConnectionInfo.java index a8d240091f..0c0b80ad53 100644 --- a/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidConnectionInfo.java +++ b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidConnectionInfo.java @@ -9,15 +9,15 @@ import static org.teiid.designer.runtime.DqpPlugin.PLUGIN_ID; import static org.teiid.designer.runtime.DqpPlugin.Util; + import java.net.MalformedURLException; + import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.teiid.core.designer.HashCodeUtil; -import org.teiid.core.designer.util.CoreArgCheck; import org.teiid.core.designer.util.StringUtilities; import org.teiid.datatools.connectivity.ConnectivityUtil; import org.teiid.datatools.connectivity.spi.ISecureStorageProvider; -import org.teiid.designer.runtime.spi.HostProvider; import org.teiid.designer.runtime.spi.ITeiidConnectionInfo; /** @@ -29,7 +29,6 @@ public abstract class TeiidConnectionInfo implements ITeiidConnectionInfo { protected static final int DEFAULT_PORT_NUMBER = 0; - private HostProvider hostProvider; private ISecureStorageProvider secureStorageProvider; /* @@ -37,12 +36,20 @@ public abstract class TeiidConnectionInfo implements ITeiidConnectionInfo { * then provides a unique reference to the password in the secure storage */ private String passToken; + + private String passwordStorageKey; + + protected String url; + private String host; private String port; private int portNumber = DEFAULT_PORT_NUMBER; private boolean secure; private String username; + + boolean settingAllInfo = false; + /** * @param port the connection port (can be null or empty) * @param username the connection user name (can be null or empty) @@ -51,11 +58,13 @@ public abstract class TeiidConnectionInfo implements ITeiidConnectionInfo { * @param secure true if a secure connection should be used * @see #validate() */ - protected TeiidConnectionInfo( String port, + protected TeiidConnectionInfo( String host, + String port, String username, ISecureStorageProvider secureStorageProvider, String password, boolean secure) { + this.host = host; this.port = port; try { this.portNumber = Integer.parseInt(port); @@ -66,16 +75,6 @@ protected TeiidConnectionInfo( String port, this.secureStorageProvider = secureStorageProvider; this.secure = secure; - /* - * Password must be set last since it relies on getUrl() which is built from - * the other properties. - * - * When restoring from TeiidServerManager, the new TeiidConnectionInfo - * will have a pass token for newer models and password for older models - * so diverge at this point to ensure both situations are handled. - * - */ - initPassword(password); } /** @@ -91,10 +90,7 @@ protected void initPassword(String password) { if (password == null) return; - if (ConnectivityUtil.isPasswordToken(password)) - setPassToken(password); - else - setPassword(password); + setPassword(password); } /** @@ -126,8 +122,8 @@ public boolean equals( Object object ) { TeiidConnectionInfo thatInfo = (TeiidConnectionInfo) object; // host - String thisHost = getHostProvider().getHost(); - String thatHost = thatInfo.getHostProvider().getHost(); + String thisHost = getHost(); + String thatHost = thatInfo.getHost(); if (thisHost == null) { if (thatHost != null) { @@ -195,15 +191,6 @@ public boolean equals( Object object ) { return true; } - - @Override - public HostProvider getHostProvider() { - if (this.hostProvider == null) { - return HostProvider.DEFAULT_HOST_PROVIDER; - } - - return this.hostProvider; - } @Override public ISecureStorageProvider getSecureStorageProvider() { @@ -214,21 +201,21 @@ public ISecureStorageProvider getSecureStorageProvider() { * Get the key to be used for storing properties against for this connection. * * @return provider key used as reference to secure storage + * @throws Exception */ - private String getProviderKey() { - String key; - if (passToken == null) - key = ConnectivityUtil.buildSecureStorageKey(getClass(), getUrl()); - else - key = ConnectivityUtil.buildSecureStorageKey(getClass(), getUrl(), passToken); - - return key; + private void generateProviderKey() throws Exception { + if( this.passwordStorageKey == null ) { + if (passToken == null) { + throw new Exception("password token is NULL"); + } else { + this.passwordStorageKey = ConnectivityUtil.buildSecureStorageKey(getClass(), getUrl(), passToken); + } + } } private boolean passwordExists() { try { - String providerKey = getProviderKey(); - boolean exists = secureStorageProvider.existsInSecureStorage(providerKey, getPasswordKey()); + boolean exists = secureStorageProvider.existsInSecureStorage(this.passwordStorageKey, getPasswordKey()); return exists; } catch (Exception ex) { DqpPlugin.Util.log(ex); @@ -237,9 +224,10 @@ private boolean passwordExists() { } private String retrievePassword() { + if( this.passwordStorageKey == null ) return null; + try { - String providerKey = getProviderKey(); - return secureStorageProvider.getFromSecureStorage(providerKey, getPasswordKey()); + return secureStorageProvider.getFromSecureStorage(this.passwordStorageKey, getPasswordKey()); } catch (Exception ex) { DqpPlugin.Util.log(ex); return null; @@ -249,12 +237,59 @@ private String retrievePassword() { private void generatePasswordToken(String password) { try { this.passToken = ConnectivityUtil.generateHashToken(getUrl(), password); - String providerKey = getProviderKey(); - secureStorageProvider.storeInSecureStorage(providerKey, getPasswordKey(), password); } catch (Exception e) { DqpPlugin.Util.log(e); } } + + private void storePassword(String password) { + boolean restoring = false; + try { + if (passToken == null ) { + generateUrl(); + if( ConnectivityUtil.isPasswordToken(password)) { + passToken = password; + restoring = true; + } else { + generatePasswordToken(password); + } + generateProviderKey(); + } + if( !restoring && !passwordExists() ) { + secureStorageProvider.storeInSecureStorage(this.passwordStorageKey, getPasswordKey(), password); + } + } catch (Exception e) { + DqpPlugin.Util.log(e); + } finally { + restoring = false; + } + } + + private void resetPassword() { + if( settingAllInfo ) return; + + // If HOST or PORT changes, this method needs to be called to do the following + + // 1) get the current password from storage with current passwordStorageKey + String currentPassword = retrievePassword(); + + // 2) remove the node from storage + try { + if( this.passwordStorageKey != null ) { + // if passToken != null, need to remove old stored password so new one can be stored instead? + secureStorageProvider.removeFromSecureStorage(passwordStorageKey); + } + } catch (Exception e) { + DqpPlugin.Util.log(e); + } + + // 3) regenerate passToken + // 4) regenerate passwordStorageKey + // 5) restore password + if( currentPassword != null ) { + setPassword(currentPassword); + } + } /** * @return the password (can be null or empty) @@ -263,13 +298,16 @@ private void generatePasswordToken(String password) { public String getPassword() { String password = retrievePassword(); - if (passToken == null && password != null) { - // Password is pre-tokenisation algorithm so generate now and setup - generatePasswordToken(password); - } - return password; } + + /** + * @return the host (can be null or empty) + */ + @Override + public String getHost() { + return this.host; + } /** * @return the port (can be null or empty) @@ -293,20 +331,24 @@ public int getPortNumber() { */ @Override public abstract String getType(); - - /** - * @return the URL (never null) - */ - @Override - public String getUrl() { + + protected void generateUrl() { // mm://host:port StringBuilder sb = new StringBuilder(); sb.append(isSecure() ? MMS : MM); - sb.append(getHostProvider().getHost()); + sb.append(getHost()); sb.append(':'); sb.append(getPort()); - return sb.toString(); + this.url = sb.toString(); + } + + /** + * @return the URL (never null) + */ + @Override + public String getUrl() { + return this.url; } /** @@ -325,7 +367,7 @@ public String getUsername() { @Override public int hashCode() { return HashCodeUtil.hashCode(0, - getHostProvider().getHost(), + getHost(), getPort(), isSecure(), getUsername()); @@ -346,37 +388,33 @@ public boolean isSecure() { */ @Override public void setAll( ITeiidConnectionInfo info ) { - setHostProvider(info.getHostProvider()); + settingAllInfo = true; + setHost(info.getHost()); setPort(info.getPort()); setUsername(info.getUsername()); setSecure(info.isSecure()); - /* Do these last since the url is required for creation of the pass token */ - setPassToken(info.getPassToken()); + settingAllInfo = false; + setPassword(info.getPassword()); } - + /** - * @param hostProvider the new value for host provider (never null) - * @throws IllegalArgumentException if hostProvider is null + * The port, password, user name, persisting password, secure protocol, and host provider are set. + * + * @param info the connection properties whose values are being used to update state */ @Override - public void setHostProvider( HostProvider hostProvider ) { - CoreArgCheck.isNotNull(hostProvider, "hostProvider"); //$NON-NLS-1$ - - /* - * Before changing: - * Retrieve password from secure storage using old url if one has been set - */ - boolean passwordExists = passwordExists(); - String myPassword = null; - if (passwordExists) - myPassword = retrievePassword(); + public void setAll(String host, String port, String username, String password, boolean isSecure ) { + settingAllInfo = true; + setHost(host); + setPort(port); + setUsername(username); + setSecure(isSecure); - this.hostProvider = hostProvider; + settingAllInfo = false; - if (passwordExists) - setPassword(myPassword); + setPassword(password); } /** @@ -387,14 +425,6 @@ public String getPassToken() { return this.passToken; } - @Override - public void setPassToken(String passToken) { - /* - * Use the password token to fetch the password from - * secure storage. - */ - this.passToken = passToken; - } /** * Note. Password can be set to null and this will be stored as the value in secure storage @@ -403,11 +433,30 @@ public void setPassToken(String passToken) { */ @Override public void setPassword( String password ) { + if( settingAllInfo ) return; // setAll() will be setting host/port/username/isSecure. Don't want to setPassword it's complete + /* * Real password being passed into this method so generate a token * and use it to store the real password in secure storage */ - generatePasswordToken(password); + this.url = null; + this.passToken = null; + this.passwordStorageKey = null; + + if( password != null ) { + storePassword(password); + } + } + + /** + * @param port the new value for host (never empty or null) + * @see #validate() + */ + @Override + public void setHost( String host ) { + this.host = host; + + resetPassword(); } /** @@ -416,14 +465,6 @@ public void setPassword( String password ) { */ @Override public void setPort( String port ) { - /* - * Before changing: - * Retrieve password from secure storage using old url if one has been set - */ - boolean passwordExists = passwordExists(); - String myPassword = null; - if (passwordExists) - myPassword = retrievePassword(); this.port = port; try { @@ -432,8 +473,7 @@ public void setPort( String port ) { this.portNumber = DEFAULT_PORT_NUMBER; } - if (passwordExists) - setPassword(myPassword); + resetPassword(); } /** @@ -441,19 +481,10 @@ public void setPort( String port ) { */ @Override public void setSecure( boolean secure ) { - /* - * Before changing: - * Retrieve password from secure storage using old url if one has been set - */ - boolean passwordExists = passwordExists(); - String myPassword = null; - if (passwordExists) - myPassword = retrievePassword(); this.secure = secure; - if (passwordExists) - setPassword(myPassword); + resetPassword(); } /** @@ -474,7 +505,7 @@ public void setUsername( String username ) { public String toString() { return DqpPlugin.Util.getString("teiidConnectionInfoProperties", //$NON-NLS-1$ getType(), - getHostProvider().getHost(), + getHost(), getPort(), getUsername(), getPassword(), diff --git a/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidJdbcInfo.java b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidJdbcInfo.java index 6c372823ee..fe8ea8940b 100644 --- a/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidJdbcInfo.java +++ b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidJdbcInfo.java @@ -2,6 +2,7 @@ import static org.teiid.designer.runtime.DqpPlugin.PLUGIN_ID; import static org.teiid.designer.runtime.DqpPlugin.Util; + import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.teiid.core.designer.HashCodeUtil; @@ -34,12 +35,13 @@ public class TeiidJdbcInfo extends TeiidConnectionInfo implements ITeiidJdbcInfo * @param secure true if a secure connection should be used * @see #validate() */ - public TeiidJdbcInfo( String port, + public TeiidJdbcInfo( String host, + String port, String username, ISecureStorageProvider secureStorageProvider, String password, boolean secure ) { - this(VDB_PLACEHOLDER, port, username, secureStorageProvider, password, secure); + this(VDB_PLACEHOLDER, host, port, username, secureStorageProvider, password, secure); } /** @@ -52,12 +54,13 @@ public TeiidJdbcInfo( String port, * @see #validate() */ private TeiidJdbcInfo( String vdbname, + String host, String port, String username, ISecureStorageProvider secureStorageProvider, String password, boolean secure ) { - super(port, username, secureStorageProvider, password, secure); + super(host, port, username, secureStorageProvider, password, secure); CoreArgCheck.isNotEmpty(vdbname, "vdbname"); //$NON-NLS-1$ this.vdbname = vdbname; @@ -67,7 +70,10 @@ private TeiidJdbcInfo( String vdbname, * which is required in the formation of the passToken and the reference * to the password in secure storage */ - initPassword(password); + + if( password != null ) { + setPassword(password); + } } /** @@ -78,9 +84,8 @@ private TeiidJdbcInfo( String vdbname, */ public TeiidJdbcInfo( String vdbname, ITeiidJdbcInfo teiidJdbcInfo ) { - this(vdbname, teiidJdbcInfo.getPort(), teiidJdbcInfo.getUsername(), teiidJdbcInfo.getSecureStorageProvider(), + this(vdbname, teiidJdbcInfo.getHost(), teiidJdbcInfo.getPort(), teiidJdbcInfo.getUsername(), teiidJdbcInfo.getSecureStorageProvider(), teiidJdbcInfo.getPassword(), teiidJdbcInfo.isSecure()); - setHostProvider(teiidJdbcInfo.getHostProvider()); } @Override @@ -96,8 +101,7 @@ protected String getPasswordKey() { @SuppressWarnings( "javadoc" ) @Override public ITeiidJdbcInfo clone() { - TeiidJdbcInfo cloned = new TeiidJdbcInfo(getPort(), getUsername(), getSecureStorageProvider(), getPassword(), isSecure()); - cloned.setHostProvider(getHostProvider()); + TeiidJdbcInfo cloned = new TeiidJdbcInfo(getHost(), getPort(), getUsername(), getSecureStorageProvider(), getPassword(), isSecure()); return cloned; } @@ -124,21 +128,18 @@ public boolean equals( Object object ) { public String getType() { return Util.getString("jdbcInfoType"); //$NON-NLS-1$ } - - /** - * {@inheritDoc} - * - * @see org.teiid.designer.runtime.TeiidConnectionInfo#getUrl() - */ + @Override - public String getUrl() { + protected void generateUrl() { + super.generateUrl(); + String superURL = super.getUrl(); // jdbc:teiid:@mm://host:port StringBuilder sb = new StringBuilder(); sb.append(JDBC_TEIID_PREFIX); sb.append(this.vdbname); sb.append('@'); - return sb.append(super.getUrl()).toString(); + url = sb.append(superURL).toString(); } /** diff --git a/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidParentServerListener.java b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidParentServerListener.java index c266edaa53..90cbf7b2a9 100644 --- a/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidParentServerListener.java +++ b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidParentServerListener.java @@ -11,9 +11,11 @@ import org.eclipse.wst.server.core.IServerLifecycleListener; import org.eclipse.wst.server.core.IServerListener; import org.eclipse.wst.server.core.ServerEvent; +import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7Server; import org.jboss.ide.eclipse.as.management.core.JBoss7ManangerException; import org.teiid.core.designer.util.StringUtilities; import org.teiid.designer.runtime.TeiidServerFactory.ServerOptions; +import org.teiid.designer.runtime.adapter.JBoss7ServerUtil; import org.teiid.designer.runtime.adapter.TeiidServerAdapterFactory; import org.teiid.designer.runtime.spi.ITeiidServer; import org.teiid.designer.runtime.spi.ITeiidServerManager; @@ -80,8 +82,6 @@ public void serverChanged(IServer server) { for (ITeiidServer teiidServer : serverManager.getServers()) { if (! server.equals(teiidServer.getParent())) continue; - - ITeiidServer newTeiidServer = factory.adaptServer(server, ServerOptions.NO_CHECK_SERVER_REGISTRY, ServerOptions.NO_CHECK_CONNECTION); /* * Cannot use updateServer as it replaces rather than modifies the existing server @@ -93,12 +93,22 @@ public void serverChanged(IServer server) { * of the jboss parent server. Thus, version 7 should not try and change these * while version 8+ should. */ - if (teiidServer.getServerVersion().isGreaterThan(Version.TEIID_7_7)) { - teiidServer.getTeiidAdminInfo().setAll(newTeiidServer.getTeiidAdminInfo()); + + if (teiidServer.getServerVersion().isGreaterThan(Version.TEIID_7_7.get())) { + teiidServer.getTeiidAdminInfo().setAll( + teiidServer.getTeiidAdminInfo().getHost(), + teiidServer.getTeiidAdminInfo().getPort(), + teiidServer.getTeiidAdminInfo().getUsername(), + teiidServer.getTeiidAdminInfo().getPassword(), + teiidServer.getTeiidAdminInfo().isSecure()); } String portNumber = serverManager.getJdbcPort(teiidServer, true); if( StringUtilities.isEmpty(portNumber) ) { - teiidServer.getTeiidJdbcInfo().setPort(newTeiidServer.getTeiidJdbcInfo().getPort()); + JBoss7Server jb7 = (JBoss7Server) server.loadAdapter(JBoss7Server.class, null); + if (jb7 != null) { + portNumber = JBoss7ServerUtil.getJdbcPort(server, jb7); + teiidServer.getTeiidJdbcInfo().setPort(portNumber); + } } teiidServer.notifyRefresh(); diff --git a/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServer.java b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServer.java index 5028291f3b..3cfd448c4f 100644 --- a/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServer.java +++ b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServer.java @@ -29,7 +29,6 @@ import org.teiid.designer.runtime.registry.TeiidRuntimeRegistry; import org.teiid.designer.runtime.spi.EventManager; import org.teiid.designer.runtime.spi.ExecutionConfigurationEvent; -import org.teiid.designer.runtime.spi.HostProvider; import org.teiid.designer.runtime.spi.IExecutionAdmin; import org.teiid.designer.runtime.spi.ITeiidAdminInfo; import org.teiid.designer.runtime.spi.ITeiidDataSource; @@ -115,10 +114,31 @@ public class TeiidServer implements ITeiidServer { * @throws IllegalArgumentException if any of the parameters are null */ TeiidServer( ITeiidServerVersion serverVersion, + String host, ITeiidAdminInfo adminInfo, ITeiidJdbcInfo jdbcInfo, EventManager eventManager, IServer parentServer) { + this(serverVersion, host, adminInfo, jdbcInfo, eventManager, parentServer, false); + } + + /** + * Constructs on new Server. + * + * @param serverVersion the version of the server + * @param adminInfo the server admin connection properties (never null) + * @param jdbcInfo the server JDBC connection properties (never null) + * @param eventManager the event manager (never null) + * @param parentServer the parent {@link IServer} (never null) + * @throws IllegalArgumentException if any of the parameters are null + */ + TeiidServer( ITeiidServerVersion serverVersion, + String host, + ITeiidAdminInfo adminInfo, + ITeiidJdbcInfo jdbcInfo, + EventManager eventManager, + IServer parentServer, + boolean loadPasswords) { CoreArgCheck.isNotNull(serverVersion, "serverVersion"); //$NON-NLS-1$ CoreArgCheck.isNotNull(adminInfo, "adminInfo"); //$NON-NLS-1$ CoreArgCheck.isNotNull(jdbcInfo, "jdbcInfo"); //$NON-NLS-1$ @@ -129,7 +149,6 @@ public class TeiidServer implements ITeiidServer { this.serverVersion = serverVersion; this.eventManager = eventManager; this.parentServer = parentServer; - /* * All fields must be set prior to calling setHostProvider * on TeiidConnectionInfo sub-classes since this calls @@ -138,10 +157,10 @@ public class TeiidServer implements ITeiidServer { */ this.teiidAdminInfo = adminInfo; - this.teiidAdminInfo.setHostProvider(this); this.teiidJdbcInfo = jdbcInfo; - this.teiidJdbcInfo.setHostProvider(this); + + this.teiidJdbcInfo = jdbcInfo; this.id = getUrl() + "-" + getServerVersion() + "-" + getParent().getId(); //$NON-NLS-1$//$NON-NLS-2$ @@ -324,13 +343,7 @@ public String getCustomLabel() { @Override public String getHost() { - String host = this.parentServer.getHost(); - - if (host == null) { - host = HostProvider.DEFAULT_HOST; - } - - return host; + return this.teiidAdminInfo.getHost(); } @Override @@ -534,7 +547,7 @@ public IStatus testJDBCPing(String host, String port, String username, String pa } private String getVdbDataSourceConnectionUrl(String vdbName) { - String host = this.teiidJdbcInfo.getHostProvider().getHost(); + String host = this.teiidJdbcInfo.getHost(); String port = this.teiidJdbcInfo.getPort(); String protocol = this.teiidJdbcInfo.isSecure() ? "@mms" : "@mm"; //$NON-NLS-1$ //$NON-NLS-2$ return "jdbc:teiid:" + vdbName + protocol+"://"+host+":"+port; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ diff --git a/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServerFactory.java b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServerFactory.java index 38d04d5b43..733df70297 100644 --- a/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServerFactory.java +++ b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServerFactory.java @@ -10,8 +10,10 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; + import org.eclipse.wst.server.core.IServer; import org.teiid.designer.runtime.spi.ITeiidAdminInfo; +import org.teiid.designer.runtime.spi.ITeiidConnectionInfo; import org.teiid.designer.runtime.spi.ITeiidJdbcInfo; import org.teiid.designer.runtime.spi.ITeiidServer; import org.teiid.designer.runtime.spi.ITeiidServerManager; @@ -117,20 +119,36 @@ public ITeiidServer createTeiidServer(ITeiidServerVersion serverVersion, String jdbcUserName, String jdbcPassword, ServerOptions... options) { + /* + * In some cases we want to return a new Teiid Instance even if its in the registry + * Such Teiid Instances should be disposed of and not kept around. + */ + + String adminPWD = adminPassword; + String jdbcPWD = jdbcPassword; + + // Pre-set the host + String host = parentServer.getHost(); + + if (host == null) { + host = ITeiidConnectionInfo.DEFAULT_HOST; + } - ITeiidAdminInfo teiidAdminInfo = new TeiidAdminInfo(adminPort, + ITeiidAdminInfo teiidAdminInfo = new TeiidAdminInfo(host, + adminPort, adminUserName, serverManager.getSecureStorageProvider(), - adminPassword, + adminPWD, false); - ITeiidJdbcInfo teiidJdbcInfo = new TeiidJdbcInfo(jdbcPort, + ITeiidJdbcInfo teiidJdbcInfo = new TeiidJdbcInfo(host, + jdbcPort, jdbcUserName, serverManager.getSecureStorageProvider(), - jdbcPassword, + jdbcPWD, false); - ITeiidServer teiidServer = new TeiidServer(serverVersion, teiidAdminInfo, teiidJdbcInfo, serverManager, parentServer); + ITeiidServer teiidServer = new TeiidServer(serverVersion, host, teiidAdminInfo, teiidJdbcInfo, serverManager, parentServer, false); processOptions(teiidServer, serverManager, options); @@ -148,13 +166,14 @@ public ITeiidServer createTeiidServer(ITeiidServerVersion serverVersion, * @return instance of {@link ITeiidServer} */ public ITeiidServer createTeiidServer(ITeiidServerVersion serverVersion, + String host, ITeiidAdminInfo teiidAdminInfo, ITeiidJdbcInfo teiidJdbcInfo, TeiidServerManager serverManager, IServer parentServer, ServerOptions... options) { - ITeiidServer teiidServer = new TeiidServer(serverVersion, teiidAdminInfo, teiidJdbcInfo, serverManager, parentServer); + ITeiidServer teiidServer = new TeiidServer(serverVersion, host, teiidAdminInfo, teiidJdbcInfo, serverManager, parentServer); processOptions(teiidServer, serverManager, options); return teiidServer; diff --git a/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServerManager.java b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServerManager.java index 763a92674e..096ae2cd4c 100644 --- a/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServerManager.java +++ b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServerManager.java @@ -11,7 +11,6 @@ import static org.teiid.designer.runtime.DqpPlugin.Util; import java.io.File; -import java.io.FileOutputStream; import java.util.Collection; import java.util.Collections; import java.util.HashSet; @@ -20,14 +19,7 @@ import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerFactoryConfigurationError; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IProgressMonitor; @@ -44,9 +36,7 @@ import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; import org.eclipse.wst.server.core.IServer; -import org.teiid.core.designer.util.Base64; import org.teiid.core.designer.util.CoreArgCheck; -import org.teiid.core.designer.util.StringUtilities; import org.teiid.datatools.connectivity.ConnectivityUtil; import org.teiid.datatools.connectivity.spi.ISecureStorageProvider; import org.teiid.designer.core.util.KeyInValueHashMap; @@ -57,26 +47,18 @@ import org.teiid.designer.runtime.preview.PreviewManager; import org.teiid.designer.runtime.spi.ExecutionConfigurationEvent; import org.teiid.designer.runtime.spi.IExecutionConfigurationListener; -import org.teiid.designer.runtime.spi.ITeiidAdminInfo; -import org.teiid.designer.runtime.spi.ITeiidJdbcInfo; import org.teiid.designer.runtime.spi.ITeiidServer; import org.teiid.designer.runtime.spi.ITeiidServerManager; import org.teiid.designer.runtime.spi.ITeiidServerVersionListener; import org.teiid.designer.runtime.version.spi.ITeiidServerVersion; import org.teiid.designer.runtime.version.spi.TeiidServerVersion; -import org.teiid.designer.runtime.version.spi.TeiidServerVersion.Version; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; /** * The ServerManager class manages the creation, deletion, and editing of servers hosting Teiid Instances. * * @since 8.0 */ -public final class TeiidServerManager implements ITeiidServerManager { +public final class TeiidServerManager implements ITeiidServerManager, TeiidServerRegistryConstants { // =========================================================================================================================== // Constants @@ -87,103 +69,6 @@ public final class TeiidServerManager implements ITeiidServerManager { */ private static final String DESIGNER_UI_PLUGIN_ID = "org.teiid.designer.ui"; //$NON-NLS-1$ - /** - * The attribute used to persist a server's custom label. May not exist if server is not using a custom label. - */ - private static final String CUSTOM_LABEL_ATTR = "customLabel"; //$NON-NLS-1$ - - /** - * The attribute indicating if the server is currently the preview server. - */ - private static final String DEFAULT_ATTR = "default"; //$NON-NLS-1$ - - /** - * The attribute used to persist a server's login password. - */ - private static final String PASSWORD_ATTR = "password"; //$NON-NLS-1$ - - /** - * The file name used when persisting the server registry. - */ - private static final String REGISTRY_FILE = "serverRegistry.xml"; //$NON-NLS-1$ - - /** - * The tag used when persisting a server. - */ - private static final String SERVER_TAG = "server"; //$NON-NLS-1$ - - /** - * The server collection tag used when persisting the server registry. - */ - private static final String SERVERS_TAG = "servers"; //$NON-NLS-1$ - - /** - * The tag used when persisting admin connection info. - */ - private static final String ADMIN_TAG = "admin"; //$NON-NLS-1$ - - /** - * The tag used when persisting jdbc connection info. - */ - private static final String JDBC_TAG = "jdbc"; //$NON-NLS-1$ - - /** - * The attribute used to persist a server's login user. - */ - private static final String USER_ATTR = "user"; //$NON-NLS-1$ - - /** - * The attribute used to persist a server's host value. - */ - private static final String HOST_ATTR = "host"; //$NON-NLS-1$ - - private static final String PARENT_SERVER_ID = "parentServerId"; //$NON-NLS-1$ - - /** - * The attribute used to persist a server's version value. - */ - private static final String SERVER_VERSION = "version"; //$NON-NLS-1$ - - /** - * The attribute used to persist a server's port value. - */ - private static final String PORT_ATTR = "port"; //$NON-NLS-1$ - - /** - * The attribute used to persist a server's secure value. - */ - private static final String SECURE_ATTR = "secure"; //$NON-NLS-1$ - - /** - * The attribute used to persist a server's jdbc host value. - */ - private static final String JDBC_HOST_ATTR = "jdbchost"; //$NON-NLS-1$ - - /** - * The attribute used to persist a server's jdbc port value. - */ - private static final String JDBC_PORT_ATTR = "jdbcport"; //$NON-NLS-1$ - - /** - * The attribute used to persist a server's login user. - */ - private static final String JDBC_USER_ATTR = "jdbcuser"; //$NON-NLS-1$ - - /** - * The attribute used to persist a server's login password. - */ - private static final String JDBC_PASSWORD_ATTR = "jdbcpassword"; //$NON-NLS-1$ - - /** - * The attribute used to persist a server's secure value. - */ - private static final String JDBC_SECURE_ATTR = "jdbcsecure"; //$NON-NLS-1$ - - /** - * The attribute used to persist a server's jdbc port override value. - */ - private static final String JDBC_PORT_OVERRIDE_ATTR = "jdbcportoverride"; //$NON-NLS-1$ - private class TeiidServerKeyValueAdapter implements KeyFromValueAdapter { @Override @@ -242,7 +127,7 @@ public String getKey(ITeiidServer value) { */ private ISecureStorageProvider secureStorageProvider; - public TeiidJdbcPortManager jdbcPortManager = new TeiidJdbcPortManager();; + public TeiidJdbcPortManager jdbcPortManager = new TeiidJdbcPortManager(); /** * Flag indicating whether other open editors should be closed when the default server @@ -433,7 +318,7 @@ public boolean isStarted() { /** * @return the name of the state file that the server registry is persisted to or null */ - private String getStateFileName() { + public final String getStateFileName() { String name = this.stateLocationPath; if (this.stateLocationPath != null) { @@ -619,25 +504,6 @@ public void notifyListeners( ExecutionConfigurationEvent event ) { } } - private IServer findParentServer(String host, String parentServerId, ITeiidAdminInfo teiidAdminInfo) throws OrphanedTeiidServerException { - IServer[] servers = parentServersProvider.getServers(); - for (IServer server : servers) { - if (! host.equals(server.getHost())) - continue; - - if (parentServerId != null && ! server.getId().equals(parentServerId)) { - // Double checks against the parent server id only if a parent server id was - // save. In the case of the old registry format, this was not possible so host - // comparison is sufficient - continue; - } - - return server; - } - - throw new OrphanedTeiidServerException(teiidAdminInfo); - } - /** * Initialise those managers and listeners under the control of the server manager * that may well rely on it. @@ -668,166 +534,25 @@ private void restoreStateInternal() { return; } - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder docBuilder = factory.newDocumentBuilder(); - Document doc = docBuilder.parse(new File(getStateFileName())); - Node root = doc.getDocumentElement(); - NodeList servers = root.getChildNodes(); - - for (int size = servers.getLength(), i = 0; i < size; ++i) { - ITeiidAdminInfo teiidAdminInfo = null; - ITeiidJdbcInfo teiidJdbcInfo = null; - String jdbcOverridePort = null; - Node serverNode = servers.item(i); - - // server attributes (host, custom label, default teiid instance) - NamedNodeMap serverAttributeMap = serverNode.getAttributes(); - - if (serverAttributeMap == null) { - continue; - } - - String host = null; - String parentServerId = null; - String customLabel = null; - boolean previewServer = false; - - // version attribute - ITeiidServerVersion teiidServerVersion = Version.TEIID_DEFAULT.get(); - Node versionNode = serverAttributeMap.getNamedItem(SERVER_VERSION); - if (versionNode != null) teiidServerVersion = new TeiidServerVersion(versionNode.getNodeValue()); + // NOTE ================================================= + // FOR DEBUGGING PURPOSES.. set boolean to TRUE below to print out the server attributes and properties + // to the console as they are loaded + + TeiidServerRegistryReader reader = + new TeiidServerRegistryReader( this, parentServersProvider, this.secureStorageProvider, false); - // host attribute - Node hostNode = serverAttributeMap.getNamedItem(HOST_ATTR); - - if (hostNode != null) { - host = hostNode.getNodeValue(); - } - - Node parentServerNode = serverAttributeMap.getNamedItem(PARENT_SERVER_ID); - - if (parentServerNode != null) { - parentServerId = parentServerNode.getNodeValue(); - } - - // custom label attribute - Node customLabelNode = serverAttributeMap.getNamedItem(CUSTOM_LABEL_ATTR); - - if (customLabelNode != null) { - customLabel = customLabelNode.getNodeValue(); - } - - // default teiid instance attribute - Node defaultServerNode = serverAttributeMap.getNamedItem(DEFAULT_ATTR); - - if (defaultServerNode != null) { - previewServer = Boolean.parseBoolean(defaultServerNode.getNodeValue()); - } - - // Check for newer XML structure where server contains child nodes (admin & jdbc elements) - NodeList connectionNodes = serverNode.getChildNodes(); - - if (connectionNodes.getLength() > 0) { - for (int connSize = connectionNodes.getLength(), j = 0; j < connSize; ++j) { - Node connNode = connectionNodes.item(j); - if (connNode.getNodeType() != Node.TEXT_NODE) { - if (connNode.getNodeName().equalsIgnoreCase(ADMIN_TAG)) { - NamedNodeMap attributeMap = connNode.getAttributes(); - if (attributeMap == null) continue; - - // if host is null than an older registry xml file is being used - if (host == null) { - Node adminHostNode = attributeMap.getNamedItem(HOST_ATTR); - assert (adminHostNode != null); - host = adminHostNode.getNodeValue(); - } - - // port must be non-null/not empty to be valid server - Node adminPortNode = attributeMap.getNamedItem(PORT_ATTR); // should always have one - assert (adminPortNode != null); - String adminPort = adminPortNode.getNodeValue(); - - // username must be non-null/not empty to be valid server - Node userNode = attributeMap.getNamedItem(USER_ATTR); // should always have one - assert (userNode != null); - String adminUsername = userNode.getNodeValue(); - Node passwordNode = attributeMap.getNamedItem(PASSWORD_ATTR); - String adminPassword = ((passwordNode == null) ? null : new String( - Base64.decode(passwordNode.getNodeValue()), - "UTF-8")); //$NON-NLS-1$ - Node adminSecureNode = attributeMap.getNamedItem(SECURE_ATTR); - String adminSecureStr = ((adminSecureNode == null) ? Boolean.FALSE.toString() : adminSecureNode.getNodeValue()); - - teiidAdminInfo = new TeiidAdminInfo(adminPort, adminUsername, secureStorageProvider, - adminPassword, Boolean.parseBoolean(adminSecureStr)); - } else if (connNode.getNodeName().equalsIgnoreCase(JDBC_TAG)) { - NamedNodeMap attributeMap = connNode.getAttributes(); - if (attributeMap == null) continue; - - // if host is null than an older registry xml file is being used - if (host == null) { - Node jdbcHostNode = attributeMap.getNamedItem(JDBC_HOST_ATTR); - assert (jdbcHostNode != null); - host = jdbcHostNode.getNodeValue(); - } - - // port must be non-null/not empty to be valid server - Node jdbcPortNode = attributeMap.getNamedItem(JDBC_PORT_ATTR); - assert (jdbcPortNode != null); - String jdbcPort = jdbcPortNode.getNodeValue(); - - // port override must be non-null/not empty to be valid server - Node jdbcPortOverrideNode = attributeMap.getNamedItem(JDBC_PORT_OVERRIDE_ATTR); - if( jdbcPortOverrideNode != null ) { - jdbcOverridePort = jdbcPortOverrideNode.getNodeValue(); - - } - - - // username must be non-null/not empty to be valid server - Node jdbcUserNode = attributeMap.getNamedItem(JDBC_USER_ATTR); - assert (jdbcUserNode != null); - String jdbcUsername = jdbcUserNode.getNodeValue(); - - Node jdbcPasswordNode = attributeMap.getNamedItem(JDBC_PASSWORD_ATTR); - String jdbcPassword = ((jdbcPasswordNode == null) ? null : new String( - Base64.decode(jdbcPasswordNode.getNodeValue()), - "UTF-8")); //$NON-NLS-1$ - Node jdbcSecureNode = attributeMap.getNamedItem(JDBC_SECURE_ATTR); - String jdbcSecureStr = ((jdbcSecureNode == null) ? Boolean.FALSE.toString() : jdbcSecureNode.getNodeValue()); - teiidJdbcInfo = new TeiidJdbcInfo(jdbcPort, jdbcUsername, secureStorageProvider, jdbcPassword, - Boolean.parseBoolean(jdbcSecureStr)); - } - } - } - } - - // add server to registry - IServer parentServer = null; - try { - parentServer = findParentServer(host, parentServerId, teiidAdminInfo); - } catch (OrphanedTeiidServerException ex) { - // Cannot add the Teiid Instance since it has no parent - continue; - } - - TeiidServerFactory teiidServerFactory = new TeiidServerFactory(); - ITeiidServer teiidServer = teiidServerFactory.createTeiidServer(teiidServerVersion, - teiidAdminInfo, - teiidJdbcInfo, - this, - parentServer); - teiidServer.setCustomLabel(customLabel); - - addServerInternal(teiidServer, true); - if( !StringUtilities.isEmpty(jdbcOverridePort) ) { - this.jdbcPortManager.setPort(teiidServer, Integer.parseInt(jdbcOverridePort), true); - } - - if (previewServer) { - defaultServer = teiidServer; - } + Collection loadedServers = reader.restoreServers(); + for( ITeiidServer server: loadedServers ) { + addServerInternal(server, true); } + + ITeiidServer loadedDefaultServer = reader.getDefaultServer(); + if( loadedDefaultServer != null ) { + defaultServer = loadedDefaultServer; + } else if( !loadedServers.isEmpty() ) { + defaultServer = loadedServers.iterator().next(); + } + } catch (Exception e) { Util.log(e); } finally { @@ -920,6 +645,10 @@ public void setJdbcPort(ITeiidServer server, int port, boolean isOverride) { public String getJdbcPort(ITeiidServer server, boolean isOverride) { return jdbcPortManager.getPort(server, isOverride); } + + public final TeiidJdbcPortManager getJdbcPortManager() { + return jdbcPortManager; + } /** * Close editors associated with modelling projects @@ -1001,101 +730,14 @@ private void saveState() throws TransformerFactoryConfigurationError { return; } - - try { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder docBuilder = factory.newDocumentBuilder(); - Document doc = docBuilder.newDocument(); - - // create root element - Element root = doc.createElement(SERVERS_TAG); - doc.appendChild(root); - - Collection servers = teiidServers.values(); - for (ITeiidServer teiidServer : servers) { - Element serverElement = doc.createElement(SERVER_TAG); - root.appendChild(serverElement); - - { // Server Version - serverElement.setAttribute(SERVER_VERSION, teiidServer.getServerVersion().toString()); - } - - { // Host - serverElement.setAttribute(HOST_ATTR, teiidServer.getHost()); - } - - { // Parent Server Id - serverElement.setAttribute(PARENT_SERVER_ID, teiidServer.getParent().getId()); - } - - { // CUSTOM LABEL - if (!StringUtilities.isEmpty(teiidServer.getCustomLabel())) { - serverElement.setAttribute(CUSTOM_LABEL_ATTR, teiidServer.getCustomLabel()); - } - } - - { // ADMIN CONNECTION INFO - Element adminElement = doc.createElement(ADMIN_TAG); - serverElement.appendChild(adminElement); - - adminElement.setAttribute(PORT_ATTR, teiidServer.getTeiidAdminInfo().getPort()); - adminElement.setAttribute(USER_ATTR, teiidServer.getTeiidAdminInfo().getUsername()); - - /* The token of the password is saved to file while the password is saved in the eclipse secure storage - * Saving the token ensures that its possible to find the password again. - */ - String passToken = teiidServer.getTeiidAdminInfo().getPassToken(); - if (passToken != null) - adminElement.setAttribute(PASSWORD_ATTR, Base64.encodeBytes(passToken.getBytes("UTF-8"))); //$NON-NLS-1$ - - adminElement.setAttribute(SECURE_ATTR, Boolean.toString(teiidServer.getTeiidAdminInfo().isSecure())); - } - - { // JDBC CONNECTION INFO - Element jdbcElement = doc.createElement(JDBC_TAG); - serverElement.appendChild(jdbcElement); - - // Check if actual port is cached, else set to default - String actualPort = jdbcPortManager.getPort(teiidServer, false); - if( actualPort == null ) { - actualPort = ITeiidJdbcInfo.DEFAULT_PORT; - } - jdbcElement.setAttribute(JDBC_PORT_ATTR, actualPort); - - // check for port override - String overridePort = jdbcPortManager.getPort(teiidServer, true); - if( overridePort != null ) { - jdbcElement.setAttribute(JDBC_PORT_OVERRIDE_ATTR, overridePort); - } - jdbcElement.setAttribute(JDBC_USER_ATTR, teiidServer.getTeiidJdbcInfo().getUsername()); - - /* The token of the password is saved to file while the password is saved in the eclipse secure storage - * Saving the token ensures that its possible to find the password again. - */ - String passToken = teiidServer.getTeiidJdbcInfo().getPassToken(); - if (passToken != null) - jdbcElement.setAttribute(JDBC_PASSWORD_ATTR, Base64.encodeBytes(passToken.getBytes("UTF-8"))); //$NON-NLS-1$ - - jdbcElement.setAttribute(JDBC_SECURE_ATTR, Boolean.toString(teiidServer.getTeiidJdbcInfo().isSecure())); - } - - if ((defaultServer != null) && (defaultServer.equals(teiidServer))) { - serverElement.setAttribute(DEFAULT_ATTR, Boolean.toString(true)); - } - } - - DOMSource source = new DOMSource(doc); - StreamResult resultXML = new StreamResult(new FileOutputStream(getStateFileName())); - TransformerFactory transFactory = TransformerFactory.newInstance(); - Transformer transformer = transFactory.newTransformer(); - transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$ - transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); //$NON-NLS-1$ //$NON-NLS-2$ - transformer.transform(source, resultXML); - } catch (Exception e) { - IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, - Util.getString("errorSavingServerRegistry", getStateFileName())); //$NON-NLS-1$ - Util.log(status); - } + + // NOTE ================================================= + // FOR DEBUGGING PURPOSES.. set boolean to TRUE below to print out the server attributes and properties + // to the console as they are written out + + TeiidServerRegistryWriter writer = new TeiidServerRegistryWriter( this, defaultServer, false); + + writer.storeServers(teiidServers.values()); } /** diff --git a/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServerRegistryConstants.java b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServerRegistryConstants.java new file mode 100644 index 0000000000..19de162fb9 --- /dev/null +++ b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServerRegistryConstants.java @@ -0,0 +1,100 @@ +package org.teiid.designer.runtime; + +public interface TeiidServerRegistryConstants { + /** + * The attribute used to persist a server's custom label. May not exist if server is not using a custom label. + */ + String CUSTOM_LABEL_ATTR = "customLabel"; //$NON-NLS-1$ + + /** + * The attribute indicating if the server is currently the preview server. + */ + String DEFAULT_ATTR = "default"; //$NON-NLS-1$ + + /** + * The attribute used to persist a server's login password. + */ + String PASSWORD_ATTR = "password"; //$NON-NLS-1$ + + /** + * The file name used when persisting the server registry. + */ + String REGISTRY_FILE = "serverRegistry.xml"; //$NON-NLS-1$ + + /** + * The tag used when persisting a server. + */ + String SERVER_TAG = "server"; //$NON-NLS-1$ + + /** + * The server collection tag used when persisting the server registry. + */ + String SERVERS_TAG = "servers"; //$NON-NLS-1$ + + /** + * The tag used when persisting admin connection info. + */ + String ADMIN_TAG = "admin"; //$NON-NLS-1$ + + /** + * The tag used when persisting jdbc connection info. + */ + String JDBC_TAG = "jdbc"; //$NON-NLS-1$ + + /** + * The attribute used to persist a server's login user. + */ + String USER_ATTR = "user"; //$NON-NLS-1$ + + /** + * The attribute used to persist a server's host value. + */ + String HOST_ATTR = "host"; //$NON-NLS-1$ + + String PARENT_SERVER_ID = "parentServerId"; //$NON-NLS-1$ + + /** + * The attribute used to persist a server's version value. + */ + String SERVER_VERSION = "version"; //$NON-NLS-1$ + + /** + * The attribute used to persist a server's port value. + */ + String PORT_ATTR = "port"; //$NON-NLS-1$ + + /** + * The attribute used to persist a server's secure value. + */ + String SECURE_ATTR = "secure"; //$NON-NLS-1$ + + /** + * The attribute used to persist a server's jdbc host value. + */ + String JDBC_HOST_ATTR = "jdbchost"; //$NON-NLS-1$ + + /** + * The attribute used to persist a server's jdbc port value. + */ + String JDBC_PORT_ATTR = "jdbcport"; //$NON-NLS-1$ + + /** + * The attribute used to persist a server's login user. + */ + String JDBC_USER_ATTR = "jdbcuser"; //$NON-NLS-1$ + + /** + * The attribute used to persist a server's login password. + */ + String JDBC_PASSWORD_ATTR = "jdbcpassword"; //$NON-NLS-1$ + + /** + * The attribute used to persist a server's secure value. + */ + String JDBC_SECURE_ATTR = "jdbcsecure"; //$NON-NLS-1$ + + /** + * The attribute used to persist a server's jdbc port override value. + */ + String JDBC_PORT_OVERRIDE_ATTR = "jdbcportoverride"; //$NON-NLS-1$ +} diff --git a/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServerRegistryReader.java b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServerRegistryReader.java new file mode 100644 index 0000000000..9d7dd701d6 --- /dev/null +++ b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServerRegistryReader.java @@ -0,0 +1,300 @@ +package org.teiid.designer.runtime; + +import java.io.File; +import java.util.Collection; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.eclipse.wst.server.core.IServer; +import org.teiid.core.designer.util.Base64; +import org.teiid.core.designer.util.StringUtilities; +import org.teiid.datatools.connectivity.spi.ISecureStorageProvider; +import org.teiid.designer.core.util.KeyInValueHashMap; +import org.teiid.designer.core.util.KeyInValueHashMap.KeyFromValueAdapter; +import org.teiid.designer.runtime.spi.ITeiidAdminInfo; +import org.teiid.designer.runtime.spi.ITeiidJdbcInfo; +import org.teiid.designer.runtime.spi.ITeiidServer; +import org.teiid.designer.runtime.version.spi.ITeiidServerVersion; +import org.teiid.designer.runtime.version.spi.TeiidServerVersion; +import org.teiid.designer.runtime.version.spi.TeiidServerVersion.Version; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +public class TeiidServerRegistryReader implements TeiidServerRegistryConstants { + + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder docBuilder; + Document doc; + Element root; + + ITeiidServer defaultServer; + + TeiidServerManager teiidServerManager; + // secure storage provider needs to get passed in because getSecureStorageProvider() does a state check and when restoreServers() is called + // The state will not be STARTED + ISecureStorageProvider secureStorageProvider; + + boolean doDebug; + + /** + * The provider used for accessing the collection of available {@link IServer}s + * rather than relying on {@link parentServersProvider} directly, which makes unit testing difficult + */ + private IServersProvider parentServersProvider; + + private final KeyInValueHashMap teiidServers; + + + + private class TeiidServerKeyValueAdapter implements KeyFromValueAdapter { + + @Override + public String getKey(ITeiidServer value) { + return value.getId(); + } + } + + + public TeiidServerRegistryReader( + TeiidServerManager teiidServerManager, + IServersProvider parentServersProvider, + ISecureStorageProvider secureStorageProvider, + boolean doDebug) { + this.teiidServerManager = teiidServerManager; + this.parentServersProvider = parentServersProvider; + this.secureStorageProvider = secureStorageProvider; + this.doDebug = doDebug; + + this.teiidServers = new KeyInValueHashMap(new TeiidServerKeyValueAdapter()); + } + + public Collection restoreServers() throws Exception { + factory = DocumentBuilderFactory.newInstance(); + docBuilder = factory.newDocumentBuilder(); + doc = docBuilder.parse(new File(teiidServerManager.getStateFileName())); + Node root = doc.getDocumentElement(); + NodeList servers = root.getChildNodes(); + + for (int size = servers.getLength(), i = 0; i < size; ++i) { + Node serverNode = servers.item(i); + + ITeiidServer teiidServer = loadServer(serverNode); + if( teiidServer != null ) { + teiidServers.add(teiidServer); + } + } + + return teiidServers.values(); + } + + private ITeiidServer loadServer(Node serverNode) throws Exception { + ITeiidAdminInfo teiidAdminInfo = null; + ITeiidJdbcInfo teiidJdbcInfo = null; + String jdbcOverridePort = null; + // server attributes (host, custom label, default teiid instance) + NamedNodeMap serverAttributeMap = serverNode.getAttributes(); + + if (serverAttributeMap == null) { + return null; + } + + String host = null; + String parentServerId = null; + String customLabel = null; + boolean previewServer = false; + + if( doDebug ) System.out.println( " <<< LOADING SERVER INFO"); + + // version attribute + ITeiidServerVersion teiidServerVersion = Version.TEIID_DEFAULT.get(); + Node versionNode = serverAttributeMap.getNamedItem(SERVER_VERSION); + if (versionNode != null) teiidServerVersion = new TeiidServerVersion(versionNode.getNodeValue()); + attributeRead(SERVER_VERSION, teiidServerVersion.toString()); + + // host attribute + Node hostNode = serverAttributeMap.getNamedItem(HOST_ATTR); + + if (hostNode != null) { + host = hostNode.getNodeValue(); + attributeRead(HOST_ATTR, host); + } + + + Node parentServerNode = serverAttributeMap.getNamedItem(PARENT_SERVER_ID); + + if (parentServerNode != null) { + parentServerId = parentServerNode.getNodeValue(); + attributeRead(PARENT_SERVER_ID, parentServerId); + } + + // custom label attribute + Node customLabelNode = serverAttributeMap.getNamedItem(CUSTOM_LABEL_ATTR); + + if (customLabelNode != null) { + customLabel = customLabelNode.getNodeValue(); + attributeRead(CUSTOM_LABEL_ATTR, customLabel); + } + // default teiid instance attribute + Node defaultServerNode = serverAttributeMap.getNamedItem(DEFAULT_ATTR); + + if (defaultServerNode != null) { + previewServer = Boolean.parseBoolean(defaultServerNode.getNodeValue()); + attributeRead(DEFAULT_ATTR, defaultServerNode.getNodeValue()); + } + + // Check for newer XML structure where server contains child nodes (admin & jdbc elements) + NodeList connectionNodes = serverNode.getChildNodes(); + + if (connectionNodes.getLength() > 0) { + for (int connSize = connectionNodes.getLength(), j = 0; j < connSize; ++j) { + Node connNode = connectionNodes.item(j); + if (connNode.getNodeType() != Node.TEXT_NODE) { + if (connNode.getNodeName().equalsIgnoreCase(ADMIN_TAG)) { + if( doDebug ) System.out.println(" <<< ADMIN INFO"); + NamedNodeMap attributeMap = connNode.getAttributes(); + if (attributeMap == null) continue; + + // if host is null than an older registry xml file is being used + if (host == null) { + Node adminHostNode = attributeMap.getNamedItem(HOST_ATTR); + assert (adminHostNode != null); + host = adminHostNode.getNodeValue(); + attributeRead(HOST_ATTR, host); + } + + // port must be non-null/not empty to be valid server + Node adminPortNode = attributeMap.getNamedItem(PORT_ATTR); // should always have one + assert (adminPortNode != null); + String adminPort = adminPortNode.getNodeValue(); + attributeRead(PORT_ATTR, adminPort); + + // username must be non-null/not empty to be valid server + Node userNode = attributeMap.getNamedItem(USER_ATTR); // should always have one + assert (userNode != null); + String adminUsername = userNode.getNodeValue(); + attributeRead(USER_ATTR, adminUsername); + + Node passwordNode = attributeMap.getNamedItem(PASSWORD_ATTR); + String adminPassword = null; + if( passwordNode != null ) { + adminPassword = new String( Base64.decode(passwordNode.getNodeValue()), "UTF-8"); //$NON-NLS-1$ + attributeRead(PASSWORD_ATTR, adminPassword); + } + + Node adminSecureNode = attributeMap.getNamedItem(SECURE_ATTR); + String adminSecureStr = ((adminSecureNode == null) ? Boolean.FALSE.toString() : adminSecureNode.getNodeValue()); + attributeRead(SECURE_ATTR, adminSecureStr); + + teiidAdminInfo = new TeiidAdminInfo(host, adminPort, adminUsername, secureStorageProvider, + adminPassword, Boolean.parseBoolean(adminSecureStr)); + } else if (connNode.getNodeName().equalsIgnoreCase(JDBC_TAG)) { + if( doDebug ) System.out.println(" <<< JDBC INFO"); + NamedNodeMap attributeMap = connNode.getAttributes(); + if (attributeMap == null) continue; + + // if host is null than an older registry xml file is being used + if (host == null) { + Node jdbcHostNode = attributeMap.getNamedItem(JDBC_HOST_ATTR); + assert (jdbcHostNode != null); + host = jdbcHostNode.getNodeValue(); + attributeRead(JDBC_HOST_ATTR, host); + } + + // port must be non-null/not empty to be valid server + Node jdbcPortNode = attributeMap.getNamedItem(JDBC_PORT_ATTR); + assert (jdbcPortNode != null); + String jdbcPort = jdbcPortNode.getNodeValue(); + + // port override must be non-null/not empty to be valid server + Node jdbcPortOverrideNode = attributeMap.getNamedItem(JDBC_PORT_OVERRIDE_ATTR); + if( jdbcPortOverrideNode != null ) { + jdbcOverridePort = jdbcPortOverrideNode.getNodeValue(); + attributeRead(JDBC_PORT_OVERRIDE_ATTR, jdbcOverridePort); + } + + + // username must be non-null/not empty to be valid server + Node jdbcUserNode = attributeMap.getNamedItem(JDBC_USER_ATTR); + assert (jdbcUserNode != null); + String jdbcUsername = jdbcUserNode.getNodeValue(); + attributeRead(JDBC_USER_ATTR, jdbcUsername); + + Node jdbcPasswordNode = attributeMap.getNamedItem(JDBC_PASSWORD_ATTR); + String jdbcPassword = null; + if( jdbcPasswordNode != null ) { + jdbcPassword = new String( Base64.decode(jdbcPasswordNode.getNodeValue()), "UTF-8"); //$NON-NLS-1$ + attributeRead(JDBC_PASSWORD_ATTR, jdbcPassword); + } + + Node jdbcSecureNode = attributeMap.getNamedItem(JDBC_SECURE_ATTR); + String jdbcSecureStr = ((jdbcSecureNode == null) ? Boolean.FALSE.toString() : jdbcSecureNode.getNodeValue()); + attributeRead(JDBC_SECURE_ATTR, jdbcSecureStr); + teiidJdbcInfo = new TeiidJdbcInfo(host, jdbcPort, jdbcUsername, secureStorageProvider, jdbcPassword, + Boolean.parseBoolean(jdbcSecureStr)); + } + } + } + } + + // add server to registry + IServer parentServer = null; + try { + parentServer = findParentServer(host, parentServerId, teiidAdminInfo); + } catch (OrphanedTeiidServerException ex) { + // Cannot add the Teiid Instance since it has no parent + return null; + } + + TeiidServerFactory teiidServerFactory = new TeiidServerFactory(); + ITeiidServer teiidServer = teiidServerFactory.createTeiidServer(teiidServerVersion, + host, + teiidAdminInfo, + teiidJdbcInfo, + teiidServerManager, + parentServer); + teiidServer.setCustomLabel(customLabel); + + if( !StringUtilities.isEmpty(jdbcOverridePort) ) { + teiidServerManager.getJdbcPortManager().setPort(teiidServer, Integer.parseInt(jdbcOverridePort), true); + } + + if (previewServer) { + defaultServer = teiidServer; + } + + return teiidServer; + } + + + private IServer findParentServer(String host, String parentServerId, ITeiidAdminInfo teiidAdminInfo) throws OrphanedTeiidServerException { + IServer[] servers = parentServersProvider.getServers(); + for (IServer server : servers) { + if (! host.equals(server.getHost())) + continue; + + if (parentServerId != null && ! server.getId().equals(parentServerId)) { + // Double checks against the parent server id only if a parent server id was + // save. In the case of the old registry format, this was not possible so host + // comparison is sufficient + continue; + } + + return server; + } + + throw new OrphanedTeiidServerException(teiidAdminInfo); + } + + private void attributeRead(String key, String value) { + if( doDebug) System.out.println(" Read Server Attribute = " + key + " value = " + value); + } + + public ITeiidServer getDefaultServer() { + return defaultServer; + } + +} diff --git a/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServerRegistryWriter.java b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServerRegistryWriter.java new file mode 100644 index 0000000000..8499109b82 --- /dev/null +++ b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/TeiidServerRegistryWriter.java @@ -0,0 +1,170 @@ +package org.teiid.designer.runtime; + +import static org.teiid.designer.runtime.DqpPlugin.PLUGIN_ID; +import static org.teiid.designer.runtime.DqpPlugin.Util; + +import java.io.FileOutputStream; +import java.util.Collection; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.TransformerFactoryConfigurationError; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.teiid.core.designer.util.Base64; +import org.teiid.core.designer.util.StringUtilities; +import org.teiid.designer.runtime.spi.ITeiidJdbcInfo; +import org.teiid.designer.runtime.spi.ITeiidServer; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +public class TeiidServerRegistryWriter implements TeiidServerRegistryConstants { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder docBuilder; + Document doc; + Element root; + + TeiidServerManager teiidServerManager; + + // Default server needs to get passed in because getDefaultServer() does a state check and when storeServers() is called + // The state will not be STARTED + ITeiidServer defaultServer; + + boolean doDebug; + + public TeiidServerRegistryWriter( + TeiidServerManager teiidServerManager, + ITeiidServer defaultServer, + boolean doDebug) { + super(); + + this.teiidServerManager = teiidServerManager; + this.defaultServer = defaultServer; + this.doDebug = doDebug; + } + + public void storeServers(Collection teiidServers ) throws TransformerFactoryConfigurationError { + + try { + docBuilder = factory.newDocumentBuilder(); + doc = docBuilder.newDocument(); + + // create root element + root = doc.createElement(SERVERS_TAG); + doc.appendChild(root); + + Collection servers = teiidServers; + for (ITeiidServer teiidServer : servers) { + storeServer(teiidServer); + } + + DOMSource source = new DOMSource(doc); + StreamResult resultXML = new StreamResult(new FileOutputStream(teiidServerManager.getStateFileName())); + TransformerFactory transFactory = TransformerFactory.newInstance(); + Transformer transformer = transFactory.newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$ + transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); //$NON-NLS-1$ //$NON-NLS-2$ + transformer.transform(source, resultXML); + } catch (Exception e) { + IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, + Util.getString("errorSavingServerRegistry", teiidServerManager.getStateFileName())); //$NON-NLS-1$ + Util.log(status); + } + } + + private void storeServer(ITeiidServer teiidServer) throws Exception { + Element serverElement = doc.createElement(SERVER_TAG); + root.appendChild(serverElement); + + if( doDebug ) System.out.println( " >>> SAVING SERVER INFO"); + + { // Server Version + setAttribute(serverElement, SERVER_VERSION, teiidServer.getServerVersion().toString()); + } + { // Host + setAttribute(serverElement, HOST_ATTR, teiidServer.getHost()); + } + + { // Parent Server Id + setAttribute(serverElement, PARENT_SERVER_ID, teiidServer.getParent().getId()); + } + + { // CUSTOM LABEL + if (!StringUtilities.isEmpty(teiidServer.getCustomLabel())) { + setAttribute(serverElement, CUSTOM_LABEL_ATTR, teiidServer.getCustomLabel()); + } + } + + storeTeiidAdminInfo(teiidServer, serverElement); + + storeTeiidJdbcInfo(teiidServer, serverElement); + + if ((defaultServer != null) && (defaultServer.equals(teiidServer))) { + serverElement.setAttribute(DEFAULT_ATTR, Boolean.toString(true)); + } + } + + private void storeTeiidAdminInfo(ITeiidServer teiidServer, Element serverElement) throws Exception { + Element adminElement = doc.createElement(ADMIN_TAG); + serverElement.appendChild(adminElement); + + if( doDebug ) System.out.println( " ADMIN INFO"); + + setAttribute(adminElement, PORT_ATTR, teiidServer.getTeiidAdminInfo().getPort()); + setAttribute(adminElement, USER_ATTR, teiidServer.getTeiidAdminInfo().getUsername()); + + + /* The token of the password is saved to file while the password is saved in the eclipse secure storage + * Saving the token ensures that its possible to find the password again. + */ + String passToken = teiidServer.getTeiidAdminInfo().getPassToken(); + if (passToken != null) { + setAttribute(adminElement, PASSWORD_ATTR, Base64.encodeBytes(passToken.getBytes("UTF-8"))); //$NON-NLS-1$ + } + + setAttribute(adminElement, SECURE_ATTR, Boolean.toString(teiidServer.getTeiidAdminInfo().isSecure())); + } + + private void storeTeiidJdbcInfo(ITeiidServer teiidServer, Element serverElement) throws Exception { + Element jdbcElement = doc.createElement(JDBC_TAG); + serverElement.appendChild(jdbcElement); + + if( doDebug ) System.out.println( " JDBC INFO"); + + // Check if actual port is cached, else set to default + String actualPort = teiidServerManager.getJdbcPortManager().getPort(teiidServer, false); + if( actualPort == null ) { + actualPort = ITeiidJdbcInfo.DEFAULT_PORT; + } + setAttribute(jdbcElement, JDBC_PORT_ATTR, actualPort); + + // check for port override + String overridePort = teiidServerManager.getJdbcPortManager().getPort(teiidServer, true); + if( overridePort != null ) { + setAttribute(jdbcElement, JDBC_PORT_OVERRIDE_ATTR, overridePort); + } + setAttribute(jdbcElement, JDBC_USER_ATTR, teiidServer.getTeiidJdbcInfo().getUsername()); + + + /* The token of the password is saved to file while the password is saved in the eclipse secure storage + * Saving the token ensures that its possible to find the password again. + */ + String passToken = teiidServer.getTeiidJdbcInfo().getPassToken(); + if (passToken != null) + setAttribute(jdbcElement, JDBC_PASSWORD_ATTR, Base64.encodeBytes(passToken.getBytes("UTF-8"))); //$NON-NLS-1$ + + setAttribute(jdbcElement, JDBC_SECURE_ATTR, Boolean.toString(teiidServer.getTeiidJdbcInfo().isSecure())); + } + + private void setAttribute(Element element, String key, String value) { + element.setAttribute(key, value); + if( doDebug) System.out.println(" Set Server Attribute = " + key + " value = " + value); + } + +} diff --git a/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/extension/mongodb/MongoDBModelExtensionConstants.java b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/extension/mongodb/MongoDBModelExtensionConstants.java index 91cbf4e76e..0669e3b64c 100644 --- a/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/extension/mongodb/MongoDBModelExtensionConstants.java +++ b/plugins/org.teiid.designer.dqp/src/org/teiid/designer/runtime/extension/mongodb/MongoDBModelExtensionConstants.java @@ -11,7 +11,21 @@ import org.teiid.designer.extension.properties.NamespaceProvider; /** - * + * + teiid_mongo:EMBEDDABLE - Means that data defined in this table is allowed to be included as an "embeddable" document + in any parent document. The parent document is referenced by the foreign key relationships. In this scenario, + Teiid maintains more than one copy of the data in MongoDB store, one in its own collection and also a copy in + each of the parent tables that have relationship to this table. You can even nest embeddable table inside another + embeddable table with some limitations. Use this property on table, where table can exist, encompass all its + relations on its own. For example, a "Category" table that defines a "Product"'s category is independent of Product, + which can be embeddable in "Products" table. + + teiid_mongo:MERGE - Means that data of this table is merged with the defined parent table. There is only a single + copy of the data that is embedded in the parent document. Parent document is defined using the foreign key relationships. + + PLEASE NOTE: + A given table can contain either the "teiid_mongo:EMBEDDABLE" property or the "teiid_mongo:MERGE" property + defining the type of nesting in MongoDB. A TABLE IS NOT ALLOWED TO HAVE BOTH PROPERTIES */ public interface MongoDBModelExtensionConstants { /** diff --git a/plugins/org.teiid.designer.dsp.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.dsp.ui/META-INF/MANIFEST.MF index fdaa9bf8fd..f139d1b8e7 100644 --- a/plugins/org.teiid.designer.dsp.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.dsp.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.dsp.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %providerName Bundle-Activator: org.teiid.designer.dsp.ui.DSPUiPlugin Require-Bundle: org.eclipse.ui, diff --git a/plugins/org.teiid.designer.extension.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.extension.ui/META-INF/MANIFEST.MF index 774ab964b6..80767816d1 100644 --- a/plugins/org.teiid.designer.extension.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.extension.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.extension.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %pluginProvider Bundle-Localization: plugin Bundle-ActivationPolicy: lazy diff --git a/plugins/org.teiid.designer.extension.ui/pom.xml b/plugins/org.teiid.designer.extension.ui/pom.xml index 35a7a17df9..ed2491d0d0 100644 --- a/plugins/org.teiid.designer.extension.ui/pom.xml +++ b/plugins/org.teiid.designer.extension.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.extension.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.extension.ui/src/org/teiid/designer/extension/ui/ModelExtensionDefinitionBuilder.java b/plugins/org.teiid.designer.extension.ui/src/org/teiid/designer/extension/ui/ModelExtensionDefinitionBuilder.java index 75b90589f4..de123960d6 100644 --- a/plugins/org.teiid.designer.extension.ui/src/org/teiid/designer/extension/ui/ModelExtensionDefinitionBuilder.java +++ b/plugins/org.teiid.designer.extension.ui/src/org/teiid/designer/extension/ui/ModelExtensionDefinitionBuilder.java @@ -56,6 +56,8 @@ public final class ModelExtensionDefinitionBuilder extends AbstractTeiidProjectB private static final String LEGACY_CLASSNAME_PREFIX = "com.metamatrix"; //$NON-NLS-1$ public static final String HAS_LEGACY_NAMES = "hasLegacyNames"; //$NON-NLS-1$ public static final String HAS_OLD_REST_PREFIX = "hasOldRestPrefix"; //$NON-NLS-1$ + public static final String IS_OLD_RELATIONAL_MED = "isOldRelationalMed"; //$NON-NLS-1$ + public static final String IS_OLD_REST_VERSION_MED = "isOldRestVersionMed"; //$NON-NLS-1$ private ModelExtensionAssistantAggregator aggregator = ExtensionPlugin.getInstance().getModelExtensionAssistantAggregator(); private ModelExtensionRegistry registry = ExtensionPlugin.getInstance().getRegistry(); @@ -245,13 +247,18 @@ private void createMarker( IFile file, UTIL.log(IStatus.ERROR, MED_VALIDATION_MSG + originalMessage); } - Map attributes = new HashMap(); + Map attributes = new HashMap(); attributes.put(IMarker.SEVERITY, severity); attributes.put(IMarker.MESSAGE, message); if(hasLegacyNames) attributes.put(HAS_LEGACY_NAMES, true); if( message.indexOf("\"rest\"") > -1 && message.indexOf("is not registered in workspace") > -1 ) { attributes.put(HAS_OLD_REST_PREFIX, true); } + if( message.indexOf("model extension definition \"relational\" found in model is a different version") > -1 ) { + attributes.put(IS_OLD_RELATIONAL_MED, true); + } else if( message.indexOf("model extension definition \"REST\" found in model is a different version") > -1 ) { + attributes.put(IS_OLD_REST_VERSION_MED, true); + } try { MarkerUtilities.createMarker(file, attributes, markerId); diff --git a/plugins/org.teiid.designer.extension/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.extension/META-INF/MANIFEST.MF index 1bc4f50bc1..652d431ea7 100644 --- a/plugins/org.teiid.designer.extension/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.extension/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.extension;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.extension.ExtensionPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.extension/pom.xml b/plugins/org.teiid.designer.extension/pom.xml index 0ab78feb5f..9de5cb6140 100644 --- a/plugins/org.teiid.designer.extension/pom.xml +++ b/plugins/org.teiid.designer.extension/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.extension - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.extension/src/org/teiid/designer/extension/ExtensionPlugin.java b/plugins/org.teiid.designer.extension/src/org/teiid/designer/extension/ExtensionPlugin.java index b565a21641..3ff9969118 100644 --- a/plugins/org.teiid.designer.extension/src/org/teiid/designer/extension/ExtensionPlugin.java +++ b/plugins/org.teiid.designer.extension/src/org/teiid/designer/extension/ExtensionPlugin.java @@ -18,6 +18,7 @@ import java.util.List; import java.util.Map; import java.util.Properties; + import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResourceVisitor; @@ -712,6 +713,17 @@ public boolean supportsMedOperation( String proposedOperationName, public boolean supportsMyNamespace( Object modelObject ) throws Exception { return false; } + + /** + * {@inheritDoc} + * + */ + @Override + public boolean supportsProperty(Object modelObject, String propId) + throws Exception { + // TODO Auto-generated method stub + return false; + } } diff --git a/plugins/org.teiid.designer.extension/src/org/teiid/designer/extension/ModelExtensionAssistantAggregator.java b/plugins/org.teiid.designer.extension/src/org/teiid/designer/extension/ModelExtensionAssistantAggregator.java index e4ff07809c..6f43a4ea78 100644 --- a/plugins/org.teiid.designer.extension/src/org/teiid/designer/extension/ModelExtensionAssistantAggregator.java +++ b/plugins/org.teiid.designer.extension/src/org/teiid/designer/extension/ModelExtensionAssistantAggregator.java @@ -37,7 +37,7 @@ public ModelExtensionAssistantAggregator( ModelExtensionRegistry registry ) { this.registry = registry; } - private ModelObjectExtensionAssistant getModelObjectExtensionAssistant( String namespacePrefix ) { + public ModelObjectExtensionAssistant getModelObjectExtensionAssistant( String namespacePrefix ) { ModelExtensionAssistant assistant = this.registry.getModelExtensionAssistant(namespacePrefix); if (assistant instanceof ModelObjectExtensionAssistant) { diff --git a/plugins/org.teiid.designer.extension/src/org/teiid/designer/extension/definition/ModelObjectExtensionAssistant.java b/plugins/org.teiid.designer.extension/src/org/teiid/designer/extension/definition/ModelObjectExtensionAssistant.java index 9e1cd4679f..181b95f183 100644 --- a/plugins/org.teiid.designer.extension/src/org/teiid/designer/extension/definition/ModelObjectExtensionAssistant.java +++ b/plugins/org.teiid.designer.extension/src/org/teiid/designer/extension/definition/ModelObjectExtensionAssistant.java @@ -170,4 +170,7 @@ public abstract void setPropertyValue( Object modelObject, public void applyMedIfNecessary(IResource model) throws Exception { // Do nothing by default } + + public abstract boolean supportsProperty(Object modelObject, + String propId ) throws Exception; } diff --git a/plugins/org.teiid.designer.extension/src/org/teiid/designer/extension/registry/ModelExtensionRegistry.java b/plugins/org.teiid.designer.extension/src/org/teiid/designer/extension/registry/ModelExtensionRegistry.java index d9d6e02fd7..b0b4e5ab57 100644 --- a/plugins/org.teiid.designer.extension/src/org/teiid/designer/extension/registry/ModelExtensionRegistry.java +++ b/plugins/org.teiid.designer.extension/src/org/teiid/designer/extension/registry/ModelExtensionRegistry.java @@ -116,14 +116,14 @@ public ModelExtensionDefinition addDefinition( InputStream definitionStream, // don't allow a namespace prefix that has already been registered if (!definition.isBuiltIn() && this.definitions.containsKey(namespacePrefix)) { - throw new Exception(NLS.bind(Messages.namespacePrefixAlreadyRegistered, namespacePrefix)); + ExtensionPlugin.Util.log(IStatus.WARNING, NLS.bind(Messages.namespacePrefixAlreadyRegistered, namespacePrefix)); } String namespaceUri = definition.getNamespaceUri(); // don't allow a namespace URI that has already been registered if (!definition.isBuiltIn() && this.namespaces.containsKey(namespaceUri)) { - throw new Exception(NLS.bind(Messages.namespaceUriAlreadyRegistered, namespaceUri)); + ExtensionPlugin.Util.log(IStatus.WARNING, NLS.bind(Messages.namespaceUriAlreadyRegistered, namespaceUri)); } // Determine if the definition extends a valid Metamodel diff --git a/plugins/org.teiid.designer.jdbc.relational/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.jdbc.relational/META-INF/MANIFEST.MF index c96650cb13..f2d56cfbcd 100644 --- a/plugins/org.teiid.designer.jdbc.relational/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.jdbc.relational/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.jdbc.relational;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.jdbc.relational.JdbcRelationalPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.jdbc.relational/pom.xml b/plugins/org.teiid.designer.jdbc.relational/pom.xml index 298ba29e43..b6f30a7102 100644 --- a/plugins/org.teiid.designer.jdbc.relational/pom.xml +++ b/plugins/org.teiid.designer.jdbc.relational/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.jdbc.relational - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.jdbc.relational/src/org/teiid/designer/jdbc/relational/i18n.properties b/plugins/org.teiid.designer.jdbc.relational/src/org/teiid/designer/jdbc/relational/i18n.properties index 223cd7b380..9f78f3b909 100644 --- a/plugins/org.teiid.designer.jdbc.relational/src/org/teiid/designer/jdbc/relational/i18n.properties +++ b/plugins/org.teiid.designer.jdbc.relational/src/org/teiid/designer/jdbc/relational/i18n.properties @@ -33,6 +33,7 @@ RelationalModelProcessorImpl.Error_while_computing_datatype = Error while comput RelationalModelProcessorImpl.ResultSetName=ResultSet RelationalModelProcessorImpl.Error_while_obtaining_quote_string = Error while obtaining quote string for {0} RelationalModelProcessorImpl.Error_while_obtaining_catalogs = Error while obtaining catalogs string for {0} +RelationalModelProcessorImpl.Error_while_obtaining_name_in_source = Unable to obtain correct name in source for {0} RelationalModelProcessorImpl.importDescription = JDBC Import diff --git a/plugins/org.teiid.designer.jdbc.relational/src/org/teiid/designer/jdbc/relational/impl/custom/SybaseModelProcessor.java b/plugins/org.teiid.designer.jdbc.relational/src/org/teiid/designer/jdbc/relational/impl/custom/SybaseModelProcessor.java index 17dc4960d4..18e5c6a20e 100644 --- a/plugins/org.teiid.designer.jdbc.relational/src/org/teiid/designer/jdbc/relational/impl/custom/SybaseModelProcessor.java +++ b/plugins/org.teiid.designer.jdbc.relational/src/org/teiid/designer/jdbc/relational/impl/custom/SybaseModelProcessor.java @@ -7,11 +7,19 @@ */ package org.teiid.designer.jdbc.relational.impl.custom; +import java.sql.DatabaseMetaData; +import java.sql.ResultSet; +import java.sql.SQLException; import java.util.Iterator; import java.util.List; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.emf.ecore.EObject; import org.teiid.designer.core.types.DatatypeConstants; +import org.teiid.designer.jdbc.JdbcException; +import org.teiid.designer.jdbc.JdbcImportSettings; +import org.teiid.designer.jdbc.metadata.JdbcNode; import org.teiid.designer.jdbc.metadata.JdbcTable; import org.teiid.designer.jdbc.relational.impl.Context; import org.teiid.designer.jdbc.relational.impl.RelationalModelProcessorImpl; @@ -20,6 +28,7 @@ import org.teiid.designer.metamodels.relational.Column; import org.teiid.designer.metamodels.relational.Index; import org.teiid.designer.metamodels.relational.PrimaryKey; +import org.teiid.designer.metamodels.relational.RelationalEntity; import org.teiid.designer.metamodels.relational.RelationalFactory; import org.teiid.designer.metamodels.relational.Table; import org.teiid.designer.metamodels.relational.util.RelationalTypeMapping; @@ -224,4 +233,90 @@ protected void setColumnInfo( final Column column, column.setNativeType("double precision"); //$NON-NLS-1$ } } + + /* (non-Javadoc) + * @see org.teiid.designer.jdbc.relational.impl.RelationalModelProcessorImpl#computeNameInSource(org.teiid.designer.metamodels.relational.RelationalEntity, java.lang.String, org.teiid.designer.jdbc.metadata.JdbcNode, org.teiid.designer.jdbc.relational.impl.Context, boolean, java.util.List) + */ + @Override + protected String computeNameInSource(RelationalEntity object, String name, + JdbcNode node, Context context, boolean forced, List problems) { + + /* + * sybase with the jconn driver does not return schemas from + * DatabaseMetaData.getSchemas, but it requires the fqn to be in the + * form .. and it does return the part as + * the SCHEMA value in DatabaseMetaData.getTables + * + * In case we are unable to obtain the correct name in source, we do not fail, + * but let the super implementation handle it and just show a warning. + * + */ + + final JdbcImportSettings settings = context.getJdbcImportSettings(); + boolean includeCatalogs = settings.isCreateCatalogsInModel(); + + if (node instanceof JdbcTable && includeCatalogs) { + JdbcTable tableEntity = (JdbcTable) node; + try { + DatabaseMetaData databaseMetaData = context.getJdbcDatabase() + .getDatabaseMetaData(); + JdbcNode parentDatabase = tableEntity.getParentDatabaseObject( + true, false); + ResultSet tables = databaseMetaData.getTables( + parentDatabase.getName(), null, name, null); + + final StringBuffer sb = new StringBuffer(); + String quoteString = databaseMetaData + .getIdentifierQuoteString(); + + if (tables.next()) { + sb.append(quoteString); + sb.append(tables.getString("TABLE_CAT")); //$NON-NLS-1$ + sb.append(quoteString); + sb.append(databaseMetaData.getCatalogSeparator()); + sb.append(quoteString); + sb.append(tables.getString("TABLE_SCHEM")); //$NON-NLS-1$ + sb.append(quoteString); + sb.append(databaseMetaData.getCatalogSeparator()); + sb.append(quoteString); + sb.append(tables.getString("TABLE_NAME")); //$NON-NLS-1$ + sb.append(quoteString); + } + + if (tables.next()) { + // multiple tables with same name but different owners + addNameInSourceWarning(name, context, problems, null); + } + + return sb.toString(); + + } catch (JdbcException ex) { + addNameInSourceWarning(name, context, problems, ex); + } catch (SQLException ex) { + addNameInSourceWarning(name, context, problems, ex); + } + } + return super.computeNameInSource(object, name, node, context, forced, + problems); + } + + /** + * @param context + * @param problems + * @param ex + */ + private void addNameInSourceWarning(String name, Context context, + List problems, Exception ex) { + final String msg = org.teiid.designer.jdbc.relational.ModelerJdbcRelationalConstants.Util + .getString( + "RelationalModelProcessorImpl.Error_while_obtaining_name_in_source", //$NON-NLS-1$ + context.getJdbcDatabase().getName()) + + (ex == null ? "" : ex.getLocalizedMessage()); //$NON-NLS-1$ + final IStatus status = new Status( + IStatus.WARNING, + org.teiid.designer.jdbc.relational.ModelerJdbcRelationalConstants.PLUGIN_ID, + 0, msg, ex); + problems.add(status); + } + } diff --git a/plugins/org.teiid.designer.jdbc.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.jdbc.ui/META-INF/MANIFEST.MF index f7f54b5eda..a1a21cb100 100644 --- a/plugins/org.teiid.designer.jdbc.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.jdbc.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.jdbc.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.jdbc.ui.ModelerJdbcUiPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.jdbc.ui/pom.xml b/plugins/org.teiid.designer.jdbc.ui/pom.xml index 4f8508053a..bb863cd884 100644 --- a/plugins/org.teiid.designer.jdbc.ui/pom.xml +++ b/plugins/org.teiid.designer.jdbc.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.jdbc.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.jdbc/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.jdbc/META-INF/MANIFEST.MF index a361d4858b..6823f359e2 100644 --- a/plugins/org.teiid.designer.jdbc/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.jdbc/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.jdbc;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.jdbc.JdbcPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.jdbc/pom.xml b/plugins/org.teiid.designer.jdbc/pom.xml index 4c65339b00..a23a7e1781 100644 --- a/plugins/org.teiid.designer.jdbc/pom.xml +++ b/plugins/org.teiid.designer.jdbc/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.jdbc - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.json.lib/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.json.lib/META-INF/MANIFEST.MF index 973ef65f56..22a8b82624 100644 --- a/plugins/org.teiid.designer.json.lib/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.json.lib/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.json.lib;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Vendor: %pluginProvider Bundle-Localization: plugin Bundle-ActivationPolicy: lazy diff --git a/plugins/org.teiid.designer.json.lib/pom.xml b/plugins/org.teiid.designer.json.lib/pom.xml index 28d1032374..325c24c175 100644 --- a/plugins/org.teiid.designer.json.lib/pom.xml +++ b/plugins/org.teiid.designer.json.lib/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.json.lib - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin 20140107 diff --git a/plugins/org.teiid.designer.legacy/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.legacy/META-INF/MANIFEST.MF index 3a25c1a477..fbf8e1b00e 100644 --- a/plugins/org.teiid.designer.legacy/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.legacy/META-INF/MANIFEST.MF @@ -3,13 +3,14 @@ Bundle-ManifestVersion: 2 Bundle-Localization: plugin Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.legacy;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %pluginProvider Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Require-Bundle: org.jdom;bundle-version="[1.1.1,2.0.0)", org.teiid.designer.modeshape;bundle-version="[9.0.2,10.0.0)", org.teiid.designer.spi;bundle-version="[9.0.2,10.0.0)", org.teiid.core.designer;bundle-version="[9.0.2,10.0.0)", + org.teiid.core.designer;bundle-version="[9.0.2,10.0.0)", org.eclipse.core.runtime;bundle-version="[3.10.0,4.0.0)" Export-Package: org.teiid.designer.common.namedobject, diff --git a/plugins/org.teiid.designer.legacy/pom.xml b/plugins/org.teiid.designer.legacy/pom.xml index d9885609a5..67ac5919ed 100644 --- a/plugins/org.teiid.designer.legacy/pom.xml +++ b/plugins/org.teiid.designer.legacy/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.legacy - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/BlockIndexException.java b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/BlockIndexException.java new file mode 100644 index 0000000000..ad15677e6d --- /dev/null +++ b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/BlockIndexException.java @@ -0,0 +1,35 @@ +/* + * JBoss, Home of Professional Open Source. +* +* See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing. +* +* See the AUTHORS.txt file distributed with this work for a full listing of individual contributors. +*/ +package org.teiid.designer.core.index; + +import java.io.IOException; + +/** + * An exception thrown when an error occurs write a block in an index + */ +public class BlockIndexException extends IOException { + + private String word; + + /** + * @param word + * @param errorMsg + */ + public BlockIndexException(String word, String errorMsg) { + super(errorMsg); + this.word = word; + } + + /** + * @return the word + */ + public String getWord() { + return this.word; + } + +} diff --git a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/BlocksIndexInput.java b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/BlocksIndexInput.java index aac689c4d2..bfa8f0c9b8 100644 --- a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/BlocksIndexInput.java +++ b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/BlocksIndexInput.java @@ -18,6 +18,7 @@ import java.util.HashMap; import org.teiid.core.designer.util.CharOperation; import org.teiid.core.designer.util.LRUCache; +import org.teiid.designer.legacy.Messages; /** * This input is used for reading indexes saved using a BlocksIndexOutput. @@ -217,7 +218,7 @@ public void open() throws IOException { if (!isOpen()) { raf = new SafeRandomAccessFile(indexFile, "r"); //$NON-NLS-1$ String sig = raf.readUTF(); - if (!sig.equals(IIndexConstants.SIGNATURE)) throw new IOException(Util.bind("exception.wrongFormat")); //$NON-NLS-1$ + if (!sig.equals(IIndexConstants.SIGNATURE)) throw new IOException(Messages.wrongFormat); //$NON-NLS-1$ int summaryBlockNum = raf.readInt(); raf.seek(summaryBlockNum * (long)IIndexConstants.BLOCK_SIZE); summary = new IndexSummary(); diff --git a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/BlocksIndexOutput.java b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/BlocksIndexOutput.java index 0993ba958c..ddb0b583f6 100644 --- a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/BlocksIndexOutput.java +++ b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/BlocksIndexOutput.java @@ -14,6 +14,7 @@ import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; +import org.teiid.designer.legacy.Messages; /** * A blocksIndexOutput is used to save an index in a file with the given structure:
@@ -39,6 +40,9 @@ public class BlocksIndexOutput extends IndexOutput { protected boolean firstIndexBlock; protected boolean firstFileListBlock; + /** + * @param indexFile + */ public BlocksIndexOutput(File indexFile) { this.indexFile= indexFile; summary= new IndexSummary(); @@ -89,10 +93,14 @@ public void addWord(WordEntry entry) throws IOException { firstInBlock= false; } numWords++; - } else { - if (indexBlock.isEmpty()) { - return; - } + } else { // Failed to add block + if (indexBlock.getOffset() == 0) { + // + // An empty index block is too small to accommodate the word entry + // + throw new BlockIndexException(new String(entry.getWord()), Messages.blockSizeExceeded); + } + flushWords(); addWord(entry); } diff --git a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/FileListBlock.java b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/FileListBlock.java index dd44fde065..4d40016186 100644 --- a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/FileListBlock.java +++ b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/FileListBlock.java @@ -13,6 +13,7 @@ import java.io.IOException; import java.util.ArrayList; +import org.teiid.core.designer.util.StringUtilities; /** * @since 8.0 @@ -38,9 +39,10 @@ public boolean addFile( IndexedFile indexedFile ) { offset += 4; } String path = indexedFile.getPath(); - int prefixLen = prevPath == null ? 0 : Util.prefixLength(prevPath, path); + int prefixLen = prevPath == null ? 0 : StringUtilities.prefixLength(prevPath, path); int sizeEstimate = 2 + 2 + (path.length() - prefixLen) * 3; - if (offset + sizeEstimate > blockSize - 2) return false; + if (offset + sizeEstimate > blockSize - 2) + return false; field.putInt2(offset, prefixLen); offset += 2; char[] chars = new char[path.length() - prefixLen]; diff --git a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/GammaCompressedIndexBlock.java b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/GammaCompressedIndexBlock.java index d7e71a2691..dcd3241299 100644 --- a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/GammaCompressedIndexBlock.java +++ b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/GammaCompressedIndexBlock.java @@ -12,6 +12,7 @@ package org.teiid.designer.core.index; import java.io.UTFDataFormatException; +import org.teiid.core.designer.util.StringUtilities; /** * Uses prefix coding on words, and gamma coding of document numbers differences. @@ -19,107 +20,108 @@ * @since 8.0 */ public class GammaCompressedIndexBlock extends IndexBlock { - CodeByteStream writeCodeStream= new CodeByteStream(); - CodeByteStream readCodeStream; - char[] prevWord= null; - int offset= 0; + CodeByteStream writeCodeStream = new CodeByteStream(); + CodeByteStream readCodeStream; + char[] prevWord = null; - public GammaCompressedIndexBlock(int blockSize) { - super(blockSize); - readCodeStream= new CodeByteStream(field.buffer()); - } - /** - * @see IndexBlock#addEntry - */ - @Override + /** + * @param blockSize + */ + public GammaCompressedIndexBlock(int blockSize) { + super(blockSize); + readCodeStream = new CodeByteStream(field.buffer()); + } + + /** + * @see IndexBlock#addEntry + */ + @Override public boolean addEntry(WordEntry entry) { - writeCodeStream.reset(); - encodeEntry(entry, prevWord, writeCodeStream); - if (offset + writeCodeStream.byteLength() > this.blockSize - 2) { - return false; - } - byte[] bytes= writeCodeStream.toByteArray(); - field.put(offset, bytes); - offset += bytes.length; - prevWord= entry.getWord(); - return true; - } - protected void encodeEntry(WordEntry entry, char[] prevWord, CodeByteStream codeStream) { - char[] word= entry.getWord(); - int prefixLen= prevWord == null ? 0 : Math.min(Util.prefixLength(prevWord, word), 255); - codeStream.writeByte(prefixLen); - codeStream.writeUTF(word, prefixLen, word.length); - int n= entry.getNumRefs(); - codeStream.writeGamma(n); - int prevRef= 0; - for (int i= 0; i < n; ++i) { - int ref= entry.getRef(i); - if (ref <= prevRef) - throw new IllegalArgumentException(); - codeStream.writeGamma(ref - prevRef); - prevRef= ref; - } - } - /** - * @see IndexBlock#flush - */ - @Override + writeCodeStream.reset(); + encodeEntry(entry, prevWord, writeCodeStream); + + if (getOffset() + writeCodeStream.byteLength() > this.blockSize - 2) { + return false; + } + + byte[] bytes = writeCodeStream.toByteArray(); + field.put(getOffset(), bytes); + setOffset(getOffset() + bytes.length); + prevWord = entry.getWord(); + return true; + } + + protected void encodeEntry(WordEntry entry, char[] prevWord, CodeByteStream codeStream) { + char[] word = entry.getWord(); + int prefixLen = prevWord == null ? 0 : Math.min(StringUtilities.prefixLength(prevWord, word), 255); + codeStream.writeByte(prefixLen); + codeStream.writeUTF(word, prefixLen, word.length); + int n = entry.getNumRefs(); + codeStream.writeGamma(n); + int prevRef = 0; + for (int i = 0; i < n; ++i) { + int ref = entry.getRef(i); + if (ref <= prevRef) + throw new IllegalArgumentException(); + codeStream.writeGamma(ref - prevRef); + prevRef = ref; + } + } + + /** + * @see IndexBlock#flush + */ + @Override public void flush() { - if (offset > 0) { - field.putInt2(offset, 0); - offset= 0; - prevWord= null; - } - } - /** - * @see IndexBlock#isEmpty - */ - @Override - public boolean isEmpty() { - return offset == 0; - } - /** - * @see IndexBlock#nextEntry - */ - @Override + if (getOffset() > 0) { + field.putInt2(getOffset(), 0); + setOffset(0); + prevWord = null; + } + } + + /** + * @see IndexBlock#nextEntry + */ + @Override public boolean nextEntry(WordEntry entry) { - try { - readCodeStream.reset(field.buffer(), offset); - int prefixLength= readCodeStream.readByte(); - char[] word= readCodeStream.readUTF(); - if (prevWord != null && prefixLength > 0) { - char[] temp= new char[prefixLength + word.length]; - System.arraycopy(prevWord, 0, temp, 0, Math.min(prefixLength, prevWord.length)); - System.arraycopy(word, 0, temp, Math.min(prefixLength, prevWord.length), word.length); - word= temp; - } - if (word.length == 0) { - return false; - } - entry.reset(word); - int n= readCodeStream.readGamma(); - int prevRef= 0; - for (int i= 0; i < n; ++i) { - int ref= prevRef + readCodeStream.readGamma(); - if (ref < prevRef) - throw new InternalError(); - entry.addRef(ref); - prevRef= ref; - } - offset= readCodeStream.byteLength(); - prevWord= word; - return true; - } catch (UTFDataFormatException e) { - return false; - } - } - /** - * @see IndexBlock#reset - */ - @Override + try { + readCodeStream.reset(field.buffer(), getOffset()); + int prefixLength = readCodeStream.readByte(); + char[] word = readCodeStream.readUTF(); + if (prevWord != null && prefixLength > 0) { + char[] temp = new char[prefixLength + word.length]; + System.arraycopy(prevWord, 0, temp, 0, Math.min(prefixLength, prevWord.length)); + System.arraycopy(word, 0, temp, Math.min(prefixLength, prevWord.length), word.length); + word = temp; + } + if (word.length == 0) { + return false; + } + entry.reset(word); + int n = readCodeStream.readGamma(); + int prevRef = 0; + for (int i = 0; i < n; ++i) { + int ref = prevRef + readCodeStream.readGamma(); + if (ref < prevRef) + throw new InternalError(); + entry.addRef(ref); + prevRef = ref; + } + setOffset(readCodeStream.byteLength()); + prevWord = word; + return true; + } catch (UTFDataFormatException e) { + return false; + } + } + + /** + * @see IndexBlock#reset + */ + @Override public void reset() { - super.reset(); - offset= 0; - prevWord= null; - } + super.reset(); + prevWord = null; + } } diff --git a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/IndexBlock.java b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/IndexBlock.java index cb51bd0bb5..ebd325b28e 100644 --- a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/IndexBlock.java +++ b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/IndexBlock.java @@ -12,7 +12,6 @@ package org.teiid.designer.core.index; import java.util.Arrays; - import org.teiid.core.designer.util.CharOperation; /** @@ -23,9 +22,33 @@ public abstract class IndexBlock extends Block { + private int offset= 0; + public IndexBlock(int blockSize) { super(blockSize); } + + /** + * @return the offset + */ + public int getOffset() { + return this.offset; + } + + /** + * @param offset the offset to set + */ + public void setOffset(int offset) { + this.offset = offset; + } + + /** + * @return whether the block is empty or not (if it doesn't contain any wordEntry). + */ + public boolean isEmpty() { + return getOffset() == 0; + } + /** * Adds the given wordEntry to the indexBlock. */ @@ -59,10 +82,6 @@ public WordEntry findExactEntry(char[] word) { } return null; } - /** - * Returns whether the block is empty or not (if it doesn't contain any wordEntry). - */ - public abstract boolean isEmpty(); /** * Finds the next wordEntry and stores it in the given entry. @@ -70,5 +89,6 @@ public WordEntry findExactEntry(char[] word) { public abstract boolean nextEntry(WordEntry entry); public void reset() { + setOffset(0); } } diff --git a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/IndexSummary.java b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/IndexSummary.java index aa67c2cf4b..a36d3de7d2 100644 --- a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/IndexSummary.java +++ b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/IndexSummary.java @@ -14,8 +14,8 @@ import java.io.IOException; import java.io.RandomAccessFile; import java.util.ArrayList; - import org.teiid.core.designer.util.CharOperation; +import org.teiid.core.designer.util.StringUtilities; /** @@ -131,7 +131,7 @@ public int getBlockNumForWord(char[] word) { while (min <= max) { int mid= (min + max) / 2; FirstWordInBlock entry= (FirstWordInBlock) firstWordsInBlocks.get(mid); - int compare= Util.compare(word, entry.word); + int compare= StringUtilities.compare(word, entry.word); if (compare == 0) return entry.blockNum; if (compare < 0) diff --git a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/MergeFactory.java b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/MergeFactory.java index daf61b43db..38f6f768d7 100644 --- a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/MergeFactory.java +++ b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/MergeFactory.java @@ -13,6 +13,7 @@ import java.io.IOException; import java.util.Map; +import org.teiid.core.designer.util.StringUtilities; /** * A mergeFactory is used to merge 2 indexes into one. One of the indexes @@ -172,7 +173,7 @@ protected void mergeReferences() throws IOException { else if (word2 == null) compare= -1; else - compare= Util.compare(word1.getWord(), word2.getWord()); + compare= StringUtilities.compare(word1.getWord(), word2.getWord()); if (compare < 0) { word1.mapRefs(mappingOld); mergeOutput.addWord(word1); diff --git a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/SimpleIndexBlock.java b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/SimpleIndexBlock.java index 55ff09700a..cccfd4e40b 100644 --- a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/SimpleIndexBlock.java +++ b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/SimpleIndexBlock.java @@ -13,113 +13,109 @@ import java.io.UTFDataFormatException; import java.util.Arrays; + /** * Does no compression of words, and uses 4-byte ints for file numbers and number of files. * * @since 8.0 */ public class SimpleIndexBlock extends IndexBlock { - protected int offset= 0; - public SimpleIndexBlock(int blockSize) { - super(blockSize); - } - /** - * @see IndexBlock#addEntry - */ - @Override + /** + * @param blockSize + */ + public SimpleIndexBlock(int blockSize) { + super(blockSize); + } + + /** + * @see IndexBlock#addEntry + */ + @Override public boolean addEntry(WordEntry entry) { - char[] word= entry.getWord(); - int n= entry.getNumRefs(); - int sizeEstimate= 2 + word.length * 3 + 4 + n * 4; - int offset= this.offset; - if (offset + sizeEstimate > this.blockSize - 2) - return false; - offset += field.putUTF(offset, word); - field.putInt4(offset, n); - offset += 4; - for (int i= 0; i < n; ++i) { - field.putInt4(offset, entry.getRef(i)); - offset += 4; - } - this.offset= offset; - return true; - } - public WordEntry findEntry(char[] word) { - try { - int offset= 0; - int byteLen; - while ((byteLen= field.getUInt2(offset)) != 0) { - char[] tempWord= field.getUTF(offset); - offset += byteLen + 2; - if (Arrays.equals(tempWord, word)) { - WordEntry entry= new WordEntry(word); - int n= field.getInt4(offset); - offset += 4; - for (int i= 0; i < n; ++i) { - int ref= field.getInt4(offset); - offset += 4; - entry.addRef(ref); - } - return entry; - } - int n= field.getInt4(offset); - offset += 4 + 4 * n; - } - return null; - } catch (UTFDataFormatException e) { - return null; - } - } - /** - * @see IndexBlock#flush - */ - @Override + char[] word = entry.getWord(); + int n = entry.getNumRefs(); + int sizeEstimate = 2 + word.length * 3 + 4 + n * 4; + int offset = getOffset(); + if (offset + sizeEstimate > this.blockSize - 2) + return false; + offset += field.putUTF(offset, word); + field.putInt4(offset, n); + offset += 4; + for (int i = 0; i < n; ++i) { + field.putInt4(offset, entry.getRef(i)); + offset += 4; + } + setOffset(offset); + return true; + } + + /** + * @param word + * @return {@link WordEntry} + */ + public WordEntry findEntry(char[] word) { + try { + int offset = 0; + int byteLen; + while ((byteLen = field.getUInt2(offset)) != 0) { + char[] tempWord = field.getUTF(offset); + offset += byteLen + 2; + if (Arrays.equals(tempWord, word)) { + WordEntry entry = new WordEntry(word); + int n = field.getInt4(offset); + offset += 4; + for (int i = 0; i < n; ++i) { + int ref = field.getInt4(offset); + offset += 4; + entry.addRef(ref); + } + return entry; + } + int n = field.getInt4(offset); + offset += 4 + 4 * n; + } + return null; + } catch (UTFDataFormatException e) { + return null; + } + } + + /** + * @see IndexBlock#flush + */ + @Override public void flush() { - if (offset > 0) { - field.putInt2(offset, 0); - offset= 0; - } - } - /** - * @see IndexBlock#isEmpty - */ - @Override - public boolean isEmpty() { - return offset == 0; - } - /** - * @see IndexBlock#nextEntry - */ - @Override + if (getOffset() > 0) { + field.putInt2(getOffset(), 0); + setOffset(0); + } + } + + /** + * @see IndexBlock#nextEntry + */ + @Override public boolean nextEntry(WordEntry entry) { - try { - int offset= this.offset; - int byteLen= field.getUInt2(offset); - if (byteLen == 0) - return false; - char[] word= field.getUTF(offset); - offset += byteLen + 2; - entry.reset(word); - int n= field.getInt4(offset); - offset += 4; - for (int i= 0; i < n; ++i) { - int ref= field.getInt4(offset); - offset += 4; - entry.addRef(ref); - } - this.offset= offset; - return true; - } catch (UTFDataFormatException e) { - return false; - } - } - /** - * @see IndexBlock#reset - */ - @Override - public void reset() { - super.reset(); - this.offset= 0; - } + try { + int offset = getOffset(); + int byteLen = field.getUInt2(offset); + if (byteLen == 0) + return false; + char[] word = field.getUTF(offset); + offset += byteLen + 2; + entry.reset(word); + int n = field.getInt4(offset); + offset += 4; + for (int i = 0; i < n; ++i) { + int ref = field.getInt4(offset); + offset += 4; + entry.addRef(ref); + } + setOffset(offset); + return true; + } catch (UTFDataFormatException e) { + return false; + } + } } diff --git a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/Util.java b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/Util.java deleted file mode 100644 index 03f74dd831..0000000000 --- a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/Util.java +++ /dev/null @@ -1,100 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * MetaMatrix, Inc - repackaging and updates for use as a metadata store - *******************************************************************************/ -package org.teiid.designer.core.index; - -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -/** - * @since 8.0 - */ -public class Util { - - private Util() { - } - - /* Bundle containing messages */ - protected static ResourceBundle bundle; - private final static String bundleName = "com.metamatrix.core.index.i18n"; //$NON-NLS-1$ - - /** - * Lookup the message with the given ID in this catalog - */ - public static String bind(String id) { - return bind(id, (String[]) null); - } - /** - * Lookup the message with the given ID in this catalog and bind its - * substitution locations with the given string values. - */ - public static String bind(String id, String[] arguments) { - if (id == null) - return "No message available"; //$NON-NLS-1$ - String message = null; - try { - message = bundle.getString(id); - } catch (MissingResourceException e) { - // If we got an exception looking for the message, fail gracefully by just returning - // the id we were looking for. In most cases this is semi-informative so is not too bad. - return "Missing message: " + id + " in: " + bundleName; //$NON-NLS-2$ //$NON-NLS-1$ - } - return MessageFormat.format(message, (Object[])arguments); - } - - /** - * Compares two strings lexicographically. - * The comparison is based on the Unicode value of each character in - * the strings. - * - * @return the value 0 if the str1 is equal to str2; - * a value less than 0 if str1 - * is lexicographically less than str2; - * and a value greater than 0 if str1 is - * lexicographically greater than str2. - */ - public static int compare(char[] str1, char[] str2) { - int len1= str1.length; - int len2= str2.length; - int n= Math.min(len1, len2); - int i= 0; - while (n-- != 0) { - char c1= str1[i]; - char c2= str2[i++]; - if (c1 != c2) { - return c1 - c2; - } - } - return len1 - len2; - } - - /** - * Returns the length of the common prefix between s1 and s2. - */ - public static int prefixLength(char[] s1, char[] s2) { - int len= 0; - int max= Math.min(s1.length, s2.length); - for (int i= 0; i < max && s1[i] == s2[i]; ++i) - ++len; - return len; - } - /** - * Returns the length of the common prefix between s1 and s2. - */ - public static int prefixLength(String s1, String s2) { - int len= 0; - int max= Math.min(s1.length(), s2.length()); - for (int i= 0; i < max && s1.charAt(i) == s2.charAt(i); ++i) - ++len; - return len; - } -} diff --git a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/WordEntry.java b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/WordEntry.java index 9db604dda3..fe1519d233 100644 --- a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/WordEntry.java +++ b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/core/index/WordEntry.java @@ -12,6 +12,7 @@ package org.teiid.designer.core.index; import java.util.Arrays; +import org.teiid.core.designer.util.StringUtilities; /** @@ -164,6 +165,6 @@ public String toString() { } @Override public int compareTo(WordEntry other) { - return Util.compare(this.fWord, other.fWord); + return StringUtilities.compare(this.fWord, other.fWord); } } diff --git a/plugins/org.teiid.designer.legacy/src/org/teiid/designer/legacy/Messages.java b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/legacy/Messages.java new file mode 100644 index 0000000000..76f695530e --- /dev/null +++ b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/legacy/Messages.java @@ -0,0 +1,26 @@ +/* + * JBoss, Home of Professional Open Source. +* +* See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing. +* +* See the AUTHORS.txt file distributed with this work for a full listing of individual contributors. +*/ +package org.teiid.designer.legacy; + +import org.eclipse.osgi.util.NLS; + +/** +* +*/ +public class Messages extends NLS { + + public static String wrongFormat; + + public static String blockSizeExceeded; + + static { + NLS.initializeMessages(Messages.class.getPackage().getName() + ".messages", Messages.class); //$NON-NLS-1$ + } + + +} diff --git a/plugins/crypto/org.teiid.designer.bc.dummy/plugin.properties b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/legacy/messages.properties similarity index 57% rename from plugins/crypto/org.teiid.designer.bc.dummy/plugin.properties rename to plugins/org.teiid.designer.legacy/src/org/teiid/designer/legacy/messages.properties index 5ab95a65aa..e4b1d3dcc1 100644 --- a/plugins/crypto/org.teiid.designer.bc.dummy/plugin.properties +++ b/plugins/org.teiid.designer.legacy/src/org/teiid/designer/legacy/messages.properties @@ -3,5 +3,6 @@ # See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing. # # See the AUTHORS.txt file distributed with this work for a full listing of individual contributors. -pluginProvider= JBoss by Red Hat -pluginName=Teiid Designer Bouncy Castle Dummy Replacement to avoid legal issues over encryption algorithms \ No newline at end of file + +blockSizeExceeded=Index creation failure: Entry cannot be added to index since its size exceeds the block size +wrongFormat=Index cannot be read since it does not conform to the correct format \ No newline at end of file diff --git a/plugins/org.teiid.designer.mapping.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.mapping.ui/META-INF/MANIFEST.MF index 0158b04242..5d8c4b661b 100644 --- a/plugins/org.teiid.designer.mapping.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.mapping.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.mapping.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.mapping.ui.UiPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.mapping.ui/pom.xml b/plugins/org.teiid.designer.mapping.ui/pom.xml index b298639040..b0c8020782 100644 --- a/plugins/org.teiid.designer.mapping.ui/pom.xml +++ b/plugins/org.teiid.designer.mapping.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.mapping.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.mapping/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.mapping/META-INF/MANIFEST.MF index 026d6246b3..f006bc6a57 100644 --- a/plugins/org.teiid.designer.mapping/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.mapping/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.mapping;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.mapping.ModelerMappingPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.mapping/pom.xml b/plugins/org.teiid.designer.mapping/pom.xml index 75bdc362e8..91c95ca5d6 100644 --- a/plugins/org.teiid.designer.mapping/pom.xml +++ b/plugins/org.teiid.designer.mapping/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.mapping - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.metamodels.builder.execution/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.metamodels.builder.execution/META-INF/MANIFEST.MF index b7a9470504..9917a3b3b6 100644 --- a/plugins/org.teiid.designer.metamodels.builder.execution/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.metamodels.builder.execution/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.metamodels.builder.execution;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.metamodels.builder.execution.MetamodelBuilderExecutionPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.metamodels.builder.execution/pom.xml b/plugins/org.teiid.designer.metamodels.builder.execution/pom.xml index a493dd982b..cf6ef48e2f 100644 --- a/plugins/org.teiid.designer.metamodels.builder.execution/pom.xml +++ b/plugins/org.teiid.designer.metamodels.builder.execution/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.metamodels.builder.execution - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.metamodels.builder/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.metamodels.builder/META-INF/MANIFEST.MF index 3a01556ebf..67a27c11d7 100644 --- a/plugins/org.teiid.designer.metamodels.builder/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.metamodels.builder/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.metamodels.builder;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.metamodels.builder.MetamodelBuilderPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.metamodels.builder/pom.xml b/plugins/org.teiid.designer.metamodels.builder/pom.xml index de7ae17095..57b789a1a3 100644 --- a/plugins/org.teiid.designer.metamodels.builder/pom.xml +++ b/plugins/org.teiid.designer.metamodels.builder/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.metamodels.builder - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.metamodels.core/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.metamodels.core/META-INF/MANIFEST.MF index 3dd2529f9d..dd4e355c7f 100644 --- a/plugins/org.teiid.designer.metamodels.core/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.metamodels.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.metamodels.core;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.metamodels.core.CoreMetamodelPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.metamodels.core/pom.xml b/plugins/org.teiid.designer.metamodels.core/pom.xml index 36804ea87a..0238b43280 100644 --- a/plugins/org.teiid.designer.metamodels.core/pom.xml +++ b/plugins/org.teiid.designer.metamodels.core/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.metamodels.core - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.metamodels.dependency/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.metamodels.dependency/META-INF/MANIFEST.MF index b24a2415ba..b2ed2f5213 100644 --- a/plugins/org.teiid.designer.metamodels.dependency/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.metamodels.dependency/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.metamodels.dependency;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.metamodels.dependency.DependencyPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.metamodels.dependency/pom.xml b/plugins/org.teiid.designer.metamodels.dependency/pom.xml index 301c675f05..90cb63fa5b 100644 --- a/plugins/org.teiid.designer.metamodels.dependency/pom.xml +++ b/plugins/org.teiid.designer.metamodels.dependency/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.metamodels.dependency - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.metamodels.diagram/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.metamodels.diagram/META-INF/MANIFEST.MF index 84a1520c0f..4a2fcec858 100644 --- a/plugins/org.teiid.designer.metamodels.diagram/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.metamodels.diagram/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.metamodels.diagram;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.metamodels.diagram.DiagramPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.metamodels.diagram/pom.xml b/plugins/org.teiid.designer.metamodels.diagram/pom.xml index 4ec753e9e1..5528cdc6b3 100644 --- a/plugins/org.teiid.designer.metamodels.diagram/pom.xml +++ b/plugins/org.teiid.designer.metamodels.diagram/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.metamodels.diagram - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.metamodels.function/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.metamodels.function/META-INF/MANIFEST.MF index 93330472cd..8560f36f29 100644 --- a/plugins/org.teiid.designer.metamodels.function/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.metamodels.function/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.metamodels.function;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.metamodels.function.FunctionPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.metamodels.function/pom.xml b/plugins/org.teiid.designer.metamodels.function/pom.xml index 67eaf13769..9677b91cd8 100644 --- a/plugins/org.teiid.designer.metamodels.function/pom.xml +++ b/plugins/org.teiid.designer.metamodels.function/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.metamodels.function - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.metamodels.relational/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.metamodels.relational/META-INF/MANIFEST.MF index 6ceeaae2bc..280296347c 100644 --- a/plugins/org.teiid.designer.metamodels.relational/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.metamodels.relational/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.metamodels.relational;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.metamodels.relational.RelationalPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.metamodels.relational/pom.xml b/plugins/org.teiid.designer.metamodels.relational/pom.xml index 67b32e2a75..b6a222e463 100644 --- a/plugins/org.teiid.designer.metamodels.relational/pom.xml +++ b/plugins/org.teiid.designer.metamodels.relational/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.metamodels.relational - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.metamodels.relational/relational.mxd b/plugins/org.teiid.designer.metamodels.relational/relational.mxd index 353a9bd854..7237b418d9 100644 --- a/plugins/org.teiid.designer.metamodels.relational/relational.mxd +++ b/plugins/org.teiid.designer.metamodels.relational/relational.mxd @@ -1,5 +1,5 @@ - + Relational metamodel extension properties PHYSICAL VIRTUAL @@ -66,6 +66,64 @@ false true + + Allow Teiid based management + false + true + + + fully qualified Status Table Name + Status Table Name + + + semi-colon(;) separated DDL/DML commands to run before the actual load of the cache, typically used to truncate staging table + Materialize Before Load Script + + + semi-colon(;) separated DDL/DML commands to run for loading of the cache + Materialize Load Script + + + semi-colon(;) separated DDL/DML commands to run after the actual load of the cache. + Typically used to rename staging table to actual cache table. Required when MATVIEW_LOAD_SCRIPT not defined to copy + data from teiid_rel:MATVIEW_STAGE_TABLE to MATVIEW table + Materialize After Load Script + + + Allowed values are {NONE, VDB, SCHEMA}, which define if the cached contents are shared among + different VDB versions and different VDBs as long as schema names match + Materialized Share Scope + NONE + SCHEMA + VDB + + + When MATVIEW_LOAD_SCRIPT property not defined, Teiid loads the cache contents + into this table. Required when MATVIEW_LOAD_SCRIPT not defined + Materialized Staging Table + + + DML commands to run start of vdb + Commands To Run On VDB Start + + + DML commands to run at VDB un-deploy; typically used for cleaning the cache/status tables + Commands To Run On VDB Drop + + + Action to be taken when mat view contents are requested but cache is invalid. Allowed values are + (THROW_EXCEPTION = throws an exception, + IGNORE = ignores the warning and supplied invalidated data, + WAIT = waits until the data is refreshed and valid then provides the updated data) + Action On Error + WAIT + IGNORE + THROW_EXCEPTION + + + Time to live in milliseconds. Provide property or cache hint on view transformation - property takes precedence. + Time To Live (ms) + diff --git a/plugins/org.teiid.designer.metamodels.relational/rest.mxd b/plugins/org.teiid.designer.metamodels.relational/rest.mxd index 6c9fb251f9..d6b446b8b9 100644 --- a/plugins/org.teiid.designer.metamodels.relational/rest.mxd +++ b/plugins/org.teiid.designer.metamodels.relational/rest.mxd @@ -1,5 +1,5 @@ - + REST extended virtual procedure properties VIRTUAL diff --git a/plugins/org.teiid.designer.metamodels.relational/src/org/teiid/designer/metamodels/relational/extension/RelationalModelExtensionAssistant.java b/plugins/org.teiid.designer.metamodels.relational/src/org/teiid/designer/metamodels/relational/extension/RelationalModelExtensionAssistant.java index ce1d7ff467..3e8e367f3a 100644 --- a/plugins/org.teiid.designer.metamodels.relational/src/org/teiid/designer/metamodels/relational/extension/RelationalModelExtensionAssistant.java +++ b/plugins/org.teiid.designer.metamodels.relational/src/org/teiid/designer/metamodels/relational/extension/RelationalModelExtensionAssistant.java @@ -15,7 +15,9 @@ import org.teiid.designer.core.workspace.ModelResource; import org.teiid.designer.core.workspace.ModelUtil; import org.teiid.designer.extension.ExtensionConstants; +import org.teiid.designer.extension.ExtensionPlugin; import org.teiid.designer.extension.properties.ModelExtensionPropertyDefinition; +import org.teiid.designer.extension.registry.ModelExtensionRegistry; import org.teiid.designer.metamodels.core.ModelType; import org.teiid.designer.metamodels.relational.DirectionKind; import org.teiid.designer.metamodels.relational.ForeignKey; @@ -55,7 +57,18 @@ private enum PropertyName { UDF_JAR_PATH(getPropertyId("udfJarPath")), //$NON-NLS-1$ ALLOW_JOIN(getPropertyId("allow-join")), //$NON-NLS-1$ NATIVE_TYPE(getPropertyId("native_type")), //$NON-NLS-1$ - GLOBAL_TEMP_TABLE(getPropertyId("global-temp-table")); //$NON-NLS-1$ + GLOBAL_TEMP_TABLE(getPropertyId("global-temp-table")), //$NON-NLS-1$ + ALLOW_MATVIEW_MANAGEMENT(getPropertyId("ALLOW_MATVIEW_MANAGEMENT")), //$NON-NLS-1$ + MATVIEW_STATUS_TABLE(getPropertyId("MATVIEW_STATUS_TABLE")), //$NON-NLS-1$ + MATVIEW_BEFORE_LOAD_SCRIPT(getPropertyId("MATVIEW_BEFORE_LOAD_SCRIPT")), //$NON-NLS-1$ + MATVIEW_LOAD_SCRIPT(getPropertyId("MATVIEW_LOAD_SCRIPT")), //$NON-NLS-1$ + MATVIEW_AFTER_LOAD_SCRIPT(getPropertyId("MATVIEW_AFTER_LOAD_SCRIPT")), //$NON-NLS-1$ + MATVIEW_SHARE_SCOPE(getPropertyId("MATVIEW_SHARE_SCOPE")), //$NON-NLS-1$ + MATERIALIZED_STAGE_TABLE(getPropertyId("MATERIALIZED_STAGE_TABLE")), //$NON-NLS-1$ + ON_VDB_START_SCRIPT(getPropertyId("ON_VDB_START_SCRIPT")), //$NON-NLS-1$ + ON_VDB_DROP_SCRIPT(getPropertyId("ON_VDB_DROP_SCRIPT")), //$NON-NLS-1$ + MATVIEW_ONERROR_ACTION(getPropertyId("MATVIEW_ONERROR_ACTION")), //$NON-NLS-1$ + MATVIEW_TTL(getPropertyId("MATVIEW_TTL")); //$NON-NLS-1$ public static boolean same(final PropertyName propName, @@ -79,6 +92,12 @@ public String toString() { return this.propName; } } + + public static RelationalModelExtensionAssistant getRelationalAssistant() { + final ModelExtensionRegistry registry = ExtensionPlugin.getInstance().getRegistry(); + final String prefix = RelationalModelExtensionConstants.NAMESPACE_PROVIDER.getNamespacePrefix(); + return (RelationalModelExtensionAssistant)registry.getModelExtensionAssistant(prefix); + } /** * Saves the relational MED to a model if necessary. @@ -226,6 +245,33 @@ protected ModelExtensionPropertyDefinition getPropertyDefinition(final Object mo return null; } + // MATERIALIZED VIEW PROPERTIES + if( ( modelObject instanceof Table ) && isPhysical) { + // remove if physical table + if ( PropertyName.same(PropertyName.MATERIALIZED_STAGE_TABLE, propId) || + PropertyName.same(PropertyName.MATVIEW_AFTER_LOAD_SCRIPT, propId) || + PropertyName.same(PropertyName.MATVIEW_BEFORE_LOAD_SCRIPT, propId) || + PropertyName.same(PropertyName.MATVIEW_LOAD_SCRIPT, propId) || + PropertyName.same(PropertyName.MATVIEW_ONERROR_ACTION, propId) || + PropertyName.same(PropertyName.MATVIEW_SHARE_SCOPE, propId) || + PropertyName.same(PropertyName.MATVIEW_STATUS_TABLE, propId) || + PropertyName.same(PropertyName.MATVIEW_TTL, propId) || + PropertyName.same(PropertyName.ON_VDB_DROP_SCRIPT, propId) || + PropertyName.same(PropertyName.ON_VDB_START_SCRIPT, propId) ) { + removeProperty(modelObject, PropertyName.MATERIALIZED_STAGE_TABLE.toString()); + removeProperty(modelObject, PropertyName.MATVIEW_AFTER_LOAD_SCRIPT.toString()); + removeProperty(modelObject, PropertyName.MATVIEW_BEFORE_LOAD_SCRIPT.toString()); + removeProperty(modelObject, PropertyName.MATVIEW_LOAD_SCRIPT.toString()); + removeProperty(modelObject, PropertyName.MATVIEW_ONERROR_ACTION.toString()); + removeProperty(modelObject, PropertyName.MATVIEW_SHARE_SCOPE.toString()); + removeProperty(modelObject, PropertyName.MATVIEW_STATUS_TABLE.toString()); + removeProperty(modelObject, PropertyName.MATVIEW_TTL.toString()); + removeProperty(modelObject, PropertyName.ON_VDB_DROP_SCRIPT.toString()); + removeProperty(modelObject, PropertyName.ON_VDB_START_SCRIPT.toString()); + } + return null; + } + return propDefn; } @@ -246,6 +292,8 @@ public void setPropertyValue(final Object modelObject, if( isVirtual && !PropertyName.same(PropertyName.NON_PREPARED, propId)) { super.setPropertyValue(modelObject, propId, newValue); + } else if( !isVirtual && PropertyName.same(PropertyName.NATIVE_QUERY, propId)) { + super.setPropertyValue(modelObject, propId, newValue); } // if setting aggregate to false remove these properties @@ -270,4 +318,11 @@ public boolean supportsMedOperation(String proposedOperationName, CoreArgCheck.isNotEmpty(proposedOperationName, "proposedOperationName is empty"); //$NON-NLS-1$ return ExtensionConstants.MedOperations.SHOW_IN_REGISTRY.equals(proposedOperationName); // only show in registry } + + + @Override + public boolean supportsProperty(Object modelObject, String propId) + throws Exception { + return getPropertyDefinition(modelObject, propId) != null; + } } diff --git a/plugins/org.teiid.designer.metamodels.relational/src/org/teiid/designer/metamodels/relational/extension/RelationalModelExtensionConstants.java b/plugins/org.teiid.designer.metamodels.relational/src/org/teiid/designer/metamodels/relational/extension/RelationalModelExtensionConstants.java index 3f707e32eb..954e76a574 100644 --- a/plugins/org.teiid.designer.metamodels.relational/src/org/teiid/designer/metamodels/relational/extension/RelationalModelExtensionConstants.java +++ b/plugins/org.teiid.designer.metamodels.relational/src/org/teiid/designer/metamodels/relational/extension/RelationalModelExtensionConstants.java @@ -58,6 +58,17 @@ interface PropertyIds { String UDF_JAR_PATH = ModelExtensionPropertyDefinition.Utils.getPropertyId(NAMESPACE_PROVIDER, "udfJarPath"); //$NON-NLS-1$ String NATIVE_TYPE = ModelExtensionPropertyDefinition.Utils.getPropertyId(NAMESPACE_PROVIDER, "native_type"); //$NON-NLS-1$ String GLOBAL_TEMP_TABLE = ModelExtensionPropertyDefinition.Utils.getPropertyId(NAMESPACE_PROVIDER, "global-temp-table"); //$NON-NLS-1$ + String ALLOW_MATVIEW_MANAGEMENT = ModelExtensionPropertyDefinition.Utils.getPropertyId(NAMESPACE_PROVIDER, "ALLOW_MATVIEW_MANAGEMENT"); //$NON-NLS-1$ + String MATVIEW_STATUS_TABLE = ModelExtensionPropertyDefinition.Utils.getPropertyId(NAMESPACE_PROVIDER, "MATVIEW_STATUS_TABLE"); //$NON-NLS-1$ + String MATVIEW_BEFORE_LOAD_SCRIPT = ModelExtensionPropertyDefinition.Utils.getPropertyId(NAMESPACE_PROVIDER, "MATVIEW_BEFORE_LOAD_SCRIPT"); //$NON-NLS-1$ + String MATVIEW_LOAD_SCRIPT = ModelExtensionPropertyDefinition.Utils.getPropertyId(NAMESPACE_PROVIDER, "MATVIEW_LOAD_SCRIPT"); //$NON-NLS-1$ + String MATVIEW_AFTER_LOAD_SCRIPT = ModelExtensionPropertyDefinition.Utils.getPropertyId(NAMESPACE_PROVIDER, "MATVIEW_AFTER_LOAD_SCRIPT"); //$NON-NLS-1$ + String MATVIEW_SHARE_SCOPE = ModelExtensionPropertyDefinition.Utils.getPropertyId(NAMESPACE_PROVIDER, "MATVIEW_SHARE_SCOPE"); //$NON-NLS-1$ + String MATERIALIZED_STAGE_TABLE = ModelExtensionPropertyDefinition.Utils.getPropertyId(NAMESPACE_PROVIDER, "MATERIALIZED_STAGE_TABLE"); //$NON-NLS-1$ + String ON_VDB_START_SCRIPT = ModelExtensionPropertyDefinition.Utils.getPropertyId(NAMESPACE_PROVIDER, "ON_VDB_START_SCRIPT"); //$NON-NLS-1$ + String ON_VDB_DROP_SCRIPT = ModelExtensionPropertyDefinition.Utils.getPropertyId(NAMESPACE_PROVIDER, "ON_VDB_DROP_SCRIPT"); //$NON-NLS-1$ + String MATVIEW_ONERROR_ACTION = ModelExtensionPropertyDefinition.Utils.getPropertyId(NAMESPACE_PROVIDER, "MATVIEW_ONERROR_ACTION"); //$NON-NLS-1$ + String MATVIEW_TTL = ModelExtensionPropertyDefinition.Utils.getPropertyId(NAMESPACE_PROVIDER, "MATVIEW_TTL"); //$NON-NLS-1$ } interface PropertyKeysNoPrefix { @@ -80,7 +91,17 @@ interface PropertyKeysNoPrefix { String ALLOW_JOIN = "allow-join"; //$NON-NLS-1$ String NATIVE_TYPE = "native_type"; //$NON-NLS-1$ String GLOBAL_TEMP_TABLE = "global-temp-table"; //$NON-NLS-1$ - + String ALLOW_MATVIEW_MANAGEMENT = "ALLOW_MATVIEW_MANAGEMENT"; //$NON-NLS-1$ + String MATVIEW_STATUS_TABLE = "MATVIEW_STATUS_TABLE"; //$NON-NLS-1$ + String MATVIEW_BEFORE_LOAD_SCRIPT = "MATVIEW_BEFORE_LOAD_SCRIPT"; //$NON-NLS-1$ + String MATVIEW_LOAD_SCRIPT = "MATVIEW_LOAD_SCRIPT"; //$NON-NLS-1$ + String MATVIEW_AFTER_LOAD_SCRIPT = "MATVIEW_AFTER_LOAD_SCRIPT"; //$NON-NLS-1$ + String MATVIEW_SHARE_SCOPE = "MATVIEW_SHARE_SCOPE"; //$NON-NLS-1$ + String MATERIALIZED_STAGE_TABLE = "MATERIALIZED_STAGE_TABLE"; //$NON-NLS-1$ + String ON_VDB_START_SCRIPT = "ON_VDB_START_SCRIPT"; //$NON-NLS-1$ + String ON_VDB_DROP_SCRIPT = "ON_VDB_DROP_SCRIPT"; //$NON-NLS-1$ + String MATVIEW_ONERROR_ACTION = "MATVIEW_ONERROR_ACTION"; //$NON-NLS-1$ + String MATVIEW_TTL = "MATVIEW_TTL"; //$NON-NLS-1$ } } \ No newline at end of file diff --git a/plugins/org.teiid.designer.metamodels.relational/src/org/teiid/designer/metamodels/relational/extension/RestModelExtensionAssistant.java b/plugins/org.teiid.designer.metamodels.relational/src/org/teiid/designer/metamodels/relational/extension/RestModelExtensionAssistant.java index 43ee58152a..ba46182983 100644 --- a/plugins/org.teiid.designer.metamodels.relational/src/org/teiid/designer/metamodels/relational/extension/RestModelExtensionAssistant.java +++ b/plugins/org.teiid.designer.metamodels.relational/src/org/teiid/designer/metamodels/relational/extension/RestModelExtensionAssistant.java @@ -65,7 +65,16 @@ protected ModelExtensionPropertyDefinition getPropertyDefinition(final Object mo if (propDefn != null) { // must be procedure in a virtual model if ((modelObject instanceof Procedure) && ModelUtil.isVirtual(modelObject)) { - if (PropertyIds.REST_METHOD.equals(propId) || PropertyIds.URI.equals(propId) || PropertyIds.CHARSET.equals(propId) || PropertyIds.HEADERS.equals(propId) || PropertyIds.DESCRIPTION.equals(propId)) { + boolean isFunction = false; + if( modelObject instanceof Procedure ) { + isFunction = ((Procedure)modelObject).isFunction(); + } + if ( !isFunction && + (PropertyIds.REST_METHOD.equals(propId) || + PropertyIds.URI.equals(propId) || + PropertyIds.CHARSET.equals(propId) || + PropertyIds.HEADERS.equals(propId) || + PropertyIds.DESCRIPTION.equals(propId))) { return propDefn; } } diff --git a/plugins/org.teiid.designer.metamodels.transformation/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.metamodels.transformation/META-INF/MANIFEST.MF index e750d5cb47..d908029d40 100644 --- a/plugins/org.teiid.designer.metamodels.transformation/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.metamodels.transformation/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.metamodels.transformation;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.metamodels.transformation.TransformationPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.metamodels.transformation/pom.xml b/plugins/org.teiid.designer.metamodels.transformation/pom.xml index a063798a25..878e986773 100644 --- a/plugins/org.teiid.designer.metamodels.transformation/pom.xml +++ b/plugins/org.teiid.designer.metamodels.transformation/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.metamodels.transformation - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.metamodels.webservice/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.metamodels.webservice/META-INF/MANIFEST.MF index b5140ebbe7..383f0f3aca 100644 --- a/plugins/org.teiid.designer.metamodels.webservice/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.metamodels.webservice/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.metamodels.webservice;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.metamodels.webservice.WebServiceMetamodelPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.metamodels.webservice/pom.xml b/plugins/org.teiid.designer.metamodels.webservice/pom.xml index b4b75f2659..1bb01938be 100644 --- a/plugins/org.teiid.designer.metamodels.webservice/pom.xml +++ b/plugins/org.teiid.designer.metamodels.webservice/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.metamodels.webservice - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.metamodels.wsdl/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.metamodels.wsdl/META-INF/MANIFEST.MF index d8c05757e7..ddd03bb35a 100644 --- a/plugins/org.teiid.designer.metamodels.wsdl/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.metamodels.wsdl/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.metamodels.wsdl;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.metamodels.wsdl.WsdlMetamodelPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.metamodels.wsdl/pom.xml b/plugins/org.teiid.designer.metamodels.wsdl/pom.xml index e3bdb5a3f2..96bde42565 100644 --- a/plugins/org.teiid.designer.metamodels.wsdl/pom.xml +++ b/plugins/org.teiid.designer.metamodels.wsdl/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.metamodels.wsdl - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.metamodels.xml/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.metamodels.xml/META-INF/MANIFEST.MF index b6c355c87b..6b4f94410b 100644 --- a/plugins/org.teiid.designer.metamodels.xml/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.metamodels.xml/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.metamodels.xml;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.metamodels.xml.XmlDocumentPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.metamodels.xml/pom.xml b/plugins/org.teiid.designer.metamodels.xml/pom.xml index 5b05eb297f..bedc129510 100644 --- a/plugins/org.teiid.designer.metamodels.xml/pom.xml +++ b/plugins/org.teiid.designer.metamodels.xml/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.metamodels.xml - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.metamodels.xsd.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.metamodels.xsd.ui/META-INF/MANIFEST.MF index bf95bb7291..d5e921bc08 100644 --- a/plugins/org.teiid.designer.metamodels.xsd.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.metamodels.xsd.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.metamodels.xsd.ui -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.metamodels.xsd.ui.XsdUiPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.metamodels.xsd.ui/pom.xml b/plugins/org.teiid.designer.metamodels.xsd.ui/pom.xml index ee2be59ef3..a8f6ddd3a4 100644 --- a/plugins/org.teiid.designer.metamodels.xsd.ui/pom.xml +++ b/plugins/org.teiid.designer.metamodels.xsd.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.metamodels.xsd.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.metamodels.xsd/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.metamodels.xsd/META-INF/MANIFEST.MF index 9ec56f34f4..77a4f29014 100644 --- a/plugins/org.teiid.designer.metamodels.xsd/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.metamodels.xsd/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.metamodels.xsd;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.metamodels.xsd.XsdPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.metamodels.xsd/pom.xml b/plugins/org.teiid.designer.metamodels.xsd/pom.xml index 108d02a511..0cb0e85826 100644 --- a/plugins/org.teiid.designer.metamodels.xsd/pom.xml +++ b/plugins/org.teiid.designer.metamodels.xsd/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.metamodels.xsd - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.modelgenerator.ldap.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.modelgenerator.ldap.ui/META-INF/MANIFEST.MF index c1c1fc7772..5af365fe4e 100644 --- a/plugins/org.teiid.designer.modelgenerator.ldap.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.modelgenerator.ldap.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.modelgenerator.ldap.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %pluginProvider Bundle-Activator: org.teiid.designer.modelgenerator.ldap.ui.ModelGeneratorLdapUiPlugin Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.modelgenerator.ldap.ui/pom.xml b/plugins/org.teiid.designer.modelgenerator.ldap.ui/pom.xml index c6df9adcad..eb97f76ca0 100644 --- a/plugins/org.teiid.designer.modelgenerator.ldap.ui/pom.xml +++ b/plugins/org.teiid.designer.modelgenerator.ldap.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.modelgenerator.ldap.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.modelgenerator.salesforce.lib/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.modelgenerator.salesforce.lib/META-INF/MANIFEST.MF index 887e8149be..749e92796a 100644 --- a/plugins/org.teiid.designer.modelgenerator.salesforce.lib/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.modelgenerator.salesforce.lib/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.modelgenerator.salesforce.lib;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Vendor: %pluginProvider Bundle-Localization: plugin Bundle-ActivationPolicy: lazy diff --git a/plugins/org.teiid.designer.modelgenerator.salesforce.lib/pom.xml b/plugins/org.teiid.designer.modelgenerator.salesforce.lib/pom.xml index fe9b806d22..12d1e20089 100644 --- a/plugins/org.teiid.designer.modelgenerator.salesforce.lib/pom.xml +++ b/plugins/org.teiid.designer.modelgenerator.salesforce.lib/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.modelgenerator.salesforce.lib - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin 8.4.0.Final diff --git a/plugins/org.teiid.designer.modelgenerator.salesforce.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.modelgenerator.salesforce.ui/META-INF/MANIFEST.MF index 527c83a58e..aef2583d98 100644 --- a/plugins/org.teiid.designer.modelgenerator.salesforce.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.modelgenerator.salesforce.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.modelgenerator.salesforce.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.modelgenerator.salesforce.ui.Activator Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.modelgenerator.salesforce.ui/pom.xml b/plugins/org.teiid.designer.modelgenerator.salesforce.ui/pom.xml index cfee206e1f..ab06c49e32 100644 --- a/plugins/org.teiid.designer.modelgenerator.salesforce.ui/pom.xml +++ b/plugins/org.teiid.designer.modelgenerator.salesforce.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.modelgenerator.salesforce.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.modelgenerator.salesforce/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.modelgenerator.salesforce/META-INF/MANIFEST.MF index 25178c0d60..98ad644e5b 100644 --- a/plugins/org.teiid.designer.modelgenerator.salesforce/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.modelgenerator.salesforce/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.modelgenerator.salesforce;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.modelgenerator.salesforce.Activator Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.modelgenerator.salesforce/pom.xml b/plugins/org.teiid.designer.modelgenerator.salesforce/pom.xml index 8ed7f3f568..5d59853a16 100644 --- a/plugins/org.teiid.designer.modelgenerator.salesforce/pom.xml +++ b/plugins/org.teiid.designer.modelgenerator.salesforce/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.modelgenerator.salesforce - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin 8.4.0.Final diff --git a/plugins/org.teiid.designer.modelgenerator.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.modelgenerator.ui/META-INF/MANIFEST.MF index f79c6df7ba..69434f4336 100644 --- a/plugins/org.teiid.designer.modelgenerator.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.modelgenerator.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.modelgenerator.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.modelgenerator.ui.ModelerModelGeneratorUiPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.modelgenerator.ui/pom.xml b/plugins/org.teiid.designer.modelgenerator.ui/pom.xml index ccd32b70e0..e9e8774640 100644 --- a/plugins/org.teiid.designer.modelgenerator.ui/pom.xml +++ b/plugins/org.teiid.designer.modelgenerator.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.modelgenerator.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.modelgenerator.wsdl.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.modelgenerator.wsdl.ui/META-INF/MANIFEST.MF index a8432edaad..53b4280709 100644 --- a/plugins/org.teiid.designer.modelgenerator.wsdl.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.modelgenerator.wsdl.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.modelgenerator.wsdl.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.modelgenerator.wsdl.ui.ModelGeneratorWsdlUiPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.modelgenerator.wsdl.ui/pom.xml b/plugins/org.teiid.designer.modelgenerator.wsdl.ui/pom.xml index a24bdc3c43..e3c61308bb 100644 --- a/plugins/org.teiid.designer.modelgenerator.wsdl.ui/pom.xml +++ b/plugins/org.teiid.designer.modelgenerator.wsdl.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.modelgenerator.wsdl.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.modelgenerator.wsdl/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.modelgenerator.wsdl/META-INF/MANIFEST.MF index 31334cd92f..a83aa57df2 100644 --- a/plugins/org.teiid.designer.modelgenerator.wsdl/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.modelgenerator.wsdl/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.modelgenerator.wsdl;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.modelgenerator.wsdl.ModelGeneratorWsdlPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.modelgenerator.wsdl/pom.xml b/plugins/org.teiid.designer.modelgenerator.wsdl/pom.xml index 780033cc32..04e018a90c 100644 --- a/plugins/org.teiid.designer.modelgenerator.wsdl/pom.xml +++ b/plugins/org.teiid.designer.modelgenerator.wsdl/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.modelgenerator.wsdl - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.modelgenerator.xml/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.modelgenerator.xml/META-INF/MANIFEST.MF index 889ed96cfb..a2b94a0449 100644 --- a/plugins/org.teiid.designer.modelgenerator.xml/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.modelgenerator.xml/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.modelgenerator.xml;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.modelgenerator.xml.XmlImporterUiPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.modelgenerator.xml/pom.xml b/plugins/org.teiid.designer.modelgenerator.xml/pom.xml index 17e0149c1e..a65f437fef 100644 --- a/plugins/org.teiid.designer.modelgenerator.xml/pom.xml +++ b/plugins/org.teiid.designer.modelgenerator.xml/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.modelgenerator.xml - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.modelgenerator/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.modelgenerator/META-INF/MANIFEST.MF index 534b2bcb80..4b3adc37b6 100644 --- a/plugins/org.teiid.designer.modelgenerator/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.modelgenerator/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.modelgenerator -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.modelgenerator.ModelGeneratorPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.modelgenerator/pom.xml b/plugins/org.teiid.designer.modelgenerator/pom.xml index 057ed33213..4299dd78d0 100644 --- a/plugins/org.teiid.designer.modelgenerator/pom.xml +++ b/plugins/org.teiid.designer.modelgenerator/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.modelgenerator - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.modeshape/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.modeshape/META-INF/MANIFEST.MF index 4aa13baca5..e50c84f12c 100644 --- a/plugins/org.teiid.designer.modeshape/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.modeshape/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.modeshape;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %pluginProvider Bundle-ClassPath: ., lib/modeshape-common.jar, diff --git a/plugins/org.teiid.designer.modeshape/pom.xml b/plugins/org.teiid.designer.modeshape/pom.xml index 4f5d91d399..3b3f1a6286 100644 --- a/plugins/org.teiid.designer.modeshape/pom.xml +++ b/plugins/org.teiid.designer.modeshape/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.modeshape - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin 4.4.0.Final diff --git a/plugins/org.teiid.designer.query.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.query.ui/META-INF/MANIFEST.MF index bebf385ea0..254f7c2af9 100644 --- a/plugins/org.teiid.designer.query.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.query.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.query.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.query.ui.UiPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.query.ui/pom.xml b/plugins/org.teiid.designer.query.ui/pom.xml index 84a22103a7..7385f99938 100644 --- a/plugins/org.teiid.designer.query.ui/pom.xml +++ b/plugins/org.teiid.designer.query.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.query.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.relational.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.relational.ui/META-INF/MANIFEST.MF index e3207237fa..b38fb3775b 100644 --- a/plugins/org.teiid.designer.relational.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.relational.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.relational.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.relational.ui.UiPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin @@ -35,6 +35,8 @@ Require-Bundle: org.eclipse.ui;bundle-version="[3.106.1,4.0.0)", org.eclipse.emf.ecore;bundle-version="[2.10.2,3.0.0)", org.teiid.designer.relational;bundle-version="[9.0.2,10.0.0)", org.teiid.designer.legacy;bundle-version="[9.0.2,10.0.0)", - org.teiid.designer.spi;bundle-version="[9.0.2,10.0.0)" + org.teiid.designer.spi;bundle-version="[9.0.2,10.0.0)", + org.teiid.designer.extension;bundle-version="[9.0.2,10.0.0)", + org.teiid.designer.extension.ui;bundle-version="[9.0.2,10.0.0)" Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/plugins/org.teiid.designer.relational.ui/plugin.xml b/plugins/org.teiid.designer.relational.ui/plugin.xml index cb5cbad4e2..f391b3dfa8 100644 --- a/plugins/org.teiid.designer.relational.ui/plugin.xml +++ b/plugins/org.teiid.designer.relational.ui/plugin.xml @@ -123,4 +123,19 @@ name="org.teiid.designer.relational.ui.actions.CreateRelationalIndexAction"> + + + + + + + + + + + diff --git a/plugins/org.teiid.designer.relational.ui/pom.xml b/plugins/org.teiid.designer.relational.ui/pom.xml index 5890dd3c8c..2693f5367b 100644 --- a/plugins/org.teiid.designer.relational.ui/pom.xml +++ b/plugins/org.teiid.designer.relational.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.relational.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/Messages.java b/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/Messages.java index 5a6cf227df..aaf021bd39 100644 --- a/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/Messages.java +++ b/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/Messages.java @@ -87,6 +87,7 @@ public class Messages extends NLS { public static String primaryKeyLabel; public static String columnsLabel; public static String uniqueConstraintLabel; + public static String uniqueConstraintsLabel; public static String columnNameLabel; public static String parameterNameLabel; public static String dataTypeLabel; @@ -134,7 +135,20 @@ public class Messages extends NLS { public static String createIndexTitle; public static String editIndexTitle; public static String includeResultSetTooltip; - + public static String createUniqueConstraintTitle; + public static String editUniqueConstraintTitle; + + public static String upgradeRelationalExtensionsLabel; + public static String quickFixMedFileDirtyTitle; + public static String quickFixMedFileDirtyMsg; + public static String quickFixModelDirtyTitle; + public static String quickFixModelDirtyMsg; + public static String medFileParseErrorMsg; + public static String getSupportedPrefixesErrorMsg; + public static String getModelMedErrorMsg; + public static String saveModelMedErrorMsg; + public static String saveModelErrorMsg; + static { NLS.initializeMessages("org.teiid.designer.relational.ui.messages", Messages.class); //$NON-NLS-1$ } diff --git a/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/UiConstants.java b/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/UiConstants.java index 8ab2d38f60..545019823d 100644 --- a/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/UiConstants.java +++ b/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/UiConstants.java @@ -8,6 +8,7 @@ package org.teiid.designer.relational.ui; import java.util.ResourceBundle; + import org.teiid.core.designer.PluginUtil; import org.teiid.core.designer.util.PluginUtilImpl; @@ -108,4 +109,8 @@ interface Images extends org.teiid.designer.ui.common.UiConstants.Images { * @since 4.0 */ PluginUtil Util = new PluginUtilImpl(PLUGIN_ID, PC.I18N_NAME, ResourceBundle.getBundle(PC.I18N_NAME)); + + interface ExtensionIds { + String MED_PROBLEM_MARKER = PLUGIN_ID + ".medMarker"; //$NON-NLS-1$"; + } } diff --git a/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/edit/EditUniqueConstraintDialog.java b/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/edit/EditUniqueConstraintDialog.java new file mode 100644 index 0000000000..8d888cff76 --- /dev/null +++ b/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/edit/EditUniqueConstraintDialog.java @@ -0,0 +1,431 @@ +/* + * JBoss, Home of Professional Open Source. + * + * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing. + * + * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors. + */ +package org.teiid.designer.relational.ui.edit; + +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.IMessageProvider; +import org.eclipse.jface.dialogs.TitleAreaDialog; +import org.eclipse.jface.viewers.ColumnLabelProvider; +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.jface.viewers.TableLayout; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.swt.SWT; +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.graphics.Image; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableItem; +import org.eclipse.swt.widgets.Text; +import org.teiid.designer.relational.model.RelationalColumn; +import org.teiid.designer.relational.model.RelationalTable; +import org.teiid.designer.relational.model.RelationalUniqueConstraint; +import org.teiid.designer.relational.ui.Messages; +import org.teiid.designer.relational.ui.UiConstants; +import org.teiid.designer.relational.ui.UiPlugin; +import org.teiid.designer.ui.common.UILabelUtil; +import org.teiid.designer.ui.common.UiLabelConstants; +import org.teiid.designer.ui.common.text.StyledTextEditor; +import org.teiid.designer.ui.common.util.WidgetFactory; + +/** + * + */ +public class EditUniqueConstraintDialog extends TitleAreaDialog { + private static final String EMPTY_STRING = ""; //$NON-NLS-1$ + + private final String CREATE_TITLE = Messages.createUniqueConstraintTitle; + private final String EDIT_TITLE = Messages.editUniqueConstraintTitle; + + // ============================================================= + // Instance variables + // ============================================================= + RelationalUniqueConstraint originalConstraint; + RelationalUniqueConstraint editedConstraint; + RelationalTable theTable; + + String selectedTableName; +// String selectedConstraintName; + + StyledTextEditor descriptionTextEditor; + + TableViewer theColumnDataViewer; + + Set selectedColumns = new HashSet(); + + boolean isEdit; + + boolean creatingContents = false; + boolean processingChecks = false; + + // ============================================================= + // Constructors + // ============================================================= + + /** + * + * @param parent the parent shell + * @param theTable the relational table object + * @param index the index being edited + * @param isEdit edit mode + */ + public EditUniqueConstraintDialog(Shell parent, RelationalTable theTable, RelationalUniqueConstraint index, boolean isEdit) { + super(parent); + this.theTable = theTable; + this.isEdit = isEdit; + boolean reallyIsEdit = isEdit; + this.originalConstraint = index; + if (reallyIsEdit) { + this.editedConstraint = this.originalConstraint.clone(); + } + if (!reallyIsEdit) { + this.editedConstraint = index; + } + } + + @Override + protected void configureShell(Shell shell) { + super.configureShell(shell); + if (isEdit) { + shell.setText(EDIT_TITLE); + } else { + shell.setText(CREATE_TITLE); + } + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.window.Window#setShellStyle(int) + */ + @Override + protected void setShellStyle(int newShellStyle) { + super.setShellStyle(newShellStyle | SWT.RESIZE | SWT.MAX); + + } + + // ============================================================= + // Instance methods + // ============================================================= + + @SuppressWarnings("unused") + @Override + protected Control createDialogArea(Composite parent) { + creatingContents = true; + if (isEdit) { + setTitle(EDIT_TITLE); + } else { + setTitle(CREATE_TITLE); + } + + Composite dialogComposite = (Composite) super.createDialogArea(parent); + + Composite composite = WidgetFactory.createPanel(dialogComposite); + // ------------------------------ + // Set layout for the Composite + // ------------------------------ + GridLayout gridLayout = new GridLayout(); + composite.setLayout(gridLayout); + gridLayout.numColumns = 2; + GridData gridData = new GridData(GridData.FILL_BOTH); + gridData.grabExcessHorizontalSpace = true; + gridData.widthHint = 500; + composite.setLayoutData(gridData); + + Label label = new Label(composite, SWT.NONE | SWT.RIGHT); + label.setText(UILabelUtil.getLabel(UiLabelConstants.LABEL_IDS.NAME)); + label.setLayoutData(new GridData()); + + final Text indexNameText = new Text(composite, SWT.BORDER | SWT.SINGLE); + indexNameText.setForeground(Display.getCurrent().getSystemColor( + SWT.COLOR_DARK_BLUE)); + indexNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + indexNameText.addModifyListener(new ModifyListener() { + @Override + public void modifyText(final ModifyEvent event) { + String value = indexNameText.getText(); + if (value == null) { + value = EMPTY_STRING; + } + editedConstraint.setName(value); + validate(); + } + }); + + label = new Label(composite, SWT.NONE | SWT.RIGHT); + label.setText(Messages.nameInSourceLabel); + label.setLayoutData(new GridData()); + + final Text indexNISText = new Text(composite, SWT.BORDER | SWT.SINGLE); + indexNISText.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE)); + indexNISText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + indexNISText.addModifyListener(new ModifyListener() { + @Override + public void modifyText(final ModifyEvent event) { + String value = indexNISText.getText(); + if (value == null) { + value = EMPTY_STRING; + } + editedConstraint.setNameInSource(value); + validate(); + } + }); + + Group theColumnsGroup = WidgetFactory.createGroup(dialogComposite, Messages.selectColumnReferencesForIndex, SWT.NONE, 1, 1); + GridData gd = new GridData(GridData.FILL_BOTH); + gd.heightHint = 120; + gd.widthHint = 500; + theColumnsGroup.setLayoutData(gd); + + Table tableWidget = new Table(theColumnsGroup, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.CHECK); + tableWidget.setHeaderVisible(false); + tableWidget.setLinesVisible(true); + tableWidget.setLayout(new TableLayout()); + tableWidget.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + + theColumnDataViewer = new TableViewer(tableWidget); + gd = new GridData(GridData.FILL_BOTH); + gd.heightHint = 160; + gd.horizontalSpan = 2; + theColumnDataViewer.getControl().setLayoutData(gd); + theColumnDataViewer.setContentProvider(new ITreeContentProvider() { + + @Override + public void inputChanged(Viewer viewer, Object oldInput, + Object newInput) { + // TODO Auto-generated method stub + } + + @Override + public void dispose() { + // TODO Auto-generated method stub + } + + @Override + public boolean hasChildren(Object element) { + return !theTable.getColumns().isEmpty(); + } + + @Override + public Object getParent(Object element) { + return null; + } + + @Override + public Object[] getElements(Object inputElement) { + if (inputElement instanceof RelationalTable) { + return theTable.getColumns().toArray(new Object[0]); + } + return new Object[0]; + } + + @Override + public Object[] getChildren(Object parentElement) { + // TODO Auto-generated method stub + return new Object[0]; + } + }); + + this.theColumnDataViewer.getTable().addSelectionListener( + new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + editedConstraint.getColumns().clear(); + for (TableItem item : theColumnDataViewer.getTable() + .getItems()) { + + if (item.getChecked()) { + editedConstraint.addColumn((RelationalColumn) item + .getData()); + } + } + validate(); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + + theColumnDataViewer.setLabelProvider(new ColumnDataLabelProvider(0)); + + theColumnDataViewer.setInput(this.theTable); + + for (RelationalColumn col : this.editedConstraint.getColumns()) { + for (TableItem item : theColumnDataViewer.getTable().getItems()) { + if (item.getData() == col) { + item.setChecked(true); + } + } + } + + DESCRIPTION_GROUP: { + final Group descGroup = WidgetFactory.createGroup(dialogComposite, UILabelUtil.getLabel(UiLabelConstants.LABEL_IDS.DESCRIPTION), GridData.FILL_BOTH, 3); + descriptionTextEditor = new StyledTextEditor(descGroup, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.WRAP | SWT.BORDER); + final GridData descGridData = new GridData(GridData.FILL_BOTH); + descGridData.horizontalSpan = 1; + descGridData.heightHint = 120; +// descGridData.minimumHeight = 30; + descGridData.grabExcessVerticalSpace = true; + descriptionTextEditor.setLayoutData(descGridData); + descriptionTextEditor.setText(""); //$NON-NLS-1$ + descriptionTextEditor.getTextWidget().addModifyListener(new ModifyListener() { + + @Override + public void modifyText(ModifyEvent e) { + editedConstraint.setDescription(descriptionTextEditor.getText()); + } + }); + } + + setMessage(Messages.newIndexMessage); + if (editedConstraint.getName() != null) { + indexNameText.setText(editedConstraint.getName()); + } + if (editedConstraint.getNameInSource() != null) { + indexNISText.setText(editedConstraint.getNameInSource()); + } + + if( editedConstraint.getDescription() != null ) { + descriptionTextEditor.setText(editedConstraint.getDescription()); + } + + creatingContents = false; + + return composite; + } + + private void validate() { + if (creatingContents) + return; + + editedConstraint.validate(); + + boolean enable = true; + setMessage(Messages.newIndexMessage); + // ONLY DISABLE if NAME == null + if (editedConstraint.getName() == null || editedConstraint.getName().trim().length() == 0) { + enable = false; + setErrorMessage(editedConstraint.getStatus().getMessage()); + } else { + if (editedConstraint.getStatus().getSeverity() < IStatus.ERROR) { + setErrorMessage(null); + } else if (editedConstraint.getStatus().getSeverity() == IStatus.WARNING) { + setMessage(editedConstraint.getStatus().getMessage(), IMessageProvider.WARNING); + } else if (editedConstraint.getStatus().getSeverity() == IStatus.ERROR) { + setErrorMessage(editedConstraint.getStatus().getMessage()); + } + } + + getButton(IDialogConstants.OK_ID).setEnabled(enable); + } + + @Override + public void create() { + super.create(); + getButton(IDialogConstants.OK_ID).setEnabled(true); + } + + @Override + protected void okPressed() { + if (isEdit) { + this.originalConstraint.inject(editedConstraint); + } + + super.okPressed(); + } + + /** + * @return the table name + */ + public String getTableName() { + return this.selectedTableName; + } + +// /** +// * @return the index name +// */ +// public String getIndexName() { +// return this.selectedIndexName; +// } + + class ColumnDataLabelProvider extends ColumnLabelProvider { + + private final int columnNumber; + + public ColumnDataLabelProvider(int columnNumber) { + this.columnNumber = columnNumber; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.jface.viewers.ColumnLabelProvider#getText(java.lang.Object) + */ + @Override + public String getText(Object element) { + if (element instanceof RelationalColumn) { + switch (this.columnNumber) { + case 0: { + return ((RelationalColumn) element).getName(); + } + case 1: { + return ((RelationalColumn) element).getDatatype(); + } + case 2: { + return Integer.toString(((RelationalColumn) element).getLength()); + } + } + } + return EMPTY_STRING; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.jface.viewers.CellLabelProvider#getToolTipText(java.lang.Object) + */ + @Override + public String getToolTipText(Object element) { + switch (this.columnNumber) { + case 0: { + return "Tooltip 1"; //getString("columnNameColumnTooltip"); //$NON-NLS-1$ + } + case 1: { + return "Tooltip 2"; //getString("datatypeColumnTooltip"); //$NON-NLS-1$ + } + } + return "unknown tooltip"; //$NON-NLS-1$ + } + + @Override + public Image getImage(Object element) { + if (this.columnNumber == 0) { + return UiPlugin.getDefault().getImage(UiConstants.Images.COLUMN_ICON); + } + return null; + } + + } + +} diff --git a/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/edit/RelationalTableEditorPanel.java b/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/edit/RelationalTableEditorPanel.java index 00a6f6a7ae..0197393188 100644 --- a/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/edit/RelationalTableEditorPanel.java +++ b/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/edit/RelationalTableEditorPanel.java @@ -107,10 +107,11 @@ public class RelationalTableEditorPanel extends RelationalEditorPanel implements // column widgets private Button addColumnButton, deleteColumnButton, upColumnButton, downColumnButton; private Button changePkColumnsButton, changeUcColumnsButton, addFKButton, editFKButton, deleteFKButton; + private Button addUCButton, editUCButton, deleteUCButton; private Button addIndexButton, deleteIndexButton, editIndexButton; private TableViewerBuilder columnsViewer; - private TableViewerBuilder pkColumnsViewer, ucColumnsViewer, fkViewer; - private TableViewerBuilder indexesViewer; + private TableViewerBuilder pkColumnsViewer, fkViewer; //ucColumnsViewer, + private TableViewerBuilder uniqueConstraintsViewer, indexesViewer; private boolean finishedStartup = false; private boolean validationPerformed = false; @@ -384,42 +385,19 @@ private void synchronizeUniqueConstraintTab() { if (uniqueConstraintTab == null) return; - if( getRelationalReference().getUniqueContraint() == null ) { - if( WidgetUtil.widgetValueChanged(includeUniqueConstraintCB, false)) { - this.includeUniqueConstraintCB.setSelection(false); - } - this.uniqueConstraintNameText.setEnabled(false); - if( WidgetUtil.widgetValueChanged(uniqueConstraintNameText, EMPTY_STRING)) { - this.uniqueConstraintNameText.setText(EMPTY_STRING); - } - this.uniqueConstraintNISText.setEnabled(false); - if( WidgetUtil.widgetValueChanged(uniqueConstraintNISText, EMPTY_STRING)) { - this.uniqueConstraintNISText.setText(EMPTY_STRING); - } - this.changeUcColumnsButton.setEnabled(false); - this.ucColumnsViewer.getTable().removeAll(); - this.ucColumnsViewer.getTable().setEnabled(false); + if( getRelationalReference().getUniqueConstraints().isEmpty() ) { + this.uniqueConstraintsViewer.getTable().removeAll(); + this.uniqueConstraintsViewer.getTable().setEnabled(false); } else { - this.ucColumnsViewer.getTable().setEnabled(true); - if( WidgetUtil.widgetValueChanged(includeUniqueConstraintCB, true)) { - this.includeUniqueConstraintCB.setSelection(true); - } - this.uniqueConstraintNameText.setEnabled(true); - if( getRelationalReference().getUniqueContraint().getName() != null && WidgetUtil.widgetValueChanged(uniqueConstraintNameText, getRelationalReference().getUniqueContraint().getName())) { - this.uniqueConstraintNameText.setText(getRelationalReference().getUniqueContraint().getName()); - } - this.uniqueConstraintNISText.setEnabled(true); - if( getRelationalReference().getUniqueContraint().getNameInSource() != null && WidgetUtil.widgetValueChanged(uniqueConstraintNISText, getRelationalReference().getUniqueContraint().getNameInSource())) { - this.uniqueConstraintNISText.setText(getRelationalReference().getUniqueContraint().getName()); - } + this.uniqueConstraintsViewer.getTable().setEnabled(true); - this.ucColumnsViewer.getTable().removeAll(); - if( !getRelationalReference().getUniqueContraint().getColumns().isEmpty() ) { - for( RelationalColumn column : getRelationalReference().getUniqueContraint().getColumns() ) { - this.ucColumnsViewer.add(column); + this.uniqueConstraintsViewer.getTable().removeAll(); + if( !getRelationalReference().getUniqueConstraints().isEmpty() ) { + for( RelationalUniqueConstraint column : getRelationalReference().getUniqueConstraints() ) { + this.uniqueConstraintsViewer.add(column); } } - this.changeUcColumnsButton.setEnabled(true); + uniqueConstraintTab.setImage(RelationalUiUtil.getRelationalImage(TYPES.UC, getRelationalReference().getModelType(), getRelationalReference().getUniqueContraint().getStatus())); } } @@ -475,14 +453,16 @@ private void setNativeQueryEnablement(boolean enable) { } private void setKeyTabsEnablement(boolean enable) { -// addFKButton.setEnabled(enable); -// editFKButton.setEnabled(enable); -// deleteFKButton.setEnabled(enable); -// includePrimaryKeyCB.setEnabled(enable); -// includeUniqueConstraintCB.setEnabled(enable); -// addIndexButton.setEnabled(enable); -// editIndexButton.setEnabled(enable); -// deleteIndexButton.setEnabled(enable); + addFKButton.setEnabled(enable); + editFKButton.setEnabled(enable); + deleteFKButton.setEnabled(enable); + includePrimaryKeyCB.setEnabled(enable); + addUCButton.setEnabled(enable); + editUCButton.setEnabled(enable); + deleteUCButton.setEnabled(enable); + addIndexButton.setEnabled(enable); + editIndexButton.setEnabled(enable); + deleteIndexButton.setEnabled(enable); } private Composite createPropertiesPanel(Composite parent) { @@ -734,8 +714,11 @@ public void widgetSelected(SelectionEvent e) { } private Composite createUniqueConstraintPanel(Composite parent) { + // TODO: This panel needs to operate like the Foreign Key panel to allow multiple Unique Constraints + // These constraints will behave just like Primary Keys so they won't need to referenced external columns/tables + Composite thePanel = WidgetFactory.createPanel(parent, SWT.NONE, 1, 2); - GridLayoutFactory.fillDefaults().numColumns(2).margins(10, 10).applyTo(thePanel); + GridLayoutFactory.fillDefaults().margins(10, 10).applyTo(thePanel); GridDataFactory.fillDefaults().grab(true, true).applyTo(thePanel); if(isRelationalView()) { @@ -745,116 +728,102 @@ private Composite createUniqueConstraintPanel(Composite parent) { GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).hint(250, HEIGHT_HINT_80).span(2, 1).applyTo(ucHelpText); ucHelpText.setText(Messages.uniqueConstraintsNotSupportedForViews); } - - this.includeUniqueConstraintCB = new Button(thePanel, SWT.CHECK | SWT.RIGHT); - GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).span(2, 1).applyTo(this.includeUniqueConstraintCB); - this.includeUniqueConstraintCB.setText(UILabelUtil.getLabel(UiLabelConstants.LABEL_IDS.INCLUDE)); - this.includeUniqueConstraintCB.addSelectionListener(new SelectionAdapter() { - /** - * {@inheritDoc} - * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent) - */ - @Override - public void widgetSelected( SelectionEvent e ) { - if( includeUniqueConstraintCB.getSelection() ) { - if( getRelationalReference().getUniqueContraint() == null ) { - RelationalUniqueConstraint key = new RelationalUniqueConstraint(); - if( uniqueConstraintNameText.getText() != null ) { - key.setName(uniqueConstraintNameText.getText()); - } - getRelationalReference().setUniqueConstraint(key); - } - } else { - getRelationalReference().setUniqueConstraint(null); - } - handleInfoChanged(); - } - }); - - Label label = new Label(thePanel, SWT.NONE | SWT.RIGHT); - label.setText(UILabelUtil.getLabel(UiLabelConstants.LABEL_IDS.NAME)); - GridDataFactory.fillDefaults().applyTo(label); - this.uniqueConstraintNameText = new Text(thePanel, SWT.BORDER | SWT.SINGLE); - this.uniqueConstraintNameText.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE)); - GridDataFactory.fillDefaults().applyTo(this.uniqueConstraintNameText); - this.uniqueConstraintNameText.addModifyListener(new ModifyListener() { - @Override - public void modifyText( final ModifyEvent event ) { - String value = uniqueConstraintNameText.getText(); - if( value == null ) { - value = EMPTY_STRING; - } - if( getRelationalReference().getUniqueContraint() != null ) { - RelationalUniqueConstraint key = getRelationalReference().getUniqueContraint(); - key.setName(value); - } - - handleInfoChanged(); - } - }); - - label = new Label(thePanel, SWT.NONE | SWT.RIGHT); - label.setText(Messages.nameInSourceLabel); - GridDataFactory.fillDefaults().applyTo(label); - - this.uniqueConstraintNISText = new Text(thePanel, SWT.BORDER | SWT.SINGLE); - this.uniqueConstraintNISText.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE)); - GridDataFactory.fillDefaults().applyTo(this.uniqueConstraintNISText); - this.uniqueConstraintNISText.addModifyListener(new ModifyListener() { - @Override - public void modifyText( final ModifyEvent event ) { - String value = uniqueConstraintNISText.getText(); - if( value == null ) { - value = EMPTY_STRING; - } - if( getRelationalReference().getUniqueContraint() != null ) { - RelationalUniqueConstraint key = getRelationalReference().getUniqueContraint(); - key.setNameInSource(value); - } - - handleInfoChanged(); - } - }); + // Create 1 panels + // Top is just a Table of current FK with Add/Edit/Delete buttons + + // Bottom panel is the "Edit - Composite buttonPanel = new Composite(thePanel, SWT.NONE); - GridLayoutFactory.fillDefaults().applyTo(buttonPanel); - GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.BEGINNING).applyTo(buttonPanel); + Composite buttonPanel = new Composite(thePanel, SWT.NONE); + GridLayoutFactory.fillDefaults().numColumns(3).applyTo(buttonPanel); + GridDataFactory.fillDefaults().grab(true, false).applyTo(buttonPanel); - this.changeUcColumnsButton = new Button(buttonPanel, SWT.PUSH); - this.changeUcColumnsButton.setText(UILabelUtil.getLabel(UiLabelConstants.LABEL_IDS.CHANGE_ELIPSIS)); - GridDataFactory.fillDefaults().applyTo(this.changeUcColumnsButton); - this.changeUcColumnsButton.addSelectionListener(new SelectionAdapter() { + this.addUCButton = new Button(buttonPanel, SWT.PUSH); + this.addUCButton.setText(UILabelUtil.getLabel(UiLabelConstants.LABEL_IDS.ADD)); + GridDataFactory.fillDefaults().applyTo(this.addUCButton); + this.addUCButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - SelectColumnsDialog dialog = new SelectColumnsDialog(getShell(), getRelationalReference(), false); + RelationalUniqueConstraint newUC = new RelationalUniqueConstraint(); + + EditUniqueConstraintDialog dialog = new EditUniqueConstraintDialog(getShell(), getRelationalReference(), newUC, false); int result = dialog.open(); if( result == Window.OK) { - Collection selectedColumns = dialog.getSelectedColumns(); - if( !selectedColumns.isEmpty() ) { - getRelationalReference().getUniqueContraint().setColumns(selectedColumns); - } else { - getRelationalReference().getUniqueContraint().setColumns(Collections. emptyList()); - } + getRelationalReference().addUniqueConstraint(newUC); } handleInfoChanged(); } }); + + this.editUCButton = new Button(buttonPanel, SWT.PUSH); + this.editUCButton.setText(UILabelUtil.getLabel(UiLabelConstants.LABEL_IDS.EDIT_ELIPSIS)); + GridDataFactory.fillDefaults().applyTo(this.editUCButton); + this.editUCButton.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + RelationalUniqueConstraint uc = null; + + IStructuredSelection selection = (IStructuredSelection)uniqueConstraintsViewer.getSelection(); + for( Object obj : selection.toArray()) { + if( obj instanceof RelationalUniqueConstraint ) { + uc = (RelationalUniqueConstraint) obj; + break; + } + } + if( uc != null ) { + + EditUniqueConstraintDialog dialog = new EditUniqueConstraintDialog(getShell(), getRelationalReference(), uc, true); + + int result = dialog.open(); + + handleInfoChanged(); + + editUCButton.setEnabled(false); + } + } + + }); + + this.deleteUCButton = new Button(buttonPanel, SWT.PUSH); + this.deleteUCButton.setText(UILabelUtil.getLabel(UiLabelConstants.LABEL_IDS.DELETE)); + GridDataFactory.fillDefaults().applyTo(this.deleteUCButton); + this.deleteUCButton.addSelectionListener(new SelectionAdapter() { - this.ucColumnsViewer = new TableViewerBuilder(thePanel, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); - GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, HEIGHT_HINT_80).applyTo(this.ucColumnsViewer.getTableComposite()); + @Override + public void widgetSelected(SelectionEvent e) { + RelationalUniqueConstraint uc= null; + + IStructuredSelection selection = (IStructuredSelection)uniqueConstraintsViewer.getSelection(); + for( Object obj : selection.toArray()) { + if( obj instanceof RelationalUniqueConstraint ) { + uc = (RelationalUniqueConstraint) obj; + break; + } + } + if( uc != null ) { + getRelationalReference().removeUniqueConstraint(uc); + deleteFKButton.setEnabled(false); + handleInfoChanged(); + } + } + + }); + + this.uniqueConstraintsViewer = new TableViewerBuilder(thePanel, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); + GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, HEIGHT_HINT_80).applyTo(this.uniqueConstraintsViewer.getTableComposite()); // create columns - TableViewerColumn column = this.ucColumnsViewer.createColumn(SWT.LEFT, 100, 40, false); - column.getColumn().setText(Messages.columnNameLabel); - column.setLabelProvider(new ColumnDataLabelProvider(0)); + TableViewerColumn column = uniqueConstraintsViewer.createColumn(SWT.LEFT, 100, 40, false); + column.getColumn().setText(Messages.uniqueConstraintsLabel); + column.setLabelProvider(new UniqueConstraintLabelProvider(0)); - if( getRelationalReference() != null && getRelationalReference().getUniqueContraint() != null ) { - for( RelationalColumn row : getRelationalReference().getUniqueContraint().getColumns() ) { - this.ucColumnsViewer.add(row); + if( getRelationalReference() != null && getRelationalReference().getUniqueConstraints() != null ) { + for( RelationalUniqueConstraint row : getRelationalReference().getUniqueConstraints() ) { + this.uniqueConstraintsViewer.add(row); } } @@ -1841,7 +1810,76 @@ public String getToolTipText(Object element) { @Override public Image getImage(Object element) { if( this.columnNumber == 0 ) { - return UiPlugin.getDefault().getImage(UiConstants.Images.COLUMN_ICON); + return UiPlugin.getDefault().getImage(UiConstants.Images.INDEX_ICON); + } + return null; + } + } + + class UniqueConstraintLabelProvider extends ColumnLabelProvider { + + private final int columnNumber; + + public UniqueConstraintLabelProvider(int columnNumber) { + this.columnNumber = columnNumber; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.jface.viewers.ColumnLabelProvider#getText(java.lang.Object) + */ + @Override + public String getText(Object element) { + if( element instanceof RelationalUniqueConstraint ) { + switch (this.columnNumber) { + case 0: { + if(element instanceof RelationalUniqueConstraint) { + RelationalUniqueConstraint index = (RelationalUniqueConstraint)element; + + String value = index.getName(); + + if(! index.getColumns().isEmpty() ) { + int i=0; + value = value + " : "; //$NON-NLS-1$ + for( RelationalColumn col : index.getColumns()) { + value += col.getName(); + i++; + if( i < index.getColumns().size()) { + value += ", "; //$NON-NLS-1$ + } + } + } + return value; + } + } + } + } + return EMPTY_STRING; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.jface.viewers.CellLabelProvider#getToolTipText(java.lang.Object) + */ + @Override + public String getToolTipText(Object element) { + switch (this.columnNumber) { + case 0: { + return "Tooltip 1"; //getString("columnNameColumnTooltip"); //$NON-NLS-1$ + } + case 1: { + return "Tooltip 2"; //getString("datatypeColumnTooltip"); //$NON-NLS-1$ + } + } + return "unknown tooltip"; //$NON-NLS-1$ + } + + @Override + public Image getImage(Object element) { + if( this.columnNumber == 0 ) { + return UiPlugin.getDefault().getImage(UiConstants.Images.UC_ICON); } return null; } diff --git a/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/extension/RelationalExtensionMarkerResolutionGenerator.java b/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/extension/RelationalExtensionMarkerResolutionGenerator.java new file mode 100644 index 0000000000..8840035525 --- /dev/null +++ b/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/extension/RelationalExtensionMarkerResolutionGenerator.java @@ -0,0 +1,23 @@ +package org.teiid.designer.relational.ui.extension; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.core.resources.IMarker; +import org.eclipse.ui.IMarkerResolution; +import org.eclipse.ui.IMarkerResolutionGenerator; + + +public class RelationalExtensionMarkerResolutionGenerator implements IMarkerResolutionGenerator { + private static final String IS_OLD_RELATIONAL_MED = "isOldRelationalMed"; //$NON-NLS-1$ + @Override + public IMarkerResolution[] getResolutions(IMarker marker) { + Collection resolutions = new ArrayList(); + + if( marker.getAttribute(IS_OLD_RELATIONAL_MED, false) ) { + resolutions.add(new RelationalExtensionVersionResolution("relational")); + } + + return resolutions.toArray(new IMarkerResolution[resolutions.size()]); + } + } \ No newline at end of file diff --git a/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/extension/RelationalExtensionVersionResolution.java b/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/extension/RelationalExtensionVersionResolution.java new file mode 100644 index 0000000000..061fa24b2b --- /dev/null +++ b/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/extension/RelationalExtensionVersionResolution.java @@ -0,0 +1,264 @@ +package org.teiid.designer.relational.ui.extension; + +import java.io.InputStream; +import java.util.Collection; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.osgi.util.NLS; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IMarkerResolution; +import org.teiid.designer.core.workspace.ModelResource; +import org.teiid.designer.extension.ExtensionPlugin; +import org.teiid.designer.extension.ModelExtensionAssistantAggregator; +import org.teiid.designer.extension.definition.ModelExtensionAssistant; +import org.teiid.designer.extension.definition.ModelExtensionDefinition; +import org.teiid.designer.extension.definition.ModelObjectExtensionAssistant; +import org.teiid.designer.metamodels.relational.extension.RelationalModelExtensionConstants; +import org.teiid.designer.metamodels.relational.extension.RestModelExtensionConstants; +import org.teiid.designer.relational.ui.Messages; +import org.teiid.designer.relational.ui.UiConstants; +import org.teiid.designer.relational.ui.UiPlugin; +import org.teiid.designer.ui.common.viewsupport.UiBusyIndicator; +import org.teiid.designer.ui.editors.ModelEditor; +import org.teiid.designer.ui.editors.ModelEditorManager; +import org.teiid.designer.ui.viewsupport.ModelUtilities; + +public class RelationalExtensionVersionResolution implements IMarkerResolution { + + private String medID; + + public RelationalExtensionVersionResolution(String medID) { + super(); + this.medID = medID; + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IMarkerResolution#getLabel() + */ + @Override + public String getLabel() { + return Messages.upgradeRelationalExtensionsLabel; + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IMarkerResolution#run(org.eclipse.core.resources.IMarker) + */ + @Override + public void run(IMarker marker) { + IResource resource = marker.getResource(); + + // Fix the Marked Model Resource + if(ModelUtilities.isModelFile(resource)) { + final IFile theFile = (IFile)resource; + + final ModelEditor editor = ModelEditorManager.getModelEditorForFile(theFile, false); + // If editor is open and dirty, ask user whether to save + if ((editor != null) && editor.isDirty()) { + boolean saveEditor = MessageDialog.openQuestion(getShell(), Messages.quickFixModelDirtyTitle, + Messages.quickFixModelDirtyMsg); + if(!saveEditor) { + return; + } else { + // Add the selected Med + UiBusyIndicator.showWhile(Display.getDefault(), new Runnable() { + @Override + public void run() { + editor.doSave(new NullProgressMonitor()); + fixModelMed(theFile); + } + }); + return; + } + } + // Add the selected Med + UiBusyIndicator.showWhile(Display.getDefault(), new Runnable() { + @Override + public void run() { + fixModelMed(theFile); + } + }); + + // Fix the Marked mxd File + } +// else if(ModelUtilities.isMedFile(resource)) { +// final IFile theFile = (IFile)resource; +// // Check whether there is currently an open editor for the selected Med +// final IEditorPart editor = UiUtil.getEditorForFile(theFile, false); +// +// // If editor is open and dirty, ask user whether to save +// if ((editor != null) && editor.isDirty()) { +// boolean saveEditor = MessageDialog.openQuestion(getShell(), Messages.quickFixMedFileDirtyTitle, +// Messages.quickFixMedFileDirtyMsg); +// if (!saveEditor) { +// return; +// } else { +// // Add the selected Med +// UiBusyIndicator.showWhile(Display.getDefault(), new Runnable() { +// @Override +// public void run() { +// editor.doSave(new NullProgressMonitor()); +// fixMedFile(theFile); +// } +// }); +// return; +// } +// +// } +// // Add the selected Med +// UiBusyIndicator.showWhile(Display.getDefault(), new Runnable() { +// @Override +// public void run() { +// fixMedFile(theFile); +// } +// }); +// } + } + + /* + * Fix Legacy Names in the supplied Model File by replacing the legacy 'com.metamatrix' names with 'org.teiid.designer' + * @param modelResource the supplied model resource + */ + private void fixModelMed( IFile modelFile ) { + // Get the namespaces which are currently persisted on the model + final ModelExtensionAssistantAggregator aggregator = ExtensionPlugin.getInstance().getModelExtensionAssistantAggregator(); + Collection supportedNamespaces = null; + + try { + supportedNamespaces = aggregator.getSupportedNamespacePrefixes(modelFile); + } catch (Exception e) { + UiConstants.Util.log(IStatus.ERROR, e, NLS.bind(Messages.getSupportedPrefixesErrorMsg, modelFile.getName())); + return; + } + + boolean modelNeedsSave = false; + + ModelExtensionAssistant assistant = null; + + if( medID.equalsIgnoreCase("relational") ) { + String nsPrefix = RelationalModelExtensionConstants.NAMESPACE_PROVIDER.getNamespacePrefix(); + + assistant = ExtensionPlugin.getInstance().getRegistry().getModelExtensionAssistant(nsPrefix); + } else if( medID.equalsIgnoreCase("rest") ) { + String nsPrefix = RestModelExtensionConstants.NAMESPACE_PROVIDER.getNamespacePrefix(); + + assistant = ExtensionPlugin.getInstance().getRegistry().getModelExtensionAssistant(nsPrefix); + } + // if assistant is null, it couldn't find in registry. Create a default assistant. + if (assistant == null) { + UiConstants.Util.log(IStatus.ERROR, medID + " MED not found in model" + modelFile.getName()); //NLS.bind(Messages.relationalExtensionNotFoundInModel, modelFile.getName())); + return; + } + + ModelObjectExtensionAssistant mAssistant = (ModelObjectExtensionAssistant)assistant; + ModelExtensionDefinition modelMed = null; + try { + modelMed = mAssistant.getModelExtensionDefinition(modelFile); + } catch (Exception e) { + UiConstants.Util.log(IStatus.ERROR, e, NLS.bind(Messages.getModelMedErrorMsg, modelFile.getName())); + return; + } + + boolean medChanged = true; //modelMed.getVersion() < assistant.getModelExtensionDefinition().getVersion(); + + if(medChanged) { + // Save the ModelResource MED + try { + mAssistant.saveModelExtensionDefinition(modelFile); + } catch (Exception e) { + UiConstants.Util.log(IStatus.ERROR, e, NLS.bind(Messages.saveModelMedErrorMsg, modelFile.getName())); + } + modelNeedsSave = true; + } + + if(modelNeedsSave) { + try { + ModelResource mdlResc = ModelUtilities.getModelResourceForIFile(modelFile, false); + if(mdlResc!=null) { + mdlResc.save(new NullProgressMonitor(), true); + } + modelFile.deleteMarkers(UiConstants.ExtensionIds.MED_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE); + modelFile.getParent().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor()); + } catch (CoreException e) { + UiConstants.Util.log(IStatus.ERROR, e, NLS.bind(Messages.saveModelErrorMsg, modelFile.getName())); + } + } + + } + + /* + * Fix Legacy Names in the supplied MED File by replacing the legacy 'com.metamatrix' names with 'org.teiid.designer' + * @param medFile the supplied MED File + */ + private void fixMedFile( IFile medFile ) { + +// System.out.println(" RelationalExtensionVersionResolution.fixMedFile() called"); +// try { +// ModelExtensionDefinition med = parse(medFile.getContents()); +// if(med!=null) { +// // Update the legacy classnames in the MED +// updateMed(med); +// +// // Re-write the Med File +// final ModelExtensionDefinitionWriter medWriter = new ModelExtensionDefinitionWriter(); +// final InputStream medInputStream = medWriter.writeAsStream(med); +// medFile.setContents(medInputStream, false, false, new NullProgressMonitor()); +// +// // Delete Error Markers and Refresh +// medFile.deleteMarkers(null, true, IResource.DEPTH_INFINITE); +// medFile.getParent().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor()); +// } +// } catch (Exception e) { +// UiConstants.Util.log(IStatus.ERROR, e, NLS.bind(Messages.fixMedFileClassnamesFailedMsg, medFile.getName())); +// } + } + + /* + * Update the the supplied MED by updating any extended legacy classnames to the new classnames + * @param med the ModelExtensionDefinition + * @return 'true' if any metaclass names were updated, 'false' if not + */ + private boolean updateMed(ModelExtensionDefinition med) { + boolean wasChanged = false; +// if(med!=null) { +// String[] extendedMCs = med.getExtendedMetaclasses(); +// if(extendedMCs!=null) { +// for(int i=0; i resolutions = new ArrayList(); + + if( marker.getAttribute(IS_OLD_REST_VERSION_MED, false) ) { + resolutions.add(new RelationalExtensionVersionResolution("rest")); + } + + return resolutions.toArray(new IMarkerResolution[resolutions.size()]); + } + } \ No newline at end of file diff --git a/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/messages.properties b/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/messages.properties index 0c766367f8..f5f45b5a27 100644 --- a/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/messages.properties +++ b/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/messages.properties @@ -90,7 +90,8 @@ lengthLabel=Length parameterNameLabel=Parameter Name columnsLabel=Columns primaryKeyLabel=PK -uniqueConstraintLabel=Unique Constraint +uniqueConstraintLabel=UC +uniqueConstraintsLabel=Unique Constraints foreignKeysLabel=FKs fkNameLabel=Foreign Key Name isFunctionLabel=Is Source Function @@ -136,3 +137,17 @@ selectColumnReferencesForIndex=Select Column References for Index createIndexTitle=Create Index editIndexTitle=Create Index includeResultSetTooltip=Click to include a result set in your procedure and to enable column editing below. +createUniqueConstraintTitle=Create Unique Constraint +editUniqueConstraintTitle=Edit Unique Constraint + +upgradeRelationalExtensionsLabel=Upgrade Relational Extensions +quickFixMedFileDirtyTitle = Model Extension has Unsaved Changes +quickFixMedFileDirtyMsg = The selected Model Extension has unsaved changes.\n\nDo you wish to save the extension and continue? +quickFixModelDirtyTitle = Model has Unsaved Changes +quickFixModelDirtyMsg = The selected Model has unsaved changes.\n\nDo you wish to save the model and continue? +medFileParseErrorMsg = The Model Extension Definition file "{0}" did not parse successfully and cannot be added to or updated in the registry. +getSupportedPrefixesErrorMsg = There was a problem getting the supported namespace prefixes for Model "{0}" +getModelMedErrorMsg = There was a problem getting the Extension Definition for Model "{0}" +saveModelMedErrorMsg = There was a problem saving the Extension Definition for Model "{0}" +saveModelErrorMsg = There was a problem saving Model "{0}" + diff --git a/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/webservice/WebServiceRelationalModelWizardPage.java b/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/webservice/WebServiceRelationalModelWizardPage.java index 7d747be21a..06ef96cafa 100644 --- a/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/webservice/WebServiceRelationalModelWizardPage.java +++ b/plugins/org.teiid.designer.relational.ui/src/org/teiid/designer/relational/ui/webservice/WebServiceRelationalModelWizardPage.java @@ -59,7 +59,7 @@ public void widgetSelected( final SelectionEvent event ) { } }); - invokeHttpCB = WidgetFactory.createCheckBox(optionsGroup, "invokeHttp(action in STRING, request in OBJECT, endpoint in STRING, stream in BOOLEAN, result out BLOB, contentType out STRING)", 0, 2, true); //$NON-NLS-1$ + invokeHttpCB = WidgetFactory.createCheckBox(optionsGroup, "invokeHttp(action in STRING, request in OBJECT, endpoint in STRING, stream in BOOLEAN, result out BLOB, contentType out STRING, headers in CLOB)", 0, 2, true); //$NON-NLS-1$ invokeHttpCB.addSelectionListener(new SelectionAdapter() { @Override diff --git a/plugins/org.teiid.designer.relational/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.relational/META-INF/MANIFEST.MF index 55b3329280..f9215b55df 100644 --- a/plugins/org.teiid.designer.relational/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.relational/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-Vendor: %Plugin-Provider Bundle-SymbolicName: org.teiid.designer.relational -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.relational.RelationalPlugin Require-Bundle: org.eclipse.ui;bundle-version="[3.106.1,4.0.0)", org.eclipse.core.runtime;bundle-version="[3.10.0,4.0.0)", diff --git a/plugins/org.teiid.designer.relational/pom.xml b/plugins/org.teiid.designer.relational/pom.xml index 103d147ada..a6fefc8930 100644 --- a/plugins/org.teiid.designer.relational/pom.xml +++ b/plugins/org.teiid.designer.relational/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.relational - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.relational/src/org/teiid/designer/relational/RelationalConstants.java b/plugins/org.teiid.designer.relational/src/org/teiid/designer/relational/RelationalConstants.java index 082a815d4e..e95b5a6845 100644 --- a/plugins/org.teiid.designer.relational/src/org/teiid/designer/relational/RelationalConstants.java +++ b/plugins/org.teiid.designer.relational/src/org/teiid/designer/relational/RelationalConstants.java @@ -16,6 +16,9 @@ public interface RelationalConstants { final static String XMI_EXT = ".xmi"; //$NON-NLS-1$ + final static String TEIID_REL_PREFIX = "teiid_rel"; //$NON-NLS-1$ + final static String RELATIONAL_PREFIX = "relational"; //$NON-NLS-1$ + /** * Relational model object types */ @@ -123,7 +126,7 @@ class UPDATE_COUNT { // IN, IN_OUT, OUT, RETURN, UNKNOWN class DIRECTION { public static final String IN = "IN"; //$NON-NLS-1$ - public static final String IN_OUT = "IN_OUT"; //$NON-NLS-1$ + public static final String IN_OUT = "INOUT"; //$NON-NLS-1$ public static final String OUT = "OUT"; //$NON-NLS-1$ public static final String RETURN = "RETURN"; //$NON-NLS-1$ public static final String UNKNOWN = "UNKNOWN"; //$NON-NLS-1$ diff --git a/plugins/org.teiid.designer.relational/src/org/teiid/designer/relational/model/RelationalModelFactory.java b/plugins/org.teiid.designer.relational/src/org/teiid/designer/relational/model/RelationalModelFactory.java index 050af7cc0d..5223233972 100644 --- a/plugins/org.teiid.designer.relational/src/org/teiid/designer/relational/model/RelationalModelFactory.java +++ b/plugins/org.teiid.designer.relational/src/org/teiid/designer/relational/model/RelationalModelFactory.java @@ -567,6 +567,11 @@ private void createPrimaryKey( RelationalReference ref, BaseTable baseTable, Mod } } + // Set Description + if( pkRef.getDescription() != null ) { + createAnnotation(primaryKey, pkRef.getDescription(), modelResource); + } + // Apply Extension Properties processExtensionProperties(modelResource,pkRef,primaryKey); @@ -611,6 +616,11 @@ public void createForeignKey( RelationalReference ref, BaseTable baseTable, Mode } } + // Set Description + if( fkRef.getDescription() != null ) { + createAnnotation(foreignKey, fkRef.getDescription(), modelResource); + } + // Apply Extension Properties processExtensionProperties(modelResource,fkRef,foreignKey); @@ -637,6 +647,11 @@ private void createAccessPattern( RelationalReference ref, Table baseTable, Mode } } + // Set Description + if( apRef.getDescription() != null ) { + createAnnotation(accessPattern, apRef.getDescription(), modelResource); + } + // Apply Extension Properties processExtensionProperties(modelResource,apRef,accessPattern); @@ -663,6 +678,11 @@ private void createUniqueConstraint( RelationalReference ref, BaseTable baseTabl } } + // Set Description + if( ucRef.getDescription() != null ) { + createAnnotation(uniqueConstraint, ucRef.getDescription(), modelResource); + } + // Apply Extension Properties processExtensionProperties(modelResource,ucRef,uniqueConstraint); @@ -1200,7 +1220,7 @@ private ModelObjectExtensionAssistant getModelExtensionAssistant( String eObject // find the assistant for the property for (ModelExtensionAssistant assistant : assistants) { // Prepend the assistant namespace to the propertyId, since it doesnt have one - String namespacedId = assistant.getNamespacePrefix()+':'+propId; + String namespacedId = propId; // assistant.getNamespacePrefix()+':'+propId; if(hasMatchingPropertyName(assistant.getModelExtensionDefinition(), eObjectClassName, namespacedId)) { return ((assistant instanceof ModelObjectExtensionAssistant) ? (ModelObjectExtensionAssistant)assistant : null); diff --git a/plugins/org.teiid.designer.relational/src/org/teiid/designer/relational/model/RelationalUniqueConstraint.java b/plugins/org.teiid.designer.relational/src/org/teiid/designer/relational/model/RelationalUniqueConstraint.java index fc8cef194a..cdb19a7cc9 100644 --- a/plugins/org.teiid.designer.relational/src/org/teiid/designer/relational/model/RelationalUniqueConstraint.java +++ b/plugins/org.teiid.designer.relational/src/org/teiid/designer/relational/model/RelationalUniqueConstraint.java @@ -50,6 +50,32 @@ public RelationalUniqueConstraint( String name ) { this.columns = new ArrayList(); setNameValidator(new RelationalStringNameValidator(true, true)); } + + @Override + public RelationalUniqueConstraint clone() { + RelationalUniqueConstraint cloneUC = new RelationalUniqueConstraint(getName()); + cloneUC.setNameInSource(getNameInSource()); + cloneUC.setDescription(getDescription()); + cloneUC.setModelType(getModelType()); + for( RelationalColumn col : getColumns() ) { + cloneUC.addColumn(col); + } + return cloneUC; + } + + @Override + public void inject(RelationalReference originalUC) { + super.inject(originalUC); + RelationalUniqueConstraint theUC = (RelationalUniqueConstraint)originalUC; + setName(theUC.getName()); + setNameInSource(theUC.getNameInSource()); + setDescription(theUC.getDescription()); + setModelType(theUC.getModelType()); + getColumns().clear(); + for( RelationalColumn col : theUC.getColumns() ) { + addColumn(col); + } + } /** * @return columns diff --git a/plugins/org.teiid.designer.roles.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.roles.ui/META-INF/MANIFEST.MF index 244e802057..5457f288a4 100644 --- a/plugins/org.teiid.designer.roles.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.roles.ui/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-Vendor: %Bundle-Vendor Bundle-SymbolicName: org.teiid.designer.roles.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.roles.ui.RolesUiPlugin Require-Bundle: org.eclipse.ui;bundle-version="[3.106.1,4.0.0)", org.eclipse.core.runtime;bundle-version="[3.10.0,4.0.0)", diff --git a/plugins/org.teiid.designer.roles.ui/pom.xml b/plugins/org.teiid.designer.roles.ui/pom.xml index 86ddc6072c..595cd47091 100644 --- a/plugins/org.teiid.designer.roles.ui/pom.xml +++ b/plugins/org.teiid.designer.roles.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.roles.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.roles.ui/src/org/teiid/designer/roles/ui/wizard/panels/RowBasedSecurityPanel.java b/plugins/org.teiid.designer.roles.ui/src/org/teiid/designer/roles/ui/wizard/panels/RowBasedSecurityPanel.java index 45df8c0b7e..91af65977e 100644 --- a/plugins/org.teiid.designer.roles.ui/src/org/teiid/designer/roles/ui/wizard/panels/RowBasedSecurityPanel.java +++ b/plugins/org.teiid.designer.roles.ui/src/org/teiid/designer/roles/ui/wizard/panels/RowBasedSecurityPanel.java @@ -573,6 +573,7 @@ public void widgetDefaultSelected(SelectionEvent e) { @Override public void widgetSelected(SelectionEvent e) { // Open dialog to display models tree so user can select a column object + constraint = constraintButton.getSelection(); handleInputChanged(); } diff --git a/plugins/org.teiid.designer.schema.tools/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.schema.tools/META-INF/MANIFEST.MF index 119e593782..6d7a79ff93 100644 --- a/plugins/org.teiid.designer.schema.tools/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.schema.tools/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.schema.tools;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.schema.tools.ToolsPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.schema.tools/pom.xml b/plugins/org.teiid.designer.schema.tools/pom.xml index c21deaecf2..ca712dc5a9 100644 --- a/plugins/org.teiid.designer.schema.tools/pom.xml +++ b/plugins/org.teiid.designer.schema.tools/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.schema.tools - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.sdt/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.sdt/META-INF/MANIFEST.MF index f057fdfabf..cbeb18a342 100644 --- a/plugins/org.teiid.designer.sdt/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.sdt/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.sdt;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.sdt.ModelerSdtPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.sdt/pom.xml b/plugins/org.teiid.designer.sdt/pom.xml index a936b2c874..eccd4f3516 100644 --- a/plugins/org.teiid.designer.sdt/pom.xml +++ b/plugins/org.teiid.designer.sdt/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.sdt - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.spi/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.spi/META-INF/MANIFEST.MF index f0e149a2dd..5f625e63a1 100644 --- a/plugins/org.teiid.designer.spi/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.spi/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.spi;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %pluginProvider Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.spi/pom.xml b/plugins/org.teiid.designer.spi/pom.xml index 0c82706fd3..ec75899dcf 100644 --- a/plugins/org.teiid.designer.spi/pom.xml +++ b/plugins/org.teiid.designer.spi/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.spi - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.spi/src/org/teiid/datatools/connectivity/spi/ISecureStorageProvider.java b/plugins/org.teiid.designer.spi/src/org/teiid/datatools/connectivity/spi/ISecureStorageProvider.java index 42a12516e8..b1b935fe9a 100644 --- a/plugins/org.teiid.designer.spi/src/org/teiid/datatools/connectivity/spi/ISecureStorageProvider.java +++ b/plugins/org.teiid.designer.spi/src/org/teiid/datatools/connectivity/spi/ISecureStorageProvider.java @@ -47,5 +47,14 @@ public interface ISecureStorageProvider { * @throws Exception */ void storeInSecureStorage(String nodeKey, String key, String value) throws Exception; + + /** + * Remove the given node from eclipse's secure + * storage. + * + * @param nodeKey + * @throws Exception + */ + void removeFromSecureStorage(String nodeKey) throws Exception; } diff --git a/plugins/org.teiid.designer.spi/src/org/teiid/designer/query/proc/ITeiidColumnInfo.java b/plugins/org.teiid.designer.spi/src/org/teiid/designer/query/proc/ITeiidColumnInfo.java index dad26bdf82..0344882fdb 100644 --- a/plugins/org.teiid.designer.spi/src/org/teiid/designer/query/proc/ITeiidColumnInfo.java +++ b/plugins/org.teiid.designer.spi/src/org/teiid/designer/query/proc/ITeiidColumnInfo.java @@ -64,6 +64,12 @@ public interface ITeiidColumnInfo { * @return forOrdinality the column forOrdinality */ boolean getOrdinality(); + + /** + * + * @return no trim value + */ + public boolean isNoTrim(); /** * diff --git a/plugins/org.teiid.designer.spi/src/org/teiid/designer/query/sql/ISQLConstants.java b/plugins/org.teiid.designer.spi/src/org/teiid/designer/query/sql/ISQLConstants.java index d6b458cc67..02ac8c3a16 100644 --- a/plugins/org.teiid.designer.spi/src/org/teiid/designer/query/sql/ISQLConstants.java +++ b/plugins/org.teiid.designer.spi/src/org/teiid/designer/query/sql/ISQLConstants.java @@ -105,6 +105,10 @@ public interface ISQLConstants { String HEADER = "HEADER"; //$NON-NLS-1$ String SKIP = "SKIP"; //$NON-NLS-1$ String WIDTH = "width"; //$NON-NLS-1$ + String NO_TRIM = "NO TRIM"; //$NON-NLS-1$ + String ESCAPE_STR = "ESCAPE"; //$NON-NLS-1$ + String QUOTE_STR = "QUOTE"; //$NON-NLS-1$ + String DELIMITER_STR = "DELIMITER"; //$NON-NLS-1$ interface INSERT_OPTIONS { int REPLACE_ALL = 0; diff --git a/plugins/org.teiid.designer.spi/src/org/teiid/designer/runtime/spi/HostProvider.java b/plugins/org.teiid.designer.spi/src/org/teiid/designer/runtime/spi/HostProvider.java deleted file mode 100644 index e30ce6f755..0000000000 --- a/plugins/org.teiid.designer.spi/src/org/teiid/designer/runtime/spi/HostProvider.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * JBoss, Home of Professional Open Source. - * - * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing. - * - * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors. - */ -package org.teiid.designer.runtime.spi; - -/** - * - * - * @since 8.0 - */ -public interface HostProvider { - - /** - * The default connection host. Value is {@value}. - */ - String DEFAULT_HOST = "localhost"; //$NON-NLS-1$ - - /** - * A HostProvider that provides the default host. - */ - DefaultHostProvider DEFAULT_HOST_PROVIDER = new DefaultHostProvider(); - - /** - * @return the host (never null) - */ - String getHost(); - - /** - * The DefaultHostProvider provides the default host. - * @see HostProvider#DEFAULT_HOST - */ - class DefaultHostProvider implements HostProvider { - /** - * {@inheritDoc} - * - * @see HostProvider#getHost() - */ - @Override - public String getHost() { - return DEFAULT_HOST; - } - } - -} diff --git a/plugins/org.teiid.designer.spi/src/org/teiid/designer/runtime/spi/ITeiidConnectionInfo.java b/plugins/org.teiid.designer.spi/src/org/teiid/designer/runtime/spi/ITeiidConnectionInfo.java index 930845a7ae..064b2f1ef9 100644 --- a/plugins/org.teiid.designer.spi/src/org/teiid/designer/runtime/spi/ITeiidConnectionInfo.java +++ b/plugins/org.teiid.designer.spi/src/org/teiid/designer/runtime/spi/ITeiidConnectionInfo.java @@ -23,12 +23,22 @@ public interface ITeiidConnectionInfo { * Protocol address prefix for server connections */ public static final String MM = "mm://"; //$NON-NLS-1$ + + /** + * The default connection host. Value is {@value}. + */ + String DEFAULT_HOST = "localhost"; //$NON-NLS-1$ /** * @return the password (can be null or empty) */ String getPassword(); + /** + * @return the host (can be null or empty) + */ + String getHost(); + /** * @return the port (can be null or empty) */ @@ -45,11 +55,6 @@ public interface ITeiidConnectionInfo { */ String getType(); - /** - * @return the host provider (never null) - */ - HostProvider getHostProvider(); - /** * @return the secureStorageProvider */ @@ -76,12 +81,20 @@ public interface ITeiidConnectionInfo { * @param info the connection properties whose values are being used to update state */ void setAll(ITeiidConnectionInfo info); - + + /** + * The port, password, user name, persisting password, secure protocol, and host provider are set. + * + * @param info the connection properties whose values are being used to update state + */ + void setAll(String host, String port, String username, String password, boolean isSecure ); + /** - * @param hostProvider the new value for host provider (never null) + * @param host the new value for host (never null) + * @param loadPasswords load passwords * @throws IllegalArgumentException if hostProvider is null */ - void setHostProvider(HostProvider hostProvider); + void setHost(String host); /** * @param password the new value for password (can be empty or null) @@ -114,10 +127,4 @@ public interface ITeiidConnectionInfo { * @return the id referencing the password in secure storage */ String getPassToken(); - - /** - * Set the pass token for this connection info - * @param passToken - */ - void setPassToken(String passToken); } diff --git a/plugins/org.teiid.designer.spi/src/org/teiid/designer/runtime/spi/ITeiidServer.java b/plugins/org.teiid.designer.spi/src/org/teiid/designer/runtime/spi/ITeiidServer.java index f64184b4ec..aa79822634 100644 --- a/plugins/org.teiid.designer.spi/src/org/teiid/designer/runtime/spi/ITeiidServer.java +++ b/plugins/org.teiid.designer.spi/src/org/teiid/designer/runtime/spi/ITeiidServer.java @@ -14,7 +14,7 @@ * @since 8.0 * */ -public interface ITeiidServer extends IExecutionAdmin, HostProvider { +public interface ITeiidServer extends IExecutionAdmin { /** * @return the version information of this server @@ -50,6 +50,11 @@ public interface ITeiidServer extends IExecutionAdmin, HostProvider { */ EventManager getEventManager(); + /** + * @return the host (never null) + */ + String getHost(); + /** * @return the host URL (never null) */ diff --git a/plugins/org.teiid.designer.spi/src/org/teiid/designer/runtime/version/spi/TeiidServerVersion.java b/plugins/org.teiid.designer.spi/src/org/teiid/designer/runtime/version/spi/TeiidServerVersion.java index 4ee7950df4..e2fddc87cf 100644 --- a/plugins/org.teiid.designer.spi/src/org/teiid/designer/runtime/version/spi/TeiidServerVersion.java +++ b/plugins/org.teiid.designer.spi/src/org/teiid/designer/runtime/version/spi/TeiidServerVersion.java @@ -97,7 +97,7 @@ public static enum Version { /** * Default Teiid for this Designer */ - TEIID_DEFAULT(VersionID.TEIID_8_9); + TEIID_DEFAULT(VersionID.TEIID_8_11); private final ITeiidServerVersion version; diff --git a/plugins/org.teiid.designer.teiidimporter.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.teiidimporter.ui/META-INF/MANIFEST.MF index 089c1997fc..c068f83197 100644 --- a/plugins/org.teiid.designer.teiidimporter.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.teiidimporter.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.teiidimporter.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.teiidimporter.ui.Activator Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.teiidimporter.ui/pom.xml b/plugins/org.teiid.designer.teiidimporter.ui/pom.xml index 97215e74d7..86a5ce36b8 100644 --- a/plugins/org.teiid.designer.teiidimporter.ui/pom.xml +++ b/plugins/org.teiid.designer.teiidimporter.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.teiidimporter.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.teiidimporter.ui/src/org/teiid/designer/teiidimporter/ui/UiConstants.java b/plugins/org.teiid.designer.teiidimporter.ui/src/org/teiid/designer/teiidimporter/ui/UiConstants.java index 15aa339c0e..2374a3c3eb 100644 --- a/plugins/org.teiid.designer.teiidimporter.ui/src/org/teiid/designer/teiidimporter/ui/UiConstants.java +++ b/plugins/org.teiid.designer.teiidimporter.ui/src/org/teiid/designer/teiidimporter/ui/UiConstants.java @@ -34,4 +34,13 @@ interface ImageIds { String REMOVE_PROPERTY = FOLDER + "remove_property.png"; //$NON-NLS-1$ } + interface JdbcTranslatorKeys { + String TABLE_TYPES = "importer.TableTypes"; + String USE_QUALIFIED_NAME = "importer.UseQualifiedName"; + } + + interface JdbcTranslatorDefaults { + String TABLE_TYPES = "TABLE"; + String USE_QUALIFIED_NAME = "false"; + } } diff --git a/plugins/org.teiid.designer.teiidimporter.ui/src/org/teiid/designer/teiidimporter/ui/panels/TranslatorHelper.java b/plugins/org.teiid.designer.teiidimporter.ui/src/org/teiid/designer/teiidimporter/ui/panels/TranslatorHelper.java index 2eb9453c36..fa7a5f8ead 100644 --- a/plugins/org.teiid.designer.teiidimporter.ui/src/org/teiid/designer/teiidimporter/ui/panels/TranslatorHelper.java +++ b/plugins/org.teiid.designer.teiidimporter.ui/src/org/teiid/designer/teiidimporter/ui/panels/TranslatorHelper.java @@ -205,6 +205,10 @@ public static String getTranslator(String driverName, Collection transla return INGRES; } + if(driverNameLC.startsWith("jconn")) { //$NON-NLS-1$ + return SYBASE; + } + if(driverNameLC.contains("hive")) { //$NON-NLS-1$ return HIVE; } diff --git a/plugins/org.teiid.designer.teiidimporter.ui/src/org/teiid/designer/teiidimporter/ui/wizard/SelectTranslatorPage.java b/plugins/org.teiid.designer.teiidimporter.ui/src/org/teiid/designer/teiidimporter/ui/wizard/SelectTranslatorPage.java index 297d4807b4..32d7889e2f 100644 --- a/plugins/org.teiid.designer.teiidimporter.ui/src/org/teiid/designer/teiidimporter/ui/wizard/SelectTranslatorPage.java +++ b/plugins/org.teiid.designer.teiidimporter.ui/src/org/teiid/designer/teiidimporter/ui/wizard/SelectTranslatorPage.java @@ -228,6 +228,21 @@ public void dispose() { */ @Override public Object[] getElements( Object inputElement ) { + TranslatorOverrideProperty[] props = importManager.getTranslatorOverride().getProperties(); + for( TranslatorOverrideProperty top : props ) { +// System.out.println(" TOP: ID = " + top.getDefinition().getId()); + if( top.getDefinition().getId().equalsIgnoreCase(JdbcTranslatorKeys.TABLE_TYPES)) { + if( top.getOverriddenValue() == null ) { + top.setValue(JdbcTranslatorDefaults.TABLE_TYPES); + } + } else if( top.getDefinition().getId().equalsIgnoreCase(JdbcTranslatorKeys.USE_QUALIFIED_NAME)) { + if( top.getOverriddenValue() == null || top.getOverriddenValue().equalsIgnoreCase(Boolean.toString(true)) ) { + top.setValue(JdbcTranslatorDefaults.USE_QUALIFIED_NAME); + } + } + + } + return importManager.getTranslatorOverride().getProperties(); } diff --git a/plugins/org.teiid.designer.tools.textimport.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.tools.textimport.ui/META-INF/MANIFEST.MF index 6614baeee2..3708f611cb 100644 --- a/plugins/org.teiid.designer.tools.textimport.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.tools.textimport.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.tools.textimport.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.tools.textimport.ui.TextImportPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.tools.textimport.ui/pom.xml b/plugins/org.teiid.designer.tools.textimport.ui/pom.xml index 4dad5e6014..b169cc0be3 100644 --- a/plugins/org.teiid.designer.tools.textimport.ui/pom.xml +++ b/plugins/org.teiid.designer.tools.textimport.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.tools.textimport.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.transformation.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.transformation.ui/META-INF/MANIFEST.MF index 71b2064b28..83a35adbdf 100644 --- a/plugins/org.teiid.designer.transformation.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.transformation.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.transformation.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.transformation.ui.UiPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.transformation.ui/pom.xml b/plugins/org.teiid.designer.transformation.ui/pom.xml index 8603e3d7ea..6dd1f940ce 100644 --- a/plugins/org.teiid.designer.transformation.ui/pom.xml +++ b/plugins/org.teiid.designer.transformation.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.transformation.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/Messages.java b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/Messages.java index 0b5a652928..43937e645e 100644 --- a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/Messages.java +++ b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/Messages.java @@ -221,6 +221,13 @@ public class Messages extends NLS { public static String saveModelErrorMsg; public static String restMedQuickFixLabel; + public static String ExportTeiidDdlModelSelectionPage_modelGroupTitle; + public static String ExportTeiidDdlModelSelectionPage_fileLabel; + public static String ExportTeiidDdlModelSelectionPage_title; + public static String ExportTeiidDdlModelSelectionPage_ddlExportOptions; + public static String ExportTeiidDdlModelSelectionPage_nameInSourceOption; + public static String ExportTeiidDdlModelSelectionPage_nativeTypeOption; + static { NLS.initializeMessages("org.teiid.designer.transformation.ui.messages", Messages.class); //$NON-NLS-1$ } diff --git a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/i18n.properties b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/i18n.properties index 20d924f5a9..9cfb1995f7 100644 --- a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/i18n.properties +++ b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/i18n.properties @@ -976,6 +976,7 @@ TeiidMetadataImportOptionsPage.editTextTableOptionsButtonLabel=Edit TEXTTABLE() TeiidMetadataImportOptionsPage.editDelimiterButtonLabel=Edit Delimiter Character TeiidMetadataImportOptionsPage.sqlUseSelectedFile=Selected File Only TeiidMetadataImportOptionsPage.sqlUseSelectedFilter=Use Specified File Filter +TeiidMetadataImportOptionsPage.noTrimLabel=No Trim DelimiterOptionsDialog.title=Select Delimiter Character DelimiterOptionsDialog.titleMessage=Select delimiter type or specify custom using 'Other' option. diff --git a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/messages.properties b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/messages.properties index d4911f43d5..0c4064c7ae 100644 --- a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/messages.properties +++ b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/messages.properties @@ -170,7 +170,7 @@ sqlTemplateDialogUpdDefaultProcLabel=UPDATE Procedure sqlTemplateDialogDelDefaultProcLabel=DELETE Procedure sqlTemplateDialogSoapCreateProcLabel=SOAP Web Service - "Create" Procedure sqlTemplateDialogSoapExtractProcLabel=SOAP Web Service - "Extract" Procedure -sqlTemplateDialogRestProcLabel=REST Procedure +sqlTemplateDialogRestProcLabel=REST ProcedureExportTeiidDdl_modelGroupTitle sqlTemplateDialogSqlAreaGroup=SQL Template sqlTemplateDialogSelectTabTitle=SELECT Queries sqlTemplateDialogProceduresTabTitle=PROCEDURES @@ -225,3 +225,10 @@ getModelMedErrorMsg = There was a problem getting the Extension Definition for M saveModelMedErrorMsg = There was a problem saving the Extension Definition for Model "{0}" saveModelErrorMsg = There was a problem saving Model "{0}" restMedQuickFixLabel=Update the out-of-date REST Model Extensions to latest version + +ExportTeiidDdlModelSelectionPage_modelGroupTitle=Relational source or view model +ExportTeiidDdlModelSelectionPage_fileLabel=Selected model +ExportTeiidDdlModelSelectionPage_title=Export Model as Teiid DDL +ExportTeiidDdlModelSelectionPage_ddlExportOptions=DDL Export Options +ExportTeiidDdlModelSelectionPage_nameInSourceOption=Add Name In Source values as OPTIONS +ExportTeiidDdlModelSelectionPage_nativeTypeOption=Add Native Type values as OPTIONS diff --git a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/teiidddl/ExportTeiidDdlModelSelectionPage.java b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/teiidddl/ExportTeiidDdlModelSelectionPage.java index 3629e6e8c2..f22be6a0c6 100644 --- a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/teiidddl/ExportTeiidDdlModelSelectionPage.java +++ b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/teiidddl/ExportTeiidDdlModelSelectionPage.java @@ -23,6 +23,7 @@ import org.teiid.designer.core.ModelerCore; import org.teiid.designer.core.workspace.ModelResource; import org.teiid.designer.core.workspace.ModelUtil; +import org.teiid.designer.transformation.ui.Messages; import org.teiid.designer.transformation.ui.UiConstants; import org.teiid.designer.ui.common.util.WidgetFactory; import org.teiid.designer.ui.common.util.WidgetUtil; @@ -45,10 +46,10 @@ public class ExportTeiidDdlModelSelectionPage extends AbstractWizardPage implements UiConstants { private static final String I18N_PREFIX = I18nUtil.getPropertyPrefix(ExportTeiidDdlModelSelectionPage.class); - private static final String TITLE = "Export Model as Teiid DDL"; //getString("title"); //$NON-NLS-1$ - private static final String OPTIONS_GROUP = "DDL Export Options"; //getString("optionsGroup"); //$NON-NLS-1$ - private static final String USE_NAMES_IN_SOURCE_CHECKBOX = "Add Name In Source values as OPTIONS"; //getString("useNamesInSourceCheckBox"); //$NON-NLS-1$ - private static final String USE_NATIVE_TYPE_CHECKBOX = "Add Native Type values as OPTIONS"; //getString("useNativeTypeCheckBox"); //$NON-NLS-1$ + private static final String TITLE = Messages.ExportTeiidDdlModelSelectionPage_title; + private static final String OPTIONS_GROUP = Messages.ExportTeiidDdlModelSelectionPage_ddlExportOptions; + private static final String USE_NAMES_IN_SOURCE_CHECKBOX = Messages.ExportTeiidDdlModelSelectionPage_nameInSourceOption; + private static final String USE_NATIVE_TYPE_CHECKBOX = Messages.ExportTeiidDdlModelSelectionPage_nativeTypeOption; private static String getString(final String id) { return Util.getString(I18N_PREFIX + id); @@ -56,8 +57,6 @@ private static String getString(final String id) { private final TeiidDdlExporter exporter; - private boolean creatingControl = false; - private Text selectedFileText; private Button useNamesInSourceCheckBox, useNativeTypeCheckBox; @@ -69,7 +68,6 @@ public ExportTeiidDdlModelSelectionPage(TeiidDdlExporter exporter) { @Override public void createControl(Composite parent) { - creatingControl = true; // Create page final Composite mainPanel = new Composite(parent, SWT.NONE); @@ -80,15 +78,6 @@ public void createControl(Composite parent) { setControl(mainPanel); setMessage("Select target model for export and define available options"); - -// Label selectedFileLabel = new Label(mainPanel, SWT.NONE); -// selectedFileLabel.setText(getString("selectedXmlFile")); //$NON-NLS-1$ -// -// selectedFileText = new Text(mainPanel, SWT.BORDER | SWT.SINGLE); -// selectedFileText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW)); -// selectedFileText.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE)); -// selectedFileText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); -// selectedFileText.setEditable(false); new Label(mainPanel, SWT.NONE); new Label(mainPanel, SWT.NONE); @@ -96,8 +85,6 @@ public void createControl(Composite parent) { createSelectModelGroup(mainPanel); createOptionsGroup(mainPanel); - - creatingControl = false; setPageComplete(false); } @@ -107,19 +94,19 @@ public void setVisible(boolean visible) { super.setVisible(visible); if (visible) { - + validatePage(); } } private void createSelectModelGroup(Composite parent) { - Group viewGroup = WidgetFactory.createGroup(parent, "Select Model File", SWT.NONE, 2, 3); //$NON-NLS-1$ + Group viewGroup = WidgetFactory.createGroup(parent, Messages.ExportTeiidDdlModelSelectionPage_modelGroupTitle, SWT.NONE, 2, 3); GridData gd_vg = new GridData(GridData.FILL_HORIZONTAL); gd_vg.horizontalSpan = 2; viewGroup.setLayoutData(gd_vg); Label fileLabel = new Label(viewGroup, SWT.NULL); - fileLabel.setText("Selected Model"); //getString("name")); //$NON-NLS-1$ + fileLabel.setText(Messages.ExportTeiidDdlModelSelectionPage_fileLabel); selectedFileText = new Text(viewGroup, SWT.BORDER | SWT.SINGLE); GridData gridData = new GridData(GridData.FILL_HORIZONTAL); @@ -132,7 +119,7 @@ private void createSelectModelGroup(Composite parent) { Button browseButton = new Button(viewGroup, SWT.PUSH); gridData = new GridData(); browseButton.setLayoutData(gridData); - browseButton.setText("..."); //getString("browse")); //$NON-NLS-1$ + browseButton.setText("..."); //$NON-NLS-1$ browseButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { @@ -196,6 +183,19 @@ void handleModelBrowse() { private boolean validatePage() { IStatus status = exporter.validate(); + if( status.isOK()) { + setMessage(null); + setPageComplete(true); + return true; + } else if( status.getSeverity() == IStatus.WARNING ){ + setMessage(status.getMessage()); + setPageComplete(true); + return true; + } else if( status.getSeverity() == IStatus.ERROR ) { + setErrorMessage(status.getMessage()); + setPageComplete(false); + return false; + } return true; } diff --git a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/teiidddl/ExportTeiidDdlWizard.java b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/teiidddl/ExportTeiidDdlWizard.java index 18f7006d0c..bc57ca341e 100644 --- a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/teiidddl/ExportTeiidDdlWizard.java +++ b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/teiidddl/ExportTeiidDdlWizard.java @@ -1,6 +1,5 @@ package org.teiid.designer.transformation.ui.teiidddl; -import java.lang.reflect.InvocationTargetException; import org.eclipse.core.resources.IResource; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.IStructuredSelection; @@ -15,7 +14,6 @@ import org.teiid.designer.transformation.ui.UiPlugin; import org.teiid.designer.ui.common.InternalUiConstants; import org.teiid.designer.ui.common.eventsupport.SelectionUtilities; -import org.teiid.designer.ui.common.util.WidgetUtil; import org.teiid.designer.ui.common.wizard.AbstractWizard; import org.teiid.designer.ui.viewsupport.ModelIdentifier; import org.teiid.designer.ui.viewsupport.ModelUtilities; @@ -63,8 +61,6 @@ private static String getString( final String id ) { private ExportTeiidDdlModelSelectionPage modelSelectionPage; private ExportTeiidShowDdlPage ddlSummaryPage; - - private ExportTeiidDdlOutputPage ddlOutputPage; private boolean invalidSelection; @@ -81,26 +77,26 @@ public ExportTeiidDdlWizard() { */ @Override public boolean finish() { - - try { - switch (exporter.getExportType()) { - case FILE: - exporter.exportToFile(); - break; - case CLIPBOARD: - exporter.exportToClipboard(); - break; - } - - return true; - } catch (Throwable err) { - if (err instanceof InvocationTargetException) { - err = ((InvocationTargetException) err).getTargetException(); - } - Util.log(err); - WidgetUtil.showError(EXPORT_ERROR_MESSAGE); - return false; - } + return true; +// try { +// switch (exporter.getExportType()) { +// case FILE: +// exporter.exportToFile(); +// break; +// case CLIPBOARD: +// exporter.exportToClipboard(); +// break; +// } +// +// return true; +// } catch (Throwable err) { +// if (err instanceof InvocationTargetException) { +// err = ((InvocationTargetException) err).getTargetException(); +// } +// Util.log(err); +// WidgetUtil.showError(EXPORT_ERROR_MESSAGE); +// return false; +// } } /**ExportTeiidDdlOutputPage @@ -151,9 +147,5 @@ public void init(final IWorkbench workbench, final IStructuredSelection selectio this.ddlSummaryPage = new ExportTeiidShowDdlPage(exporter); this.ddlSummaryPage.setPageComplete(false); addPage(ddlSummaryPage); - - this.ddlOutputPage = new ExportTeiidDdlOutputPage(exporter); - this.ddlOutputPage.setPageComplete(false); - addPage(ddlOutputPage); } } diff --git a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/teiidddl/ExportTeiidShowDdlPage.java b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/teiidddl/ExportTeiidShowDdlPage.java index 366af4e80a..8552328d1a 100644 --- a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/teiidddl/ExportTeiidShowDdlPage.java +++ b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/teiidddl/ExportTeiidShowDdlPage.java @@ -276,39 +276,6 @@ private void setButtonStates() { public void setVisible( boolean visible ) { if (visible) { String ddlString = exporter.generateDdl(); -// // When this page is show, ensure that differences page is set incomplete. -// IWizard wizard = getWizard(); -// IWizardPage differencesPage = wizard.getPage("DdlImportDifferencesPage"); //$NON-NLS-1$ -// if(differencesPage instanceof DdlImportDifferencesPage) { -// ((DdlImportDifferencesPage)differencesPage).setPageComplete(false); -// } -// if(importManager.isVdbDeployed() && importManager.shouldRedeploy()) { -// importManager.undeployDynamicVdb(); -// importManager.deleteDdlTempFile(); -// importManager.setRedeploy(false); -// } -// -// if(importManager.isVdbDeployed() ) { -// String ddl = importManager.getDdl(); -// if(ddl==null) ddl=EMPTY; -// this.ddlContentsBox.setText(ddl); -// } else { -// IStatus deployStatus = importManager.deployDynamicVdb(); -// if(deployStatus == null) { -// ddlContentsBox.setText(Util.getString("ExportTeiidShowDdlPage_vdbDeploymentErrorMsg")); -// } else if(!deployStatus.isOK()) { -// StringBuffer sb = new StringBuffer(deployStatus.getMessage()); -// sb.append("\n\n"+ Util.getString("ExportTeiidShowDdlPage_vdbDeploymentCheckServerLogMsg")); //$NON-NLS-1$ -// ddlContentsBox.setText(sb.toString()); -// } else { -// String ddl = importManager.getDdl(); -// // Consider null DDL an error.. -// if(ddl==null) ddl=Messages.TeiidImportManager_getDdlErrorMsg; -// -// ddlContentsBox.setText(ddl); -// ddlContentsBox.setTopIndex(0); -// } -// } if( ddlString != null ) { ddlContentsBox.setText(ddlString); ddlContentsBox.setTopIndex(0); @@ -325,23 +292,6 @@ public void setVisible( boolean visible ) { * Validate the page */ private boolean validatePage() { - // VDB deployment validation -// if(!this.importManager.isVdbDeployed()) { -// String errorMsg; -// IStatus deployStatus = importManager.getVdbDeploymentStatus(); -// if(deployStatus!=null) { -// errorMsg = deployStatus.getMessage(); -// } else { -// errorMsg = Util.getString("ExportTeiidShowDdlPage_vdbDeploymentErrorMsg"); -// } -// setThisPageComplete(errorMsg, WARNING); -// return false; -// } -// String ddlStr = getDDL(); -// if(ddlStr==null || ddlStr.trim().equals(Messages.TeiidImportManager_getDdlErrorMsg)) { -// setThisPageComplete(Messages.TeiidImportManager_getDdlErrorMsg,WARNING); -// return false; -// } setThisPageComplete(EMPTY, NONE); return true; diff --git a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/wizards/file/TeiidColumnInfo.java b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/wizards/file/TeiidColumnInfo.java index 5abf13a7ef..f23d3812a6 100644 --- a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/wizards/file/TeiidColumnInfo.java +++ b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/wizards/file/TeiidColumnInfo.java @@ -77,6 +77,8 @@ public class TeiidColumnInfo implements ITeiidColumnInfo { */ private XmlAttribute xmlAttribute; + private boolean noTrim; + /** * Current IStatus representing the state of the input values for this instance of * TeiidColumnInfo @@ -389,6 +391,23 @@ public void setOrdinality(boolean value) { validate(); } + /** + * + * @return no trim value + */ + @Override + public boolean isNoTrim() { + return noTrim; + } + + /** + * + * @param noTrim + */ + public void setNoTrim(boolean noTrim) { + this.noTrim = noTrim; + } + /** * * @return status the IStatus representing the validity of the data in this info object diff --git a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/wizards/file/TeiidMetadataImportOptionsPage.java b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/wizards/file/TeiidMetadataImportOptionsPage.java index b320b9ccca..42428bdf57 100644 --- a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/wizards/file/TeiidMetadataImportOptionsPage.java +++ b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/wizards/file/TeiidMetadataImportOptionsPage.java @@ -59,6 +59,7 @@ import org.teiid.designer.transformation.ui.editors.sqleditor.SqlTextViewer; import org.teiid.designer.type.IDataTypeManagerService; import org.teiid.designer.ui.common.graphics.ColorManager; +import org.teiid.designer.ui.common.table.CheckBoxEditingSupport; import org.teiid.designer.ui.common.table.ComboBoxEditingSupport; import org.teiid.designer.ui.common.table.TableViewerBuilder; import org.teiid.designer.ui.common.util.WidgetFactory; @@ -1004,6 +1005,11 @@ private void createFixedColumnInfoGroup(Composite parent) { column.getColumn().setText(getString("width") + getSpaces(12)); //$NON-NLS-1$ column.setLabelProvider(new ColumnDataLabelProvider(2)); column.setEditingSupport(new ColumnWidthEditingSupport(this.fixedColumnsViewer.getTableViewer())); + + column = fixedColumnsViewer.createColumn(SWT.LEFT, 30, 50, true); + column.getColumn().setText(getString("noTrimLabel") + getSpaces(12)); //$NON-NLS-1$ + column.setLabelProvider(new ColumnDataLabelProvider(3)); + column.setEditingSupport(new NoTrimEditingSupport(this.fixedColumnsViewer.getTableViewer())); if( this.dataFileInfo != null ) { for( ITeiidColumnInfo row : this.dataFileInfo.getColumnInfoList() ) { @@ -1342,6 +1348,9 @@ public String getText(Object element) { case 2: { return Integer.toString(((ITeiidColumnInfo)element).getWidth()); } + case 3: { + return Boolean.toString(((ITeiidColumnInfo)element).isNoTrim()); + } } } return EMPTY; @@ -1562,6 +1571,28 @@ protected void setElementValue( Object element, handleInfoChanged(false); } } + + class NoTrimEditingSupport extends CheckBoxEditingSupport { + + public NoTrimEditingSupport(ColumnViewer viewer) { + super(viewer); + } + + @Override + protected void setElementValue(Object element, Object newValue) { + + if( element instanceof TeiidColumnInfo && newValue instanceof Boolean) { + TeiidColumnInfo info = (TeiidColumnInfo)element; + if(info.isNoTrim() ) { + info.setNoTrim(false); + handleInfoChanged(false); + } else { + info.setNoTrim(true); + handleInfoChanged(false); + } + } + } + } } diff --git a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/wizards/file/TeiidMetadataImportSourcePage.java b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/wizards/file/TeiidMetadataImportSourcePage.java index ea3064cfb0..83a8599915 100644 --- a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/wizards/file/TeiidMetadataImportSourcePage.java +++ b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/wizards/file/TeiidMetadataImportSourcePage.java @@ -968,6 +968,7 @@ void handleSourceModelLocationBrowse() { if (folder != null && sourceModelContainerText != null) { this.info.setSourceModelLocation(folder.getFullPath().makeRelative()); this.sourceModelFilePath = this.info.getSourceModelLocation(); + this.info.setTargetProject(folder.getProject()); this.sourceModelContainerText.setText(this.info.getSourceModelLocation().makeRelative().toString()); } else { this.info.setSourceModelLocation(new Path(StringConstants.EMPTY_STRING)); @@ -1199,11 +1200,6 @@ private boolean validatePage() { setThisPageComplete(Util.getString(I18N_PREFIX + "sourceFileLocationMustBeSpecified"), ERROR); //$NON-NLS-1$ return false; } - IProject project = this.info.getTargetProject(); - if (project == null) { - setThisPageComplete(Util.getString(I18N_PREFIX + "sourceFileLocationMustBeSpecified"), ERROR); //$NON-NLS-1$ - return false; - } String fileText = sourceModelFileText.getText().trim(); diff --git a/plugins/org.teiid.designer.transformation/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.transformation/META-INF/MANIFEST.MF index 24625dde87..1c723f59fc 100644 --- a/plugins/org.teiid.designer.transformation/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.transformation/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.transformation;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.transformation.TransformationPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin @@ -38,6 +38,7 @@ Require-Bundle: org.teiid.designer.core;bundle-version="[9.0.2,10.0.0)", org.eclipse.emf.ecore.xmi;bundle-version="[2.10.2,3.0.0)", org.teiid.designer.metamodels.function;bundle-version="[9.0.2,10.0.0)", org.teiid.designer.relational;bundle-version="[9.0.2,10.0.0)", - org.teiid.designer.spi;bundle-version="[9.0.2,10.0.0)" + org.teiid.designer.spi;bundle-version="[9.0.2,10.0.0)", + org.teiid.designer.extension;bundle-version="[9.0.2,10.0.0)" Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/plugins/org.teiid.designer.transformation/pom.xml b/plugins/org.teiid.designer.transformation/pom.xml index bcdff12db0..0acb1ab8de 100644 --- a/plugins/org.teiid.designer.transformation/pom.xml +++ b/plugins/org.teiid.designer.transformation/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.transformation - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.transformation/src/org/teiid/designer/transformation/aspects/sql/SqlTransformationMappingRootSqlAspect.java b/plugins/org.teiid.designer.transformation/src/org/teiid/designer/transformation/aspects/sql/SqlTransformationMappingRootSqlAspect.java index c70e54a2e5..5481b7e19b 100644 --- a/plugins/org.teiid.designer.transformation/src/org/teiid/designer/transformation/aspects/sql/SqlTransformationMappingRootSqlAspect.java +++ b/plugins/org.teiid.designer.transformation/src/org/teiid/designer/transformation/aspects/sql/SqlTransformationMappingRootSqlAspect.java @@ -8,15 +8,18 @@ package org.teiid.designer.transformation.aspects.sql; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.Iterator; import java.util.List; import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.mapping.Mapping; import org.eclipse.emf.mapping.MappingHelper; import org.teiid.core.designer.util.CoreArgCheck; import org.teiid.core.designer.util.CoreStringUtil; +import org.teiid.core.designer.util.StringConstants; import org.teiid.designer.core.ModelerCore; import org.teiid.designer.core.index.IndexConstants; import org.teiid.designer.core.index.IndexingContext; @@ -35,6 +38,7 @@ import org.teiid.designer.metamodels.transformation.MappingClassColumn; import org.teiid.designer.metamodels.transformation.SqlTransformation; import org.teiid.designer.metamodels.transformation.SqlTransformationMappingRoot; +import org.teiid.designer.metamodels.transformation.TransformationContainer; import org.teiid.designer.metamodels.transformation.TransformationMappingRoot; import org.teiid.designer.query.IQueryFactory; import org.teiid.designer.query.IQueryParser; @@ -480,13 +484,14 @@ public SqlTransformationInfo getTransformationInfo( final EObject eObject, @Override public void updateObject( EObject targetObject, EObject sourceObject ) { + // Nothing to do } /** * Get the User SqlTransformation from a SqlTransformationMappingRoot. This is the nested SqlTransformation that is used to * store the "user" (or non-uuid) SQL strings. * - * @param transMappingRoot the transformation mapping root + * @param root the transformation mapping root * @return the mapping helper */ public static SqlTransformation getUserSqlTransformation( final SqlTransformationMappingRoot root ) { @@ -509,6 +514,92 @@ public static SqlTransformation getUserSqlTransformation( final SqlTransformatio return nestedSqlTrans; } + /** + * Replaces all occurrences of oldModelName with newModelName in the given sql + * + * @param sql + * @param oldLiteral + * @param newLiteral + */ + private static String updateSql(String sql, String oldLiteral, String newLiteral) { + if (sql == null) + return null; + + if (oldLiteral == null || newLiteral == null) + return sql; + + // Remove the xml extension if it exists + oldLiteral = oldLiteral.replace(StringConstants.DOT_XMI, StringConstants.EMPTY_STRING); + newLiteral = newLiteral.replace(StringConstants.DOT_XMI, StringConstants.EMPTY_STRING); + + return sql.replace(oldLiteral, newLiteral); + } + + /** + * Replaces the given old literal in the transformation SQL + * with the new literal + * + * @param mappingRoot the mapping root + * @param oldLiteral the old literal + * @param newLiteral the new literal + */ + public static void replaceTransformationLiteral(SqlTransformationMappingRoot mappingRoot, + String oldLiteral, String newLiteral) { + SqlTransformation sqlTransformation = getUserSqlTransformation(mappingRoot); + if (sqlTransformation == null) + return; + + String selectSql = sqlTransformation.getSelectSql(); + String deleteSql = sqlTransformation.getDeleteSql(); + String updateSql = sqlTransformation.getUpdateSql(); + String insertSql = sqlTransformation.getInsertSql(); + + selectSql = updateSql(selectSql, oldLiteral, newLiteral); + deleteSql = updateSql(deleteSql, oldLiteral, newLiteral); + updateSql = updateSql(updateSql, oldLiteral, newLiteral); + insertSql = updateSql(insertSql, oldLiteral, newLiteral); + + if (selectSql != null) + sqlTransformation.setSelectSql(selectSql); + if (deleteSql != null) + sqlTransformation.setDeleteSql(deleteSql); + if (updateSql != null) + sqlTransformation.setUpdateSql(updateSql); + if (insertSql != null) + sqlTransformation.setInsertSql(insertSql); + } + + /** + * Iterates the collection of target roots and replaces the given + * old literal in the transformation SQL with the new literal + * + * @param targetRoots collection of target roots + * @param oldLiteral the old literal + * @param newLiteral the new literal + */ + public static void replaceTransformationLiteral(Collection targetRoots, String oldLiteral, String newLiteral) { + if (targetRoots == null) + return; + + for (Object childCopy : targetRoots) { + if (! (childCopy instanceof TransformationContainer)) + continue; + + TransformationContainer trContainer = (TransformationContainer) childCopy; + EList mappings = trContainer.getTransformationMappings(); + for (Object mapping : mappings.toArray()) { + if (! (mapping instanceof SqlTransformationMappingRoot)) + continue; + + SqlTransformationMappingRoot mappingRoot = (SqlTransformationMappingRoot) mapping; + SqlTransformationMappingRootSqlAspect.replaceTransformationLiteral( + mappingRoot, + oldLiteral, + newLiteral); + } + } + } + /** * This method attempts to parse the supplied SQL string. The result is returned as a SqlTransformationResult object. * diff --git a/plugins/org.teiid.designer.transformation/src/org/teiid/designer/transformation/ddl/TeiidDDLConstants.java b/plugins/org.teiid.designer.transformation/src/org/teiid/designer/transformation/ddl/TeiidDDLConstants.java index 2096be5961..e48425bee9 100644 --- a/plugins/org.teiid.designer.transformation/src/org/teiid/designer/transformation/ddl/TeiidDDLConstants.java +++ b/plugins/org.teiid.designer.transformation/src/org/teiid/designer/transformation/ddl/TeiidDDLConstants.java @@ -89,5 +89,43 @@ public interface TeiidDDLConstants { public static final String DETERMINISM_OPT_USER_DETERMINISTIC = "USER_DETERMINISTIC"; //$NON-NLS-1$ public static final String DETERMINISM_OPT_VDB_DETERMINISTIC = "VDB_DETERMINISTIC"; //$NON-NLS-1$ public static final String DETERMINISM_OPT_DETERMINISTIC = "DETERMINISTIC"; //$NON-NLS-1$ + public static final String RETURNS = "RETURNS"; //$NON-NLS-1$ + public static final String TABLE = "TABLE"; //$NON-NLS-1$ + public static final String IN = "IN"; //$NON-NLS-1$ + public static final String INOUT = "INOUT"; //$NON-NLS-1$ + public static final String OUT = "OUT"; //$NON-NLS-1$ + public static final String DEFAULT = "DEFAULT"; //$NON-NLS-1$ + + /* REST EXTENSION PROPERTIES + METHOD HTTP Method to use Yes GET | POST| PUT | DELETE + URI URI of procedure Yes ex:/procedure + PRODUCES Type of content produced by the service no xml | json | plain | any text + CHARSET When procedure returns Blob, and content type text based, this character set to used to convert the data no US-ASCII | UTF-8 + */ + public static final String METHOD = "METHOD"; //$NON-NLS-1$ + public static final String REST_METHOD = "REST:METHOD"; //$NON-NLS-1$ + public static final String URI = "URI"; //$NON-NLS-1$ + public static final String REST_URI = "REST:URI"; //$NON-NLS-1$ + public static final String PRODUCES = "PRODUCES"; //$NON-NLS-1$ + public static final String REST_PRODUCES = "REST:PRODUCES"; //$NON-NLS-1$ + public static final String CHARSET = "CHARSET"; //$NON-NLS-1$ + public static final String REST_CHARSET = "REST:CHARSET"; //$NON-NLS-1$ + public static final String REST_TEIID_SET_NAMESPACE = "SET NAMESPACE 'http://teiid.org/rest' AS REST;"; //$NON-NLS-1$ + + public static String TEIID_SF_PREFIX = "teiid_sf"; //$NON-NLS-1$ + public static String SALESFORCE_PREFIX = "salesforce"; //$NON-NLS-1$ + + public static String TEIID_MONGO_PREFIX = "teiid_mongo"; //$NON-NLS-1$ + public static String MONGODB_PREFIX = "mongodb"; //$NON-NLS-1$"; //$NON-NLS-1$ + + /* + * Teiid's EXCEL extension properties + */ + public static String TEIID_EXCEL_PREFIX = "teiid_excel"; //$NON-NLS-1$ + public static String EXCEL_PREFIX = "excel"; //$NON-NLS-1$"; //$NON-NLS-1$ + public static String EXCEL_CELL_NUMBER = "CELL_NUMBER"; //$NON-NLS-1$"; //$NON-NLS-1$ COLUMN ONLY + public static String EXCEL_FILE = "FILE"; //$NON-NLS-1$"; //$NON-NLS-1$ TABLE + public static String EXCEL_FIRST_DATA_ROW_NUMBER = "FIRST_DATA_ROW_NUMBER"; //$NON-NLS-1$"; //$NON-NLS-1$ TABLE + } diff --git a/plugins/org.teiid.designer.transformation/src/org/teiid/designer/transformation/ddl/TeiidModelToDdlGenerator.java b/plugins/org.teiid.designer.transformation/src/org/teiid/designer/transformation/ddl/TeiidModelToDdlGenerator.java index 7bfe32fa6f..ed4ce7befc 100644 --- a/plugins/org.teiid.designer.transformation/src/org/teiid/designer/transformation/ddl/TeiidModelToDdlGenerator.java +++ b/plugins/org.teiid.designer.transformation/src/org/teiid/designer/transformation/ddl/TeiidModelToDdlGenerator.java @@ -9,8 +9,10 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; import org.eclipse.core.runtime.IStatus; @@ -27,8 +29,13 @@ import org.teiid.designer.core.util.ModelContents; import org.teiid.designer.core.workspace.ModelResource; import org.teiid.designer.core.workspace.ModelWorkspaceException; +import org.teiid.designer.extension.ExtensionPlugin; +import org.teiid.designer.extension.ModelExtensionAssistantAggregator; +import org.teiid.designer.extension.definition.ModelObjectExtensionAssistant; +import org.teiid.designer.extension.properties.ModelExtensionPropertyDefinition; import org.teiid.designer.metamodels.relational.BaseTable; import org.teiid.designer.metamodels.relational.Column; +import org.teiid.designer.metamodels.relational.DirectionKind; import org.teiid.designer.metamodels.relational.ForeignKey; import org.teiid.designer.metamodels.relational.NullableType; import org.teiid.designer.metamodels.relational.PrimaryKey; @@ -37,7 +44,10 @@ import org.teiid.designer.metamodels.relational.SearchabilityType; import org.teiid.designer.metamodels.relational.Table; import org.teiid.designer.metamodels.relational.UniqueConstraint; +import org.teiid.designer.metamodels.relational.UniqueKey; import org.teiid.designer.metamodels.relational.extension.RelationalModelExtensionAssistant; +import org.teiid.designer.metamodels.relational.extension.RestModelExtensionAssistant; +import org.teiid.designer.metamodels.relational.extension.RestModelExtensionConstants; import org.teiid.designer.metamodels.relational.util.RelationalUtil; import org.teiid.designer.metamodels.transformation.TransformationMappingRoot; import org.teiid.designer.relational.RelationalConstants; @@ -50,7 +60,7 @@ /** * Generator for converting a teiid xmi model into DDL */ -public class TeiidModelToDdlGenerator implements TeiidDDLConstants, TeiidReservedConstants { +public class TeiidModelToDdlGenerator implements TeiidDDLConstants, TeiidReservedConstants, RelationalConstants { private StringBuilder ddlBuffer = new StringBuilder(); @@ -63,6 +73,10 @@ public class TeiidModelToDdlGenerator implements TeiidDDLConstants, TeiidReserve private RelationalModelExtensionAssistant assistant; private List issues = new ArrayList(); + + private Set namespaces = new HashSet(); + + private ModelExtensionAssistantAggregator medAggregator = ExtensionPlugin.getInstance().getModelExtensionAssistantAggregator(); /** * @param modelResource @@ -84,7 +98,12 @@ public String generate(ModelResource modelResource) throws ModelWorkspaceExcepti append(StringConstants.NEW_LINE); } } - + if( ! namespaces.isEmpty() ) { + for( String namespace : namespaces ) { + ddlBuffer.insert(0, namespace + NEW_LINE); + } + ddlBuffer.insert(0, NEW_LINE); + } return ddlBuffer.toString(); } @@ -132,7 +151,12 @@ private String resolveExportedDataType(EObject dataTypeEObject) { String runtimeTypeName = ModelerCore.getBuiltInTypesManager().getRuntimeTypeName(dataTypeEObject); - if( runtimeTypeName.equalsIgnoreCase("XMLLITERAL")) { + if( runtimeTypeName == null) { + // Check with + runtimeTypeName = ModelerCore.getDatatypeManager().getRuntimeTypeName(dataTypeEObject); + } + + if( runtimeTypeName != null && runtimeTypeName.equalsIgnoreCase("XMLLITERAL")) { return DataTypeName.XML.name(); } @@ -304,7 +328,7 @@ private String view(Table table) { // QueryDisplayFormatter formatter = new QueryDisplayFormatter(sqlString); // String formatedSQL = formatter.getFormattedSql(); // sb.append(SPACE).append(NEW_LINE + Reserved.AS).append(NEW_LINE + TAB).append(formatedSQL); - sb.append(SPACE).append(NEW_LINE + Reserved.AS).append(NEW_LINE + TAB + TAB).append(sqlString); + sb.append(SPACE).append(NEW_LINE + Reserved.AS).append(NEW_LINE + TAB).append(sqlString); sb.append(SEMI_COLON + NEW_LINE); } @@ -339,21 +363,72 @@ private String procedure(Procedure procedure) { List params = procedure.getParameters(); int nParams = params.size(); int count = 0; + + // Check for an "RETURN" parameter direction and cache it's datatype + String returnType = null; + + for( ProcedureParameter param : params ) { + if( param.getDirection() == DirectionKind.RETURN_LITERAL) { + returnType = resolveExportedDataType(param.getType()); + break; + } + } + + if( returnType != null ) { + nParams = nParams-1; + } + for( ProcedureParameter param : params ) { + if( param.getDirection() == DirectionKind.RETURN_LITERAL) { + continue; + } String paramStr = getParameterDdl(param); count++; sb.append(paramStr); + + addOptionsForEObject(param, sb); + if( count < nParams ) sb.append(COMMA + SPACE); } + sb.append(CLOSE_BRACKET); + + // Add the RETURNS clause to handle the result set + // CREATE VIRTUAL PROCEDURE testProc (p1 string(4000)) RETURNS TABLE ( xml_out xml) + // CREATE VIRTUAL PROCEDURE getTweets(query varchar) RETURNS (created_on varchar(25), from_user varchar(25), to_user varchar(25)) + // CREATE FOREIGN PROCEDURE func (x integer, y integer) returns table (z integer); + // CREATE FOREIGN PROCEDURE func (x integer, y integer) returns integer; + // CREATE VIRTUAL FUNCTION celsiusToFahrenheit(celsius decimal) RETURNS decimal OPTIONS (JAVA_CLASS 'org.something.TempConv', JAVA_METHOD 'celsiusToFahrenheit'); + // CREATE VIRTUAL FUNCTION sumAll(arg integer) RETURNS integer OPTIONS (JAVA_CLASS 'org.something.SumAll', JAVA_METHOD 'addInput', AGGREGATE 'true', VARARGS 'true', "NULL-ON-NULL" 'true'); + + if( procedure.getResult() != null ) { + sb.append(SPACE + RETURNS + SPACE + TABLE + SPACE); + sb.append(OPEN_BRACKET); + count = 0; + int nCols = procedure.getResult().getColumns().size(); + for( Object col : procedure.getResult().getColumns() ) { + Column nextCol = (Column)col; + count++; + String columnStr = getColumnDdl(nextCol); + sb.append(columnStr); + if( count < nCols ) sb.append(COMMA + SPACE); + + addOptionsForEObject(nextCol, sb); + } + sb.append(CLOSE_BRACKET); + addOptionsForEObject(procedure.getResult(), sb); + } else if( returnType != null ) { + sb.append(SPACE + RETURNS + SPACE + returnType); + } String options = getProcedureOptions(procedure); if( !StringUtilities.isEmpty(options)) { - sb.append(NEW_LINE + CLOSE_BRACKET); + sb.append(NEW_LINE); sb.append(SPACE).append(options); - } else { - sb.append(CLOSE_BRACKET); } +// else { +// sb.append(CLOSE_BRACKET); +// } // Depending on the procedure type, need to append either one of the following: // > returns datatype @@ -362,9 +437,13 @@ private String procedure(Procedure procedure) { // > ??? if( isVirtual && !isFunction ) { TransformationMappingRoot tRoot = (TransformationMappingRoot)TransformationHelper.getTransformationMappingRoot(procedure); - String sqlString = TransformationHelper.getSelectSqlString(tRoot); + String sqlString = TransformationHelper.getSelectSqlString(tRoot).replace(CREATE_VIRTUAL_PROCEDURE, StringConstants.EMPTY_STRING); + if( sqlString != null ) { - sb.append(NEW_LINE + TAB).append(Reserved.AS).append(NEW_LINE + SPACE).append(sqlString); + if( sqlString.indexOf('\n') == 0 ) { + sqlString = sqlString.replace(StringConstants.NEW_LINE, StringConstants.EMPTY_STRING); + } + sb.append(NEW_LINE + TAB).append(Reserved.AS).append(NEW_LINE).append(sqlString); if( ! sqlString.endsWith(SEMI_COLON)) sb.append(SEMI_COLON); sb.append(NEW_LINE); } @@ -389,8 +468,9 @@ private String getColumnProperties(Column col) { // DEFAULT // String defaultValue = col.getDefaultValue(); - if (defaultValue != null) + if (!StringUtilities.isEmpty(defaultValue)) { sb.append(TeiidSQLConstants.Reserved.DEFAULT).append(SPACE).append(defaultValue).append(SPACE); + } // // AUTO_INCREMENT @@ -453,6 +533,17 @@ private String getColumnOptions(Column col) { if( !col.getSearchability().equals(SearchabilityType.SEARCHABLE) ) { options.add(SEARCHABLE, col.getSearchability().getLiteral(), SearchabilityType.SEARCHABLE_LITERAL.toString()); } + + // Need to check with other assistants too + try { + Map props = getOptionsForObject(col); + for( String key : props.keySet() ) { + String value = props.get(key); + options.add(key, value, null); + } + } catch (Exception e) { + issues.add(new Status(IStatus.ERROR, TransformationPlugin.PLUGIN_ID, "Error finding options for " + getName(col), e)); //$NON-NLS-1$ + } return options.toString(); } @@ -510,19 +601,39 @@ private String getContraints(BaseTable table) { } // REFERENCES if( fk.getTable() != null ) { - BaseTable fkTableRef = (BaseTable)fk.getUniqueKey().getTable(); + UniqueKey uk = fk.getUniqueKey(); + BaseTable fkTableRef = (BaseTable)uk.getTable(); + String fkTableRefName = getName(fkTableRef); theSB.append(SPACE).append(REFERENCES).append(SPACE).append(fkTableRefName); - PrimaryKey pkRef = fkTableRef.getPrimaryKey(); - nColumns = pkRef.getColumns().size(); - count = 0; - for( Object col : pkRef.getColumns() ) { - count++; - if( count == 1 ) theSB.append(OPEN_BRACKET); - theSB.append(getName((EObject)col)); - if( count < nColumns ) theSB.append(COMMA + SPACE); - else theSB.append(CLOSE_BRACKET); + if( uk instanceof UniqueConstraint ) { + // Unique Constraint + UniqueConstraint ucRef = fkTableRef.getUniqueConstraints().get(0); + nColumns = ucRef.getColumns().size(); + count = 0; + for( Object col : ucRef.getColumns() ) { + count++; + if( count == 1 ) theSB.append(OPEN_BRACKET); + theSB.append(getName((EObject)col)); + if( count < nColumns ) theSB.append(COMMA + SPACE); + else theSB.append(CLOSE_BRACKET); + } + // TODO: Not sure how to handle the case where there are multiple UC's. + + } else { + // Primary Key + PrimaryKey pkRef = fkTableRef.getPrimaryKey(); + nColumns = pkRef.getColumns().size(); + count = 0; + for( Object col : pkRef.getColumns() ) { + count++; + if( count == 1 ) theSB.append(OPEN_BRACKET); + theSB.append(getName((EObject)col)); + if( count < nColumns ) theSB.append(COMMA + SPACE); + else theSB.append(CLOSE_BRACKET); + } } + } sb.append(theSB.toString()); @@ -559,7 +670,7 @@ private String getContraints(BaseTable table) { private String getTableOptions(Table table) { OptionsStatement options = new OptionsStatement(); - + options.add(NAMEINSOURCE, table.getNameInSource(), null); options.add(MATERIALIZED, Boolean.toString(table.isMaterialized()), Boolean.FALSE.toString()); options.add(UPDATABLE, Boolean.toString(table.isSupportsUpdate()), Boolean.TRUE.toString()); @@ -569,7 +680,18 @@ private String getTableOptions(Table table) { if( table.getMaterializedTable() != null ) { options.add(MATERIALIZED_TABLE, table.getMaterializedTable().getName(), null); } - + + // Need to check with other assistants too + try { + Map props = getOptionsForObject(table); + for( String key : props.keySet() ) { + String value = props.get(key); + options.add(key, value, null); + } + } catch (Exception e) { + issues.add(new Status(IStatus.ERROR, TransformationPlugin.PLUGIN_ID, "Error finding options for " + getName(table), e)); //$NON-NLS-1$ + } + String desc = getDescription(table); if( !StringUtilities.isEmpty(desc) ) { options.add(ANNOTATION, desc, null); @@ -578,66 +700,167 @@ private String getTableOptions(Table table) { return options.toString(); } + private Map getOptionsForObject(EObject modelObject) throws Exception { + Map options = new HashMap(); + + Collection extensionNamespaces = medAggregator.getSupportedNamespacePrefixes(modelObject); + for( String ns : extensionNamespaces ) { + ModelObjectExtensionAssistant assistant = medAggregator.getModelObjectExtensionAssistant(ns); + if( assistant != null ) { + Collection defns = assistant.getPropertyDefinitions(modelObject); + + // If relational, we're handling this via getPropetyValue()... + if(ns.equals(RELATIONAL_PREFIX)) { + String propId = BASE_TABLE_EXT_PROPERTIES.NATIVE_QUERY; + String nativeQuery = assistant.getOverriddenValue(modelObject, propId); + if(!CoreStringUtil.isEmpty(nativeQuery)) { + propId = propId.replace(RELATIONAL_PREFIX, TEIID_REL_PREFIX); + options.put(propId, nativeQuery); + } + propId = BASE_TABLE_EXT_PROPERTIES.VIEW_TABLE_GLOBAL_TEMP_TABLE; + String globalTempTable = assistant.getOverriddenValue(modelObject, propId); + if(!CoreStringUtil.isEmpty(globalTempTable)) { + propId = propId.replace(RELATIONAL_PREFIX, TEIID_REL_PREFIX); + options.put(propId, globalTempTable); + } + } else if(ns.equals(SALESFORCE_PREFIX) ) { + for( ModelExtensionPropertyDefinition ext : defns) { + String propId = ext.getId(); + String value = assistant.getOverriddenValue(modelObject, propId); + + if( value != null ) { + propId = propId.replace(SALESFORCE_PREFIX, TEIID_SF_PREFIX); + options.put(propId, value); + } + } + } else if(ns.equals(MONGODB_PREFIX)) { + for( ModelExtensionPropertyDefinition ext : defns) { + String propId = ext.getId(); + String value = assistant.getOverriddenValue(modelObject, propId); + + if( value != null ) { + propId = propId.replace(MONGODB_PREFIX, TEIID_MONGO_PREFIX); + options.put(propId, value); + } + } + } else if(ns.equals(EXCEL_PREFIX)) { + for( ModelExtensionPropertyDefinition ext : defns) { + String propId = ext.getId(); + String value = assistant.getOverriddenValue(modelObject, propId); + + if( value != null ) { + propId = propId.replace(EXCEL_PREFIX, TEIID_EXCEL_PREFIX); + options.put(propId, value); + } + } + } + + } + } + + return options; + + } + + private void addOptionsForEObject(EObject eObj, StringBuilder sb) { + // Need to check with other assistants too + try { + OptionsStatement options = new OptionsStatement(); + Map props = getOptionsForObject(eObj); + for( String key : props.keySet() ) { + String value = props.get(key); + options.add(key, value, null); + } + if( !StringUtilities.isEmpty(options.toString())) { + sb.append(SPACE).append(options); + } + } catch (Exception e) { + issues.add(new Status(IStatus.ERROR, TransformationPlugin.PLUGIN_ID, "Error finding options for " + getName(eObj), e)); //$NON-NLS-1$ + } + } + private String getProcedureOptions(Procedure procedure) { OptionsStatement options = new OptionsStatement(); options.add(NAMEINSOURCE, procedure.getNameInSource(), null); - String nativeQuery = getPropertyValue(procedure, RelationalConstants.PROCEDURE_EXT_PROPERTIES.NATIVE_QUERY); + String nativeQuery = getPropertyValue(procedure, PROCEDURE_EXT_PROPERTIES.NATIVE_QUERY); if(!CoreStringUtil.isEmpty(nativeQuery)) { options.add(NATIVE_QUERY_PROP, nativeQuery, null); } // Physical Model only if( !isVirtual ) { - String nonPreparedValue = getPropertyValue(procedure, RelationalConstants.PROCEDURE_EXT_PROPERTIES.NON_PREPARED); + String nonPreparedValue = getPropertyValue(procedure, PROCEDURE_EXT_PROPERTIES.NON_PREPARED); setBooleanProperty(NON_PREPARED_PROP, nonPreparedValue, false, options); } // Functions have many additional extension properties boolean isFunction = procedure.isFunction(); if(isFunction) { - String value = getPropertyValue(procedure, RelationalConstants.PROCEDURE_EXT_PROPERTIES.FUNCTION_CATEGORY); + String value = getPropertyValue(procedure, PROCEDURE_EXT_PROPERTIES.FUNCTION_CATEGORY); options.add(FUNCTION_CATEGORY_PROP, value, null); - value = getPropertyValue(procedure, RelationalConstants.PROCEDURE_EXT_PROPERTIES.JAVA_CLASS); + value = getPropertyValue(procedure, PROCEDURE_EXT_PROPERTIES.JAVA_CLASS); options.add(JAVA_CLASS, value, null); - value = getPropertyValue(procedure, RelationalConstants.PROCEDURE_EXT_PROPERTIES.JAVA_METHOD); + value = getPropertyValue(procedure, PROCEDURE_EXT_PROPERTIES.JAVA_METHOD); options.add(JAVA_METHOD, value, null); - value = getPropertyValue(procedure, RelationalConstants.PROCEDURE_EXT_PROPERTIES.VARARGS); + value = getPropertyValue(procedure, PROCEDURE_EXT_PROPERTIES.VARARGS); setBooleanProperty(VARARGS_PROP, value, false, options); - value = getPropertyValue(procedure, RelationalConstants.PROCEDURE_EXT_PROPERTIES.NULL_ON_NULL); + value = getPropertyValue(procedure, PROCEDURE_EXT_PROPERTIES.NULL_ON_NULL); setBooleanProperty(NULL_ON_NULL_PROP, value, false, options); - value = getPropertyValue(procedure, RelationalConstants.PROCEDURE_EXT_PROPERTIES.DETERMINISTIC); + value = getPropertyValue(procedure, PROCEDURE_EXT_PROPERTIES.DETERMINISTIC); setBooleanProperty(DETERMINISM_PROP, value, false, options); - value = getPropertyValue(procedure, RelationalConstants.PROCEDURE_EXT_PROPERTIES.AGGREGATE); + value = getPropertyValue(procedure, PROCEDURE_EXT_PROPERTIES.AGGREGATE); if( value != null ) { boolean booleanValue = Boolean.getBoolean(value); if( booleanValue ) { setBooleanProperty(AGGREGATE_PROP, value, false, options); - value = getPropertyValue(procedure, RelationalConstants.PROCEDURE_EXT_PROPERTIES.ANALYTIC); + value = getPropertyValue(procedure, PROCEDURE_EXT_PROPERTIES.ANALYTIC); setBooleanProperty(ANALYTIC_PROP, value, false, options); - value = getPropertyValue(procedure, RelationalConstants.PROCEDURE_EXT_PROPERTIES.ALLOWS_ORDER_BY); + value = getPropertyValue(procedure, PROCEDURE_EXT_PROPERTIES.ALLOWS_ORDER_BY); setBooleanProperty(ALLOWS_ORDER_BY_PROP, value, false, options); - value = getPropertyValue(procedure, RelationalConstants.PROCEDURE_EXT_PROPERTIES.USES_DISTINCT_ROWS); + value = getPropertyValue(procedure, PROCEDURE_EXT_PROPERTIES.USES_DISTINCT_ROWS); setBooleanProperty(USES_DISTINCT_ROWS_PROP, value, false, options); - value = getPropertyValue(procedure, RelationalConstants.PROCEDURE_EXT_PROPERTIES.ALLOWS_DISTINCT); + value = getPropertyValue(procedure, PROCEDURE_EXT_PROPERTIES.ALLOWS_DISTINCT); setBooleanProperty(ALLOWS_DISTINCT_PROP, value, false, options); - value = getPropertyValue(procedure, RelationalConstants.PROCEDURE_EXT_PROPERTIES.DECOMPOSABLE); + value = getPropertyValue(procedure, PROCEDURE_EXT_PROPERTIES.DECOMPOSABLE); setBooleanProperty(DECOMPOSABLE_PROP, value, false, options); } } + } else { + // REST PROPERTIES?? + String value = getRestPropertyValue(procedure, RestModelExtensionConstants.PropertyIds.URI); + if( value != null ) namespaces.add(REST_TEIID_SET_NAMESPACE); + + options.add(REST_URI, value, null); + + value = getRestPropertyValue(procedure, RestModelExtensionConstants.PropertyIds.REST_METHOD); + if( value != null ) namespaces.add(REST_TEIID_SET_NAMESPACE); + + options.add(REST_METHOD, value, null); + } + + // Need to check with other assistants too + try { + Map props = getOptionsForObject(procedure); + for( String key : props.keySet() ) { + String value = props.get(key); + options.add(key, value, null); + } + } catch (Exception e) { + issues.add(new Status(IStatus.ERROR, TransformationPlugin.PLUGIN_ID, "Error finding options for " + getName(procedure), e)); //$NON-NLS-1$ } return options.toString(); @@ -662,6 +885,17 @@ private String getPropertyValue(EObject eObj, String propertyID ) { return null; } + private String getRestPropertyValue(EObject eObj, String propertyID ) { + + try { + return RestModelExtensionAssistant.getRestProperty(eObj, propertyID); + } catch (Exception e) { + e.printStackTrace(); + } + + return null; + } + private void setBooleanProperty(String propID, String stringValue, boolean defaultValue, OptionsStatement options) { if( stringValue != null ) { boolean booleanValue = Boolean.parseBoolean(stringValue); @@ -696,7 +930,7 @@ private String escapeSinglePart(String token) { * Utility to check a unique constraint and determine if it is redundant. Basically if the uc columns match a PK with the same columns */ private Collection getUniqueUniqueContraints(BaseTable table) { - EList ucs = table.getUniqueConstraints(); + EList ucs = table.getUniqueConstraints(); Collection uniqueConstraints = new ArrayList(); PrimaryKey pk = table.getPrimaryKey(); @@ -704,8 +938,8 @@ private Collection getUniqueUniqueContraints(BaseTable table) for( Object obj: ucs) { UniqueConstraint uc = (UniqueConstraint)obj; if( pk != null ) { - EList pkColumns = pk.getColumns(); - EList ucColumns = uc.getColumns(); + EList pkColumns = pk.getColumns(); + EList ucColumns = uc.getColumns(); if( pkColumns.size() == ucColumns.size() ) { boolean matchesAll = true; diff --git a/plugins/org.teiid.designer.transformation/src/org/teiid/designer/transformation/model/RelationalViewModelFactory.java b/plugins/org.teiid.designer.transformation/src/org/teiid/designer/transformation/model/RelationalViewModelFactory.java index b2c58ea39a..1caf700bb0 100644 --- a/plugins/org.teiid.designer.transformation/src/org/teiid/designer/transformation/model/RelationalViewModelFactory.java +++ b/plugins/org.teiid.designer.transformation/src/org/teiid/designer/transformation/model/RelationalViewModelFactory.java @@ -194,9 +194,16 @@ protected void applyTableExtensionProperties(RelationalTable tableRef, BaseTable protected void applyProcedureExtensionProperties( RelationalProcedure procedureRef, Procedure procedure) { RelationalViewProcedure viewProcedure = (RelationalViewProcedure)procedureRef; - RestModelExtensionAssistant.setRestProperties( + if( !viewProcedure.isFunction() ) { + RestModelExtensionAssistant.setRestProperties( procedure, viewProcedure.getRestMethod(), viewProcedure.getRestUri(), viewProcedure.getRestCharSet(), viewProcedure.getRestHeaders(), viewProcedure.getRestDescription()); + } super.applyProcedureExtensionProperties(procedureRef, procedure); } + + public void addTransformation(BaseTable baseTable, RelationalViewTable viewTable) { + // Set the transformation SQL + TransformationHelper.createTransformation(baseTable, viewTable.getTransformationSQL()); + } } diff --git a/plugins/org.teiid.designer.udf.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.udf.ui/META-INF/MANIFEST.MF index 1bac193aaa..7e35876d66 100644 --- a/plugins/org.teiid.designer.udf.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.udf.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.udf.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %pluginProvider Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/plugins/org.teiid.designer.udf.ui/pom.xml b/plugins/org.teiid.designer.udf.ui/pom.xml index b036ba4a14..b1c3244f98 100644 --- a/plugins/org.teiid.designer.udf.ui/pom.xml +++ b/plugins/org.teiid.designer.udf.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.udf.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.udf/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.udf/META-INF/MANIFEST.MF index aadc916030..128efa0e87 100644 --- a/plugins/org.teiid.designer.udf/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.udf/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.udf;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %pluginProvider Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/plugins/org.teiid.designer.udf/pom.xml b/plugins/org.teiid.designer.udf/pom.xml index 3d0558da97..a77857d59c 100644 --- a/plugins/org.teiid.designer.udf/pom.xml +++ b/plugins/org.teiid.designer.udf/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.udf - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.ui.common/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.ui.common/META-INF/MANIFEST.MF index d9415c185a..97c522ec68 100644 --- a/plugins/org.teiid.designer.ui.common/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.ui.common/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.ui.common;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.ui.common.UiPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.ui.common/pom.xml b/plugins/org.teiid.designer.ui.common/pom.xml index 1f9b72f2ef..d779e9b948 100644 --- a/plugins/org.teiid.designer.ui.common/pom.xml +++ b/plugins/org.teiid.designer.ui.common/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.ui.common - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.ui.common/src/org/teiid/designer/ui/common/widget/ListMessageDialog.java b/plugins/org.teiid.designer.ui.common/src/org/teiid/designer/ui/common/widget/ListMessageDialog.java index 0a4d76c8ca..81b3f51dc3 100644 --- a/plugins/org.teiid.designer.ui.common/src/org/teiid/designer/ui/common/widget/ListMessageDialog.java +++ b/plugins/org.teiid.designer.ui.common/src/org/teiid/designer/ui/common/widget/ListMessageDialog.java @@ -9,8 +9,10 @@ import java.util.Collections; import java.util.List; + import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jface.viewers.IBaseLabelProvider; import org.eclipse.jface.viewers.ListViewer; import org.eclipse.swt.SWT; @@ -33,6 +35,8 @@ public class ListMessageDialog extends MessageDialog { /////////////////////////////////////////////////////////////////////////////////////////////// private static final String[] DEFAULT_BUTTONS = new String[] {IDialogConstants.OK_LABEL}; private static final String[] QUESTION_BUTTONS = new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL}; + + private static boolean allowResize; /////////////////////////////////////////////////////////////////////////////////////////////// // CLASS METHODS @@ -56,7 +60,30 @@ private static int openDialog(Shell theShell, int theDialogType, List theItems, IBaseLabelProvider theLabelProvider) { - return openDialog(theShell, theTitle, theImage, theMessage, theDialogType, theItems, theLabelProvider, DEFAULT_BUTTONS); + return openDialog(theShell, theTitle, theImage, theMessage, theDialogType, theItems, theLabelProvider, DEFAULT_BUTTONS, false); + } + + /** + * Constructs and opens a dialog. + * @param theShell the parent window + * @param theTitle the dialog title + * @param theImage the dialog image (may be null) + * @param theMessage the dialog message + * @param theDialogType the dialog type (error, warning, info) + * @param theItems the items being displayed (may be null) + * @param theLabelProvider the list label provider (may be null) + * @param allowResizing allow dialog to be resized + * @return the return code + */ + private static int openDialog(Shell theShell, + String theTitle, + Image theImage, + String theMessage, + int theDialogType, + List theItems, + IBaseLabelProvider theLabelProvider, + boolean allowResizing) { + return openDialog(theShell, theTitle, theImage, theMessage, theDialogType, theItems, theLabelProvider, DEFAULT_BUTTONS, allowResizing); } /** @@ -78,11 +105,15 @@ private static int openDialog(Shell theShell, int theDialogType, List theItems, IBaseLabelProvider theLabelProvider, - String[] dialogButtonLabels) { + String[] dialogButtonLabels, + boolean allowResizing) { + allowResize = allowResizing; ListMessageDialog dialog = new ListMessageDialog(theShell, theTitle, theImage, theMessage, theDialogType, dialogButtonLabels); dialog.setLabelProvider(theLabelProvider); dialog.setItems(theItems); - return dialog.open(); + int result = dialog.open(); + allowResize = false; + return result; } /** @@ -104,6 +135,27 @@ public static void openError(Shell theShell, openDialog(theShell, theTitle, theImage, theMessage, ERROR, theItems, theLabelProvider); } + /** + * Opens an error dialog showing the specified items. + * @param theShell the parent window + * @param theTitle the dialog title + * @param theImage the dialog image (may be null) + * @param theMessage the dialog message + * @param theItems the items being displayed (may be null) + * @param theLabelProvider the list label provider (may be null) + * @param allowResizing allow dialog to be resized + * @since 4.2 + */ + public static void openError(Shell theShell, + String theTitle, + Image theImage, + String theMessage, + List theItems, + IBaseLabelProvider theLabelProvider, + boolean allowResizing) { + openDialog(theShell, theTitle, theImage, theMessage, ERROR, theItems, theLabelProvider, allowResizing); + } + /** * Opens an information dialog showing the specified items. * @param theShell the parent window @@ -123,6 +175,27 @@ public static void openInformation(Shell theShell, openDialog(theShell, theTitle, theImage, theMessage, INFORMATION, theItems, theLabelProvider); } + /** + * Opens an information dialog showing the specified items. + * @param theShell the parent window + * @param theTitle the dialog title + * @param theImage the dialog image (may be null) + * @param theMessage the dialog message + * @param theItems the items being displayed (may be null) + * @param theLabelProvider the list label provider (may be null) + * @param allowResizing allow dialog to be resized + * @since 4.2 + */ + public static void openInformation(Shell theShell, + String theTitle, + Image theImage, + String theMessage, + List theItems, + IBaseLabelProvider theLabelProvider, + boolean allowResizing) { + openDialog(theShell, theTitle, theImage, theMessage, INFORMATION, theItems, theLabelProvider, allowResizing); + } + /** * Opens a warning dialog showing the specified items. * @param theShell the parent window @@ -141,6 +214,26 @@ public static void openWarning(Shell theShell, IBaseLabelProvider theLabelProvider) { openDialog(theShell, theTitle, theImage, theMessage, WARNING, theItems, theLabelProvider); } + + /** + * Opens a warning dialog showing the specified items. + * @param theShell the parent window + * @param theTitle the dialog title + * @param theImage the dialog image (may be null) + * @param theMessage the dialog message + * @param theItems the items being displayed (may be null) + * @param theLabelProvider the list label provider (may be null) + * @since 4.2 + */ + public static void openWarning(Shell theShell, + String theTitle, + Image theImage, + String theMessage, + List theItems, + IBaseLabelProvider theLabelProvider, + boolean allowResizing) { + openDialog(theShell, theTitle, theImage, theMessage, WARNING, theItems, theLabelProvider, allowResizing); + } /** * Opens a confirm dialog showing the specified items. @@ -158,7 +251,28 @@ public static boolean openQuestion(Shell theShell, String theMessage, List theItems, IBaseLabelProvider theLabelProvider) { - return openDialog(theShell, theTitle, theImage, theMessage, QUESTION, theItems, theLabelProvider, QUESTION_BUTTONS) == OK; + return openDialog(theShell, theTitle, theImage, theMessage, QUESTION, theItems, theLabelProvider, QUESTION_BUTTONS, false) == OK; + } + + /** + * Opens a confirm dialog showing the specified items. + * @param theShell the parent window + * @param theTitle the dialog title + * @param theImage the dialog image (may be null) + * @param theMessage the dialog message + * @param theItems the items being displayed (may be null) + * @param theLabelProvider the list label provider (may be null) + * @param allowResizing allow dialog to be resized + * @since 4.2 + */ + public static boolean openQuestion(Shell theShell, + String theTitle, + Image theImage, + String theMessage, + List theItems, + IBaseLabelProvider theLabelProvider, + boolean allowResizing) { + return openDialog(theShell, theTitle, theImage, theMessage, QUESTION, theItems, theLabelProvider, QUESTION_BUTTONS, allowResizing) == OK; } /** @@ -177,7 +291,27 @@ public static boolean openWarningQuestion(Shell theShell, String theMessage, List theItems, IBaseLabelProvider theLabelProvider) { - return openDialog(theShell, theTitle, theImage, theMessage, WARNING, theItems, theLabelProvider, QUESTION_BUTTONS) == OK; + return openWarningQuestion(theShell, theTitle, theImage, theMessage, theItems, theLabelProvider, false); + } + + /** + * Opens a confirm dialog showing the specified items, using a WARNING icon. + * @param theShell the parent window + * @param theTitle the dialog title + * @param theImage the dialog image (may be null) + * @param theMessage the dialog message + * @param theItems the items being displayed (may be null) + * @param theLabelProvider the list label provider (may be null) + * @since 4.2 + */ + public static boolean openWarningQuestion(Shell theShell, + String theTitle, + Image theImage, + String theMessage, + List theItems, + IBaseLabelProvider theLabelProvider, + boolean allowResizing) { + return openDialog(theShell, theTitle, theImage, theMessage, WARNING, theItems, theLabelProvider, QUESTION_BUTTONS, allowResizing) == OK; } /////////////////////////////////////////////////////////////////////////////////////////////// @@ -204,7 +338,9 @@ protected ListMessageDialog(Shell theShell, int theDialogImageType, String[] dialogButtonLabels) { super(theShell, theTitle, null, theMessage, theDialogImageType, dialogButtonLabels, 0); -// setShellStyle(getShellStyle() | SWT.RESIZE); + if( allowResize ) { + setShellStyle(getShellStyle() | SWT.RESIZE); + } } /////////////////////////////////////////////////////////////////////////////////////////////// @@ -218,20 +354,26 @@ protected ListMessageDialog(Shell theShell, protected Control createCustomArea(Composite theParent) { this.viewer = new ListViewer(theParent, SWT.READ_ONLY | SWT.HIDE_SELECTION | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); + // set input items + if (this.items == null) { + this.items = Collections.EMPTY_LIST; + } + // configure List control org.eclipse.swt.widgets.List list = this.viewer.getList(); - list.setLayoutData(new GridData(GridData.FILL_BOTH)); + if( allowResize ) { + int heightHint = items.size() > 5 ? 300 : 200; + GridDataFactory.fillDefaults().hint(400, heightHint).grab(true, true).applyTo(list); + } else { + list.setLayoutData(new GridData(GridData.FILL_BOTH)); + } list.setBackground(UiUtil.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); // set label provider if (this.labelProvider != null) { this.viewer.setLabelProvider(this.labelProvider); } - - // set input items - if (this.items == null) { - this.items = Collections.EMPTY_LIST; - } + this.viewer.add(this.items.toArray()); diff --git a/plugins/org.teiid.designer.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.ui/META-INF/MANIFEST.MF index 9db93c1a62..08ce8f7a86 100644 --- a/plugins/org.teiid.designer.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.ui.UiPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.ui/launch/Designer Windows.launch b/plugins/org.teiid.designer.ui/launch/Designer Windows.launch index a68deb8603..504dc8fd55 100644 --- a/plugins/org.teiid.designer.ui/launch/Designer Windows.launch +++ b/plugins/org.teiid.designer.ui/launch/Designer Windows.launch @@ -1,416 +1,419 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/org.teiid.designer.ui/pom.xml b/plugins/org.teiid.designer.ui/pom.xml index 88c125f983..5496118bba 100644 --- a/plugins/org.teiid.designer.ui/pom.xml +++ b/plugins/org.teiid.designer.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.ui/src/org/teiid/designer/ui/editors/ModelEditor.java b/plugins/org.teiid.designer.ui/src/org/teiid/designer/ui/editors/ModelEditor.java index 6a4ae8328d..11313d48e1 100644 --- a/plugins/org.teiid.designer.ui/src/org/teiid/designer/ui/editors/ModelEditor.java +++ b/plugins/org.teiid.designer.ui/src/org/teiid/designer/ui/editors/ModelEditor.java @@ -83,7 +83,6 @@ import org.teiid.core.designer.util.I18nUtil; import org.teiid.designer.core.ModelerCore; import org.teiid.designer.core.notification.util.NotificationUtilities; -import org.teiid.designer.core.refactor.ModelCopyCommand; import org.teiid.designer.core.search.ModelWorkspaceSearch; import org.teiid.designer.core.search.runtime.ResourceImportRecord; import org.teiid.designer.core.workspace.ModelFileUtil; @@ -104,6 +103,7 @@ import org.teiid.designer.ui.explorer.ModelExplorerResourceNavigator; import org.teiid.designer.ui.outline.ModelOutlinePage; import org.teiid.designer.ui.properties.ModelObjectPropertySourceProvider; +import org.teiid.designer.ui.refactor.ModelCopyCommand; import org.teiid.designer.ui.undo.IUndoManager; import org.teiid.designer.ui.undo.ModelerUndoManager; import org.teiid.designer.ui.viewsupport.MarkerUtilities; diff --git a/plugins/org.teiid.designer.ui/src/org/teiid/designer/ui/editors/SaveAsDialog.java b/plugins/org.teiid.designer.ui/src/org/teiid/designer/ui/editors/SaveAsDialog.java index 2e13b5caad..a3ee451351 100644 --- a/plugins/org.teiid.designer.ui/src/org/teiid/designer/ui/editors/SaveAsDialog.java +++ b/plugins/org.teiid.designer.ui/src/org/teiid/designer/ui/editors/SaveAsDialog.java @@ -28,7 +28,6 @@ import org.eclipse.ui.dialogs.ISelectionStatusValidator; import org.teiid.core.designer.util.StringUtilities; import org.teiid.designer.core.ModelerCore; -import org.teiid.designer.core.refactor.ModelCopyCommand; import org.teiid.designer.core.validation.rules.StringNameValidator; import org.teiid.designer.core.workspace.ModelResource; import org.teiid.designer.ui.UiConstants; @@ -36,6 +35,7 @@ import org.teiid.designer.ui.common.viewsupport.StatusInfo; import org.teiid.designer.ui.explorer.ModelExplorerContentProvider; import org.teiid.designer.ui.explorer.ModelExplorerLabelProvider; +import org.teiid.designer.ui.refactor.ModelCopyCommand; import org.teiid.designer.ui.viewsupport.ModelingResourceFilter; diff --git a/plugins/org.teiid.designer.core/src/org/teiid/designer/core/refactor/ModelCopyCommand.java b/plugins/org.teiid.designer.ui/src/org/teiid/designer/ui/refactor/ModelCopyCommand.java similarity index 97% rename from plugins/org.teiid.designer.core/src/org/teiid/designer/core/refactor/ModelCopyCommand.java rename to plugins/org.teiid.designer.ui/src/org/teiid/designer/ui/refactor/ModelCopyCommand.java index 959a8bcb78..16138e7f0b 100644 --- a/plugins/org.teiid.designer.core/src/org/teiid/designer/core/refactor/ModelCopyCommand.java +++ b/plugins/org.teiid.designer.ui/src/org/teiid/designer/ui/refactor/ModelCopyCommand.java @@ -5,7 +5,7 @@ * * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors. */ -package org.teiid.designer.core.refactor; +package org.teiid.designer.ui.refactor; import java.io.BufferedOutputStream; import java.io.File; @@ -39,11 +39,12 @@ import org.eclipse.xsd.XSDSchema; import org.eclipse.xsd.XSDSimpleTypeDefinition; import org.eclipse.xsd.util.XSDResourceImpl; -import org.w3c.dom.Element; import org.teiid.core.designer.id.IDGenerator; import org.teiid.core.designer.plugin.PluginUtilities; import org.teiid.designer.core.ModelerCore; import org.teiid.designer.core.builder.ModelBuildUtil; +import org.teiid.designer.core.refactor.RefactorCommand; +import org.teiid.designer.core.refactor.ReferenceUpdator; import org.teiid.designer.core.resource.EmfResource; import org.teiid.designer.core.types.DatatypeConstants; import org.teiid.designer.core.util.ConcurrentModelVisitorProcessor; @@ -55,6 +56,8 @@ import org.teiid.designer.core.workspace.ModelResource; import org.teiid.designer.core.workspace.ModelUtil; import org.teiid.designer.metamodels.core.ModelAnnotation; +import org.teiid.designer.transformation.aspects.sql.SqlTransformationMappingRootSqlAspect; +import org.w3c.dom.Element; /** @@ -603,6 +606,16 @@ protected void executeXmiCopy( final IProgressMonitor monitor ) { final Collection targetRoots = this.copyEObject(sourceRootsToCopy, originalsToCopies); + /* + * Replicating the model objects is not quite good enough since the transformations may + * still contain the name of the source model. + * Need to replace those references with the new name. + */ + SqlTransformationMappingRootSqlAspect.replaceTransformationLiteral( + targetRoots, + resourceToCopy.getItemName(), + modelResource.getItemName()); + // Process the copied root EObjects ... for (final Iterator iter = targetRoots.iterator(); iter.hasNext();) { EObject targetRoot = (EObject)iter.next(); diff --git a/plugins/org.teiid.designer.ui/src/org/teiid/designer/ui/wizards/StructuralCopyModelFeaturePopulator.java b/plugins/org.teiid.designer.ui/src/org/teiid/designer/ui/wizards/StructuralCopyModelFeaturePopulator.java index 03f125cf9d..3c06b4e78a 100644 --- a/plugins/org.teiid.designer.ui/src/org/teiid/designer/ui/wizards/StructuralCopyModelFeaturePopulator.java +++ b/plugins/org.teiid.designer.ui/src/org/teiid/designer/ui/wizards/StructuralCopyModelFeaturePopulator.java @@ -8,25 +8,33 @@ package org.teiid.designer.ui.wizards; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Map; import javax.swing.tree.DefaultMutableTreeNode; import org.eclipse.core.resources.IFile; +import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.jface.viewers.ViewerFilter; import org.teiid.core.designer.ModelerCoreException; import org.teiid.designer.core.ModelerCore; +import org.teiid.designer.core.container.ResourceFinder; import org.teiid.designer.core.util.NewModelObjectHelperManager; import org.teiid.designer.core.workspace.ModelResource; import org.teiid.designer.metamodels.core.AnnotationContainer; import org.teiid.designer.metamodels.core.ModelAnnotation; +import org.teiid.designer.metamodels.core.ModelImport; import org.teiid.designer.metamodels.core.ModelType; import org.teiid.designer.metamodels.transformation.TransformationContainer; +import org.teiid.designer.transformation.aspects.sql.SqlTransformationMappingRootSqlAspect; import org.teiid.designer.ui.common.tree.TreeViewerUtil; import org.teiid.designer.ui.common.widget.InheritanceCheckboxTreeViewer; import org.teiid.designer.ui.explorer.ModelExplorerLabelProvider; @@ -139,7 +147,7 @@ public void copyModel( ModelResource sourceModelResource, // This method is being revoked due to inadequate design and implementation. throw new UnsupportedOperationException(); } - + /** * Copy the model to the target, only copying those nodes selected in the tree viewer. * @@ -213,13 +221,59 @@ public void copyModel( ModelResource sourceModelResource, throw ex; } + /* + * Replicating the model objects is not quite good enough since the transformations may + * still contain the name of the source model. + * Need to replace those references with the new name. + */ + SqlTransformationMappingRootSqlAspect.replaceTransformationLiteral( + sourceFirstLevelChildrenCopies, + sourceModelResource.getItemName(), + targetModelResource.getItemName()); // just add the nodes to the target: targetModelResource.getEmfResource().getContents().addAll(sourceFirstLevelChildrenCopies); - // Need to re-set the model type here. - targetModelResource.getModelAnnotation().setModelType(targetModelType); + ModelAnnotation modelAnnotation = targetModelResource.getModelAnnotation(); + modelAnnotation.setModelType(targetModelType); + + /* + * Need to check that all the model imports are valid + * When a model is copied it seems to leave behind imports referencing + * models relative to the old location which can be invalid for the new location. + * + * Remove those import statements that are invalid for the new location. + */ + EList imports = modelAnnotation.getModelImports(); + if (imports != null) { + ResourceFinder resourceFinder; + try { + resourceFinder = ModelerCore.getModelContainer().getResourceFinder(); + } catch (CoreException ex) { + throw new ModelerCoreException(ex); + } + + // + // Iterator through the imports and use the resource finder + // to determine if the uri location of the import model is still + // valid relative to the target model resource location + // + List mImports = Arrays.asList(imports.toArray()); + for (Object mImport : mImports) { + ModelImport modelImport = (ModelImport) mImport; + URI uri = URI.createURI(modelImport.getModelLocation()); + + if (resourceFinder.isBuiltInResource(uri)) + continue; + + Resource resource = resourceFinder.findByWorkspaceUri(uri, targetModelResource.getEmfResource()); + if (resource == null) { + // The resource location is invalid so remove it + imports.remove(mImport); + } + } + } // Now we need to check if virtual, then call the NewModelObjectHelper ..... if (targetIsVirtual) { diff --git a/plugins/org.teiid.designer.vdb.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.vdb.ui/META-INF/MANIFEST.MF index 5e83f365a5..4ec1946e1d 100644 --- a/plugins/org.teiid.designer.vdb.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.vdb.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.vdb.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.vdb.ui.VdbUiPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.vdb.ui/pom.xml b/plugins/org.teiid.designer.vdb.ui/pom.xml index af27b8bad7..3650acfbc3 100644 --- a/plugins/org.teiid.designer.vdb.ui/pom.xml +++ b/plugins/org.teiid.designer.vdb.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.vdb.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/Messages.java b/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/Messages.java index bb623d4dac..3be2c8055c 100644 --- a/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/Messages.java +++ b/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/Messages.java @@ -49,6 +49,8 @@ public class Messages extends NLS { public static String modelDetailsPanel_problemsTabTooltip; public static String modelDetailsPanel_problemPathLabel; public static String modelDetailsPanel_problemDescriptionLabel; + public static String modelDetailsPanel_propertiesTabLabel; + public static String modelDetailsPanel_propertiesTabTooltip; public static String vdbEditor_location; public static String vdbEditor_content_tab_label; diff --git a/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/editor/VdbEditor.java b/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/editor/VdbEditor.java index c7bf5d26de..92e7af71a0 100644 --- a/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/editor/VdbEditor.java +++ b/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/editor/VdbEditor.java @@ -79,6 +79,8 @@ import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IEditorSite; import org.eclipse.ui.IFileEditorInput; +import org.eclipse.ui.ISharedImages; +import org.eclipse.ui.PlatformUI; import org.eclipse.ui.dialogs.ISelectionStatusValidator; import org.eclipse.ui.ide.IDE; import org.eclipse.ui.model.WorkbenchLabelProvider; @@ -1043,7 +1045,12 @@ void openEditor( final VdbEntry entry ) { */ @Override public Image getImage( final VdbEntry element ) { - return workbenchLabelProvider.getImage(element.findFileInWorkspace()); + Image img = workbenchLabelProvider.getImage(element.findFileInWorkspace()); + if (img == null) { + img = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FILE); + } + + return img; } /** @@ -1280,7 +1287,12 @@ void openEditor( final VdbEntry entry ) { */ @Override public Image getImage( final VdbEntry element ) { - return workbenchLabelProvider.getImage(element.findFileInWorkspace()); + Image img = workbenchLabelProvider.getImage(element.findFileInWorkspace()); + if (img == null) { + img = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FILE); + } + + return img; } /** diff --git a/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/editor/panels/ModelDetailsPanel.java b/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/editor/panels/ModelDetailsPanel.java index 2332e9a4ca..d724ee6588 100644 --- a/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/editor/panels/ModelDetailsPanel.java +++ b/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/editor/panels/ModelDetailsPanel.java @@ -8,12 +8,15 @@ package org.teiid.designer.vdb.ui.editor.panels; import static org.teiid.core.designer.util.StringConstants.EMPTY_STRING; + import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; + import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource; +import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jface.text.DocumentEvent; import org.eclipse.jface.text.IDocumentListener; import org.eclipse.jface.viewers.CellEditor; @@ -34,6 +37,8 @@ import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; @@ -45,6 +50,7 @@ import org.teiid.designer.ui.common.UILabelUtil; import org.teiid.designer.ui.common.UiLabelConstants; import org.teiid.designer.ui.common.graphics.GlobalUiColorManager; +import org.teiid.designer.ui.common.graphics.GlobalUiFontManager; import org.teiid.designer.ui.common.table.ResourceEditingSupport; import org.teiid.designer.ui.common.table.TableViewerBuilder; import org.teiid.designer.ui.common.text.StyledTextEditor; @@ -79,6 +85,8 @@ static String i18n( final String id ) { TableViewerBuilder problemsViewer; VdbModelEntry selectedVdbModelEntry; + ModelUserDefinedPropertiesPanel modelPropsPanel; + Vdb vdb; @@ -99,6 +107,18 @@ private void createPanel(Composite parent) { Composite headerPanel = WidgetFactory.createPanel(mainPanel, SWT.NONE, GridData.FILL_HORIZONTAL, 1, 2); headerPanel.setLayout(new GridLayout(2, false)); + Label summaryLabel = new Label(headerPanel, SWT.NONE); + summaryLabel.setText("Selected Model Summary"); //$NON-NLS-1$ + summaryLabel.setBackground(headerPanel.getBackground()); + summaryLabel.setForeground(GlobalUiColorManager.EMPHASIS_COLOR); + + Font fOld = summaryLabel.getFont(); + FontData data = fOld.getFontData()[0]; + data.setStyle(SWT.BOLD); + Font fNewFont = GlobalUiFontManager.getFont(data); + summaryLabel.setFont(fNewFont); + GridDataFactory.fillDefaults().span(2, 1).applyTo(summaryLabel); + Label label = new Label(headerPanel, SWT.NONE); label.setText("Name"); //$NON-NLS-1$ @@ -339,6 +359,18 @@ public void documentChanged( final DocumentEvent event ) { modelDescriptionEditor.setText(EMPTY_STRING); modelDescriptionEditor.getTextViewer().setEditable(false); } + + { + // User Defined Model Properties + CTabItem propertiesTab = new CTabItem(tabFolder, SWT.NONE); + propertiesTab.setText(Messages.modelDetailsPanel_propertiesTabLabel); + propertiesTab.setToolTipText(Messages.modelDetailsPanel_propertiesTabTooltip); + + modelPropsPanel = new ModelUserDefinedPropertiesPanel(tabFolder); + modelPropsPanel.setLayout(new GridLayout(1, false)); + modelPropsPanel.setLayoutData(new GridData(GridData.FILL_BOTH)); + propertiesTab.setControl(modelPropsPanel); + } CTabItem problemsTab = new CTabItem(tabFolder, SWT.NONE); @@ -413,6 +445,7 @@ public void refreshModelDetails() { columnAliasText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW)); problemsViewer.getTable().removeAll(); modelDescriptionEditor.getTextViewer().setEditable(false); + modelPropsPanel.setVdbModelEntry(null); } else { modelNameText.setText(selectedVdbModelEntry.getName()); modelLocationText.setText(selectedVdbModelEntry.getPath().toOSString()); @@ -440,6 +473,8 @@ public void refreshModelDetails() { } else { columnAliasText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW)); } + + modelPropsPanel.setVdbModelEntry(selectedVdbModelEntry); } } diff --git a/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/editor/panels/ModelUserDefinedPropertiesPanel.java b/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/editor/panels/ModelUserDefinedPropertiesPanel.java new file mode 100644 index 0000000000..b7be176bdb --- /dev/null +++ b/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/editor/panels/ModelUserDefinedPropertiesPanel.java @@ -0,0 +1,398 @@ +package org.teiid.designer.vdb.ui.editor.panels; + +import static org.teiid.designer.vdb.ui.VdbUiConstants.Images.ADD; +import static org.teiid.designer.vdb.ui.VdbUiConstants.Images.REMOVE; + +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.viewers.CellEditor; +import org.eclipse.jface.viewers.ColumnLabelProvider; +import org.eclipse.jface.viewers.ColumnViewer; +import org.eclipse.jface.viewers.ColumnViewerToolTipSupport; +import org.eclipse.jface.viewers.EditingSupport; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.TableViewerColumn; +import org.eclipse.jface.viewers.TextCellEditor; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerComparator; +import org.eclipse.jface.window.Window; +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.TableItem; +import org.teiid.core.designer.util.I18nUtil; +import org.teiid.designer.core.translators.SimpleProperty; +import org.teiid.designer.ui.common.table.TableViewerBuilder; +import org.teiid.designer.ui.common.util.WidgetFactory; +import org.teiid.designer.vdb.VdbModelEntry; +import org.teiid.designer.vdb.manifest.EntryElement; +import org.teiid.designer.vdb.manifest.ModelElement; +import org.teiid.designer.vdb.ui.VdbUiConstants; +import org.teiid.designer.vdb.ui.VdbUiPlugin; + +/** + * @author blafond + * + */ +public class ModelUserDefinedPropertiesPanel extends Composite { + static final String PREFIX = I18nUtil.getPropertyPrefix(ModelUserDefinedPropertiesPanel.class); + + TableViewerBuilder propertiesViewer; + Button addPropertyButton; + Button removePropertyButton; + + VdbModelEntry modelEntry ; + + static String prefixedI18n( final String id ) { + return VdbUiConstants.Util.getString(PREFIX + id); + } + + /** + * @param parent + */ + public ModelUserDefinedPropertiesPanel(Composite parent) { + super(parent, SWT.NONE); + + createPanel(this); + } + + private void createPanel(Composite parent) { + Composite pnlUserProperties = WidgetFactory.createGroup(parent, null, SWT.FILL, 1, 1); + pnlUserProperties.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + + this.propertiesViewer = new TableViewerBuilder(pnlUserProperties, (SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.BORDER)); + ColumnViewerToolTipSupport.enableFor(this.propertiesViewer.getTableViewer()); + this.propertiesViewer.setContentProvider(new IStructuredContentProvider() { + /** + * {@inheritDoc} + * + * @see org.eclipse.jface.viewers.IContentProvider#dispose() + */ + @Override + public void dispose() { + // nothing to do + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) + */ + @Override + public Object[] getElements( Object inputElement ) { + if (modelEntry == null ) return new Object[0]; + + Properties props = modelEntry.getProperties(); + + if (props.isEmpty())return new Object[0]; + + List properties= new ArrayList(); + for( Object key : props.keySet() ) { + String keyStr = key.toString(); + if (ModelElement.BUILT_IN.equals(keyStr) || + ModelElement.MODEL_CLASS.equals(keyStr) || + ModelElement.MODEL_UUID.equals(keyStr) || + ModelElement.IMPORT_VDB_REFERENCE.equals(keyStr) || + ModelElement.SUPPORTS_MULTI_SOURCE.equals(keyStr) || + ModelElement.MULTI_SOURCE_ADD_COLUMN.equals(keyStr) || + ModelElement.MULTI_SOURCE_COLUMN_ALIAS.equals(keyStr) || + EntryElement.CHECKSUM.equals(keyStr)|| + EntryElement.INDEX_NAME.equals(keyStr) ) { + continue; + } + properties.add(new SimpleProperty(keyStr, props.getProperty(keyStr))); + } + return properties.toArray(new SimpleProperty[0]); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, + * java.lang.Object) + */ + @Override + public void inputChanged( Viewer viewer, + Object oldInput, + Object newInput ) { + // nothing to do + } + }); + + // sort the table rows by display name + this.propertiesViewer.setComparator(new ViewerComparator() { + /** + * {@inheritDoc} + * + * @see org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, + * java.lang.Object) + */ + @Override + public int compare( Viewer viewer, + Object e1, + Object e2 ) { + SimpleProperty prop1 = (SimpleProperty)e1; + SimpleProperty prop2 = (SimpleProperty)e2; + + return super.compare(viewer, prop1.getName(), prop2.getName()); + } + }); + + GridDataFactory.fillDefaults().grab(true, true).span(2, 1).applyTo(propertiesViewer.getTableComposite()); + + // create columns + TableViewerColumn column = propertiesViewer.createColumn(SWT.LEFT, 50, 40, true); + column.getColumn().setText(prefixedI18n("name") + " "); //$NON-NLS-1$//$NON-NLS-2$ + column.setLabelProvider(new PropertyLabelProvider(0)); + //column.setEditingSupport(new PropertyNameEditingSupport(this.propertiesViewer, 0)); + + + column = propertiesViewer.createColumn(SWT.LEFT, 50, 40, true); + column.getColumn().setText(prefixedI18n("value")); //$NON-NLS-1$ + column.setLabelProvider(new PropertyLabelProvider(1)); + column.setEditingSupport(new PropertyNameEditingSupport(this.propertiesViewer.getTableViewer(), 1)); + + + this.propertiesViewer.addSelectionChangedListener(new ISelectionChangedListener() { + /** + * {@inheritDoc} + * + * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent) + */ + @Override + public void selectionChanged( SelectionChangedEvent event ) { + handlePropertySelected(); + } + }); + + // + // add toolbar below the table + // + + Composite toolbarPanel = WidgetFactory.createPanel(pnlUserProperties, SWT.NONE, GridData.VERTICAL_ALIGN_BEGINNING, 1, 2); + + this.addPropertyButton = WidgetFactory.createButton(toolbarPanel, GridData.FILL); + this.addPropertyButton.setImage(VdbUiPlugin.singleton.getImage(ADD)); + this.addPropertyButton.setToolTipText(prefixedI18n("addNewPropertyButton.tooltip")); //$NON-NLS-1$ + this.addPropertyButton.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + handleAddProperty(); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + + this.removePropertyButton = WidgetFactory.createButton(toolbarPanel, GridData.FILL); + this.removePropertyButton.setImage(VdbUiPlugin.singleton.getImage(REMOVE)); + this.removePropertyButton.setToolTipText(prefixedI18n("removePropertyButton.tooltip")); //$NON-NLS-1$ + this.removePropertyButton.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + handleRemoveProperty(); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + this.removePropertyButton.setEnabled(false); + + this.propertiesViewer.setInput(this); + } + + /** + * @param entry + */ + public void setVdbModelEntry(VdbModelEntry entry) { + this.modelEntry = entry; + + this.propertiesViewer.setInput(this); + } + + + void handlePropertySelected() { + boolean hasSelection = !this.propertiesViewer.getSelection().isEmpty(); + this.removePropertyButton.setEnabled(hasSelection); + } + + private SimpleProperty getSelectedProperty() { + IStructuredSelection selection = (IStructuredSelection)this.propertiesViewer.getSelection(); + + if (selection.isEmpty()) { + return null; + } + + return (SimpleProperty)selection.getFirstElement(); + } + + void handleAddProperty() { + assert (!this.propertiesViewer.getSelection().isEmpty()); + + AddGeneralPropertyDialog dialog = + new AddGeneralPropertyDialog(propertiesViewer.getControl().getShell(), this.modelEntry.getProperties()); + + if (dialog.open() == Window.OK) { + // update model + String name = dialog.getName(); + String value = dialog.getValue(); + this.modelEntry.setProperty(name, value); + + // update UI from model + this.propertiesViewer.refresh(); + + // select the new property + + + SimpleProperty prop = null; + + for(TableItem item : this.propertiesViewer.getTable().getItems() ) { + if( item.getData() instanceof SimpleProperty && ((SimpleProperty)item.getData()).getName().equals(name) ) { + prop = (SimpleProperty)item.getData(); + break; + } + } + + if( prop != null ) { + this.propertiesViewer.setSelection(new StructuredSelection(prop), true); + } + } + } + + void handleRemoveProperty() { + SimpleProperty selectedProperty = getSelectedProperty(); + assert (selectedProperty != null); + + // update model + this.modelEntry.removeProperty(selectedProperty.getName()); + + // update UI + this.propertiesViewer.refresh(); + } + + class PropertyLabelProvider extends ColumnLabelProvider { + + private final int columnID; + + public PropertyLabelProvider( int columnID ) { + this.columnID = columnID; + } + + /* (non-Javadoc) + * @see org.eclipse.jface.viewers.ColumnLabelProvider#getText(java.lang.Object) + */ + @Override + public String getText(Object element) { + if( element instanceof SimpleProperty ) { + if( columnID == 0 ) { + return ((SimpleProperty)element).getName(); + } else if( columnID == 1 ) { + return ((SimpleProperty)element).getValue(); + } + } + return super.getText(element); + } + } + + class PropertyNameEditingSupport extends EditingSupport { + int columnID; + + private TextCellEditor editor; + + /** + * Create a new instance of the receiver. + * + * @param viewer the viewer where the editing support is being provided (cannot be null) + * @param columnID + */ + public PropertyNameEditingSupport(ColumnViewer viewer, int columnID) { + super(viewer); + this.columnID = columnID; + this.editor = new TextCellEditor((Composite) viewer.getControl()); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.viewers.EditingSupport#canEdit(java.lang.Object) + */ + @Override + protected boolean canEdit(Object element) { + return true; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.viewers.EditingSupport#getCellEditor(java.lang.Object) + */ + @Override + protected CellEditor getCellEditor(Object element) { + return editor; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.viewers.EditingSupport#getValue(java.lang.Object) + */ + @Override + protected Object getValue(Object element) { + if( element instanceof SimpleProperty ) { + if( columnID == 0 ) { + return ((SimpleProperty)element).getName(); + } else if( columnID == 1 ) { + return ((SimpleProperty)element).getValue(); + } + } + return 0; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.viewers.EditingSupport#setValue(java.lang.Object, + * java.lang.Object) + */ + @Override + protected void setValue(Object element, Object value) { + if( element instanceof SimpleProperty ) { + if( columnID == 0 ) { + String oldKey = ((SimpleProperty)element).getName(); + String oldValue = ((SimpleProperty)element).getValue(); + String newKey = (String)value; + if( newKey != null && newKey.length() > 0 && !newKey.equalsIgnoreCase(oldKey)) { + modelEntry.removeProperty(oldKey); + modelEntry.setProperty(newKey, oldValue); + propertiesViewer.refresh(); + } + } else if( columnID == 1 ) { + String key = ((SimpleProperty)element).getName(); + String oldValue = ((SimpleProperty)element).getValue(); + String newValue = (String)value; + if( newValue != null && newValue.length() > 0 && !newValue.equalsIgnoreCase(oldValue)) { + modelEntry.setProperty(key, newValue); + propertiesViewer.refresh(); + } + } + + } + } + + } + +} \ No newline at end of file diff --git a/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/editor/panels/UserDefinedPropertiesPanel.java b/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/editor/panels/UserDefinedPropertiesPanel.java index 305984542e..f586680a4f 100644 --- a/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/editor/panels/UserDefinedPropertiesPanel.java +++ b/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/editor/panels/UserDefinedPropertiesPanel.java @@ -263,7 +263,7 @@ void handleRemoveProperty() { assert (selectedProperty != null); // update model - this.vdb.setProperty(selectedProperty.getName(), selectedProperty.getValue()); + this.vdb.removeProperty(selectedProperty.getName()); // update UI this.propertiesViewer.refresh(); diff --git a/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/i18n.properties b/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/i18n.properties index 212733d5c9..d63973b6d4 100644 --- a/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/i18n.properties +++ b/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/i18n.properties @@ -256,6 +256,10 @@ UserDefinedPropertiesPanel.name=Name UserDefinedPropertiesPanel.value=Value UserDefinedPropertiesPanel.addNewPropertyButton.tooltip=Add New Property UserDefinedPropertiesPanel.removePropertyButton.tooltip=Remove Property +ModelUserDefinedPropertiesPanel.name=Name +ModelUserDefinedPropertiesPanel.value=Value +ModelUserDefinedPropertiesPanel.addNewPropertyButton.tooltip=Add New Property +ModelUserDefinedPropertiesPanel.removePropertyButton.tooltip=Remove Property AddLanguagePropertyDialog.title = Add Allowed Language AddLanguagePropertyDialog.message = Enter a unique allowed language : diff --git a/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/messages.properties b/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/messages.properties index 0d5bebd0ab..00962a4adc 100644 --- a/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/messages.properties +++ b/plugins/org.teiid.designer.vdb.ui/src/org/teiid/designer/vdb/ui/messages.properties @@ -38,6 +38,8 @@ modelDetailsPanel_problemsTabLabel=Problems modelDetailsPanel_problemsTabTooltip=Errors and warnings associated with the selected model modelDetailsPanel_problemPathLabel=Object Path modelDetailsPanel_problemDescriptionLabel=Description +modelDetailsPanel_propertiesTabLabel=Properties +modelDetailsPanel_propertiesTabTooltip=Manage user-defined model properties vdbEditor_loadingErrMessage=The editor failed to load the contents of this vdb vdbEditor_location=Location: diff --git a/plugins/org.teiid.designer.vdb/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.vdb/META-INF/MANIFEST.MF index b76709eef7..3eaf135cfd 100644 --- a/plugins/org.teiid.designer.vdb/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.vdb/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Localization: plugin Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.vdb;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.vdb.VdbPlugin Bundle-Vendor: %pluginProvider Require-Bundle: org.eclipse.emf.ecore;bundle-version="[2.10.2,3.0.0)", diff --git a/plugins/org.teiid.designer.vdb/pom.xml b/plugins/org.teiid.designer.vdb/pom.xml index 31dd209088..4b47eefef0 100644 --- a/plugins/org.teiid.designer.vdb/pom.xml +++ b/plugins/org.teiid.designer.vdb/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.vdb - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/BasicVdb.java b/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/BasicVdb.java index 0b259ca04c..a29a267981 100644 --- a/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/BasicVdb.java +++ b/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/BasicVdb.java @@ -10,7 +10,6 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.io.File; -import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -624,6 +623,27 @@ public void setValidationDateTime( Date dateTime ) { public String getValidationVersion() { return validationVersion; } + + /** + * @param key + * @param value + */ + @Override + public void setProperty(String key, String value) { + super.setProperty(key, value); + setModified(this, Event.GENERAL_PROPERTY, null, value); + } + + /** + * @param key + * @return removed property + */ + @Override + public String removeProperty(String key) { + String prop = super.removeProperty(key); + setModified(this, Event.GENERAL_PROPERTY, null, prop); + return prop; + } /* (non-Javadoc) * @see org.teiid.designer.vdb.Vdb#notifyChangeListeners(java.lang.Object, java.lang.String, java.lang.Object, java.lang.Object) @@ -709,7 +729,7 @@ protected void populateVdb(BasicVdb vdb) { // Note that at this time, the input VDB would have validation version and validation date defined as properties. // So need to either copy them instead of generating them. // {validationVersion=8.7.1, validationDateTime=Thu Aug 06 14:29:43 CDT 2015} - Properties existingProps = vdb.getProperties(); + Properties existingProps = this.getProperties(); vdb.setName(getName()); vdb.setDescription(getDescription()); String validationVersion = existingProps.getProperty("validationVersion"); diff --git a/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/VdbEntry.java b/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/VdbEntry.java index f4f585adf9..f3e20ae550 100644 --- a/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/VdbEntry.java +++ b/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/VdbEntry.java @@ -243,9 +243,15 @@ public boolean equals(Object obj) { */ public void save( final ZipOutputStream out) throws Exception { String zipName = getPath().toString(); + // + // Path on Windows will be using backslashes but zip entries only + // deal with forward slashes so need to replace with them. + // + zipName = zipName.replace(DOUBLE_BACK_SLASH, FORWARD_SLASH); + // Need to strip off the leading delimeter if it exists, else a "jar" extract command will result in models // being located at the file system "root" folder. - if( zipName.startsWith("/") ) { //$NON-NLS-1$ + if (zipName.startsWith(FORWARD_SLASH)) { zipName = zipName.substring(1, zipName.length()); } final ZipEntry zipEntry = new ZipEntry(zipName); diff --git a/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/VdbFileEntry.java b/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/VdbFileEntry.java index 51c42cf583..c84c126dfa 100644 --- a/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/VdbFileEntry.java +++ b/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/VdbFileEntry.java @@ -179,6 +179,13 @@ public IFile findFileInWorkspace() { public void save( final ZipOutputStream out) throws Exception { // Name of VDB entry String zipName = getPath().toOSString(); + + // + // Path on Windows will be using backslashes but zip entries only + // deal with forward slashes so need to replace with them. + // + zipName = zipName.replace(DOUBLE_BACK_SLASH, FORWARD_SLASH); + // Need to strip off the leading delimeter if it exists, else a "jar" extract command will result in models // being located at the file system "root" folder. if(zipName.startsWith(StringConstants.FORWARD_SLASH)) { diff --git a/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/VdbModelEntry.java b/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/VdbModelEntry.java index dd5989306a..80bc67d642 100644 --- a/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/VdbModelEntry.java +++ b/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/VdbModelEntry.java @@ -262,6 +262,8 @@ else if (ModelElement.IMPORT_VDB_REFERENCE.equals(name)) { sourceInfo.setAddColumn(Boolean.parseBoolean(property.getValue())); } else if( ModelElement.MULTI_SOURCE_COLUMN_ALIAS.equals(name)) { sourceInfo.setColumnAlias(property.getValue()); + } else { + setProperty(name, property.getValue()); } } this.builtIn = builtIn; diff --git a/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/XmiVdb.java b/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/XmiVdb.java index f0412bf144..ee274edc29 100644 --- a/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/XmiVdb.java +++ b/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/XmiVdb.java @@ -11,6 +11,7 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.InputStream; +import java.nio.file.Files; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collection; @@ -27,7 +28,6 @@ import java.util.zip.ZipOutputStream; import javax.xml.bind.Marshaller; import javax.xml.bind.Unmarshaller; -import net.jcip.annotations.ThreadSafe; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IMarker; @@ -63,6 +63,7 @@ import org.teiid.designer.vdb.manifest.PropertyElement; import org.teiid.designer.vdb.manifest.TranslatorElement; import org.teiid.designer.vdb.manifest.VdbElement; +import net.jcip.annotations.ThreadSafe; /** * @@ -228,115 +229,131 @@ public void tryToDo() throws Exception { archive = new ZipFile(file.getLocation().toString()); for (final Enumeration iter = archive.entries(); iter.hasMoreElements();) { final ZipEntry zipEntry = iter.nextElement(); - entryStream = archive.getInputStream(zipEntry); - if (zipEntry.getName().equals(MANIFEST)) { - // Initialize using manifest - final Unmarshaller unmarshaller = getJaxbContext().createUnmarshaller(); - unmarshaller.setSchema(getManifestSchema()); - final VdbElement manifest = (VdbElement)unmarshaller.unmarshal(entryStream); - setDescription(manifest.getDescription()); - vdbVersion[0] = manifest.getVersion(); - vdb.setName(manifest.getName()); - // VDB properties - for (final PropertyElement property : manifest.getProperties()) { - final String name = property.getName(); - final String value = property.getValue(); - - if (Xml.PREVIEW.equals(name)) { - previewable[0] = Boolean.parseBoolean(value); - // The stored timeout is in milliseconds. We are converting to seconds for display in Designer - } else if (Xml.QUERY_TIMEOUT.equals(name)) { - int timeoutMillis = Integer.parseInt(value); - if (timeoutMillis > 0) { - queryTimeout[0] = timeoutMillis / 1000; + try { + entryStream = archive.getInputStream(zipEntry); + if (zipEntry.getName().equals(MANIFEST)) { + // Initialize using manifest + final Unmarshaller unmarshaller = getJaxbContext().createUnmarshaller(); + unmarshaller.setSchema(getManifestSchema()); + final VdbElement manifest = (VdbElement)unmarshaller.unmarshal(entryStream); + setDescription(manifest.getDescription()); + vdbVersion[0] = manifest.getVersion(); + vdb.setName(manifest.getName()); + // VDB properties + for (final PropertyElement property : manifest.getProperties()) { + final String name = property.getName(); + final String value = property.getValue(); + + if (Xml.PREVIEW.equals(name)) { + previewable[0] = Boolean.parseBoolean(value); + // The stored timeout is in milliseconds. We + // are converting to seconds for display in + // Designer + } else if (Xml.QUERY_TIMEOUT.equals(name)) { + int timeoutMillis = Integer.parseInt(value); + if (timeoutMillis > 0) { + queryTimeout[0] = timeoutMillis / 1000; + } + } else if (Xml.ALLOWED_LANGUAGES.equals(name)) { + /* + * EXAMPLE XML FRAGMENT multiple properties + * allowed with SAME KEY different values + * Need to discover and treat these + * differently + */ + String[] langs = StringUtilities.parseCommaDelimitedString(value); + for (String lang : langs) { + addAllowedLanguage(lang); + } + } else if (Xml.VALIDATION_DATETIME.equals(name)) { + valDateTime[0] = value; + } else if (Xml.VALIDATION_VERSION.equals(name)) { + valVersion[0] = value; + } else if (Xml.SECURITY_DOMAIN.equals(name)) { + secDomain[0] = value; + } else if (Xml.GSS_PATTERN.equals(name)) { + gssPatt[0] = value; + } else if (Xml.PASSWORD_PATTERN.equals(name)) { + pwdPatt[0] = value; + } else if (Xml.AUTHENTICATION_TYPE.equals(name)) { + authType[0] = value; + } else if (Xml.AUTO_GENERATE_REST_WAR.equals(name)) { + autoGen[0] = Boolean.parseBoolean(value); + // The stored timeout is in milliseconds. We + // are converting to seconds for display in + // Designer + } else { + setProperty(name, value); + } + } + + for (final ModelElement element : manifest.getModels()) { + IPath path = null; + if (element.getPath() != null) { + path = Path.fromPortableString(element.getPath()); } - } else if(Xml.ALLOWED_LANGUAGES.equals(name) ) { /* - * EXAMPLE XML FRAGMENT - * multiple properties allowed with SAME KEY different values - * Need to discover and treat these differently - + * Allows migration from old vdbs where xsd + * files were considered models */ - String[] langs = StringUtilities.parseCommaDelimitedString(value); - for( String lang : langs ) { - addAllowedLanguage(lang); + if (path != null && ModelUtil.isXsdFile(path)) { + VdbSchemaEntry vdbSchemaEntry = new VdbSchemaEntry(XmiVdb.this, element); + schemaEntries().add(vdbSchemaEntry); + } else { + modelEntries().add(new VdbModelEntry(XmiVdb.this, element)); } - } else if (Xml.VALIDATION_DATETIME.equals(name)) { - valDateTime[0] = value; - } else if (Xml.VALIDATION_VERSION.equals(name)) { - valVersion[0] = value; - } else if (Xml.SECURITY_DOMAIN.equals(name)) { - secDomain[0] = value; - } else if (Xml.GSS_PATTERN.equals(name)) { - gssPatt[0] = value; - } else if (Xml.PASSWORD_PATTERN.equals(name)) { - pwdPatt[0] = value; - } else if (Xml.AUTHENTICATION_TYPE.equals(name)) { - authType[0] = value; - } else if (Xml.AUTO_GENERATE_REST_WAR.equals(name)) { - autoGen[0] = Boolean.parseBoolean(value); - // The stored timeout is in milliseconds. We are converting to seconds for display in Designer - } else { - setProperty(name, value); - } - } - - for (final ModelElement element : manifest.getModels()) { - IPath path = null; - if( element.getPath() != null ) { - path = Path.fromPortableString(element.getPath()); } - /* Allows migration from old vdbs where xsd files were considered models */ - if (path != null && ModelUtil.isXsdFile(path)) { - VdbSchemaEntry vdbSchemaEntry = new VdbSchemaEntry(XmiVdb.this, element); - schemaEntries().add(vdbSchemaEntry); - } else { - modelEntries().add(new VdbModelEntry(XmiVdb.this, element)); + + // Initialize model entry imports only after all + // model entries have been created + for (final VdbModelEntry entry : modelEntries()) { + entry.initializeImports(); } - } - // Initialize model entry imports only after all model entries have been created - for (final VdbModelEntry entry : modelEntries()) { - entry.initializeImports(); - } - - for (final EntryElement element : manifest.getEntries()) { - IPath path = Path.fromPortableString(element.getPath()); - /* - * Xsd files were be added to the manifest as entries but they should - * become schema entries in this runtime instance. - */ - if (ModelUtil.isXsdFile(path)) { - VdbSchemaEntry vdbSchemaEntry = new VdbSchemaEntry(XmiVdb.this, element); - schemaEntries().add(vdbSchemaEntry); - } else { - VdbFileEntry vdbFileEntry = new VdbFileEntry(XmiVdb.this, element); - switch (vdbFileEntry.getFileType()) { - case UDFJar: - udfJarEntries().add(vdbFileEntry); - break; - case UserFile: - fileEntries().add(vdbFileEntry); + for (final EntryElement element : manifest.getEntries()) { + IPath path = Path.fromPortableString(element.getPath()); + /* + * Xsd files were be added to the manifest as + * entries but they should become schema entries + * in this runtime instance. + */ + if (ModelUtil.isXsdFile(path)) { + VdbSchemaEntry vdbSchemaEntry = new VdbSchemaEntry(XmiVdb.this, element); + schemaEntries().add(vdbSchemaEntry); + } else { + VdbFileEntry vdbFileEntry = new VdbFileEntry(XmiVdb.this, element); + switch (vdbFileEntry.getFileType()) { + case UDFJar: + udfJarEntries().add(vdbFileEntry); + break; + case UserFile: + fileEntries().add(vdbFileEntry); + } } } - } - - // Vdb Import entries - for (final ImportVdbElement element : manifest.getImportVdbEntries()) { - addImport(new VdbImportVdbEntry(XmiVdb.this, element)); - } - - // load translator overrides - for (final TranslatorElement translatorElement : manifest.getTranslators()) { - addTranslator(new TranslatorOverride(XmiVdb.this, translatorElement)); - } - for (final DataRoleElement element : manifest.getDataPolicies()) { - DataRole dataRole = new DataRole(element); - addDataRole(dataRole); + // Vdb Import entries + for (final ImportVdbElement element : manifest.getImportVdbEntries()) { + addImport(new VdbImportVdbEntry(XmiVdb.this, element)); + } + + // load translator overrides + for (final TranslatorElement translatorElement : manifest.getTranslators()) { + addTranslator(new TranslatorOverride(XmiVdb.this, translatorElement)); + } + + for (final DataRoleElement element : manifest.getDataPolicies()) { + DataRole dataRole = new DataRole(element); + addDataRole(dataRole); + } + } else if (!zipEntry.isDirectory()) { + FileUtils.copy(entryStream, new File(getStagingFolder(), zipEntry.getName())); } - } else if (! zipEntry.isDirectory()) { - FileUtils.copy(entryStream, new File(getStagingFolder(), zipEntry.getName())); + } finally { + if (entryStream != null) + entryStream.close(); } } setChanged(false); @@ -776,42 +793,47 @@ public void tryToDo() throws Exception { tmpFolder); tmpArchive.getParentFile().mkdirs(); out = new ZipOutputStream(new FileOutputStream(tmpArchive)); - // Create VDB manifest - final ZipEntry zipEntry = new ZipEntry(MANIFEST); - zipEntry.setComment(getDescription()); - out.putNextEntry(zipEntry); try { - final Marshaller marshaller = getJaxbContext().createMarshaller(); - marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); - marshaller.setSchema(getManifestSchema()); - marshaller.marshal(vdbElement, out); - } finally { - out.closeEntry(); - } - // Clear all problem markers on VDB file - IFile file = getSourceFile(); - if (file != null && file.exists()) { - IMarker[] markers = file.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE); - if (markers != null) { - for (final IMarker marker : markers) - marker.delete(); + // Create VDB manifest + final ZipEntry zipEntry = new ZipEntry(MANIFEST); + zipEntry.setComment(getDescription()); + out.putNextEntry(zipEntry); + try { + final Marshaller marshaller = getJaxbContext().createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); + marshaller.setSchema(getManifestSchema()); + marshaller.marshal(vdbElement, out); + } finally { + out.closeEntry(); + } + // Clear all problem markers on VDB file + IFile file = getSourceFile(); + if (file != null && file.exists()) { + IMarker[] markers = file.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE); + if (markers != null) { + for (final IMarker marker : markers) + marker.delete(); + } } - } - // Save entries - for (final VdbEntry entry : getEntries()) - entry.save(out); - for (final VdbModelEntry entry : modelEntries()) - entry.save(out); + // Save entries + for (final VdbEntry entry : getEntries()) + entry.save(out); + for (final VdbModelEntry entry : modelEntries()) + entry.save(out); + + } finally { + // Close zip output stream so its fully writen and any locks are removed. + out.close(); + out = null; + } - // Close zip output stream so its fully writen and any locks are removed. - out.close(); - out = null; // Replace archive in workspace with temporary archive File archiveFile = getSourceFile().getLocation().toFile(); - if (archiveFile.exists()) { - if (!archiveFile.delete()) - throw new Exception(VdbPlugin.UTIL.getString("unableToDelete", archiveFile)); //$NON-NLS-1$ + try { + Files.deleteIfExists(archiveFile.toPath()); + } catch (Exception ex) { + throw new Exception(VdbPlugin.UTIL.getString("unableToDelete", archiveFile), ex); //$NON-NLS-1$ } if (!tmpArchive.renameTo(archiveFile)) throw new Exception( @@ -952,7 +974,7 @@ public DynamicVdb dynVdbConvert(IFile destination, Properties options) throws Ex model.setName(entry.getName()); model.setDescription(entry.getDescription()); - for (Map.Entry prop : getProperties().entrySet()) { + for (Map.Entry prop : entry.getProperties().entrySet()) { model.setProperty(prop.getKey().toString(), prop.getValue().toString()); } diff --git a/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/dynamic/DynamicVdb.java b/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/dynamic/DynamicVdb.java index 2f030f7bfb..ff2ec5494e 100644 --- a/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/dynamic/DynamicVdb.java +++ b/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/dynamic/DynamicVdb.java @@ -683,6 +683,11 @@ public XmiVdb xmiVdbConvert(IFile destination, Properties options) throws Except for (VdbSource source : dynModel.getSources()) { sourceInfo.add(source.getName(), source.getJndiName(), source.getTranslatorName()); } + + // copy any model properties into archive VDB + for (Map.Entry entry : dynModel.getProperties().entrySet()) { + modelEntry.setProperty(entry.getKey().toString(), entry.getValue().toString()); + } } return xmiVdb; diff --git a/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/manifest/ModelElement.java b/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/manifest/ModelElement.java index 36aeab3656..fe8e2c834f 100644 --- a/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/manifest/ModelElement.java +++ b/plugins/org.teiid.designer.vdb/src/org/teiid/designer/vdb/manifest/ModelElement.java @@ -136,6 +136,10 @@ public ModelElement() { props.add(new PropertyElement(MULTI_SOURCE_COLUMN_ALIAS, alias)); } } + + for( Object key : entry.getProperties().keySet() ) { + props.add(new PropertyElement((String)key, (String)entry.getProperties().get(key))); + } for (final VdbEntry importedEntry : entry.getImports()) props.add(new PropertyElement(IMPORTS, importedEntry.getName().toString())); for (final String importedVdbName : entry.getImportVdbNames()) diff --git a/plugins/org.teiid.designer.webservice.lib/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.webservice.lib/META-INF/MANIFEST.MF index 267ca9dc27..801f2b04b5 100644 --- a/plugins/org.teiid.designer.webservice.lib/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.webservice.lib/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.webservice.lib;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.webservice.lib.WebServiceLibPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.webservice.lib/pom.xml b/plugins/org.teiid.designer.webservice.lib/pom.xml index ba6aa3e084..20f16ec11d 100644 --- a/plugins/org.teiid.designer.webservice.lib/pom.xml +++ b/plugins/org.teiid.designer.webservice.lib/pom.xml @@ -8,7 +8,7 @@ 0.0.4-SNAPSHOT org.jboss.tools - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT org.teiid.designer.webservice.lib eclipse-plugin diff --git a/plugins/org.teiid.designer.webservice.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.webservice.ui/META-INF/MANIFEST.MF index 2d7b404414..c96d29082c 100644 --- a/plugins/org.teiid.designer.webservice.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.webservice.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.webservice.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.webservice.ui.WebServiceUiPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.webservice.ui/pom.xml b/plugins/org.teiid.designer.webservice.ui/pom.xml index a91ae32d37..a77b472fda 100644 --- a/plugins/org.teiid.designer.webservice.ui/pom.xml +++ b/plugins/org.teiid.designer.webservice.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.webservice.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.webservice.ui/src/org/teiid/designer/webservice/ui/editor/NewOperationPanel.java b/plugins/org.teiid.designer.webservice.ui/src/org/teiid/designer/webservice/ui/editor/NewOperationPanel.java index 255af78232..931402d404 100644 --- a/plugins/org.teiid.designer.webservice.ui/src/org/teiid/designer/webservice/ui/editor/NewOperationPanel.java +++ b/plugins/org.teiid.designer.webservice.ui/src/org/teiid/designer/webservice/ui/editor/NewOperationPanel.java @@ -12,6 +12,7 @@ import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; 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; @@ -62,6 +63,9 @@ public class NewOperationPanel extends Composite implements StringConstants { private Text selectedOutputContentText; private Button browseOutputXmlDocumentButton; private Text selectedOutputXmlDocumentText; + + private Button includeInputMessageButton; + private Button includeOutputMessageButton; ModelResource modelResource; @@ -208,6 +212,27 @@ private Composite createPropertiesPanel(Composite parent) { GridDataFactory.fillDefaults().grab(true, false).applyTo(inputMessagePanel); GridLayoutFactory.fillDefaults().numColumns(3).equalWidth(false).margins(3, 3).applyTo(inputMessagePanel); + this.includeInputMessageButton = new Button(inputMessagePanel, SWT.CHECK); + this.includeInputMessageButton.setText("Include Input Message"); + this.includeInputMessageButton.setSelection(operation.isIncludeInputMessage()); + GridDataFactory.fillDefaults().grab(true, false).span(3,1).applyTo(this.includeInputMessageButton); + + this.includeInputMessageButton.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + boolean include = includeInputMessageButton.getSelection(); + inputMsgText.setEnabled(include); + selectedInputContentText.setEnabled(include); + browseInputContentElementButton.setEnabled(include); + operation.setIncludeInputMessage(include); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + Label label = new Label(inputMessagePanel, SWT.NONE); label.setText(UILabelUtil.getLabel(UiLabelConstants.LABEL_IDS.NAME)); @@ -252,10 +277,33 @@ public void widgetSelected(SelectionEvent theEvent) { } { // Output Message - Composite outputMessagePanel = WidgetFactory.createGroup(thePanel, getString("inputMessageGroup"), GridData.FILL_BOTH); //$NON-NLS-1$ + Composite outputMessagePanel = WidgetFactory.createGroup(thePanel, getString("outputMessageGroup"), GridData.FILL_BOTH); //$NON-NLS-1$ GridDataFactory.fillDefaults().grab(true, false).applyTo(outputMessagePanel); GridLayoutFactory.fillDefaults().numColumns(3).equalWidth(false).margins(3, 3).applyTo(outputMessagePanel); + this.includeOutputMessageButton = new Button(outputMessagePanel, SWT.CHECK); + this.includeOutputMessageButton.setText("Include Output Message"); + this.includeOutputMessageButton.setSelection(operation.isIncludeOutputMessage()); + GridDataFactory.fillDefaults().grab(true, false).span(3,1).applyTo(this.includeOutputMessageButton); + + this.includeOutputMessageButton.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + boolean include = includeOutputMessageButton.getSelection(); + outputMsgText.setEnabled(include); + selectedOutputContentText.setEnabled(include); + browseOutputContentElementButton.setEnabled(include); + selectedOutputXmlDocumentText.setEnabled(include); + browseOutputXmlDocumentButton.setEnabled(include); + operation.setIncludeOutputMessage(include); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + Label label = new Label(outputMessagePanel, SWT.NONE); label.setText(UILabelUtil.getLabel(UiLabelConstants.LABEL_IDS.NAME)); diff --git a/plugins/org.teiid.designer.webservice.ui/src/org/teiid/designer/webservice/ui/editor/OperationObjectEditorPage.java b/plugins/org.teiid.designer.webservice.ui/src/org/teiid/designer/webservice/ui/editor/OperationObjectEditorPage.java index 7c18336e26..2f4a03ed63 100644 --- a/plugins/org.teiid.designer.webservice.ui/src/org/teiid/designer/webservice/ui/editor/OperationObjectEditorPage.java +++ b/plugins/org.teiid.designer.webservice.ui/src/org/teiid/designer/webservice/ui/editor/OperationObjectEditorPage.java @@ -971,16 +971,19 @@ private void createOperation() throws ModelWorkspaceException { } // Input - Input input = factory.createInput(); - input.setName(operationData.getInputMessageName()); - operation.setInput(input); - input.setContentElement(operationData.getInputContentViaElement()); - - Output output = factory.createOutput(); - output.setName(operationData.getOutputMessageName()); - operation.setOutput(output); - output.setContentElement(operationData.getOutputContentViaElement()); - output.setXmlDocument(operationData.getXmlDocument()); + if( operationData.isIncludeInputMessage() ) { + Input input = factory.createInput(); + input.setName(operationData.getInputMessageName()); + operation.setInput(input); + input.setContentElement(operationData.getInputContentViaElement()); + } + if( operationData.isIncludeOutputMessage() ) { + Output output = factory.createOutput(); + output.setName(operationData.getOutputMessageName()); + operation.setOutput(output); + output.setContentElement(operationData.getOutputContentViaElement()); + output.setXmlDocument(operationData.getXmlDocument()); + } // MessageDialog.openInformation(getControl().getShell(), "Create New Operation", " < NOT YET IMPLEMENTED> "); } diff --git a/plugins/org.teiid.designer.webservice.ui/src/org/teiid/designer/webservice/ui/editor/WebServiceOperation.java b/plugins/org.teiid.designer.webservice.ui/src/org/teiid/designer/webservice/ui/editor/WebServiceOperation.java index d16ff098bb..fd33dab160 100644 --- a/plugins/org.teiid.designer.webservice.ui/src/org/teiid/designer/webservice/ui/editor/WebServiceOperation.java +++ b/plugins/org.teiid.designer.webservice.ui/src/org/teiid/designer/webservice/ui/editor/WebServiceOperation.java @@ -29,6 +29,9 @@ public class WebServiceOperation extends RelationalReference { private String transformationSQL; + private boolean includeInputMessage = true; + private boolean includeOutputMessage = true; + public WebServiceOperation() { super(); @@ -179,6 +182,22 @@ private String getNewUniqueName(String proposedName) { return proposedName; } + + public boolean isIncludeInputMessage() { + return includeInputMessage; + } + + public void setIncludeInputMessage(boolean includeInputMessage) { + this.includeInputMessage = includeInputMessage; + } + + public boolean isIncludeOutputMessage() { + return includeOutputMessage; + } + + public void setIncludeOutputMessage(boolean includeOutputMessage) { + this.includeOutputMessage = includeOutputMessage; + } } diff --git a/plugins/org.teiid.designer.webservice/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.webservice/META-INF/MANIFEST.MF index c04c9ad3c2..487224ca84 100644 --- a/plugins/org.teiid.designer.webservice/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.webservice/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.webservice;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.webservice.WebServicePlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.webservice/pom.xml b/plugins/org.teiid.designer.webservice/pom.xml index 6b096cd3b3..286b1f4b74 100644 --- a/plugins/org.teiid.designer.webservice/pom.xml +++ b/plugins/org.teiid.designer.webservice/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.webservice - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.xml.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.xml.ui/META-INF/MANIFEST.MF index 150528c623..d5c0712405 100644 --- a/plugins/org.teiid.designer.xml.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.xml.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.xml.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.xml.ui.ModelerXmlUiPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.xml.ui/pom.xml b/plugins/org.teiid.designer.xml.ui/pom.xml index 19ae9c4113..883d61489a 100644 --- a/plugins/org.teiid.designer.xml.ui/pom.xml +++ b/plugins/org.teiid.designer.xml.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.xml.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.xml/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.xml/META-INF/MANIFEST.MF index 348b67de32..529330331a 100644 --- a/plugins/org.teiid.designer.xml/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.xml/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.xml;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.xml.ModelerXmlPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.xml/pom.xml b/plugins/org.teiid.designer.xml/pom.xml index 136dd59ce6..0f51aa5e9f 100644 --- a/plugins/org.teiid.designer.xml/pom.xml +++ b/plugins/org.teiid.designer.xml/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.xml - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.xsd.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.xsd.ui/META-INF/MANIFEST.MF index 3a063859a0..2e901a1faf 100644 --- a/plugins/org.teiid.designer.xsd.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.xsd.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.xsd.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.xsd.ui.ModelerXsdUiPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.xsd.ui/pom.xml b/plugins/org.teiid.designer.xsd.ui/pom.xml index 3db5efc80f..49fedc5d53 100644 --- a/plugins/org.teiid.designer.xsd.ui/pom.xml +++ b/plugins/org.teiid.designer.xsd.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.xsd.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer.xsd/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.xsd/META-INF/MANIFEST.MF index 5bc401d5e9..464cbb2d72 100644 --- a/plugins/org.teiid.designer.xsd/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.xsd/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer.xsd;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.xsd.ModelerXsdPlugin Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer.xsd/pom.xml b/plugins/org.teiid.designer.xsd/pom.xml index 19db5b2a4e..e102ac2522 100644 --- a/plugins/org.teiid.designer.xsd/pom.xml +++ b/plugins/org.teiid.designer.xsd/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.xsd - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/org.teiid.designer/META-INF/MANIFEST.MF b/plugins/org.teiid.designer/META-INF/MANIFEST.MF index d207ea71c3..bcbede6b8f 100644 --- a/plugins/org.teiid.designer/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer/META-INF/MANIFEST.MF @@ -2,6 +2,6 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.designer -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %pluginProvider Bundle-Localization: plugin diff --git a/plugins/org.teiid.designer/about.properties b/plugins/org.teiid.designer/about.properties index 28a255425d..b56266549e 100644 --- a/plugins/org.teiid.designer/about.properties +++ b/plugins/org.teiid.designer/about.properties @@ -5,7 +5,7 @@ # See the AUTHORS.txt file distributed with this work for a full listing of individual contributors. featureText=Teiid Designer\n\ -Version: 9.2.0\n\ +Version: 9.2.1\n\ \n\ (c) 2000-2015 MetaMatrix, Inc. and Red Hat, Inc.\n\ \n\ diff --git a/plugins/org.teiid.designer/pom.xml b/plugins/org.teiid.designer/pom.xml index e853b6456a..94308cf9c0 100644 --- a/plugins/org.teiid.designer/pom.xml +++ b/plugins/org.teiid.designer/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/pom.xml b/plugins/pom.xml index 44a43a4b71..05b13d0985 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -14,7 +14,6 @@ pom teiid - crypto org.teiid.datatools.connectivity org.teiid.datatools.connectivity.model org.teiid.datatools.connectivity.ui diff --git a/plugins/techpreview.designer.ui/META-INF/MANIFEST.MF b/plugins/techpreview.designer.ui/META-INF/MANIFEST.MF index e5416fc2c4..e547c6923f 100644 --- a/plugins/techpreview.designer.ui/META-INF/MANIFEST.MF +++ b/plugins/techpreview.designer.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %fragmentName Bundle-SymbolicName: techpreview.designer.ui;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Fragment-Host: org.teiid.designer.ui Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Require-Bundle: org.eclipse.ui.navigator;bundle-version="[3.5.200,4.0.0)" diff --git a/plugins/techpreview.designer.ui/pom.xml b/plugins/techpreview.designer.ui/pom.xml index 6a47ff5be6..c2f5a356c6 100644 --- a/plugins/techpreview.designer.ui/pom.xml +++ b/plugins/techpreview.designer.ui/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools techpreview.designer.ui - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/plugins/teiid/org.teiid.runtime.client/META-INF/MANIFEST.MF b/plugins/teiid/org.teiid.runtime.client/META-INF/MANIFEST.MF index f57e7deb3c..240fe3c5e9 100644 --- a/plugins/teiid/org.teiid.runtime.client/META-INF/MANIFEST.MF +++ b/plugins/teiid/org.teiid.runtime.client/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.teiid.runtime.client;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %pluginProvider Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-Localization: plugin diff --git a/plugins/teiid/org.teiid.runtime.client/pom.xml b/plugins/teiid/org.teiid.runtime.client/pom.xml index b358bcec12..0d75fb6676 100644 --- a/plugins/teiid/org.teiid.runtime.client/pom.xml +++ b/plugins/teiid/org.teiid.runtime.client/pom.xml @@ -11,7 +11,7 @@ org.teiid.runtime.client eclipse-plugin teiid runtime client - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT Teiid SQL runtime client 7.5.0.Final-redhat-15 diff --git a/plugins/teiid/org.teiid.runtime.client/src/org/teiid/runtime/client/admin/v8/Admin8Factory.java b/plugins/teiid/org.teiid.runtime.client/src/org/teiid/runtime/client/admin/v8/Admin8Factory.java index eac5fcfcc9..215eaff800 100644 --- a/plugins/teiid/org.teiid.runtime.client/src/org/teiid/runtime/client/admin/v8/Admin8Factory.java +++ b/plugins/teiid/org.teiid.runtime.client/src/org/teiid/runtime/client/admin/v8/Admin8Factory.java @@ -144,7 +144,7 @@ public Admin createAdmin(ITeiidServerVersion teiidVersion, String host, int port return new AdminImpl(teiidVersion, newClient); } LOGGER.info(Messages.gs(Messages.TEIID.TEIID70051, host, port)); //$NON-NLS-1$ //$NON-NLS-2$ - } catch (UnknownHostException e) { + } catch (Exception e) { throw new AdminProcessingException(Messages.gs(Messages.TEIID.TEIID70000, host, e.getLocalizedMessage())); } return null; diff --git a/plugins/teiid/org.teiid.runtime.client/src/org/teiid/runtime/client/proc/ProcedureService.java b/plugins/teiid/org.teiid.runtime.client/src/org/teiid/runtime/client/proc/ProcedureService.java index 72b63ecf67..aba3e0b443 100644 --- a/plugins/teiid/org.teiid.runtime.client/src/org/teiid/runtime/client/proc/ProcedureService.java +++ b/plugins/teiid/org.teiid.runtime.client/src/org/teiid/runtime/client/proc/ProcedureService.java @@ -89,6 +89,9 @@ public String getSQLStatement(ITeiidMetadataFileInfo metadataFileInfo, String re sb.append(columnStr.getSymbolName()).append(SPACE).append(columnStr.getDatatype()); if( metadataFileInfo.isFixedWidthColumns()) { sb.append(SPACE).append(WIDTH).append(SPACE).append(Integer.toString(columnStr.getWidth())); + if(columnStr.isNoTrim()) { + sb.append(SPACE).append(NO_TRIM); + } } if(i < (nColumns-1)) { sb.append(COMMA).append(SPACE); @@ -116,26 +119,26 @@ public String getSQLStatement(ITeiidMetadataFileInfo metadataFileInfo, String re String delimiter = metadataFileInfo.getDelimiter(); if( metadataFileInfo.doUseDelimitedColumns() && ! DEFAULT_DELIMITER.equals(delimiter) ) { - sb.append("DELIMITER"); //$NON-NLS-1$ + sb.append(DELIMITER_STR); //$NON-NLS-1$ sb.append(SPACE).append('\'').append(delimiter).append('\''); } if( metadataFileInfo.doIncludeQuote() ) { String quote = metadataFileInfo.getQuote(); if( ! DEFAULT_QUOTE.equals(quote)) { - sb.append("QUOTE"); //$NON-NLS-1$ + sb.append(QUOTE_STR); //$NON-NLS-1$ sb.append(SPACE).append('\'').append(quote).append('\''); } } else if(metadataFileInfo.doIncludeEscape() ) { String escape = metadataFileInfo.getEscape(); if( ! DEFAULT_ESCAPE.equals(escape)) { - sb.append("ESCAPE"); //$NON-NLS-1$ + sb.append(ESCAPE_STR); //$NON-NLS-1$ sb.append(SPACE).append('\'').append(escape).append('\''); } } if( metadataFileInfo.doIncludeHeader() ) { - sb.append(SPACE).append("HEADER"); //$NON-NLS-1$ + sb.append(SPACE).append(HEADER); //$NON-NLS-1$ if( metadataFileInfo.getHeaderLineNumber() > 1 ) { sb.append(SPACE).append(Integer.toString(metadataFileInfo.getHeaderLineNumber())); } @@ -143,12 +146,12 @@ public String getSQLStatement(ITeiidMetadataFileInfo metadataFileInfo, String re int firstDataRow = metadataFileInfo.getFirstDataRow(); if( firstDataRow > 1 && (metadataFileInfo.doIncludeSkip() || metadataFileInfo.isFixedWidthColumns()) ) { - sb.append(SPACE).append("SKIP"); //$NON-NLS-1$ + sb.append(SPACE).append(SKIP); //$NON-NLS-1$ sb.append(SPACE).append(Integer.toString(firstDataRow-1)); } if( metadataFileInfo.doIncludeNoTrim() && firstDataRow > 1 ) { - sb.append(SPACE).append("NO TRIM"); //$NON-NLS-1$ + sb.append(SPACE).append(NO_TRIM); //$NON-NLS-1$ } tokens.add(sb.toString()); tokens.add(alias); diff --git a/plugins/teiid/org.teiid.runtime.client/src/org/teiid/runtime/client/query/QueryService.java b/plugins/teiid/org.teiid.runtime.client/src/org/teiid/runtime/client/query/QueryService.java index b113b18d5f..0f2c188dde 100644 --- a/plugins/teiid/org.teiid.runtime.client/src/org/teiid/runtime/client/query/QueryService.java +++ b/plugins/teiid/org.teiid.runtime.client/src/org/teiid/runtime/client/query/QueryService.java @@ -167,12 +167,14 @@ public IFunctionLibrary createFunctionLibrary(List fun } FunctionTree tree = functionTrees.get(descriptor.getSchema()); + UDFSource udfSource = new UDFSource(Collections.EMPTY_LIST, getClass().getClassLoader()); + if (tree == null) { - tree = new FunctionTree(teiidVersion, descriptor.getSchema(), new UDFSource(Collections.EMPTY_LIST, getClass().getClassLoader()), false); + tree = new FunctionTree(teiidVersion, descriptor.getSchema(), udfSource, false); functionTrees.put(descriptor.getSchema(), tree); } - - FunctionDescriptor fd = tree.addFunction(descriptor.getSchema(), null, fMethod, false); + + FunctionDescriptor fd = tree.addFunction(descriptor.getSchema(), udfSource, fMethod, false); fd.setMetadataID(descriptor.getMetadataID()); } diff --git a/pom.xml b/pom.xml index 168391959d..74029b1f2b 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ org.jboss.tools.integration-stack target-platform - 4.2.8.Final + 4.2.9.Final target base diff --git a/scripts/build-common.xml b/scripts/build-common.xml index d525519fe5..920243c470 100644 --- a/scripts/build-common.xml +++ b/scripts/build-common.xml @@ -99,7 +99,7 @@ Executing maven in directory @{dir} with arguments: ${rwsResult} - + @@ -111,4 +111,4 @@ - \ No newline at end of file + diff --git a/site/category.xml b/site/category.xml index 0b0fa28a2e..dbac9af08f 100644 --- a/site/category.xml +++ b/site/category.xml @@ -20,6 +20,10 @@ Visit the project home page at: http://www.teiid.org for details. + + + + diff --git a/site/pom.xml b/site/pom.xml index a9b948878f..b87934e88b 100644 --- a/site/pom.xml +++ b/site/pom.xml @@ -10,7 +10,7 @@ org.jboss.tools teiid.site Teiid Designer - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-repository Teiid Designer diff --git a/target-platform/build.sh b/target-platform/build.sh index 3a2c7c1760..5365bf69a8 100755 --- a/target-platform/build.sh +++ b/target-platform/build.sh @@ -34,6 +34,7 @@ echo "Script directory = $SCRIPT_DIR" # Set root directory to be the parent of this. # ROOT_DIR="$SCRIPT_DIR/../.." +echo "Root Directory: $ROOT_DIR" # # By default debug is turned off @@ -63,7 +64,12 @@ SRC_DIR="${SCRIPT_DIR}" # Ensure it only contains teiid related artifacts and # does not clutter up user's existing $HOME/.m2 repository # -LOCAL_REPO="${ROOT_DIR}/m2-repository" +if [ -z "${M2_REPO}" ]; then + LOCAL_REPO="${ROOT_DIR}/m2-repository" +else + LOCAL_REPO=${M2_REPO} +fi +echo "Local Repository: $LOCAL_REPO" # # Maven command diff --git a/test-aggregate/org.teiid.designer.aggregate.test/META-INF/MANIFEST.MF b/test-aggregate/org.teiid.designer.aggregate.test/META-INF/MANIFEST.MF index 72fcfcf63e..5b9080f577 100644 --- a/test-aggregate/org.teiid.designer.aggregate.test/META-INF/MANIFEST.MF +++ b/test-aggregate/org.teiid.designer.aggregate.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.teiid.designer.aggregate.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Activator: org.teiid.designer.aggregate.test.TestDesignerPlugin Require-Bundle: org.eclipse.ui;bundle-version="[3.106.1,4.0.0)", org.eclipse.core.runtime;bundle-version="[3.10.0,4.0.0)", diff --git a/test-aggregate/org.teiid.designer.aggregate.test/pom.xml b/test-aggregate/org.teiid.designer.aggregate.test/pom.xml index 9e3004175b..f11d9e67c4 100644 --- a/test-aggregate/org.teiid.designer.aggregate.test/pom.xml +++ b/test-aggregate/org.teiid.designer.aggregate.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.aggregate.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-test-plugin diff --git a/tests/org.teiid.core.designer.test.framework/META-INF/MANIFEST.MF b/tests/org.teiid.core.designer.test.framework/META-INF/MANIFEST.MF index 7e83ef6645..71c41769f0 100644 --- a/tests/org.teiid.core.designer.test.framework/META-INF/MANIFEST.MF +++ b/tests/org.teiid.core.designer.test.framework/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.teiid.core.designer.test.framework;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Require-Bundle: org.jboss.tools.locus.mockito;bundle-version="[1.9.5,2.0.0)", diff --git a/tests/org.teiid.core.designer.test.framework/pom.xml b/tests/org.teiid.core.designer.test.framework/pom.xml index 95929b82b7..8be4f48622 100644 --- a/tests/org.teiid.core.designer.test.framework/pom.xml +++ b/tests/org.teiid.core.designer.test.framework/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.core.designer.test.framework - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.core.designer.test/META-INF/MANIFEST.MF b/tests/org.teiid.core.designer.test/META-INF/MANIFEST.MF index b98f7c2435..db47e32a7f 100644 --- a/tests/org.teiid.core.designer.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.core.designer.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.core.designer.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.core.designer Bundle-Localization: plugin diff --git a/tests/org.teiid.core.designer.test/pom.xml b/tests/org.teiid.core.designer.test/pom.xml index a005902494..52240d8895 100644 --- a/tests/org.teiid.core.designer.test/pom.xml +++ b/tests/org.teiid.core.designer.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.core.designer.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.compare.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.compare.test/META-INF/MANIFEST.MF index fa327bdaa3..b8048faeac 100644 --- a/tests/org.teiid.designer.compare.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.compare.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.compare.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.compare Bundle-Localization: plugin diff --git a/tests/org.teiid.designer.compare.test/pom.xml b/tests/org.teiid.designer.compare.test/pom.xml index 7f262cbbfa..a7bbcec8f9 100644 --- a/tests/org.teiid.designer.compare.test/pom.xml +++ b/tests/org.teiid.designer.compare.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.compare.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.core.test.framework/META-INF/MANIFEST.MF b/tests/org.teiid.designer.core.test.framework/META-INF/MANIFEST.MF index 44cca92d6b..729d4dae84 100644 --- a/tests/org.teiid.designer.core.test.framework/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.core.test.framework/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.teiid.designer.core.test.framework;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Export-Package: org.teiid.designer.core, diff --git a/tests/org.teiid.designer.core.test.framework/pom.xml b/tests/org.teiid.designer.core.test.framework/pom.xml index e9bb163c6e..09e6243c00 100644 --- a/tests/org.teiid.designer.core.test.framework/pom.xml +++ b/tests/org.teiid.designer.core.test.framework/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.core.test.framework - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.core.test.framework/src/org/teiid/designer/core/workspace/MockFileBuilder.java b/tests/org.teiid.designer.core.test.framework/src/org/teiid/designer/core/workspace/MockFileBuilder.java index ee87361c83..a9a489e964 100644 --- a/tests/org.teiid.designer.core.test.framework/src/org/teiid/designer/core/workspace/MockFileBuilder.java +++ b/tests/org.teiid.designer.core.test.framework/src/org/teiid/designer/core/workspace/MockFileBuilder.java @@ -252,7 +252,13 @@ private void mockFile() throws Exception { mockFileProperties(resource, realFile, wkspPath, IResource.FILE); IFile resourceFile = getResourceFile(); - when(resourceFile.getContents()).thenReturn(new FileInputStream(realFile)); + when(resourceFile.getContents()).thenAnswer(new Answer() { + @Override + public InputStream answer(InvocationOnMock invocation) throws Throwable { + assertNotNull(realFile); + return new FileInputStream(realFile); + } + }); } /** diff --git a/tests/org.teiid.designer.core.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.core.test/META-INF/MANIFEST.MF index 897aa79676..e885b1ab02 100644 --- a/tests/org.teiid.designer.core.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.core.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.core.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.core Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.core.test/pom.xml b/tests/org.teiid.designer.core.test/pom.xml index cb5be0dbaa..f5c398a05f 100644 --- a/tests/org.teiid.designer.core.test/pom.xml +++ b/tests/org.teiid.designer.core.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.core.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.core.xslt.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.core.xslt.test/META-INF/MANIFEST.MF index 700eee5f0d..49962a3287 100644 --- a/tests/org.teiid.designer.core.xslt.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.core.xslt.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.core.xslt.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.core.xslt Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.core.xslt.test/pom.xml b/tests/org.teiid.designer.core.xslt.test/pom.xml index 3b07b75e80..327cbee0a1 100644 --- a/tests/org.teiid.designer.core.xslt.test/pom.xml +++ b/tests/org.teiid.designer.core.xslt.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.core.xslt.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.ddl.importer.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.ddl.importer.test/META-INF/MANIFEST.MF index 0a73347c25..b502f92f36 100644 --- a/tests/org.teiid.designer.ddl.importer.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.ddl.importer.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.teiid.designer.ddl.importer.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor Fragment-Host: org.teiid.designer.ddl.importer Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.ddl.importer.test/pom.xml b/tests/org.teiid.designer.ddl.importer.test/pom.xml index fd3576c08b..84fe2c4c21 100644 --- a/tests/org.teiid.designer.ddl.importer.test/pom.xml +++ b/tests/org.teiid.designer.ddl.importer.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.ddl.importer.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.dqp.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.dqp.test/META-INF/MANIFEST.MF index d804c58234..c6a78351d5 100644 --- a/tests/org.teiid.designer.dqp.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.dqp.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.dqp.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.dqp Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.dqp.test/pom.xml b/tests/org.teiid.designer.dqp.test/pom.xml index 1d4457d438..192f8014a6 100644 --- a/tests/org.teiid.designer.dqp.test/pom.xml +++ b/tests/org.teiid.designer.dqp.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.dqp.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.dqp.test/src/org/teiid/designer/runtime/DefaultStorageProvider.java b/tests/org.teiid.designer.dqp.test/src/org/teiid/designer/runtime/DefaultStorageProvider.java index f84a538c82..e673168653 100644 --- a/tests/org.teiid.designer.dqp.test/src/org/teiid/designer/runtime/DefaultStorageProvider.java +++ b/tests/org.teiid.designer.dqp.test/src/org/teiid/designer/runtime/DefaultStorageProvider.java @@ -9,6 +9,7 @@ import java.util.HashMap; import java.util.Map; + import org.teiid.datatools.connectivity.spi.ISecureStorageProvider; /** @@ -51,4 +52,9 @@ public void storeInSecureStorage(String nodeKey, String key, String value) throw public void clear() { storageMap.clear(); } + + @Override + public void removeFromSecureStorage(String nodeKey) throws Exception { + storageMap.remove(nodeKey); + } } diff --git a/tests/org.teiid.designer.dqp.test/src/org/teiid/designer/runtime/ServerManagerTest.java b/tests/org.teiid.designer.dqp.test/src/org/teiid/designer/runtime/ServerManagerTest.java index 4443fd26de..6b67e5669e 100644 --- a/tests/org.teiid.designer.dqp.test/src/org/teiid/designer/runtime/ServerManagerTest.java +++ b/tests/org.teiid.designer.dqp.test/src/org/teiid/designer/runtime/ServerManagerTest.java @@ -19,8 +19,10 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; + import java.util.ArrayList; import java.util.List; + import org.eclipse.wst.server.core.IServer; import org.eclipse.wst.server.core.IServerLifecycleListener; import org.eclipse.wst.server.core.IServerListener; @@ -32,10 +34,10 @@ import org.teiid.core.util.SmartTestDesignerSuite; import org.teiid.core.util.TestUtilities; import org.teiid.datatools.connectivity.ConnectivityUtil; +import org.teiid.datatools.connectivity.spi.ISecureStorageProvider; import org.teiid.designer.core.ModelerCore; import org.teiid.designer.runtime.spi.EventManager; import org.teiid.designer.runtime.spi.ExecutionConfigurationEvent; -import org.teiid.designer.runtime.spi.HostProvider; import org.teiid.designer.runtime.spi.IExecutionConfigurationListener; import org.teiid.designer.runtime.spi.ITeiidAdminInfo; import org.teiid.designer.runtime.spi.ITeiidJdbcInfo; @@ -277,15 +279,8 @@ public void shouldRestoreServerRegistry() throws Exception { // setup MockObjectFactory.createModelContainer(); - DefaultStorageProvider mgrStorageProvider = new DefaultStorageProvider(); - mgrStorageProvider.storeInSecureStorage("org/teiid/datatools/connectivity/TeiidAdminInfo/mms://localhost:31443/TOK##!nprfI5QGuA6XDzOmAF6xE4kZGMbzgRlGI83rRX4BxKJXqwgykxJ2qOfHtJgtjf7vfCkAxQlQ-YZBauTUYuOk9w/", - ConnectivityUtil.ADMIN_PASSWORD, "admin"); - mgrStorageProvider.storeInSecureStorage("org/teiid/datatools/connectivity/TeiidJdbcInfo/jdbc:teiid:@mms://myserver.com:31000/TOK##!kdGRBt_o38H5yh6mcwJBHNFMeGn1xdPoERHtQRTURr3t3OlrDvxoBtyjW06rKv7EsFkCWBw5lZM4hK4YwvP7Nw/", - ConnectivityUtil.JDBC_PASSWORD, "teiid"); - this.mgr = new TeiidServerManager(SmartTestDesignerSuite.getTestDataPath(getClass()), - serversProvider, mgrStorageProvider); - ModelerCore.setTeiidServerManager(this.mgr); + serversProvider, new DefaultStorageProvider()); this.mgr.restoreState(); assertThat(this.mgr.getServers().size(), is(2)); @@ -300,22 +295,23 @@ public void shouldRestoreServerRegistry() throws Exception { boolean jdbcSecure = false; String jdbcUser = "teiid"; String jdbcPassword = null; + String host = "localhost"; EventManager eventMgr = mock(EventManager.class); IServer parentServer1 = mock(IServer.class); + when(parentServer1.getHost()).thenReturn(host); when(parentServer1.getId()).thenReturn("server1"); + ISecureStorageProvider secureStorageProvider = new DefaultStorageProvider(); // construct a server just to get its URL - ITeiidAdminInfo adminInfo = new TeiidAdminInfo(adminPort, adminUser, mgrStorageProvider, adminPassword, adminSecure); - ITeiidJdbcInfo jdbcInfo = new TeiidJdbcInfo(jdbcPort, jdbcUser, mgrStorageProvider, jdbcPassword, jdbcSecure); - TeiidServer testServer = new TeiidServer(serverVersion, adminInfo, jdbcInfo, eventMgr, parentServer1); - adminInfo.setHostProvider(testServer); - jdbcInfo.setHostProvider(testServer); + ITeiidAdminInfo adminInfo = new TeiidAdminInfo(host, adminPort, adminUser, secureStorageProvider, adminPassword, adminSecure); + ITeiidJdbcInfo jdbcInfo = new TeiidJdbcInfo(host, jdbcPort, jdbcUser, secureStorageProvider, jdbcPassword, jdbcSecure); + TeiidServer testServer = new TeiidServer(serverVersion, host, adminInfo, jdbcInfo, eventMgr, parentServer1); ITeiidServer teiidServer = this.mgr.getServer(testServer.getId()); assertThat(teiidServer, notNullValue()); assertThat(teiidServer, is(this.mgr.getDefaultServer())); assertThat(teiidServer.getCustomLabel(), is(customLabel)); - assertThat(teiidServer.getHost(), is(HostProvider.DEFAULT_HOST)); + assertThat(teiidServer.getHost(), is(host)); assertThat(teiidServer.getTeiidAdminInfo().getPort(), is(adminPort)); assertThat(teiidServer.getTeiidAdminInfo().getUsername(), is(adminUser)); assertThat(teiidServer.getTeiidAdminInfo().getPassword(), is(adminPassword)); @@ -338,19 +334,18 @@ public void shouldRestoreServerRegistry() throws Exception { jdbcSecure = true; jdbcUser = "teiid2"; jdbcPassword = "teiid"; + host = "myserver.com"; // construct a server just to get its URL - adminInfo = new TeiidAdminInfo(adminPort, adminUser, mgrStorageProvider, adminPassword, adminSecure); - jdbcInfo = new TeiidJdbcInfo(jdbcPort, jdbcUser, mgrStorageProvider, jdbcPassword, jdbcSecure); - testServer = new TeiidServer(serverVersion, adminInfo, jdbcInfo, eventMgr, parentServer2); - adminInfo.setHostProvider(testServer); - jdbcInfo.setHostProvider(testServer); + adminInfo = new TeiidAdminInfo(host, adminPort, adminUser, secureStorageProvider, adminPassword, adminSecure); + jdbcInfo = new TeiidJdbcInfo(host, jdbcPort, jdbcUser, secureStorageProvider, jdbcPassword, jdbcSecure); + testServer = new TeiidServer(serverVersion, host, adminInfo, jdbcInfo, eventMgr, parentServer2); teiidServer = this.mgr.getServer(testServer.getId()); assertThat(teiidServer, notNullValue()); assertThat(teiidServer, is(not(this.mgr.getDefaultServer()))); assertThat(teiidServer.getCustomLabel(), nullValue()); // customLabel is empty string but gets set as a null - assertThat(teiidServer.getHost(), is(parentServer2.getHost())); + assertThat(teiidServer.getHost(), is(host)); assertThat(teiidServer.getTeiidAdminInfo().getPort(), is(adminPort)); assertThat(teiidServer.getTeiidAdminInfo().getUsername(), is(adminUser)); assertThat(teiidServer.getTeiidAdminInfo().getPassword(), is(adminPassword)); @@ -360,5 +355,4 @@ public void shouldRestoreServerRegistry() throws Exception { assertThat(teiidServer.getTeiidJdbcInfo().getPassword(), is(jdbcPassword)); assertThat(teiidServer.getTeiidJdbcInfo().isSecure(), is(jdbcSecure)); } - } diff --git a/tests/org.teiid.designer.dqp.test/src/org/teiid/designer/runtime/ServerTest.java b/tests/org.teiid.designer.dqp.test/src/org/teiid/designer/runtime/ServerTest.java index cd3bca2d18..fc9f80308b 100644 --- a/tests/org.teiid.designer.dqp.test/src/org/teiid/designer/runtime/ServerTest.java +++ b/tests/org.teiid.designer.dqp.test/src/org/teiid/designer/runtime/ServerTest.java @@ -11,6 +11,7 @@ import static org.hamcrest.core.IsNull.nullValue; import static org.junit.Assert.assertThat; import static org.mockito.Mockito.mock; + import org.eclipse.wst.server.core.IServer; import org.junit.After; import org.junit.Before; @@ -19,8 +20,8 @@ import org.teiid.datatools.connectivity.spi.ISecureStorageProvider; import org.teiid.designer.core.ModelerCore; import org.teiid.designer.runtime.spi.EventManager; -import org.teiid.designer.runtime.spi.HostProvider; import org.teiid.designer.runtime.spi.ITeiidAdminInfo; +import org.teiid.designer.runtime.spi.ITeiidConnectionInfo; import org.teiid.designer.runtime.spi.ITeiidJdbcInfo; import org.teiid.designer.runtime.spi.ITeiidServer; import org.teiid.designer.runtime.spi.ITeiidServerManager; @@ -31,6 +32,7 @@ */ public class ServerTest { + private static final String HOST = "localhost"; private static final String PORT = "31000"; private static final String USER = "user"; private static final String PSWD = "pswd"; @@ -47,7 +49,8 @@ public class ServerTest { @Before public void beforeEach() { this.serverVersion = mock(ITeiidServerVersion.class); - this.adminInfo = mock(ITeiidAdminInfo.class); + this.adminInfo = new TeiidAdminInfo(HOST, PORT, USER, SECURE_STORAGE_PROVIDER, PSWD, SECURE); + this.jdbcInfo = mock(ITeiidJdbcInfo.class); this.eventMgr = mock(EventManager.class); this.parentServer = mock(IServer.class); @@ -55,7 +58,7 @@ public void beforeEach() { ITeiidServerManager teiidServerManager = mock(ITeiidServerManager.class); ModelerCore.setTeiidServerManager(teiidServerManager); - this.teiidServer = new TeiidServer(serverVersion, adminInfo, jdbcInfo, eventMgr, parentServer); + this.teiidServer = new TeiidServer(serverVersion, HOST, adminInfo, jdbcInfo, eventMgr, parentServer); } @After @@ -65,27 +68,27 @@ public void afterEach() { @Test(expected = IllegalArgumentException.class) public void shouldNotCreateServerWithNullServerVersion() { - new TeiidServer(null, this.adminInfo, this.jdbcInfo, this.eventMgr, this.parentServer); + new TeiidServer(null, HOST, this.adminInfo, this.jdbcInfo, this.eventMgr, this.parentServer); } @Test(expected = IllegalArgumentException.class) public void shouldNotCreateServerWithNullAdminInfo() { - new TeiidServer(serverVersion, null, this.jdbcInfo, this.eventMgr, this.parentServer); + new TeiidServer(serverVersion, HOST, null, this.jdbcInfo, this.eventMgr, this.parentServer); } @Test(expected = IllegalArgumentException.class) public void shouldNotCreateServerWithNullJdbcInfo() { - new TeiidServer(serverVersion, this.adminInfo, null, this.eventMgr, this.parentServer); + new TeiidServer(serverVersion, HOST, this.adminInfo, null, this.eventMgr, this.parentServer); } @Test(expected = IllegalArgumentException.class) public void shouldNotCreateServerWithNullEventManager() { - new TeiidServer(serverVersion, this.adminInfo, this.jdbcInfo, null, this.parentServer); + new TeiidServer(serverVersion, HOST, this.adminInfo, this.jdbcInfo, null, this.parentServer); } @Test(expected = IllegalArgumentException.class) public void shouldNotCreateServerWithNullParentServer() { - new TeiidServer(serverVersion, this.adminInfo, this.jdbcInfo, this.eventMgr, null); + new TeiidServer(serverVersion, HOST, this.adminInfo, this.jdbcInfo, this.eventMgr, null); } @Test @@ -119,18 +122,18 @@ public void shouldVerifyCustomLabelIsNullAfterConstruction() { @Test public void shouldVerifyDefaultHostAfterConstruction() { - assertThat(this.teiidServer.getHost(), is(HostProvider.DEFAULT_HOST)); + assertThat(this.teiidServer.getHost(), is(ITeiidConnectionInfo.DEFAULT_HOST)); } @Test public void shouldBeEqualsWhenAllPropertiesAreTheSame() { - ITeiidServer server1 = new TeiidServer(serverVersion, - new TeiidAdminInfo(PORT, USER, SECURE_STORAGE_PROVIDER, PSWD, SECURE), - new TeiidJdbcInfo(PORT, USER, SECURE_STORAGE_PROVIDER, PSWD, SECURE), + ITeiidServer server1 = new TeiidServer(serverVersion, HOST, + new TeiidAdminInfo(HOST, PORT, USER, SECURE_STORAGE_PROVIDER, PSWD, SECURE), + new TeiidJdbcInfo(HOST, PORT, USER, SECURE_STORAGE_PROVIDER, PSWD, SECURE), this.eventMgr, this.parentServer); - ITeiidServer server2 = new TeiidServer(serverVersion, - new TeiidAdminInfo(PORT, USER, SECURE_STORAGE_PROVIDER, PSWD, SECURE), - new TeiidJdbcInfo(PORT, USER, SECURE_STORAGE_PROVIDER, PSWD, SECURE), + ITeiidServer server2 = new TeiidServer(serverVersion, HOST, + new TeiidAdminInfo(HOST, PORT, USER, SECURE_STORAGE_PROVIDER, PSWD, SECURE), + new TeiidJdbcInfo(HOST, PORT, USER, SECURE_STORAGE_PROVIDER, PSWD, SECURE), this.eventMgr, this.parentServer); assertThat(server1.equals(server2), is(true)); } diff --git a/tests/org.teiid.designer.dqp.test/src/org/teiid/designer/runtime/TeiidConnectionInfoTest.java b/tests/org.teiid.designer.dqp.test/src/org/teiid/designer/runtime/TeiidConnectionInfoTest.java index 3d77a0994b..7fcc4e9a43 100644 --- a/tests/org.teiid.designer.dqp.test/src/org/teiid/designer/runtime/TeiidConnectionInfoTest.java +++ b/tests/org.teiid.designer.dqp.test/src/org/teiid/designer/runtime/TeiidConnectionInfoTest.java @@ -16,11 +16,12 @@ import static org.junit.Assert.assertSame; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; + import org.eclipse.core.runtime.IStatus; import org.junit.Before; import org.junit.Test; import org.teiid.datatools.connectivity.ConnectivityUtil; -import org.teiid.designer.runtime.spi.HostProvider; +import org.teiid.designer.runtime.spi.ITeiidConnectionInfo; /** * @@ -33,30 +34,34 @@ public class TeiidConnectionInfoTest { private static final boolean INITIAL_SECURE = true; private static final String INITIAL_USER = "user"; - private static final HostProvider NEW_HOST_PROVIDER = new HostProvider() { - @Override - public String getHost() { - return NEW_HOST; - } - }; private static final String NEW_HOST = "newHost"; private static final String NEW_PORT = "31443"; private static final String NEW_PSWD = "newPswd"; private static final String NEW_USER = "newUser"; + + private static final String EXTRA_URL_PARAMETER = "MyExtraUrlPrefix"; static final String PASSWORD_KEY = ConnectionInfo.class.getName() + ".password"; DefaultStorageProvider defaultStorageProvider; - class ConnectionInfo extends TeiidConnectionInfo { + class ConnectionInfo extends TeiidAdminInfo { - public ConnectionInfo( String port, + public ConnectionInfo( String host, + String port, String username, String password, boolean secure ) { - super(port, username, defaultStorageProvider, password, secure); + super(host, port, username, defaultStorageProvider, password, secure); } + public ConnectionInfo( String port, + String username, + String password, + boolean secure ) { + super(ITeiidConnectionInfo.DEFAULT_HOST, port, username, defaultStorageProvider, password, secure); + } + @Override protected String getPasswordKey() { return PASSWORD_KEY; @@ -71,6 +76,11 @@ protected String getPasswordKey() { public String getType() { return "Test"; } + + @Override + public String getUrl() { + return super.getUrl(); + } } @@ -82,12 +92,6 @@ public void beforeEach() { this.connectionInfo = new ConnectionInfo(INITIAL_PORT, INITIAL_USER, INITIAL_PSWD, INITIAL_SECURE); } - @Test - public void shouldSetHostProvider() { - this.connectionInfo.setHostProvider(NEW_HOST_PROVIDER); - assertSame(this.connectionInfo.getHostProvider(), NEW_HOST_PROVIDER); - } - @Test public void shouldAllowNullPortAtConstruction() { new ConnectionInfo(null, INITIAL_USER, INITIAL_PSWD, INITIAL_SECURE); @@ -249,19 +253,13 @@ public void shouldSetSecure() { @Test public void shouldGetCorrectUrlAfterConstruction() { - assertThat(this.connectionInfo.getUrl(), is("mms://" + HostProvider.DEFAULT_HOST + ':' + INITIAL_PORT)); - } - - @Test - public void shouldGetCorrectUrlAfterChangingHostProvider() { - this.connectionInfo.setHostProvider(NEW_HOST_PROVIDER); - assertThat(this.connectionInfo.getUrl(), is("mms://" + NEW_HOST + ':' + INITIAL_PORT)); + assertThat(this.connectionInfo.getUrl(), is("mms://" + ITeiidConnectionInfo.DEFAULT_HOST + ':' + INITIAL_PORT)); } @Test public void shouldGetCorrectUrlWithNotSecureAfterConstruction() { this.connectionInfo = new ConnectionInfo(INITIAL_PORT, INITIAL_USER, INITIAL_PSWD, !INITIAL_SECURE); - assertThat(this.connectionInfo.getUrl(), is("mm://" + HostProvider.DEFAULT_HOST + ':' + INITIAL_PORT)); + assertThat(this.connectionInfo.getUrl(), is("mm://" + ITeiidConnectionInfo.DEFAULT_HOST + ':' + INITIAL_PORT)); } @Test @@ -275,14 +273,13 @@ public void shouldGetSamePassTokenForSamePassword() { @Test public void shouldSetAll() { - TeiidConnectionInfo anotherConnectionInfo = new ConnectionInfo(NEW_PORT, + TeiidAdminInfo anotherConnectionInfo = new ConnectionInfo(NEW_HOST, NEW_PORT, NEW_USER, NEW_PSWD, !INITIAL_SECURE); - anotherConnectionInfo.setHostProvider(NEW_HOST_PROVIDER); this.connectionInfo.setAll(anotherConnectionInfo); - assertSame(this.connectionInfo.getHostProvider(), NEW_HOST_PROVIDER); + assertSame(this.connectionInfo.getHost(), NEW_HOST); assertThat(this.connectionInfo.getPort(), is(NEW_PORT)); assertThat(this.connectionInfo.getUsername(), is(NEW_USER)); assertThat(this.connectionInfo.getPassword(), is(NEW_PSWD)); @@ -332,45 +329,6 @@ public void shouldNotBeEqualIfUsernameIsDifferent() { assertThat(this.connectionInfo.equals(otherInfo), is(false)); } - @Test - public void shouldFindPasswordUsingPassToken() throws Exception { - String myPassword = "FindMe"; - String passToken = "MyPassToken"; - String url = connectionInfo.getUrl(); - - String providerKey = ConnectivityUtil.buildSecureStorageKey(ConnectionInfo.class, url, passToken); - defaultStorageProvider.storeInSecureStorage(providerKey, PASSWORD_KEY, myPassword); - - ConnectionInfo otherInfo = new ConnectionInfo(connectionInfo.getPort(), connectionInfo.getUsername(), null, connectionInfo.isSecure()); - assertNull(otherInfo.getPassword()); - - otherInfo.setPassToken(passToken); - assertEquals(otherInfo.getPassToken(), passToken); - - assertEquals(otherInfo.getPassword(), myPassword); - } - - @Test - public void shouldFindLegacyPasswordsWithoutPassToken() throws Exception { - String myPassword = "FindMe"; - String url = connectionInfo.getUrl(); - - ConnectionInfo otherInfo = new ConnectionInfo(connectionInfo.getPort(), connectionInfo.getUsername(), null, connectionInfo.isSecure()); - assertNull(otherInfo.getPassToken()); - assertNull(otherInfo.getPassword()); - - String providerKey = ConnectivityUtil.buildSecureStorageKey(ConnectionInfo.class, url); - defaultStorageProvider.storeInSecureStorage(providerKey, PASSWORD_KEY, myPassword); - assertEquals(otherInfo.getPassword(), myPassword); - - /* Password should not be stored in the correct place with a new pass token */ - assertNotNull(otherInfo.getPassToken()); - - providerKey = ConnectivityUtil.buildSecureStorageKey(ConnectionInfo.class, otherInfo.getUrl(), otherInfo.getPassToken()); - String otherInfoPasswd = defaultStorageProvider.getFromSecureStorage(providerKey, PASSWORD_KEY); - assertEquals(myPassword, otherInfoPasswd); - } - /** * Sub classes demonstrating that the password reference will be broken * if extra url parameter are set in the constructor and initPassword is @@ -380,26 +338,22 @@ public void shouldFindLegacyPasswordsWithoutPassToken() throws Exception { */ private class LostPasswdSubConnectionInfo extends ConnectionInfo { - private String extraUrlParameter = null; - public LostPasswdSubConnectionInfo(String port, String username, String password, boolean secure) { super(port, username, password, secure); - this.extraUrlParameter = "MyExtraUrlPrefix"; } @Override - public String getUrl() { - return "<" + this.extraUrlParameter + ">" + super.getUrl(); + protected void generateUrl() { + super.generateUrl(); + + this.url = "<" + EXTRA_URL_PARAMETER + ">" + super.getUrl(); } } private class FoundPasswdSubConnectionInfo extends ConnectionInfo { - private String extraUrlParameter = null; - public FoundPasswdSubConnectionInfo(String port, String username, String password, boolean secure) { super(port, username, password, secure); - this.extraUrlParameter = "MyExtraUrlPrefix"; /* * Note this init method has been called after the setting of the @@ -407,12 +361,14 @@ public FoundPasswdSubConnectionInfo(String port, String username, String passwor * value of the url which is required for generating the pass token * used to reference the password in storage */ - initPassword(password); + setPassword(password); } @Override - public String getUrl() { - return "<" + this.extraUrlParameter + ">" + super.getUrl(); + protected void generateUrl() { + super.generateUrl(); + + this.url = "<" + EXTRA_URL_PARAMETER + ">" + super.getUrl(); } } @@ -422,7 +378,7 @@ public void shouldStillFindPasswordIfUpdatingUrlInConstructor() throws Exception * Do it like this and we lose the link to the password! */ LostPasswdSubConnectionInfo subInfo1 = new LostPasswdSubConnectionInfo(INITIAL_PORT, INITIAL_USER, INITIAL_PSWD, INITIAL_SECURE); - assertNull(subInfo1.getPassword()); + assertNotNull(subInfo1.getPassword()); /* * Do it like this and the password link is maintained @@ -430,25 +386,30 @@ public void shouldStillFindPasswordIfUpdatingUrlInConstructor() throws Exception FoundPasswdSubConnectionInfo subInfo2 = new FoundPasswdSubConnectionInfo(INITIAL_PORT, INITIAL_USER, INITIAL_PSWD, INITIAL_SECURE); assertEquals(INITIAL_PSWD, subInfo2.getPassword()); } - + @Test - public void updatingHostProviderShouldNotStoreNullPasswordIfNoPasswordExisted() throws Exception { - String myPassword = "FindMe"; + public void shouldReplacePasswordWithHostChange() throws Exception { - String providerKey = ConnectivityUtil.buildSecureStorageKey(ConnectionInfo.class, connectionInfo.getUrl(), connectionInfo.getPassToken()); - assertTrue(defaultStorageProvider.existsInSecureStorage(providerKey, PASSWORD_KEY)); + String originalToken = connectionInfo.getPassToken(); + String originalPWD = connectionInfo.getPassword(); + connectionInfo.setHost(NEW_HOST); - defaultStorageProvider.clear(); - - connectionInfo.setHostProvider(NEW_HOST_PROVIDER); - - assertFalse(defaultStorageProvider.existsInSecureStorage(providerKey, PASSWORD_KEY)); - - connectionInfo.setPassword(myPassword); + assertNotNull(connectionInfo.getPassToken()); + assertFalse(connectionInfo.getPassToken().equals(originalToken)); + assertNotNull(connectionInfo.getPassword()); + assertTrue(connectionInfo.getPassword().equals(originalPWD)); + } + + @Test + public void shouldReplacePasswordWithPortChange() throws Exception { - providerKey = ConnectivityUtil.buildSecureStorageKey(ConnectionInfo.class, connectionInfo.getUrl(), connectionInfo.getPassToken()); - assertTrue(defaultStorageProvider.existsInSecureStorage(providerKey, PASSWORD_KEY)); - assertEquals(defaultStorageProvider.getFromSecureStorage(providerKey, PASSWORD_KEY), myPassword); - assertEquals(connectionInfo.getPassword(), myPassword); + String originalToken = connectionInfo.getPassToken(); + String originalPWD = connectionInfo.getPassword(); + connectionInfo.setPort(NEW_PORT); + + assertNotNull(connectionInfo.getPassToken()); + assertFalse(connectionInfo.getPassToken().equals(originalToken)); + assertNotNull(connectionInfo.getPassword()); + assertTrue(connectionInfo.getPassword().equals(originalPWD)); } } diff --git a/tests/org.teiid.designer.extension.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.extension.test/META-INF/MANIFEST.MF index d13894414f..fc9ccf86f1 100644 --- a/tests/org.teiid.designer.extension.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.extension.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.extension.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.extension Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.extension.test/pom.xml b/tests/org.teiid.designer.extension.test/pom.xml index ef76de22ec..87ed45844b 100644 --- a/tests/org.teiid.designer.extension.test/pom.xml +++ b/tests/org.teiid.designer.extension.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.extension.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.jdbc.relational.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.jdbc.relational.test/META-INF/MANIFEST.MF index acc653a0da..165ccb9e92 100644 --- a/tests/org.teiid.designer.jdbc.relational.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.jdbc.relational.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.jdbc.relational.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.jdbc.relational Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.jdbc.relational.test/pom.xml b/tests/org.teiid.designer.jdbc.relational.test/pom.xml index 2db02a055a..060f8b7d6c 100644 --- a/tests/org.teiid.designer.jdbc.relational.test/pom.xml +++ b/tests/org.teiid.designer.jdbc.relational.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.jdbc.relational.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.jdbc.test.framework/META-INF/MANIFEST.MF b/tests/org.teiid.designer.jdbc.test.framework/META-INF/MANIFEST.MF index 8f22fb7860..0721cda02d 100644 --- a/tests/org.teiid.designer.jdbc.test.framework/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.jdbc.test.framework/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.teiid.designer.jdbc.test.framework;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Export-Package: org.teiid.designer.jdbc, diff --git a/tests/org.teiid.designer.jdbc.test.framework/pom.xml b/tests/org.teiid.designer.jdbc.test.framework/pom.xml index fb53e8d9a6..c313ed3219 100644 --- a/tests/org.teiid.designer.jdbc.test.framework/pom.xml +++ b/tests/org.teiid.designer.jdbc.test.framework/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.jdbc.test.framework - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.jdbc.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.jdbc.test/META-INF/MANIFEST.MF index 30a042aa3e..13b230258a 100644 --- a/tests/org.teiid.designer.jdbc.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.jdbc.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.jdbc.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.jdbc Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.jdbc.test/pom.xml b/tests/org.teiid.designer.jdbc.test/pom.xml index ed54450529..cea5316acb 100644 --- a/tests/org.teiid.designer.jdbc.test/pom.xml +++ b/tests/org.teiid.designer.jdbc.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.jdbc.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.mapping.ui.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.mapping.ui.test/META-INF/MANIFEST.MF index 7f69df43c0..5933b84f5f 100644 --- a/tests/org.teiid.designer.mapping.ui.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.mapping.ui.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.mapping.ui.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.mapping.ui Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.mapping.ui.test/pom.xml b/tests/org.teiid.designer.mapping.ui.test/pom.xml index 48380eb295..0d954cfd5f 100644 --- a/tests/org.teiid.designer.mapping.ui.test/pom.xml +++ b/tests/org.teiid.designer.mapping.ui.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.mapping.ui.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.metamodels.core.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.metamodels.core.test/META-INF/MANIFEST.MF index fc21d98b62..98dfd927b4 100644 --- a/tests/org.teiid.designer.metamodels.core.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.metamodels.core.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.metamodels.core.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.metamodels.core Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.metamodels.core.test/pom.xml b/tests/org.teiid.designer.metamodels.core.test/pom.xml index 1033cde43e..08d376acf9 100644 --- a/tests/org.teiid.designer.metamodels.core.test/pom.xml +++ b/tests/org.teiid.designer.metamodels.core.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.metamodels.core.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.metamodels.relational.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.metamodels.relational.test/META-INF/MANIFEST.MF index 5127a1c78e..08aeb8b15b 100644 --- a/tests/org.teiid.designer.metamodels.relational.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.metamodels.relational.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.metamodels.relational.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.metamodels.relational Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.metamodels.relational.test/pom.xml b/tests/org.teiid.designer.metamodels.relational.test/pom.xml index 11f8cc28aa..ff32f1b2e0 100644 --- a/tests/org.teiid.designer.metamodels.relational.test/pom.xml +++ b/tests/org.teiid.designer.metamodels.relational.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.metamodels.relational.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.metamodels.transformation.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.metamodels.transformation.test/META-INF/MANIFEST.MF index 5e499f391e..331b4c412e 100644 --- a/tests/org.teiid.designer.metamodels.transformation.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.metamodels.transformation.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.metamodels.transformation.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.metamodels.transformation Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.metamodels.transformation.test/pom.xml b/tests/org.teiid.designer.metamodels.transformation.test/pom.xml index 764210c168..7c3311cc88 100644 --- a/tests/org.teiid.designer.metamodels.transformation.test/pom.xml +++ b/tests/org.teiid.designer.metamodels.transformation.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.metamodels.transformation.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.metamodels.wsdl.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.metamodels.wsdl.test/META-INF/MANIFEST.MF index 04a6cb53c2..1695d90c9c 100644 --- a/tests/org.teiid.designer.metamodels.wsdl.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.metamodels.wsdl.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.metamodels.wsdl.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.metamodels.wsdl Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.metamodels.wsdl.test/pom.xml b/tests/org.teiid.designer.metamodels.wsdl.test/pom.xml index ad853a0a66..87bbf38847 100644 --- a/tests/org.teiid.designer.metamodels.wsdl.test/pom.xml +++ b/tests/org.teiid.designer.metamodels.wsdl.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.metamodels.wsdl.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.metamodels.xml.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.metamodels.xml.test/META-INF/MANIFEST.MF index 9204608cea..aa12a3f8d9 100644 --- a/tests/org.teiid.designer.metamodels.xml.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.metamodels.xml.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.metamodels.xml.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.metamodels.xml Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.metamodels.xml.test/pom.xml b/tests/org.teiid.designer.metamodels.xml.test/pom.xml index 67ae650bc6..5ed211d12b 100644 --- a/tests/org.teiid.designer.metamodels.xml.test/pom.xml +++ b/tests/org.teiid.designer.metamodels.xml.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.metamodels.xml.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.modelgenerator.salesforce.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.modelgenerator.salesforce.test/META-INF/MANIFEST.MF index 1b742b4028..49019d29c9 100644 --- a/tests/org.teiid.designer.modelgenerator.salesforce.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.modelgenerator.salesforce.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.modelgenerator.salesforce.test -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.modelgenerator.salesforce Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.modelgenerator.salesforce.test/pom.xml b/tests/org.teiid.designer.modelgenerator.salesforce.test/pom.xml index 1128dbc660..0d1acf12b8 100644 --- a/tests/org.teiid.designer.modelgenerator.salesforce.test/pom.xml +++ b/tests/org.teiid.designer.modelgenerator.salesforce.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.modelgenerator.salesforce.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.modelgenerator.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.modelgenerator.test/META-INF/MANIFEST.MF index 12fe3806e6..aba576133a 100644 --- a/tests/org.teiid.designer.modelgenerator.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.modelgenerator.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.modelgenerator.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.modelgenerator Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.modelgenerator.test/pom.xml b/tests/org.teiid.designer.modelgenerator.test/pom.xml index 448cb25ce5..3e55cde08c 100644 --- a/tests/org.teiid.designer.modelgenerator.test/pom.xml +++ b/tests/org.teiid.designer.modelgenerator.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.modelgenerator.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.modelgenerator.wsdl.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.modelgenerator.wsdl.test/META-INF/MANIFEST.MF index 20e8ff2e48..ecba0dad70 100644 --- a/tests/org.teiid.designer.modelgenerator.wsdl.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.modelgenerator.wsdl.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.modelgenerator.wsdl.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.modelgenerator.wsdl Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.modelgenerator.wsdl.test/pom.xml b/tests/org.teiid.designer.modelgenerator.wsdl.test/pom.xml index 21c4ab9a1a..013df7478c 100644 --- a/tests/org.teiid.designer.modelgenerator.wsdl.test/pom.xml +++ b/tests/org.teiid.designer.modelgenerator.wsdl.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.modelgenerator.wsdl.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.query.ui.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.query.ui.test/META-INF/MANIFEST.MF index 81a616dc9a..f5a431a706 100644 --- a/tests/org.teiid.designer.query.ui.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.query.ui.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.query.ui.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.query.ui Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.query.ui.test/pom.xml b/tests/org.teiid.designer.query.ui.test/pom.xml index d496a88c18..6c7421ce1a 100644 --- a/tests/org.teiid.designer.query.ui.test/pom.xml +++ b/tests/org.teiid.designer.query.ui.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.query.ui.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.schema.tools.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.schema.tools.test/META-INF/MANIFEST.MF index cc0c3054bb..aaf3e852aa 100644 --- a/tests/org.teiid.designer.schema.tools.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.schema.tools.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.schema.tools.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.schema.tools Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.schema.tools.test/pom.xml b/tests/org.teiid.designer.schema.tools.test/pom.xml index 463550d23a..a196f7b9e0 100644 --- a/tests/org.teiid.designer.schema.tools.test/pom.xml +++ b/tests/org.teiid.designer.schema.tools.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.schema.tools.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.sdt.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.sdt.test/META-INF/MANIFEST.MF index 975cd4b255..a8231802da 100644 --- a/tests/org.teiid.designer.sdt.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.sdt.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.sdt.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.sdt Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.sdt.test/pom.xml b/tests/org.teiid.designer.sdt.test/pom.xml index c824012e3d..09f8f2e87d 100644 --- a/tests/org.teiid.designer.sdt.test/pom.xml +++ b/tests/org.teiid.designer.sdt.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.sdt.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.spi.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.spi.test/META-INF/MANIFEST.MF index 4517dc2cdf..04b1d224a7 100644 --- a/tests/org.teiid.designer.spi.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.spi.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.spi.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.spi;bundle-version="[9.0.0,10.0.0)" Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.spi.test/pom.xml b/tests/org.teiid.designer.spi.test/pom.xml index fb16b8b2dd..2cc80e1346 100644 --- a/tests/org.teiid.designer.spi.test/pom.xml +++ b/tests/org.teiid.designer.spi.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.spi.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.transformation.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.transformation.test/META-INF/MANIFEST.MF index bed56b3503..0c54ddf57c 100644 --- a/tests/org.teiid.designer.transformation.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.transformation.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.transformation.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.transformation Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.transformation.test/pom.xml b/tests/org.teiid.designer.transformation.test/pom.xml index 5adf9afaa4..e3a122b5af 100644 --- a/tests/org.teiid.designer.transformation.test/pom.xml +++ b/tests/org.teiid.designer.transformation.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.transformation.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.ui.common.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.ui.common.test/META-INF/MANIFEST.MF index a01502c0d5..08bebfc274 100644 --- a/tests/org.teiid.designer.ui.common.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.ui.common.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.ui.common.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.ui.common Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.ui.common.test/pom.xml b/tests/org.teiid.designer.ui.common.test/pom.xml index 5b81458671..3bbdfc5e93 100644 --- a/tests/org.teiid.designer.ui.common.test/pom.xml +++ b/tests/org.teiid.designer.ui.common.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.ui.common.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.ui.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.ui.test/META-INF/MANIFEST.MF index 34c450a162..ff0c4eeb86 100644 --- a/tests/org.teiid.designer.ui.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.ui.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.ui.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.ui Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.ui.test/pom.xml b/tests/org.teiid.designer.ui.test/pom.xml index 86a53b4546..55fc013961 100644 --- a/tests/org.teiid.designer.ui.test/pom.xml +++ b/tests/org.teiid.designer.ui.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.ui.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.vdb.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.vdb.test/META-INF/MANIFEST.MF index 6ed8aec2f5..96eb0243a8 100644 --- a/tests/org.teiid.designer.vdb.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.vdb.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.teiid.designer.vdb.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-Vendor: %Bundle-Vendor Fragment-Host: org.teiid.designer.vdb diff --git a/tests/org.teiid.designer.vdb.test/pom.xml b/tests/org.teiid.designer.vdb.test/pom.xml index a196609a67..3192c565a9 100644 --- a/tests/org.teiid.designer.vdb.test/pom.xml +++ b/tests/org.teiid.designer.vdb.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.vdb.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.vdb.test/src/org/teiid/designer/vdb/VdbTest.java b/tests/org.teiid.designer.vdb.test/src/org/teiid/designer/vdb/VdbTest.java index db8e5c3d05..3ccb981f1b 100644 --- a/tests/org.teiid.designer.vdb.test/src/org/teiid/designer/vdb/VdbTest.java +++ b/tests/org.teiid.designer.vdb.test/src/org/teiid/designer/vdb/VdbTest.java @@ -28,6 +28,7 @@ import java.io.InputStream; import java.util.Collection; import java.util.Enumeration; +import java.util.Set; import java.util.zip.Checksum; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -55,6 +56,7 @@ import org.teiid.designer.roles.DataRole; import org.teiid.designer.runtime.version.spi.TeiidServerVersion.Version; import org.teiid.designer.vdb.VdbEntry.Synchronization; +import org.teiid.designer.vdb.VdbFileEntry.FileEntryType; import org.teiid.designer.vdb.file.ValidationVersionCallback; import org.teiid.designer.vdb.file.VdbFileProcessor; import org.teiid.designer.vdb.manifest.EntryElement; @@ -424,6 +426,7 @@ public void testSaveOfUdfVdb() throws Exception { Vdb udfVdb = new XmiVdb(udfVdbBuilder.getResourceFile()); udfVdb.save(); + udfVdb.close(); boolean udfJarPresent = false; boolean empSourceModelPresent = false; @@ -485,6 +488,22 @@ public void testSaveOfUdfVdb() throws Exception { assertTrue(empSourceModelPresent); assertEquals(2, indexFilesPresent); assertTrue(empViewModelPresent); + + // + // Create a new vdb based on the newly-saved version to check everything is intact + // + udfVdbBuilder = new MockFileBuilder(udfVdbCopy); + udfVdbBuilder.addToModelWorkspace(modelWorkspaceMock); + when(udfVdbBuilder.getResourceFile().findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE)).thenReturn(new IMarker[0]); + when(udfVdbBuilder.getResourceFile().createMarker(IMarker.PROBLEM)).thenReturn(mock(IMarker.class)); + + udfVdb = new XmiVdb(udfVdbBuilder.getResourceFile()); + Set udfJarEntries = udfVdb.getUdfJarEntries(); + assertEquals(1, udfJarEntries.size()); + VdbFileEntry udfEntry = udfJarEntries.iterator().next(); + assertEquals("name_builder", udfEntry.getName()); + assertEquals(File.separator + "lib" + File.separator + "name_builder.jar", udfEntry.getPath().toOSString()); + assertEquals(FileEntryType.UDFJar, udfEntry.getFileType()); } @Test diff --git a/tests/org.teiid.designer.webservice.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.webservice.test/META-INF/MANIFEST.MF index df4014f869..71e6e4dbe4 100644 --- a/tests/org.teiid.designer.webservice.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.webservice.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.webservice.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.webservice Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.webservice.test/pom.xml b/tests/org.teiid.designer.webservice.test/pom.xml index ccbed4f0e5..fec3573fab 100644 --- a/tests/org.teiid.designer.webservice.test/pom.xml +++ b/tests/org.teiid.designer.webservice.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.webservice.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.webservice.ui.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.webservice.ui.test/META-INF/MANIFEST.MF index b9828e3e20..1c245f7493 100644 --- a/tests/org.teiid.designer.webservice.ui.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.webservice.ui.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.webservice.ui.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.webservice.ui Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/tests/org.teiid.designer.webservice.ui.test/pom.xml b/tests/org.teiid.designer.webservice.ui.test/pom.xml index d5b376b55b..98cf5bb6ab 100644 --- a/tests/org.teiid.designer.webservice.ui.test/pom.xml +++ b/tests/org.teiid.designer.webservice.ui.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.webservice.ui.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.xml.ui.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.xml.ui.test/META-INF/MANIFEST.MF index 9b3f056824..d14de7d724 100644 --- a/tests/org.teiid.designer.xml.ui.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.xml.ui.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.xml.ui.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.xml.ui Export-Package: org.teiid.designer.xml.ui.wizards diff --git a/tests/org.teiid.designer.xml.ui.test/pom.xml b/tests/org.teiid.designer.xml.ui.test/pom.xml index 8d61abce7a..405fed9736 100644 --- a/tests/org.teiid.designer.xml.ui.test/pom.xml +++ b/tests/org.teiid.designer.xml.ui.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.xml.ui.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.designer.xsd.ui.test/META-INF/MANIFEST.MF b/tests/org.teiid.designer.xsd.ui.test/META-INF/MANIFEST.MF index eca8610446..80ac32c3c2 100644 --- a/tests/org.teiid.designer.xsd.ui.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.designer.xsd.ui.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.designer.xsd.ui.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.designer.xsd.ui Export-Package: org.teiid.designer.xsd.ui.wizards diff --git a/tests/org.teiid.designer.xsd.ui.test/pom.xml b/tests/org.teiid.designer.xsd.ui.test/pom.xml index 62cc1a8ab5..98374e3cd2 100644 --- a/tests/org.teiid.designer.xsd.ui.test/pom.xml +++ b/tests/org.teiid.designer.xsd.ui.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.designer.xsd.ui.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin diff --git a/tests/org.teiid.runtime.client.test/META-INF/MANIFEST.MF b/tests/org.teiid.runtime.client.test/META-INF/MANIFEST.MF index 20ca50e606..f3787fee7a 100644 --- a/tests/org.teiid.runtime.client.test/META-INF/MANIFEST.MF +++ b/tests/org.teiid.runtime.client.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.teiid.runtime.client.test;singleton:=true -Bundle-Version: 9.2.0.qualifier +Bundle-Version: 9.2.1.qualifier Bundle-Vendor: %Bundle-Vendor.0 Fragment-Host: org.teiid.runtime.client;bundle-version="[9.2.0,10.0.0)" Bundle-Localization: plugin diff --git a/tests/org.teiid.runtime.client.test/pom.xml b/tests/org.teiid.runtime.client.test/pom.xml index 5612be97c1..ea316f311b 100644 --- a/tests/org.teiid.runtime.client.test/pom.xml +++ b/tests/org.teiid.runtime.client.test/pom.xml @@ -8,7 +8,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs org.jboss.tools org.teiid.runtime.client.test - 9.2.0-SNAPSHOT + 9.2.1-SNAPSHOT eclipse-plugin