Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Commit

Permalink
Merge branch 'master' of https://github.com/wso2/product-af
Browse files Browse the repository at this point in the history
  • Loading branch information
Danushka Fernando committed Sep 22, 2015
2 parents fa76547 + f2a43d0 commit 7d3ccf9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
3 changes: 3 additions & 0 deletions modules/jaggery-apps/appmgt/src/jagg/constants.jag
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ var MUTUALSSL_HEADER_USERNAME_URL = "http://mutualssl.carbon.wso2.org";
var CLOUD_HEADER_USERNAME_URL = "http://cloud.carbon.wso2.org/username";
var CLOUD_HEADER_SECRET_URL = "http://cloud.carbon.wso2.org/secret";

//for application creation started message

var APPLICATION_CREATION_STARTED_FLAG = "appCreationStartedFlag_";
var PAGES={
APP_HOME : "APP_HOME",
USER_HOME : "USER_HOME",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@ var log=new Log();
var applicationDescription = replaceSpecialCharacters(request.getParameter("applicationDescription"));
var applicationType = request.getParameter("appType");
var repositoryType = request.getParameter("repositoryType");
log.info(repositoryType)
var repoAccessibility = request.getParameter("repoAccessibility");
var repoAccessibility = request.getParameter("repoAccessibility");
var userName = request.getParameter("userName");
var applicationURL = request.getParameter("applicationURL");
var appTypeDisplayName1 = request.getParameter("appTypeDisplayName");
log.info("applicationType + " + applicationType);
var response = {};
if (jagg.module("permission").isUserAccessGrantedForPlatform(PERMISSION_APPLICATION_CREATE)) {
try {
Expand All @@ -64,15 +62,12 @@ var log=new Log();
// is created.
if(!isApplicationDuplicateWithSession(applicationKey,applicationName, repositoryType,
applicationDescription, applicationType, userName,appTypeDisplayName)){
log.info("inside if 1")
for (var provider in repositoryProviders) {
if (repositoryType == repositoryProviders[provider]) {
log.info("repositoryType if 2")
result = mod.createApplicationBPEL(applicationName, applicationKey,
applicationDescription, applicationType,
repoAccessibility, repositoryType, userName,
applicationURL, 'trunk', LIFE_CYCLE_NAME);
log.info(result)
message = "Application was created under Repository type ".concat(repositoryType);
response.message = message;
response.result = 1;
Expand All @@ -85,7 +80,8 @@ var log=new Log();
response.message = message;
response.result = 0;
}

// this session parameter is to , show the application creation started message only once
session.put(APPLICATION_CREATION_STARTED_FLAG + applicationKey, true);
print(response);

} catch (e) {
Expand Down Expand Up @@ -126,6 +122,8 @@ var log=new Log();
log.error(e);
status = generateValidationResponse(false, msg);
}
// this session parameter is to , show the application creation started message only once
session.put(APPLICATION_CREATION_STARTED_FLAG + applicationKey, true);
print(status);
} else if (action == "uploadExistingApplication") {
var registryMod = jagg.module("registry");
Expand Down Expand Up @@ -190,6 +188,8 @@ var log=new Log();
response.message = "You don't have permission to create application";
response.result = 0;
}
// this session parameter is to , show the application creation started message only once
session.put(APPLICATION_CREATION_STARTED_FLAG + applicationKey, true);
print(response);

} catch (e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var popoverAdded = false;
// page initialization
$(document).ready(function() {
// show the application creation status as a notification
if("created" == userAction) {
if(appCreationStartedFlag) {
showTopMessage("Application creation started.");
}
// set current version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
var servicePath = appFacURL + getProperty(WEB_CONTEXT_ROOT);
var iconUrl = appFacURL + getProperty(WEB_CONTEXT_ROOT) + "/site/blocks/application/get/ajax/list.jag?action=getAppIcon&applicationKey=" + applicationKey;
var applicationInfo = outputs.applicationInfo;

var appCreationStartedFlag = session.get(APPLICATION_CREATION_STARTED_FLAG + applicationKey);
session.remove(APPLICATION_CREATION_STARTED_FLAG + applicationKey);
var appName = "";
if(applicationInfo){
if (applicationInfo.name) {
Expand Down Expand Up @@ -57,6 +58,8 @@
var fgdmAllowedStage = JSON.parse('<%=stringify(outputs.fineGrainedDomainMappingAllowedStage)%>');
var previousVersion = "<%=previousVersion%>";
var lifeCycleName = "<%=LIFE_CYCLE_NAME%>";
var appCreationStartedFlag = "<%=appCreationStartedFlag%>";
appCreationStartedFlag = JSON.parse(appCreationStartedFlag);
</script>

<!-- end of setting global javascript variable -->
Expand Down

0 comments on commit 7d3ccf9

Please sign in to comment.