Author: keith
Date: Fri Apr 4 09:04:09 2008
New Revision: 15579
Log:
Updating backend services to accept a parameter to decide weather to share
comments or not. Mashup-644
Modified:
trunk/mashup/java/modules/core/src/org/wso2/mashup/requestprocessor/DownloadProcessor.java
trunk/mashup/java/modules/core/src/org/wso2/mashup/utils/MashupArchiveManupulator.java
trunk/mashup/java/modules/coreservices/servicesharinghelper/src/org/wso2/mashup/coreservices/servicesharinghelper/ServiceSharingHelper.java
Modified:
trunk/mashup/java/modules/core/src/org/wso2/mashup/requestprocessor/DownloadProcessor.java
==============================================================================
---
trunk/mashup/java/modules/core/src/org/wso2/mashup/requestprocessor/DownloadProcessor.java
(original)
+++
trunk/mashup/java/modules/core/src/org/wso2/mashup/requestprocessor/DownloadProcessor.java
Fri Apr 4 09:04:09 2008
@@ -19,10 +19,8 @@
import org.apache.axis2.description.AxisService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.wso2.mashup.MashupConstants;
import org.wso2.mashup.utils.MashupArchiveManupulator;
import org.wso2.mashup.utils.MashupUtils;
-import org.wso2.wsas.ServerConstants;
import org.wso2.wsas.transport.HttpGetRequestProcessor;
import javax.servlet.http.HttpServletRequest;
@@ -55,7 +53,8 @@
MashupArchiveManupulator mashupArchiveManupulator =
new MashupArchiveManupulator();
mashupArchiveManupulator
- .createMashupArchive(axisService,
configurationContext, outputStream);
+ .createMashupArchive(axisService,
configurationContext, outputStream,
+ "true");
outputStream.flush();
} else {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
Modified:
trunk/mashup/java/modules/core/src/org/wso2/mashup/utils/MashupArchiveManupulator.java
==============================================================================
---
trunk/mashup/java/modules/core/src/org/wso2/mashup/utils/MashupArchiveManupulator.java
(original)
+++
trunk/mashup/java/modules/core/src/org/wso2/mashup/utils/MashupArchiveManupulator.java
Fri Apr 4 09:04:09 2008
@@ -75,7 +75,8 @@
* @throws MashupFault - Thrown in case an Exception occurs
*/
public DataHandler createMashupArchiveDataHandler(AxisService
mashupService,
- ConfigurationContext
configCtx)
+ ConfigurationContext
configCtx,
+ String migrateTags)
throws MashupFault {
// Use the WSAS work dir to create the temporary archive file
Object workDirObject = configCtx.getProperty(ServerConstants.WORK_DIR);
@@ -92,7 +93,8 @@
// write the service js file & the contents of the
// service.resources folder to the outstream of the data source
- createMashupArchive(mashupService, configCtx,
dataSource.getOutputStream());
+ createMashupArchive(mashupService, configCtx,
dataSource.getOutputStream(),
+ migrateTags);
} catch (IOException e) {
throw new MashupFault(e);
}
@@ -102,7 +104,8 @@
}
public void createMashupArchive(AxisService mashupService,
ConfigurationContext configCtx,
- OutputStream outputStream) throws
MashupFault {
+ OutputStream outputStream, String
migrateTags)
+ throws MashupFault {
File serviceFile;
File serviceResourceFolder = null;
@@ -139,7 +142,7 @@
Parameter myRegistryPath =
mashupService.getParameter(MashupConstants.REGISTRY_MASHUP_PATH);
ByteArrayInputStream byteArrayInputStream = null;
- if (myRegistryPath != null) {
+ if ("true".equals(migrateTags) && myRegistryPath != null) {
String mashupPath = (String) myRegistryPath.getValue();
JDBCRegistry registry =
(JDBCRegistry)
configCtx.getAxisConfiguration().getParameterValue(
@@ -167,9 +170,6 @@
}
}
-
-
-
if (serviceFile != null && serviceResourceFolder != null) {
try {
// Creating a FileDataSource
@@ -520,4 +520,4 @@
fis.close();
}
}
-}
+}
\ No newline at end of file
Modified:
trunk/mashup/java/modules/coreservices/servicesharinghelper/src/org/wso2/mashup/coreservices/servicesharinghelper/ServiceSharingHelper.java
==============================================================================
---
trunk/mashup/java/modules/coreservices/servicesharinghelper/src/org/wso2/mashup/coreservices/servicesharinghelper/ServiceSharingHelper.java
(original)
+++
trunk/mashup/java/modules/coreservices/servicesharinghelper/src/org/wso2/mashup/coreservices/servicesharinghelper/ServiceSharingHelper.java
Fri Apr 4 09:04:09 2008
@@ -46,10 +46,11 @@
private static final Log log = LogFactory.getLog(GlobalAdmin.class);
public Boolean shareService(String serviceName, String username, String
password,
- String destinationServerAddress, String
overwriteExisting)
+ String destinationServerAddress, String
overwriteExisting,
+ String migrateTags)
throws IOException {
boolean success;
- File serviceFile = null;
+ File serviceFile;
MessageContext currentMessageContext =
MessageContext.getCurrentMessageContext();
AxisConfiguration configuration =
currentMessageContext.getAxisService()
@@ -68,7 +69,7 @@
}
MashupArchiveManupulator masshupArchiveManupulator = new
MashupArchiveManupulator();
DataHandler dataHandler =
masshupArchiveManupulator.createMashupArchiveDataHandler(
- axisService, configContext);
+ axisService, configContext, migrateTags);
String value = (String)
axisService.getParameterValue(ServerConstants.SERVICE_TYPE);
if (MashupConstants.MASHUP_JS_SERVICE.equals(value)) {
@@ -101,10 +102,11 @@
}
public Boolean shareServiceIC(String serviceName, String infoCardToken,
- String destinationServerAddress, String
overwriteExisting)
+ String destinationServerAddress, String
overwriteExisting,
+ String migrateTags)
throws IOException {
boolean success;
- File serviceFile = null;
+ File serviceFile;
MessageContext currentMessageContext =
MessageContext.getCurrentMessageContext();
AxisConfiguration configuration =
currentMessageContext.getAxisService()
@@ -123,7 +125,7 @@
}
MashupArchiveManupulator masshupArchiveManupulator = new
MashupArchiveManupulator();
DataHandler dataHandler =
masshupArchiveManupulator.createMashupArchiveDataHandler(
- axisService, configContext);
+ axisService, configContext, migrateTags);
String value = (String)
axisService.getParameterValue(ServerConstants.SERVICE_TYPE);
if (MashupConstants.MASHUP_JS_SERVICE.equals(value)) {
_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev