|
|
@ -11,20 +11,20 @@ public class DesignerWorkspaceGenerator { |
|
|
|
|
|
|
|
|
|
|
|
public static Workspace generate(DesignerWorkspaceInfo config) throws Exception { |
|
|
|
public static Workspace generate(DesignerWorkspaceInfo config) throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
if (config == null || config.getType() == null) { |
|
|
|
if (config == null || config.getType() == null) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Workspace workspace = null; |
|
|
|
Workspace workspace = null; |
|
|
|
switch (config.getType()) { |
|
|
|
switch (config.getType()) { |
|
|
|
case Local: { |
|
|
|
case Local: { |
|
|
|
workspace = WorkContext.getFactory().build(config.getPath()); |
|
|
|
workspace = WorkContext.getFactory().build(config.getPath()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
case Remote: { |
|
|
|
case Remote: { |
|
|
|
WorkspaceClient client = WorkContext.getConnector().connect(config.getConnection()); |
|
|
|
WorkspaceClient client = WorkContext.getConnector().connect(config.getConnection()); |
|
|
|
if (client != null) { |
|
|
|
if (client != null) { |
|
|
|
workspace = new RemoteWorkspace(client, config.getConnection()); |
|
|
|
workspace = new RemoteWorkspace(client, config.getConnection()); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|