on 01-11-2016 4:57 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Michal,
What I've determined in the interim by installing Wireshark on the backend is that the connection from the SCC reaches the target EP server.
The WEBIDE plugin is somehow just not calling the endpoint.
I see that the release notes of the NetWeaver 7.5 SP01 installation refers to a WEBIDE plugin. I am assuming that there may be a upgrade for the version currently deployed in the WEBIDE (Version 1.0.7) in SP01 - I will contact our basis support team to hear if there is an update in the downloads they received when installing the SP.
Any suggestions will be greatly appreciated
Ok,
I worked out what was wrong.
In the WEBIDE plugin file Deploy.js (added below for clarity)
The deploy button is created in an inactive state (line 452).
The button's state is only changed to enabled in the eventhandler _validateDeployData: (line 480)
This event handler is only called when one of the fields in the dialog is physically changed.
Thus, if the dialog is opened pre-populated from the project, you have to manually change a field for the deploy button to get enabled.
Maybe this can be corrected in a future release.
Regards
Andre _validateDeploy
define(function() {
return {
_oContext: null,
_oModel: null,
createContent: function(oContext, oModel) {
var that = this;
that._oContext = oContext;
that._oModel = oModel;
that.aDialogButtons = [];
that.oGrid = new sap.ui.layout.Grid({
vSpacing: 0
});
that.oLoginGrid = new sap.ui.layout.Grid({
vSpacing: 0
});
that.oDestinationsGrid = new sap.ui.layout.Grid({
vSpacing: 0
});
var nameErrorMsg = that._oContext.i18n.getText("i18n", "CreateApplicationStep_RegexNameErrorMsg");
that.message = new sap.ui.commons.TextView({
text: nameErrorMsg,
width: "100%",
accessibleRole: sap.ui.core.AccessibleRole.Textbox,
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12"
})
});
var aStyles = [{
uri: "portaldeploy/css/portalClass.css"
}];
that._oContext.service.resource.includeStyles(aStyles).done();
that.message.addStyleClass("errorText");
that.message.addStyleClass("validText");
//grid to display error messages
that.oMessageGrid = new sap.ui.layout.Grid({
vSpacing: 0,
content: [that.message]
});
that.oLoginGrid.setVisible(false);
////////////////////////////////project name////////////////////////////////////////
var label = that._oContext.i18n.getText("i18n", "ApplicationName");
var projectNameLabel = new sap.ui.commons.Label({
required: true,
text: label,
textAlign: "Left",
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12"
})
});
that.projectNameTextField = new sap.ui.commons.TextField({
value: "{/projectName}",
width: "100%",
liveChange: function(oEvent) {
var liveValue = oEvent.getParameter("liveValue");
that._oModel.setProperty("/projectName", liveValue);
if(that._validateInput(liveValue)){
that._hideErrorMessageBar();
that._validateDeployData();
}
else{
var projNameErrorMsg = that._oContext.i18n.getText("i18n", "CreateApplicationStep_RegexNameErrorMsg");
that._showErrorMessageBar(projNameErrorMsg);
that.deployBtn.setEnabled(false);
}
},
accessibleRole: sap.ui.core.AccessibleRole.Textbox,
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12"
})
});
var projectNameContent = new sap.ui.layout.Grid({
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12",
linebreak: true
}),
content: [projectNameLabel, that.projectNameTextField]
});
that.oGrid.addContent(projectNameContent);
//////////////////End project name/////////////////////////////////////////////////
///////////////////user name////////////////////////////////////////
var userNamelabelText = that._oContext.i18n.getText("i18n", "User_Name");
var userNameLabel = new sap.ui.commons.Label({
required: true,
text: userNamelabelText,
textAlign: "Left",
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12"
})
});
that.userNameTextField = new sap.ui.commons.TextField({
value: "{/userName}",
width: "100%",
liveChange: function(oEvent) {
var liveValue = oEvent.getParameter("liveValue");
that._oModel.setProperty("/userName", liveValue);
that._validateLoginData();
},
accessibleRole: sap.ui.core.AccessibleRole.Textbox,
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12"
})
});
var userNameContent = new sap.ui.layout.Grid({
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12",
linebreak: true
}),
content: [userNameLabel, that.userNameTextField]
});
that.oLoginGrid.addContent(userNameContent);
//////////////////End user name/////////////////////////////////////////////////
//////////////////password////////////////////////////////////////
var passwordLabelText = that._oContext.i18n.getText("i18n", "Password");
var passwordLabel = new sap.ui.commons.Label({
required: true,
text: passwordLabelText,
textAlign: "Left",
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12"
})
});
that.passwordTextField = new sap.ui.commons.PasswordField({
value: "{/password}",
width: "100%",
liveChange: function(oEvent) {
var liveValue = oEvent.getParameter("liveValue");
that._oModel.setProperty("/password", liveValue);
that._validateLoginData();
},
accessibleRole: sap.ui.core.AccessibleRole.Textbox,
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12"
})
});
var passwordContent = new sap.ui.layout.Grid({
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12",
linebreak: true
}),
content: [passwordLabel, that.passwordTextField]
});
that.oLoginGrid.addContent(passwordContent);
//////////////////End password/////////////////////////////////////////////////
//add the component path and component name only if Component.js was found in the project
if (that._oModel.getProperty("/compPath") && that._oModel.getProperty("/compPath") != null) {
that._oModel.setProperty("/componentExists", true);
////////////////////////////////Component name////////////////////////////////////////
var compNamelable = that._oContext.i18n.getText("i18n", "ComponentJsName");
var componentNameLabel = new sap.ui.commons.Label({
required: true,
text: compNamelable,
textAlign: "Left",
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12"
})
});
that.componentNameTextField = new sap.ui.commons.TextField({
value: "{/compName}",
width: "100%",
liveChange: function(oEvent) {
var liveValue = oEvent.getParameter("liveValue");
that._oModel.setProperty("/compName", liveValue);
if(that._validateInput(liveValue)){
//that._hideErrorMessageBar();
that._validateDeployData();
}
},
accessibleRole: sap.ui.core.AccessibleRole.Textbox,
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12"
})
});
var componentNameContent = new sap.ui.layout.Grid({
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12",
linebreak: true
}),
content: [componentNameLabel, that.componentNameTextField]
});
that.oGrid.addContent(componentNameContent);
//////////////////End component name/////////////////////////////////////////////////
////////////////////////////////Component path////////////////////////////////////////
var compPathLable = that._oContext.i18n.getText("i18n", "ComponentJsPath");
var componentPathLabel = new sap.ui.commons.Label({
required: true,
text: compPathLable,
textAlign: "Left",
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12"
})
}).addStyleClass("wizardBody");
that.componentPathTextField = new sap.ui.commons.TextField({
value: "{/compPath}",
width: "100%",
liveChange: function(oEvent) {
var liveValue = oEvent.getParameter("liveValue");
that._oModel.setProperty("/compPath", liveValue);
if(that._validateInput(liveValue)){
that._validateDeployData();
}
},
accessibleRole: sap.ui.core.AccessibleRole.Textbox,
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12"
})
});
var componentPathContent = new sap.ui.layout.Grid({
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12",
linebreak: true
}),
content: [componentPathLabel, that.componentPathTextField]
});
that.oGrid.addContent(componentPathContent);
//////////////////End component path/////////////////////////////////////////////////
} else {
that._oModel.setProperty("/componentExists", false);
}
////////////////////////////////index.html////////////////////////////////////////
var indexLabel = that._oContext.i18n.getText("i18n", "indexHtml");
var indexHtmlLabel = new sap.ui.commons.Label({
required: false,
text: indexLabel,
textAlign: "Left",
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12"
})
});
that.indexHtmlTextField = new sap.ui.commons.TextField({
value: "{/indexHtml}",
width: "100%",
liveChange: function(oEvent) {
var liveValue = oEvent.getParameter("liveValue");
that._oModel.setProperty("/indexHtml", liveValue);
if(that._validateInput(liveValue)){
that._validateDeployData();
}
},
accessibleRole: sap.ui.core.AccessibleRole.Textbox,
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12"
})
});
var indexHtmlContent = new sap.ui.layout.Grid({
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12",
linebreak: true
}),
content: [indexHtmlLabel, that.indexHtmlTextField]
});
that.oGrid.addContent(indexHtmlContent);
//////////////////End index.html/////////////////////////////////////////////////
////////////////////////////////Description////////////////////////////////////////
var descriptionLabelText = that._oContext.i18n.getText("i18n", "Description");
var descriptionLabel = new sap.ui.commons.Label({
required: false,
text: descriptionLabelText,
textAlign: "Left",
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12"
})
}).addStyleClass("wizardBody");
that.descriptionTextField = new sap.ui.commons.TextField({
value: "{/description}",
width: "100%",
liveChange: function(oEvent) {
var liveValue = oEvent.getParameter("liveValue");
that._oModel.setProperty("/description", liveValue);
},
accessibleRole: sap.ui.core.AccessibleRole.Textbox,
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12"
})
});
var descriptionContent = new sap.ui.layout.Grid({
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12",
linebreak: true
}),
content: [descriptionLabel, that.descriptionTextField]
});
that.oGrid.addContent(descriptionContent);
//////////////////End Description/////////////////////////////////////////////////
///////////////////Destinations/////////////////////////////////////////////////
var destinationLabel = that._oContext.i18n.getText("i18n", "System");
var domainLabel = new sap.ui.commons.Label({
required: true,
text: destinationLabel,
textAlign: "Left",
layoutData: new sap.ui.layout.GridData({
span: "L2 M2 S12"
})
}).addStyleClass("wizardBody");
that.domainDropdownBox = new sap.ui.commons.DropdownBox("destinationsDropDown", {
layoutData: new sap.ui.layout.GridData({
span: "L10 M10 S12"
}),
width: "100%",
accessibleRole: sap.ui.core.AccessibleRole.Combobox,
change: function(oEvent) {
var destinationKey = oEvent.mParameters.newValue;
var destinationsMap = that._oModel.getProperty("/destinationsMap");
var selectedDestination = destinationsMap.get(destinationKey);
that._oModel.setProperty("/destination", selectedDestination);
}
});
that.domainDropdownBox.addDelegate({
onBeforeRendering: function() {
var destinations = that._oContext.service.destination.getDestinations("enterprise_portal", true, "description");
return destinations.then(function(foundDestinations) {
destinations = foundDestinations;
var mAllDestinations = new Map();
var destination = null;
var oItem = null;
//the onbeforeRendering is called twice so this is called in order to avoid duplications.
that.domainDropdownBox.removeAllItems();
for (var i = 0; i < destinations.length; i++) {
destination = destinations[i];
mAllDestinations.set(destination.name, destinations[i]);
oItem = new sap.ui.core.ListItem();
oItem.setText(destination.name);
oItem.setAdditionalText(destination.url);
var oDestinationJSON = new sap.ui.model.json.JSONModel(destination);
oItem.setModel(oDestinationJSON);
oItem.setKey(i);
that.domainDropdownBox.addItem(oItem);
}
if (destinations[0] != undefined) {
that._oModel.setProperty("/destination", destinations[0]);
}
// if only one destination exists - select it
if ((destinations.length === 1) && (oItem !== null)) {
that.domainDropdownBox.setSelectedKey(oItem.getKey());
that.domainDropdownBox.fireChange({
"selectedItem": oItem
});
}
that._oModel.setProperty("/destinationsMap", mAllDestinations);
that.destinationsLoaded = true;
that.domainDropdownBox.setEnabled(true);
that.domainDropdownBox.focus();
that._validateDeployData();
});
}
});
var domainContent = new sap.ui.layout.Grid({
layoutData: new sap.ui.layout.GridData({
span: "L12 M12 S12",
linebreak: true
}),
content: [domainLabel, that.domainDropdownBox]
});
that.oDestinationsGrid.addContent(domainContent);
///////////////////Destinations End//////////////////////////////////////////////
///////////////////buttons///////////////////////////////////////////////////////
that.deployBtn = new sap.ui.commons.Button({
text: "Deploy",
tooltip: "Deploy",
press: function() {
that.oDialog.setBusy(true);
// setTimeout(function(){
// that.oDialog.setBusy(false);
// alert("timeout, cannot determine if deployment is succesful");
// }, 30000);
var destination = that._oModel.getProperty("/destination");
//we'll do a ping to check if login is needed, if we get an xsrf token in the response, we can do imiditly a deploy request, otherwise,
//show the login popup
that._oContext.service.FileSender.ping(destination).then(function(xhr) {
if (xhr) {
var responseCode = xhr.status;
var responseStatusText = xhr.statusText;
if (responseCode === 200) {
var xsrf = xhr.getResponseHeader("X-CSRF-TOKEN");
if (xsrf == null) {
//show the login popup
that.oGrid.setVisible(false);
that.oLoginGrid.setVisible(true);
that.deployBtn.setVisible(false);
that.Login.setVisible(true);
that.Login.setEnabled(false);
that.domainDropdownBox.setEnabled(false);
that.oDialog.setBusy(false);
var dialogTitle = that._oContext.i18n.getText("i18n", "LoginToPortal");
that.oDialog.setTitle(dialogTitle);
} else {
that._oModel.setProperty("/xsrfid", xsrf);
that._deploy();
}
} else {
var errorMessage = "Netwrok Error";
if (responseCode && responseStatusText) {
errorMessage = responseStatusText;
}
that._handleDeployFailed(errorMessage);
}
} else {
that._handleDeployFailed("Netwrok Error");
}
});
}
});
that.cancel = new sap.ui.commons.Button({
text: "Cancel",
tooltip: "Cancel",
press: function() {
that.oDialog.close();
that.oDialog.destroy();
}
});
that.Login = new sap.ui.commons.Button({
text: "Login",
tooltip: "Login",
press: function() {
that.oDialog.setBusy(true);
var userName = that._oModel.getProperty("/userName");
var password = that._oModel.getProperty("/password");
var destination = that._oModel.getProperty("/destination");
that._oContext.service.FileSender.login(userName, password, destination).then(function(xhr) {
if (xhr) {
var responseCode = xhr.status;
var responseStatusText = xhr.statusText;
var responseText = xhr.responseText;
if (responseCode === 200) {
var xsrf = xhr.getResponseHeader("X-CSRF-TOKEN");
if (xsrf == null) {
var loginFail = that._oContext.i18n.getText("i18n", "Login_Failed");
that._showErrorMessageBar(loginFail);
} else {
that._oModel.setProperty("/xsrfid", xsrf);
that._handleLoginSuccess();
}
} else {
that._showErrorMessageBar(responseStatusText + "\n" + responseText);
}
}
});
}
});
that.Login.setVisible(false);
///////////////////End buttons//////////////////////////////////////
that.aDialogButtons.push(
that.deployBtn, that.Login, that.cancel
);
this.deployBtn.setEnabled(false);
var dialogTitle = that._oContext.i18n.getText("i18n", "commandgroup_sample");
that.oDialog = new sap.ui.commons.Dialog({
width: "600px",
resizable: false,
modal: true,
title: dialogTitle,
content: [that.oMessageGrid, that.oGrid, that.oLoginGrid, that.oDestinationsGrid],
buttons: that.aDialogButtons
});
that.oDialog.setModel(that._oModel);
// report when the wizard is opened
that._oContext.service.usagemonitoring.report("deployment", "deploy_to_ep", "open_dialog").done();
that.oDialog.open();
},
_validateLoginData: function() {
this.Login.setEnabled(false);
var user = this._oModel.getProperty("/userName");
var password = this._oModel.getProperty("/password");
var destination = this._oModel.getProperty("/destination");
if (destination !== undefined) {
if (user !== undefined && user.length > 0) {
if (password !== undefined && password.length > 0) {
this.Login.setEnabled(true);
}
}
}
},
_validateDeployData: function() {
this.deployBtn.setEnabled(false);
var projectName = this._oModel.getProperty("/projectName");
var destination = this._oModel.getProperty("/destination");
if (destination == undefined) {
return;
}
if (this._oModel.getProperty("/componentExists")) {
var compName = this._oModel.getProperty("/compName");
var compPath = this._oModel.getProperty("/compPath");
if (projectName !== undefined && projectName.length > 0) {
if (compName !== undefined && compName.length > 0) {
if (compPath !== undefined && compPath.length > 0) {
this.deployBtn.setEnabled(true);
}
}
}
} else {
if (projectName !== undefined && projectName.length > 0) {
this.deployBtn.setEnabled(true);
}
}
},
_handleDeployFailed: function(sMessage) {
var that = this;
that.domainDropdownBox.setEnabled(true);
that.oDialog.setBusy(false);
that.oDialog.close();
// report when the deployment fails
that._oContext.service.usagemonitoring.report("deployment", "deploy_to_ep","Deploy failed " + sMessage).done();
that._oContext.service.usernotification.alert(sMessage).then(function() {
that.oDialog.open();
});
},
_handleLoginSuccess: function() {
this.oMessageGrid.setVisible(false);
this._deploy();
},
_showErrorMessageBar: function(sMessage) {
this.message.setText(sMessage);
this._oContext.service.usagemonitoring.report("deployment", "deploy_to_ep",sMessage).done();
this.message.removeStyleClass("validText");
this.oDialog.setBusy(false);
},
_hideErrorMessageBar: function() {
this.message.addStyleClass("validText");
},
_validateInput: function(inputValue) {
// validate project name is not empty
if (inputValue.length === 0) {
return false;
} else if (!this._checkNameAllowed(inputValue)) {
return false;
}
return true;
},
/** Note: This method checks against all the name parts (splitted by '.') and not in one regex due to performance reasons **/
_checkNameAllowed: function(sName) {
//Corresponds to allowed characters for UI5 Repositories (which are also valid UI5 namespaces):
//Last character must not be a "."
//First character must be a letter or _
//After . must come a letter or _
//maximum length 100 charechters according to the portal's limit
if(sName.length > 100){
return false;
}
var sLastChar = sName.charAt(sName.length - 1);
if (sLastChar === ".") {
return false;
} else {
var aParts = sName.split(".");
var rAllowedPartNames = /^[a-zA-Z_]+[a-zA-Z0-9_]*$/;
for (var i = 0; i < aParts.length; i++) {
if (!rAllowedPartNames.test(aParts[i])) {
//regex returns null in case of no match
return false;
}
}
return true;
}
},
_deploy: function() {
var that = this;
that._oContext.service.usagemonitoring.startPerf("deployment", "deploy_to_ep").done();
that.oDialog.setBusy(true);
var destination = that._oModel.getProperty("/destination");
var compName = that._oModel.getProperty("/compName");
var compPath = that._oModel.getProperty("/compPath");
var xsrfid = that._oModel.getProperty("/xsrfid");
var projectName = that._oModel.getProperty("/projectName");
var description = that._oModel.getProperty("/description");
var indexHtmlPath = that._oModel.getProperty("/indexHtml");
var config = {};
config["X-CSRF-TOKEN"] = xsrfid;
config.providerName = "WRRDeployer";
config.fileName = projectName.concat(".zip");
config["com.sap.portal.pcm.Title"] = projectName;
config["com.sap.portal.pcm.Description"] = description || "";
//the two properties are name and path of the component.js file
config.SAPUI5URLPath = compPath || "";
config.SAPUI5CompName = compName || "";
if (config.SAPUI5URLPath === "") {
config.EmbedIViewInFLP = "false";
} else {
config.EmbedIViewInFLP = "true";
}
//This is the html file to run in AFP
config.UI5RelativePath = indexHtmlPath || "";
if(config.UI5RelativePath.charAt(0) ==='/'){
//since the portal concats the WRR root folder with "/" at the end before the UI5RelativePath, this is to avoid "//"
config.UI5RelativePath = config.UI5RelativePath.substr(1);
}
config.destination = destination;
config.timeout = 60000; // Set timeout to 60 seconds (60000 milliseconds)
that._oContext.service.PortalDeployService.deployToPortal(config, that._oContext).then(function(xhr) {
if (xhr) {
var responseCode = xhr.status;
var responseStatusText = xhr.statusText;
var responseText = xhr.responseText;
if (responseCode.toString() === "201") {
that._oContext.service.usagemonitoring.report("deployment", "deploy_to_ep", "Deploy succesful").done();
that.oDialog.close();
that.oDialog.destroy();
that._oContext.service.usernotification.info("Deploy success!");
} else {
if (responseCode.toString() === "200") {
//this means we got the login screen and need to do login
that.oLoginGrid.setVisible(true);
that.oGrid.setVisible(false);
that.deployBtn.setVisible(false);
that.Login.setVisible(true);
that.Login.setEnabled(false);
that.oDialog.setBusy(false);
var dialogTitle = that._oContext.i18n.getText("i18n", "LoginToPortal");
that.oDialog.setTitle(dialogTitle);
} else {
//we got an unpexpected response...
that._handleDeployFailed(responseStatusText.concat(" - ").concat(responseText));
}
}
} else {
// report when the deployment fails
that._oContext.service.usagemonitoring.report("deployment", "deploy_to_ep","Deploy failed due to network issue").done();
that._oContext.service.usernotification.alert("Netwrok Error").then(function() {
that.oDialog.setBusy(false);
});
}
});
}
};
});
any errors in console?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.