JBoss Tools SVN: r24035 - trunk/esb/plugins/org.jboss.tools.esb.core/schemas.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-08-11 05:08:17 -0400 (Wed, 11 Aug 2010)
New Revision: 24035
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/schemas/jbossesb-1.3.0.xsd
Log:
https://jira.jboss.org/browse/JBIDE-6615
Added: trunk/esb/plugins/org.jboss.tools.esb.core/schemas/jbossesb-1.3.0.xsd
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/schemas/jbossesb-1.3.0.xsd (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/schemas/jbossesb-1.3.0.xsd 2010-08-11 09:08:17 UTC (rev 24035)
@@ -0,0 +1,2184 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Generated by Turbo XML 2.4.1.100. Conforms to w3c http://www.w3.org/2001/XMLSchema-->
+<xsd:schema
+ xmlns:jesb="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml..."
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ targetNamespace="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml...">
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ Document root + some basic types.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+
+ <xsd:element name="jbossesb">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The jbossesb configuration for a single instance.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:globals" />
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:providers" />
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:services" />
+ </xsd:sequence>
+ <xsd:attribute default="180" name="parameterReloadSecs"
+ use="optional" />
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="property">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A simple name-value pair.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="xsd:anyType">
+ <xsd:attribute name="name" type="xsd:string"
+ use="required" />
+ <xsd:attribute name="value" type="xsd:string" />
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="globals">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A container for the configurations global to a jbossesb config file
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="war-security" minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Security configuration that is global to the jboss-esb.xml file.
+ These configuration settings are shared for all http-providers and EBWS that are defined in jboss-esb.xml.Domain.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:attribute name="method" use="optional" default="BASIC">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="BASIC" />
+ <xsd:enumeration value="DIGEST" />
+ <xsd:enumeration value="CLIENT-CERT" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="domain" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">Security Domain.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ Provider and Bus base types.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+
+ <xsd:element name="providers">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A container for the providers referenced in the jbossesb
+ config file
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ ref="jesb:provider" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:complexType abstract="true" name="provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Abstract provider.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ ref="jesb:property" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ <xsd:element abstract="true" name="provider" type="jesb:provider" />
+
+ <xsd:complexType name="bus-provider">
+ <xsd:complexContent>
+ <xsd:extension base="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A provider of a bus. So for instance you can
+ have a jms-provider (JBossMQ) or an
+ ftp-provider.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="1"
+ ref="jesb:bus" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ <xsd:element name="bus-provider"
+ substitutionGroup="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Generic Bus Provider.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus-provider" />
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:complexType name="bus">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A bus (also called "channel" by others) is a means by
+ which Services communicate with each other (JMS, FTP,
+ HTTP, etc).
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ ref="jesb:property" />
+ </xsd:sequence>
+ <xsd:attribute name="busid" type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ An id such that this bus can be referenced by
+ Service listn.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ <xsd:element name="bus" type="jesb:bus" />
+
+ <xsd:element name="schedule-provider"
+ substitutionGroup="jesb:provider">
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:provider">
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="1"
+ ref="jesb:schedule" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:complexType abstract="true" name="schedule">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Schedule Configuration.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ ref="jesb:property" />
+ </xsd:sequence>
+ <xsd:attribute name="scheduleid" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ An id such that this schedule can be referenced by
+ Service listner.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="startDate" type="xsd:dateTime"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Schedule start time and date.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="endDate" type="xsd:dateTime"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Schedule end time and date.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ <xsd:element abstract="true" name="schedule" type="jesb:schedule" />
+
+ <xsd:element name="simple-schedule"
+ substitutionGroup="jesb:schedule">
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:schedule">
+ <xsd:attribute name="frequency" use="optional" type="xsd:long" default="10">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">Schedule frequency.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="frequencyUnits" use="optional" type="jesb:frequency-unit" default="seconds">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">Schedule frequency time units.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="-1" name="execCount" type="xsd:int" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Schedule execution count. -1 to execute indefinitely.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:simpleType name="frequency-unit">
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="seconds"/>
+ <xsd:enumeration value="milliseconds"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:element name="cron-schedule"
+ substitutionGroup="jesb:schedule">
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:schedule">
+ <xsd:attribute name="cronExpression"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Schedule CRON expression.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ Service and Action types.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+
+ <xsd:element name="services">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A container for services.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="1"
+ ref="jesb:service" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="service">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A service has listener or gateways and a list of
+ actions.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0" ref="jesb:security" />
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ ref="jesb:property" />
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:listeners" />
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:actions" />
+ </xsd:sequence>
+ <xsd:attribute name="category"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The service category which will be used to store
+ a reference to this service in the registry.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string">
+ <xsd:maxLength value="255"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="name"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The service name which will be used to store a
+ reference to this service in the registry.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string">
+ <xsd:maxLength value="255"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="description"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The service description which stored with this
+ service in the registry, so that the purpose of
+ this service can be understood by a human.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string">
+ <xsd:maxLength value="255"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="alertTimeThreshold"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A value used for monitoring to produce alerts
+ if the service takes longer to complete than
+ the value of the field.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:decimal"/>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="alertLengthThreshold"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A value used for monitoring to produce alerts
+ if the service takes longer to complete than
+ the value of the field.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:decimal"/>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="invmScope" type="jesb:invmScope" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ All services are locally invokable over an "in VM" transport. Invokability
+ can be scoped using this attribute. An "invmScope" value of "NONE" means that
+ the Service should not be locally invokable over the "in VM" transport.
+ More fine grained scoping will be added in the future.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="invmTransacted" type="xsd:boolean">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Should the InVM listener execute in a transacted environment?
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:simpleType name="invmScope">
+ <xsd:restriction base="xsd:NMTOKEN">
+ <!-- Not invokable over InVM -->
+ <xsd:enumeration value="NONE" />
+
+ <!-- Invokable over InVM only from within the same/local deployment. -->
+ <!-- xsd:enumeration value="LOCAL" / -->
+
+ <!-- (DEFAULT) Invokable over InVM from within the same classloader scope. -->
+ <xsd:enumeration value="GLOBAL" />
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:simpleType name="mepType">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="RequestResponse" />
+ <xsd:enumeration value="OneWay" />
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:element name="actions">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A container for actions belonging to this service.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="1"
+ ref="jesb:action" />
+ </xsd:sequence>
+ <xsd:attribute name="mep" type="jesb:mepType" />
+ <xsd:attribute name="inXsd" type="xsd:string" />
+ <xsd:attribute name="outXsd" type="xsd:string" />
+ <xsd:attribute name="requestLocation" type="xsd:string"/>
+ <xsd:attribute name="responseLocation" type="xsd:string"/>
+ <xsd:attribute name="faultXsd" type="xsd:string" />
+ <xsd:attribute name="webservice" type="xsd:boolean" default="true"/>
+ <xsd:attribute name="validate" type="xsd:boolean" default="false"/>
+ <xsd:attribute name="addressing" type="xsd:boolean" default="false"/>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="action">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ An action which will act on the message when it is
+ received by the service. Actions can be chained. Hence
+ you can specify a list of actions. Action are
+ 'pluggable' and can be custom code, however JBossESB
+ comes with a list of predefined actions.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ ref="jesb:property" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The logical name of the action.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="class" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The full classname of the java class in which
+ this action is defined.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="process" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The name of the method on the action that needs
+ to be called when the message is received.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="alertTimeThreshold"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A value used for monitoring to produce alerts
+ if the service takes longer to complete than
+ the value of the field.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:decimal"/>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="alertLengthThreshold"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A value used for monitoring to produce alerts
+ if the service takes longer to complete than
+ the value of the field.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:decimal"/>
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="security">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" ref="jesb:property" />
+ </xsd:sequence>
+ <xsd:attribute name="runAs" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Is used to specify that a specific security role given by the role-name value should be used
+ as the security identity for this service.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="rolesAllowed" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Specifies one or more logical roles that are allowed to acccess the service.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="moduleName" type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="useCallerIdentity" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Is used to indicate that the current caller's identity should be propagated as the security identity
+ this service.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="callbackHandler" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ CallbackHandler implementation class. This will override the global callbackhandler
+ which can be specified in jbossesb-properties.xml
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ Listener base types.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+
+ <xsd:element name="listeners">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A container for all listener for a service.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="1"
+ ref="jesb:abstract-listener" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:complexType name="listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A listener is a listener or a gateway. The listener
+ defines to which bus the service is listening. The
+ service can simultaneniously listen to multiple buses.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ ref="jesb:property" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The logical name of the listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="$not-defined$" name="busidref"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A reference to an existing bus, as defined in the
+ 'buses' section of this jbossesb config.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+
+ <xsd:complexType abstract="true" name="gateway-only-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Listener type that can only act as a message-unaware listener (gateway) .
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:listener" />
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="dual-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Listener type that can act as both a message-aware and message-unaware listener (gateway).
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:listener">
+ <xsd:attribute default="1" name="maxThreads" type="xsd:int" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The number of threads which will be started for this
+ listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="false" name="is-gateway" type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ true if the listener is a gateway. A gateway is an
+ ESB-Unware listener, while a listener is ESB-aware
+ and as such expects jbossesb formatted messages.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:element name="abstract-listener" type="jesb:listener" abstract="true"/>
+
+ <xsd:element name="listener" type="jesb:dual-listener" substitutionGroup="jesb:abstract-listener"/>
+
+ <xsd:complexType abstract="true"
+ name="abstract-scheduled-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Abstract scheduled listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:dual-listener">
+ <xsd:attribute default="-1"
+ name="poll-frequency-seconds" type="xsd:int" use="optional">
+<!-- Purposely defaults to -1 -->
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ DEPRECATED (use "schedule-frequency" or
+ "scheduleidref"): The frequency with which
+ this listener is scheduled (in seconds).
+ Defaults to 10 seconds.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="-1" name="schedule-frequency"
+ type="xsd:int" use="optional">
+<!-- Purposely defaults to -1 -->
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The frequency with which this listener is
+ scheduled (in seconds). Defaults to 10
+ seconds.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="scheduleidref" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The id reference for the schedule that's
+ driving this scheduled listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:element name="scheduled-listener"
+ substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Scheduled listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension
+ base="jesb:abstract-scheduled-listener">
+ <xsd:attribute name="event-processor"
+ type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Message Composer class name.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="transacted"
+ type="xsd:boolean">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Should the schedule execute in a
+ transacted environment?
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- JCA Types -->
+ <xsd:element name="activation-config">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Activation configuration for jca bus or listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="1"
+ ref="jesb:property" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="jca-gateway" substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific gateway using JCA inflow.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:gateway-only-listener">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:activation-config" />
+ </xsd:sequence>
+ <xsd:attribute name="adapter" type="xsd:string"
+ use="required" />
+ <xsd:attribute name="endpointClass"
+ type="xsd:string" use="required" />
+ <xsd:attribute name="messagingType"
+ type="xsd:string" use="optional" />
+ <xsd:attribute name="jcaBridge" type="xsd:string"
+ use="optional" />
+ <xsd:attribute name="transacted" type="xsd:boolean"
+ use="optional" />
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ JMS Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+
+ <xsd:element name="jms-message-filter">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A JMS filter can add information to a Queue, or Topic.
+ For example you can defined a message-selector. However,
+ you can also push the queue name and type into this
+ filter given you did not already specify them in the
+ jms-bus.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:attribute name="dest-name" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Name of the Queue of Topic.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="dest-type" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A Queue delivers a message once, a topic
+ broadcasts a message to all registered
+ listeners.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="QUEUE" />
+ <xsd:enumeration value="TOPIC" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="selector" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A message-selector allows multiple listeners to
+ register with the same queue/topic, but they
+ will filter on this message-selector.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="true" name="persistent"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If false, JMS messages will be sent
+ non-persistent. Default is to send messages with
+ DeliveryMode.PERSISTENT.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="AUTO_ACKNOWLEDGE"
+ name="acknowledge-mode" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ JMS Session acknowledge mode. Can be on of
+ AUTO_ACKNOWLEDGE (default), CLIENT_ACKNOWLEDGE,
+ or DUPS_OK_ACKNOWLEDGE.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute
+ name="jms-security-principal" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ JMS destination username. Will be used when creating a connection
+ to the destination.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute
+ name="jms-security-credential" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ JMS destination password. Will be used when creating a connection
+ to the destination. Will be ignored if username is not specified.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="false" name="transacted"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, JMS sessions will be transaction aware.
+ Default is false.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="jms-bus" substitutionGroup="jesb:bus">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A JMS-Bus is a specific instance of a bus using the JMS
+ protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:jms-message-filter" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:complexType name="jms-provider-type">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific instance of a provider, providing JMS.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus-provider">
+ <xsd:attribute name="connection-factory"
+ type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The connection-factory used to lookup
+ queues/topics in a naming directory (JNDI)
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="jndi-context-factory"
+ type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The context factory class the JBossESB will
+ use to do naming lookups.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="jndi-pkg-prefix"
+ type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The pkg-prefix which will be used to do
+ naming lookups. It is left empty by default.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="jndi-URL" type="xsd:anyURI">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The URL used to do naming lookups.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ <xsd:element name="jms-provider" substitutionGroup="jesb:provider"
+ type="jesb:jms-provider-type" />
+
+ <xsd:element name="jms-jca-provider"
+ substitutionGroup="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific instance of a provider, providing JMS through
+ JCA inflow.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:jms-provider-type">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:activation-config" />
+ </xsd:sequence>
+ <xsd:attribute name="adapter" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The artifact containing the resource
+ adapter.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="endpointClass"
+ type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The class name of the JCA endpoint.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="messagingType"
+ type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The class name of the messaging specific
+ interface.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="jcaBridge" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The class name of the JCA Bridge.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="transacted"
+ type="xsd:boolean">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The transacted flag.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="providerAdapterJNDI" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The JNDI location of an alternate provider adapter
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="jms-listener"
+ substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific listener using the jms protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:dual-listener">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:jms-message-filter" />
+ </xsd:sequence>
+ <xsd:attribute name="clientId" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Client ID to be associated with the connection. Used to associate a connection and its objects with
+ state maintained on behalf of the client by a provider e.g. durable subscriptions.
+ <p/>
+ If a clientId is required (e.g. when a 'durableSubscriptionName' is specified), but is not specified,
+ it will default to the listener name.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="durableSubscriptionName" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Durable subscription name. Only relevant for JMS Topics.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ FS Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+ <xsd:element name="fs-message-filter">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A FS filter.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:attribute name="directory" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file share that is monitored for incoming
+ new files.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="input-suffix" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file suffix used to filter files targeted
+ for comsumption by the ESB (note: add the dot,
+ so something like '.esbIn').
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default=".esbInProcess" name="work-suffix"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file suffix used while the file is being
+ process, so that another thread or process won't
+ pick it up too.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="true" name="post-delete"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, the file will be deleted after it is
+ processed. Note that in that case post-directory
+ and post-suffix have no effect.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="true" name="post-rename"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, the file will be renamed after it is
+ processed. Note that in that case post-directory
+ and post-suffix have no effect.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="processed" name="post-directory"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file share to which the file will be moved
+ after it is processed by the ESB
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default=".esbDone" name="post-suffix"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file suffix which will be added to the file
+ name after it is processed.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="true" name="error-delete"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, the file will be deleted if an error
+ occurs during processing. Note that in that case
+ error-directory and error-suffix have no effect.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="processed" name="error-directory"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file share to which the file will be moved
+ after when an error occurs during processing.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default=".esbERROR" name="error-suffix"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file suffix which will be added to the file
+ name after an error occurs during processing.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="fs-bus" substitutionGroup="jesb:bus">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A Fs-Bus is a specific instance of a bus using the File
+ protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:fs-message-filter" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="fs-provider" substitutionGroup="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific instance of a provider, providing a file
+ system (local fileshare or NAS).
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus-provider" />
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="fs-listener" substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific listener using the file protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension
+ base="jesb:abstract-scheduled-listener">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:fs-message-filter" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ FTP Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+ <xsd:element name="ftp-message-filter">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A FTP filter.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:attribute name="directory" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The ftp directory that is monitored for incoming
+ new files.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="username" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The username used to access the ftp server
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="password" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The password used to access the ftp server.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="input-suffix" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file suffix used to filter files targeted
+ for comsumption by the ESB (note: add the dot,
+ so something like '.esbIn').
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default=".esbInProcess" name="work-suffix"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file suffix used while the file is being
+ process, so that another thread or process won't
+ pick it up too.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="true" name="post-delete"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, the file will be deleted after it is
+ processed. Note that in that case post-directory
+ and post-suffix have no effect.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="true" name="post-rename"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, the file will be renamed after it is
+ processed. Note that in that case post-directory
+ and post-suffix have no effect.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="post-directory" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The ftp directory to which the file will be
+ moved after it is processed by the ESB
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default=".esbDone" name="post-suffix"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file suffix which will be added to the file
+ name after it is processed.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="true" name="error-delete"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, the file will be deleted if an error
+ occurs during processing. Note that in that case
+ error-directory and error-suffix have no effect.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="processed" name="error-directory"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The ftp directory to which the file will be
+ moved after when an error occurs during
+ processing.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default=".esbERROR" name="error-suffix"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The file suffix which will be added to the file
+ name after an error occurs during processing.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="passive" type="xsd:boolean"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ This is an ftp server setting which may vary per
+ session.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="ftp" name="protocol"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The protocol, can be sftp (SSH File Transfer
+ Protocol), ftps (FTP over SLL) and ftp (to which
+ it defaults).
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="ftp" />
+ <xsd:enumeration value="ftps" />
+ <xsd:enumeration value="sftp" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="certificate-url" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The url to a public server certificate for ftps, or to a
+ private certificate for sftp client verification. sftp certificate
+ can be located via a resource.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="certificate-name" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The common name of a certificate, which may be needed
+ for ftps.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="certificate-passphrase" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The passphrase of the private key, if necessary, for sftp client verification.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="false" name="read-only"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, the ftp server does not permit write
+ opertations on files. Note that in this case the
+ following properties have no effect:
+ work-suffix, post-delete, post-directory,
+ post-suffix, error-delete, error-directory, and
+ error-suffix.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="ftp-bus" substitutionGroup="jesb:bus">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A FTP-Bus is a specific instance of a bus using the FTP
+ protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:ftp-message-filter" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="ftp-provider"
+ substitutionGroup="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific instance of a provider, providing a ftp
+ service.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus-provider">
+ <xsd:attribute name="hostname" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The ftp hostname, as it can be resolved
+ by DNS.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="ftp-listener"
+ substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific listener using the ftp protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension
+ base="jesb:abstract-scheduled-listener">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:ftp-message-filter" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ SQL Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+ <xsd:element name="sql-message-filter">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A SQL filter.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:attribute name="tablename" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The table in which esb message are stored.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="message-id-column"
+ type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A unique key (PK) in the table.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="retry-count-column" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Column name for storing the message delivery retry count.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="message-column"
+ type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The field that holds the serialized message.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="status-column"
+ type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ This column contents ('P', 'W', 'E' or 'D')
+ indicates if the row is pending (P), in process
+ (W), in error(E) or done (D) if postDelete
+ and/or errorDelete are 'true' rows might be
+ deleted
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="where-condition" use="optional"
+ type="xsd:string" default="">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A where clause, not including the word where,
+ which is applied to the query.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="order-by" use="optional"
+ type="xsd:string" default="">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A where clause, not including the word where,
+ which is applied to the query.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="insert-timestamp-column" use="optional"
+ type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Holds the timestamp when the record was
+ inserted.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="true" name="post-delete"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, records will be deleted after
+ processing.((e.g. no rows with a 'D' for done,
+ in column defined in 'status_column')
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="true" name="error-delete"
+ type="xsd:boolean" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ If true, records in error will be deleted after
+ attempted picked up for processing.(e.g. no rows
+ with a 'E' for error, in column defined in
+ 'status_column')
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="sql-bus" substitutionGroup="jesb:bus">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A SQL-Bus is a specific instance of a bus using the SQL
+ protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:sql-message-filter" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="sql-provider"
+ substitutionGroup="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific instance of a provider, providing a db
+ service.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus-provider">
+ <xsd:attribute name="datasource" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The name of the datasource.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="url" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The url needed to connect to the db.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="driver" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The driver needed to connect to the db.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="username" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The username used to access the
+ database.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="password" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The password used to access the
+ database.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="transacted"
+ type="xsd:boolean">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The transacted flag.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="sql-listener"
+ substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific listener using the SQL protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:dual-listener">
+ <xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0"
+ ref="jesb:sql-message-filter" />
+ </xsd:sequence>
+ <xsd:attribute default="10"
+ name="poll-frequency-seconds" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The frequency with which this listener
+ polls the db in seconds. Defaults to 10
+ seconds.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:integer">
+ <xsd:minExclusive value="0" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ Hibernate Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+ <xsd:element name="hibernate-message-filter">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A Hibernate filter.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:attribute name="classname" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The class name to monitor.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="message_id" name="event"
+ type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A comma-separated list of events to intercept.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="hibernate-bus" substitutionGroup="jesb:bus">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A hibernate-bus is a specific instance of a bus using
+ the Hibernate protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus">
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="1"
+ ref="jesb:hibernate-message-filter" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="hibernate-provider"
+ substitutionGroup="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific instance of a provider, providing a hibernate
+ service.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus-provider">
+ <xsd:attribute name="hibernate-cfg-file"
+ type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The Hibernate configuration file to use.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="hibernate-listener"
+ substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ A specific listener using the hibernate protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:dual-listener">
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ ref="jesb:hibernate-message-filter" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ JBoss Remoting Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+ <xsd:element name="jbr-bus" substitutionGroup="jesb:bus">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ JBoss Remoting Bus
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus">
+ <xsd:attribute name="port" type="xsd:int"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ JBoss Remoting Server listen port.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="jbr-provider"
+ substitutionGroup="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ JBoss Remoting Provider.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus-provider">
+ <xsd:attribute name="protocol" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Jboss Remoting Listener/Server protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="http" />
+ <xsd:enumeration value="https" />
+ <xsd:enumeration value="socket" />
+ <xsd:enumeration value="sslsocket" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="host" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ JBoss Remoting Server bind address. When
+ not specified, defaults to
+ InetAddress.getLocalHost().getHostName().
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="jbr-listener"
+ substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ JBoss Remoting Listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:dual-listener" />
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ Http Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+ <xsd:element name="http-bus" substitutionGroup="jesb:bus">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Http Bus
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus">
+ <xsd:choice minOccurs="0" maxOccurs="2">
+ <xsd:element name="protected-methods" minOccurs="0" maxOccurs="1">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="method" minOccurs="1" maxOccurs="5">
+ <xsd:complexType>
+ <xsd:attribute name="name" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="GET" />
+ <xsd:enumeration value="POST" />
+ <xsd:enumeration value="PUT" />
+ <xsd:enumeration value="DELETE" />
+ <xsd:enumeration value="HEAD" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="allowed-roles" minOccurs="0" maxOccurs="1">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="role" minOccurs="1" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ <xsd:attribute name="transportGuarantee" use="optional">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="NONE" />
+ <xsd:enumeration value="INTEGRAL" />
+ <xsd:enumeration value="CONFIDENTIAL" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="http-provider"
+ substitutionGroup="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Http Provider.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus-provider">
+ <xsd:sequence>
+ <xsd:element name="exception" type="jesb:httpExceptionMappings" minOccurs="0" maxOccurs="1" />
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="http-gateway"
+ substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ http Listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:gateway-only-listener">
+ <xsd:choice minOccurs="0" maxOccurs="2">
+ <xsd:element name="exception" type="jesb:httpExceptionMappings">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Exception to HTTP status code mappings.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="asyncResponse" type="jesb:asyncHttpResponse">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Aynchronous HTTP Response. If set, the gateway will asynchronously deliver the
+ message to the target Service.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:choice>
+ <xsd:attribute name="urlPattern" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The URL Pattern of requests to be filtered to this listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="payloadAs" type="jesb:payloadAs" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Set the ESB Message payload ass either a String or an array of bytes.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:simpleType name="payloadAs">
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="STRING"/>
+ <xsd:enumeration value="BYTES"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ <xsd:complexType name="httpExceptionMappings">
+ <xsd:sequence>
+ <xsd:element name="mapping" minOccurs="0" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:attribute name="class" type="xsd:string" use="required" />
+ <xsd:attribute name="status" type="xsd:integer" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="mappingsFile" type="xsd:string" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Path to a .properties file containing a list of Exception to HTTP Status code mappings.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ <xsd:complexType name="asyncHttpResponse">
+ <xsd:sequence>
+ <xsd:element name="payload" minOccurs="0" maxOccurs="1">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Static HTTP Gateway response payload for async message delivery to service.
+ <p/>
+ If not set, an empty (zero length) payload will be returned in the HTTP Response.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:attribute name="classpathResource" type="xsd:string" use="required" />
+ <xsd:attribute name="contentType" type="xsd:string" use="required" />
+ <xsd:attribute name="characterEncoding" type="xsd:string" use="optional" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ <xsd:attribute name="statusCode" type="xsd:int" default="200" use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Static HTTP Gateway response code for async message delivery to service.
+ <p/>
+ If not set, a 200 status (OK) will be returned in the HTTP Response.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ Groovy Gateway Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+ <xsd:element name="groovy-listener"
+ substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Groovy Listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:dual-listener">
+ <xsd:attribute name="script" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The path (classpath) to the Groovy
+ Gateway script. Or, the alias for the
+ pre-packaged Groovy Gateway script.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ UDP Gateway Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+ <xsd:element name="udp-listener" substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ UDP Listener that uses Mina.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:dual-listener">
+ <xsd:attribute name="host" type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The host that this listener will listen to.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="port" type="xsd:integer" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The port that this listener will listen to.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="handlerClass" type="xsd:string" use="optional" default="org.jboss.soa.esb.listeners.gateway.mina.DefaultMessageHandler">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The fully qualified name of a org.jboss.soa.esb.listeners.gateway.mina.MessageHandler implementation.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ Camel Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+ <xsd:element name="from">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Camel "from" element.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:attribute name="uri" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Camel "uri" attribute.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="camel-bus" substitutionGroup="jesb:bus">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Camel Bus
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus">
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ ref="jesb:from" />
+ </xsd:sequence>
+ <xsd:attribute name="from-uri" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Camel "from" URI.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="async" type="xsd:boolean"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Should the Service be invoked asynchronously?
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="timeout" type="xsd:long"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Synchronous Service invocation timeout.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="camel-provider"
+ substitutionGroup="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Camel Provider.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus-provider" />
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="camel-gateway"
+ substitutionGroup="jesb:abstract-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Camel Gateway.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:gateway-only-listener">
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0"
+ ref="jesb:from" />
+ </xsd:sequence>
+ <xsd:attribute name="from-uri" type="xsd:string"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Camel "from" URI.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="async" type="xsd:boolean"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Should the Service be invoked asynchronously?
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="timeout" type="xsd:long"
+ use="optional">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Synchronous Service invocation timeout.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+</xsd:schema>
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.core/schemas/jbossesb-1.3.0.xsd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 5 months
JBoss Tools SVN: r24033 - in workspace/rstryker/rse/as/plugins: org.jboss.ide.eclipse.as.rse.core and 30 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-08-11 04:53:06 -0400 (Wed, 11 Aug 2010)
New Revision: 24033
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.classpath
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.project
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.settings/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.settings/org.eclipse.jdt.core.prefs
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/META-INF/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/META-INF/MANIFEST.MF
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/build.properties
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.properties
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.xml
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSECorePlugin.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSESingleFilePublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEUtils.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.classpath
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.project
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.settings/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.settings/org.eclipse.jdt.core.prefs
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/META-INF/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/META-INF/MANIFEST.MF
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPageCallback.class
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$1.class
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$2.class
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$3.class
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$4.class
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$CustomSystemHostCombo$1.class
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$CustomSystemHostCombo.class
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite.class
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.class
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEUIPlugin.class
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/build.properties
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/plugin.xml
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPageCallback.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEUIPlugin.java
Log:
Separating RSE into own plugins
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.classpath
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.classpath (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.classpath 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.project
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.project (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.project 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.ide.eclipse.as.rse.core</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/.settings/org.eclipse.jdt.core.prefs 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,8 @@
+#Wed Aug 11 12:29:43 GMT+08:00 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/META-INF/MANIFEST.MF
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/META-INF/MANIFEST.MF (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/META-INF/MANIFEST.MF 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Core
+Bundle-SymbolicName: org.jboss.ide.eclipse.as.rse.core;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.ide.eclipse.as.rse.core.RSECorePlugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.rse.core,
+ org.eclipse.rse.subsystems.files.core,
+ org.eclipse.rse.services,
+ org.eclipse.rse.services.files.ftp,
+ org.eclipse.rse.services.local,
+ org.eclipse.rse.services.ssh,
+ org.jboss.ide.eclipse.as.core,
+ org.jboss.ide.eclipse.as.wtp.core,
+ org.eclipse.wst.server.core,
+ org.eclipse.wst.common.project.facet.core,
+ org.eclipse.core.resources,
+ org.eclipse.wst.common.modulecore,
+ org.eclipse.wst.common.emfworkbench.integration,
+ org.eclipse.jem.util,
+ org.jboss.ide.eclipse.archives.webtools;resolution:=optional
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.jboss.ide.eclipse.as.rse.core
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/build.properties
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/build.properties (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/build.properties 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties
+src.includes = plugin.properties,\
+ META-INF/
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.properties
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.properties (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.properties 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,4 @@
+AllJBossRuntimeTypes=org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42,org.jboss.ide.eclipse.as.runtime.50,org.jboss.ide.eclipse.as.runtime.51,org.jboss.ide.eclipse.as.runtime.60,org.jboss.ide.eclipse.as.runtime.eap.43,org.jboss.ide.eclipse.as.runtime.eap.50
+AllJBossServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50
+AllJBTServerTypes=org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.systemCopyServer
+ServerTypesJBoss6OrHigher=org.jboss.ide.eclipse.as.60
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.xml
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.xml (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/plugin.xml 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <!-- Below here is RSE stuff which can / should be moved if a new plugin is created -->
+ <extension
+ point="org.jboss.ide.eclipse.as.core.publishMethod">
+ <publishMethod
+ class="org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod"
+ id="rse"
+ name="Remote System Deployment"
+ serverTypes="org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42,org.jboss.ide.eclipse.as.50,org.jboss.ide.eclipse.as.51,org.jboss.ide.eclipse.as.60,org.jboss.ide.eclipse.as.eap.43,org.jboss.ide.eclipse.as.eap.50,org.jboss.ide.eclipse.as.systemCopyServer">
+ </publishMethod>
+ </extension>
+ <extension
+ point="org.jboss.ide.eclipse.as.core.publishers">
+ <publisher
+ class="org.jboss.ide.eclipse.as.rse.core.RSESingleFilePublisher"
+ priority="7">
+ </publisher>
+ <publisher
+ class="org.jboss.ide.eclipse.as.rse.core.RSEJSTPublisher"
+ priority="5">
+ </publisher>
+ <publisher
+ class="org.jboss.ide.eclipse.as.rse.core.archives.RSEZippedJSTPublisher"
+ priority="3"
+ zipDelegate="true">
+ </publisher>
+ </extension>
+
+</plugin>
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSECorePlugin.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSECorePlugin.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSECorePlugin.java 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,30 @@
+package org.jboss.ide.eclipse.as.rse.core;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class RSECorePlugin implements BundleActivator {
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ RSECorePlugin.context = bundleContext;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ RSECorePlugin.context = null;
+ }
+
+}
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * 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 org.jboss.ide.eclipse.as.core.publishers.AbstractJSTPublisher;
+
+
+public class RSEJSTPublisher extends AbstractJSTPublisher {
+
+ @Override
+ protected String getTargetedPublishMethodId() {
+ return RSEPublishMethod.RSE_ID;
+ }
+}
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * 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 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.Path;
+import org.eclipse.rse.core.RSECorePlugin;
+import org.eclipse.rse.core.model.IHost;
+import org.eclipse.rse.core.subsystems.ISubSystem;
+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.internal.JBossServer;
+import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+
+public class RSEPublishMethod extends AbstractPublishMethod {
+
+ public static final String RSE_ID = "rse"; //$NON-NLS-1$
+
+ private DeployableServerBehavior behaviour;
+
+ @Override
+ public String getPublishMethodId() {
+ return RSE_ID;
+ }
+
+ private IFileServiceSubSystem fileSubSystem = null;
+ private IPath remoteRootFolder;
+ private IPath remoteTemporaryFolder;
+ public void publishStart(DeployableServerBehavior behaviour,
+ IProgressMonitor monitor) throws CoreException {
+ this.behaviour = behaviour;
+ loadRemoteDeploymentDetails();
+ if (fileSubSystem != null && !fileSubSystem.isConnected()) {
+ try {
+ fileSubSystem.connect(monitor, false);
+ } catch (Exception e) {
+ }
+ }
+ super.publishStart(behaviour, monitor);
+ }
+ public IPath getRemoteRootFolder() {
+ return remoteRootFolder;
+ }
+ public IPath getRemoteTemporaryFolder() {
+ return remoteTemporaryFolder;
+ }
+ public IFileServiceSubSystem getFileServiceSubSystem() {
+ return fileSubSystem;
+ }
+ public IFileService getFileService() {
+ return fileSubSystem.getFileService();
+ }
+
+ public int publishFinish(DeployableServerBehavior behaviour,
+ IProgressMonitor monitor) throws CoreException {
+ return super.publishFinish(behaviour, monitor);
+ }
+
+ protected void loadRemoteDeploymentDetails() throws CoreException{
+ // TODO obviously fix this
+// String homeDir = RSEUtils.getRSEHomeDir(behaviour.getServer());
+// String conf = RSEUtils.getRSEConfigName(behaviour.getServer());
+ String connectionName = RSEUtils.getRSEConnectionName(behaviour.getServer());
+// this.remoteRootFolder = new Path("/home/rob/redhat/deploy"); //$NON-NLS-1$
+// this.remoteTemporaryFolder = new Path("/home/rob/redhat/tmp"); //$NON-NLS-1$
+ JBossServer jbs = ServerConverter.getJBossServer(behaviour.getServer());
+ this.remoteRootFolder = new Path(RSEUtils.getDeployRootFolder(jbs));
+ this.remoteTemporaryFolder = new Path("/home/rob/redhat/tmp"); //$NON-NLS-1$
+
+ IHost host = findHost(connectionName);
+ if( host != null ) {
+ fileSubSystem = findFileTransferSubSystem(host);
+ } else {
+ // TODO error host not found in RSE
+ }
+ }
+
+ protected IHost findHost(String connectionName) {
+ IHost[] allHosts = RSECorePlugin.getTheSystemRegistry().getHosts();
+ for( int i = 0; i < allHosts.length; i++ ) {
+ if( allHosts[i].getAliasName().equals(connectionName))
+ return allHosts[i];
+ }
+ return null;
+ }
+
+ /* approved files subsystems *
+ ftp.files
+ local.files
+ ssh.files
+ */
+ protected static List<String> APPROVED_FILE_SYSTEMS =
+ Arrays.asList(new String[]{ "ftp.files", "local.files", "ssh.files"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ protected IFileServiceSubSystem findFileTransferSubSystem(IHost host) {
+ ISubSystem[] systems = RSECorePlugin.getTheSystemRegistry().getSubSystems(host);
+ for( int i = 0; i < systems.length; i++ ) {
+ if( APPROVED_FILE_SYSTEMS.contains(systems[i].getConfigurationId()))
+ return (IFileServiceSubSystem)systems[i];
+ }
+ return null;
+ }
+
+ public static IPath findModuleFolderWithDefault(IModule module, IDeployableServer server, IPath startingPath) {
+ IModule[] moduleTree = new IModule[]{module};
+ String folder = PublishUtil.getDeployRootFolder(
+ moduleTree, server, startingPath.toString(),
+ IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
+ 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.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * 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.common.project.facet.core.util.internal.ProgressMonitorUtil;
+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 {
+ monitor.beginTask("Make directory " + dir.toString(), 100); //$NON-NLS-1$
+ if( dir.segmentCount() > 0 )
+ makeDirectoryIfRequired(dir.removeLastSegments(1), ProgressMonitorUtil.submon(monitor, 70));
+ 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(), ProgressMonitorUtil.submon(monitor, 30));
+ } catch( SystemMessageException sme ) {
+ System.err.println("failed to make folder " + toMake.toString()); //$NON-NLS-1$
+ }
+ createdFolders.add(toMake);
+ monitor.done();
+ return null;
+ }
+}
+
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSESingleFilePublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSESingleFilePublisher.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSESingleFilePublisher.java 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * 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;
+import org.jboss.ide.eclipse.as.core.publishers.AbstractServerToolsPublisher;
+
+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;
+ }
+}
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEUtils.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEUtils.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEUtils.java 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * 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.core.runtime.Path;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerAttributes;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
+import org.jboss.ide.eclipse.as.core.util.IConstants;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+
+
+/*
+ * Some of this code will need to be abstracted out from JBossServer
+ * and turned into a proper API, but in as simple a way as possible
+ */
+public class RSEUtils {
+ public static final String RSE_SERVER_CONFIG = "org.jboss.ide.eclipse.as.rse.core.RSEServerConfig"; //$NON-NLS-1$
+ public static final String RSE_SERVER_HOME_DIR = "org.jboss.ide.eclipse.as.rse.core.RSEServerHomeDir"; //$NON-NLS-1$
+ public static final String RSE_SERVER_HOST = "org.jboss.ide.eclipse.as.rse.core.ServerHost"; //$NON-NLS-1$
+ public static final String RSE_SERVER_DEFAULT_HOST = "Local"; //$NON-NLS-1$
+
+ public static String getRSEConnectionName(IServer server) {
+ return server.getAttribute(RSEUtils.RSE_SERVER_HOST, RSE_SERVER_DEFAULT_HOST);
+ }
+
+ public static String getRSEHomeDir(IServerAttributes server) {
+ return server.getAttribute(RSEUtils.RSE_SERVER_HOME_DIR, server.getRuntime().getLocation().toString());
+ }
+
+ public static String getRSEConfigName(IServerAttributes server) {
+ IJBossServerRuntime runtime = ServerConverter.getJBossRuntime(server);
+ return server.getAttribute(RSEUtils.RSE_SERVER_CONFIG, runtime.getJBossConfiguration());
+ }
+
+ public static String getDeployRootFolder(JBossServer server) {
+ return getDeployRootFolder(server.getServer(), server.getDeployLocationType());
+ }
+
+ /* Copied from JBossServer.getDeployFolder(etc) */
+ public static String getDeployRootFolder(IServer server, String type) {
+ if( type.equals(JBossServer.DEPLOY_CUSTOM)) {
+ String val = server.getAttribute(JBossServer.DEPLOY_DIRECTORY, (String)null);
+ if( val != null ) {
+ IPath val2 = new Path(val);
+ return makeGlobal(server, val2).toString();
+ }
+ // if no value is set, default to metadata
+ type = JBossServer.DEPLOY_SERVER;
+ }
+ // TODO error here, or sensible default?
+ if( type.equals(JBossServer.DEPLOY_METADATA)) {
+ return JBossServerCorePlugin.getServerStateLocation(server).
+ append(IJBossServerConstants.DEPLOY).makeAbsolute().toString();
+ } else if( type.equals(JBossServer.DEPLOY_SERVER)) {
+ String loc = IConstants.SERVER;
+ String config = getRSEConfigName(server);
+ IPath p = new Path(loc).append(config)
+ .append(IJBossServerConstants.DEPLOY);
+ return makeGlobal(server, p).toString();
+ }
+ return null;
+ }
+
+ public static IPath makeRelative(IServer server, IPath p) {
+ if( p.isAbsolute()) {
+ if(new Path(getRSEHomeDir(server)).isPrefixOf(p)) {
+ int size = new Path(getRSEHomeDir(server)).toOSString().length();
+ return new Path(p.toOSString().substring(size)).makeRelative();
+ }
+ }
+ return p;
+ }
+
+ public static IPath makeGlobal(IServer server, IPath p) {
+ if( !p.isAbsolute()) {
+ return new Path(getRSEHomeDir(server)).append(p).makeAbsolute();
+ }
+ return p;
+ }
+
+
+}
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * 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.archives;
+
+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.rse.services.clientserver.messages.SystemMessageException;
+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.archives.webtools.modules.WTPZippedPublisher;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+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.util.ServerConverter;
+import org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod;
+
+/**
+ * This class is in charge of RSE zipped publishing for flexible projects.
+ * It extends the functionality of the local zipped publishing class
+ * by uploading the file after building it in a temporary directory
+ */
+public class RSEZippedJSTPublisher extends WTPZippedPublisher {
+
+ protected String getPublishMethod() {
+ return RSEPublishMethod.RSE_ID;
+ }
+
+ /**
+ * Here we put the deployment first in a temporary remote deploy folder
+ * Then during the publishModule call, we'll also upload it to remote machine
+ */
+ protected String getDeployRoot(IModule[] module, IDeployableServer ds) {
+ IPath deployRoot = JBossServerCorePlugin.getServerStateLocation(ds.getServer()).
+ append(IJBossServerConstants.TEMP_REMOTE_DEPLOY).makeAbsolute();
+ deployRoot.toFile().mkdirs();
+ return deployRoot.toString();
+ }
+
+ @Override
+ public IStatus publishModule(
+ IJBossServerPublishMethod method,
+ IServer server, IModule[] module,
+ int publishType, IModuleResourceDelta[] delta,
+ IProgressMonitor monitor) throws CoreException {
+
+ // Locally zip it up into the remote tmp folder
+ IStatus sup = super.publishModule(method, server, module, publishType, delta, monitor);
+
+ // set up needed vars
+ IDeployableServer server2 = ServerConverter.getDeployableServer(server);
+ String remoteTempDeployRoot = getDeployRoot(module, ServerConverter.getDeployableServer(server));
+ RSEPublishMethod method2 = (RSEPublishMethod)method;
+ 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());
+ String name = sourcePath.lastSegment();
+
+ // Now transfer the file to RSE
+ try {
+ method2.getFileService().upload(sourcePath.toFile(), tempDestFolder.toString(), name, true, null, null, new NullProgressMonitor());
+ method2.getFileService().move(tempDestFolder.toString(), name, destFolder.toString(), name, new NullProgressMonitor());
+ } catch( SystemMessageException sme ) {
+ // TODO fix or return error
+ sme.printStackTrace();
+ }
+
+ return sup;
+ }
+}
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.classpath
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.classpath (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.classpath 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.project
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.project (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.project 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.ide.eclipse.as.rse.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/.settings/org.eclipse.jdt.core.prefs 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,8 @@
+#Wed Aug 11 12:55:39 GMT+08:00 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/META-INF/MANIFEST.MF
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/META-INF/MANIFEST.MF (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/META-INF/MANIFEST.MF 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,29 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Ui
+Bundle-SymbolicName: org.jboss.ide.eclipse.as.rse.ui;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.ide.eclipse.as.rse.ui.RSEUIPlugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.ui,
+ org.eclipse.rse.core,
+ org.eclipse.rse.subsystems.files.core,
+ org.eclipse.rse.services,
+ org.eclipse.rse.services.files.ftp,
+ org.eclipse.rse.services.local,
+ org.eclipse.rse.services.ssh,
+ org.jboss.ide.eclipse.as.core,
+ org.jboss.ide.eclipse.as.wtp.core,
+ org.eclipse.wst.server.core,
+ org.eclipse.wst.common.project.facet.core,
+ org.eclipse.core.resources,
+ org.eclipse.wst.common.modulecore,
+ org.eclipse.wst.common.emfworkbench.integration,
+ org.eclipse.jem.util,
+ org.jboss.ide.eclipse.as.rse.core,
+ org.jboss.ide.eclipse.as.ui,
+ org.eclipse.rse.files.ui,
+ org.eclipse.rse.ui,
+ org.eclipse.wst.server.ui
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPageCallback.class
===================================================================
(Binary files differ)
Property changes on: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPageCallback.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$1.class
===================================================================
(Binary files differ)
Property changes on: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$1.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$2.class
===================================================================
(Binary files differ)
Property changes on: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$2.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$3.class
===================================================================
(Binary files differ)
Property changes on: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$3.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$4.class
===================================================================
(Binary files differ)
Property changes on: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$4.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$CustomSystemHostCombo$1.class
===================================================================
(Binary files differ)
Property changes on: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$CustomSystemHostCombo$1.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$CustomSystemHostCombo.class
===================================================================
(Binary files differ)
Property changes on: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite$CustomSystemHostCombo.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite.class
===================================================================
(Binary files differ)
Property changes on: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI$RSEDeploymentPreferenceComposite.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.class
===================================================================
(Binary files differ)
Property changes on: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEUIPlugin.class
===================================================================
(Binary files differ)
Property changes on: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/bin/org/jboss/ide/eclipse/as/rse/ui/RSEUIPlugin.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/build.properties
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/build.properties (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/build.properties 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/plugin.xml
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/plugin.xml (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/plugin.xml 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.jboss.ide.eclipse.as.ui.DeployMethodUI">
+ <ui
+ class="org.jboss.tools.as.rse.ui.RSEDeploymentPreferenceUI"
+ deployMethodId="rse">
+ </ui>
+ </extension>
+</plugin>
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPageCallback.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPageCallback.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPageCallback.java 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,33 @@
+package org.jboss.ide.eclipse.as.rse.ui;
+
+import java.beans.PropertyChangeEvent;
+
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.jboss.ide.eclipse.as.core.util.IConstants;
+import org.jboss.ide.eclipse.as.rse.core.RSEUtils;
+import org.jboss.ide.eclipse.as.ui.editor.DeploymentModuleOptionCompositeAssistant;
+import org.jboss.ide.eclipse.as.ui.editor.DeploymentModuleOptionCompositeAssistant.IDeploymentPageCallback;
+
+public class RSEDeploymentPageCallback implements IDeploymentPageCallback {
+ public boolean metadataEnabled() {
+ return false;
+ }
+ public String getServerLocation(IServerWorkingCopy wc) {
+ return IConstants.SERVER;
+ }
+
+ public String getServerConfigName(IServerWorkingCopy wc) {
+ return RSEUtils.getRSEConfigName(wc);
+ }
+ public void propertyChange(PropertyChangeEvent evt,
+ DeploymentModuleOptionCompositeAssistant composite) {
+
+ if( composite.getServerRadio().getSelection() && (
+ evt.getPropertyName().equals( RSEUtils.RSE_SERVER_CONFIG) ||
+ evt.getPropertyName().equals( RSEUtils.RSE_SERVER_HOME_DIR))) {
+ composite.radioSelected(composite.getServerRadio());
+ }
+
+ }
+
+}
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,310 @@
+/*******************************************************************************
+ * 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.ui;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.rse.core.RSECorePlugin;
+import org.eclipse.rse.core.events.ISystemModelChangeEvent;
+import org.eclipse.rse.core.events.ISystemModelChangeListener;
+import org.eclipse.rse.core.model.IHost;
+import org.eclipse.rse.files.ui.dialogs.SystemRemoteFileDialog;
+import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.rse.core.RSEUtils;
+import org.jboss.ide.eclipse.as.ui.UIUtil;
+import org.jboss.ide.eclipse.as.ui.editor.IDeploymentTypeUI;
+import org.jboss.ide.eclipse.as.ui.editor.ServerModeSection;
+import org.jboss.ide.eclipse.as.ui.editor.ServerModeSection.ChangeServerPropertyCommand;
+
+public class RSEDeploymentPreferenceUI implements IDeploymentTypeUI {
+ public RSEDeploymentPreferenceUI() {
+ // Do nothing
+ }
+
+ @Override
+ public void fillComposite(Composite parent, ServerModeSection modeSection) {
+ parent.setLayout(new FillLayout());
+ new RSEDeploymentPreferenceComposite(parent, SWT.NONE, modeSection);
+ }
+
+ public static class RSEDeploymentPreferenceComposite extends Composite implements PropertyChangeListener {
+ private ServerModeSection modeSection;
+ private CustomSystemHostCombo combo;
+ private Text rseServerHome,rseServerConfig;
+ private Button rseBrowse;
+ private ModifyListener comboMListener;
+ public RSEDeploymentPreferenceComposite(Composite parent, int style, ServerModeSection modeSection) {
+ super(parent, style);
+ this.modeSection = modeSection;
+ setLayout(new FormLayout());
+ Composite child = new Composite(this, SWT.None);
+ child.setLayoutData(UIUtil.createFormData2(0, 0, null, 0, 0, 5, 100, 0));
+ child.setLayout(new GridLayout());
+ String current = modeSection.getServer().getAttribute(RSEUtils.RSE_SERVER_HOST, RSEUtils.RSE_SERVER_DEFAULT_HOST);
+ combo = new CustomSystemHostCombo(child, SWT.NULL, current, "files"); //$NON-NLS-1$
+ /* ISubSystemConfigurationCategories.SUBSYSTEM_CATEGORY_FILES*/
+ // "files");
+ comboMListener = new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ rseHostChanged();
+ }
+ };
+ combo.getCombo().addModifyListener(comboMListener);
+ Label serverHomeLabel = new Label(this, SWT.NONE);
+ serverHomeLabel.setText("Remote Server Home: ");
+ rseBrowse = new Button(this, SWT.DEFAULT);
+ rseBrowse.setText("Browse...");
+ rseBrowse.setLayoutData(UIUtil.createFormData2(child, 5, null, 0, null, 0, 100, -5));
+ rseBrowse.addSelectionListener(new SelectionListener(){
+ public void widgetSelected(SelectionEvent e) {
+ browseClicked();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ browseClicked();
+ }
+ });
+ rseServerHome = new Text(this, SWT.SINGLE | SWT.BORDER);
+ serverHomeLabel.setLayoutData(UIUtil.createFormData2(child, 7, null, 0, 0, 10, null, 0));
+ rseServerHome.setLayoutData(UIUtil.createFormData2(child, 5, null, 0, serverHomeLabel, 5, rseBrowse, -5));
+ rseServerHome.setText(modeSection.getServer().getAttribute(RSEUtils.RSE_SERVER_HOME_DIR,
+ getRuntime().getRuntime().getLocation().toString()));
+ rseServerHome.addModifyListener(new ModifyListener(){
+ public void modifyText(ModifyEvent e) {
+ serverHomeChanged();
+ }});
+
+ Label serverConfigLabel = new Label(this, SWT.NONE);
+ serverConfigLabel.setText("Remote Server Configuration: ");
+ rseServerConfig= new Text(this, SWT.SINGLE | SWT.BORDER);
+ serverConfigLabel.setLayoutData(UIUtil.createFormData2(rseServerHome, 7, null, 0, 0, 10, null, 0));
+ rseServerConfig.setLayoutData(UIUtil.createFormData2(rseServerHome, 5, null, 0, serverConfigLabel, 5, 100, -5));
+ rseServerConfig.setText(modeSection.getServer().getAttribute(RSEUtils.RSE_SERVER_CONFIG,
+ getRuntime().getJBossConfiguration()));
+ rseServerConfig.addModifyListener(new ModifyListener(){
+ public void modifyText(ModifyEvent e) {
+ serverConfigChanged();
+ }});
+ modeSection.getServer().addPropertyChangeListener(this);
+ }
+
+ @Override
+ public void dispose () {
+ super.dispose();
+ modeSection.getServer().removePropertyChangeListener(this);
+ }
+
+ private boolean updatingFromModelChange = false;
+ public void propertyChange(PropertyChangeEvent evt) {
+ updatingFromModelChange = true;
+ if( evt.getPropertyName().equals(RSEUtils.RSE_SERVER_HOME_DIR)) {
+ rseServerHome.setText(evt.getNewValue().toString());
+ } else if( evt.getPropertyName().equals(RSEUtils.RSE_SERVER_CONFIG)) {
+ rseServerConfig.setText(evt.getNewValue().toString());
+ } else if( evt.getPropertyName().equals(RSEUtils.RSE_SERVER_HOST)) {
+ combo.setHostName(evt.getNewValue().toString());
+ }
+ updatingFromModelChange = false;
+ }
+
+ protected void browseClicked() {
+ SystemRemoteFileDialog d = new SystemRemoteFileDialog(
+ rseBrowse.getShell(), "Browse remote system", combo.getHost());
+ if( d.open() == Dialog.OK) {
+ Object o = d.getOutputObject();
+ if( o instanceof IRemoteFile ) {
+ String path = ((IRemoteFile)o).getAbsolutePath();
+ rseServerHome.setText(path);
+ serverHomeChanged();
+ }
+ }
+ }
+
+ protected IJBossServerRuntime getRuntime() {
+ return ServerConverter.getJBossRuntime(modeSection.getServer().getOriginal());
+ }
+
+ protected void rseHostChanged() {
+ if( !updatingFromModelChange ) {
+ String hostName = combo.getHost() == null ? null : combo.getHost().getAliasName();
+ String oldVal = modeSection.getServer().getAttribute(RSEUtils.RSE_SERVER_HOST, (String)null);
+ if( !hostName.equals(oldVal) && !updatingFromModelChange) {
+ modeSection.getCommandManager().execute(new ChangeServerPropertyCommand(
+ modeSection.getServer(), RSEUtils.RSE_SERVER_HOST, hostName,
+ "Change RSE Host"));
+ modeSection.getCommandManager().execute(new ChangeServerPropertyCommand(
+ modeSection.getServer(), "hostname", combo.getHost().getHostName(),
+ "Change Hostname"));
+ }
+ }
+ }
+
+ protected void serverHomeChanged() {
+ if( !updatingFromModelChange) {
+ modeSection.getCommandManager().execute(new ChangeServerPropertyCommand(
+ modeSection.getServer(), RSEUtils.RSE_SERVER_HOME_DIR, rseServerHome.getText(),
+ "Change RSE Server's Home Directory"));
+ }
+ }
+
+ protected void serverConfigChanged() {
+ if( !updatingFromModelChange ) {
+ modeSection.getCommandManager().execute(new ChangeServerPropertyCommand(
+ modeSection.getServer(), RSEUtils.RSE_SERVER_CONFIG, rseServerConfig.getText(),
+ "Change RSE Server's Configuration"));
+ }
+ }
+
+ public class CustomSystemHostCombo extends Composite implements ModifyListener, ISystemModelChangeListener {
+ private String fileSubSystem;
+ private Combo combo;
+ private IHost currentHost;
+ private String currentHostName;
+ private IHost[] hosts;
+ private String[] hostsAsStrings;
+ public CustomSystemHostCombo(Composite parent, int style, String initialHostName, String fileSubSystem) {
+ super(parent, style);
+ this.fileSubSystem = fileSubSystem;
+ this.currentHostName = initialHostName;
+ this.hosts = RSECorePlugin.getTheSystemRegistry().getHostsBySubSystemConfigurationCategory(fileSubSystem);
+ this.currentHost = findHost(initialHostName);
+ RSECorePlugin.getTheSystemRegistry().addSystemModelChangeListener(this);
+
+ // Where I belong in the parent
+ GridData data = new GridData();
+ // horizontal clues
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ data.widthHint = 200;
+ // vertical clues
+ data.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING; //GridData.CENTER;
+ data.grabExcessVerticalSpace = false; // true;
+ this.setLayoutData(data);
+
+ // What's inside me
+ setLayout(new FormLayout());
+ Label l = new Label(this, SWT.NONE);
+ l.setText("Host");
+ combo = new Combo(this, SWT.DEFAULT | SWT.READ_ONLY);
+ l.setLayoutData(UIUtil.createFormData2(0, 5, null, 0, 0, 0, null, 0));
+ combo.setLayoutData(UIUtil.createFormData2(0, 0, null, 0, l, 5, 100, -5));
+ refreshConnections();
+ combo.addModifyListener(this);
+ }
+
+ public IHost findHost(String name) {
+ for( int i = 0; i < hosts.length; i++ ) {
+ if( hosts[i].getAliasName().equals(name))
+ return hosts[i];
+ }
+ return null;
+ }
+
+ public Combo getCombo() {
+ return combo;
+ }
+
+ public IHost getHost() {
+ return currentHost;
+ }
+
+ public String getHostName() {
+ return currentHostName;
+ }
+
+ public void setHostName(String name) {
+ this.currentHostName = name;
+ this.currentHost = findHost(currentHostName);
+ if( currentHost == null )
+ combo.clearSelection();
+ else {
+ String[] items = combo.getItems();
+ for( int i = 0; i < items.length; i++ ) {
+ if( items[i].equals(currentHost.getAliasName())) {
+ combo.select(i);
+ return;
+ }
+ }
+ }
+ }
+
+ public void refreshConnections() {
+ hosts = RSECorePlugin.getTheSystemRegistry().getHostsBySubSystemConfigurationCategory(fileSubSystem);
+ hostsAsStrings = new String[hosts.length];
+ int currentHostIndex = -1;
+ for( int i = 0; i < hosts.length; i++ ) {
+ hostsAsStrings[i] = hosts[i].getAliasName();
+ if( currentHostIndex == -1 && currentHostName != null
+ && hostsAsStrings[i].equals(currentHostName)) {
+ currentHostIndex = i;
+ }
+ }
+
+ // refill the combo thingie
+ combo.setItems(hostsAsStrings);
+ if( currentHostIndex != -1 ) // set the current host
+ combo.select(currentHostIndex);
+ else
+ combo.clearSelection();
+ }
+
+ @Override
+ public void modifyText(ModifyEvent e) {
+ int index = combo.getSelectionIndex();
+ if( index != -1 ) {
+ String s = combo.getItem(index);
+ for( int i = 0; i < hosts.length; i++ ) {
+ if( hosts[i].getAliasName().equals(s)) {
+ currentHost = hosts[i];
+ currentHostName = currentHost.getAliasName();
+ return;
+ }
+ }
+ }
+ }
+ public void systemModelResourceChanged(ISystemModelChangeEvent event) {
+ if( combo.isDisposed())
+ return;
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run() {
+ combo.removeModifyListener(comboMListener);
+ refreshConnections();
+ combo.addModifyListener(comboMListener);
+ }
+ });
+ }
+ @Override
+ public void dispose () {
+ super.dispose();
+ RSECorePlugin.getTheSystemRegistry().removeSystemModelChangeListener(this);
+ }
+ }
+ }
+
+}
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEUIPlugin.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEUIPlugin.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEUIPlugin.java 2010-08-11 08:53:06 UTC (rev 24033)
@@ -0,0 +1,33 @@
+package org.jboss.ide.eclipse.as.rse.ui;
+
+import org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod;
+import org.jboss.ide.eclipse.as.ui.editor.DeploymentModuleOptionCompositeAssistant;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class RSEUIPlugin implements BundleActivator {
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ RSEUIPlugin.context = bundleContext;
+ DeploymentModuleOptionCompositeAssistant.addMapping(RSEPublishMethod.RSE_ID, new RSEDeploymentPageCallback());
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ RSEUIPlugin.context = null;
+ }
+
+}
15 years, 5 months
JBoss Tools SVN: r24032 - in workspace/rstryker/rse/as/plugins: org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-08-11 04:41:16 -0400 (Wed, 11 Aug 2010)
New Revision: 24032
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractJSTPublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java
Removed:
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/rse/core/AbstractJSTPublisher.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/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.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSEUtils.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/rse/ui/
Modified:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml
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.as.core/META-INF/MANIFEST.MF
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/SingleFilePublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
Log:
Separating RSE out into new plugins
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml 2010-08-10 18:50:48 UTC (rev 24031)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml 2010-08-11 08:41:16 UTC (rev 24032)
@@ -95,11 +95,6 @@
priority="2"
zipDelegate="true">
</publisher>
- <publisher
- class="org.jboss.ide.eclipse.archives.webtools.modules.rse.RSEZippedJSTPublisher"
- priority="3"
- zipDelegate="true">
- </publisher>
</extension>
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-08-10 18:50:48 UTC (rev 24031)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackagesPublisher.java 2010-08-11 08:41:16 UTC (rev 24032)
@@ -12,8 +12,8 @@
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.publishers.AbstractServerToolsPublisher;
import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
-import org.jboss.ide.eclipse.as.rse.core.AbstractServerToolsPublisher;
public class PackagesPublisher extends AbstractServerToolsPublisher {
public boolean accepts(String method, IServer server, IModule[] module) {
Deleted: 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-08-10 18:50:48 UTC (rev 24031)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/rse/RSEZippedJSTPublisher.java 2010-08-11 08:41:16 UTC (rev 24032)
@@ -1,86 +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
- *
- * TODO: Logging and Progress Monitors
- ******************************************************************************/
-package org.jboss.ide.eclipse.archives.webtools.modules.rse;
-
-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.rse.services.clientserver.messages.SystemMessageException;
-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.archives.webtools.modules.WTPZippedPublisher;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-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.util.ServerConverter;
-import org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod;
-
-/**
- * This class is in charge of RSE zipped publishing for flexible projects.
- * It extends the functionality of the local zipped publishing class
- * by uploading the file after building it in a temporary directory
- */
-public class RSEZippedJSTPublisher extends WTPZippedPublisher {
-
- protected String getPublishMethod() {
- return RSEPublishMethod.RSE_ID;
- }
-
- /**
- * Here we put the deployment first in a temporary remote deploy folder
- * Then during the publishModule call, we'll also upload it to remote machine
- */
- protected String getDeployRoot(IModule[] module, IDeployableServer ds) {
- IPath deployRoot = JBossServerCorePlugin.getServerStateLocation(ds.getServer()).
- append(IJBossServerConstants.TEMP_REMOTE_DEPLOY).makeAbsolute();
- deployRoot.toFile().mkdirs();
- return deployRoot.toString();
- }
-
- @Override
- public IStatus publishModule(
- IJBossServerPublishMethod method,
- IServer server, IModule[] module,
- int publishType, IModuleResourceDelta[] delta,
- IProgressMonitor monitor) throws CoreException {
-
- // Locally zip it up into the remote tmp folder
- IStatus sup = super.publishModule(method, server, module, publishType, delta, monitor);
-
- // set up needed vars
- IDeployableServer server2 = ServerConverter.getDeployableServer(server);
- String remoteTempDeployRoot = getDeployRoot(module, ServerConverter.getDeployableServer(server));
- RSEPublishMethod method2 = (RSEPublishMethod)method;
- 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());
- String name = sourcePath.lastSegment();
-
- // Now transfer the file to RSE
- try {
- method2.getFileService().upload(sourcePath.toFile(), tempDestFolder.toString(), name, true, null, null, new NullProgressMonitor());
- method2.getFileService().move(tempDestFolder.toString(), name, destFolder.toString(), name, new NullProgressMonitor());
- } catch( SystemMessageException sme ) {
- // TODO fix or return error
- sme.printStackTrace();
- }
-
- return sup;
- }
-}
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2010-08-10 18:50:48 UTC (rev 24031)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2010-08-11 08:41:16 UTC (rev 24032)
@@ -22,13 +22,7 @@
org.eclipse.wst.common.project.facet.core,
org.eclipse.wst.common.frameworks,
org.eclipse.jst.jee,
- org.eclipse.core.commands,
- org.eclipse.rse.core;bundle-version="3.1.100",
- org.eclipse.rse.subsystems.files.core;bundle-version="3.2.0",
- org.eclipse.rse.services;bundle-version="3.2.0",
- org.eclipse.rse.services.files.ftp;bundle-version="3.0.200",
- org.eclipse.rse.services.local;bundle-version="2.1.200",
- org.eclipse.rse.services.ssh;bundle-version="3.0.1"
+ org.eclipse.core.commands
Bundle-ActivationPolicy: lazy
Export-Package: org.jboss.ide.eclipse.as.core,
org.jboss.ide.eclipse.as.core.extensions.descriptors,
@@ -41,8 +35,7 @@
org.jboss.ide.eclipse.as.core.server.internal,
org.jboss.ide.eclipse.as.core.server.internal.launch,
org.jboss.ide.eclipse.as.core.server.xpl,
- org.jboss.ide.eclipse.as.core.util,
- org.jboss.ide.eclipse.as.rse.core
+ org.jboss.ide.eclipse.as.core.util
Bundle-ClassPath: dom4j-1.6.1.jar,
jaxen-1.1-beta-6.jar,
getopt.jar,
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractJSTPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractJSTPublisher.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractJSTPublisher.java 2010-08-11 08:41:16 UTC (rev 24032)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * 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.core.publishers;
+
+import org.eclipse.wst.common.componentcore.ModuleCoreNature;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+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.util.ServerConverter;
+
+public abstract class AbstractJSTPublisher extends AbstractServerToolsPublisher {
+ public AbstractJSTPublisher() {}
+
+ /**
+ * This abstract publisher is only suitable for non force-zipped deployments
+ */
+ public boolean accepts(String method, IServer server, IModule[] module) {
+ if( module == null || !method.equals(getTargetedPublishMethodId()))
+ return false;
+ IDeployableServer ds = ServerConverter.getDeployableServer(server);
+ return ds != null
+ && ModuleCoreNature.isFlexibleProject(module[0].getProject())
+ && !ds.zipsWTPDeployments();
+ }
+
+ /**
+ * Get the publish method this publisher is associated with
+ * @return
+ */
+ protected abstract String getTargetedPublishMethodId();
+
+ /**
+ * JST projects require certain children (utility, etc) to be zipped up
+ */
+ @Override
+ protected boolean forceZipModule(IModule[] moduleTree) {
+ return PublishUtil.deployPackaged(moduleTree);
+ }
+}
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java 2010-08-11 08:41:16 UTC (rev 24032)
@@ -0,0 +1,290 @@
+/*******************************************************************************
+ * 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.core.publishers;
+
+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.project.facet.core.util.internal.ProgressMonitorUtil;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.model.IModuleResource;
+import org.eclipse.wst.server.core.model.IModuleResourceDelta;
+import org.eclipse.wst.server.core.util.ModuleFile;
+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.util.DeploymentPreferenceLoader;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
+
+/**
+ * Class suitable for parsing any properly formed servertools-api module
+ */
+public abstract class AbstractServerToolsPublisher implements IJBossServerPublisher {
+ protected IModuleResourceDelta[] delta;
+ protected IDeployableServer server;
+ protected int publishState = IServer.PUBLISH_STATE_NONE;
+ protected IJBossServerPublishMethod publishMethod;
+
+ public AbstractServerToolsPublisher() {}
+ public abstract boolean accepts(String method, IServer server, IModule[] module);
+
+ public int getPublishState() {
+ return publishState;
+ }
+
+ protected void setPublishState(int state) {
+ this.publishState = state;
+ }
+
+ 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 = method;
+
+ boolean deleted = false;
+ for( int i = 0; i < module.length; i++ ) {
+ if( module[i].isExternal() )
+ deleted = true;
+ }
+
+ // Monitor at this point has been begun with 1000 monitor
+ IProgressMonitor subMon = ProgressMonitorUtil.submon(monitor, 1000);
+ if (publishType == REMOVE_PUBLISH ) {
+ status = unpublish(this.server, module, subMon);
+ } else {
+ if( deleted ) {
+ publishState = IServer.PUBLISH_STATE_UNKNOWN;
+ } else {
+ if (publishType == FULL_PUBLISH ) {
+ status = fullPublish(module, module[module.length-1], subMon);
+ } else if (publishType == INCREMENTAL_PUBLISH) {
+ status = incrementalPublish(module, module[module.length-1], subMon);
+ }
+ }
+ }
+ return status;
+ }
+
+ /**
+ * Gets the actual deploy path for this module
+ *
+ * @param moduleTree
+ * @param server
+ * @return
+ */
+ protected IPath getDeployPath(IModule[] moduleTree, IDeployableServer server) {
+ String folder = PublishUtil.getDeployRootFolder(
+ moduleTree, server,
+ publishMethod.getPublishDefaultRootFolder(server.getServer()),
+ IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
+ return PublishUtil.getDeployPath(moduleTree, folder);
+ }
+
+ /**
+ * 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.
+ *
+ * Subclasses may override
+ *
+ * @param publishType
+ * @param moduleTree
+ * @param server
+ * @param monitor
+ */
+ protected void finishPublish(int publishType, IModule[] moduleTree, IDeployableServer server, IProgressMonitor monitor){}
+
+ private IPublishCopyCallbackHandler getCallbackHandler(IPath path) {
+ return publishMethod.getCallbackHandler(path, server.getServer());
+ }
+
+ /**
+ * For certain module trees, some publishers may want to force a child to be zipped.
+ * For example, JST Publisher may want to force utility project children to be zipped.
+ *
+ * @param moduleTree
+ * @return
+ */
+ protected boolean forceZipModule(IModule[] moduleTree) {
+ return false;
+ }
+
+ protected IStatus canceledStatus() {
+ return new Status(IStatus.CANCEL, JBossServerCorePlugin.PLUGIN_ID, "Publish Canceled"); //$NON-NLS-1$
+ }
+
+ protected IStatus fullPublish(IModule[] moduleTree, IModule module, IProgressMonitor monitor) throws CoreException {
+ monitor.beginTask("Full Publish", 1000); //$NON-NLS-1$
+
+ IPath deployPath = getDeployPath(moduleTree, server);
+ IPublishCopyCallbackHandler callback = getCallbackHandler(deployPath);
+ IModuleResource[] members = PublishUtil.getResources(module, ProgressMonitorUtil.submon(monitor, 200));
+
+ if( monitor.isCanceled())
+ return canceledStatus();
+
+ // 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 ))
+ callback.deleteResource(new Path("/"), ProgressMonitorUtil.submon(monitor, 100)); //$NON-NLS-1$
+
+ if( monitor.isCanceled())
+ return canceledStatus();
+
+ ArrayList<IStatus> list = new ArrayList<IStatus>();
+
+ boolean isBinaryObject = ServerModelUtilities.isBinaryModule(module);
+ boolean forceZip = forceZipModule(moduleTree);
+
+ if( !forceZip && !isBinaryObject) {
+ PublishCopyUtil util = new PublishCopyUtil(callback);
+ list.addAll(Arrays.asList(util.publishFull(members, ProgressMonitorUtil.submon(monitor, 700))));
+ } else if( isBinaryObject )
+ list.addAll(Arrays.asList(copyBinaryModule(moduleTree, ProgressMonitorUtil.submon(monitor, 700))));
+ else {
+ // A child that must be zipped, forceZip is true
+ IPath deployRoot = JBossServerCorePlugin.getServerStateLocation(server.getServer()).
+ append(IJBossServerConstants.TEMP_DEPLOY).makeAbsolute();
+
+ try {
+ File temp = deployRoot.toFile().createTempFile(module.getName(), ".tmp", deployRoot.toFile()); //$NON-NLS-1$
+ IPath tempFile = new Path(temp.getAbsolutePath());
+ list.addAll(Arrays.asList(PublishUtil.packModuleIntoJar(moduleTree[moduleTree.length-1], tempFile)));
+ IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$
+ String parentFolder = deployPath.removeLastSegments(1).toString();
+ handler.makeDirectoryIfRequired(new Path(parentFolder), ProgressMonitorUtil.submon(monitor, 200));
+ ModuleFile mf = new ModuleFile(tempFile.toFile(), tempFile.lastSegment(), tempFile);
+ handler.copyFile(mf, deployPath, ProgressMonitorUtil.submon(monitor, 500));
+ } catch( IOException ioe) {
+ list.add(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, ioe.getMessage(), ioe));
+ }
+ }
+
+ monitor.done();
+ if( list.size() > 0 )
+ return createMultiStatus(list, module);
+ return Status.OK_STATUS;
+ }
+
+ protected IStatus incrementalPublish(IModule[] moduleTree, IModule module, IProgressMonitor monitor) throws CoreException {
+ monitor.beginTask("Incremental Publish", 100); //$NON-NLS-1$
+ IStatus[] results = new IStatus[] {};
+ IPath deployPath = getDeployPath(moduleTree, server);
+ boolean isBinaryObject = ServerModelUtilities.isBinaryModule(module);
+ boolean forceZip = forceZipModule(moduleTree);
+ if( !forceZip && !isBinaryObject) {
+ IPublishCopyCallbackHandler handler = getCallbackHandler(deployPath);
+ results = new PublishCopyUtil(handler).publishDelta(delta, ProgressMonitorUtil.submon(monitor, 100));
+ } else if( delta.length > 0 ) {
+ if( isBinaryObject)
+ results = copyBinaryModule(moduleTree, ProgressMonitorUtil.submon(monitor, 100));
+ else {
+ // forceZip a child module
+ IPath localDeployRoot = JBossServerCorePlugin.getServerStateLocation(server.getServer()).
+ append(IJBossServerConstants.TEMP_DEPLOY).makeAbsolute();
+ try {
+ File temp = File.createTempFile(module.getName(), ".tmp", localDeployRoot.toFile()); //$NON-NLS-1$
+ IPath tempFile = new Path(temp.getAbsolutePath());
+ PublishUtil.packModuleIntoJar(moduleTree[moduleTree.length-1], tempFile);
+ IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$
+ String parentFolder = deployPath.removeLastSegments(1).toString();
+ handler.makeDirectoryIfRequired(new Path(parentFolder), ProgressMonitorUtil.submon(monitor, 50));
+ ModuleFile mf = new ModuleFile(tempFile.toFile(), tempFile.lastSegment(), tempFile);
+ handler.copyFile(mf, deployPath, ProgressMonitorUtil.submon(monitor, 50));
+ } catch( IOException ioe) {
+ IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, ioe.getMessage(), ioe);
+ results = new IStatus[] { s };
+ }
+ }
+ }
+
+ monitor.done();
+ 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) {
+ monitor.beginTask("Copy Binary Module", 100); //$NON-NLS-1$
+ try {
+ IPath destinationPath = getDeployPath(moduleTree, server);
+ IModuleResource[] members = PublishUtil.getResources(moduleTree);
+ File source = PublishUtil.getFile(members[0]);
+ if( source != null ) {
+ IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$
+ IPath localFilePath = new Path(source.getAbsolutePath());
+ ModuleFile mf = new ModuleFile(localFilePath.toFile(), localFilePath.lastSegment(), localFilePath);
+ handler.copyFile(mf, destinationPath, new NullProgressMonitor());
+ } 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()};
+ }
+ monitor.done();
+ return new IStatus[]{Status.OK_STATUS};
+ }
+
+ protected IStatus unpublish(IDeployableServer jbServer, IModule[] module,
+ IProgressMonitor monitor) throws CoreException {
+ monitor.beginTask("Begin Unpublish", 100); //$NON-NLS-1$
+ IPath remotePath = getDeployPath(module, server);
+ IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$
+ handler.deleteResource(remotePath, ProgressMonitorUtil.submon(monitor, 100));
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+}
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-08-10 18:50:48 UTC (rev 24031)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2010-08-11 08:41:16 UTC (rev 24032)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.publishers;
-import org.jboss.ide.eclipse.as.rse.core.AbstractJSTPublisher;
public class JstPublisher extends AbstractJSTPublisher {
protected String getTargetedPublishMethodId() {
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-08-10 18:50:48 UTC (rev 24031)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2010-08-11 08:41:16 UTC (rev 24032)
@@ -13,7 +13,6 @@
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.rse.core.AbstractServerToolsPublisher;
public class SingleFilePublisher extends AbstractServerToolsPublisher {
public boolean accepts(String method, IServer server, IModule[] module) {
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2010-08-10 18:50:48 UTC (rev 24031)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2010-08-11 08:41:16 UTC (rev 24032)
@@ -85,12 +85,16 @@
}
public String getTempDeployFolder() {
- IJBossServerRuntime jbsrt = getRuntime();
- String type = getDeployLocationType();
+ return getTempDeployFolder(this, getDeployLocationType());
+ }
+
+ public static String getTempDeployFolder(JBossServer jbs, String type) {
+ IServer server = jbs.getServer();
+ IJBossServerRuntime jbsrt = getRuntime(server);
if( type.equals(DEPLOY_CUSTOM))
- return ServerUtil.makeGlobal(jbsrt, new Path(getAttribute(TEMP_DEPLOY_DIRECTORY, ""))).toString(); //$NON-NLS-1$
+ return ServerUtil.makeGlobal(jbsrt, new Path(server.getAttribute(TEMP_DEPLOY_DIRECTORY, ""))).toString(); //$NON-NLS-1$
if( type.equals(DEPLOY_METADATA)) {
- return JBossServerCorePlugin.getServerStateLocation(getServer()).
+ return JBossServerCorePlugin.getServerStateLocation(server).
append(IJBossServerConstants.TEMP_DEPLOY).makeAbsolute().toString();
} else if( type.equals(DEPLOY_SERVER)) {
String loc = jbsrt.getConfigLocation();
Deleted: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/AbstractJSTPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/AbstractJSTPublisher.java 2010-08-10 18:50:48 UTC (rev 24031)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/AbstractJSTPublisher.java 2010-08-11 08:41:16 UTC (rev 24032)
@@ -1,48 +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.wst.common.componentcore.ModuleCoreNature;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-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.util.ServerConverter;
-
-public abstract class AbstractJSTPublisher extends AbstractServerToolsPublisher {
- public AbstractJSTPublisher() {}
-
- /**
- * This abstract publisher is only suitable for non force-zipped deployments
- */
- public boolean accepts(String method, IServer server, IModule[] module) {
- if( module == null || !method.equals(getTargetedPublishMethodId()))
- return false;
- IDeployableServer ds = ServerConverter.getDeployableServer(server);
- return ds != null
- && ModuleCoreNature.isFlexibleProject(module[0].getProject())
- && !ds.zipsWTPDeployments();
- }
-
- /**
- * Get the publish method this publisher is associated with
- * @return
- */
- protected abstract String getTargetedPublishMethodId();
-
- /**
- * JST projects require certain children (utility, etc) to be zipped up
- */
- @Override
- protected boolean forceZipModule(IModule[] moduleTree) {
- return PublishUtil.deployPackaged(moduleTree);
- }
-}
Deleted: 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-08-10 18:50:48 UTC (rev 24031)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/AbstractServerToolsPublisher.java 2010-08-11 08:41:16 UTC (rev 24032)
@@ -1,290 +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 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.project.facet.core.util.internal.ProgressMonitorUtil;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.model.IModuleResource;
-import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-import org.eclipse.wst.server.core.util.ModuleFile;
-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.util.DeploymentPreferenceLoader;
-import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
-
-/**
- * Class suitable for parsing any properly formed servertools-api module
- */
-public abstract class AbstractServerToolsPublisher implements IJBossServerPublisher {
- protected IModuleResourceDelta[] delta;
- protected IDeployableServer server;
- protected int publishState = IServer.PUBLISH_STATE_NONE;
- protected IJBossServerPublishMethod publishMethod;
-
- public AbstractServerToolsPublisher() {}
- public abstract boolean accepts(String method, IServer server, IModule[] module);
-
- public int getPublishState() {
- return publishState;
- }
-
- protected void setPublishState(int state) {
- this.publishState = state;
- }
-
- 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 = method;
-
- boolean deleted = false;
- for( int i = 0; i < module.length; i++ ) {
- if( module[i].isExternal() )
- deleted = true;
- }
-
- // Monitor at this point has been begun with 1000 monitor
- IProgressMonitor subMon = ProgressMonitorUtil.submon(monitor, 1000);
- if (publishType == REMOVE_PUBLISH ) {
- status = unpublish(this.server, module, subMon);
- } else {
- if( deleted ) {
- publishState = IServer.PUBLISH_STATE_UNKNOWN;
- } else {
- if (publishType == FULL_PUBLISH ) {
- status = fullPublish(module, module[module.length-1], subMon);
- } else if (publishType == INCREMENTAL_PUBLISH) {
- status = incrementalPublish(module, module[module.length-1], subMon);
- }
- }
- }
- return status;
- }
-
- /**
- * Gets the actual deploy path for this module
- *
- * @param moduleTree
- * @param server
- * @return
- */
- protected IPath getDeployPath(IModule[] moduleTree, IDeployableServer server) {
- String folder = PublishUtil.getDeployRootFolder(
- moduleTree, server,
- publishMethod.getPublishDefaultRootFolder(server.getServer()),
- IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
- return PublishUtil.getDeployPath(moduleTree, folder);
- }
-
- /**
- * 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.
- *
- * Subclasses may override
- *
- * @param publishType
- * @param moduleTree
- * @param server
- * @param monitor
- */
- protected void finishPublish(int publishType, IModule[] moduleTree, IDeployableServer server, IProgressMonitor monitor){}
-
- private IPublishCopyCallbackHandler getCallbackHandler(IPath path) {
- return publishMethod.getCallbackHandler(path, server.getServer());
- }
-
- /**
- * For certain module trees, some publishers may want to force a child to be zipped.
- * For example, JST Publisher may want to force utility project children to be zipped.
- *
- * @param moduleTree
- * @return
- */
- protected boolean forceZipModule(IModule[] moduleTree) {
- return false;
- }
-
- protected IStatus canceledStatus() {
- return new Status(IStatus.CANCEL, JBossServerCorePlugin.PLUGIN_ID, "Publish Canceled"); //$NON-NLS-1$
- }
-
- protected IStatus fullPublish(IModule[] moduleTree, IModule module, IProgressMonitor monitor) throws CoreException {
- monitor.beginTask("Full Publish", 1000); //$NON-NLS-1$
-
- IPath deployPath = getDeployPath(moduleTree, server);
- IPublishCopyCallbackHandler callback = getCallbackHandler(deployPath);
- IModuleResource[] members = PublishUtil.getResources(module, ProgressMonitorUtil.submon(monitor, 200));
-
- if( monitor.isCanceled())
- return canceledStatus();
-
- // 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 ))
- callback.deleteResource(new Path("/"), ProgressMonitorUtil.submon(monitor, 100)); //$NON-NLS-1$
-
- if( monitor.isCanceled())
- return canceledStatus();
-
- ArrayList<IStatus> list = new ArrayList<IStatus>();
-
- boolean isBinaryObject = ServerModelUtilities.isBinaryModule(module);
- boolean forceZip = forceZipModule(moduleTree);
-
- if( !forceZip && !isBinaryObject) {
- PublishCopyUtil util = new PublishCopyUtil(callback);
- list.addAll(Arrays.asList(util.publishFull(members, ProgressMonitorUtil.submon(monitor, 700))));
- } else if( isBinaryObject )
- list.addAll(Arrays.asList(copyBinaryModule(moduleTree, ProgressMonitorUtil.submon(monitor, 700))));
- else {
- // A child that must be zipped, forceZip is true
- IPath deployRoot = JBossServerCorePlugin.getServerStateLocation(server.getServer()).
- append(IJBossServerConstants.TEMP_DEPLOY).makeAbsolute();
-
- try {
- File temp = deployRoot.toFile().createTempFile(module.getName(), ".tmp", deployRoot.toFile()); //$NON-NLS-1$
- IPath tempFile = new Path(temp.getAbsolutePath());
- list.addAll(Arrays.asList(PublishUtil.packModuleIntoJar(moduleTree[moduleTree.length-1], tempFile)));
- IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$
- String parentFolder = deployPath.removeLastSegments(1).toString();
- handler.makeDirectoryIfRequired(new Path(parentFolder), ProgressMonitorUtil.submon(monitor, 200));
- ModuleFile mf = new ModuleFile(tempFile.toFile(), tempFile.lastSegment(), tempFile);
- handler.copyFile(mf, deployPath, ProgressMonitorUtil.submon(monitor, 500));
- } catch( IOException ioe) {
- list.add(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, ioe.getMessage(), ioe));
- }
- }
-
- monitor.done();
- if( list.size() > 0 )
- return createMultiStatus(list, module);
- return Status.OK_STATUS;
- }
-
- protected IStatus incrementalPublish(IModule[] moduleTree, IModule module, IProgressMonitor monitor) throws CoreException {
- monitor.beginTask("Incremental Publish", 100); //$NON-NLS-1$
- IStatus[] results = new IStatus[] {};
- IPath deployPath = getDeployPath(moduleTree, server);
- boolean isBinaryObject = ServerModelUtilities.isBinaryModule(module);
- boolean forceZip = forceZipModule(moduleTree);
- if( !forceZip && !isBinaryObject) {
- IPublishCopyCallbackHandler handler = getCallbackHandler(deployPath);
- results = new PublishCopyUtil(handler).publishDelta(delta, ProgressMonitorUtil.submon(monitor, 100));
- } else if( delta.length > 0 ) {
- if( isBinaryObject)
- results = copyBinaryModule(moduleTree, ProgressMonitorUtil.submon(monitor, 100));
- else {
- // forceZip a child module
- IPath localDeployRoot = JBossServerCorePlugin.getServerStateLocation(server.getServer()).
- append(IJBossServerConstants.TEMP_DEPLOY).makeAbsolute();
- try {
- File temp = File.createTempFile(module.getName(), ".tmp", localDeployRoot.toFile()); //$NON-NLS-1$
- IPath tempFile = new Path(temp.getAbsolutePath());
- PublishUtil.packModuleIntoJar(moduleTree[moduleTree.length-1], tempFile);
- IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$
- String parentFolder = deployPath.removeLastSegments(1).toString();
- handler.makeDirectoryIfRequired(new Path(parentFolder), ProgressMonitorUtil.submon(monitor, 50));
- ModuleFile mf = new ModuleFile(tempFile.toFile(), tempFile.lastSegment(), tempFile);
- handler.copyFile(mf, deployPath, ProgressMonitorUtil.submon(monitor, 50));
- } catch( IOException ioe) {
- IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, ioe.getMessage(), ioe);
- results = new IStatus[] { s };
- }
- }
- }
-
- monitor.done();
- 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) {
- monitor.beginTask("Copy Binary Module", 100); //$NON-NLS-1$
- try {
- IPath destinationPath = getDeployPath(moduleTree, server);
- IModuleResource[] members = PublishUtil.getResources(moduleTree);
- File source = PublishUtil.getFile(members[0]);
- if( source != null ) {
- IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$
- IPath localFilePath = new Path(source.getAbsolutePath());
- ModuleFile mf = new ModuleFile(localFilePath.toFile(), localFilePath.lastSegment(), localFilePath);
- handler.copyFile(mf, destinationPath, new NullProgressMonitor());
- } 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()};
- }
- monitor.done();
- return new IStatus[]{Status.OK_STATUS};
- }
-
- protected IStatus unpublish(IDeployableServer jbServer, IModule[] module,
- IProgressMonitor monitor) throws CoreException {
- monitor.beginTask("Begin Unpublish", 100); //$NON-NLS-1$
- IPath remotePath = getDeployPath(module, server);
- IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$
- handler.deleteResource(remotePath, ProgressMonitorUtil.submon(monitor, 100));
- monitor.done();
- return Status.OK_STATUS;
- }
-}
Deleted: 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-08-10 18:50:48 UTC (rev 24031)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java 2010-08-11 08:41:16 UTC (rev 24032)
@@ -1,22 +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
- *
- * TODO: Logging and Progress Monitors
- ******************************************************************************/
-package org.jboss.ide.eclipse.as.rse.core;
-
-
-public class RSEJSTPublisher extends AbstractJSTPublisher {
-
- @Override
- protected String getTargetedPublishMethodId() {
- return RSEPublishMethod.RSE_ID;
- }
-}
Deleted: 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-08-10 18:50:48 UTC (rev 24031)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java 2010-08-11 08:41:16 UTC (rev 24032)
@@ -1,141 +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 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.Path;
-import org.eclipse.rse.core.RSECorePlugin;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.ISubSystem;
-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.internal.JBossServer;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
-import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-
-public class RSEPublishMethod extends AbstractPublishMethod {
-
- public static final String RSE_ID = "rse"; //$NON-NLS-1$
-
- private DeployableServerBehavior behaviour;
-
- @Override
- public String getPublishMethodId() {
- return RSE_ID;
- }
-
- private IFileServiceSubSystem fileSubSystem = null;
- private IPath remoteRootFolder;
- private IPath remoteTemporaryFolder;
- public void publishStart(DeployableServerBehavior behaviour,
- IProgressMonitor monitor) throws CoreException {
- this.behaviour = behaviour;
- loadRemoteDeploymentDetails();
- if (fileSubSystem != null && !fileSubSystem.isConnected()) {
- try {
- fileSubSystem.connect(monitor, false);
- } catch (Exception e) {
- }
- }
- super.publishStart(behaviour, monitor);
- }
- public IPath getRemoteRootFolder() {
- return remoteRootFolder;
- }
- public IPath getRemoteTemporaryFolder() {
- return remoteTemporaryFolder;
- }
- public IFileServiceSubSystem getFileServiceSubSystem() {
- return fileSubSystem;
- }
- public IFileService getFileService() {
- return fileSubSystem.getFileService();
- }
-
- public int publishFinish(DeployableServerBehavior behaviour,
- IProgressMonitor monitor) throws CoreException {
- return super.publishFinish(behaviour, monitor);
- }
-
- protected void loadRemoteDeploymentDetails() throws CoreException{
- // TODO obviously fix this
-// String homeDir = RSEUtils.getRSEHomeDir(behaviour.getServer());
-// String conf = RSEUtils.getRSEConfigName(behaviour.getServer());
- String connectionName = RSEUtils.getRSEConnectionName(behaviour.getServer());
-// this.remoteRootFolder = new Path("/home/rob/redhat/deploy"); //$NON-NLS-1$
-// this.remoteTemporaryFolder = new Path("/home/rob/redhat/tmp"); //$NON-NLS-1$
- JBossServer jbs = ServerConverter.getJBossServer(behaviour.getServer());
- this.remoteRootFolder = new Path(RSEUtils.getDeployRootFolder(jbs));
- this.remoteTemporaryFolder = new Path("/home/rob/redhat/tmp"); //$NON-NLS-1$
-
- IHost host = findHost(connectionName);
- if( host != null ) {
- fileSubSystem = findFileTransferSubSystem(host);
- } else {
- // TODO error host not found in RSE
- }
- }
-
- protected IHost findHost(String connectionName) {
- IHost[] allHosts = RSECorePlugin.getTheSystemRegistry().getHosts();
- for( int i = 0; i < allHosts.length; i++ ) {
- if( allHosts[i].getAliasName().equals(connectionName))
- return allHosts[i];
- }
- return null;
- }
-
- /* approved files subsystems *
- ftp.files
- local.files
- ssh.files
- */
- protected static List<String> APPROVED_FILE_SYSTEMS =
- Arrays.asList(new String[]{ "ftp.files", "local.files", "ssh.files"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- protected IFileServiceSubSystem findFileTransferSubSystem(IHost host) {
- ISubSystem[] systems = RSECorePlugin.getTheSystemRegistry().getSubSystems(host);
- for( int i = 0; i < systems.length; i++ ) {
- if( APPROVED_FILE_SYSTEMS.contains(systems[i].getConfigurationId()))
- return (IFileServiceSubSystem)systems[i];
- }
- return null;
- }
-
- public static IPath findModuleFolderWithDefault(IModule module, IDeployableServer server, IPath startingPath) {
- IModule[] moduleTree = new IModule[]{module};
- String folder = PublishUtil.getDeployRootFolder(
- moduleTree, server, startingPath.toString(),
- IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
- 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();
- }
-
-}
Deleted: 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 2010-08-10 18:50:48 UTC (rev 24031)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSERemotePublishHandler.java 2010-08-11 08:41:16 UTC (rev 24032)
@@ -1,80 +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
- *
- * 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.common.project.facet.core.util.internal.ProgressMonitorUtil;
-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 {
- monitor.beginTask("Make directory " + dir.toString(), 100); //$NON-NLS-1$
- if( dir.segmentCount() > 0 )
- makeDirectoryIfRequired(dir.removeLastSegments(1), ProgressMonitorUtil.submon(monitor, 70));
- 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(), ProgressMonitorUtil.submon(monitor, 30));
- } catch( SystemMessageException sme ) {
- System.err.println("failed to make folder " + toMake.toString()); //$NON-NLS-1$
- }
- createdFolders.add(toMake);
- monitor.done();
- return null;
- }
-}
-
Deleted: 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.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSESingleFilePublisher.java 2010-08-10 18:50:48 UTC (rev 24031)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSESingleFilePublisher.java 2010-08-11 08:41:16 UTC (rev 24032)
@@ -1,27 +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.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/RSEUtils.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSEUtils.java 2010-08-10 18:50:48 UTC (rev 24031)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSEUtils.java 2010-08-11 08:41:16 UTC (rev 24032)
@@ -1,95 +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.core.runtime.Path;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerAttributes;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
-import org.jboss.ide.eclipse.as.core.util.IConstants;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-
-
-/*
- * Some of this code will need to be abstracted out from JBossServer
- * and turned into a proper API, but in as simple a way as possible
- */
-public class RSEUtils {
- public static final String RSE_SERVER_CONFIG = "org.jboss.ide.eclipse.as.rse.core.RSEServerConfig"; //$NON-NLS-1$
- public static final String RSE_SERVER_HOME_DIR = "org.jboss.ide.eclipse.as.rse.core.RSEServerHomeDir"; //$NON-NLS-1$
- public static final String RSE_SERVER_HOST = "org.jboss.ide.eclipse.as.rse.core.ServerHost"; //$NON-NLS-1$
- public static final String RSE_SERVER_DEFAULT_HOST = "Local"; //$NON-NLS-1$
-
- public static String getRSEConnectionName(IServer server) {
- return server.getAttribute(RSEUtils.RSE_SERVER_HOST, RSE_SERVER_DEFAULT_HOST);
- }
-
- public static String getRSEHomeDir(IServerAttributes server) {
- return server.getAttribute(RSEUtils.RSE_SERVER_HOME_DIR, server.getRuntime().getLocation().toString());
- }
-
- public static String getRSEConfigName(IServerAttributes server) {
- IJBossServerRuntime runtime = ServerConverter.getJBossRuntime(server);
- return server.getAttribute(RSEUtils.RSE_SERVER_CONFIG, runtime.getJBossConfiguration());
- }
-
- public static String getDeployRootFolder(JBossServer server) {
- return getDeployRootFolder(server.getServer(), server.getDeployLocationType());
- }
-
- /* Copied from JBossServer.getDeployFolder(etc) */
- public static String getDeployRootFolder(IServer server, String type) {
- if( type.equals(JBossServer.DEPLOY_CUSTOM)) {
- String val = server.getAttribute(JBossServer.DEPLOY_DIRECTORY, (String)null);
- if( val != null ) {
- IPath val2 = new Path(val);
- return makeGlobal(server, val2).toString();
- }
- // if no value is set, default to metadata
- type = JBossServer.DEPLOY_SERVER;
- }
- // TODO error here, or sensible default?
- if( type.equals(JBossServer.DEPLOY_METADATA)) {
- return JBossServerCorePlugin.getServerStateLocation(server).
- append(IJBossServerConstants.DEPLOY).makeAbsolute().toString();
- } else if( type.equals(JBossServer.DEPLOY_SERVER)) {
- String loc = IConstants.SERVER;
- String config = getRSEConfigName(server);
- IPath p = new Path(loc).append(config)
- .append(IJBossServerConstants.DEPLOY);
- return makeGlobal(server, p).toString();
- }
- return null;
- }
-
- public static IPath makeRelative(IServer server, IPath p) {
- if( p.isAbsolute()) {
- if(new Path(getRSEHomeDir(server)).isPrefixOf(p)) {
- int size = new Path(getRSEHomeDir(server)).toOSString().length();
- return new Path(p.toOSString().substring(size)).makeRelative();
- }
- }
- return p;
- }
-
- public static IPath makeGlobal(IServer server, IPath p) {
- if( !p.isAbsolute()) {
- return new Path(getRSEHomeDir(server)).append(p).makeAbsolute();
- }
- return p;
- }
-
-
-}
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-08-10 18:50:48 UTC (rev 24031)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2010-08-11 08:41:16 UTC (rev 24032)
@@ -1047,27 +1047,4 @@
serverTypes="%AllJBTServerTypes">
</publishMethod>
</extension>
-
-
- <!-- Below here is RSE stuff which can / should be moved if a new plugin is created -->
- <extension
- point="org.jboss.ide.eclipse.as.core.publishMethod">
- <publishMethod
- class="org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod"
- id="rse"
- name="Remote System Deployment"
- serverTypes="%AllJBTServerTypes">
- </publishMethod>
- </extension>
- <extension
- point="org.jboss.ide.eclipse.as.core.publishers">
- <publisher
- class="org.jboss.ide.eclipse.as.rse.core.RSESingleFilePublisher"
- priority="7">
- </publisher>
- <publisher
- class="org.jboss.ide.eclipse.as.rse.core.RSEJSTPublisher"
- priority="5">
- </publisher>
- </extension>
</plugin>
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java 2010-08-10 18:50:48 UTC (rev 24031)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java 2010-08-11 08:41:16 UTC (rev 24032)
@@ -13,6 +13,7 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
+import java.util.HashMap;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
@@ -61,16 +62,57 @@
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader.DeploymentModulePrefs;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader.DeploymentPreferences;
-import org.jboss.ide.eclipse.as.core.util.IConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
-import org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod;
-import org.jboss.ide.eclipse.as.rse.core.RSEUtils;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.ui.Messages;
public class DeploymentModuleOptionCompositeAssistant implements PropertyChangeListener {
+ public static interface IDeploymentPageCallback {
+ public boolean metadataEnabled();
+ public String getServerLocation(IServerWorkingCopy wc);
+ public String getServerConfigName(IServerWorkingCopy wc);
+ public void propertyChange(PropertyChangeEvent evt, DeploymentModuleOptionCompositeAssistant composite);
+ }
+
+ public static class LocalDeploymentPageCallback implements IDeploymentPageCallback {
+ public boolean metadataEnabled() {
+ return true;
+ }
+
+ @Override
+ public String getServerLocation(IServerWorkingCopy wc) {
+ IJBossServerRuntime jbsrt = (IJBossServerRuntime)wc.getRuntime().loadAdapter(IJBossServerRuntime.class, null);
+ return jbsrt.getConfigLocation();
+ }
+
+ @Override
+ public String getServerConfigName(IServerWorkingCopy wc) {
+ IJBossServerRuntime jbsrt = (IJBossServerRuntime)wc.getRuntime().loadAdapter(IJBossServerRuntime.class, null);
+ return jbsrt.getJBossConfiguration();
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt,
+ DeploymentModuleOptionCompositeAssistant composite) {
+ // TODO Auto-generated method stub
+
+ }
+ }
+
+ private static HashMap<String, IDeploymentPageCallback> callbackMappings;
+ static {
+ callbackMappings = new HashMap<String, IDeploymentPageCallback>();
+ callbackMappings.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD, new LocalDeploymentPageCallback());
+ }
+
+ public static void addMapping(String mode, IDeploymentPageCallback callback) {
+ callbackMappings.put(mode, callback);
+ }
+
private ModuleDeploymentPage page;
private DeploymentPreferences preferences;
private TreeViewer viewer;
@@ -88,6 +130,10 @@
currentDeployType = LocalPublishMethod.LOCAL_PUBLISH_METHOD;
}
+ public ModuleDeploymentPage getPage() {
+ return page;
+ }
+
public String getCurrentDeployType() {
return currentDeployType;
}
@@ -115,7 +161,15 @@
private SelectionListener radioListener, zipListener;
private Button zipDeployWTPProjects;
private String lastCustomDeploy, lastCustomTemp;
+
+ public Button getServerRadio() {
+ return serverRadio;
+ }
+ public Button getCurrentSelection() {
+ return currentSelection;
+ }
+
protected Composite createDefaultComposite(Composite parent) {
FormToolkit toolkit = new FormToolkit(parent.getDisplay());
@@ -316,10 +370,13 @@
: serverRadio.getSelection() ? serverRadio : customRadio;
String mode = page.getServer().getAttribute(IDeployableServer.SERVER_MODE, LocalPublishMethod.LOCAL_PUBLISH_METHOD);
- metadataRadio.setEnabled(!mode.equals(RSEPublishMethod.RSE_ID));
-
- String newDir = getHelper().getAttribute(IDeployableServer.DEPLOY_DIRECTORY, "");
- String newTemp = getHelper().getAttribute(IDeployableServer.TEMP_DEPLOY_DIRECTORY, "");
+ boolean metaEnabled = callbackMappings.get(mode).metadataEnabled();
+ metadataRadio.setEnabled(metaEnabled);
+ JBossServer jbs = ServerConverter.getJBossServer(page.getServer().getOriginal());
+ String newDir = getHelper().getAttribute(IDeployableServer.DEPLOY_DIRECTORY,
+ jbs == null ? "" : jbs.getDeployFolder(jbs, getDeployType()));
+ String newTemp = getHelper().getAttribute(IDeployableServer.TEMP_DEPLOY_DIRECTORY,
+ jbs == null ? "" : jbs.getTempDeployFolder(jbs, getDeployType()));
deployText.removeModifyListener(deployListener);
deployText.setText(newDir);
deployText.addModifyListener(deployListener);
@@ -333,7 +390,7 @@
tempDeployButton.setEnabled(getDeployType().equals(IDeployableServer.DEPLOY_CUSTOM));
}
- protected void radioSelected(Object c) {
+ public void radioSelected(Object c) {
if (c == currentSelection)
return; // do nothing
page.execute(new RadioClickedCommand((Button)c, currentSelection));
@@ -467,17 +524,12 @@
} else if( newSelection == serverRadio ) {
if( server.getRuntime() != null &&
server.getRuntime().loadAdapter(IJBossServerRuntime.class, null) != null) {
- IJBossServerRuntime jbsrt = (IJBossServerRuntime)getServer().getServer().getRuntime().loadAdapter(IJBossServerRuntime.class, null);
String loc, config;
loc = config = null;
String mode = getHelper().getAttribute(IDeployableServer.SERVER_MODE, LocalPublishMethod.LOCAL_PUBLISH_METHOD);
- if( mode.equals(LocalPublishMethod.LOCAL_PUBLISH_METHOD)){
- loc = jbsrt.getConfigLocation();
- config = jbsrt.getJBossConfiguration();
- } else if( mode.equals(RSEPublishMethod.RSE_ID)) {
- loc = IConstants.SERVER;
- config = RSEUtils.getRSEConfigName(getHelper().getWorkingCopy());
- }
+ IDeploymentPageCallback cb = callbackMappings.get(mode);
+ loc = cb.getServerLocation(page.getServer());
+ config = cb.getServerConfigName(page.getServer());
newDir = new Path(loc)
.append(config)
.append(IJBossServerConstants.DEPLOY).toString();
@@ -706,16 +758,13 @@
@Override
public void propertyChange(PropertyChangeEvent evt) {
if( evt.getPropertyName().equals( IDeployableServer.SERVER_MODE)) {
- metadataRadio.setEnabled(evt.getNewValue().equals(LocalPublishMethod.LOCAL_PUBLISH_METHOD));
+ String mode = page.getServer().getAttribute(IDeployableServer.SERVER_MODE, LocalPublishMethod.LOCAL_PUBLISH_METHOD);
+ metadataRadio.setEnabled(callbackMappings.get(mode).metadataEnabled());
String originalDeployLocation = page.getServer().getOriginal().getAttribute(IDeployableServer.DEPLOY_DIRECTORY_TYPE, IDeployableServer.DEPLOY_CUSTOM);
String wcDeployLocation = page.getServer().getAttribute(IDeployableServer.DEPLOY_DIRECTORY_TYPE, IDeployableServer.DEPLOY_CUSTOM);
if(!metadataRadio.isEnabled() && metadataRadio.getSelection()) {
page.execute(new RadioClickedCommand(serverRadio, currentSelection));
}
- } else if( serverRadio.getSelection() && (
- evt.getPropertyName().equals( RSEUtils.RSE_SERVER_CONFIG) ||
- evt.getPropertyName().equals( RSEUtils.RSE_SERVER_HOME_DIR))) {
- page.execute(new RadioClickedCommand(serverRadio, currentSelection));
- }
+ }
}
}
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2010-08-10 18:50:48 UTC (rev 24031)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2010-08-11 08:41:16 UTC (rev 24032)
@@ -585,12 +585,4 @@
typeIds="%AllJBossServerTypes">
</runtimeLocator>
</extension>
- <extension
- point="org.jboss.ide.eclipse.as.ui.DeployMethodUI">
- <ui
- class="org.jboss.tools.as.rse.ui.RSEDeploymentPreferenceUI"
- deployMethodId="rse">
- </ui>
- </extension>
-
</plugin>
15 years, 5 months
JBoss Tools SVN: r24031 - in trunk/bpel/plugins: org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/util and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: bbrodt
Date: 2010-08-10 14:50:48 -0400 (Tue, 10 Aug 2010)
New Revision: 24031
Added:
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/util/DeployResourceSetImpl.java
Modified:
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/pages/ProcessPage.java
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/util/DeployUtils.java
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/resource/BPELResourceSetImpl.java
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/WSDLImportResolver.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/SchemaImportDialog.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/CreatePartnerLinkWizard.java
Log:
https://jira.jboss.org/browse/JBIDE-6786
Modified: trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/pages/ProcessPage.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/pages/ProcessPage.java 2010-08-10 18:27:39 UTC (rev 24030)
+++ trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/pages/ProcessPage.java 2010-08-10 18:50:48 UTC (rev 24031)
@@ -33,6 +33,7 @@
import org.eclipse.bpel.apache.ode.deploy.model.dd.ddPackage;
import org.eclipse.bpel.apache.ode.deploy.ui.Activator;
import org.eclipse.bpel.apache.ode.deploy.ui.editors.ODEDeployMultiPageEditor;
+import org.eclipse.bpel.apache.ode.deploy.ui.util.DeployResourceSetImpl;
import org.eclipse.bpel.apache.ode.deploy.ui.util.DeployUtils;
import org.eclipse.bpel.model.BPELFactory;
import org.eclipse.bpel.model.PartnerLink;
@@ -59,6 +60,7 @@
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.edit.command.AddCommand;
import org.eclipse.emf.edit.command.RemoveCommand;
import org.eclipse.emf.edit.command.SetCommand;
@@ -149,6 +151,9 @@
private EditingDomain domain;
private TableViewer scopeTableViewer;
private Form mainform;
+ // https://jira.jboss.org/browse/JBIDE-6786
+ // we will manage this for ServiceCellEditor and PortTypeLabelProvider
+ private ResourceSetImpl resourceSet = null;
public ProcessPage(FormEditor editor, ProcessType pt) {
super(editor, "ODED" + pt.getName().toString(), pt.getName().getLocalPart()); //$NON-NLS-1$
@@ -158,6 +163,8 @@
ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE);
this.domain = this.editor.getEditingDomain();
+ // https://jira.jboss.org/browse/JBIDE-6786
+ resourceSet = new DeployResourceSetImpl();
}
@Override
@@ -300,7 +307,8 @@
viewer.setUseHashlookup(true);
viewer.setColumnProperties(columnNames);
viewer.setContentProvider(new PortTypeContentProvider(isInbound));
- viewer.setLabelProvider(new PortTypeLabelProvider(ddFile.getProject(), current.eResource().getResourceSet()));
+ // https://jira.jboss.org/browse/JBIDE-6786
+ viewer.setLabelProvider(new PortTypeLabelProvider(ddFile.getProject(), resourceSet));
viewer.setInput(current);
for (int i = 0, n = t.getColumnCount(); i < n; i++) {
@@ -319,7 +327,8 @@
// t.addListener(SWT.MouseDown, tableListener);
// Column 2 : Associate Service (ComboBox)
- ServiceCellEditor sCellEditor = new ServiceCellEditor(t, ddFile.getProject(), current.eResource().getResourceSet());
+ // https://jira.jboss.org/browse/JBIDE-6786
+ ServiceCellEditor sCellEditor = new ServiceCellEditor(t, ddFile.getProject(), resourceSet);
editors[1] = sCellEditor;
// Assign the cell editors to the viewer
@@ -606,11 +615,18 @@
class PortTypeLabelProvider extends LabelProvider implements ITableLabelProvider {
protected IProject bpelProject = null;
- protected ResourceSet resourceSet = null;
+ protected ResourceSetImpl resourceSet = null;
- public PortTypeLabelProvider(IProject bpelProject, ResourceSet resourceSet){
+ public PortTypeLabelProvider(IProject bpelProject, ResourceSetImpl resourceSet){
this.bpelProject = bpelProject;
- this.resourceSet = resourceSet;
+ // https://jira.jboss.org/browse/JBIDE-6786
+ // ProcessPage allocates the resourceSet - this should never be null!
+ if (resourceSet != null) {
+ this.resourceSet = resourceSet;
+ }
+ else {
+ this.resourceSet = new ResourceSetImpl();
+ }
}
public String getColumnText(Object obj, int index) {
Added: trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/util/DeployResourceSetImpl.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/util/DeployResourceSetImpl.java (rev 0)
+++ trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/util/DeployResourceSetImpl.java 2010-08-10 18:50:48 UTC (rev 24031)
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2006 Oracle Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.bpel.apache.ode.deploy.ui.util;
+
+import org.eclipse.bpel.model.resource.BPELResourceSetImpl;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+
+/**
+ * @author Bob Brodt (bbrodt(a)redhat.com)
+ * @date Aug 10, 2010
+ */
+
+@SuppressWarnings("nls")
+public class DeployResourceSetImpl extends BPELResourceSetImpl {
+
+ public DeployResourceSetImpl() {
+ super();
+ }
+
+ @Override
+ public Resource getResource(URI uri, boolean loadOnDemand) {
+ String name = uri.toString().toLowerCase();
+ if (name.endsWith("wsdl"))
+ return getResource(uri,true,"wsdl");
+ if (name.endsWith("wsil"))
+ return getResource(uri,true,"wsil");
+ if (name.endsWith(".xsd"))
+ return getResource(uri,true,"xsd");
+ if (name.endsWith(".bpel"))
+ return getResource(uri,true,"bpel");
+ return super.getResource(uri,loadOnDemand);
+ }
+}
Modified: trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/util/DeployUtils.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/util/DeployUtils.java 2010-08-10 18:27:39 UTC (rev 24030)
+++ trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/util/DeployUtils.java 2010-08-10 18:50:48 UTC (rev 24031)
@@ -201,6 +201,15 @@
wsdlFiles.add(currentDef);
}
}
+
+ // https://jira.jboss.org/browse/JBIDE-6786
+ // Add WSDLs that were resolved as imports, to the list
+ for (Resource res : resourceSet.getResources())
+ {
+ Definition def = (Definition)res.getContents().get(0);
+ if (!wsdlFiles.contains(def))
+ wsdlFiles.add(def);
+ }
return wsdlFiles;
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/resource/BPELResourceSetImpl.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/resource/BPELResourceSetImpl.java 2010-08-10 18:27:39 UTC (rev 24030)
+++ trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/resource/BPELResourceSetImpl.java 2010-08-10 18:50:48 UTC (rev 24031)
@@ -74,13 +74,24 @@
@SuppressWarnings("nls")
public Resource getResource(URI uri, boolean loadOnDemand, String kind) {
+ // https://jira.jboss.org/browse/JBIDE-6786
+ // don't bother if URI is null or empty
+ if (uri==null || uri.isEmpty())
+ return null;
+
Map<URI, Resource> map = getURIResourceMap();
if (map != null) {
Resource resource = map.get(uri);
if (resource != null) {
if (loadOnDemand && !resource.isLoaded()) {
- demandLoadHelper(resource);
+ // https://jira.jboss.org/browse/JBIDE-6786
+ // if load fails, mark resource as unloaded
+ try {
+ demandLoadHelper(resource);
+ } catch (Exception ex) {
+ resource.unload();
+ }
}
return resource;
@@ -94,7 +105,14 @@
if (theURIConverter.normalize(resource.getURI()).equals(
normalizedURI)) {
if (loadOnDemand && !resource.isLoaded()) {
- demandLoadHelper(resource);
+ // https://jira.jboss.org/browse/JBIDE-6786
+ // if load fails, mark resource as unloaded
+ try {
+ demandLoadHelper(resource);
+ } catch (Exception ex) {
+ resource.unload();
+ break;
+ }
}
if (map != null) {
Modified: trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/WSDLImportResolver.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/WSDLImportResolver.java 2010-08-10 18:27:39 UTC (rev 24030)
+++ trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/WSDLImportResolver.java 2010-08-10 18:50:48 UTC (rev 24031)
@@ -133,7 +133,9 @@
if (what == RESOLVE_DEFINITION) {
ArrayList<Object> al = new ArrayList<Object>(1);
- al.add(definition);
+ // https://jira.jboss.org/browse/JBIDE-6786
+ if (definition!=null)
+ al.add(definition);
return al;
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/SchemaImportDialog.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/SchemaImportDialog.java 2010-08-10 18:27:39 UTC (rev 24030)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/SchemaImportDialog.java 2010-08-10 18:50:48 UTC (rev 24031)
@@ -593,7 +593,8 @@
return t;
}
- if (resource.getErrors().isEmpty() && resource.isLoaded()) {
+ // https://jira.jboss.org/browse/JBIDE-6786
+ if (resource!=null && resource.getErrors().isEmpty() && resource.isLoaded()) {
return resource.getContents().get(0);
}
return null;
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/CreatePartnerLinkWizard.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/CreatePartnerLinkWizard.java 2010-08-10 18:27:39 UTC (rev 24030)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/CreatePartnerLinkWizard.java 2010-08-10 18:50:48 UTC (rev 24031)
@@ -37,6 +37,7 @@
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.wst.wsdl.Definition;
import org.eclipse.wst.wsdl.PortType;
@@ -101,7 +102,13 @@
IBPELUIConstants.ICON_WIZARD_BANNER));
IFile file = EditModel.getIFileForURI(fMandatoryPortType.eResource().getURI());
- fRolePage2.setOptionalDefinitions( getOptionalDefinitions(file.getProject()) );
+ if (file==null)
+ // https://jira.jboss.org/browse/JBIDE-6786
+ // if WSDL is not a file (e.g. http://service.com?WSDL) use editor's input file project
+ file = ((FileEditorInput)fEditor.getEditorInput()).getFile();
+
+ if (file!=null)
+ fRolePage2.setOptionalDefinitions( getOptionalDefinitions(file.getProject()) );
fRolePage2.setOptional(true);
@@ -126,7 +133,7 @@
if (resource.getType() == IResource.FILE && "wsdl".equalsIgnoreCase(resource.getFileExtension())) {
IFile artifactFile = EditModel.getIFileForURI(fEditor.getArtifactsDefinition().eResource().getURI());
- if (!(artifactFile.getFullPath().equals(((IFile)resource).getFullPath()))) {
+ if (artifactFile==null || !(artifactFile.getFullPath().equals(((IFile)resource).getFullPath()))) {
//filter artifacts WSDL
wsdlFiles.add((IFile)resource);
}
15 years, 5 months
JBoss Tools SVN: r24030 - trunk/xulrunner-1.9.1.2/site.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-08-10 14:27:39 -0400 (Tue, 10 Aug 2010)
New Revision: 24030
Added:
trunk/xulrunner-1.9.1.2/site/site.xml
Removed:
trunk/xulrunner-1.9.1.2/site/org.mozilla.xulrunner.site/
Modified:
trunk/xulrunner-1.9.1.2/site/pom.xml
Log:
remove nesting of update site
Modified: trunk/xulrunner-1.9.1.2/site/pom.xml
===================================================================
--- trunk/xulrunner-1.9.1.2/site/pom.xml 2010-08-10 17:24:19 UTC (rev 24029)
+++ trunk/xulrunner-1.9.1.2/site/pom.xml 2010-08-10 18:27:39 UTC (rev 24030)
@@ -1,17 +1,13 @@
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jboss.tools</groupId>
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools</groupId>
- <artifactId>xulrunner.site</artifactId>
+ <artifactId>org.mozilla.xulrunner.site</artifactId>
<version>0.0.1-SNAPSHOT</version>
- <packaging>pom</packaging>
- <modules>
- <module>org.mozilla.xulrunner.site</module>
- </modules>
+ <packaging>eclipse-update-site</packaging>
</project>
-
Added: trunk/xulrunner-1.9.1.2/site/site.xml
===================================================================
--- trunk/xulrunner-1.9.1.2/site/site.xml (rev 0)
+++ trunk/xulrunner-1.9.1.2/site/site.xml 2010-08-10 18:27:39 UTC (rev 24030)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<site>
+ <feature url="features/org.mozilla.xulrunner.feature_0.0.0.jar" id="org.mozilla.xulrunner.feature" version="0.0.0">
+ <category name="XulRunner"/>
+ </feature>
+ <feature url="features/org.mozilla.xpcom.feature_0.0.0.jar" id="org.mozilla.xpcom.feature" version="0.0.0">
+ <category name="XulRunner"/>
+ </feature>
+ <category-def name="XulRunner" label="XulRunner support for JBoss Tools">
+ <description>XulRunner support for JBoss Tools</description>
+ </category-def>
+</site>
15 years, 5 months
JBoss Tools SVN: r24029 - in trunk/jst/plugins/org.jboss.tools.jst.web.ui: src/org/jboss/tools/jst/web/ui/editor/pref/template/contentassist and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2010-08-10 13:24:19 -0400 (Tue, 10 Aug 2010)
New Revision: 24029
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/editor/pref/template/contentassist/XHTMLTemplateContentAssistComputer.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
Log:
JBIDE-6807: Move the CA processor for the Visual Page Editor Code Templates to the CA Computer due to be invoked by WTP CA
Issue is fixed
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2010-08-10 17:01:22 UTC (rev 24028)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2010-08-10 17:24:19 UTC (rev 24029)
@@ -756,8 +756,26 @@
</newWizardShortcut>
</perspectiveExtension>
</extension>
+
+ <!-- The following extension point is subject to be removed due of its deprecation
<extension
point="org.jboss.tools.jst.jsp.editorContentAssistent">
<contentassisten class="org.jboss.tools.jst.web.ui.editor.pref.template.contentassist.XHTMLContentAssistProcessor"/>
</extension>
+ -->
+ <extension
+ point="org.eclipse.wst.sse.ui.completionProposal">
+ <proposalComputer
+ activate="false"
+ categoryId="org.eclipse.wst.html.ui.proposalCategory.htmlTemplates"
+ class="org.jboss.tools.jst.web.ui.editor.pref.template.contentassist.XHTMLTemplateContentAssistComputer"
+ id="org.jboss.tools.jst.web.ui.editor.template">
+ <contentType id="org.eclipse.wst.html.core.htmlsource">
+ <partitionType id="org.eclipse.wst.html.HTML_DEFAULT" />
+ </contentType>
+ <contentType id="jsf.facelet">
+ <partitionType id="org.eclipse.wst.html.HTML_DEFAULT" />
+ </contentType>
+ </proposalComputer>
+ </extension>
</plugin>
Added: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/editor/pref/template/contentassist/XHTMLTemplateContentAssistComputer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/editor/pref/template/contentassist/XHTMLTemplateContentAssistComputer.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/editor/pref/template/contentassist/XHTMLTemplateContentAssistComputer.java 2010-08-10 17:24:19 UTC (rev 24029)
@@ -0,0 +1,168 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.ui.editor.pref.template.contentassist;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
+import org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer;
+import org.jboss.tools.jst.web.ui.editor.pref.template.TemplateContextTypeIdsXHTML;
+import org.w3c.dom.Node;
+
+/**
+ * XHTML Content Assist Computer for Templates, a computer which adds templates
+ * proposals to CA
+ *
+ * @author Jeremy
+ *
+ */
+@SuppressWarnings("restriction")
+public class XHTMLTemplateContentAssistComputer implements ICompletionProposalComputer {
+ protected IPreferenceStore fPreferenceStore = null;
+ protected boolean isXHTML = false;
+ private XHTMLTemplateCompletionProcessor fTemplateProcessor = null;
+
+
+ public XHTMLTemplateContentAssistComputer() {
+ super();
+ }
+
+ @SuppressWarnings("rawtypes")
+ public List computeCompletionProposals(
+ CompletionProposalInvocationContext context,
+ IProgressMonitor monitor) {
+ List<ICompletionProposal> result = new ArrayList<ICompletionProposal>();
+ List<String> fContextTypes = getContentTypes(context.getViewer(),
+ context.getInvocationOffset());
+ addTemplates(context.getViewer(), result, fContextTypes,
+ context.getInvocationOffset());
+ return result;
+ }
+
+ @SuppressWarnings("rawtypes")
+ public List computeContextInformation(
+ CompletionProposalInvocationContext context,
+ IProgressMonitor monitor) {
+ return new ArrayList();
+ }
+
+ public String getErrorMessage() {
+ return null;
+ }
+
+ /**
+ * <p>default is to do nothing</p>
+ *
+ * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#sessionEnded()
+ */
+ public void sessionEnded() {
+ //default is to do nothing
+ }
+
+ /**
+ * <p>default is to do nothing</p>
+ *
+ * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#sessionStarted()
+ */
+ public void sessionStarted() {
+ //default is to do nothing
+ }
+
+
+ /**
+ * Function for culculation content type depending on position
+ * @param textViewer
+ * @param documentPosition
+ * @return List of content types
+ *
+ * @author mareshkau
+ */
+ private List<String> getContentTypes(ITextViewer textViewer, int documentPosition){
+ List<String> fContextTypes = new ArrayList<String>();
+ //this should be added in any case
+ fContextTypes.add(TemplateContextTypeIdsXHTML.ALL);
+ IDocument document = textViewer.getDocument();
+ IStructuredModel model = null;
+ try {
+ model = StructuredModelManager.getModelManager()
+ .getExistingModelForRead(document);
+ Node node = (Node) model.getIndexedRegion(documentPosition);
+
+ if(node==null||node.getNodeType()==Node.DOCUMENT_NODE){
+ fContextTypes.add(TemplateContextTypeIdsXHTML.NEW);
+ }
+ //commented by Maksim Areshkau, because even on attribute we get type ELEMENT_NODE
+// else if(node.getNodeType()==Node.ATTRIBUTE_NODE){
+// fContextTypes.add(TemplateContextTypeIdsXHTML.ATTRIBUTE);
+// fContextTypes.add(TemplateContextTypeIdsXHTML.ATTRIBUTE_VALUE);
+// }
+ else if(node.getNodeType()==Node.ELEMENT_NODE ||node.getNodeType()==Node.TEXT_NODE) {
+ fContextTypes.add(TemplateContextTypeIdsXHTML.ATTRIBUTE);
+ fContextTypes.add(TemplateContextTypeIdsXHTML.ATTRIBUTE_VALUE);
+ fContextTypes.add(TemplateContextTypeIdsXHTML.TAG);
+ }
+
+ }
+ finally{
+ if (model != null) {
+ model.releaseFromRead();
+ }
+ }
+// fContextTypes.add(TemplateContextTypeIdsXHTML.TAG);
+// fContextTypes.add(TemplateContextTypeIdsXHTML.NEW);
+// fContextTypes.add(TemplateContextTypeIdsXHTML.ATTRIBUTE);
+// fContextTypes.add(TemplateContextTypeIdsXHTML.ATTRIBUTE_VALUE);
+ return fContextTypes;
+ }
+
+ /**
+ * Adds templates to the list of proposals
+ *
+ * @param contentAssistRequest
+ * @param context
+ * @param startOffset
+ */
+ private void addTemplates(ITextViewer fTextViewer,
+ List<ICompletionProposal> contentAssistRequest,
+ List<String> fTemplateContexts, int startOffset) {
+ if (contentAssistRequest == null)
+ return;
+
+ // if already adding template proposals for a certain context type, do
+ // not add again
+ if (getTemplateCompletionProcessor() != null) {
+ for (String context : fTemplateContexts) {
+ getTemplateCompletionProcessor().setContextType(context);
+ ICompletionProposal[] proposals = getTemplateCompletionProcessor()
+ .computeCompletionProposals(fTextViewer, startOffset);
+ for (int i = 0; i < proposals.length; ++i) {
+ contentAssistRequest.add(proposals[i]);
+ }
+ }
+ }
+ }
+
+ private XHTMLTemplateCompletionProcessor getTemplateCompletionProcessor() {
+ if (this.fTemplateProcessor == null) {
+ this.fTemplateProcessor = new XHTMLTemplateCompletionProcessor();
+ }
+ return this.fTemplateProcessor;
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/editor/pref/template/contentassist/XHTMLTemplateContentAssistComputer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 5 months
JBoss Tools SVN: r24028 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse: console and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-08-10 13:01:22 -0400 (Tue, 10 Aug 2010)
New Revision: 24028
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/codegen/ExportAntCodeGenWizardPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java
Log:
https://jira.jboss.org/browse/JBIDE-6620 - fixed
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/codegen/ExportAntCodeGenWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/codegen/ExportAntCodeGenWizardPage.java 2010-08-10 17:01:01 UTC (rev 24027)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/codegen/ExportAntCodeGenWizardPage.java 2010-08-10 17:01:22 UTC (rev 24028)
@@ -12,14 +12,25 @@
import java.io.ByteArrayInputStream;
import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ComboDialogField;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
+import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -27,6 +38,13 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+import org.eclipse.ui.ide.undo.CreateFileOperation;
+import org.eclipse.ui.ide.undo.WorkspaceUndoUtil;
+import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
+import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
+import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.console.KnownConfigurations;
+import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.LaunchHelper;
import org.hibernate.eclipse.launch.CodeGenXMLFactory;
@@ -40,6 +58,8 @@
protected ComboDialogField consoleConfigurationName;
+ protected CodeGenXMLFactory codeGenXMLFactory = null;
+
/**
* Creates a new file creation (Ant code generation) wizard page. If the initial resource
* selection contains exactly one container resource then it will be used as the default
@@ -123,9 +143,7 @@
res = false;
} else {
String checkMessage = checkCodeGenLaunchConfig(lc);
- if (checkMessage != null) {
- checkMessage = HibernateConsoleMessages.ExportAntCodeGenWizardPage_error_in_hibernate_code_generation_configuration
- + " " + checkMessage; //$NON-NLS-1$
+ if (checkMessage != null) {
setMessage(checkMessage, IMessageProvider.WARNING);
}
}
@@ -134,14 +152,45 @@
return res;
}
+ protected ConsoleConfigurationPreferences getConsoleConfigPreferences(String consoleConfigName) {
+ ConsoleConfiguration consoleConfig = KnownConfigurations.getInstance().find(consoleConfigName);
+ if (consoleConfig == null) {
+ return null;
+ }
+ return consoleConfig.getPreferences();
+ }
+
protected String checkCodeGenLaunchConfig(ILaunchConfiguration lc) {
String checkMessage = null;
+ ExporterAttributes attributes = null;
try {
- ExporterAttributes attributes = new ExporterAttributes(lc);
+ attributes = new ExporterAttributes(lc);
checkMessage = attributes.checkExporterAttributes();
} catch (CoreException e) {
checkMessage = e.getMessage();
}
+ if (checkMessage != null) {
+ checkMessage = NLS.bind(HibernateConsoleMessages.ExportAntCodeGenWizardPage_error_in_hibernate_code_generation_configuration,
+ checkMessage);
+ }
+ if (checkMessage == null && attributes != null) {
+ String consoleConfigName = attributes.getConsoleConfigurationName();
+ ConsoleConfigurationPreferences consoleConfigPrefs =
+ getConsoleConfigPreferences(consoleConfigName);
+ String connProfileName = consoleConfigPrefs == null ? null :
+ consoleConfigPrefs.getConnectionProfileName();
+ if (!CodeGenXMLFactory.isEmpty(connProfileName)) {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ String externalPropFileName = CodeGenXMLFactory.propFileNameSuffix;
+ externalPropFileName = getFileName() + "." + externalPropFileName; //$NON-NLS-1$
+ String problemMessage = NLS.bind(HibernateConsoleMessages.ExportAntCodeGenWizardPage_warning,
+ externalPropFileName);
+ IPath resourcePath = getContainerFullPath().append(externalPropFileName);
+ if (workspace.getRoot().getFile(resourcePath).exists()) {
+ checkMessage = problemMessage;
+ }
+ }
+ }
return checkMessage;
}
@@ -164,8 +213,83 @@
if (lc == null) {
return null;
}
- final CodeGenXMLFactory codeGenXMLFactory = new CodeGenXMLFactory(lc);
+ codeGenXMLFactory = new CodeGenXMLFactory(lc);
+ String externalPropFileName = CodeGenXMLFactory.propFileNameSuffix;
+ externalPropFileName = getFileName() + "." + externalPropFileName; //$NON-NLS-1$
+ codeGenXMLFactory.setExternalPropFileName(externalPropFileName);
String buildXml = codeGenXMLFactory.createCodeGenXML();
return new ByteArrayInputStream(buildXml.getBytes());
}
+
+ public IFile createNewFile() {
+ codeGenXMLFactory = null;
+ IFile res = super.createNewFile();
+ if (codeGenXMLFactory != null && res != null) {
+ final String propFileContentPreSave = codeGenXMLFactory.getPropFileContentPreSave();
+ if (!CodeGenXMLFactory.isEmpty(propFileContentPreSave)) {
+ IPath path = res.getFullPath();
+ path = path.removeLastSegments(1);
+ path = path.append(codeGenXMLFactory.getExternalPropFileName());
+ final IFile newFileHandle = createFileHandle(path);
+ final InputStream initialContents = new ByteArrayInputStream(
+ propFileContentPreSave.getBytes());
+ IRunnableWithProgress op = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) {
+ CreateFileOperation op = new CreateFileOperation(newFileHandle, null,
+ initialContents,
+ IDEWorkbenchMessages.WizardNewFileCreationPage_title);
+ try {
+ // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=219901
+ // directly execute the operation so that the undo state is
+ // not preserved. Making this undoable resulted in too many
+ // accidental file deletions.
+ op.execute(monitor, WorkspaceUndoUtil.getUIInfoAdapter(getShell()));
+ } catch (final ExecutionException e) {
+ getContainer().getShell().getDisplay().syncExec(new Runnable() {
+ public void run() {
+ if (e.getCause() instanceof CoreException) {
+ ErrorDialog
+ .openError(
+ getContainer().getShell(), // Was
+ // Utilities.getFocusShell()
+ IDEWorkbenchMessages.WizardNewFileCreationPage_errorTitle,
+ null, // no special
+ // message
+ ((CoreException) e.getCause()).getStatus());
+ } else {
+ IDEWorkbenchPlugin.log(getClass(),
+ "createNewFile()", e.getCause()); //$NON-NLS-1$
+ MessageDialog
+ .openError(
+ getContainer().getShell(),
+ IDEWorkbenchMessages.WizardNewFileCreationPage_internalErrorTitle,
+ NLS.bind(
+ IDEWorkbenchMessages.WizardNewFileCreationPage_internalErrorMessage,
+ e.getCause().getMessage()));
+ }
+ }
+ });
+ }
+ }
+ };
+ try {
+ getContainer().run(true, true, op);
+ } catch (InterruptedException e) {
+ } catch (InvocationTargetException e) {
+ // Execution Exceptions are handled above but we may still get
+ // unexpected runtime errors.
+ IDEWorkbenchPlugin.log(getClass(), "createNewFile()", e.getTargetException()); //$NON-NLS-1$
+ MessageDialog
+ .open(MessageDialog.ERROR,
+ getContainer().getShell(),
+ IDEWorkbenchMessages.WizardNewFileCreationPage_internalErrorTitle,
+ NLS.bind(
+ IDEWorkbenchMessages.WizardNewFileCreationPage_internalErrorMessage,
+ e.getTargetException().getMessage()), SWT.SHEET);
+
+ }
+ }
+ }
+ return res;
+ }
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java 2010-08-10 17:01:01 UTC (rev 24027)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java 2010-08-10 17:01:22 UTC (rev 24028)
@@ -385,6 +385,7 @@
public static String CodeGenerationSettingsTab_use_custom_templates;
public static String CodeGenerationSettingsTab_use_existing;
public static String CodeGenerationSettingsTab_workspace;
+ public static String CodeGenerationSettingsTab_use_generation_in_external_process;
public static String ConsoleConfigurationLaunchDelegate_direct_launch_not_supported;
public static String ConsoleConfigurationMainTab_annotations;
public static String ConsoleConfigurationMainTab_cfg_xml;
@@ -523,6 +524,11 @@
public static String ExportAntCodeGenWizardPage_empty_hibernate_code_generation_configuration;
public static String ExportAntCodeGenWizardPage_cannot_find_selected_hibernate_code_generation_configuration;
public static String ExportAntCodeGenWizardPage_error_in_hibernate_code_generation_configuration;
+ public static String ExportAntCodeGenWizardPage_warning;
+
+ public static String QueryParametersPage_add_query_parameter_tooltip;
+ public static String QueryParametersPage_remove_query_parameter_tooltip;
+ public static String QueryParametersPage_enable_disable_parameters_tooltip;
//
static {
// initialize resource bundle
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2010-08-10 17:01:01 UTC (rev 24027)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2010-08-10 17:01:22 UTC (rev 24028)
@@ -388,6 +388,7 @@
CodeGenerationSettingsTab_use_custom_templates=Use custom templates (for custom file generation)
CodeGenerationSettingsTab_use_existing=Use &existing...
CodeGenerationSettingsTab_workspace=&Workspace...
+CodeGenerationSettingsTab_use_generation_in_external_process=Use generation in external process
ConsoleConfigurationLaunchDelegate_direct_launch_not_supported=Direct launch not supported
ConsoleConfigurationMainTab_annotations=Annotations (jdk 1.5+)
ConsoleConfigurationMainTab_cfg_xml=cfg.xml
@@ -522,4 +523,9 @@
ExportAntCodeGenWizardPage_hibernate_code_generation_configurations=Hibernate Code Generation Configurations:
ExportAntCodeGenWizardPage_empty_hibernate_code_generation_configuration=Hibernate Code Generation Configuration is empty
ExportAntCodeGenWizardPage_cannot_find_selected_hibernate_code_generation_configuration=Can't find selected Hibernate Code Generation Configuration
-ExportAntCodeGenWizardPage_error_in_hibernate_code_generation_configuration=Error in Hibernate Code Generation Configuration:
+ExportAntCodeGenWizardPage_error_in_hibernate_code_generation_configuration=Error in Hibernate Code Generation Configuration: ''{0}''
+ExportAntCodeGenWizardPage_warning=Warning: ''{0}'' already exists.
+
+QueryParametersPage_add_query_parameter_tooltip=Add Query Parameter
+QueryParametersPage_remove_query_parameter_tooltip=Remove Query Parameter
+QueryParametersPage_enable_disable_parameters_tooltip=Enable/Disable Parameters
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java 2010-08-10 17:01:01 UTC (rev 24027)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java 2010-08-10 17:01:22 UTC (rev 24028)
@@ -13,6 +13,7 @@
import java.io.ByteArrayOutputStream;
import java.net.URISyntaxException;
import java.net.URL;
+import java.util.Arrays;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -58,14 +59,26 @@
*/
public static final long versionUID4PropFile = 1841714864553304000L;
/**
+ */
+ public static final String propFileNameSuffix = "hibernate.properties"; //$NON-NLS-1$
+ /**
* presave generated Hibernate Properties file content,
* this is necessary to proper content formating
*/
protected String propFileContentPreSave = ""; //$NON-NLS-1$
/**
- * generate Ant scrip from this launch configuration
+ * generate Ant script from this launch configuration
*/
protected ILaunchConfiguration lc = null;
+ /**
+ * generate external Hibernate Properties file or
+ * put generated properties into Ant script directly
+ */
+ protected boolean externalPropFile = true;
+ /**
+ * file name for generated properties file
+ */
+ protected String externalPropFileName = propFileNameSuffix;
public CodeGenXMLFactory(ILaunchConfiguration lc) {
this.lc = lc;
@@ -115,52 +128,73 @@
String generateHibernatePropeties = null;
String connProfileName = consoleConfigPrefs == null ? null :
consoleConfigPrefs.getConnectionProfileName();
- if (!isEmpty(connProfileName)) {
- IConnectionProfile profile = ProfileManager.getInstance().getProfileByName(connProfileName);
- if (profile != null) {
- StringBuilder propFileContent = new StringBuilder();
- DriverInstance driverInstance = ConnectionProfileUtil.getDriverDefinition(connProfileName);
- final Properties cpProperties = profile.getProperties(profile.getProviderId());
+ IConnectionProfile profile = getConnectionProfile(connProfileName);
+ if (profile != null) {
+ StringBuilder propFileContent = new StringBuilder();
+ String driverClass = getDriverClass(connProfileName);
+ final Properties cpProperties = profile.getProperties(profile.getProviderId());
+ //
+ String url = cpProperties.getProperty("org.eclipse.datatools.connectivity.db.URL"); //$NON-NLS-1$
+ //
+ String user = cpProperties.getProperty("org.eclipse.datatools.connectivity.db.username"); //$NON-NLS-1$
+ //
+ String pass = cpProperties.getProperty("org.eclipse.datatools.connectivity.db.password"); //$NON-NLS-1$
+ //
+ String dialectName = consoleConfigPrefs.getDialectName();
+ if (consoleConfigPrefs.getPropertyFile() != null) {
+ props = consoleConfigPrefs.getProperties();
+ props.setProperty(Environment.DRIVER, driverClass);
+ props.setProperty(Environment.URL, url);
+ props.setProperty(Environment.USER, user);
+ props.setProperty(Environment.PASS, pass);
+ if (StringHelper.isNotEmpty(dialectName)) {
+ props.setProperty(Environment.DIALECT, dialectName);
+ }
+ // output keys in sort order
+ Object[] keys = props.keySet().toArray();
+ Arrays.sort(keys);
+ for (Object obj : keys) {
+ addIntoPropFileContent(propFileContent, obj.toString(), props.getProperty(obj.toString()));
+ }
+ } else {
//
/** /
String driverURL = getConnectionProfileDriverURL(connProfileName);
- el = root.addElement(CGS.PROPERTY);
- el.addAttribute(CGS.NAME, "jdbc.driver"); //$NON-NLS-1$
- el.addAttribute(CGS.LOCATION, driverURL);
+ el = root.addElement(CodeGenerationStrings.PROPERTY);
+ el.addAttribute(CodeGenerationStrings.NAME, "jdbc.driver"); //$NON-NLS-1$
+ el.addAttribute(CodeGenerationStrings.LOCATION, driverURL);
/**/
//
- String driverClass = driverInstance.getProperty("org.eclipse.datatools.connectivity.db.driverClass"); //$NON-NLS-1$
el = root.addElement(CodeGenerationStrings.PROPERTY);
el.addAttribute(CodeGenerationStrings.NAME, Environment.DRIVER);
el.addAttribute(CodeGenerationStrings.VALUE, driverClass);
addIntoPropFileContent(propFileContent, Environment.DRIVER);
//
- String url = cpProperties.getProperty("org.eclipse.datatools.connectivity.db.URL"); //$NON-NLS-1$
el = root.addElement(CodeGenerationStrings.PROPERTY);
el.addAttribute(CodeGenerationStrings.NAME, Environment.URL);
el.addAttribute(CodeGenerationStrings.VALUE, url);
addIntoPropFileContent(propFileContent, Environment.URL);
//
- String user = cpProperties.getProperty("org.eclipse.datatools.connectivity.db.username"); //$NON-NLS-1$
el = root.addElement(CodeGenerationStrings.PROPERTY);
el.addAttribute(CodeGenerationStrings.NAME, Environment.USER);
el.addAttribute(CodeGenerationStrings.VALUE, user);
addIntoPropFileContent(propFileContent, Environment.USER);
//
- String pass = cpProperties.getProperty("org.eclipse.datatools.connectivity.db.password"); //$NON-NLS-1$
el = root.addElement(CodeGenerationStrings.PROPERTY);
el.addAttribute(CodeGenerationStrings.NAME, Environment.PASS);
el.addAttribute(CodeGenerationStrings.VALUE, pass);
addIntoPropFileContent(propFileContent, Environment.PASS);
//
- String dialectName = consoleConfigPrefs.getDialectName();
if (StringHelper.isNotEmpty(dialectName)) {
el = root.addElement(CodeGenerationStrings.PROPERTY);
el.addAttribute(CodeGenerationStrings.NAME, Environment.DIALECT);
el.addAttribute(CodeGenerationStrings.VALUE, dialectName);
addIntoPropFileContent(propFileContent, Environment.DIALECT);
}
- //
+ }
+ if (externalPropFile) {
+ hibernatePropFile = externalPropFileName;
+ } else {
hibernatePropFile = "hibernatePropFile"; //$NON-NLS-1$
el = root.addElement(CodeGenerationStrings.PROPERTY);
el.addAttribute(CodeGenerationStrings.NAME, hibernatePropFile);
@@ -174,9 +208,8 @@
Element echo = target.addElement(CodeGenerationStrings.ECHO);
echo.addAttribute(CodeGenerationStrings.FILE, hibernatePropFile);
echo.addText(getPropFileContentStubUID());
- //echo.addText(propFileContent.toString());
- propFileContentPreSave = propFileContent.toString();
}
+ propFileContentPreSave = propFileContent.toString().trim();
}
// all jars from libraries should be here
String toolslibID = "toolslib"; //$NON-NLS-1$
@@ -187,11 +220,11 @@
if (customClassPathURLs[i] == null) {
continue;
}
- // what is right here: CGS.PATH or CGS.PATHELEMENT?
+ // what is right here: CodeGenerationStrings.PATH or CodeGenerationStrings.PATHELEMENT?
// http://www.redhat.com/docs/en-US/JBoss_Developer_Studio/en/hibernatetools...
- // use CGS.PATH - so may be error in documentation?
+ // use CodeGenerationStrings.PATH - so may be error in documentation?
Element pathItem = toolslib.addElement(CodeGenerationStrings.PATH);
- //Element pathItem = toolslib.addElement(CGS.PATHELEMENT);
+ //Element pathItem = toolslib.addElement(CodeGenerationStrings.PATHELEMENT);
String strPathItem = customClassPathURLs[i].getPath();
try {
strPathItem = (new java.io.File(customClassPathURLs[i].toURI())).getPath();
@@ -307,10 +340,37 @@
return root;
}
+ public IConnectionProfile getConnectionProfile(String connProfileName) {
+ IConnectionProfile profile = null;
+ if (!isEmpty(connProfileName)) {
+ profile = ProfileManager.getInstance().getProfileByName(connProfileName);
+ }
+ return profile;
+ }
+
+ public DriverInstance getDriverInstance(String connProfileName) {
+ DriverInstance driverInstance = null;
+ if (!isEmpty(connProfileName)) {
+ driverInstance = ConnectionProfileUtil.getDriverDefinition(connProfileName);
+ }
+ return driverInstance;
+ }
+
+ public String getDriverClass(String connProfileName) {
+ DriverInstance driverInstance = getDriverInstance(connProfileName);
+ String driverClass = driverInstance != null ?
+ driverInstance.getProperty("org.eclipse.datatools.connectivity.db.driverClass") : ""; //$NON-NLS-1$ //$NON-NLS-2$
+ return driverClass;
+ }
+
public void addIntoPropFileContent(StringBuilder pfc, String str) {
pfc.append(NL + str + "=${" + str + "}"); //$NON-NLS-1$ //$NON-NLS-2$
}
+ public void addIntoPropFileContent(StringBuilder pfc, String name, String value) {
+ pfc.append(NL + name + "=" + value); //$NON-NLS-1$
+ }
+
public ConsoleConfigurationPreferences getConsoleConfigPreferences(String consoleConfigName) {
ConsoleConfiguration consoleConfig = KnownConfigurations.getInstance().find(consoleConfigName);
if (consoleConfig == null) {
@@ -342,7 +402,7 @@
return driverURL;
}
- public boolean isEmpty(String str) {
+ public static boolean isEmpty(String str) {
return (str == null || str.length() == 0);
}
@@ -362,4 +422,17 @@
getPropFileContentStubUID(), getPropFileContentPreSave()).trim();
return res;
}
+
+ public void setExternalPropFile(boolean externalPropFile) {
+ this.externalPropFile = externalPropFile;
+ }
+
+ public void setExternalPropFileName(String externalPropFileName) {
+ this.externalPropFileName = externalPropFileName;
+ }
+
+ public String getExternalPropFileName() {
+ return externalPropFileName;
+ }
+
}
15 years, 5 months
JBoss Tools SVN: r24027 - in trunk/hibernatetools/tests/org.hibernate.eclipse.console.test: res/project/src and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-08-10 13:01:01 -0400 (Tue, 10 Aug 2010)
New Revision: 24027
Added:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/hibernate.properties
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps.hibernate.properties
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test2.xml
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test2.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test2.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/launchcfg/TestConsoleConfigurationPreferences.java
Log:
https://jira.jboss.org/browse/JBIDE-6620 - fixed
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF 2010-08-10 16:58:27 UTC (rev 24026)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/META-INF/MANIFEST.MF 2010-08-10 17:01:01 UTC (rev 24027)
@@ -54,6 +54,8 @@
org.jboss.tools.hibernate.ui,
org.eclipse.jdt.apt.core,
org.eclipse.debug.ui,
+ org.eclipse.datatools.connectivity.ui,
+ org.eclipse.datatools.connectivity,
org.eclipse.ui.workbench.texteditor;bundle-version="3.5.0"
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.hibernate.eclipse.console.test.HibernateConsoleTestPlugin
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/hibernate.properties
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/hibernate.properties (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/project/src/hibernate.properties 2010-08-10 17:01:01 UTC (rev 24027)
@@ -0,0 +1,6 @@
+hibernate.connection.driver_class=111
+hibernate.connection.password=111
+hibernate.connection.url=111
+hibernate.connection.username=111
+hibernate.dialect=111
+hibernate.dialectXXX=111XXX
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps.hibernate.properties
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps.hibernate.properties (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps.hibernate.properties 2010-08-10 17:01:01 UTC (rev 24027)
@@ -0,0 +1,5 @@
+hibernate.connection.driver_class=driverClass
+hibernate.connection.password=passw
+hibernate.connection.url=url
+hibernate.connection.username=username
+hibernate.dialect=testDialect
\ No newline at end of file
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test1.xml 2010-08-10 17:01:01 UTC (rev 24027)
@@ -0,0 +1,36 @@
+<project name="CodeGen" default="hibernateAntCodeGeneration">
+ <property name="build.dir" location="reslocation/test"/>
+ <path id="toolslib"/>
+ <target name="hibernateAntCodeGeneration">
+ <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
+ <hibernatetool destdir="${build.dir}">
+ <configuration configurationFile="project\src\hibernate.cfg.xml" propertyFile="hibernate.properties"/>
+ <classpath>
+ <path location="${build.dir}"/>
+ </classpath>
+ <hbm2doc>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2doc>
+ <hbm2cfgxml>
+ <property key="jdk5" value="false"/>
+ </hbm2cfgxml>
+ <hbm2hbmxml>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2hbmxml>
+ <hbmtemplate>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbmtemplate>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
+ <hbm2ddl>
+ <property key="ejb3" value="false"/>
+ <property key="jdk5" value="false"/>
+ </hbm2ddl>
+ <hbm2dao/>
+ </hibernatetool>
+ </target>
+</project>
\ No newline at end of file
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test2.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test2.xml (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenProps_test2.xml 2010-08-10 17:01:01 UTC (rev 24027)
@@ -0,0 +1,16 @@
+<project name="CodeGen" default="hibernateAntCodeGeneration">
+ <property name="build.dir" location="reslocation/test"/>
+ <path id="toolslib"/>
+ <target name="hibernateAntCodeGeneration">
+ <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
+ <hibernatetool destdir="${build.dir}">
+ <configuration configurationFile="project\src\hibernate.cfg.xml" propertyFile="hibernate.properties"/>
+ <classpath>
+ <path location="${build.dir}"/>
+ </classpath>
+ <hbm2java destdir="outputdir/test">
+ <property key="keyXXX" value="valueYYY"/>
+ </hbm2java>
+ </hibernatetool>
+ </target>
+</project>
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml 2010-08-10 16:58:27 UTC (rev 24026)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test1.xml 2010-08-10 17:01:01 UTC (rev 24027)
@@ -4,7 +4,7 @@
<target name="hibernateAntCodeGeneration">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
<hibernatetool destdir="${build.dir}">
- <jdbcconfiguration configurationFile="project\src\hibernate.cfg.xml" detectManyToMany="true" detectOneToOne="true" detectOptimisticLock="true" revEngFile="reslocation/test"/>
+ <jdbcconfiguration configurationFile="project\src\hibernate.cfg.xml" propertyFile="project\src\hibernate.properties" detectManyToMany="true" detectOneToOne="true" detectOptimisticLock="true" revEngFile="reslocation/test"/>
<classpath>
<path location="${build.dir}"/>
</classpath>
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test2.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test2.xml 2010-08-10 16:58:27 UTC (rev 24026)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenReveng_test2.xml 2010-08-10 17:01:01 UTC (rev 24027)
@@ -4,7 +4,7 @@
<target name="hibernateAntCodeGeneration">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
<hibernatetool destdir="${build.dir}">
- <jdbcconfiguration configurationFile="project\src\hibernate.cfg.xml" detectManyToMany="true" detectOneToOne="true" detectOptimisticLock="true" revEngFile="reslocation/test"/>
+ <jdbcconfiguration configurationFile="project\src\hibernate.cfg.xml" propertyFile="project\src\hibernate.properties" detectManyToMany="true" detectOneToOne="true" detectOptimisticLock="true" revEngFile="reslocation/test"/>
<classpath>
<path location="${build.dir}"/>
</classpath>
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml 2010-08-10 16:58:27 UTC (rev 24026)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test1.xml 2010-08-10 17:01:01 UTC (rev 24027)
@@ -4,7 +4,7 @@
<target name="hibernateAntCodeGeneration">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
<hibernatetool destdir="${build.dir}">
- <configuration configurationFile="project\src\hibernate.cfg.xml"/>
+ <configuration configurationFile="project\src\hibernate.cfg.xml" propertyFile="project\src\hibernate.properties"/>
<classpath>
<path location="${build.dir}"/>
</classpath>
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test2.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test2.xml 2010-08-10 16:58:27 UTC (rev 24026)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGen_test2.xml 2010-08-10 17:01:01 UTC (rev 24027)
@@ -4,7 +4,7 @@
<target name="hibernateAntCodeGeneration">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
<hibernatetool destdir="${build.dir}">
- <configuration configurationFile="project\src\hibernate.cfg.xml"/>
+ <configuration configurationFile="project\src\hibernate.cfg.xml" propertyFile="project\src\hibernate.properties"/>
<classpath>
<path location="${build.dir}"/>
</classpath>
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java 2010-08-10 16:58:27 UTC (rev 24026)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java 2010-08-10 17:01:01 UTC (rev 24027)
@@ -22,10 +22,13 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Properties;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.datatools.connectivity.IConnectionProfile;
+import org.eclipse.datatools.connectivity.internal.ConnectionProfile;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
import org.hibernate.eclipse.console.ExtensionManager;
@@ -58,6 +61,11 @@
final File xmlConfig = new File("project/src/hibernate.cfg.xml"); //$NON-NLS-1$
return xmlConfig;
}
+
+ public File getPropertyFile() {
+ final File propFile = new File("project/src/hibernate.properties"); //$NON-NLS-1$
+ return propFile;
+ }
}
public class TestConsoleConfigPref2 extends TestConsoleConfigurationPreferences {
@@ -108,9 +116,20 @@
}
}
+ public class TestConsoleConfigPref3 extends TestConsoleConfigPref {
+ public String getConnectionProfileName() {
+ return "connectionProfileName"; //$NON-NLS-1$
+ }
+
+ public String getDialectName() {
+ return "testDialect"; //$NON-NLS-1$
+ }
+ }
+
public enum ETestCase {
simple,
jpa,
+ properties,
nullable,
}
@@ -129,6 +148,8 @@
pref = new TestConsoleConfigPref();
} else if (testCase == ETestCase.jpa) {
pref = new TestConsoleConfigPref2();
+ } else if (testCase == ETestCase.properties) {
+ pref = new TestConsoleConfigPref3();
}
return pref;
}
@@ -140,59 +161,139 @@
public String getResLocation(String path) {
return "reslocation/test"; //$NON-NLS-1$
}
+
+ public IConnectionProfile getConnectionProfile(String connProfileName) {
+ IConnectionProfile profile = null;
+ if (testCase == ETestCase.properties) {
+ profile = new ConnectionProfile("testName", null, null) { //$NON-NLS-1$
+ public Properties getProperties(String type) {
+ Properties res = new Properties();
+ res.setProperty("org.eclipse.datatools.connectivity.db.URL", "url"); //$NON-NLS-1$ //$NON-NLS-2$
+ res.setProperty("org.eclipse.datatools.connectivity.db.username", "username"); //$NON-NLS-1$ //$NON-NLS-2$
+ res.setProperty("org.eclipse.datatools.connectivity.db.password", "passw"); //$NON-NLS-1$ //$NON-NLS-2$
+ return res;
+ }
+ };
+ }
+ return profile;
+ }
+
+ public String getDriverClass(String connProfileName) {
+ String driverClass = ""; //$NON-NLS-1$
+ if (testCase == ETestCase.properties) {
+ driverClass = "driverClass"; //$NON-NLS-1$
+ }
+ return driverClass;
+ }
}
+
+ public class CodeGenXMLFactory4Test2 extends CodeGenXMLFactory4Test {
+ public CodeGenXMLFactory4Test2(ILaunchConfiguration lc, ETestCase testCase) {
+ super(lc, testCase);
+ }
+ public ConsoleConfigurationPreferences getConsoleConfigPreferences(String consoleConfigName) {
+ return new TestConsoleConfigPref2();
+ }
+ }
+
public void testCodeGenXMLFactoryRevengAll() {
- String codeGen = codeGenXMLFactory(true, true, ETestCase.simple);
+ CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(true, true, ETestCase.simple);
+ String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
String specimen = getSample("AntCodeGenReveng_test1.xml"); //$NON-NLS-1$
assertEquals(specimen.trim(), codeGen.replaceAll("\n", "\r\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals(codeGenProperties.length(), 0);
}
public void testCodeGenXMLFactoryRevengOne() {
- String codeGen = codeGenXMLFactory(true, false, ETestCase.simple);
+ CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(true, false, ETestCase.simple);
+ String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
String sample = getSample("AntCodeGenReveng_test2.xml"); //$NON-NLS-1$
assertEquals(sample.trim(), codeGen.replaceAll("\n", "\r\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals(codeGenProperties.length(), 0);
}
public void testCodeGenXMLFactoryAll() {
- String codeGen = codeGenXMLFactory(false, true, ETestCase.simple);
+ CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, true, ETestCase.simple);
+ String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
String sample = getSample("AntCodeGen_test1.xml"); //$NON-NLS-1$
assertEquals(sample.trim(), codeGen.replaceAll("\n", "\r\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals(codeGenProperties.length(), 0);
}
public void testCodeGenXMLFactoryOne() {
- String codeGen = codeGenXMLFactory(false, false, ETestCase.simple);
+ CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, false, ETestCase.simple);
+ String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
String sample = getSample("AntCodeGen_test2.xml"); //$NON-NLS-1$
assertEquals(sample.trim(), codeGen.replaceAll("\n", "\r\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals(codeGenProperties.length(), 0);
}
public void testCodeGenXMLFactoryJpaAll() {
- String codeGen = codeGenXMLFactory(false, true, ETestCase.jpa);
+ CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, true, ETestCase.jpa);
+ String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
String sample = getSample("AntCodeGenJpa_test1.xml"); //$NON-NLS-1$
assertEquals(sample.trim(), codeGen.replaceAll("\n", "\r\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals(codeGenProperties.length(), 0);
}
public void testCodeGenXMLFactoryJpaOne() {
- String codeGen = codeGenXMLFactory(false, false, ETestCase.jpa);
+ CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, false, ETestCase.jpa);
+ String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
String sample = getSample("AntCodeGenJpa_test2.xml"); //$NON-NLS-1$
assertEquals(sample.trim(), codeGen.replaceAll("\n", "\r\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals(codeGenProperties.length(), 0);
}
public void testCodeGenXMLFactoryNullableAll() {
- String codeGen = codeGenXMLFactory(false, true, ETestCase.nullable);
+ CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, true, ETestCase.nullable);
+ String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
String sample = getSample("AntCodeGenNullable_test1.xml"); //$NON-NLS-1$
assertEquals(sample.trim(), codeGen.replaceAll("\n", "\r\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals(codeGenProperties.length(), 0);
}
public void testCodeGenXMLFactoryNullableOne() {
- String codeGen = codeGenXMLFactory(false, false, ETestCase.nullable);
+ CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, false, ETestCase.nullable);
+ String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
String sample = getSample("AntCodeGenNullable_test2.xml"); //$NON-NLS-1$
assertEquals(sample.trim(), codeGen.replaceAll("\n", "\r\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals(codeGenProperties.length(), 0);
}
+
+ public void testCodeGenXMLFactoryPropertiesAll() {
+ CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, true, ETestCase.properties);
+ String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
+ codeGen = updatePaths(codeGen);
+ String sample = getSample("AntCodeGenProps_test1.xml"); //$NON-NLS-1$
+ String sampleProperties = getSample("AntCodeGenProps.hibernate.properties"); //$NON-NLS-1$
+ assertEquals(sample.trim(), codeGen.replaceAll("\n", "\r\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals(sampleProperties.trim(), codeGenProperties);
+ }
+
+ public void testCodeGenXMLFactoryPropertiesOne() {
+ CodeGenXMLFactory codeGenFactory = codeGenXMLFactory(false, false, ETestCase.properties);
+ String codeGen = codeGenFactory.createCodeGenXML();
+ String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
+ codeGen = updatePaths(codeGen);
+ String sample = getSample("AntCodeGenProps_test2.xml"); //$NON-NLS-1$
+ String sampleProperties = getSample("AntCodeGenProps.hibernate.properties"); //$NON-NLS-1$
+ assertEquals(sample.trim(), codeGen.replaceAll("\n", "\r\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals(sampleProperties.trim(), codeGenProperties);
+ }
public String updatePaths(String codeGen) {
String repl = ""; //$NON-NLS-1$
@@ -205,7 +306,7 @@
return codeGen.replace(repl + File.separator, ""); //$NON-NLS-1$
}
- public String codeGenXMLFactory(boolean reveng, boolean exportersAll, ETestCase testCase) {
+ public CodeGenXMLFactory codeGenXMLFactory(boolean reveng, boolean exportersAll, ETestCase testCase) {
Map<String, ExporterDefinition> exDefinitions = ExtensionManager.findExporterDefinitionsAsMap();
Map<String, Object> testLaunchConfigAttr = new HashMap<String, Object>();
String tmp = "12345678901234567890"; //$NON-NLS-1$
@@ -246,7 +347,7 @@
testLaunchConfigAttr.put(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER, reveng);
TestLaunchConfig testLaunchConfig = new TestLaunchConfig(testLaunchConfigAttr);
CodeGenXMLFactory codeGenFactory = new CodeGenXMLFactory4Test(testLaunchConfig, testCase);
- return codeGenFactory.createCodeGenXML();
+ return codeGenFactory;
}
public String getSample(String fileName) {
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/launchcfg/TestConsoleConfigurationPreferences.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/launchcfg/TestConsoleConfigurationPreferences.java 2010-08-10 16:58:27 UTC (rev 24026)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/launchcfg/TestConsoleConfigurationPreferences.java 2010-08-10 17:01:01 UTC (rev 24027)
@@ -19,6 +19,8 @@
public static final String HIBERNATE_CFG_XML_PATH = "/res/project/src/hibernate.cfg.xml".replaceAll("//", File.separator); //$NON-NLS-1$ //$NON-NLS-2$
+ public static final String HIBERNATE_PROPERTIES_PATH = "/res/project/src/hibernate.properties".replaceAll("//", File.separator); //$NON-NLS-1$ //$NON-NLS-2$
+
public void setName(String name) {
Assert.fail();
}
15 years, 5 months