JBoss Tools SVN: r25411 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-10-01 15:01:54 -0400 (Fri, 01 Oct 2010)
New Revision: 25411
Modified:
trunk/build/target-platform/e361-wtp322.target
trunk/build/target-platform/e361-wtp322.target.p2mirror.xml
Log:
add missing RSE and DTP features; extract JBT mirrors as extraneous sites
Modified: trunk/build/target-platform/e361-wtp322.target
===================================================================
--- trunk/build/target-platform/e361-wtp322.target 2010-10-01 18:39:50 UTC (rev 25410)
+++ trunk/build/target-platform/e361-wtp322.target 2010-10-01 19:01:54 UTC (rev 25411)
@@ -70,8 +70,7 @@
<unit id="org.eclipse.swtbot.ide.feature.group" version="2.0.0.595-dev-e36"/>
<unit id="org.eclipse.swtbot.eclipse.test.junit4.feature.group" version="2.0.0.595-dev-e36"/>
<unit id="org.eclipse.swtbot.feature.group" version="2.0.0.595-dev-e36"/>
- <repository location="http://download.jboss.org/jbosstools/updates/requirements/swtbot-helios/"/>
- <!--repository location="http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site/"/-->
+ <repository location="http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site/"/>
</location>
<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
<unit id="org.eclipse.birt.osgi.runtime.sdk.feature.group" version="2.6.1.v20100617a-57B185wFfAqPz0Ef8mBsMkG-0hfS"/>
@@ -122,11 +121,13 @@
<unit id="org.eclipse.datatools.sdk.feature.feature.group" version="1.8.0.v201005280400-7P9i0FDxNYrk4QYG-9qpz0N-vbEp"/>
<unit id="org.eclipse.datatools.enablement.jdt.feature.feature.group" version="1.8.0.v201005280400-2-07w31211518181A"/>
<unit id="org.eclipse.datatools.modelbase.feature.feature.group" version="1.8.0.v201005280400-77077CcNBGKBWJ_HWVi"/>
+ <unit id="org.eclipse.datatools.enablement.apache.derby.feature.feature.group" version="1.8.1.v20100618-77778eBmKDNOMgJvJ8Of7QBR"/>
<unit id="org.eclipse.draw2d.feature.group" version="3.6.0.v20100519-2050-45-7w3121163602336"/>
<unit id="org.eclipse.gef.feature.group" version="3.6.0.v20100519-2050-777B-81A2Bz-69793A8B83447"/>
<unit id="org.eclipse.zest.feature.group" version="1.2.0.v20100519-2050-678-8yE4F-8HAH4DFEF3447"/>
<unit id="org.eclipse.uml2.feature.group" version="3.1.0.v201006071150"/>
- <repository location="http://download.jboss.org/jbosstools/updates/requirements/helios/"/>
+ <unit id="org.eclipse.rse.feature.group" version="3.2.1.v201008191400-7L78FA-8wqbPcNk4qa8R0eVlyGvo"/>
+ <repository location="http://download.eclipse.org/releases/helios/"/>
</location>
<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
<unit id="org.eclipse.jst.jee" version="1.0.301.v201007151900"/>
@@ -166,7 +167,6 @@
<unit id="org.eclipse.wst.ws_ui.feature.feature.group" version="3.2.2.v201008211705-7I78FZFEtEoO2c5BlJ4jPNvNC-yS"/>
<unit id="org.eclipse.wst.xml_core.feature.feature.group" version="3.2.2.v201008170029-7C7OFXYF7RZHQHI5PyJwPT"/>
<repository location="http://download.eclipse.org/webtools/repository/helios/"/>
- <!-- repository location="http://download.jboss.org/jbosstools/updates/requirements/webtools-3.2/"/ -->
</location>
<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
<repository location="http://download.jboss.org/jbosstools/builds/staging/jbosstools-drools/all..."/>
@@ -175,6 +175,17 @@
<unit id="com.google.gdt.eclipse.suite.e36.feature.feature.group" version="1.3.3.v201006111317"/>
<repository location="http://dl.google.com/eclipse/plugin/3.6/"/>
</location>
+
+ <!-- additional JBoss.org mirrors -->
+ <location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+ <repository location="http://download.jboss.org/jbosstools/updates/requirements/swtbot-helios/"/>
+ </location>
+ <location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+ <repository location="http://download.jboss.org/jbosstools/updates/requirements/webtools-3.2/"/>
+ </location>
+ <location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
+ <repository location="http://download.jboss.org/jbosstools/updates/requirements/helios/"/>
+ </location>
</locations>
<includeBundles>
<feature id="org.drools.eclipse.feature"/>
@@ -184,4 +195,4 @@
<feature id="org.mozilla.xpcom.feature"/>
</includeBundles>
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-</target>
\ No newline at end of file
+</target>
Modified: trunk/build/target-platform/e361-wtp322.target.p2mirror.xml
===================================================================
--- trunk/build/target-platform/e361-wtp322.target.p2mirror.xml 2010-10-01 18:39:50 UTC (rev 25410)
+++ trunk/build/target-platform/e361-wtp322.target.p2mirror.xml 2010-10-01 19:01:54 UTC (rev 25411)
@@ -42,13 +42,16 @@
<repository location="http://download.eclipse.org/rt/ecf/3.2/3.6/site.p2"/>
<repository location="http://download.eclipse.org/tptp/updates/"/>
<repository location="http://download.eclipse.org/modeling/emf/emf/updates/2.6/R201009141218/"/>
-<repository location="http://download.jboss.org/jbosstools/updates/requirements/swtbot-helios/"/>
+<repository location="http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site/"/>
<repository location="http://download.eclipse.org/birt/update-site/2.6/"/>
<repository location="http://download.eclipse.org/eclipse/updates/3.6.x/"/>
-<repository location="http://download.jboss.org/jbosstools/updates/requirements/helios/"/>
+<repository location="http://download.eclipse.org/releases/helios/"/>
<repository location="http://download.eclipse.org/webtools/repository/helios/"/>
<repository location="http://download.jboss.org/jbosstools/builds/staging/jbosstools-drools/all..."/>
<repository location="http://dl.google.com/eclipse/plugin/3.6/"/>
+<repository location="http://download.jboss.org/jbosstools/updates/requirements/swtbot-helios/"/>
+<repository location="http://download.jboss.org/jbosstools/updates/requirements/webtools-3.2/"/>
+<repository location="http://download.jboss.org/jbosstools/updates/requirements/helios/"/>
</source>
<iu version="" id="org.maven.ide.eclipse.feature.feature.group"/>
<iu version="" id="org.maven.ide.eclipse.wtp.feature.feature.group"/>
@@ -115,10 +118,12 @@
<iu version="" id="org.eclipse.datatools.sdk.feature.feature.group"/>
<iu version="" id="org.eclipse.datatools.enablement.jdt.feature.feature.group"/>
<iu version="" id="org.eclipse.datatools.modelbase.feature.feature.group"/>
+<iu version="" id="org.eclipse.datatools.enablement.apache.derby.feature.feature.group"/>
<iu version="" id="org.eclipse.draw2d.feature.group"/>
<iu version="" id="org.eclipse.gef.feature.group"/>
<iu version="" id="org.eclipse.zest.feature.group"/>
<iu version="" id="org.eclipse.uml2.feature.group"/>
+<iu version="" id="org.eclipse.rse.feature.group"/>
<iu version="" id="org.eclipse.jst.jee"/>
<iu version="" id="org.eclipse.wst.common.frameworks"/>
<iu version="" id="org.eclipse.wst.common.project.facet.ui"/>
14 years, 5 months
JBoss Tools SVN: r25410 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-10-01 14:39:50 -0400 (Fri, 01 Oct 2010)
New Revision: 25410
Modified:
trunk/build/publish.sh
Log:
comment out empy else-if
Modified: trunk/build/publish.sh
===================================================================
--- trunk/build/publish.sh 2010-10-01 18:39:43 UTC (rev 25409)
+++ trunk/build/publish.sh 2010-10-01 18:39:50 UTC (rev 25410)
@@ -178,7 +178,7 @@
date; rsync -arzq --delete ${STAGINGDIR}/* $DESTINATION/builds/nightly/${JOBNAMEREDUX}/${BUILD_ID}-H${BUILD_NUMBER}/
fi
rm -f /tmp/latestBuild.html
- else
+ #else
# COMMENTED OUT as this uses too much disk space
# if a release build, create a named dir
#if [[ ${RELEASE} == "Yes" ]]; then
14 years, 5 months
JBoss Tools SVN: r25409 - branches/jbosstools-3.2.0.Beta1/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-10-01 14:39:43 -0400 (Fri, 01 Oct 2010)
New Revision: 25409
Modified:
branches/jbosstools-3.2.0.Beta1/build/publish.sh
Log:
comment out empy else-if
Modified: branches/jbosstools-3.2.0.Beta1/build/publish.sh
===================================================================
--- branches/jbosstools-3.2.0.Beta1/build/publish.sh 2010-10-01 18:23:17 UTC (rev 25408)
+++ branches/jbosstools-3.2.0.Beta1/build/publish.sh 2010-10-01 18:39:43 UTC (rev 25409)
@@ -178,7 +178,7 @@
date; rsync -arzq --delete ${STAGINGDIR}/* $DESTINATION/builds/nightly/${JOBNAMEREDUX}/${BUILD_ID}-H${BUILD_NUMBER}/
fi
rm -f /tmp/latestBuild.html
- else
+ #else
# COMMENTED OUT as this uses too much disk space
# if a release build, create a named dir
#if [[ ${RELEASE} == "Yes" ]]; then
14 years, 5 months
JBoss Tools SVN: r25408 - branches/jbosstools-3.2.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2010-10-01 14:23:17 -0400 (Fri, 01 Oct 2010)
New Revision: 25408
Modified:
branches/jbosstools-3.2.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/ViewerInitorStore.java
Log:
JBIDE-7240: Configuring CSV input, unable to load sample CSV file in Smooks Editor - beta1 branch
https://jira.jboss.org/browse/JBIDE-7240
Modified: branches/jbosstools-3.2.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/ViewerInitorStore.java
===================================================================
--- branches/jbosstools-3.2.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/ViewerInitorStore.java 2010-10-01 18:17:24 UTC (rev 25407)
+++ branches/jbosstools-3.2.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/ViewerInitorStore.java 2010-10-01 18:23:17 UTC (rev 25408)
@@ -261,7 +261,7 @@
csv12ViewerInitor.setLabelProvider(new XMLStructuredDataLabelProvider());
csv12ViewerInitor.setTreeContentProvider(new XMLStructuredDataContentProvider());
csv12ViewerInitor.setStructuredDataLoadWizard(new CSV12InputDataWizard());
- // map.put(typeID, csv12ViewerInitor);
+ map.put(typeID, csv12ViewerInitor);
// for EDI 1.1
BaseViewerInitor ediViewerInitor = new BaseViewerInitor();
14 years, 5 months
JBoss Tools SVN: r25407 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2010-10-01 14:17:24 -0400 (Fri, 01 Oct 2010)
New Revision: 25407
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/ViewerInitorStore.java
Log:
JBIDE-7240: Configuring CSV input, unable to load sample CSV file in Smooks Editor
https://jira.jboss.org/browse/JBIDE-7240
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/ViewerInitorStore.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/ViewerInitorStore.java 2010-10-01 18:02:01 UTC (rev 25406)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/ViewerInitorStore.java 2010-10-01 18:17:24 UTC (rev 25407)
@@ -261,7 +261,7 @@
csv12ViewerInitor.setLabelProvider(new XMLStructuredDataLabelProvider());
csv12ViewerInitor.setTreeContentProvider(new XMLStructuredDataContentProvider());
csv12ViewerInitor.setStructuredDataLoadWizard(new CSV12InputDataWizard());
- // map.put(typeID, csv12ViewerInitor);
+ map.put(typeID, csv12ViewerInitor);
// for EDI 1.1
BaseViewerInitor ediViewerInitor = new BaseViewerInitor();
14 years, 5 months
JBoss Tools SVN: r25406 - trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2010-10-01 14:02:01 -0400 (Fri, 01 Oct 2010)
New Revision: 25406
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/OpenOnsTest.java
Log:
JBIDE-7162
org.jboss.tools.jsf.text.ext.hyperlink.JsfJSPTagNameHyperlink fails
The delay is risen from 0.5sec to 0.75sec due to get an additional time for editor to be opened.
Fixed test conditions for one of the hiperlinks test (removed the redundant link's opening)
Modified: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/OpenOnsTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/OpenOnsTest.java 2010-10-01 17:02:32 UTC (rev 25405)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/OpenOnsTest.java 2010-10-01 18:02:01 UTC (rev 25406)
@@ -197,7 +197,7 @@
String fileName = editor.getEditorInput().getName();
assertTrue("style1.css".equals(fileName));
}
-
+ private static final int DELAY_FOR_LINK_OPEN = 750;
public void testStyleClassOpenOns() throws CoreException, BadLocationException {
IEditorPart editor = WorkbenchUtils.openEditor(STYLE_TEST_FILE);
assertTrue(editor instanceof JSPMultiPageEditor);
@@ -213,7 +213,7 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
+ JobUtils.waitForIdle(DELAY_FOR_LINK_OPEN);
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
@@ -227,7 +227,7 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
+ JobUtils.waitForIdle(DELAY_FOR_LINK_OPEN);
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
fileName = editor.getEditorInput().getName();
@@ -236,14 +236,12 @@
reg = new FindReplaceDocumentAdapter(document).find(0,
"style-class6", true, true, false, false);
links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
- links[0].open();
- JobUtils.waitForIdle();
assertNotNull(links);
assertTrue(links.length!=0);
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
- JobUtils.waitForIdle();
+ JobUtils.waitForIdle(DELAY_FOR_LINK_OPEN);
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
fileName = editor.getEditorInput().getName();
14 years, 5 months
JBoss Tools SVN: r25405 - in trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator: rules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: bbrodt
Date: 2010-10-01 13:02:32 -0400 (Fri, 01 Oct 2010)
New Revision: 25405
Modified:
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/EmfModelQuery.java
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/CPartnerActivityValidator.java
Log:
https://jira.jboss.org/browse/JBIDE-7116
Fix Message and XSD type comparison methods
Modified: trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/EmfModelQuery.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/EmfModelQuery.java 2010-10-01 16:54:18 UTC (rev 25404)
+++ trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/EmfModelQuery.java 2010-10-01 17:02:32 UTC (rev 25405)
@@ -12,6 +12,7 @@
import java.util.List;
+import javax.wsdl.OperationType;
import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
@@ -25,9 +26,15 @@
import org.eclipse.bpel.model.util.ImportResolverRegistry;
import org.eclipse.bpel.model.util.WSDLUtil;
import org.eclipse.bpel.model.util.XSDUtil;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.wst.wsdl.Definition;
+import org.eclipse.wst.wsdl.Fault;
+import org.eclipse.wst.wsdl.Input;
import org.eclipse.wst.wsdl.Message;
+import org.eclipse.wst.wsdl.Operation;
+import org.eclipse.wst.wsdl.Output;
import org.eclipse.wst.wsdl.Part;
import org.eclipse.wst.wsdl.PortType;
import org.eclipse.xsd.XSDAttributeDeclaration;
@@ -36,6 +43,7 @@
import org.eclipse.xsd.XSDSchema;
import org.eclipse.xsd.XSDSimpleTypeDefinition;
import org.eclipse.xsd.XSDTypeDefinition;
+import org.eclipse.xsd.impl.XSDNamedComponentImpl;
/**
*
@@ -496,6 +504,11 @@
assertTrue(src != null, CONTEXT_MSG);
assertTrue(dst != null, CONTEXT_MSG);
+ // https://jira.jboss.org/browse/JBIDE-7116
+ // quick exit
+ if (src==dst)
+ return true;
+
Message srcMsg = null;
Message dstMsg = null;
@@ -508,7 +521,8 @@
// both messages, and both non null - check if same.
if (srcMsg != null && dstMsg != null) {
- return srcMsg.equals(dstMsg);
+ // https://jira.jboss.org/browse/JBIDE-7116
+ return compatibleType(srcMsg, dstMsg);
}
// either source OR destination is not a message, check for the XSDElement variant.
@@ -532,7 +546,8 @@
}
Part part = (Part) parts.get(0);
- return srcXSD.equals( part.getElementDeclaration() );
+ // https://jira.jboss.org/browse/JBIDE-7116
+ return compatibleType(srcXSD, part.getElementDeclaration());
}
// destination is XSD element, source message may have 1 part defined as that element
@@ -544,7 +559,8 @@
}
Part part = (Part) parts.get(0);
- return dstXSD.equals( part.getElementDeclaration() );
+ // https://jira.jboss.org/browse/JBIDE-7116
+ return compatibleType(dstXSD, part.getElementDeclaration());
}
// otherwise, incompatible partner activity messages
@@ -583,6 +599,11 @@
assertTrue(src != null, CONTEXT_MSG);
assertTrue(dst != null, CONTEXT_MSG);
+ // https://jira.jboss.org/browse/JBIDE-7116
+ // quick exit
+ if (src==dst)
+ return true;
+
Message srcMsg = null;
Message dstMsg = null;
@@ -595,7 +616,8 @@
// both messages, and both non null - check if same.
if (srcMsg != null && dstMsg != null) {
- return srcMsg.equals(dstMsg);
+ // https://jira.jboss.org/browse/JBIDE-7116
+ return compatibleType(srcMsg, dstMsg);
}
// either source OR destination is not a message, check for the XSDElement variant.
@@ -611,7 +633,8 @@
}
if (srcXSD != null && dstXSD != null) {
- return srcXSD.equals(dstXSD);
+ // https://jira.jboss.org/browse/JBIDE-7116
+ return compatibleType(srcXSD, dstXSD);
}
XSDTypeDefinition srcType = null;
@@ -625,8 +648,8 @@
}
if (srcType != null && dstType != null) {
-
- if (srcType.equals(dstType)) {
+ //https://jira.jboss.org/browse/JBIDE-7116
+ if (compatibleType(srcType, dstType)) {
return true;
}
@@ -636,17 +659,166 @@
XSDTypeDefinition baseType = srcType.getBaseType();
do {
// System.out.println("Checking: " + dstType + " against baseType: " + baseType);
- if (dstType.equals(baseType)) {
+ // https://jira.jboss.org/browse/JBIDE-7116
+ if (compatibleType(dstType, baseType)) {
return true;
}
baseType = baseType.getBaseType();
- } while ( baseType.equals(baseType.getBaseType()) == false );
+ } while ( !compatibleType(baseType,baseType.getBaseType()) );
+
+ return false;
}
+ PortType srcPort = null;
+ PortType dstPort = null;
+ if (src instanceof PortType)
+ srcPort = (PortType)src;
+ if (dst instanceof PortType)
+ dstPort = (PortType)dst;
+ if (srcPort != null && dstPort != null)
+ return compatibleType(srcPort, dstPort);
+
// otherwise, incompatible partner activity messages
return false;
}
+
+ // https://jira.jboss.org/browse/JBIDE-7116
+ // new: compare contents of messages
+ public static boolean compatibleType(Message src, Message dst) {
+ assertTrue(src != null, CONTEXT_MSG);
+ assertTrue(dst != null, CONTEXT_MSG);
+
+ if (src==dst)
+ return true;
+
+ if (!src.getQName().equals(dst.getQName()))
+ return false;
+ URI uri1 = src.eResource().getURI();
+ URI uri2 = dst.eResource().getURI();
+ if (src.eResource().getURI().equals(dst.eResource().getURI()))
+ return true;
+
+ EList<Part> parts1 = src.getEParts();
+ EList<Part> parts2 = dst.getEParts();
+ if (parts1.size() != parts2.size())
+ return false;
+
+ for (int i=0; i<parts1.size(); ++i) {
+ Part part1 = parts1.get(i);
+ Part part2 = parts2.get(i);
+ if (!part1.getName().equals(part2.getName()))
+ return false;
+ if (!compatibleType(part1.getTypeDefinition(), part2.getTypeDefinition()))
+ return false;
+ }
+
+ return true;
+ }
+
+ // https://jira.jboss.org/browse/JBIDE-7116
+ // new: compare XSDElementDeclaractions
+ public static boolean compatibleType(XSDElementDeclaration src, XSDElementDeclaration dst) {
+ assertTrue(src != null, CONTEXT_MSG);
+ assertTrue(dst != null, CONTEXT_MSG);
+
+ if (src==dst)
+ return true;
+
+ // TODO: currently just doing a rudimentary name-only compare
+ // need to add XSD compare/diff when the eclipse MDT project builds one
+ return XSDNamedComponentImpl.Comparator.getInstance().compare(src,dst) == 0;
+ }
+
+ // https://jira.jboss.org/browse/JBIDE-7116
+ // new: compare XSDTypeDefinitions
+ public static boolean compatibleType(XSDTypeDefinition src, XSDTypeDefinition dst) {
+ assertTrue(src != null, CONTEXT_MSG);
+ assertTrue(dst != null, CONTEXT_MSG);
+
+ if (src==dst)
+ return true;
+ // rudimentary name-only compare
+ return XSDNamedComponentImpl.Comparator.getInstance().compare(src,dst) == 0;
+ }
+
+ // https://jira.jboss.org/browse/JBIDE-7116
+ // new: compare PortTypes
+ public static boolean compatibleType(PortType src, PortType dst) {
+ assertTrue(src != null, CONTEXT_MSG);
+ assertTrue(dst != null, CONTEXT_MSG);
+
+ if (src==dst)
+ return true;
+
+ // do portTypes have to be defined in the same WSDL?
+// URI uri1 = src.eResource().getURI();
+// URI uri2 = dst.eResource().getURI();
+// if ( !src.eResource().getURI().equals(dst.eResource().getURI()) )
+// return false;
+
+ // check names
+ if (src.getQName()==null || !src.getQName().equals(dst.getQName()))
+ return false;
+
+ // check operations
+ EList<Operation> ops1 = src.getEOperations();
+ EList<Operation> ops2 = dst.getEOperations();
+ if (ops1.size()!=ops2.size())
+ return false;
+ for (int i=0; i<ops1.size(); ++i) {
+ Operation op1 = ops1.get(i);
+ Operation op2 = ops2.get(i);
+ if (!compatibleType(op1, op2))
+ return false;
+ }
+ return true;
+ }
+
+ // https://jira.jboss.org/browse/JBIDE-7116
+ // new: compare Operations
+ public static boolean compatibleType(Operation src, Operation dst) {
+ assertTrue(src != null, CONTEXT_MSG);
+ assertTrue(dst != null, CONTEXT_MSG);
+
+ if (src==dst)
+ return true;
+
+ if (src.getName()==null || !src.getName().equals(dst.getName()))
+ return false;
+
+ if (!src.getStyle().equals(dst.getStyle()))
+ return false;
+
+ // check inputs, outputs and faults
+ Input in1 = src.getEInput();
+ Input in2 = dst.getEInput();
+ if (in1!=null && in2!=null) {
+ if (!compatibleType(in1.getEMessage(), in2.getEMessage()))
+ return false;
+ }
+ else if ( (in1==null) != (in2==null) )
+ return false;
+
+ Output out1 = src.getEOutput();
+ Output out2 = dst.getEOutput();
+ if (out1!=null && out2!=null) {
+ if (!compatibleType(out1.getEMessage(), out2.getEMessage()))
+ return false;
+ }
+ else if ( (out1==null) != (out2==null) )
+ return false;
+
+ EList<Fault> faults1 = src.getEFaults();
+ EList<Fault> faults2 = dst.getEFaults();
+ if (faults1.size() != faults2.size())
+ return false;
+ for (int i=0; i<faults1.size(); ++i) {
+ if (!compatibleType(faults1.get(i).getEMessage(), faults2.get(i).getEMessage()))
+ return false;
+ }
+ return true;
+ }
/**
* @param eObj the object
* @return returns if simple type, false otherwise.
Modified: trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/CPartnerActivityValidator.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/CPartnerActivityValidator.java 2010-10-01 16:54:18 UTC (rev 25404)
+++ trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/rules/CPartnerActivityValidator.java 2010-10-01 17:02:32 UTC (rev 25405)
@@ -256,8 +256,9 @@
IProblem problem;
if (portType != null) {
-
- if (mModelQuery.check ( IModelQueryLookups.TEST_EQUAL, portTypeFromRole , portType ) == false) {
+ // https://jira.jboss.org/browse/JBIDE-7116
+ // port types just have to be compatible, not necessarily the same java object
+ if (mModelQuery.check ( IModelQueryLookups.TEST_COMPATIBLE_TYPE, portTypeFromRole , portType ) == false) {
problem = createError();
problem.fill( "BPELC_MISMATCH_ROLE_PORT_TYPE", //$NON-NLS-1$
14 years, 5 months
JBoss Tools SVN: r25404 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/deltacloud/ui and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: jjohnstn
Date: 2010-10-01 12:54:18 -0400 (Fri, 01 Oct 2010)
New Revision: 25404
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/IDeltaCloudPreferenceConstants.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/DeltaCloudPreferencePage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/PreferenceMessages.properties
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstance.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
Log:
2010-10-01 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/deltacloud/ui/IDeltaCloudPreferenceConstants.java: Add new constant
for auto-connect to RSE.
* src/org/jboss/tools/deltacloud/ui/preferences/DeltaCloudPreferencePage.java (performOk): Add
auto-connect support.
(createContents): Ditto.
* src/org/jboss/tools/deltacloud/ui/preferences/PreferenceMessages.properties: Add message for
auto-connect preference.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstance.java (WatchCreateJob.run): If
auto-connect is true, connect to RSE.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties: Add new message
for auto-connect progress.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-10-01 16:46:53 UTC (rev 25403)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-10-01 16:54:18 UTC (rev 25404)
@@ -1,3 +1,17 @@
+2010-10-01 Jeff Johnston <jjohnstn(a)redhat.com>
+
+ * src/org/jboss/tools/deltacloud/ui/IDeltaCloudPreferenceConstants.java: Add new constant
+ for auto-connect to RSE.
+ * src/org/jboss/tools/deltacloud/ui/preferences/DeltaCloudPreferencePage.java (performOk): Add
+ auto-connect support.
+ (createContents): Ditto.
+ * src/org/jboss/tools/deltacloud/ui/preferences/PreferenceMessages.properties: Add message for
+ auto-connect preference.
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstance.java (WatchCreateJob.run): If
+ auto-connect is true, connect to RSE.
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties: Add new message
+ for auto-connect progress.
+
2010-09-29 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java (makeActions):
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/IDeltaCloudPreferenceConstants.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/IDeltaCloudPreferenceConstants.java 2010-10-01 16:46:53 UTC (rev 25403)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/IDeltaCloudPreferenceConstants.java 2010-10-01 16:54:18 UTC (rev 25404)
@@ -13,6 +13,7 @@
public interface IDeltaCloudPreferenceConstants {
public final static String DONT_CONFIRM_CREATE_INSTANCE = "dont_confirm_create_instance"; //$NON-NLS-1$
+ public final static String AUTO_CONNECT_INSTANCE = "auto_connect_instance"; //$NON-NLS-1$
public final static String LAST_EC2_KEYNAME = "last_ec2_keyname"; //$NON-NLS-1$
public final static String DEFAULT_KEY_DIR = "default_key_directory"; //$NON-NLS-1$
public final static String LAST_CLOUD_INSTANCE_VIEW = "last_cloud_instance_view"; //$NON-NLS-1$
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/DeltaCloudPreferencePage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/DeltaCloudPreferencePage.java 2010-10-01 16:46:53 UTC (rev 25403)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/DeltaCloudPreferencePage.java 2010-10-01 16:54:18 UTC (rev 25404)
@@ -14,6 +14,8 @@
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
@@ -29,8 +31,10 @@
IWorkbenchPreferencePage {
private final static String LAUNCH_WARN = "LaunchWarnPreference.msg"; //$NON-NLS-1$
+ private final static String AUTO_CONNECT = "AutoConnectPreference.msg"; //$NON-NLS-1$
private Button warnLaunch;
+ private Button autoConnect;
public DeltaCloudPreferencePage() {
// TODO Auto-generated constructor stub
@@ -61,6 +65,11 @@
prefs.putBoolean(IDeltaCloudPreferenceConstants.DONT_CONFIRM_CREATE_INSTANCE, warnLaunch.getSelection());
}
+ boolean oldConnect = prefs.getBoolean(IDeltaCloudPreferenceConstants.AUTO_CONNECT_INSTANCE, true);
+ if (oldConnect != autoConnect.getSelection()) {
+ prefs.putBoolean(IDeltaCloudPreferenceConstants.AUTO_CONNECT_INSTANCE, autoConnect.getSelection());
+ }
+
try {
prefs.flush();
} catch (BackingStoreException e) {
@@ -82,7 +91,16 @@
warnLaunch = new Button(container, SWT.CHECK);
warnLaunch.setText(PreferenceMessages.getString(LAUNCH_WARN));
warnLaunch.setSelection(prefs.getBoolean(IDeltaCloudPreferenceConstants.DONT_CONFIRM_CREATE_INSTANCE, false));
+
+ autoConnect = new Button(container, SWT.CHECK);
+ autoConnect.setText(PreferenceMessages.getString(AUTO_CONNECT));
+ autoConnect.setSelection(prefs.getBoolean(IDeltaCloudPreferenceConstants.AUTO_CONNECT_INSTANCE, true));
+ FormData f = new FormData();
+ f.top = new FormAttachment(warnLaunch, 10);
+ f.left = new FormAttachment(warnLaunch, 0, SWT.LEFT);
+ autoConnect.setLayoutData(f);
+
return container;
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/PreferenceMessages.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/PreferenceMessages.properties 2010-10-01 16:46:53 UTC (rev 25403)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/PreferenceMessages.properties 2010-10-01 16:54:18 UTC (rev 25404)
@@ -8,4 +8,5 @@
# Contributors:
# Red Hat Incorporated - initial API and implementation
#################################################################################
-LaunchWarnPreference.msg=Do not warn me when launching an instance
\ No newline at end of file
+LaunchWarnPreference.msg=Do not warn me when launching an instance
+AutoConnectPreference.msg=Automatically connect to RSE when creating an instance
\ No newline at end of file
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstance.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstance.java 2010-10-01 16:46:53 UTC (rev 25403)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstance.java 2010-10-01 16:54:18 UTC (rev 25404)
@@ -22,12 +22,20 @@
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.rse.core.IRSECoreRegistry;
+import org.eclipse.rse.core.IRSESystemType;
+import org.eclipse.rse.core.RSECorePlugin;
+import org.eclipse.rse.core.model.IHost;
+import org.eclipse.rse.core.model.ISystemRegistry;
+import org.eclipse.rse.core.model.SystemStartHere;
+import org.eclipse.rse.core.subsystems.IConnectorService;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.DeltaCloudImage;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.deltacloud.ui.IDeltaCloudPreferenceConstants;
+import org.jboss.tools.deltacloud.ui.views.CVMessages;
import org.osgi.service.prefs.Preferences;
public class NewInstance extends Wizard {
@@ -40,6 +48,8 @@
private final static String DONT_SHOW_THIS_AGAIN_MSG = "DontShowThisAgain.msg"; //$NON-NLS-1$
private final static String STARTING_INSTANCE_MSG = "StartingInstance.msg"; //$NON-NLS-1$
private final static String STARTING_INSTANCE_TITLE = "StartingInstance.title"; //$NON-NLS-1$
+ private final static String RSE_CONNECTING_MSG = "ConnectingRSE.msg"; //$NON-NLS-1$
+
private NewInstancePage mainPage;
@@ -99,6 +109,47 @@
} finally {
cloud.addReplaceInstance(instance);
cloud.removeActionJob(instanceId, this);
+ String hostname = instance.getHostName();
+ Preferences prefs = new InstanceScope().getNode(Activator.PLUGIN_ID);
+ boolean autoConnect = prefs.getBoolean(IDeltaCloudPreferenceConstants.AUTO_CONNECT_INSTANCE, true);
+ if (hostname != null && hostname.length() > 0 && autoConnect) {
+ ISystemRegistry registry = SystemStartHere.getSystemRegistry();
+ RSECorePlugin rsep = RSECorePlugin.getDefault();
+ IRSECoreRegistry coreRegistry = rsep.getCoreRegistry();
+ IRSESystemType[] sysTypes = coreRegistry.getSystemTypes();
+ IRSESystemType sshType = null;
+ for (IRSESystemType sysType : sysTypes) {
+ if (sysType.getId().equals(IRSESystemType.SYSTEMTYPE_SSH_ONLY_ID))
+ sshType = sysType;
+ }
+ String connectionName = instance.getName() + " [" + instance.getId() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
+ try {
+ IHost host = registry.createHost(sshType, connectionName, hostname, null);
+ if (host != null) {
+ host.setDefaultUserId("root"); //$NON-NLS-1$
+ IConnectorService[] services = host.getConnectorServices();
+ if (services.length > 0) {
+ final IConnectorService service = services[0];
+ Job connect = new Job(CVMessages.getFormattedString(RSE_CONNECTING_MSG, connectionName)) {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ service.connect(monitor);
+ return Status.OK_STATUS;
+ } catch(Exception e) {
+ return Status.CANCEL_STATUS;
+ }
+ }
+ };
+ connect.setUser(true);
+ connect.schedule();
+ }
+ }
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ Activator.log(e);
+ }
+ }
pm.done();
}
return Status.OK_STATUS;
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-10-01 16:46:53 UTC (rev 25403)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-10-01 16:54:18 UTC (rev 25404)
@@ -79,4 +79,5 @@
ConfirmKeyDelete.msg=Confirm deletion of key: {0}
StartingInstance.title=Starting Instance
-StartingInstance.msg=Starting Instance: {0}
\ No newline at end of file
+StartingInstance.msg=Starting Instance: {0}
+ConnectingRSE.msg=Connecting instance as: {0}
14 years, 5 months
JBoss Tools SVN: r25403 - trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/util.
by jbosstools-commits@lists.jboss.org
Author: bbrodt
Date: 2010-10-01 12:46:53 -0400 (Fri, 01 Oct 2010)
New Revision: 25403
Modified:
trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/util/DeployUtils.java
Log:
https://jira.jboss.org/browse/JBIDE-6613
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-10-01 16:25:25 UTC (rev 25402)
+++ trunk/bpel/plugins/org.eclipse.bpel.apache.ode.deploy.ui/src/org/eclipse/bpel/apache/ode/deploy/ui/util/DeployUtils.java 2010-10-01 16:46:53 UTC (rev 25403)
@@ -209,9 +209,16 @@
// 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);
+ // https://jira.jboss.org/browse/JBIDE-6613
+ // fix a dumb mistake: XSDs don't have Definitions
+ // and will cause this to throw a class cast exception
+ Object obj = res.getContents().get(0);
+ if ( obj instanceof Definition )
+ {
+ Definition def = (Definition)obj;
+ if (!wsdlFiles.contains(def))
+ wsdlFiles.add(def);
+ }
}
return wsdlFiles;
@@ -229,8 +236,11 @@
if (DeployUtils.isBPELFile(file)) {
// load it
Process currentProcess = loadBPEL(file, resourceSet);
- // stuff it in bpelFiles
- bpelFiles.add(currentProcess);
+ // https://jira.jboss.org/browse/JBIDE-6613
+ // make sure the BPEL is valid.
+ if (currentProcess!=null)
+ // stuff it in bpelFiles
+ bpelFiles.add(currentProcess);
}
}
14 years, 5 months
JBoss Tools SVN: r25402 - in trunk/usage/plugins/org.jboss.tools.usage: META-INF and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-10-01 12:25:25 -0400 (Fri, 01 Oct 2010)
New Revision: 25402
Added:
trunk/usage/plugins/org.jboss.tools.usage/META-INF/default-usage-branding.xml
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/branding/
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/branding/IUsageBranding.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding/
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding/JBossToolsUsageBranding.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding/JBossToolsUsageBrandingMessages.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding/messages.properties
Removed:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBDSConstants.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBDSUtils.java
Modified:
trunk/usage/plugins/org.jboss.tools.usage/META-INF/MANIFEST.MF
trunk/usage/plugins/org.jboss.tools.usage/build.properties
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBossToolsUsageActivator.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/GlobalUsageSettings.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/PreferencesMessages.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/UsageReportPreferencePage.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/messages.properties
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/ReportingMessages.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReport.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReportDispatcher.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReportEnablementDialog.java
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/messages.properties
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/BundleUtils.java
Log:
[JBDS-1338] initial implementation. Default branding supplied by a service in org.jboss.tools.usage + specific branding by additional (superseeding) service in com.jboss.jbds.usage.branding
Modified: trunk/usage/plugins/org.jboss.tools.usage/META-INF/MANIFEST.MF
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/META-INF/MANIFEST.MF 2010-10-01 15:47:43 UTC (rev 25401)
+++ trunk/usage/plugins/org.jboss.tools.usage/META-INF/MANIFEST.MF 2010-10-01 16:25:25 UTC (rev 25402)
@@ -4,7 +4,8 @@
Bundle-SymbolicName: org.jboss.tools.usage;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.jboss.tools.usage.googleanalytics,
+Export-Package: org.jboss.tools.usage.branding,
+ org.jboss.tools.usage.googleanalytics,
org.jboss.tools.usage.googleanalytics.eclipse,
org.jboss.tools.usage.http,
org.jboss.tools.usage.internal;x-friends:="org.jboss.tools.usage.test",
@@ -21,5 +22,6 @@
Bundle-Activator: org.jboss.tools.usage.internal.JBossToolsUsageActivator
Bundle-Vendor: %bundle-vendor
Bundle-ActivationPolicy: lazy
+Service-Component: META-INF/default-usage-branding.xml
Added: trunk/usage/plugins/org.jboss.tools.usage/META-INF/default-usage-branding.xml
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/META-INF/default-usage-branding.xml (rev 0)
+++ trunk/usage/plugins/org.jboss.tools.usage/META-INF/default-usage-branding.xml 2010-10-01 16:25:25 UTC (rev 25402)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.jboss.tools.usage.branding">
+ <implementation class="org.jboss.tools.usage.internal.branding.JBossToolsUsageBranding"/>
+ <service>
+ <provide interface="org.jboss.tools.usage.branding.IUsageBranding"/>
+ </service>
+ <property name="service.ranking" type="Integer" value="-1"/>/service>
+</scr:component>
Property changes on: trunk/usage/plugins/org.jboss.tools.usage/META-INF/default-usage-branding.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/usage/plugins/org.jboss.tools.usage/build.properties
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/build.properties 2010-10-01 15:47:43 UTC (rev 25401)
+++ trunk/usage/plugins/org.jboss.tools.usage/build.properties 2010-10-01 16:25:25 UTC (rev 25402)
@@ -1,19 +1,12 @@
output.. = bin/
bin.includes = .,\
- OSGI-INF/l10n/bundle.properties,\
- .classpath,\
- .project,\
- .settings/,\
- META-INF/,\
- JBoss Usage Reporter.launch,\
about.html,\
build.properties,\
plugin.xml,\
pom.xml,\
src/,\
- tracker-service.xml,\
- OSGI-INF/propertiesprovider-factory.xml
-src.includes = JBoss Usage Reporter.launch,\
- about.html,\
+ META-INF/,\
+ OSGI-INF/
+src.includes = about.html,\
pom.xml
source.. = src/
Added: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/branding/IUsageBranding.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/branding/IUsageBranding.java (rev 0)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/branding/IUsageBranding.java 2010-10-01 16:25:25 UTC (rev 25402)
@@ -0,0 +1,22 @@
+package org.jboss.tools.usage.branding;
+
+public interface IUsageBranding {
+
+ public String getPreferencesDescription();
+
+ public String getPreferencesAllowReportingCheckboxLabel();
+
+ public String getStartupAllowReportingTitle();
+
+ public String getStartupAllowReportingCheckboxLabel();
+
+ public String getStartupAllowReportingMessage();
+
+ public String getStartupAllowReportingDetailLink();
+
+ public String getGlobalRemotePropertiesUrl();
+
+ public String getGoogleAnalyticsAccount();
+
+ public String getGoogleAnalyticsReportingHost();
+}
Property changes on: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/branding/IUsageBranding.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBDSConstants.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBDSConstants.java 2010-10-01 15:47:43 UTC (rev 25401)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBDSConstants.java 2010-10-01 16:25:25 UTC (rev 25402)
@@ -1,19 +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.tools.usage.internal;
-
-public class JBDSConstants {
- /** the suffix that gets added to message keys when reporting JBDS */
- public static final String JBDS_MESSAGEKEY_SUFFIX = "_JBDS";
-
- /** the JBDS product feature id */
- public static final String JBDS_PRODUCT_ID = "com.jboss.jbds.product.product";
-}
Deleted: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBDSUtils.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBDSUtils.java 2010-10-01 15:47:43 UTC (rev 25401)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBDSUtils.java 2010-10-01 16:25:25 UTC (rev 25402)
@@ -1,29 +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.tools.usage.internal;
-
-import org.eclipse.core.runtime.IProduct;
-import org.eclipse.core.runtime.Platform;
-
-
-public class JBDSUtils {
-
- private static Boolean isJBDS = null;
-
- public static boolean isJBDS() {
- if (isJBDS == null) {
- IProduct product = Platform.getProduct();
- isJBDS = (product != null
- && JBDSConstants.JBDS_PRODUCT_ID.equals(product.getId()));
- }
- return isJBDS;
- }
-}
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBossToolsUsageActivator.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBossToolsUsageActivator.java 2010-10-01 15:47:43 UTC (rev 25401)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/JBossToolsUsageActivator.java 2010-10-01 16:25:25 UTC (rev 25402)
@@ -11,11 +11,13 @@
package org.jboss.tools.usage.internal;
import org.eclipse.core.runtime.Plugin;
+import org.jboss.tools.usage.branding.IUsageBranding;
import org.jboss.tools.usage.googleanalytics.IJBossToolsEclipseEnvironment;
import org.jboss.tools.usage.internal.preferences.UsageReportPreferencesUtils;
import org.jboss.tools.usage.internal.reporting.JBossToolsEclipseEnvironment;
-import org.jboss.tools.usage.internal.reporting.ReportingMessages;
+import org.jboss.tools.usage.util.BundleUtils;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
/**
* @author Andre Dietisheim
@@ -27,7 +29,7 @@
private static JBossToolsUsageActivator plugin;
private IJBossToolsEclipseEnvironment eclipseEnvironment;
-
+
public JBossToolsUsageActivator() {
plugin = this;
}
@@ -41,37 +43,32 @@
public static JBossToolsUsageActivator getDefault() {
return plugin;
}
-
+
public void start(BundleContext context) throws Exception {
super.start(context);
}
public IJBossToolsEclipseEnvironment getJBossToolsEclipseEnvironment() {
- if (eclipseEnvironment == null) {
- eclipseEnvironment = createEclipseEnvironment();
+ try {
+ if (eclipseEnvironment == null) {
+ eclipseEnvironment = createEclipseEnvironment();
+ }
+ return eclipseEnvironment;
+ } catch (Exception e) {
+ return null;
}
- return eclipseEnvironment;
}
- private IJBossToolsEclipseEnvironment createEclipseEnvironment() {
+ private IJBossToolsEclipseEnvironment createEclipseEnvironment() throws InvalidSyntaxException {
+ IUsageBranding branding = BundleUtils.getHighestRankedService(IUsageBranding.class.getName(),
+ JBossToolsUsageActivator
+ .getDefault().getBundle());
+ if (branding == null) {
+ return null;
+ }
+
return new JBossToolsEclipseEnvironment(
- getGoogleAnalyticsAccount(), getGoogleAnalyticsHostname(),
+ branding.getGoogleAnalyticsAccount(), branding.getGoogleAnalyticsReportingHost(),
UsageReportPreferencesUtils.getPreferences());
}
-
- private String getGoogleAnalyticsAccount() {
- if (JBDSUtils.isJBDS()) {
- return ReportingMessages.UsageReport_GoogleAnalytics_Account_JBDS;
- } else {
- return ReportingMessages.UsageReport_GoogleAnalytics_Account;
- }
- }
-
- private String getGoogleAnalyticsHostname() {
- if (JBDSUtils.isJBDS()) {
- return ReportingMessages.UsageReport_HostName_JBDS;
- } else {
- return ReportingMessages.UsageReport_HostName;
- }
- }
}
Added: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding/JBossToolsUsageBranding.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding/JBossToolsUsageBranding.java (rev 0)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding/JBossToolsUsageBranding.java 2010-10-01 16:25:25 UTC (rev 25402)
@@ -0,0 +1,42 @@
+package org.jboss.tools.usage.internal.branding;
+
+import org.jboss.tools.usage.branding.IUsageBranding;
+
+public class JBossToolsUsageBranding implements IUsageBranding {
+
+ public String getPreferencesDescription() {
+ return JBossToolsUsageBrandingMessages.UsageReportPreferencePage_Description;
+ }
+
+ public String getPreferencesAllowReportingCheckboxLabel() {
+ return JBossToolsUsageBrandingMessages.UsageReportPreferencePage_AllowReporting;
+ }
+
+ public String getStartupAllowReportingTitle() {
+ return JBossToolsUsageBrandingMessages.UsageReport_DialogTitle;
+ }
+
+ public String getStartupAllowReportingMessage() {
+ return JBossToolsUsageBrandingMessages.UsageReport_DialogMessage;
+ }
+
+ public String getStartupAllowReportingCheckboxLabel() {
+ return JBossToolsUsageBrandingMessages.UsageReport_Checkbox_Text;
+ }
+
+ public String getStartupAllowReportingDetailLink() {
+ return JBossToolsUsageBrandingMessages.UsageReport_ExplanationPage;
+ }
+
+ public String getGlobalRemotePropertiesUrl() {
+ return JBossToolsUsageBrandingMessages.GlobalUsageSettings_RemoteProps_URL;
+ }
+
+ public String getGoogleAnalyticsAccount() {
+ return JBossToolsUsageBrandingMessages.UsageReport_GoogleAnalytics_Account;
+ }
+
+ public String getGoogleAnalyticsReportingHost() {
+ return JBossToolsUsageBrandingMessages.UsageReport_HostName;
+ }
+}
Property changes on: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding/JBossToolsUsageBranding.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding/JBossToolsUsageBrandingMessages.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding/JBossToolsUsageBrandingMessages.java (rev 0)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding/JBossToolsUsageBrandingMessages.java 2010-10-01 16:25:25 UTC (rev 25402)
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * 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.tools.usage.internal.branding;
+
+import org.eclipse.osgi.util.NLS;
+
+public class JBossToolsUsageBrandingMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.usage.internal.branding.messages"; //$NON-NLS-1$
+
+ public static String UsageReportPreferencePage_Description;
+ public static String UsageReportPreferencePage_AllowReporting;
+
+ public static String GlobalUsageSettings_RemoteProps_URL;
+
+// public static String UsageReportPreferencePage_Description_JBDS;
+// public static String UsageReportPreferencePage_AllowReporting_JBDS;
+//
+// public static String GlobalUsageSettings_RemoteProps_URL_JBDS;
+
+ public static String UsageReport_DialogTitle;
+ public static String UsageReport_DialogMessage;
+ public static String UsageReport_GoogleAnalytics_Account;
+ public static String UsageReport_Checkbox_Text;
+ public static String UsageReport_HostName;
+ public static String UsageReport_ExplanationPage;
+
+// public static String UsageReport_DialogTitle_JBDS;
+// public static String UsageReport_DialogMessage_JBDS;
+// public static String UsageReport_GoogleAnalytics_Account_JBDS;
+// public static String UsageReport_Checkbox_Text_JBDS;
+// public static String UsageReport_HostName_JBDS;
+// public static String UsageReport_ExplanationPage_JBDS;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, JBossToolsUsageBrandingMessages.class);
+ }
+
+ private JBossToolsUsageBrandingMessages() {
+ }
+}
Property changes on: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding/JBossToolsUsageBrandingMessages.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding/messages.properties
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding/messages.properties (rev 0)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding/messages.properties 2010-10-01 16:25:25 UTC (rev 25402)
@@ -0,0 +1,25 @@
+UsageReportPreferencePage_Description=Preference page with options for anonymous usage data reporting.\nUsage data is used for statistical matters only.
+UsageReportPreferencePage_AllowReporting=&Please allow the JBoss Tools team to receive anonymous usage\n statistics for this Eclipse installation with JBoss Tools.
+UsageReportPreferencePage_Error_Saving=Could not save the preferences.
+
+GlobalUsageSettings_RemoteProps_URL=http://anonsvn.jboss.org/repos/jbosstools/workspace/usage/usage.properties
+
+# this is a hack to get into the code freeze deadline. this stuff will be removed with a proper implementatino
+UsageReportPreferencePage_Description_JBDS=Preference page with options for anonymous usage data reporting.\nUsage data is used for statistical matters only.
+UsageReportPreferencePage_AllowReporting_JBDS=&Please allow Red Hat Inc. to receive anonymous usage\n statistics for this JBoss Developer Studio installation.
+
+GlobalUsageSettings_RemoteProps_URL_JBDS=http://devstudio.jboss.com/usage/usage.properties
+
+UsageReport_DialogMessage=Please allow JBoss Tools team to receive anonymous usage statistics for this Eclipse instance with JBoss Tools (<a>info</a>).
+UsageReport_Checkbox_Text=Report usage of JBoss Tools to JBoss Tools team.
+UsageReport_GoogleAnalytics_Account=UA-17645367-1
+UsageReport_HostName=jboss.org
+UsageReport_ExplanationPage=http://jboss.org/tools/usage
+
+# this is a hack to get into the code freeze deadline. this stuff will be removed with a proper implementation
+UsageReport_DialogTitle_JBDS=JBoss Developer Studio Usage
+UsageReport_DialogMessage_JBDS=Please allow Red Hat Inc. to receive anonymous usage statistics for this JBoss Developer Studio installation (<a>info</a>).
+UsageReport_GoogleAnalytics_Account_JBDS=UA-18653195-2
+UsageReport_Checkbox_Text_JBDS=Report usage of JBoss Developer Studio to Red Hat Inc.
+UsageReport_HostName_JBDS=devstudio.jboss.com
+UsageReport_ExplanationPage_JBDS=http://devstudio.jboss.com/usage
Property changes on: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/branding/messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/GlobalUsageSettings.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/GlobalUsageSettings.java 2010-10-01 15:47:43 UTC (rev 25401)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/GlobalUsageSettings.java 2010-10-01 16:25:25 UTC (rev 25402)
@@ -12,10 +12,15 @@
import java.util.Map;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
+import org.jboss.tools.usage.branding.IUsageBranding;
import org.jboss.tools.usage.http.HttpRemotePropertiesProvider;
import org.jboss.tools.usage.http.IPropertiesProvider;
-import org.jboss.tools.usage.internal.JBDSUtils;
+import org.jboss.tools.usage.internal.JBossToolsUsageActivator;
+import org.jboss.tools.usage.util.BundleUtils;
+import org.jboss.tools.usage.util.LoggingUtils;
+import org.jboss.tools.usage.util.StatusUtils;
/**
* A class that implements a global reporting enablement setting. The current
@@ -46,18 +51,17 @@
private IPropertiesProvider remoteMap;
public GlobalUsageSettings(Plugin plugin) {
- remoteMap = createRemoteMap(
- getRemotePropsUrl()
- , VALUE_DELIMITER
- , plugin
- , REMOTEPROPS_USAGE_REPORTING_ENABLED_KEY);
- }
-
- private String getRemotePropsUrl() {
- if (JBDSUtils.isJBDS()) {
- return PreferencesMessages.GlobalUsageSettings_RemoteProps_URL_JBDS;
- } else {
- return PreferencesMessages.GlobalUsageSettings_RemoteProps_URL;
+ try {
+ IUsageBranding brandingService = BundleUtils.getHighestRankedService(IUsageBranding.class.getName(),
+ JBossToolsUsageActivator.getDefault().getBundle());
+ remoteMap = createRemoteMap(
+ brandingService.getGlobalRemotePropertiesUrl()
+ , VALUE_DELIMITER
+ , plugin
+ , REMOTEPROPS_USAGE_REPORTING_ENABLED_KEY);
+ } catch (Exception e) {
+ IStatus status = StatusUtils.getErrorStatus(JBossToolsUsageActivator.PLUGIN_ID, "could not ", e);
+ LoggingUtils.log(status, JBossToolsUsageActivator.getDefault());
}
}
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/PreferencesMessages.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/PreferencesMessages.java 2010-10-01 15:47:43 UTC (rev 25401)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/PreferencesMessages.java 2010-10-01 16:25:25 UTC (rev 25402)
@@ -33,16 +33,6 @@
public static String UsageReportPreferencePage_ScreenResolution;
public static String UsageReportPreferencePage_Error_Saving;
- public static String UsageReportPreferencePage_Description;
- public static String UsageReportPreferencePage_AllowReporting;
-
- public static String GlobalUsageSettings_RemoteProps_URL;
-
- public static String UsageReportPreferencePage_Description_JBDS;
- public static String UsageReportPreferencePage_AllowReporting_JBDS;
-
- public static String GlobalUsageSettings_RemoteProps_URL_JBDS;
-
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, PreferencesMessages.class);
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/UsageReportPreferencePage.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/UsageReportPreferencePage.java 2010-10-01 15:47:43 UTC (rev 25401)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/UsageReportPreferencePage.java 2010-10-01 16:25:25 UTC (rev 25402)
@@ -17,6 +17,7 @@
import java.util.List;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
@@ -29,10 +30,11 @@
import org.eclipse.swt.widgets.Group;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.jboss.tools.usage.branding.IUsageBranding;
import org.jboss.tools.usage.googleanalytics.IJBossToolsEclipseEnvironment;
import org.jboss.tools.usage.googleanalytics.eclipse.IEclipseUserAgent;
-import org.jboss.tools.usage.internal.JBDSUtils;
import org.jboss.tools.usage.internal.JBossToolsUsageActivator;
+import org.jboss.tools.usage.util.BundleUtils;
import org.jboss.tools.usage.util.StatusUtils;
import org.jboss.tools.usage.util.StringUtils;
import org.osgi.service.prefs.BackingStoreException;
@@ -65,46 +67,65 @@
fillLayout.marginWidth = 8;
group.setLayout(fillLayout);
StyledText text = new StyledText(group, SWT.BORDER | SWT.V_SCROLL);
+ text.setEditable(false);
IJBossToolsEclipseEnvironment eclipseEnvironment = JBossToolsUsageActivator.getDefault()
.getJBossToolsEclipseEnvironment();
- createText(eclipseEnvironment, text);
- text.setEditable(false);
+ if (eclipseEnvironment == null) {
+ text.setText("usage reporting facility is disabled");
+ } else {
+ createText(eclipseEnvironment, text);
+ }
}
private void createText(IJBossToolsEclipseEnvironment eclipseEnvironment, StyledText text) {
List<StyleRange> styles = new ArrayList<StyleRange>();
StringBuilder builder = new StringBuilder();
- appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_JBossToolsVersion, eclipseEnvironment.getJBossToolsVersion(), builder, styles);
- appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_JBossToolsComponents, eclipseEnvironment.getKeyword(), builder, styles);
+ appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_JBossToolsVersion,
+ eclipseEnvironment.getJBossToolsVersion(), builder, styles);
+ appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_JBossToolsComponents,
+ eclipseEnvironment.getKeyword(), builder, styles);
builder.append(StringUtils.getLineSeparator());
IEclipseUserAgent eclipseUserAgent = eclipseEnvironment.getEclipseUserAgent();
- appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_ProductId, eclipseUserAgent.getApplicationName(), builder, styles);
+ appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_ProductId,
+ eclipseUserAgent.getApplicationName(), builder, styles);
- appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_ProductVersion, eclipseUserAgent.getApplicationVersion(), builder, styles);
+ appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_ProductVersion,
+ eclipseUserAgent.getApplicationVersion(), builder, styles);
builder.append(StringUtils.getLineSeparator());
- appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_OperatingSystem, eclipseUserAgent.getOS(), builder, styles);
- appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_OperatingSystemVersion, eclipseUserAgent.getOSVersion(), builder, styles);
+ appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_OperatingSystem, eclipseUserAgent.getOS(),
+ builder, styles);
+ appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_OperatingSystemVersion,
+ eclipseUserAgent.getOSVersion(), builder, styles);
if (eclipseEnvironment.isLinuxDistro()) {
- appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_LinuxDistro, eclipseEnvironment.getUserDefined(), builder, styles);
+ appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_LinuxDistro,
+ eclipseEnvironment.getUserDefined(), builder, styles);
}
builder.append(StringUtils.getLineSeparator());
- appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_Locale, eclipseUserAgent.getBrowserLanguage(), builder, styles);
- appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_ScreenColors, eclipseEnvironment.getScreenColorDepth(), builder, styles);
- appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_ScreenResolution, eclipseEnvironment.getScreenResolution(), builder, styles);
+ appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_Locale, eclipseUserAgent.getBrowserLanguage(),
+ builder, styles);
+ appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_ScreenColors,
+ eclipseEnvironment.getScreenColorDepth(), builder, styles);
+ appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_ScreenResolution,
+ eclipseEnvironment.getScreenResolution(), builder, styles);
builder.append(StringUtils.getLineSeparator());
- appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_ProductOwner, eclipseEnvironment.getHostname(), builder, styles);
+ appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_ProductOwner,
+ eclipseEnvironment.getHostname(), builder, styles);
builder.append(StringUtils.getLineSeparator());
- appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_NumberOfUsageHits, String.valueOf(eclipseEnvironment.getVisitCount()), builder,
+ appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_NumberOfUsageHits,
+ String.valueOf(eclipseEnvironment.getVisitCount()), builder,
styles);
- appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_FirstUsageHit, getFormattedDate(eclipseEnvironment.getFirstVisit()), builder, styles);
- appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_LastUsageHit, getFormattedDate(eclipseEnvironment.getLastVisit()), builder, styles);
- appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_CurrentUsageHit, getFormattedDate(eclipseEnvironment.getCurrentVisit()), builder,
+ appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_FirstUsageHit,
+ getFormattedDate(eclipseEnvironment.getFirstVisit()), builder, styles);
+ appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_LastUsageHit,
+ getFormattedDate(eclipseEnvironment.getLastVisit()), builder, styles);
+ appendLabeledValue(PreferencesMessages.UsageReportPreferencePage_CurrentUsageHit,
+ getFormattedDate(eclipseEnvironment.getCurrentVisit()), builder,
styles);
text.setText(builder.toString());
@@ -150,31 +171,34 @@
}
public void createFieldEditors() {
- addField(new BooleanFieldEditor(
- IUsageReportPreferenceConstants.USAGEREPORT_ENABLED_ID
- , getCheckBoxlabel()
- , getFieldEditorParent()));
- }
-
- private String getCheckBoxlabel() {
- if (JBDSUtils.isJBDS()) {
- return PreferencesMessages.UsageReportPreferencePage_AllowReporting_JBDS;
- } else {
- return PreferencesMessages.UsageReportPreferencePage_AllowReporting;
+ IUsageBranding branding;
+ try {
+ branding = BundleUtils.getHighestRankedService(IUsageBranding.class.getName(), JBossToolsUsageActivator
+ .getDefault().getBundle());
+ addField(new BooleanFieldEditor(
+ IUsageReportPreferenceConstants.USAGEREPORT_ENABLED_ID
+ , branding.getPreferencesAllowReportingCheckboxLabel()
+ , getFieldEditorParent()));
+ } catch (Exception e) {
+ catchBrandingError(e);
}
}
public void init(IWorkbench workbench) {
setPreferenceStore(UsageReportPreferences.createPreferenceStore());
- setDescription(getPageDescription());
+ IUsageBranding branding;
+ try {
+ branding = BundleUtils.getHighestRankedService(IUsageBranding.class.getName(), JBossToolsUsageActivator
+ .getDefault().getBundle());
+ setDescription(branding.getPreferencesDescription());
+ } catch (Exception e) {
+ catchBrandingError(e);
+ }
}
- private String getPageDescription() {
- if (JBDSUtils.isJBDS()) {
- return PreferencesMessages.UsageReportPreferencePage_Description_JBDS;
- } else {
- return PreferencesMessages.UsageReportPreferencePage_Description;
- }
+ private void catchBrandingError(Exception e) {
+ IStatus status = StatusUtils.getErrorStatus(JBossToolsUsageActivator.PLUGIN_ID, "Could not find branding.", e);
+ ErrorDialog.openError(getShell(), "Branding Error", "Could not display usage reporting preferences", status);
}
@Override
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/messages.properties
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/messages.properties 2010-10-01 15:47:43 UTC (rev 25401)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/preferences/messages.properties 2010-10-01 16:25:25 UTC (rev 25402)
@@ -14,15 +14,4 @@
UsageReportPreferencePage_ProductVersion=Product version\:
UsageReportPreferencePage_ScreenColors=Screen Colors\:
UsageReportPreferencePage_ScreenResolution=Screen Resolution\:
-
-UsageReportPreferencePage_Description=Preference page with options for anonymous usage data reporting.\nUsage data is used for statistical matters only.
-UsageReportPreferencePage_AllowReporting=&Please allow the JBoss Tools team to receive anonymous usage\n statistics for this Eclipse installation with JBoss Tools.
-UsageReportPreferencePage_Error_Saving=Could not save the preferences.
-
-GlobalUsageSettings_RemoteProps_URL=http://anonsvn.jboss.org/repos/jbosstools/workspace/usage/usage.properties
-
-# this is a hack to get into the code freeze deadline. this stuff will be removed with a proper implementatino
-UsageReportPreferencePage_Description_JBDS=Preference page with options for anonymous usage data reporting.\nUsage data is used for statistical matters only.
-UsageReportPreferencePage_AllowReporting_JBDS=&Please allow Red Hat Inc. to receive anonymous usage\n statistics for this JBoss Developer Studio installation.
-
-GlobalUsageSettings_RemoteProps_URL_JBDS=http://devstudio.jboss.com/usage/usage.properties
+UsageReportPreferencePage_Error_Saving=Could not save usage reporting preferences
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/ReportingMessages.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/ReportingMessages.java 2010-10-01 15:47:43 UTC (rev 25401)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/ReportingMessages.java 2010-10-01 16:25:25 UTC (rev 25402)
@@ -18,22 +18,8 @@
public static String UsageReport_Reporting_Usage;
public static String UsageReport_Querying_Enablement;
public static String UsageReport_Asking_User;
- public static String UsageReport_DialogTitle;
public static String UsageReport_Error_SavePreferences;
- public static String UsageReport_Checkbox_Text;
- public static String UsageReport_DialogMessage;
- public static String UsageReport_GoogleAnalytics_Account;
- public static String UsageReport_HostName;
- public static String UsageReport_ExplanationPage;
-
- public static String UsageReport_DialogTitle_JBDS;
- public static String UsageReport_DialogMessage_JBDS;
- public static String UsageReport_GoogleAnalytics_Account_JBDS;
- public static String UsageReport_Checkbox_Text_JBDS;
- public static String UsageReport_HostName_JBDS;
- public static String UsageReport_ExplanationPage_JBDS;
-
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, ReportingMessages.class);
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReport.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReport.java 2010-10-01 15:47:43 UTC (rev 25401)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReport.java 2010-10-01 16:25:25 UTC (rev 25402)
@@ -34,6 +34,7 @@
import org.jboss.tools.usage.tracker.internal.SuffixFocusPoint;
import org.jboss.tools.usage.tracker.internal.Tracker;
import org.jboss.tools.usage.util.StatusUtils;
+import org.osgi.framework.InvalidSyntaxException;
import org.osgi.service.prefs.BackingStoreException;
/**
@@ -47,7 +48,7 @@
private IJBossToolsEclipseEnvironment eclipseEnvironment;
- public UsageReport() {
+ public UsageReport() throws InvalidSyntaxException {
eclipseEnvironment = JBossToolsUsageActivator.getDefault().getJBossToolsEclipseEnvironment();
focusPoint = new SuffixFocusPoint("tools", eclipseEnvironment.getJBossToolsVersion()) //$NON-NLS-1$
.setChild(new FocusPoint("usage") //$NON-NLS-1$
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReportDispatcher.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReportDispatcher.java 2010-10-01 15:47:43 UTC (rev 25401)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReportDispatcher.java 2010-10-01 16:25:25 UTC (rev 25402)
@@ -10,8 +10,12 @@
******************************************************************************/
package org.jboss.tools.usage.internal.reporting;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IStartup;
+import org.jboss.tools.usage.internal.JBossToolsUsageActivator;
+import org.jboss.tools.usage.util.LoggingUtils;
+import org.jboss.tools.usage.util.StatusUtils;
/**
* @author Andre Dieitsheim
@@ -22,7 +26,12 @@
Display.getDefault().asyncExec(new Runnable() {
public void run() {
- new UsageReport().report();
+ try {
+ new UsageReport().report();
+ } catch (Exception e) {
+ IStatus status = StatusUtils.getErrorStatus(JBossToolsUsageActivator.PLUGIN_ID, "could not start usage reporting", e);
+ LoggingUtils.log(status, JBossToolsUsageActivator.getDefault());
+ }
}
});
}
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReportEnablementDialog.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReportEnablementDialog.java 2010-10-01 15:47:43 UTC (rev 25401)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/UsageReportEnablementDialog.java 2010-10-01 16:25:25 UTC (rev 25402)
@@ -10,7 +10,9 @@
******************************************************************************/
package org.jboss.tools.usage.internal.reporting;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.window.IShellProvider;
@@ -22,9 +24,12 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Shell;
-import org.jboss.tools.usage.internal.JBDSUtils;
+import org.jboss.tools.usage.branding.IUsageBranding;
import org.jboss.tools.usage.internal.JBossToolsUsageActivator;
import org.jboss.tools.usage.util.BrowserUtil;
+import org.jboss.tools.usage.util.BundleUtils;
+import org.jboss.tools.usage.util.StatusUtils;
+import org.osgi.framework.InvalidSyntaxException;
/**
* @author Andre Dietisheim
@@ -50,14 +55,13 @@
protected void configureShell(Shell shell) {
super.configureShell(shell);
- shell.setText(getDialogTitle());
- }
-
- private String getDialogTitle() {
- if (JBDSUtils.isJBDS()) {
- return ReportingMessages.UsageReport_DialogTitle_JBDS;
- } else {
- return ReportingMessages.UsageReport_DialogTitle;
+ try {
+ IUsageBranding branding = BundleUtils.getHighestRankedService(IUsageBranding.class.getName(),
+ JBossToolsUsageActivator
+ .getDefault().getBundle());
+ shell.setText(branding.getStartupAllowReportingTitle());
+ } catch (InvalidSyntaxException e) {
+ catchBrandingError(e);
}
}
@@ -70,63 +74,52 @@
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
+ createUsageReportingWidgets(parent, composite);
+ applyDialogFont(composite);
- // message
- Link link = new Link(composite, SWT.WRAP);
- link.setFont(parent.getFont());
- link.setText(
- getLinkText());
- link.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- BrowserUtil.checkedCreateExternalBrowser(
- getExplanationUrl(),
- JBossToolsUsageActivator.PLUGIN_ID,
- JBossToolsUsageActivator.getDefault().getLog());
- }
- });
- GridDataFactory.fillDefaults()
+ return composite;
+ }
+
+ private void createUsageReportingWidgets(Composite parent, Composite composite) {
+ try {
+ // message
+ Link link = new Link(composite, SWT.WRAP);
+ link.setFont(parent.getFont());
+
+ final IUsageBranding branding = BundleUtils.getHighestRankedService(IUsageBranding.class.getName(),
+ JBossToolsUsageActivator.getDefault().getBundle());
+ link.setText(branding.getStartupAllowReportingMessage());
+ link.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ BrowserUtil.checkedCreateExternalBrowser(
+ branding.getStartupAllowReportingDetailLink(),
+ JBossToolsUsageActivator.PLUGIN_ID,
+ JBossToolsUsageActivator.getDefault().getLog());
+ }
+ });
+ GridDataFactory.fillDefaults()
.align(SWT.FILL, SWT.CENTER)
.grab(true, false)
.hint(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH, SWT.DEFAULT)
.applyTo(link);
- // checkbox
- checkBox = new Button(composite, SWT.CHECK);
- checkBox.setText(getCheckBoxText());
- GridDataFactory.fillDefaults().grab(true, false).align(SWT.LEFT, SWT.CENTER).applyTo(checkBox);
+ // checkbox
+ checkBox = new Button(composite, SWT.CHECK);
+ checkBox.setText(branding.getStartupAllowReportingCheckboxLabel());
+ GridDataFactory.fillDefaults().grab(true, false).align(SWT.LEFT, SWT.CENTER).applyTo(checkBox);
+ } catch (Exception e) {
+ catchBrandingError(e);
+ }
+ }
- applyDialogFont(composite);
-
- return composite;
+ private void catchBrandingError(Exception e) {
+ IStatus status = StatusUtils.getErrorStatus(JBossToolsUsageActivator.PLUGIN_ID, "Could not find branding.", e);
+ ErrorDialog.openError(getShell(), "Branding Error", "Could not ask to allow usage reporting", status);
+ close();
}
public boolean isReportEnabled() {
return reportEnabled;
}
-
- private String getCheckBoxText() {
- if (JBDSUtils.isJBDS()) {
- return ReportingMessages.UsageReport_Checkbox_Text_JBDS;
- } else {
- return ReportingMessages.UsageReport_Checkbox_Text;
- }
- }
-
- private String getLinkText() {
- if (JBDSUtils.isJBDS()) {
- return ReportingMessages.UsageReport_DialogMessage_JBDS;
- } else {
- return ReportingMessages.UsageReport_DialogMessage;
- }
- }
-
- private String getExplanationUrl() {
- if (JBDSUtils.isJBDS()) {
- return ReportingMessages.UsageReport_ExplanationPage_JBDS;
- } else {
- return ReportingMessages.UsageReport_ExplanationPage;
- }
- }
-
}
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/messages.properties
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/messages.properties 2010-10-01 15:47:43 UTC (rev 25401)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/internal/reporting/messages.properties 2010-10-01 16:25:25 UTC (rev 25402)
@@ -1,20 +1,4 @@
UsageReport_Reporting_Usage=Reporting JBoss Developer Studio usage
UsageReport_Querying_Enablement=Querying whether reporting is globally enabled
UsageReport_Asking_User=Asking User to allow reporting
-UsageReport_DialogTitle=JBoss Tools Usage
UsageReport_Error_SavePreferences=Could not save preferences {0}
-
-UsageReport_DialogMessage=Please allow JBoss Tools team to receive anonymous usage statistics for this Eclipse instance with JBoss Tools (<a>info</a>).
-UsageReport_Checkbox_Text=Report usage of JBoss Tools to JBoss Tools team.
-UsageReport_GoogleAnalytics_Account=UA-17645367-1
-UsageReport_HostName=jboss.org
-UsageReport_ExplanationPage=http://jboss.org/tools/usage
-
-# this is a hack to get into the code freeze deadline. this stuff will be removed with a proper implementation
-UsageReport_DialogTitle_JBDS=JBoss Developer Studio Usage
-UsageReport_DialogMessage_JBDS=Please allow Red Hat Inc. to receive anonymous usage statistics for this JBoss Developer Studio installation (<a>info</a>).
-UsageReport_GoogleAnalytics_Account_JBDS=UA-18653195-2
-UsageReport_Checkbox_Text_JBDS=Report usage of JBoss Developer Studio to Red Hat Inc.
-UsageReport_HostName_JBDS=devstudio.jboss.com
-UsageReport_ExplanationPage_JBDS=http://devstudio.jboss.com/usage
-
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/BundleUtils.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/BundleUtils.java 2010-10-01 15:47:43 UTC (rev 25401)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/util/BundleUtils.java 2010-10-01 16:25:25 UTC (rev 25402)
@@ -17,6 +17,10 @@
import org.jboss.tools.usage.util.collectionfilter.CollectionFilterUtils;
import org.jboss.tools.usage.util.collectionfilter.ICollectionFilter;
import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
/**
* @author Andre Dietisheim
@@ -70,4 +74,42 @@
return pattern.matcher(bundle.getSymbolicName()).matches();
}
}
+
+// @SuppressWarnings("unchecked")
+// public static <T> T getService(String serviceClass, Bundle bundle) {
+// BundleContext bundleContext = bundle.getBundleContext();
+// ServiceReference serviceReference = bundleContext.getServiceReference(serviceClass);
+// if (serviceReference == null) {
+// return null;
+// }
+// return (T) bundleContext.getService(serviceReference);
+// }
+
+ @SuppressWarnings("unchecked")
+ public static <T> T getHighestRankedService(String serviceClass, Bundle bundle) throws InvalidSyntaxException {
+ BundleContext bundleContext = bundle.getBundleContext();
+ ServiceReference[] serviceReferences = bundleContext.getServiceReferences(serviceClass, null);
+ if (serviceReferences.length != 0) {
+ ServiceReference reference = getHihgestRankedServiceReference(bundleContext, serviceReferences);
+ if (reference != null) {
+ return (T) bundleContext.getService(reference);
+ }
+ }
+
+ return null;
+ }
+
+ private static ServiceReference getHihgestRankedServiceReference(BundleContext bundleContext,
+ ServiceReference[] serviceReferences) {
+ Integer highestRanking = Integer.MIN_VALUE;
+ ServiceReference currentReference = null;
+ for (ServiceReference reference : serviceReferences) {
+ Integer ranking = (Integer) reference.getProperty(Constants.SERVICE_RANKING);
+ if (ranking > highestRanking) {
+ currentReference = reference;
+ highestRanking = ranking;
+ }
+ }
+ return currentReference;
+ }
}
14 years, 5 months