Skip to content

Commit

Permalink
JBIDE-16521 - zipped publish checkbox in server editor was broken
Browse files Browse the repository at this point in the history
JBIDE-16521 - zipped publish checkbox in server editor was broken
  • Loading branch information
robstryker committed Feb 12, 2014
1 parent 785217a commit ea38665
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ public IProvideCredentials getFirstCredentialProvider(IServerProvider serverProv
}

private ArrayList<PublisherWrapper> publishers;
@Deprecated
public IJBossServerPublisher getPublisher(IServer server, IModule[] module, String deployMethod) {
if( publishers == null )
loadPublishers();
Expand All @@ -220,6 +221,7 @@ public IJBossServerPublisher getPublisher(IServer server, IModule[] module, Stri
return null;
}

@Deprecated
private void loadPublishers() {
ArrayList<PublisherWrapper> publishers = new ArrayList<PublisherWrapper>();
IExtensionRegistry registry = Platform.getExtensionRegistry();
Expand Down Expand Up @@ -255,6 +257,7 @@ public int compare(PublisherWrapper o1, PublisherWrapper o2) {
Collections.sort(this.publishers, comparator);
}

@Deprecated
private class PublisherWrapper {
private int priority;
private IJBossServerPublisher publisher;
Expand All @@ -280,6 +283,7 @@ public String toString() {
}
}

@Deprecated
public IJBossServerPublisher[] getZippedPublishers() {
if( publishers == null )
loadPublishers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,21 +455,10 @@ public void radioSelected(Object c) {
}

protected boolean isZippedPublisherAvailable() {
/*
* Maybe use IJBossServerPublishMethodType type = DeploymentPreferenceLoader.getCurrentDeploymentMethodType(getServer());
* But this class has no reference to the server, and it also might not want to go by stored data,
* but rather the combo in the ModuleDeploymentPage somehow?
*/

// String method = DeploymentPreferenceLoader.getCurrentDeploymentMethodType(getServer()).getId();
String method = LocalPublishMethod.LOCAL_PUBLISH_METHOD;
IJBossServerPublisher[] publishers =
ExtensionManager.getDefault().getZippedPublishers();
for( int i = 0; i < publishers.length; i++ ) {
if( publishers[i].accepts(method, getServer().getServer(), null))
return true;
}
return false;
// Zipped publisher is always available after rewrite.
// ASTools now depends on archives and doesn't need to do weird logic
// to find a zipped publisher
return true;
}

public class SetDeployDirCommand extends ServerCommand {
Expand Down

0 comments on commit ea38665

Please sign in to comment.