08-26-2013 12:17 PM
08-26-2013 02:39 PM
08-27-2013 05:06 AM
08-27-2013 08:15 AM
08-28-2013 09:54 AM
/**
* Set busy and create base site
*/
onDBAR: function FGCreateSiteMgr_onDBAR(p_form, obj) {
this.submittedForm = p_form;
this._setBusy(this.msg("fg-create-site-mgr.create.creating"));
// Call the site create
var jsonSite = {
visibility: this.siteVisibility,
title: p_form.dataObj[this.siteTitle],
shortName: p_form.dataObj[this.siteTitle],
description: p_form.dataObj[this.siteDescription],
sitePreset: this.sitePreset
}
var actionURL = YAHOO.lang.substitute("/share/service/modules/create-site");
Alfresco.util.Ajax.request(
{
url: actionURL,
method: Alfresco.util.Ajax.POST,
dataObj: jsonSite,
requestContentType: Alfresco.util.Ajax.JSON,
responseContentType: Alfresco.util.Ajax.JSON,
successCallback:
{
fn: this._siteCreated,
scope: this
},
failureCallback:
{
fn: this._createSiteFailed,
scope: this
},
scope: this,
noReloadOnAuthFailure: true
});
// This kills the AJAX processing of the form and allows me
// to do my own submit control.
return false;
},
_siteCreated: function FGCreateSiteMgr__siteCreated()
{
this._releaseBusy();
Alfresco.util.PopupManager.displayMessage(
{
text: this.msg("fg-create-site-mgr.create.complete"),
spanClass: "wait",
displayTime: 0
});
var responseJSON = eval('(' + response.serverResponse.responseText + ')');
if (responseJSON) {
// Now, where do we go "none" means go to the site dashboard
var navigateTo = "";
if(responseJSON.navigateTo == "none") {
navigateTo = "/share/page/site/" + responseJSON.shortName + "/dashboard";
} else {
navigateTo = "/share/page/site/" + responseJSON.shortName + "/create-content?destination=" + responseJSON.nodeRef + "&itemId=" + responseJSON.navigateTo + "&mimeType=text/plain";
}
window.location.href = navigateTo;
}
},
_createSiteFailed: function FGCreateSiteMgr__createSiteFailed(response)
{
this._releaseBusy();
var errorMsg = this.msg("fg-create-site-mgr.create.failed");
if((response.serverResponse.status != 200) && (response.serverResponse.status != 500)) {
errorMsg = errorMsg + ": " + response.serverResponse.status + " " + response.serverResponse.statusText;
}
if (response.json.message) {
var ourMsg = this.msg(response.json.message);
errorMsg = errorMsg + ": " + ourMsg;
}
Alfresco.util.PopupManager.displayPrompt(
{
title: this.msg("message.failure"),
text: errorMsg
});
},
/**
* Tell the world we are doing something
*/
_setBusy: function FGCreateSiteMgr__setBusy(busyMessage)
{
if (this.busy)
{
return false;
}
this.busy = true;
this.widgets.busyMessage = Alfresco.util.PopupManager.displayMessage(
{
text: busyMessage,
spanClass: "wait",
displayTime: 0
});
return true;
},
/**
* Removes the busy message and marks the component as non-busy
*
* @method _releaseBusy
*/
_releaseBusy: function FGCreateSiteMgr__releaseBusy()
{
if (this.busy)
{
this.widgets.busyMessage.destroy();
this.busy = false;
return true;
}
else
{
return false;
}
}
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.