JBoss Tools SVN: r23641 - trunk/common/plugins/org.jboss.tools.common.model.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-07-21 17:08:03 -0400 (Wed, 21 Jul 2010)
New Revision: 23641
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/browse/JBIDE-6430 Eclipse has a problem to reference org.jboss.tools.common.model.ui 3.1.1
bundle classpath attribute removed from manifest because it is not needed
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/META-INF/MANIFEST.MF 2010-07-21 20:52:43 UTC (rev 23640)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/META-INF/MANIFEST.MF 2010-07-21 21:08:03 UTC (rev 23641)
@@ -2,7 +2,6 @@
Bundle-ManifestVersion: 2
Bundle-ActivationPolicy: lazy
Bundle-Name: %pluginName
-Bundle-ClassPath: .
Bundle-Activator: org.jboss.tools.common.model.ui.ModelUIPlugin
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.jboss.tools.common.model.ui;singleton:=true
15 years, 9 months
JBoss Tools SVN: r23640 - in trunk/documentation/whatsnew: bpel and 11 other directories.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2010-07-21 16:52:43 -0400 (Wed, 21 Jul 2010)
New Revision: 23640
Added:
trunk/documentation/whatsnew/jst/images/jsf2preview1.png
trunk/documentation/whatsnew/jst/images/jsf2preview2.png
Removed:
trunk/documentation/whatsnew/vpe/images/3.2.0.M1/jsf2preview1.png
trunk/documentation/whatsnew/vpe/images/3.2.0.M1/jsf2preview2.png
Modified:
trunk/documentation/whatsnew/bpel/bpel-news-1.1.0.M1.html
trunk/documentation/whatsnew/cdi/cdi-news-3.2.0.M1.html
trunk/documentation/whatsnew/core/core-news-3.1.0.M1.html
trunk/documentation/whatsnew/drools/guvnor-tools-news-5.1.0.M1.html
trunk/documentation/whatsnew/hibernate/hibernate-news-3.4.0.M1.html
trunk/documentation/whatsnew/index.html
trunk/documentation/whatsnew/jbpm/jbpm-news-3.2.0.M1.html
trunk/documentation/whatsnew/jst/jst-news-3.2.0.M1.html
trunk/documentation/whatsnew/seam/seam-news-3.2.0.M1.html
trunk/documentation/whatsnew/vpe/vpe-news-3.2.0.M1.html
trunk/documentation/whatsnew/ws/ws-news-1.2.0.M1.html
Log:
updated jbt 3.2 M1 news
Modified: trunk/documentation/whatsnew/bpel/bpel-news-1.1.0.M1.html
===================================================================
--- trunk/documentation/whatsnew/bpel/bpel-news-1.1.0.M1.html 2010-07-21 18:21:46 UTC (rev 23639)
+++ trunk/documentation/whatsnew/bpel/bpel-news-1.1.0.M1.html 2010-07-21 20:52:43 UTC (rev 23640)
@@ -11,7 +11,8 @@
<body>
<h1>JBoss Eclipse BPEL Editor 1.1.0.M1 What's New</h1>
-<p align="right"><a href="../index.html">< Main Index</a></p>
+<p align="right"><a href="../index.html">< Main Index</a> <a
+href="../drools/guvnor-tools-news-5.1.0.M1.html">Drools/Guvnor Tools ></a></p>
<table border="0" cellpadding="10" cellspacing="0" width="80%">
<tr>
<td colspan="2">
@@ -24,7 +25,7 @@
<td valign="top" align="right"><a name="itemname3" id="itemname3"></a><b>BPEL
Editor</b></td>
<td valign="top">The following issues were fixed. The list
- includes several XPath validation errors, user interface warts, <a
+ includes several XPath validation errors, user interface glitches, <a
href="http://www.docjar.com/docs/api/java/lang/NullPointerException.html">NPEs</a>
and some cosmetic issues.
<ol>
@@ -51,8 +52,10 @@
<tr>
<td valign="top" align="right"><a name="itemname3" id="itemname3"></a><b>Deployment
Editor</b></td>
- <td valign="top">A serious flaw in the ODE Deployment editor has
- been fixed. See <a href="https://jira.jboss.org/browse/JBIDE-6230">JBIDE-6230</a>.
+ <td valign="top">ODE Deployment editor had problems
+ with defintions after refactoring operations. This
+ is now fixed.
+ See <a href="https://jira.jboss.org/browse/JBIDE-6230">JBIDE-6230</a>.
<p></p>
</td>
</tr>
@@ -65,12 +68,13 @@
</td>
</tr>
<tr>
- <td valign="top" align="right"><a name="itemname3" id="itemname3"></a><b>""New
- File"" Wizard</b></td>
- <td valign="top">The BPEL "New File" Wizard has been enhanced to
+ <td valign="top" align="right"><a name="itemname3"
+ id="itemname3"></a><b>New WSDL
+ File Wizard</b></td> <td valign="top">The BPEL "New File" Wizard has been enhanced to
allow specification of a SOAP or HTTP service endpoint, which generates the
<service> and <binding> elements in the WSDL artifact.
- This saves lot of mouse clicks. See
+ Compared to earlier where all this had to be done
+ manually via the editors this saves alot of time. See
<a href="https://jira.jboss.org/browse/JBIDE-6154">JBIDE-6154</a> for details.
<p></p>
<img src="images/NewFileWizard.png"/>
Modified: trunk/documentation/whatsnew/cdi/cdi-news-3.2.0.M1.html
===================================================================
--- trunk/documentation/whatsnew/cdi/cdi-news-3.2.0.M1.html 2010-07-21 18:21:46 UTC (rev 23639)
+++ trunk/documentation/whatsnew/cdi/cdi-news-3.2.0.M1.html 2010-07-21 20:52:43 UTC (rev 23640)
@@ -18,71 +18,32 @@
<tr>
<td colspan="2">
<hr />
- <h3>New Wizards</h3>
+ <h3>Wizards</h3>
<hr />
</td>
</tr>
<tr>
<td valign="top" align="left">
- <p><b>New Quilifier Type Wizard</b></p>
+ <p><b>CDI Annotation Type Wizards</b></p>
</td>
- <td valign="top">
- <p>Qualifier Type Wizard creates qualifier annotation type.</p>
+ <td align="top">
+ <p>There are now a handful of Wizards to easily create
+ various CDI specific artifacts, such as Qualifier
+ Annotation Type.</p>
<img src="images/CDIAnnotationWizards.png"/><br><br>
+
+ <p>Qualifier Annotation Type Wizard:</p>
<img src="images/NewQualifierWizard.png"/>
<p><small><a
- href="https://jira.jboss.org/jira/browse/JBIDE-6413">Related Jira</a></small></p>
+ href="https://jira.jboss.org/jira/browse/JBIDE-6413">1</a>,
+ <a href="https://jira.jboss.org/jira/browse/JBIDE-6414">2</a>,<a
+ href="https://jira.jboss.org/jira/browse/JBIDE-6415">3</a>,<a
+ href="https://jira.jboss.org/jira/browse/JBIDE-6416">3</a></small></p>
</td>
</tr>
-
<tr>
<td colspan="2">
<hr />
- </td>
- </tr>
- <tr>
- <td valign="top" align="left">
- <p><b>New Stereotype Wizard</b></p>
- </td>
- <td valign="top">
- <p>Stereotype Wizard creates stereotype annotation type.</p>
- <p><small><a
- href="https://jira.jboss.org/jira/browse/JBIDE-6414">Related Jira</a></small></p>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <hr />
- </td>
- </tr>
- <tr>
- <td valign="top" align="left">
- <p><b>New Interceptor Binding Type Wizard</b></p>
- </td>
- <td valign="top">
- <p>Interceptor Binding Type Wizard creates interceptor annotation type.</p>
- <p><small><a
- href="https://jira.jboss.org/jira/browse/JBIDE-6415">Related Jira</a></small></p>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <hr />
- </td>
- </tr>
- <tr>
- <td valign="top" align="left">
- <p><b>New Scope Type Wizard</b></p>
- </td>
- <td valign="top">
- <p>Scope Type Wizard creates scope annotation type.</p>
- <p><small><a
- href="https://jira.jboss.org/jira/browse/JBIDE-6416">Related Jira</a></small></p>
- </td>
- </tr>
-<tr>
- <td colspan="2">
- <hr />
<h3>Hyperlinks (OpenOns)</h3>
<hr />
</td>
@@ -92,7 +53,8 @@
<p><b>OpenOn for Disposer/Producer methods</b></p>
</td>
<td valign="top">
- <p>If user ctrl+click on Disposer (Producer) method, this OpenOn suggests opening the bound producer (disposer) method.</p>
+ <p>Producer and Disposer methods can now be navigate
+ to via OpenOn.</p>
<img src="images/ProducerOpenOn.png"/><br><br>
<img src="images/DisposerOpenOn.png"/>
<p><small><a
@@ -109,10 +71,13 @@
</tr>
<tr>
<td valign="top" align="left">
- <p><b>Unsatisfied and ambiguous dependencies validation for CDI Injection points</b></p>
+ <p><b>Validation for CDI Injection points</b></p>
</td>
<td valign="top">
- <p>CDI projects are validated now against the unsatisfied and ambiquos dependencies.</p>
+ <p>CDI Injection points where there are no or
+ ambigious matching injections will now be validated
+ and marked with Error or Warning based on users preference.
+ </p>
<p><small><a
href="https://jira.jboss.org/jira/browse/JBIDE-6418">Related Jira</a></small></p>
</td>
@@ -130,8 +95,8 @@
<p><b>Rename action for CDI @Named beans</b></p>
</td>
<td valign="top">
- <p>Rename action for CDI @Named beans also shows
- all resources that has references renamed element in EL.</p>
+ <p>CDI @Named beans now be renamed via refactoring
+ and shows up when using Find References for EL Expressions.</p>
<p>Rename action is available from context menu on a @Named annotation in Java Source editor.</p>
<p><small><a
href="https://jira.jboss.org/jira/browse/JBIDE-5927">Related Jira</a></small></p>
Modified: trunk/documentation/whatsnew/core/core-news-3.1.0.M1.html
===================================================================
--- trunk/documentation/whatsnew/core/core-news-3.1.0.M1.html 2010-07-21 18:21:46 UTC (rev 23639)
+++ trunk/documentation/whatsnew/core/core-news-3.1.0.M1.html 2010-07-21 20:52:43 UTC (rev 23640)
@@ -12,7 +12,7 @@
<h1>What's New Core/General</h1>
<p align="right"><a href="../index.html">< Main Index</a> <a
- href="../as/as-news-3.1.0.M1.html">AS Tools ></a></p>
+ href="../hibernate/hibernate-news-3.4.0.M1.html">AS Tools ></a></p>
<table border="0" cellpadding="10" cellspacing="0" width="80%">
<tr>
<td colspan="2">
@@ -35,34 +35,6 @@
</td>
</tr>
-
-
- <tr>
- <td valign="top" align="left"><a name="itemname3" id="itemname3"></a><b>Japanese Translation</b></td>
- <td valign="top">
- <p>Thanks to hard work of Sean Flanigan preparing
- JBoss Tools for i18n and Shinobu Nogami's contribution
- we now got Japanese translation for most of the JBoss
- Tools plugins.</p>
-
- <p><img src="../images/japanesei18n.png"/></p>
-
- <p>You can try it out by running a japanese locale or
- simply pass -nl jp as an argument to your eclipse. For
- best results download the Eclipse platform
- translations from
- the <a href="http://www.eclipse.org/babel/downloads.php">Babel</a>
- project.</p>
-
- <p>If you want to help improve and complete the
- japanese translation or any other language for that
- matter then contact us on forums or jira.</p>
-
- <p><small><a href="https://jira.jboss.org/jira/browse/JBIDE-3970">Related Jira</a></small></p>
-
- </td>
- </tr>
-
</table>
</body>
Modified: trunk/documentation/whatsnew/drools/guvnor-tools-news-5.1.0.M1.html
===================================================================
--- trunk/documentation/whatsnew/drools/guvnor-tools-news-5.1.0.M1.html 2010-07-21 18:21:46 UTC (rev 23639)
+++ trunk/documentation/whatsnew/drools/guvnor-tools-news-5.1.0.M1.html 2010-07-21 20:52:43 UTC (rev 23640)
@@ -11,7 +11,8 @@
<body>
<h1>Drools Guvnor 5.1.0.M1 What's New</h1>
-<p align="right"><a href="../index.html">< Main Index</a> <a href="../vpe/vpe-news-3.2.0.M1.html">Visual Page Editor ></a></p>
+<p align="right"><a href="../index.html">< Main Index</a> <a
+href="../jbpm/jbpm-news-3.2.0.M1.html">jBPM Tools ></a></p>
<table border="0" cellpadding="10" cellspacing="0" width="80%">
Modified: trunk/documentation/whatsnew/hibernate/hibernate-news-3.4.0.M1.html
===================================================================
--- trunk/documentation/whatsnew/hibernate/hibernate-news-3.4.0.M1.html 2010-07-21 18:21:46 UTC (rev 23639)
+++ trunk/documentation/whatsnew/hibernate/hibernate-news-3.4.0.M1.html 2010-07-21 20:52:43 UTC (rev 23640)
@@ -11,7 +11,7 @@
<body>
<h1>Hibernate tools 3.4.0.M1 What's New</h1>
-<p align="right"><a href="../index.html">< Main Index</a> <a href="../vpe/vpe-news-3.2.0.M1.html">Visual Page Editor ></a></p>
+<p align="right"><a href="../index.html">< Main Index</a> <a href="../jst/jst-news-3.2.0.M1.html">JST Tools ></a></p>
<table border="0" cellpadding="10" cellspacing="0" width="80%">
@@ -26,13 +26,11 @@
<tr>
<td valign="top" align="right"><a name="itemname3" id="itemname3"></a><b>Support Dali 2.3</b></td>
<td valign="top">
- <p>Hibernate tools 3.4.0 support Dali 2.3 version and don't support previous ones because of the API changes.</p>
+ <p>Hibernate tools 3.4.0 now supports Eclipse JPA/Dali version
+ 2.3. Previous versions cannot be supported because API has changed.</p>
-<p></p>
+ <p><small><a href="https://jira.jboss.org/browse/JBIDE-5847">Related jira</a></p>
-
- <p><small><a href="https://jira.jboss.org/browse/JBIDE-5847">Related jira</a></p>
-
</td>
</tr>
@@ -43,9 +41,9 @@
</tr>
<tr>
- <td valign="top" align="right"><a name="itemname3" id="itemname3"></a><b>Support Jpa 2.0 in jpa projects</b></td>
+ <td valign="top" align="right"><a name="itemname3" id="itemname3"></a><b>Support JPA 2.0 in JPA projects</b></td>
<td valign="top">
- <p>Jpa projects with Hibernate platform support now hibernate jpa 2.0 implementation.</p>
+ <p>JPA projects with Hibernate platform now support Hibernate JPA 2.0 implementation.</p>
<p><img src="images/jpa2_0.png"/></p>
<p></p>
@@ -83,7 +81,9 @@
<tr>
<td valign="top" align="right"><a name="itemname3" id="itemname3"></a><b>DDL script</b></td>
<td valign="top">
- <p>DDL script isn't executed after generation by default because it could clear the database data.</p>
+ <p>Schema Export when started from within Eclipse now generates DDL script by default instead of
+ directly manipulating the database to avoid manipulating existing
+ data by accident.</p>
<p><img src="images/ddl_generation.png"/></p>
<p>Related jiras:<small><a href="https://jira.jboss.org/browse/JBIDE-6115">1</a>, <a href="http://opensource.atlassian.com/projects/hibernate/browse/HBX-1161">2</a></p>
</td>
Modified: trunk/documentation/whatsnew/index.html
===================================================================
--- trunk/documentation/whatsnew/index.html 2010-07-21 18:21:46 UTC (rev 23639)
+++ trunk/documentation/whatsnew/index.html 2010-07-21 20:52:43 UTC (rev 23640)
@@ -23,12 +23,18 @@
<tr>
<td valign="top" align="left">
<p align="right"><b>3.2.0.M1</b>
- <td valign="top">
+ <td valign="top">
+ <p><a href="core/core-news-3.1.0.M1.html">Core/General</a></p>
<p><a href="hibernate/hibernate-news-3.4.0.M1.html">Hibernate Tools</a></p>
+ <p><a href="jst/jst-news-3.2.0.M1.html">JST/JSF Tools</a></p>
<p><a href="vpe/vpe-news-3.2.0.M1.html">Visual Page Editor</a></p>
<p><a href="cdi/cdi-news-3.2.0.M1.html">CDI (JSR-299) Tools</a></p>
<p><a href="seam/seam-news-3.2.0.M1.html">Seam Tools</a></p>
- <p><a href="jst/jst-news-3.2.0.M1.html">JST/JSF Tools</a></p>
+ <p><a href="bpel/bpel-news-1.1.0.M1.html">BPEL Tools</a></p>
+ <p><a href="drools/guvnor-tools-news-5.1.0.M1.html">Drools/Guvnor Tools</a></p>
+ <p><a href="jbpm/jbpm-news-3.2.0.M1.html">jBPM Tools</a></p>
+ <p><a href="ws/ws-news-1.2.0.M1.html">JBoss Webservice Tools</a></p>
+
</td>
</tr>
@@ -377,4 +383,4 @@
</body>
-</html>
\ No newline at end of file
+</html>
Modified: trunk/documentation/whatsnew/jbpm/jbpm-news-3.2.0.M1.html
===================================================================
--- trunk/documentation/whatsnew/jbpm/jbpm-news-3.2.0.M1.html 2010-07-21 18:21:46 UTC (rev 23639)
+++ trunk/documentation/whatsnew/jbpm/jbpm-news-3.2.0.M1.html 2010-07-21 20:52:43 UTC (rev 23640)
@@ -11,7 +11,8 @@
<body>
<h1>jBPM Tools 3.2.0.M1 What's New</h1>
- <p align="right"><a href="../index.html">< Main Index</a>
+ <p align="right"><a href="../index.html">< Main Index</a> <a
+ href="../ws/ws-news-1.2.0.M1.html">JBoss Webservice Tools ></a>
<table border="0" cellpadding="10" cellspacing="0" width="80%">
Copied: trunk/documentation/whatsnew/jst/images/jsf2preview1.png (from rev 23633, trunk/documentation/whatsnew/vpe/images/3.2.0.M1/jsf2preview1.png)
===================================================================
(Binary files differ)
Copied: trunk/documentation/whatsnew/jst/images/jsf2preview2.png (from rev 23633, trunk/documentation/whatsnew/vpe/images/3.2.0.M1/jsf2preview2.png)
===================================================================
(Binary files differ)
Modified: trunk/documentation/whatsnew/jst/jst-news-3.2.0.M1.html
===================================================================
--- trunk/documentation/whatsnew/jst/jst-news-3.2.0.M1.html 2010-07-21 18:21:46 UTC (rev 23639)
+++ trunk/documentation/whatsnew/jst/jst-news-3.2.0.M1.html 2010-07-21 20:52:43 UTC (rev 23640)
@@ -11,7 +11,8 @@
<body>
<h1>JST/JSF 3.2.0.M1 What's New</h1>
-<p align="right"><a href="../index.html">< Main Index</a></p>
+<p align="right"><a href="../index.html">< Main
+ Index</a> <a href="../vpe/vpe-news-3.2.0.M1.html">VPE Tools ></a></p>
<table border="0" cellpadding="10" cellspacing="0" width="80%">
<tr>
@@ -99,6 +100,14 @@
<td valign="top">
<p>If user changes name of component file, refactoring changes names this component in project.</p>
+ <p><img src="images/jsf2preview1.png"
+ alt="Refactor JSF 2" /></p>
+ <p>
+ <p><img src="images/jsf2preview2.png"
+ alt="Refactor JSF 2 Preview" /></p>
+ <p>
+
+
<p><small><a
href="https://jira.jboss.org/jira/browse/JBIDE-5942">Related Jira</a></small></p>
</td>
@@ -145,48 +154,11 @@
</td>
</tr>
<tr>
- <td valign="top" align="left">
- <p><b>Quick fix for custom element attribute</b></p>
- </td>
- <td valign="top">
- <p>If custom element attribute does not exist, quick fix offers to create it.</p>
-
- <p><small><a
- href="https://jira.jboss.org/jira/browse/JBIDE-5937">Related Jira</a></small></p>
- </td>
- </tr>
- <tr>
<td colspan="2">
<hr />
</td>
</tr>
- <tr>
- <td valign="top" align="left">
- <p><b>Quick fix to create new folder in JSF project</b></p>
- </td>
- <td valign="top">
- <p>When user types on page xmlns:mareshkau="http://java.sun.com/jsf/composite/mareshkau", Quick fix offers to create folder 'mareshkau' in JSF resouces folder.</p>
-
- <p><small><a
- href="https://jira.jboss.org/jira/browse/JBIDE-5922">Related Jira</a></small></p>
- </td>
</tr>
- <tr>
- <td colspan="2">
- <hr />
- </td>
- </tr>
- <tr>
- <td valign="top" align="left">
- <p><b>Quck fix for creating JSF custom page with element name when it does not exist</b></p>
- </td>
- <td valign="top">
- <p>If user types on page 'xmlns:mar="http://java.sun.com/jsf/composite/mar', then types 'mar:table', and table.xthml does not exist in 'resources/mar' folder quick fix offers to create 'mar/table.xhtml' with JSF element structure.</p>
-
- <p><small><a
- href="https://jira.jboss.org/jira/browse/JBIDE-5930">Related Jira</a></small></p>
- </td>
- </tr>
</tr>
<td colspan="2">
<hr />
@@ -215,10 +187,11 @@
</tr>
<tr>
<td valign="top" align="left">
- <p><b>Way to specify pages templates</b></p>
+ <p><b>XHTML Templates</b></p>
</td>
<td valign="top">
- <p>Now user can use standart way to specify pages templates.</p>
+ <p>Preferences for XHTML templates now uses the standard Eclipse UI
+ for specifying templates.</p>
<img src="images/PageTemplates.png"/>
<p><small><a
href="https://jira.jboss.org/jira/browse/JBIDE-6131">Related Jira</a></small></p>
Modified: trunk/documentation/whatsnew/seam/seam-news-3.2.0.M1.html
===================================================================
--- trunk/documentation/whatsnew/seam/seam-news-3.2.0.M1.html 2010-07-21 18:21:46 UTC (rev 23639)
+++ trunk/documentation/whatsnew/seam/seam-news-3.2.0.M1.html 2010-07-21 20:52:43 UTC (rev 23640)
@@ -12,22 +12,23 @@
<h1>Seam tools 3.2.0.M1 What's New</h1>
<p align="right"><a href="../index.html">< Main Index</a> <a
- href="../jst/jst-news-3.2.0.M1.html">JST/JSF Tools News ></a></p>
+ href="../bpel/bpel-news-1.1.0.M1.html">BPEL Tools ></a></p>
<table border="0" cellpadding="10" cellspacing="0" width="80%">
<tr>
<td colspan="2">
<hr />
- <h3>Updated Wizards</h3>
+ <h3>Wizards</h3>
<hr />
</td>
</tr>
<tr>
<td valign="top" align="left">
- <p><b>In "Generate Seam Entities" wizard added fields to allow use an existing *.reveng.xml file</b></p>
+ <p><b>Use existing *.reveng.xml file</b></p>
</td>
<td valign="top">
- <p>Now "Generate Seam Entities" provides opportunity to specify an existing *.reveng.xml file for using it to regenerate entities.</p>
+ <p"Generate Seam Entities" now has field to specify an
+ existing *.reveng.xml file when (re-)generating entities.</p>
<img src="images/SeamGenEntitiesWizard.PNG"/>
<p><small><a
href="https://jira.jboss.org/jira/browse/JBIDE-5007">Related Jira</a></small></p>
@@ -41,10 +42,10 @@
</tr>
<tr>
<td valign="top" align="left">
- <p><b>In "New Seam Project" wizard added fields to specify the project(s) name</b></p>
+ <p><b>EJB & EAR Project names</b></p>
</td>
<td valign="top">
- <p>Now "New Seam Project" wizard provides opportunity to specify names for WAR, EJB and EAR projects.</p>
+ <p>Now "New Seam Project" wizard allows to control the names for WAR, EJB and EAR projects.</p>
<img src="images/ear_project.jpg"/>
<p><small><a
href="https://jira.jboss.org/jira/browse/JBIDE-2809">Related Jira</a></small></p>
Deleted: trunk/documentation/whatsnew/vpe/images/3.2.0.M1/jsf2preview1.png
===================================================================
(Binary files differ)
Deleted: trunk/documentation/whatsnew/vpe/images/3.2.0.M1/jsf2preview2.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/whatsnew/vpe/vpe-news-3.2.0.M1.html
===================================================================
--- trunk/documentation/whatsnew/vpe/vpe-news-3.2.0.M1.html 2010-07-21 18:21:46 UTC (rev 23639)
+++ trunk/documentation/whatsnew/vpe/vpe-news-3.2.0.M1.html 2010-07-21 20:52:43 UTC (rev 23640)
@@ -22,8 +22,10 @@
</td>
</tr>
<tr>
- <td valign="top" align="left"><b>Quick Fixes for JSF 2</b></td>
+ <td valign="top" align="left"><b>Quick Fixes for JSF Composite components</b></td>
<td valign="top">
+ <p>There is now quick fixes to easily create
+ and edit composite components while editing JSF 2 documents.</p>
<ul>
<li>Quick fix to create JSF 2 composite folder:
<p><img src="images/3.2.0.M1/jsf2-create-folder.png"
@@ -39,7 +41,7 @@
href="https://jira.jboss.org/jira/browse/JBIDE-5930">Related
Jira</a></small></p>
</li>
- <li>Quick fix to create attributes in JSF 2 composite component:
+ <li>Quick fix to create attributes in JSF 2 compsite component:
<p><img src="images/3.2.0.M1/jsf2-create-attribute.png"
alt="Create attribute in JSF 2 Composite Component" /></p>
<p><small><a
@@ -54,43 +56,13 @@
<hr />
</td>
</tr>
- <tr>
- <td valign="top" align="left"><b>XHTML Templates</b></td>
- <td valign="top">Now templates for new XHTML pages may be edited
- in the conventional way.
- <p><img src="images/3.2.0.M1/xhtml-templates.png"
- alt="XHTML Templates Editor" /></p>
- <p><small><a
- href="https://jira.jboss.org/jira/browse/JBIDE-6131">Related Jira</a></small></p>
- </td>
- </tr>
<tr>
- <td valign="top" align="left"><b>Refactoring for JSF 2
- components</b></td>
- <td valign="top">
- <p>Refactoring for JSF 2 components is available now. <br></br>
- For instance you can rename the component or its attributes. <br></br>
- All the related changes will be shown on the Preview page.</p>
- <p><img src="images/3.2.0.M1/jsf2preview1.png"
- alt="Refactor JSF 2" /></p>
- <p>
- <p><img src="images/3.2.0.M1/jsf2preview2.png"
- alt="Refactor JSF 2 Preview" /></p>
- <p><small> <a
- href="https://jira.jboss.org/jira/browse/JBIDE-5942">Related Jira</a>
- </small></p>
- </td>
- </tr>
-
- <tr>
<td valign="top" align="left"><b>CSS Selector dialog updates</b></td>
<td valign="top">
- <p>Several classes could be selected and moved to another column
- at once.</p>
- <p>Classes could be moved from one column to another by dragging,
- pushing the button or by "Alt + Left Arrow" and "Alt + Right Arrow"
- key combinations.</p>
+ <p>The CSS Dialog now allow multiple classes to be
+ selected and moved between the two columns via either
+ the arrow buttons, keyboard or drag'n'drop.</p>
<p>In addition you can change the order of selected classes by
moving them up and down.</p>
<p><img src="images/3.2.0.M1/cssSelector.png" alt="Css Selector" /></p>
@@ -104,13 +76,12 @@
<td valign="top" align="left"><b>Import/Export for VPE visual
templates</b></td>
<td valign="top">
- <p>Now VPE visual templates could be exported to/imported from the
- external file.</p>
+ <p>VPE visual templates for custom tags can now be
+ exported and from a file</p>
<p><img src="images/3.2.0.M1/storedTags1.png"
alt="Stored Tags List" /></p>
<p>
- <p>It is a very convenient way to share setting among team
- members.</p>
+ <p>This allows you to share templates between team members.</p>
<p><img src="images/3.2.0.M1/storedTags2.png" alt="Select wizard" /></p>
<p>
<p><img src="images/3.2.0.M1/storedTags3.png" alt="Export" /></p>
@@ -128,10 +99,9 @@
</tr>
<tr>
<td valign="top" align="left"><b>Enhanced Drag&Drop Support</b></td>
- <td valign="top">Drag&Drop actions became more predicable and
- visual. Now the elements being dragged as well as available drop
- targets for them are rendered by Visual Editor.
-
+ <td valign="top">Drag & Drop in the Visual page editor
+ is now more reliable and easier. The drop indicator will now be shown in
+ all drop locations available.
<p><img src="images/3.2.0.M1/vpe-drag-and-drop.png"
alt="VPE Drag&Drop" /></p>
<p><small><a
@@ -146,9 +116,10 @@
<tr>
<td valign="top" align="left"><b>Externalize Strings Dialog</b></td>
<td valign="top">
- <p>Text strings could be externalized via Externalize Strings
- Dialog which will put additional resource bundle value and replace the
- text on the page by EL expression.</p>
+ <p>There is now and Externalize String Dialog for
+ JSF/XHTML pages. Text strings will now be externalized
+ to a resource bundle and the expression will be
+ rendered via an EL expression. Allowing for easier i18n.</p>
<p><img src="images/3.2.0.M1/externalize11.png"
alt="Externalize Strings Dialog" /></p>
<p>
@@ -170,7 +141,8 @@
</tr>
<tr>
<td valign="top" align="left"><b>New templates for JBPM</b></td>
- <td valign="top">Visual Page Editor now supports some JBPM tags
+ <td valign="top">Visual Page Editor now supports jBPM
+ 3 tags
such as <code> jbpm:dataform, jbpm:datacell, tf:cancelButton,
tf:saveButton; tf:transitionButton </code>
<p><img src="images/3.2.0.M1/jbpmTemplates.png"
Modified: trunk/documentation/whatsnew/ws/ws-news-1.2.0.M1.html
===================================================================
--- trunk/documentation/whatsnew/ws/ws-news-1.2.0.M1.html 2010-07-21 18:21:46 UTC (rev 23639)
+++ trunk/documentation/whatsnew/ws/ws-news-1.2.0.M1.html 2010-07-21 20:52:43 UTC (rev 23640)
@@ -24,7 +24,7 @@
</tr>
<tr>
- <td valign="top" align="right"><a name="itemname3" id="itemname3"></a><b>New Web Service Tester Available</b></td>
+ <td valign="top" align="right"><a name="itemname3" id="itemname3"></a><b>Web Service Tester</b></td>
<td valign="top">
<p>A new Web Service Tester is available as a view in JBoss Tools. The tester, though still maturing a bit, provides the following functionality: </p>
<ul><li>Tests JAX-WS and JAX-RS services</li>
@@ -48,7 +48,8 @@
</tr>
<tr>
- <td valign="top" align="right"><a name="itemname3" id="itemname3"></a><b>Fixes when Generating WS Projects from WSDL or Java Class Sources</b></td>
+ <td valign="top" align="right"><a name="itemname3"
+ id="itemname3"></a><b>Web Services Wizard</b></td>
<td valign="top">
<p>We've also addressed a few issues in the Web Service wizard:</p>
<ol><li>Adding '--show-traces' to executables used to produce web service artifacts for additional help when debugging (<a href="https://jira.jboss.org/browse/JBIDE-6499">JBIDE-6499</a>)</li>
15 years, 9 months
JBoss Tools SVN: r23639 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/el.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-07-21 14:21:46 -0400 (Wed, 21 Jul 2010)
New Revision: 23639
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/el/ELExprPartitionerTest.java
Log:
NullPointerException in org.jboss.tools.seam.ui.test.el.ELExprPartitionerTest.testELExprPartitioner test fixed
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/el/ELExprPartitionerTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/el/ELExprPartitionerTest.java 2010-07-21 17:46:14 UTC (rev 23638)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/el/ELExprPartitionerTest.java 2010-07-21 18:21:46 UTC (rev 23639)
@@ -50,7 +50,7 @@
}
public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.jsf.text.ext.test", "projects/" + PROJECT_NAME, PROJECT_NAME, makeCopy);
+ provider = new TestProjectProvider("org.jboss.tools.seam.ui.test", "projects/" + PROJECT_NAME, PROJECT_NAME, makeCopy);
project = provider.getProject();
Throwable exception = null;
15 years, 9 months
JBoss Tools SVN: r23638 - in trunk/jst/tests/org.jboss.tools.jst.web.ui.test: src/org/jboss/tools/jst/web/ui/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-07-21 13:46:14 -0400 (Wed, 21 Jul 2010)
New Revision: 23638
Removed:
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/.settings/org.eclipse.jdt.core.prefs
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/AddJSFCapabilitiesTest.java
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JSPProblemMarkerResolutionTest.java
Modified:
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiAllTests.java
Log:
Green Build
JSF related tests are moved to jsf.ui.test plug-in
Deleted: trunk/jst/tests/org.jboss.tools.jst.web.ui.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.ui.test/.settings/org.eclipse.jdt.core.prefs 2010-07-21 15:28:37 UTC (rev 23637)
+++ trunk/jst/tests/org.jboss.tools.jst.web.ui.test/.settings/org.eclipse.jdt.core.prefs 2010-07-21 17:46:14 UTC (rev 23638)
@@ -1,8 +0,0 @@
-#Fri Jun 11 14:44:27 MSD 2010
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
Deleted: trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/AddJSFCapabilitiesTest.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/AddJSFCapabilitiesTest.java 2010-07-21 15:28:37 UTC (rev 23637)
+++ trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/AddJSFCapabilitiesTest.java 2010-07-21 17:46:14 UTC (rev 23638)
@@ -1,143 +0,0 @@
-package org.jboss.tools.jst.web.ui.test;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.ServerCore;
-import org.jboss.tools.common.meta.key.WizardKeys;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.action.AddNatureActionDelegate;
-import org.jboss.tools.common.model.ui.util.ExtensionPointUtils;
-import org.jboss.tools.jst.web.ui.wizards.project.ImportWebProjectWizard;
-import org.jboss.tools.test.util.JobUtils;
-import org.jboss.tools.test.util.ProjectImportTestSetup;
-
-
-public class AddJSFCapabilitiesTest extends TestCase {
- IProject project = null;
- IProject fake_as = null;
-
- public AddJSFCapabilitiesTest() {
- super("Add JSF Capabilities Test");
- }
-
- public AddJSFCapabilitiesTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- JobUtils.waitForIdle(3000);
- IResource project = ResourcesPlugin.getWorkspace().getRoot().findMember("test_add_jsf_capabilities");
- if(project == null) {
- ProjectImportTestSetup setup = new ProjectImportTestSetup(
- this,
- "org.jboss.tools.jst.web.ui.test",
- "projects/test_add_jsf_capabilities",
- "test_add_jsf_capabilities");
- project = setup.importProject();
- }
- this.project = project.getProject();
-
- IResource fake_as = ResourcesPlugin.getWorkspace().getRoot().findMember("fake_as");
- if(fake_as == null) {
- ProjectImportTestSetup setup = new ProjectImportTestSetup(
- this,
- "org.jboss.tools.jst.web.ui.test",
- "projects/fake_as",
- "fake_as");
- fake_as = setup.importProject();
- }
- this.fake_as = fake_as.getProject();
- JobUtils.waitForIdle();
- }
-
- public void testAddJSFCapabilities() {
- ImportWebProjectWizard wizard = (ImportWebProjectWizard)new Act().getWizard(project);
- WizardDialog dialog = new WizardDialog(
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- wizard);
- dialog.setBlockOnOpen(false);
- dialog.open();
-
- IRuntime r0 = createRuntime();
- ((ImportWebProjectWizard)wizard).setRuntimeName(r0.getName());
-
- assertTrue(wizard.canFinish());
-
- boolean b = wizard.performFinish();
-
- assertTrue(b);
-
- try {
- assertTrue(project.hasNature("org.jboss.tools.jsf.jsfnature"));
- } catch (CoreException e) {
- fail(e.getMessage());
- }
-
- IFile f = project.getFile(new Path(".settings/org.eclipse.wst.common.project.facet.core.xml"));
- assertNotNull(f);
- assertTrue(f.exists());
- }
-
- static String RUNTIME = "org.jboss.ide.eclipse.as.runtime.42";
-
- IRuntime createRuntime() {
- IRuntimeType t = ServerCore.findRuntimeType(RUNTIME);
-
- IPath location = fake_as.getLocation();
- try {
- IRuntimeWorkingCopy r = t.createRuntime(RUNTIME, new NullProgressMonitor());
- r.setName("myRuntime");
- r.setLocation(location);
- return r.save(true, new NullProgressMonitor());
-
- } catch (CoreException e) {
- fail(e.getMessage());
- return null;
- }
- }
-
- private void refreshProject(IProject project){
- try {
- project.refreshLocal(IResource.DEPTH_INFINITE, null);
- JobUtils.waitForIdle();
- JobUtils.delay(2000);
- } catch (CoreException e) {
- // ignore
- }
- }
-
- class Act extends AddNatureActionDelegate {
-
- protected IWizard getWizard(IProject project) {
- ImportWebProjectWizard wizard = (ImportWebProjectWizard)ExtensionPointUtils.findImportWizardsItem(
- "org.jboss.tools.jsf",
- "org.jboss.tools.jsf.ui.wizard.project.ImportProjectWizard" //$NON-NLS-1$
- );
- if (wizard == null) throw new IllegalArgumentException("Wizard org.jboss.tools.common.model.ui.wizards.ImportProjectWizard is not found."); //$NON-NLS-1$
- wizard.setInitialName(project.getName());
- wizard.setInitialLocation(findWebXML(project.getLocation().toString()));
- wizard.init(ModelUIPlugin.getDefault().getWorkbench(), null);
- wizard.setWindowTitle(WizardKeys.getString("ADD_JSF_NATURE")); //$NON-NLS-1$
- return wizard;
- }
-
- protected String getNatureID() {
- return null;
- }
-
- }
-}
Deleted: trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JSPProblemMarkerResolutionTest.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JSPProblemMarkerResolutionTest.java 2010-07-21 15:28:37 UTC (rev 23637)
+++ trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JSPProblemMarkerResolutionTest.java 2010-07-21 17:46:14 UTC (rev 23638)
@@ -1,98 +0,0 @@
-package org.jboss.tools.jst.web.ui.test;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.ui.IMarkerResolution;
-import org.jboss.tools.jst.web.ui.action.JSPProblemMarkerResolutionGenerator;
-import org.jboss.tools.test.util.JobUtils;
-import org.jboss.tools.test.util.ProjectImportTestSetup;
-import org.jboss.tools.tests.AbstractResourceMarkerTest;
-
-public class JSPProblemMarkerResolutionTest extends AbstractResourceMarkerTest{
- IProject project = null;
-
- public JSPProblemMarkerResolutionTest() {
- super("JSP Problem Marker Resolution Tests");
- }
-
- public JSPProblemMarkerResolutionTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- JobUtils.waitForIdle();
- IResource project = ResourcesPlugin.getWorkspace().getRoot().findMember("test_jsf_project");
- if(project == null) {
- ProjectImportTestSetup setup = new ProjectImportTestSetup(
- this,
- "org.jboss.tools.jst.web.ui.test",
- "projects/test_jsf_project",
- "test_jsf_project");
- project = setup.importProject();
- }
- this.project = project.getProject();
- JobUtils.waitForIdle();
- }
-
- public void testProblemMarkerResolutionInJSP() throws CoreException {
- IFile jspFile = project.getFile("WebContent/pages/test_page1.jsp");
-
- assertMarkerIsCreated(jspFile, "org.eclipse.jst.jsp.core.validationMarker", "Unknown tag.*");
-
- IMarker[] markers = findMarkers(jspFile, "org.eclipse.jst.jsp.core.validationMarker", "Unknown tag.*");
-
- assertEquals(1, markers.length);
-
- JSPProblemMarkerResolutionGenerator generator = new JSPProblemMarkerResolutionGenerator();
-
- for(IMarker marker : markers){
- generator.hasResolutions(marker);
- IMarkerResolution[] resolutions = generator.getResolutions(marker);
- for(IMarkerResolution resolution : resolutions){
- resolution.run(marker);
- }
- }
-
- refreshProject(project);
-
- assertMarkerIsNotCreated(jspFile, "org.eclipse.jst.jsp.core.validationMarker", "Unknown tag.*");
- }
-
- public void testProblemMarkerResolutionInXHTML() throws CoreException {
- IFile jspFile = project.getFile("WebContent/pages/test_page2.xhtml");
-
- assertMarkerIsCreated(jspFile, "org.eclipse.wst.html.core.validationMarker", "Unknown tag.*");
-
- IMarker[] markers = findMarkers(jspFile, "org.eclipse.wst.html.core.validationMarker", "Unknown tag.*");
-
- assertEquals(3, markers.length);
-
- JSPProblemMarkerResolutionGenerator generator = new JSPProblemMarkerResolutionGenerator();
-
- for(IMarker marker : markers){
- generator.hasResolutions(marker);
- IMarkerResolution[] resolutions = generator.getResolutions(marker);
- for(IMarkerResolution resolution : resolutions){
- resolution.run(marker);
- }
- }
-
- refreshProject(project);
-
- assertMarkerIsNotCreated(jspFile, "org.eclipse.wst.html.core.validationMarker", "Unknown tag.*");
- }
-
- private void refreshProject(IProject project){
- try {
- project.refreshLocal(IResource.DEPTH_INFINITE, null);
- JobUtils.waitForIdle();
- JobUtils.delay(2000);
- } catch (CoreException e) {
- // ignore
- }
- }
-}
Modified: trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiAllTests.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiAllTests.java 2010-07-21 15:28:37 UTC (rev 23637)
+++ trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiAllTests.java 2010-07-21 17:46:14 UTC (rev 23638)
@@ -10,12 +10,12 @@
******************************************************************************/
package org.jboss.tools.jst.web.ui.test;
-import org.jboss.tools.test.util.ProjectImportTestSetup;
-
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.jboss.tools.test.util.ProjectImportTestSetup;
+
/**
* @author eskimo
*
@@ -27,15 +27,7 @@
suite.addTestSuite(WebViewsTest.class);
suite.addTestSuite(WebWizardsTest.class);
suite.addTestSuite(JstWebUiPreferencesPagesTest.class);
- suite.addTest(new ProjectImportTestSetup(new TestSuite(JSPProblemMarkerResolutionTest.class),
- "org.jboss.tools.jst.web.ui.test",
- new String[]{"projects/test_jsf_project"},
- new String[]{"test_jsf_project"}));
- suite.addTest(new ProjectImportTestSetup(new TestSuite(AddJSFCapabilitiesTest.class),
- "org.jboss.tools.jst.web.ui.test",
- new String[]{"projects/test_add_jsf_capabilities"},
- new String[]{"test_add_jsf_capabilities"}));
-
+
return suite;
}
}
15 years, 9 months
JBoss Tools SVN: r23637 - in trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext: hyperlink and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-07-21 11:28:37 -0400 (Wed, 21 Jul 2010)
New Revision: 23637
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/CDIExtensionsMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlink.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/messages.properties
Log:
https://jira.jboss.org/browse/JBIDE-6635
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/CDIExtensionsMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/CDIExtensionsMessages.java 2010-07-21 12:30:33 UTC (rev 23636)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/CDIExtensionsMessages.java 2010-07-21 15:28:37 UTC (rev 23637)
@@ -21,6 +21,8 @@
public static String CDI_EXT_PLUGIN_NO_MESSAGE;
public static String CDI_INJECTED_POINT_HYPERLINK_OPEN_BEAN;
+ public static String CDI_INJECTED_POINT_HYPERLINK_OPEN_DECORATOR;
+ public static String CDI_INJECTED_POINT_HYPERLINK_OPEN_INTERCEPTOR;
public static String CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECTED_BEAN;
public static String CDI_PRODUCER_DISPOSER_HYPERLINK_OPEN_BOUND_DISPOSER;
public static String CDI_PRODUCER_DISPOSER_HYPERLINK_OPEN_BOUND_PRODUCER;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlink.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlink.java 2010-07-21 12:30:33 UTC (rev 23636)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlink.java 2010-07-21 15:28:37 UTC (rev 23637)
@@ -18,6 +18,8 @@
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PartInitException;
import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.IDecorator;
+import org.jboss.tools.cdi.core.IInterceptor;
import org.jboss.tools.cdi.core.IProducerField;
import org.jboss.tools.cdi.core.IProducerMethod;
import org.jboss.tools.cdi.text.ext.CDIExtensionsMessages;
@@ -63,8 +65,15 @@
@Override
public String getHyperlinkText() {
- String text = CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_BEAN+" ";
+ String text="";
if(bean != null){
+ if(bean instanceof IDecorator)
+ text = CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_DECORATOR+" ";
+ else if(bean instanceof IInterceptor)
+ text = CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INTERCEPTOR+" ";
+ else
+ text = CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_BEAN+" ";
+
text += bean.getBeanClass().getElementName();
if(bean instanceof IProducerField){
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/messages.properties 2010-07-21 12:30:33 UTC (rev 23636)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/messages.properties 2010-07-21 15:28:37 UTC (rev 23637)
@@ -1,5 +1,7 @@
CDI_EXT_PLUGIN_NO_MESSAGE=No message
CDI_INJECTED_POINT_HYPERLINK_OPEN_BEAN=Open CDI Bean
+CDI_INJECTED_POINT_HYPERLINK_OPEN_DECORATOR=Open CDI Decorator
+CDI_INJECTED_POINT_HYPERLINK_OPEN_INTERCEPTOR=Open CDI Interceptor
CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECTED_BEAN=Open Injected Bean
CDI_PRODUCER_DISPOSER_HYPERLINK_OPEN_BOUND_DISPOSER=Open Bound Disposer Method
CDI_PRODUCER_DISPOSER_HYPERLINK_OPEN_BOUND_PRODUCER=Open Bound Producer Method
15 years, 9 months
JBoss Tools SVN: r23636 - in workspace/rstryker/rse/as/plugins: org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/rse and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-07-21 08:30:33 -0400 (Wed, 21 Jul 2010)
New Revision: 23636
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSESingleFilePublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHCommandUtil.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHCopyCallback.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHJstPublisher.java
Removed:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/SingleFileRSEPublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHPublisher.java
Modified:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackagesPublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/rse/RSEZippedJSTPublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/LocalPublishMethod.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublishMethod.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/AbstractServerToolsPublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/plugin.xml
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHPackagesPublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHServerBehaviourDelegate.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHSingleFilePublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHZippedJSTPublisher.java
Log:
Moved two of three remaining publisher methods into the publisher method (local, rse, ssh, etc)
JBIDE-6580
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackagesPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackagesPublisher.java 2010-07-21 12:08:00 UTC (rev 23635)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackagesPublisher.java 2010-07-21 12:30:33 UTC (rev 23636)
@@ -10,16 +10,9 @@
******************************************************************************/
package org.jboss.ide.eclipse.archives.webtools.modules;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.LocalCopyCallback;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.rse.core.AbstractServerToolsPublisher;
public class PackagesPublisher extends AbstractServerToolsPublisher {
@@ -29,18 +22,4 @@
return true;
return false;
}
-
- @Override
- protected IPublishCopyCallbackHandler getCallbackHandler(IPath path,
- IServer server, IJBossServerPublishMethod method) {
- IDeployableServer ds = ServerConverter.getDeployableServer(server);
- return new LocalCopyCallback(server, path,
- new Path(ds.getTempDeployFolder()));
- }
-
- @Override
- protected String getPublishDefaultRootFolder() {
- return server.getDeployFolder();
- }
-
}
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/rse/RSEZippedJSTPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/rse/RSEZippedJSTPublisher.java 2010-07-21 12:08:00 UTC (rev 23635)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/rse/RSEZippedJSTPublisher.java 2010-07-21 12:30:33 UTC (rev 23636)
@@ -64,9 +64,9 @@
// set up needed vars
IDeployableServer server2 = ServerConverter.getDeployableServer(server);
- String depRoot = getDeployRoot(module, ServerConverter.getDeployableServer(server));
+ String remoteTempDeployRoot = getDeployRoot(module, ServerConverter.getDeployableServer(server));
RSEPublishMethod method2 = (RSEPublishMethod)method;
- IPath sourcePath = PublishUtil.getDeployPath(module, depRoot);
+ IPath sourcePath = PublishUtil.getDeployPath(module, remoteTempDeployRoot);
IModule lastMod = module[module.length-1];
IPath destFolder = RSEPublishMethod.findModuleFolderWithDefault(lastMod, server2, method2.getRemoteRootFolder());
IPath tempDestFolder = RSEPublishMethod.findModuleFolderWithDefault(lastMod, server2, method2.getRemoteTemporaryFolder());
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2010-07-21 12:08:00 UTC (rev 23635)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2010-07-21 12:30:33 UTC (rev 23636)
@@ -10,33 +10,10 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.publishers;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.LocalCopyCallback;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.rse.core.AbstractJSTPublisher;
public class JstPublisher extends AbstractJSTPublisher {
protected String getTargetedPublishMethodId() {
return LocalPublishMethod.LOCAL_PUBLISH_METHOD;
}
-
- @Override
- protected IPublishCopyCallbackHandler getCallbackHandler(IPath path,
- IServer server, IJBossServerPublishMethod method) {
- IDeployableServer ds = ServerConverter.getDeployableServer(server);
- String tempDeployPath = ds.getTempDeployFolder();
- LocalCopyCallback handler = new LocalCopyCallback(server,
- path, new Path(tempDeployPath));
- return handler;
- }
-
- @Override
- protected String getPublishDefaultRootFolder() {
- return server.getDeployFolder();
- }
}
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/LocalPublishMethod.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/LocalPublishMethod.java 2010-07-21 12:08:00 UTC (rev 23635)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/LocalPublishMethod.java 2010-07-21 12:30:33 UTC (rev 23636)
@@ -10,12 +10,32 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.publishers;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
+import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.LocalCopyCallback;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+
public class LocalPublishMethod extends AbstractPublishMethod {
public static final String LOCAL_PUBLISH_METHOD = "local"; //$NON-NLS-1$
- @Override
public String getPublishMethodId() {
return LOCAL_PUBLISH_METHOD;
}
+
+ public IPublishCopyCallbackHandler getCallbackHandler(IPath path, IServer server) {
+ IDeployableServer ds = ServerConverter.getDeployableServer(server);
+ String tempDeployPath = ds.getTempDeployFolder();
+ LocalCopyCallback handler = new LocalCopyCallback(server,
+ path, new Path(tempDeployPath));
+ return handler;
+ }
+
+ public String getPublishDefaultRootFolder(IServer server) {
+ IDeployableServer s = ServerConverter.getDeployableServer(server);
+ return s.getDeployFolder();
+ }
}
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2010-07-21 12:08:00 UTC (rev 23635)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2010-07-21 12:30:33 UTC (rev 23636)
@@ -10,16 +10,9 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.publishers;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
-import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.LocalCopyCallback;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.rse.core.AbstractServerToolsPublisher;
public class SingleFilePublisher extends AbstractServerToolsPublisher {
@@ -31,19 +24,4 @@
return true;
return false;
}
-
- @Override
- protected IPublishCopyCallbackHandler getCallbackHandler(IPath path,
- IServer server, IJBossServerPublishMethod method) {
- IDeployableServer ds = ServerConverter.getDeployableServer(server);
- String tempDeployPath = ds.getTempDeployFolder();
- LocalCopyCallback handler = new LocalCopyCallback(server,
- path, new Path(tempDeployPath));
- return handler;
- }
-
- @Override
- protected String getPublishDefaultRootFolder() {
- return server.getDeployFolder();
- }
}
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublishMethod.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublishMethod.java 2010-07-21 12:08:00 UTC (rev 23635)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublishMethod.java 2010-07-21 12:30:33 UTC (rev 23636)
@@ -11,14 +11,20 @@
package org.jboss.ide.eclipse.as.core.server;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
+import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
public interface IJBossServerPublishMethod {
public IJBossServerPublishMethodType getPublishMethodType();
public void publishStart(DeployableServerBehavior behaviour, IProgressMonitor monitor) throws CoreException;
public int publishFinish(DeployableServerBehavior behaviour, IProgressMonitor monitor) throws CoreException;
public int publishModule(DeployableServerBehavior behaviour, int kind, int deltaKind, IModule[] module, IProgressMonitor monitor) throws CoreException;
+
+ // Methods moved from publishers into the publish method
+ public IPublishCopyCallbackHandler getCallbackHandler(IPath path, IServer server);
+ public String getPublishDefaultRootFolder(IServer server);
}
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/AbstractServerToolsPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/AbstractServerToolsPublisher.java 2010-07-21 12:08:00 UTC (rev 23635)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/AbstractServerToolsPublisher.java 2010-07-21 12:30:33 UTC (rev 23636)
@@ -25,7 +25,6 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.componentcore.ModuleCoreNature;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.model.IModuleResource;
@@ -38,7 +37,6 @@
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil;
import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
@@ -97,21 +95,8 @@
}
return status;
}
-
+
/**
- * Get the callback handler to be used for building the module.
- * If the module is to be published locally, this may be a handler which only copies locally.
- * If the module is to be zipped & published locally, this may be
- * a handler which zips to a temporary directory, and allows the finish method to move the file
- *
- * @param path
- * @param server
- * @param method
- * @return
- */
- protected abstract IPublishCopyCallbackHandler getCallbackHandler(IPath path, IServer server, IJBossServerPublishMethod method);
-
- /**
* Gets the actual deploy path for this module
*
* @param moduleTree
@@ -122,19 +107,12 @@
DeploymentPreferenceLoader.getCurrentDeploymentMethodType(server.getServer());
String folder = PublishUtil.getDeployRootFolder(
moduleTree, server,
- getPublishDefaultRootFolder(),
+ publishMethod.getPublishDefaultRootFolder(server.getServer()),
IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
return PublishUtil.getDeployPath(moduleTree, folder);
}
-
+
/**
- * In the event that no module-specific preferences are enabled,
- * get the default publish folder
- * @return
- */
- protected abstract String getPublishDefaultRootFolder();
-
- /**
* Finish up the publishing. This may be moving a final zipped entity into the proper
* folder or sending it over the wire to a remote machine.
*
@@ -148,7 +126,7 @@
protected void finishPublish(int publishType, IModule[] moduleTree, IDeployableServer server, IProgressMonitor monitor){}
private IPublishCopyCallbackHandler getCallbackHandler(IPath path) {
- return getCallbackHandler(path, server.getServer(), publishMethod);
+ return publishMethod.getCallbackHandler(path, server.getServer());
}
/**
@@ -283,7 +261,7 @@
protected IStatus unpublish(IDeployableServer jbServer, IModule[] module,
IProgressMonitor monitor) throws CoreException {
IPath remotePath = getDeployPath(module, server);
- IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$
+ IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$
handler.deleteResource(remotePath, monitor);
return Status.OK_STATUS;
}
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java 2010-07-21 12:08:00 UTC (rev 23635)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java 2010-07-21 12:30:33 UTC (rev 23636)
@@ -12,89 +12,11 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.rse.core;
-import java.io.File;
-import java.util.ArrayList;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.model.IModuleFile;
-import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
-
public class RSEJSTPublisher extends AbstractJSTPublisher {
@Override
protected String getTargetedPublishMethodId() {
return RSEPublishMethod.RSE_ID;
}
-
- private RSEPublishMethod getPublishMethod() {
- return (RSEPublishMethod)publishMethod;
- }
-
- @Override
- protected String getPublishDefaultRootFolder() {
- return getPublishMethod().getRemoteRootFolder().toString();
- }
-
- @Override
- protected IPublishCopyCallbackHandler getCallbackHandler(IPath path, IServer server,
- IJBossServerPublishMethod method) {
- return new RSERemotePublishHandler(path, getPublishMethod());
- }
-
- public static class RSERemotePublishHandler implements IPublishCopyCallbackHandler {
- protected IPath root;
- protected RSEPublishMethod method;
- private ArrayList<IPath> createdFolders = new ArrayList<IPath>();
- public RSERemotePublishHandler(IPath path, RSEPublishMethod method) {
- this.root = path;
- this.method = method;
- }
- public IStatus[] copyFile(IModuleFile mf, IPath path,
- IProgressMonitor monitor) throws CoreException {
- File file = PublishUtil.getFile(mf);
- IPath remotePath = root.append(path);
- try {
- method.getFileService().upload(file, remotePath.removeLastSegments(1).toString(),
- remotePath.lastSegment(), true, null, null, monitor);
- } catch( SystemMessageException sme ) {
- System.err.println("failed to copy to " + remotePath.toString()); //$NON-NLS-1$
- }
- return null;
- }
-
- public IStatus[] deleteResource(IPath path, IProgressMonitor monitor)
- throws CoreException {
- IPath remotePath = root.append(path);
- try {
- method.getFileService().delete(remotePath.removeLastSegments(1).toString(), remotePath.lastSegment(), monitor);
- } catch( SystemMessageException sme ) {
- System.err.println("failed to delete " + remotePath.toString()); //$NON-NLS-1$
- }
- return null;
- }
-
- public IStatus[] makeDirectoryIfRequired(IPath dir,
- IProgressMonitor monitor) throws CoreException {
- if( dir.segmentCount() > 0 )
- makeDirectoryIfRequired(dir.removeLastSegments(1), monitor);
- IPath toMake = root.append(dir);
- if( createdFolders.contains(toMake))
- return new IStatus[]{Status.OK_STATUS};
- try {
- method.getFileService().createFolder(toMake.removeLastSegments(1).toString(), toMake.lastSegment(), monitor);
- } catch( SystemMessageException sme ) {
- System.err.println("failed to make folder " + toMake.toString()); //$NON-NLS-1$
- }
- createdFolders.add(toMake);
- return null;
- }
- }
}
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java 2010-07-21 12:08:00 UTC (rev 23635)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java 2010-07-21 12:30:33 UTC (rev 23636)
@@ -23,10 +23,12 @@
import org.eclipse.rse.services.files.IFileService;
import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem;
import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.publishers.AbstractPublishMethod;
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
+import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
public class RSEPublishMethod extends AbstractPublishMethod {
@@ -116,4 +118,13 @@
return PublishUtil.getDeployPath(moduleTree, folder).removeLastSegments(1);
}
+
+ public IPublishCopyCallbackHandler getCallbackHandler(IPath path, IServer server) {
+ return new RSERemotePublishHandler(path, this);
+ }
+
+ public String getPublishDefaultRootFolder(IServer server) {
+ return getRemoteRootFolder().toString();
+ }
+
}
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java 2010-07-21 12:30:33 UTC (rev 23636)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ * TODO: Logging and Progress Monitors
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.rse.core;
+
+import java.io.File;
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
+import org.eclipse.wst.server.core.model.IModuleFile;
+import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
+import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
+
+public class RSERemotePublishHandler implements IPublishCopyCallbackHandler {
+ protected IPath root;
+ protected RSEPublishMethod method;
+ private ArrayList<IPath> createdFolders = new ArrayList<IPath>();
+ public RSERemotePublishHandler(IPath path, RSEPublishMethod method) {
+ this.root = path;
+ this.method = method;
+ }
+ public IStatus[] copyFile(IModuleFile mf, IPath path,
+ IProgressMonitor monitor) throws CoreException {
+ File file = PublishUtil.getFile(mf);
+ IPath remotePath = root.append(path);
+ try {
+ method.getFileService().upload(file, remotePath.removeLastSegments(1).toString(),
+ remotePath.lastSegment(), true, null, null, monitor);
+ } catch( SystemMessageException sme ) {
+ System.err.println("failed to copy to " + remotePath.toString()); //$NON-NLS-1$
+ }
+ return null;
+ }
+
+ public IStatus[] deleteResource(IPath path, IProgressMonitor monitor)
+ throws CoreException {
+ IPath remotePath = root.append(path);
+ try {
+ method.getFileService().delete(remotePath.removeLastSegments(1).toString(), remotePath.lastSegment(), monitor);
+ } catch( SystemMessageException sme ) {
+ System.err.println("failed to delete " + remotePath.toString()); //$NON-NLS-1$
+ }
+ return null;
+ }
+
+ public IStatus[] makeDirectoryIfRequired(IPath dir,
+ IProgressMonitor monitor) throws CoreException {
+ if( dir.segmentCount() > 0 )
+ makeDirectoryIfRequired(dir.removeLastSegments(1), monitor);
+ IPath toMake = root.append(dir);
+ if( createdFolders.contains(toMake))
+ return new IStatus[]{Status.OK_STATUS};
+ try {
+ method.getFileService().createFolder(toMake.removeLastSegments(1).toString(), toMake.lastSegment(), monitor);
+ } catch( SystemMessageException sme ) {
+ System.err.println("failed to make folder " + toMake.toString()); //$NON-NLS-1$
+ }
+ createdFolders.add(toMake);
+ return null;
+ }
+}
+
Copied: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSESingleFilePublisher.java (from rev 23618, workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/SingleFileRSEPublisher.java)
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSESingleFilePublisher.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSESingleFilePublisher.java 2010-07-21 12:30:33 UTC (rev 23636)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.rse.core;
+
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
+
+public class RSESingleFilePublisher extends AbstractServerToolsPublisher {
+
+ public boolean accepts(String method, IServer server, IModule[] module) {
+ if( RSEPublishMethod.RSE_ID.equals(method)
+ && module != null && module.length > 0
+ && module[module.length-1] != null
+ && module[module.length-1].getModuleType().getId().equals(SingleDeployableFactory.MODULE_TYPE))
+ return true;
+ return false;
+ }
+}
Deleted: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/SingleFileRSEPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/SingleFileRSEPublisher.java 2010-07-21 12:08:00 UTC (rev 23635)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/SingleFileRSEPublisher.java 2010-07-21 12:30:33 UTC (rev 23636)
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.rse.core;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
-import org.jboss.ide.eclipse.as.rse.core.RSEJSTPublisher.RSERemotePublishHandler;
-
-public class SingleFileRSEPublisher extends AbstractServerToolsPublisher {
-
- public boolean accepts(String method, IServer server, IModule[] module) {
- if( RSEPublishMethod.RSE_ID.equals(method)
- && module != null && module.length > 0
- && module[module.length-1] != null
- && module[module.length-1].getModuleType().getId().equals(SingleDeployableFactory.MODULE_TYPE))
- return true;
- return false;
- }
-
- @Override
- protected IPublishCopyCallbackHandler getCallbackHandler(IPath path,
- IServer server, IJBossServerPublishMethod method) {
- return new RSERemotePublishHandler(path, (RSEPublishMethod)method);
- }
-
- @Override
- protected String getPublishDefaultRootFolder() {
- return ((RSEPublishMethod)publishMethod).getRemoteRootFolder().toString();
- }
-}
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2010-07-21 12:08:00 UTC (rev 23635)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2010-07-21 12:30:33 UTC (rev 23636)
@@ -1062,7 +1062,7 @@
<extension
point="org.jboss.ide.eclipse.as.core.publishers">
<publisher
- class="org.jboss.ide.eclipse.as.rse.core.SingleFileRSEPublisher"
+ class="org.jboss.ide.eclipse.as.rse.core.RSESingleFilePublisher"
priority="7">
</publisher>
<publisher
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/plugin.xml
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/plugin.xml 2010-07-21 12:08:00 UTC (rev 23635)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/plugin.xml 2010-07-21 12:30:33 UTC (rev 23636)
@@ -69,7 +69,7 @@
zipDelegate="true">
</publisher>
<publisher
- class="org.jboss.ide.eclipse.as.ssh.server.SSHPublisher"
+ class="org.jboss.ide.eclipse.as.ssh.server.SSHJstPublisher"
priority="3"
zipDelegate="false">
</publisher>
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHCommandUtil.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHCommandUtil.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHCommandUtil.java 2010-07-21 12:30:33 UTC (rev 23636)
@@ -0,0 +1,213 @@
+package org.jboss.ide.eclipse.as.ssh.server;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
+import org.jboss.ide.eclipse.as.ssh.SSHDeploymentPlugin;
+
+import com.jcraft.jsch.Channel;
+import com.jcraft.jsch.ChannelExec;
+import com.jcraft.jsch.JSchException;
+import com.jcraft.jsch.Session;
+
+public class SSHCommandUtil {
+ public static void launchRemoveCommand(Session session, String remoteLocation, IProgressMonitor monitor) throws CoreException {
+ String command = "rm " + remoteLocation;
+ launchCommand(session, command, monitor);
+ }
+
+ public static void launchCommand(Session session, String command, IProgressMonitor monitor) throws CoreException {
+ launchThreadedCommand(session, command, monitor);
+ }
+
+ public static void launchThreadedCommand(final Session session, final String command, final IProgressMonitor monitor) throws CoreException {
+ // thread and watch the monitor for cancelations and interrupt the thread
+ LaunchRunnable r = new LaunchRunnable() { public void run() throws CoreException {
+ launchCommandNoThread(session, command, monitor);
+ } };
+ launchThreadedCommand(r, monitor);
+ }
+
+ public static void launchCommandNoThread(Session session, String command, IProgressMonitor monitor) throws CoreException {
+ Channel channel = null;
+ try {
+ channel = session.openChannel("exec");
+ ((ChannelExec) channel).setCommand(command);
+
+ channel.connect();
+ while(!channel.isClosed()) {
+ try {Thread.sleep(300);} catch(InterruptedException ie) {}
+ }
+ } catch( JSchException jsche ) {
+ throw new CoreException(new Status(IStatus.ERROR, SSHDeploymentPlugin.PLUGIN_ID, IEventCodes.SSH_PUBLISHING_ROOT_CODE, "Error executing command: " + command, null));
+ } finally {
+ channel.disconnect();
+ }
+ }
+
+ public static class LaunchRunnable {
+ public void run() throws CoreException {
+ }
+ }
+
+ public static void launchCopyCommand(final Session session, final String localFile,
+ final String remoteFile, final IProgressMonitor monitor) throws CoreException {
+ // thread and watch the monitor for cancelations and interrupt the thread
+ LaunchRunnable r = new LaunchRunnable() { public void run() throws CoreException {
+ launchCopyCommandImpl(session, localFile, remoteFile, monitor);
+ } };
+ launchThreadedCommand(r, monitor);
+ }
+
+ public static void launchThreadedCommand(final LaunchRunnable runnable, IProgressMonitor monitor) throws CoreException {
+ final Exception[] e = new Exception[1];
+ e[0] = null;
+ final Object waitObject = new Object();
+ final Boolean[] subtaskComplete = new Boolean[1];
+ subtaskComplete[0] = new Boolean(false);
+ Thread t = new Thread() {
+ public void run() {
+ Exception exception = null;
+ try {
+ runnable.run();
+ } catch( Exception ex ) {
+ exception = ex;
+ }
+ synchronized(waitObject) {
+ e[0] = exception;
+ subtaskComplete[0] = new Boolean(true);
+ waitObject.notifyAll();
+ }
+ }
+ };
+ t.start();
+ while(t.isAlive() && !monitor.isCanceled() ) {
+ synchronized(waitObject) {
+ if( subtaskComplete[0].booleanValue() )
+ break;
+ try {
+ waitObject.wait(500);
+ } catch(InterruptedException ie) {}
+ }
+ }
+ synchronized(waitObject) {
+ if( !subtaskComplete[0].booleanValue()) {
+ t.interrupt();
+ IStatus status = new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.ISTATUS_CODE_ERROR, "SSH command canceled", e[0]);
+ CoreException ce = new CoreException(status);
+ throw ce;
+ }
+ if( e[0] != null ) {
+ IStatus status = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.ISTATUS_CODE_ERROR, "Error running remote command", e[0]);
+ CoreException ce = new CoreException(status);
+ throw ce;
+ }
+
+ }
+ }
+
+ public static void launchCopyCommandImpl(Session session, String localFile, String remoteFile, IProgressMonitor monitor) throws CoreException {
+ Channel channel = null;
+ OutputStream out = null;
+ try {
+ // exec 'scp -t rfile' remotely
+ String command = "scp -p -t " + remoteFile;
+ channel = session.openChannel("exec");
+ ((ChannelExec) channel).setCommand(command);
+
+ // get I/O streams for remote scp
+ out = channel.getOutputStream();
+ InputStream in = channel.getInputStream();
+ channel.connect();
+ if (checkAck(in) != 0) {
+ throw new CoreException(new Status(IStatus.ERROR, SSHDeploymentPlugin.PLUGIN_ID, IEventCodes.SSH_PUBLISHING_ROOT_CODE, "Error transfering file: " + localFile, null));
+ }
+
+ // send "C0644 filesize filename", where filename should not include
+ // '/'
+ long filesize = (new File(localFile)).length();
+ command = "C0644 " + filesize + " ";
+ if (localFile.lastIndexOf('/') > 0) {
+ command += localFile.substring(localFile.lastIndexOf('/') + 1);
+ } else {
+ command += localFile;
+ }
+ command += "\n";
+ out.write(command.getBytes());
+ out.flush();
+ if (checkAck(in) != 0) {
+ throw new CoreException(new Status(IStatus.ERROR, SSHDeploymentPlugin.PLUGIN_ID, IEventCodes.SSH_PUBLISHING_ROOT_CODE, "Error transfering file: " + localFile, null));
+ }
+
+ // send a content of lfile
+ FileInputStream fis = new FileInputStream(localFile);
+ byte[] buf = new byte[1024];
+ while (true) {
+ int len = fis.read(buf, 0, buf.length);
+ if (len <= 0)
+ break;
+ out.write(buf, 0, len); // out.flush();
+ }
+ fis.close();
+ fis = null;
+ // send '\0'
+ buf[0] = 0;
+ out.write(buf, 0, 1);
+ out.flush();
+ if (checkAck(in) != 0) {
+ throw new CoreException(new Status(IStatus.ERROR, SSHDeploymentPlugin.PLUGIN_ID, IEventCodes.SSH_PUBLISHING_ROOT_CODE, "Error transfering file: " + localFile, null));
+ }
+
+ } catch( JSchException jsche ) {
+ throw new CoreException(new Status(IStatus.ERROR, SSHDeploymentPlugin.PLUGIN_ID, IEventCodes.SSH_PUBLISHING_ROOT_CODE, "Error transfering file: " + localFile, jsche));
+ } catch( IOException ioe) {
+ throw new CoreException(new Status(IStatus.ERROR, SSHDeploymentPlugin.PLUGIN_ID, IEventCodes.SSH_PUBLISHING_ROOT_CODE, "Error transfering file: " + localFile, ioe));
+ } finally {
+ if( channel != null )
+ channel.disconnect();
+ if( out != null ) {
+ try {
+ out.close();
+ } catch(IOException ioe) {}
+ }
+ }
+ }
+
+ static int checkAck(InputStream in) throws IOException {
+ int b = in.read();
+ // b may be 0 for success,
+ // 1 for error,
+ // 2 for fatal error,
+ // -1
+ if (b == 0)
+ return b;
+ if (b == -1)
+ return b;
+
+ if (b == 1 || b == 2) {
+ StringBuffer sb = new StringBuffer();
+ int c;
+ do {
+ c = in.read();
+ sb.append((char) c);
+ } while (c != '\n');
+// if (b == 1) { // error
+// System.out.print(sb.toString());
+// }
+// if (b == 2) { // fatal error
+// System.out.print(sb.toString());
+// }
+ }
+ return b;
+ }
+
+}
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHCopyCallback.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHCopyCallback.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHCopyCallback.java 2010-07-21 12:30:33 UTC (rev 23636)
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.ssh.server;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.CoreException;
+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.wst.server.core.model.IModuleFile;
+import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
+import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
+import org.jboss.ide.eclipse.as.ssh.server.SSHServerBehaviourDelegate.SSHPublishMethod;
+
+import com.jcraft.jsch.Session;
+
+public class SSHCopyCallback implements IPublishCopyCallbackHandler {
+
+ private IPath root;
+ private SSHPublishMethod method;
+ public SSHCopyCallback(IPath deployRoot, SSHPublishMethod method) {
+ this.root = deployRoot;
+ this.method = method;
+ }
+
+ public IStatus[] copyFile(IModuleFile mf, IPath path,
+ IProgressMonitor monitor) throws CoreException {
+ File sourceFile = PublishUtil.getFile(mf);
+ IPath destination = root.append(path);
+ String parentFolder = destination.removeLastSegments(1).toString();
+ SSHCommandUtil.launchCommand(getSession(), "mkdir -p " + parentFolder, new NullProgressMonitor());
+ SSHCommandUtil.launchCopyCommand(getSession(), sourceFile.getAbsolutePath(), destination.toString(), new NullProgressMonitor());
+ return new IStatus[]{};
+ }
+
+ protected Session getSession() {
+ return method.getSession();
+ }
+
+ public IStatus[] deleteResource(IPath path, IProgressMonitor monitor) {
+ IPath remotePath = root.append(path);
+ try {
+ SSHCommandUtil.launchCommand(method.getSession(), "rm -rf " + remotePath.toString(), monitor);
+ } catch( CoreException ce ) {
+ return new IStatus[]{ce.getStatus()};
+ }
+ return new IStatus[] {};
+ }
+
+ public IStatus[] makeDirectoryIfRequired(IPath dir, IProgressMonitor monitor) {
+ IPath remotePath = root.append(dir);
+ try {
+ SSHCommandUtil.launchCommand(method.getSession(), "mkdir -p " + remotePath.toString(), monitor);
+ } catch( CoreException ce ) {
+ return new IStatus[]{ce.getStatus()};
+ }
+ return new IStatus[] {};
+ }
+}
\ No newline at end of file
Copied: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHJstPublisher.java (from rev 23581, workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHPublisher.java)
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHJstPublisher.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHJstPublisher.java 2010-07-21 12:30:33 UTC (rev 23636)
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.ssh.server;
+
+
+import org.jboss.ide.eclipse.as.rse.core.AbstractJSTPublisher;
+import org.jboss.ide.eclipse.as.ssh.server.SSHServerBehaviourDelegate.SSHPublishMethod;
+
+
+public class SSHJstPublisher extends AbstractJSTPublisher {
+ public SSHJstPublisher() {}
+
+ @Override
+ protected String getTargetedPublishMethodId() {
+ return SSHPublishMethod.SSH_PUBLISH_METHOD;
+ }
+}
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHPackagesPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHPackagesPublisher.java 2010-07-21 12:08:00 UTC (rev 23635)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHPackagesPublisher.java 2010-07-21 12:30:33 UTC (rev 23636)
@@ -1,149 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.ide.eclipse.as.ssh.server;
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.core.model.IModuleResource;
-import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-import org.jboss.ide.eclipse.archives.core.model.IArchive;
-import org.jboss.ide.eclipse.archives.webtools.IntegrationPlugin;
-import org.jboss.ide.eclipse.archives.webtools.Messages;
import org.jboss.ide.eclipse.archives.webtools.modules.PackageModuleFactory;
-import org.jboss.ide.eclipse.archives.webtools.modules.PackageModuleFactory.PackagedModuleDelegate;
-import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
-import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-import org.jboss.ide.eclipse.as.ssh.server.SSHPublisher.SSHCopyCallback;
+import org.jboss.ide.eclipse.as.rse.core.AbstractServerToolsPublisher;
import org.jboss.ide.eclipse.as.ssh.server.SSHServerBehaviourDelegate.SSHPublishMethod;
-public class SSHPackagesPublisher implements IJBossServerPublisher {
-
- protected IDeployableServer server;
- protected IModuleResourceDelta[] delta;
- protected ArrayList<IStatus> statuses = new ArrayList<IStatus>();
- protected SSHPublishMethod method;
- public SSHPackagesPublisher() {
- }
-
- public int getPublishState() {
- return IServer.PUBLISH_STATE_NONE;
- }
-
+public class SSHPackagesPublisher extends AbstractServerToolsPublisher {
public boolean accepts(String method, IServer server, IModule[] module) {
if( SSHPublishMethod.SSH_PUBLISH_METHOD.equals(method) && module != null && module.length > 0
&& PackageModuleFactory.MODULE_TYPE.equals(module[0].getModuleType().getId()))
return true;
return false;
}
- public IStatus publishModule(
- IJBossServerPublishMethod method,
- IServer server, IModule[] module,
- int publishType, IModuleResourceDelta[] delta,
- IProgressMonitor monitor)
- throws CoreException {
- this.method = (SSHPublishMethod)method;
- this.server = ServerConverter.getDeployableServer(server);
- this.delta = delta;
- IModule module2 = module[0];
-
- try {
- // if it's being removed
- if( publishType == REMOVE_PUBLISH ) {
- statuses.addAll(Arrays.asList(removeModule(module2, monitor)));
- } else if( publishType == FULL_PUBLISH ) {
- statuses.addAll(Arrays.asList(publishModule(module2, false, monitor)));
- } else if( publishType == INCREMENTAL_PUBLISH ) {
- statuses.addAll(Arrays.asList(publishModule(module2, true, monitor)));
- }
- }catch(Exception e) {
- e.printStackTrace();
- IStatus status = new Status(IStatus.ERROR, IntegrationPlugin.PLUGIN_ID,
- NLS.bind(Messages.ErrorDuringPublish, module2.getName()), e);
- return status;
- }
-
- if( statuses.size() > 0 ) {
- MultiStatus ms = new MultiStatus(IntegrationPlugin.PLUGIN_ID, IStatus.ERROR,
- NLS.bind(Messages.ErrorDuringPublish, module2.getName()), null);
- for( int i = 0; i < statuses.size(); i++ ) {
- ms.add(statuses.get(i));
- }
- return ms;
- }
-
- IStatus ret = new Status(IStatus.OK, IntegrationPlugin.PLUGIN_ID,
- NLS.bind(Messages.PublishSuccessful, module2.getName()));
- return ret;
- }
-
- protected IStatus[] removeModule(IModule module, IProgressMonitor monitor) {
- IArchive pack = getPackage(module);
- // remove all of the deployed items
- if( pack != null ) {
- IPath sourcePath = pack.getArchiveFilePath();
- String deployFolder = getRemoteDeployFolder(server.getServer());
- String deployFile = new Path(deployFolder).append(sourcePath.lastSegment()).toString();
- try {
- SSHZippedJSTPublisher.launchRemoveCommand(method.getSession(), deployFile, monitor);
- } catch( CoreException ce ) {
- return new IStatus[] { ce.getStatus() };
- }
- }
- return new IStatus[] { }; // nothing to report
- }
-
-
-
- protected IStatus[] publishModule(IModule module, boolean incremental, IProgressMonitor monitor) {
- IArchive pack = getPackage(module);
- IPath sourcePath = pack.getArchiveFilePath();
- String remoteContainer = getRemoteDeployFolder(server.getServer());
- IPath remoteRoot = new Path(remoteContainer).append(sourcePath.lastSegment());
-
- try {
- if( !pack.isExploded() ) {
- // copy the output file
- SSHZippedJSTPublisher.launchCommand(method.getSession(), "rm -rf " + remoteRoot.toString(), monitor);
- SSHZippedJSTPublisher.launchCopyCommand(method.getSession(), sourcePath.toOSString(), remoteRoot.toString(), monitor);
- } else {
- if( incremental ) {
- SSHCopyCallback callback = new SSHCopyCallback(remoteRoot, method);
- PublishCopyUtil util = new PublishCopyUtil(callback);
- return util.publishDelta(delta, monitor);
- } else {
- SSHZippedJSTPublisher.launchCommand(method.getSession(), "rm -rf " + remoteRoot.toString(), monitor);
- IModuleResource[] members = PublishUtil.getResources(module);
- SSHCopyCallback callback = new SSHCopyCallback(remoteRoot, method);
- PublishCopyUtil util = new PublishCopyUtil(callback);
- return util.publishFull(members, monitor);
- }
- }
- } catch( CoreException ce ) {
- return new IStatus[] { ce.getStatus() };
- }
- return new IStatus[] { };
- }
-
- protected IArchive getPackage(IModule module) {
- PackagedModuleDelegate delegate = (PackagedModuleDelegate)module.loadAdapter(PackagedModuleDelegate.class, new NullProgressMonitor());
- return delegate == null ? null : delegate.getPackage();
- }
- protected String getRemoteDeployFolder(IServer server) {
- return ((Server)server).getAttribute(ISSHDeploymentConstants.DEPLOY_DIRECTORY, (String)null);
- }
}
\ No newline at end of file
Deleted: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHPublisher.java 2010-07-21 12:08:00 UTC (rev 23635)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHPublisher.java 2010-07-21 12:30:33 UTC (rev 23636)
@@ -1,267 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.ssh.server;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.componentcore.ModuleCoreNature;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.core.model.IModuleFile;
-import org.eclipse.wst.server.core.model.IModuleResource;
-import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.Messages;
-import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
-import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
-import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.LocalCopyCallback;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-import org.jboss.ide.eclipse.as.ssh.SSHDeploymentPlugin;
-import org.jboss.ide.eclipse.as.ssh.server.SSHServerBehaviourDelegate.SSHPublishMethod;
-
-import com.jcraft.jsch.Session;
-
-public class SSHPublisher implements IJBossServerPublisher {
- protected IModuleResourceDelta[] delta;
- protected IDeployableServer server;
- protected int publishState = IServer.PUBLISH_STATE_NONE;
- protected SSHPublishMethod publishMethod;
-
- public SSHPublisher() {}
-
- public boolean accepts(String method, IServer server, IModule[] module) {
- if( !method.equals(SSHPublishMethod.SSH_PUBLISH_METHOD))
- return false;
- if( module == null )
- return true;
- IDeployableServer ds = ServerConverter.getDeployableServer(server);
- boolean shouldAccept = ds != null
- && ModuleCoreNature.isFlexibleProject(module[0].getProject())
- && !SSHPublishUtil.getZipsSSHDeployments(server);
- return shouldAccept;
- }
-
- public int getPublishState() {
- return publishState;
- }
-
- public IStatus publishModule(IJBossServerPublishMethod method,
- IServer server, IModule[] module, int publishType,
- IModuleResourceDelta[] delta, IProgressMonitor monitor)
- throws CoreException {
- IStatus status = null;
- this.server = ServerConverter.getDeployableServer(server);
- this.delta = delta;
- this.publishMethod = (SSHPublishMethod)method;
-
- boolean deleted = false;
- for( int i = 0; i < module.length; i++ ) {
- if( module[i].isExternal() )
- deleted = true;
- }
-
- if (publishType == REMOVE_PUBLISH ) {
- status = unpublish(this.server, module, monitor);
- } else {
- if( deleted ) {
- publishState = IServer.PUBLISH_STATE_UNKNOWN;
- } else {
- if (publishType == FULL_PUBLISH ) {
- status = fullPublish(module, module[module.length-1], monitor);
- } else if (publishType == INCREMENTAL_PUBLISH) {
- status = incrementalPublish(module, module[module.length-1], monitor);
- }
- }
- }
- return status;
- }
-
- protected IStatus fullPublish(IModule[] moduleTree, IModule module, IProgressMonitor monitor) throws CoreException {
- IPath remoteDeployPath = getDeployPath(moduleTree, server);
- IModuleResource[] members = PublishUtil.getResources(module);
-
- // First delete it
- // if the module we're publishing is a project, not a binary, clean it's folder
- if( !(new Path(module.getName()).segmentCount() > 1 ))
- SSHZippedJSTPublisher.launchCommand(publishMethod.getSession(), "rm -rf " + remoteDeployPath.toString(), monitor);
-
- ArrayList<IStatus> list = new ArrayList<IStatus>();
-
- if( !PublishUtil.deployPackaged(moduleTree) && !PublishUtil.isBinaryObject(moduleTree)) {
- SSHCopyCallback callback = new SSHCopyCallback(remoteDeployPath, publishMethod);
- PublishCopyUtil util = new PublishCopyUtil(callback);
- list.addAll(Arrays.asList(util.publishFull(members, monitor)));
- }
- else if( PublishUtil.isBinaryObject(moduleTree))
- list.addAll(Arrays.asList(copyBinaryModule(moduleTree, monitor)));
- else {
- IPath deployRoot = JBossServerCorePlugin.getServerStateLocation(server.getServer()).
- append(IJBossServerConstants.DEPLOY).makeAbsolute();
- try {
- File temp = deployRoot.toFile().createTempFile(module.getName(), ".tmp", deployRoot.toFile());
- IPath tempFile = new Path(temp.getAbsolutePath());
- list.addAll(Arrays.asList(PublishUtil.packModuleIntoJar(moduleTree[moduleTree.length-1], tempFile)));
- mkdirAndCopy(publishMethod.getSession(), tempFile.toString(), remoteDeployPath.toString());
- } catch( IOException ioe) {
- list.add(new Status(IStatus.ERROR, SSHDeploymentPlugin.PLUGIN_ID, ioe.getMessage(), ioe));
- }
- }
-
- if( list.size() > 0 )
- return createMultiStatus(list, module);
- return Status.OK_STATUS;
- }
-
- protected IStatus incrementalPublish(IModule[] moduleTree, IModule module, IProgressMonitor monitor) throws CoreException {
- IStatus[] results = new IStatus[] {};
- IPath remoteDeployPath = getDeployPath(moduleTree, server);
- if( !PublishUtil.deployPackaged(moduleTree) && !PublishUtil.isBinaryObject(moduleTree)) {
- SSHCopyCallback handler = new SSHCopyCallback(remoteDeployPath, publishMethod);
- results = new PublishCopyUtil(handler).publishDelta(delta, monitor);
- } else if( delta.length > 0 ) {
- if( PublishUtil.isBinaryObject(moduleTree))
- results = copyBinaryModule(moduleTree, monitor);
- else {
- IPath localDeployRoot = JBossServerCorePlugin.getServerStateLocation(server.getServer()).
- append(IJBossServerConstants.DEPLOY).makeAbsolute();
- try {
- File temp = localDeployRoot.toFile().createTempFile(module.getName(), ".tmp", localDeployRoot.toFile());
- IPath tempFile = new Path(temp.getAbsolutePath());
- PublishUtil.packModuleIntoJar(moduleTree[moduleTree.length-1], tempFile);
- mkdirAndCopy(publishMethod.getSession(), tempFile.toString(), remoteDeployPath.toString());
- } catch( IOException ioe) {
- IStatus s = new Status(IStatus.ERROR, SSHDeploymentPlugin.PLUGIN_ID, ioe.getMessage(), ioe);
- results = new IStatus[] { s };
- }
- }
- }
-
- if( results != null && results.length > 0 ) {
- MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_INC_FAIL,
- NLS.bind(Messages.IncrementalPublishFail, module.getName()), null);
- for( int i = 0; i < results.length; i++ )
- ms.add(results[i]);
- return ms;
- }
-
- IStatus ret = new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FULL_SUCCESS,
- NLS.bind(Messages.CountModifiedMembers, PublishUtil.countChanges(delta), module.getName()), null);
- return ret;
- }
-
-
- protected IStatus createMultiStatus(List<IStatus> list, IModule module) {
- MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FULL_FAIL,
- NLS.bind(Messages.FullPublishFail, module.getName()), null);
- for( int i = 0; i < list.size(); i++ )
- ms.add(list.get(i));
- return ms;
- }
-
- protected IStatus[] copyBinaryModule(IModule[] moduleTree, IProgressMonitor monitor) {
- try {
- IPath remoteDeployPath = getDeployPath(moduleTree, server);
- IModuleResource[] members = PublishUtil.getResources(moduleTree);
- File source = PublishUtil.getFile(members[0]);
- if( source != null ) {
- SSHZippedJSTPublisher.launchCopyCommand(publishMethod.getSession(), source.toString(), remoteDeployPath.toString(), monitor);
- } else {
-// IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_COPY_BINARY_FAIL,
-// NLS.bind(Messages.CouldNotPublishModule,
-// moduleTree[moduleTree.length-1]), null);
-// return new IStatus[] {s};
- // TODO
- }
- } catch( CoreException ce ) {
- return new IStatus[] {ce.getStatus()};
- }
- return new IStatus[]{Status.OK_STATUS};
- }
-
- protected IStatus unpublish(IDeployableServer jbServer, IModule[] module,
- IProgressMonitor monitor) throws CoreException {
- IPath remotePath = getDeployPath(module, server);
- SSHZippedJSTPublisher.launchCommand(publishMethod.getSession(), "rm -rf " + remotePath.toString(), monitor);
- return Status.OK_STATUS;
- }
-
- public static IPath getDeployPath(IModule[] moduleTree, IDeployableServer server) {
- return PublishUtil.getDeployPath(moduleTree, getRemoteDeployFolder(server.getServer()));
- }
-
- public static String getRemoteDeployFolder(IServer server) {
- return ((Server)server).getAttribute(ISSHDeploymentConstants.DEPLOY_DIRECTORY, (String)null);
- }
-
- public static void mkdirAndCopy(Session session, String localFile, String remoteFile) throws CoreException {
- String parentFolder = new Path(remoteFile).removeLastSegments(1).toString();
- SSHZippedJSTPublisher.launchCommand(session, "mkdir -p " + parentFolder, new NullProgressMonitor());
- SSHZippedJSTPublisher.launchCopyCommand(session, localFile, remoteFile, new NullProgressMonitor());
- }
-
- public static class SSHCopyCallback implements IPublishCopyCallbackHandler {
-
- private IPath root;
- private SSHPublishMethod method;
- public SSHCopyCallback(IPath deployRoot, SSHPublishMethod method) {
- this.root = deployRoot;
- this.method = method;
- }
-
- public IStatus[] copyFile(IModuleFile mf, IPath path,
- IProgressMonitor monitor) throws CoreException {
- File sourceFile = PublishUtil.getFile(mf);
- IPath destination = root.append(path);
- mkdirAndCopy(method.getSession(), sourceFile.getAbsolutePath(), destination.toString());
- return new IStatus[]{};
- }
-
- public IStatus[] deleteResource(IPath path, IProgressMonitor monitor) {
- IPath remotePath = root.append(path);
- try {
- SSHZippedJSTPublisher.launchCommand(method.getSession(), "rm -rf " + remotePath.toString(), monitor);
- } catch( CoreException ce ) {
- return new IStatus[]{ce.getStatus()};
- }
- return new IStatus[] {};
- }
-
- public IStatus[] makeDirectoryIfRequired(IPath dir, IProgressMonitor monitor) {
- IPath remotePath = root.append(dir);
- try {
- SSHZippedJSTPublisher.launchCommand(method.getSession(), "mkdir -p " + remotePath.toString(), monitor);
- } catch( CoreException ce ) {
- return new IStatus[]{ce.getStatus()};
- }
- return new IStatus[] {};
- }
- }
-}
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHServerBehaviourDelegate.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHServerBehaviourDelegate.java 2010-07-21 12:08:00 UTC (rev 23635)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHServerBehaviourDelegate.java 2010-07-21 12:30:33 UTC (rev 23636)
@@ -11,16 +11,19 @@
package org.jboss.ide.eclipse.as.ssh.server;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.internal.Server;
import org.jboss.ide.eclipse.as.core.ExtensionManager;
import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
+import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.ssh.SSHDeploymentPlugin;
import com.jcraft.jsch.JSch;
@@ -79,6 +82,10 @@
session = null;
return ret;
}
+
+ public String getPublishDefaultRootFolder(IServer server) {
+ return ((Server)server).getAttribute(ISSHDeploymentConstants.DEPLOY_DIRECTORY, (String)null);
+ }
}
@@ -127,4 +134,15 @@
}
}
+ public IPublishCopyCallbackHandler getCallbackHandler(IPath path,
+ IServer server, IJBossServerPublishMethod method) {
+ return new SSHCopyCallback(path, (SSHPublishMethod)method);
+ }
+
+ public String getPublishDefaultRootFolder(IServer server) {
+ return getPublishDefaultRootFolder(server);
+ }
+
+
+
}
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHSingleFilePublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHSingleFilePublisher.java 2010-07-21 12:08:00 UTC (rev 23635)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHSingleFilePublisher.java 2010-07-21 12:30:33 UTC (rev 23636)
@@ -10,33 +10,16 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.ssh.server;
-import org.eclipse.core.runtime.CoreException;
-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.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.Messages;
-import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
-import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory.SingleDeployableModuleDelegate;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.rse.core.AbstractServerToolsPublisher;
import org.jboss.ide.eclipse.as.ssh.server.SSHServerBehaviourDelegate.SSHPublishMethod;
-public class SSHSingleFilePublisher implements IJBossServerPublisher {
+public class SSHSingleFilePublisher extends AbstractServerToolsPublisher {
- public SSHSingleFilePublisher() {
- }
-
public boolean accepts(String method, IServer server, IModule[] module) {
if( !method.equals(SSHPublishMethod.SSH_PUBLISH_METHOD))
return false;
@@ -48,68 +31,4 @@
&& module[0].getModuleType().getId().equals(SingleDeployableFactory.MODULE_TYPE);
return shouldAccept;
}
-
- public int getPublishState() {
- return IServer.PUBLISH_STATE_NONE;
- }
-
- private IDeployableServer server;
- private SSHPublishMethod publishMethod;
- private int publishState = IServer.PUBLISH_STATE_NONE;
- public IStatus publishModule(IJBossServerPublishMethod method,
- IServer server, IModule[] module, int publishType,
- IModuleResourceDelta[] delta, IProgressMonitor monitor)
- throws CoreException {
- this.server = ServerConverter.getDeployableServer(server);
- this.publishMethod = (SSHPublishMethod)method;
- IModule module2 = module[0];
-
- IStatus status = null;
- if(publishType == REMOVE_PUBLISH){
- status = unpublish(this.server, module2, monitor);
- } else if( publishType == FULL_PUBLISH || publishType == INCREMENTAL_PUBLISH){
- // if there's no change, do nothing. Otherwise, on change or add, re-publish
- status = publish(this.server, module2, monitor);
- }
- return status;
- }
-
- protected IStatus publish(IDeployableServer server, IModule module, IProgressMonitor monitor) {
- SingleDeployableModuleDelegate delegate = (SingleDeployableModuleDelegate)module.loadAdapter(SingleDeployableModuleDelegate.class, new NullProgressMonitor());
- if( delegate != null ) {
- IPath sourcePath = delegate.getGlobalSourcePath();
- String destFolder = SSHPublisher.getRemoteDeployFolder(server.getServer());
- IPath destFile = new Path(destFolder).append(sourcePath.lastSegment());
- try {
- SSHPublisher.mkdirAndCopy(publishMethod.getSession(), sourcePath.toOSString(), destFile.toString());
- } catch( CoreException ce ) {
- return ce.getStatus();
- }
- } else {
- // error can't do nuffin, should never happen
- publishState = IServer.PUBLISH_STATE_UNKNOWN;
- }
- return Status.OK_STATUS;
- }
-
- protected IStatus unpublish(IDeployableServer server, IModule module, IProgressMonitor monitor) throws CoreException {
- SingleDeployableModuleDelegate delegate = (SingleDeployableModuleDelegate)module.loadAdapter(SingleDeployableModuleDelegate.class, new NullProgressMonitor());
- if( delegate != null ) {
- IPath sourcePath = delegate.getGlobalSourcePath();
- String destFolder = SSHPublisher.getRemoteDeployFolder(server.getServer());
- IPath destFile = new Path(destFolder).append(sourcePath.lastSegment());
- SSHZippedJSTPublisher.launchCommand(publishMethod.getSession(), "rm -rf " + destFile.toString(), monitor);
- } else {
- // deleted module. o noes. Ignore it.
- publishState = IServer.PUBLISH_STATE_UNKNOWN;
- Status status = new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.SINGLE_FILE_UNPUBLISH_MNF,
- NLS.bind(Messages.DeleteModuleFail, module.getName()), null);
- return status;
- }
- Status status = new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.SINGLE_FILE_UNPUBLISH_SUCCESS,
- NLS.bind(Messages.ModuleDeleted, module.getName()), null);
- return status;
- }
-
-
}
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHZippedJSTPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHZippedJSTPublisher.java 2010-07-21 12:08:00 UTC (rev 23635)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHZippedJSTPublisher.java 2010-07-21 12:30:33 UTC (rev 23636)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2010 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -10,282 +10,48 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.ssh.server;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.common.componentcore.ModuleCoreNature;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.Server;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-import org.jboss.ide.eclipse.archives.webtools.modules.LocalZippedPublisherUtil;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.Messages;
-import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
-import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
+import org.jboss.ide.eclipse.archives.webtools.modules.WTPZippedPublisher;
+import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-import org.jboss.ide.eclipse.as.ssh.SSHDeploymentPlugin;
import org.jboss.ide.eclipse.as.ssh.server.SSHServerBehaviourDelegate.SSHPublishMethod;
-import com.jcraft.jsch.Channel;
-import com.jcraft.jsch.ChannelExec;
-import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
-public class SSHZippedJSTPublisher implements IJBossServerPublisher {
-
- public SSHZippedJSTPublisher() {
+public class SSHZippedJSTPublisher extends WTPZippedPublisher {
+ protected String getPublishMethod() {
+ return SSHPublishMethod.SSH_PUBLISH_METHOD;
}
-
- public boolean accepts(String method, IServer server, IModule[] module) {
- if( !method.equals(SSHPublishMethod.SSH_PUBLISH_METHOD))
- return false;
- if( module == null )
- return true;
- IDeployableServer ds = ServerConverter.getDeployableServer(server);
- boolean shouldAccept = ds != null
- && ModuleCoreNature.isFlexibleProject(module[0].getProject())
- && SSHPublishUtil.getZipsSSHDeployments(server);
- return shouldAccept;
- }
-
- public int getPublishState() {
- return IServer.PUBLISH_STATE_NONE;
- }
-
+
public IStatus publishModule(
IJBossServerPublishMethod method,
IServer server, IModule[] module,
int publishType, IModuleResourceDelta[] delta,
IProgressMonitor monitor) throws CoreException {
- // Let the local zipped publisher do the work in a local / metadata folder
- IStatus returnStatus = null;
- SSHPublishMethod method2 = (SSHPublishMethod)method;
- IPath deployRoot = JBossServerCorePlugin.getServerStateLocation(server).
- append(IJBossServerConstants.DEPLOY).makeAbsolute();
+ IStatus s = super.publishModule(method, server, module, publishType, delta, monitor);
+ // set up needed vars
+ IDeployableServer server2 = ServerConverter.getDeployableServer(server);
+ String builtArchivesFolder = getDeployRoot(module, ServerConverter.getDeployableServer(server));
+ IPath builtArchive = PublishUtil.getDeployPath(module, builtArchivesFolder);
+ String defaultDeployRoot = ((SSHPublishMethod)method).getPublishDefaultRootFolder(server);
+ String folder = PublishUtil.getDeployRootFolder(
+ module, server2, defaultDeployRoot,
+ SSHPublishMethod.SSH_PUBLISH_METHOD);
+ IPath remoteFile = PublishUtil.getDeployPath(module, folder);
+ Session session = ((SSHPublishMethod)method).getSession();
- LocalZippedPublisherUtil localDelegate = new LocalZippedPublisherUtil();
- IStatus localCopyStatus = localDelegate.publishModule(server,
- deployRoot.toOSString(), module, publishType, delta, monitor);
- IPath outputFilepath = localDelegate.getOutputFilePath(module);
-
- String deployFolder = getRemoteDeployFolder(server);
- String deployFile = new Path(deployFolder).append(outputFilepath.lastSegment()).toString();
-
- // Am I a removal? If yes, remove me, and return
- if( publishType == IJBossServerPublisher.REMOVE_PUBLISH) {
- launchRemoveCommand(method2.getSession(), deployFile, monitor);
- } else {
- launchCopyCommand(method2.getSession(),
- outputFilepath.toString(), deployFile, monitor);
- }
- return null;
+ // Now transfer the file via ssh
+ SSHCommandUtil.launchCopyCommand(session, builtArchive.toString(), remoteFile.toString(), monitor);
+ return s;
}
-
- protected String getRemoteDeployFolder(IServer server) {
- return ((Server)server).getAttribute(ISSHDeploymentConstants.DEPLOY_DIRECTORY, (String)null);
- }
- public static void launchRemoveCommand(Session session, String remoteLocation, IProgressMonitor monitor) throws CoreException {
- String command = "rm " + remoteLocation;
- launchCommand(session, command, monitor);
- }
- public static void launchCommand(Session session, String command, IProgressMonitor monitor) throws CoreException {
- launchThreadedCommand(session, command, monitor);
- }
-
- protected static void launchThreadedCommand(final Session session, final String command, final IProgressMonitor monitor) throws CoreException {
- // thread and watch the monitor for cancelations and interrupt the thread
- LaunchRunnable r = new LaunchRunnable() { public void run() throws CoreException {
- launchCommandNoThread(session, command, monitor);
- } };
- launchThreadedCommand(r, monitor);
- }
-
- protected static void launchCommandNoThread(Session session, String command, IProgressMonitor monitor) throws CoreException {
- Channel channel = null;
- try {
- channel = session.openChannel("exec");
- ((ChannelExec) channel).setCommand(command);
-
- channel.connect();
- while(!channel.isClosed()) {
- try {Thread.sleep(300);} catch(InterruptedException ie) {}
- }
- } catch( JSchException jsche ) {
- throw new CoreException(new Status(IStatus.ERROR, SSHDeploymentPlugin.PLUGIN_ID, IEventCodes.SSH_PUBLISHING_ROOT_CODE, "Error executing command: " + command, null));
- } finally {
- channel.disconnect();
- }
- }
-
- public static class LaunchRunnable {
- public void run() throws CoreException {
- }
- }
-
- public static void launchCopyCommand(final Session session, final String localFile,
- final String remoteFile, final IProgressMonitor monitor) throws CoreException {
- // thread and watch the monitor for cancelations and interrupt the thread
- LaunchRunnable r = new LaunchRunnable() { public void run() throws CoreException {
- launchCopyCommandImpl(session, localFile, remoteFile, monitor);
- } };
- launchThreadedCommand(r, monitor);
- }
-
- protected static void launchThreadedCommand(final LaunchRunnable runnable, IProgressMonitor monitor) throws CoreException {
- final Exception[] e = new Exception[1];
- e[0] = null;
- final Object waitObject = new Object();
- final Boolean[] subtaskComplete = new Boolean[1];
- subtaskComplete[0] = new Boolean(false);
- Thread t = new Thread() {
- public void run() {
- Exception exception = null;
- try {
- runnable.run();
- } catch( Exception ex ) {
- exception = ex;
- }
- synchronized(waitObject) {
- e[0] = exception;
- subtaskComplete[0] = new Boolean(true);
- waitObject.notifyAll();
- }
- }
- };
- t.start();
- while(t.isAlive() && !monitor.isCanceled() ) {
- synchronized(waitObject) {
- if( subtaskComplete[0].booleanValue() )
- break;
- try {
- waitObject.wait(500);
- } catch(InterruptedException ie) {}
- }
- }
- synchronized(waitObject) {
- if( !subtaskComplete[0].booleanValue()) {
- t.interrupt();
- IStatus status = new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.ISTATUS_CODE_ERROR, "SSH command canceled", e[0]);
- CoreException ce = new CoreException(status);
- throw ce;
- }
- if( e[0] != null ) {
- IStatus status = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.ISTATUS_CODE_ERROR, "Error running remote command", e[0]);
- CoreException ce = new CoreException(status);
- throw ce;
- }
-
- }
- }
-
- protected static void launchCopyCommandImpl(Session session, String localFile, String remoteFile, IProgressMonitor monitor) throws CoreException {
- Channel channel = null;
- OutputStream out = null;
- try {
- // exec 'scp -t rfile' remotely
- String command = "scp -p -t " + remoteFile;
- channel = session.openChannel("exec");
- ((ChannelExec) channel).setCommand(command);
-
- // get I/O streams for remote scp
- out = channel.getOutputStream();
- InputStream in = channel.getInputStream();
- channel.connect();
- if (checkAck(in) != 0) {
- throw new CoreException(new Status(IStatus.ERROR, SSHDeploymentPlugin.PLUGIN_ID, IEventCodes.SSH_PUBLISHING_ROOT_CODE, "Error transfering file: " + localFile, null));
- }
-
- // send "C0644 filesize filename", where filename should not include
- // '/'
- long filesize = (new File(localFile)).length();
- command = "C0644 " + filesize + " ";
- if (localFile.lastIndexOf('/') > 0) {
- command += localFile.substring(localFile.lastIndexOf('/') + 1);
- } else {
- command += localFile;
- }
- command += "\n";
- out.write(command.getBytes());
- out.flush();
- if (checkAck(in) != 0) {
- throw new CoreException(new Status(IStatus.ERROR, SSHDeploymentPlugin.PLUGIN_ID, IEventCodes.SSH_PUBLISHING_ROOT_CODE, "Error transfering file: " + localFile, null));
- }
-
- // send a content of lfile
- FileInputStream fis = new FileInputStream(localFile);
- byte[] buf = new byte[1024];
- while (true) {
- int len = fis.read(buf, 0, buf.length);
- if (len <= 0)
- break;
- out.write(buf, 0, len); // out.flush();
- }
- fis.close();
- fis = null;
- // send '\0'
- buf[0] = 0;
- out.write(buf, 0, 1);
- out.flush();
- if (checkAck(in) != 0) {
- throw new CoreException(new Status(IStatus.ERROR, SSHDeploymentPlugin.PLUGIN_ID, IEventCodes.SSH_PUBLISHING_ROOT_CODE, "Error transfering file: " + localFile, null));
- }
-
- } catch( JSchException jsche ) {
- throw new CoreException(new Status(IStatus.ERROR, SSHDeploymentPlugin.PLUGIN_ID, IEventCodes.SSH_PUBLISHING_ROOT_CODE, "Error transfering file: " + localFile, jsche));
- } catch( IOException ioe) {
- throw new CoreException(new Status(IStatus.ERROR, SSHDeploymentPlugin.PLUGIN_ID, IEventCodes.SSH_PUBLISHING_ROOT_CODE, "Error transfering file: " + localFile, ioe));
- } finally {
- if( channel != null )
- channel.disconnect();
- if( out != null ) {
- try {
- out.close();
- } catch(IOException ioe) {}
- }
- }
- }
-
- static int checkAck(InputStream in) throws IOException {
- int b = in.read();
- // b may be 0 for success,
- // 1 for error,
- // 2 for fatal error,
- // -1
- if (b == 0)
- return b;
- if (b == -1)
- return b;
-
- if (b == 1 || b == 2) {
- StringBuffer sb = new StringBuffer();
- int c;
- do {
- c = in.read();
- sb.append((char) c);
- } while (c != '\n');
-// if (b == 1) { // error
-// System.out.print(sb.toString());
-// }
-// if (b == 2) { // fatal error
-// System.out.print(sb.toString());
-// }
- }
- return b;
- }
}
15 years, 9 months
JBoss Tools SVN: r23635 - in trunk: jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-07-21 08:08:00 -0400 (Wed, 21 Jul 2010)
New Revision: 23635
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUIMessages.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/MessagesFileRenameParticipant.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/messages.properties
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/SearchUtil.java
Log:
https://jira.jboss.org/browse/JBIDE-4858
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUIMessages.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUIMessages.java 2010-07-21 11:41:37 UTC (rev 23634)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUIMessages.java 2010-07-21 12:08:00 UTC (rev 23635)
@@ -44,6 +44,7 @@
public static String SKIP_BUTTON_LABEL;
public static String MESSAGES_FILE_RENAME_PARTICIPANT_UPDATE_MESSAGE_BUNDLE_REFERENCES;
+ public static String MESSAGES_FILE_RENAME_PARTICIPANT_FILE_NAME_SHOULD_BE_WITH_THE_SAME_EXTENSION;
static {
// initialize resource bundle
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/MessagesFileRenameParticipant.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/MessagesFileRenameParticipant.java 2010-07-21 11:41:37 UTC (rev 23634)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/MessagesFileRenameParticipant.java 2010-07-21 12:08:00 UTC (rev 23635)
@@ -34,9 +34,10 @@
public class MessagesFileRenameParticipant extends RenameParticipant {
private static final String PROPERTIES_EXT = "properties";
- private RefactoringStatus status;
+ //private RefactoringStatus status;
private CompositeChange rootChange;
private IFile file;
+ private String newName=null;
@Override
protected boolean initialize(Object element) {
@@ -45,31 +46,7 @@
file = (IFile)element;
String ext = file.getFileExtension();
if(PROPERTIES_EXT.equals(ext)){
-
- IPath path = file.getFullPath();
-
- String newName = getArguments().getNewName();
- newName = newName.replace(".properties","");
- String oldName = getQualifiedName(path);
- String fileName = file.getName().replace(".properties","");
- newName = "\""+oldName.replace(fileName,newName)+"\"";
-
- SearchUtil su = new SearchUtil(SearchUtil.XML_FILES, oldName);
-
- SearchResult result = su.searchInNodeAttribute(file.getProject(), ":loadBundle", "basename");
- if(result.getEntries().size() == 0)
- return false;
-
- for(FileResult fr : result.getEntries()){
- TextFileChange fileChange = new TextFileChange(fr.getFile().getName(), fr.getFile());
- MultiTextEdit root = new MultiTextEdit();
- fileChange.setEdit(root);
- rootChange.add(fileChange);
- for(int position : fr.getPositions()){
- TextEdit edit = new ReplaceEdit(position, oldName.length(), newName);
- fileChange.addEdit(edit);
- }
- }
+ newName = getArguments().getNewName();
return true;
}
}
@@ -88,7 +65,7 @@
String pathString = relativePath.toString();
pathString = pathString.replace(".properties","");
pathString = pathString.replace("/",".");
- return "\""+pathString+"\"";
+ return pathString;
}
}
}
@@ -98,7 +75,38 @@
@Override
public RefactoringStatus checkConditions(IProgressMonitor pm,
CheckConditionsContext context) throws OperationCanceledException {
-
+ RefactoringStatus status = new RefactoringStatus();
+ if(newName != null){
+ if(!newName.endsWith(".properties")){
+ status.addFatalError(JsfUIMessages.MESSAGES_FILE_RENAME_PARTICIPANT_FILE_NAME_SHOULD_BE_WITH_THE_SAME_EXTENSION);
+ return status;
+ }
+
+ IPath path = file.getFullPath();
+
+ newName = newName.replace(".properties","");
+ String oldName = getQualifiedName(path);
+ String fileName = file.getName().replace(".properties","");
+ newName = oldName.replace(fileName,newName);
+
+ SearchUtil su = new SearchUtil(SearchUtil.XML_FILES, oldName);
+
+ SearchResult result = su.searchInNodeAttribute(file.getProject(), ":loadBundle", "basename");
+ if(result.getEntries().size() == 0)
+ return status;
+
+ for(FileResult fr : result.getEntries()){
+ TextFileChange fileChange = new TextFileChange(fr.getFile().getName(), fr.getFile());
+ MultiTextEdit root = new MultiTextEdit();
+ fileChange.setEdit(root);
+ rootChange.add(fileChange);
+ for(int position : fr.getPositions()){
+ TextEdit edit = new ReplaceEdit(position, oldName.length(), newName);
+ fileChange.addEdit(edit);
+ }
+ }
+
+ }
return status;
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/messages.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/messages.properties 2010-07-21 11:41:37 UTC (rev 23634)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/messages.properties 2010-07-21 12:08:00 UTC (rev 23635)
@@ -33,4 +33,5 @@
DONT_SHOW_CHECKER_DIALOG=Do not show this dialog again!
MISSING_NATURES_INFO_MESSAGE_TITLE=Missing Natures
SKIP_BUTTON_LABEL=Skip
-MESSAGES_FILE_RENAME_PARTICIPANT_UPDATE_MESSAGE_BUNDLE_REFERENCES=Update Message Bundle References
\ No newline at end of file
+MESSAGES_FILE_RENAME_PARTICIPANT_UPDATE_MESSAGE_BUNDLE_REFERENCES=Update Message Bundle References
+MESSAGES_FILE_RENAME_PARTICIPANT_FILE_NAME_SHOULD_BE_WITH_THE_SAME_EXTENSION=New file name should be with the same extension
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/SearchUtil.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/SearchUtil.java 2010-07-21 11:41:37 UTC (rev 23634)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/SearchUtil.java 2010-07-21 12:08:00 UTC (rev 23635)
@@ -22,7 +22,13 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.internal.ui.text.FastJavaPartitionScanner;
+import org.eclipse.jdt.ui.text.IJavaPartitions;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.Token;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
@@ -100,10 +106,10 @@
// searching java, xml and property files in source folders
if(javaProject != null){
for(IResource resource : EclipseResourceUtil.getJavaSourceRoots(project)){
- //if(resource instanceof IFolder)
- //scanForJava((IFolder) resource);
- //else if(resource instanceof IFile)
- //scanForJava((IFile) resource);
+ if(resource instanceof IFolder)
+ scanForJava((IFolder) resource);
+ else if(resource instanceof IFile)
+ scanForJava((IFile) resource);
}
}
}
@@ -154,6 +160,19 @@
}
}
+ private void scanForJava(IContainer container){
+ try{
+ for(IResource resource : container.members()){
+ if(resource instanceof IFolder)
+ scanForJava((IFolder) resource);
+ else if(resource instanceof IFile)
+ scanForJava((IFile) resource);
+ }
+ }catch(CoreException ex){
+ ELCorePlugin.getDefault().logError(ex);
+ }
+ }
+
private void scan(IFile file){
if(isFileCorrect(file)) {
String fileContent=null;
@@ -169,6 +188,21 @@
}
}
}
+
+ private void scanForJava(IFile file){
+ if(isFileCorrect(file)) {
+ String fileContent=null;
+ try {
+ fileContent = FileUtil.readStream(file);
+ } catch (CoreException e) {
+ ELCorePlugin.getDefault().logError(e);
+ }
+ String ext = file.getFileExtension();
+ if(JAVA_EXT.equalsIgnoreCase(ext)) {
+ scanInJava(file, fileContent);
+ }
+ }
+ }
private boolean scanInDOM(IFile file, String content){
@@ -222,6 +256,34 @@
return false;
}
+ private boolean scanInJava(IFile file, String content){
+ try {
+ FastJavaPartitionScanner scaner = new FastJavaPartitionScanner();
+ Document document = new Document(content);
+ scaner.setRange(document, 0, document.getLength());
+ IToken token = scaner.nextToken();
+ while(token!=null && token!=Token.EOF) {
+ if(IJavaPartitions.JAVA_STRING.equals(token.getData())) {
+ int length = scaner.getTokenLength();
+ int offset = scaner.getTokenOffset();
+ String value = document.get(offset, length);
+ if(searchString.equals(value)){
+ if(lastResult == null || !lastResult.getFile().equals(file)){
+ lastResult = new FileResult(file);
+ result.getEntries().add(lastResult);
+ }
+
+ lastResult.addPosition(length);
+ }
+ }
+ token = scaner.nextToken();
+ }
+ } catch (BadLocationException e) {
+ WebKbPlugin.getDefault().logError(e);
+ }
+ return false;
+ }
+
private boolean scanNodeContent(IFile file, IStructuredDocumentRegion node, String regionType) {
boolean status = false;
@@ -230,16 +292,22 @@
ITextRegionList regions = node.getRegions();
for(int i=0; i<regions.size(); i++) {
+ String tempSearchString = searchString;
+ int delta = 0;
ITextRegion region = regions.get(i);
if(region.getType() == regionType) {
- String text = node.getFullText(region).trim();
- if(searchString.equals(text)){
+ String text = node.getFullText(region);
+ if(text.startsWith("\"")){
+ tempSearchString = "\""+tempSearchString;
+ delta = 1;
+ }
+ if(text.startsWith(tempSearchString)){
if(lastResult == null || !lastResult.getFile().equals(file)){
lastResult = new FileResult(file);
result.getEntries().add(lastResult);
}
- lastResult.addPosition(node.getStartOffset()+region.getStart());
+ lastResult.addPosition(node.getStartOffset()+region.getStart()+delta);
}
}
}
15 years, 9 months
JBoss Tools SVN: r23634 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-07-21 07:41:37 -0400 (Wed, 21 Jul 2010)
New Revision: 23634
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java
Log:
https://jira.jboss.org/browse/JBIDE-6610
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2010-07-21 11:20:03 UTC (rev 23633)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2010-07-21 11:41:37 UTC (rev 23634)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.seam.core;
+import java.io.IOException;
import java.util.Map;
import org.eclipse.core.resources.IProject;
@@ -60,6 +61,13 @@
long end = System.currentTimeMillis();
seamProject.fullBuildTime += end - begin;
+ try {
+ //It is important to save results of build right after the build is done.
+ //Otherwise, at Eclipse restart, the results can be lost.
+ seamProject.store();
+ } catch (IOException e) {
+ SeamCorePlugin.getDefault().logError(e);
+ }
seamProject.postBuild();
} finally {
15 years, 9 months
JBoss Tools SVN: r23633 - in trunk: jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-07-21 07:20:03 -0400 (Wed, 21 Jul 2010)
New Revision: 23633
Modified:
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuvnorRepositoriesTest.java
trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
Log:
Fixes for JBT 3.2.0.M1
Modified: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuvnorRepositoriesTest.java
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuvnorRepositoriesTest.java 2010-07-21 10:14:01 UTC (rev 23632)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/GuvnorRepositoriesTest.java 2010-07-21 11:20:03 UTC (rev 23633)
@@ -27,6 +27,7 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.hamcrest.Matcher;
@@ -35,6 +36,7 @@
import org.jboss.tools.ui.bot.ext.config.requirement.RequirementNotFulfilledException;
import org.jboss.tools.ui.bot.ext.config.requirement.StartServer;
import org.jboss.tools.ui.bot.ext.config.requirement.StopServer;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
import org.jboss.tools.ui.bot.ext.gen.ActionItem.View.GuvnorGuvnorResourceHistory;
import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
import org.jboss.tools.ui.bot.ext.helper.DragAndDropHelper;
@@ -67,6 +69,7 @@
*/
@Test
public void testGuvnorRepositories() {
+ setGuvnorTemplate();
startGuvnor();
addGuvnorRepository();
deleteGuvnorRepository();
@@ -194,6 +197,8 @@
new String[] {DroolsAllBotTests.DROOLS_PROJECT_NAME});
DragAndDropHelper.dragAndDropOnTo(tiGuvnorFile.widget,tiDroolRuleDir.widget);
bot.sleep(Timing.time5S());
+ bot.shell(IDELabel.Shell.COPY_FILE_FROM_GUVNOR_TO_PACKAGE_EXPLORER).activate();
+ bot.button(IDELabel.Button.OK).click();
SWTBotTree packageExplorerTree = packageExplorerBot.tree();
// File is renamed because there is appended Guvnor info to Tree Item Label
// So we need to get real label of Tree Item and use it later
@@ -256,6 +261,7 @@
new String[]{IDELabel.GuvnorRepositories.GUVNOR_REPOSITORY_ROOT_TREE_ITEM,
IDELabel.GuvnorRepositories.PACKAGES_TREE_ITEM})
.select();
+ bot.sleep(Timing.time5S());
addToGuvnorDialogBot.button(IDELabel.Button.FINISH).click();
eclipse.waitForClosedShell(addToGuvnorShell);
boolean isAddedToGuvnorRepository = false;
@@ -505,4 +511,14 @@
"Content should start with " + addedChange +
"\n but is " + editorText,editorText.startsWith(addedChange));
}
+ /**
+ * Sets properly Guvnor Template
+ */
+ private void setGuvnorTemplate(){
+ SWTBot dialogBot = open.preferenceOpen(ActionItem.Preference.Guvnor.LABEL);
+ SWTBotText guvnorTemplateText = dialogBot.textWithLabel(IDELabel.GuvnorPropertiesDialog.GUVNOR_URL_TEMPLATE);
+ guvnorTemplateText.setText(guvnorTemplateText.getText().replaceFirst("jboss-brms", "drools-guvnor"));
+ dialogBot.button(IDELabel.Button.OK).click();
+ SWTEclipseExt.hideWarningIfDisplayed(bot);
+ }
}
\ No newline at end of file
Modified: trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java
===================================================================
--- trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java 2010-07-21 10:14:01 UTC (rev 23632)
+++ trunk/drools/tests/org.jboss.tools.drools.ui.bot.test/src/org/jboss/tools/drools/ui/bot/test/smoke/ManageDroolsProject.java 2010-07-21 11:20:03 UTC (rev 23633)
@@ -15,6 +15,7 @@
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
+import org.jboss.tools.ui.bot.ext.Timing;
import org.jboss.tools.ui.bot.ext.helper.FileRenameHelper;
import org.jboss.tools.ui.bot.ext.types.EntityType;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
@@ -74,8 +75,7 @@
bot.button(IDELabel.Button.NEXT).click();
bot.button(IDELabel.Button.FINISH).click();
SWTTestExt.util.waitForAll(30*1000L);
- jbt.delay();
-
+ bot.sleep(Timing.time5S());
assertTrue("Project "
+ droolsProjectName
+ " was not created properly.",SWTEclipseExt.isProjectInPackageExplorer(bot,droolsProjectName));
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-07-21 10:14:01 UTC (rev 23632)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-07-21 11:20:03 UTC (rev 23633)
@@ -136,6 +136,7 @@
public static final String CONFIRM_DELETE = "Confirm Delete";
public static final String SHOW_VIEW = "Show View";
public static final String PROPERTIES_FOR = "Properties for";
+ public static final String COPY_FILE_FROM_GUVNOR_TO_PACKAGE_EXPLORER = "File Operation";
}
public class EntityGroup {
@@ -477,7 +478,7 @@
public static final String ADD_GUVNOR_REPOSITORY_TOOLTIP = "Add a Guvnor respository connection";
public static final String REMOVE_GUVNOR_REPOSITORY_TOOLTIP = "Delete Guvnor repository connection";
public static final String REMOVE_GUVNOR_REPOSITORY_DIALOG_TITLE = "Remove repository connection";
- public static final String GUVNOR_REPOSITORY_ROOT_TREE_ITEM = "http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/webdav";
+ public static final String GUVNOR_REPOSITORY_ROOT_TREE_ITEM = "http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/webdav/";
public static final String PACKAGES_TREE_ITEM = "packages/";
public static final String MORTGAGE_TREE_ITEM = "mortgages/";
public static final String GO_INTO_GUVNOR_REPOSITORY_TOOLTIP = "Go Into";
@@ -505,4 +506,10 @@
}
}
+
+ public static class GuvnorPropertiesDialog {
+
+ public static final String GUVNOR_URL_TEMPLATE = "Guvnor URL template: ";
+
+ }
}
15 years, 9 months
JBoss Tools SVN: r23632 - in trunk: jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-07-21 06:14:01 -0400 (Wed, 21 Jul 2010)
New Revision: 23632
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ElCoreMessages.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/messages.properties
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameMessagePropertyProcessor.java
Log:
https://jira.jboss.org/browse/JBIDE-4858
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ElCoreMessages.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ElCoreMessages.java 2010-07-21 10:05:28 UTC (rev 23631)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ElCoreMessages.java 2010-07-21 10:14:01 UTC (rev 23632)
@@ -29,6 +29,7 @@
public static String RENAME_EL_VARIABLE_PROCESSOR_TITLE;
public static String RENAME_MESSAGE_PROPERTY_PROCESSOR_TITLE;
public static String RENAME_EL_VARIABLE_PROCESSOR_CAN_NOT_FIND_EL_VARIABLE;
+ public static String RENAME_MESSAGE_PROPERTY_PROCESSOR_CAN_NOT_FIND_MESSAGE_PROPERTY;
static {
// initialize resource bundle
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/messages.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/messages.properties 2010-07-21 10:05:28 UTC (rev 23631)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/messages.properties 2010-07-21 10:14:01 UTC (rev 23632)
@@ -22,4 +22,5 @@
RENAME_EL_VARIABLE_PROCESSOR_TITLE=Rename EL Variable
RENAME_MESSAGE_PROPERTY_PROCESSOR_TITLE=Rename Resource Bundle Message
RENAME_EL_VARIABLE_PROCESSOR_CAN_NOT_FIND_EL_VARIABLE=Can not find EL Variable: ''{0}''.
+RENAME_MESSAGE_PROPERTY_PROCESSOR_CAN_NOT_FIND_MESSAGE_PROPERTY=Can not find message: ''{0}''.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameMessagePropertyProcessor.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameMessagePropertyProcessor.java 2010-07-21 10:05:28 UTC (rev 23631)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RenameMessagePropertyProcessor.java 2010-07-21 10:14:01 UTC (rev 23632)
@@ -26,6 +26,7 @@
import org.eclipse.text.edits.ReplaceEdit;
import org.eclipse.text.edits.TextEdit;
import org.jboss.tools.common.el.core.ELReference;
+import org.eclipse.ltk.internal.core.refactoring.Messages;
import org.jboss.tools.common.el.core.ElCoreMessages;
import org.jboss.tools.common.el.core.model.ELExpression;
import org.jboss.tools.common.el.core.resolver.ELCompletionEngine;
@@ -87,11 +88,22 @@
throws CoreException, OperationCanceledException {
RefactoringStatus result = new RefactoringStatus();
- //if(findManagedBean(file, getOldName()) == null)
- //result.addFatalError(Messages.format(ElCoreMessages.RENAME_EL_VARIABLE_PROCESSOR_CAN_NOT_FIND_EL_VARIABLE, getOldName()));
+ if(!validateSegment())
+ result.addFatalError(Messages.format(ElCoreMessages.RENAME_MESSAGE_PROPERTY_PROCESSOR_CAN_NOT_FIND_MESSAGE_PROPERTY, getOldName()));
return result;
}
+ private boolean validateSegment(){
+ if(segment.getMessageBundleResource() == null)
+ return false;
+ if(segment.getToken() == null)
+ return false;
+ if(segment.getBaseName() == null || segment.getBaseName().isEmpty())
+ return false;
+
+ return true;
+ }
+
/*
* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#createChange(org.eclipse.core.runtime.IProgressMonitor)
15 years, 9 months