06-04-2009 10:28 AM
org.alfresco.web.scripts.WebScriptException: 05040001 Failed to load script '/or
g/alfresco/modules/test/config-test.post.json.js (in classpath store file:C:
/Alfresco/tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts)': 05040
000 TypeError: Cannot read property "properties" from null (file:C:/Alfresco/tom
cat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/modules/
test/config-test.post.json.js#7)
var c = sitedata.getComponent(url.templateArgs.componentId);
var testLogin = String(json.get("testLogin"));
var testPass = String(json.get("testPass"));
var testURL = String(json.get("testURL"));
c.properties["testLogin"] = testLogin;
model.testLogin = (testLogin == "") ? null : testLogin;
c.properties["testPass"] = testPass;
model.testPass = (testPass == "") ? null : testPass;
c.properties["testURL"] = testURL;
model.testURL = (testURL == "") ? null : testURL;
c.save();
06-04-2009 10:40 AM
06-04-2009 11:30 AM
<webscript>
<shortname>Test Config post</shortname>
<description>Configuration dialog for Test dashlet</description>
<url>/modules/test/config/{componentId}</url>
<format default="html">argument</format>
</webscript>
06-04-2009 12:10 PM
06-05-2009 04:48 AM
var uri = args.testURI;
if (!uri)
{
// Use the default
var conf = new XML(config.script);
uri = conf.uri[0].toString();
}
var url = "http://localhost/test/login.php?username=admin&password=admin&return=alfresco_view_page.php";
model.url = url;
var testLogin = args.testLogin;
if (!testLogin)
{
testLogin = "";
}
var testPass = args.testPass;
if (!testPass)
{
testPass = "";
}
var testURL = args.testURL;
if (!testURL)
{
testURL = "";
}
var connector = remote.connect("http");
var re = /^http:\/\//;
if (!re.test(uri))
{
uri = "http://" + uri;
}
model.testLogin = testLogin;
model.testPass = testPass;
model.testURL = testURL;
/*
*** Alfresco test Dashlet
*
* @namespace Alfresco
* @class Alfresco.test
*
*/
(function()
{
/**
* YUI Library aliases
*/
var Dom = YAHOO.util.Dom,
Event = YAHOO.util.Event;
/**
* Alfresco Slingshot aliases
*/
var $html = Alfresco.util.encodeHTML;
Alfresco.test = function(htmlId)
{
this.name = "Alfresco.test";
this.id = htmlId;
this.configDialog = null;
/* Register this component */
Alfresco.util.ComponentManager.register(this);
/* Load YUI Components */
Alfresco.util.YUILoaderHelper.require([], this.onComponentsLoaded, this);
return this;
};
Alfresco.test.prototype =
{
/**
* Object container for initialization options
*
* @property options
* @type object
*/
options:
{
componentId: "",
testLogin: "",
testPass: "",
testURL: ""
},
/**
* Configuration dialog instance
*
* @property configDialog
* @type object
*/
configDialog: null,
/**
* Set multiple initialization options at once.
*
* @method setOptions
* @param obj {object} Object literal specifying a set of options
*/
setOptions: function test_setOptions(obj)
{
this.options = YAHOO.lang.merge(this.options, obj);
return this;
},
/**
* Fired by YUILoaderHelper when required component script files have
* been loaded into the browser.
*
* @method onComponentsLoaded
*/
onComponentsLoaded: function test_onComponentsLoaded()
{
Event.onContentReady(this.id, this.onReady, this, true);
},
/**
* Fired by YUI when parent element is available for scripting.
* Initialises components, including YUI widgets.
*
* @method onReady
*/
onReady: function test_onReady()
{
var configtestLink = Dom.get(this.id + "-configtest-link");
Event.addListener(configtestLink, "click", this.onConfigtestClick, this, true);
},
/**
* Event listener for configuration link click.
*
* @method onConfigtestClick
*/
onConfigtestClick: function test_onConfigtestClick(event)
{
var actionUrl = Alfresco.constants.URL_SERVICECONTEXT + "modules/test/config/" + encodeURIComponent(this.options.componentId);
if (!this.configDialog)
{
this.configDialog = new Alfresco.module.SimpleDialog(this.id + "-configDialog").setOptions(
{
width: "50em",
templateUrl: Alfresco.constants.URL_SERVICECONTEXT + "modules/test/config",
actionUrl: actionUrl,
onSuccess:
{
fn: function test_onConfigtest_callback(response)
{
// MSIE6 doesn't redraw the IFRAME correctly, so tell it to refresh the page
if (YAHOO.env.ua.ie === 6)
{
window.location.reload(true);
}
else
{
var div = Dom.get(this.id + "-iframeWrapper");
div.innerHTML = response.serverResponse.responseText;
var iframe = Dom.getFirstChildBy(div, function(node)
{
return (node.tagName.toUpperCase() == "IFRAME");
});
if (iframe)
{
if (iframe.attributes["testLogin"])
{
var testLogin = iframe.attributes["testLogin"].value;
}
if (iframe.attributes["testPass"])
{
var testPass = iframe.attributes["testPass"].value;
}
if (iframe.attributes["testURL"])
{
var testPass = iframe.attributes["testURL"].value;
}
}
}
},
scope: this
},
doSetupFormsValidation:
{
fn: function test_doSetupForm_callback(form)
{
/* Get the link title */
var elem = Dom.get(this.configDialog.id + "-testLogin");
if (elem)
{
elem.value = this.options.testLogin;
}
/* Get the link title */
var elem = Dom.get(this.configDialog.id + "-testPass");
if (elem)
{
elem.value = this.options.testPass;
}
var elem = Dom.get(this.configDialog.id + "-testURL");
if (elem)
{
elem.value = this.options.testPass;
}
},
scope: this
}
});
}
else
{
this.configDialog.setOptions(
{
actionUrl: actionUrl
});
}
this.configDialog.show();
Event.stopEvent(event);
}
};
})();
(function(){var f=YAHOO.util.Dom,b=YAHOO.util.Event;var a=Alfresco.util.encodeHTML;Alfresco.test=function(h){this.name="Alfresco.test";this.id=h;this.configDialog=null;Alfresco.util.ComponentManager.register(this);Alfresco.util.YUILoaderHelper.require([],this.onComponentsLoaded,this);return this};Alfresco.test.prototype={options:{componentId:"",testLogin:"",testPass:"",testURL:""},configDialog:null,setOptions:function d(h){this.options=YAHOO.lang.merge(this.options,h);return this},onComponentsLoaded:function e(){b.onContentReady(this.id,this.onReady,this,true)},onReady:function g(){var h=f.get(this.id+"-configtest-link");b.addListener(h,"click",this.onConfigtestClick,this,true)},onConfigtestClick:function c(j){var i=Alfresco.constants.URL_SERVICECONTEXT+"modules/test/config/"+encodeURIComponent(this.options.componentId);if(!this.configDialog){this.configDialog=new Alfresco.module.SimpleDialog(this.id+"-configDialog").setOptions({width:"50em",templateUrl:Alfresco.constants.URL_SERVICECONTEXT+"modules/test/config",actionUrl:i,onSuccess:{fn:function k(m){if(YAHOO.env.ua.ie===6){window.location.reload(true)}else{var q=f.get(this.id+"-iframeWrapper");q.innerHTML=m.serverResponse.responseText;var n=f.getFirstChildBy(q,function(r){return(r.tagName.toUpperCase()=="IFRAME")});if(n){if(n.attributes.testLogin){var p=n.attributes.testLogin.value;}if(n.attributes.testPass){var l=n.attributes.testPass.value;}}}},scope:this},doSetupFormsValidation:{fn:function h(m){var l=f.get(this.configDialog.id+"-testLogin");if(l){l.value=this.options.testLogin}l=f.get(this.configDialog.id+"-testPass");if(l){l.value=this.options.testPass}l=f.get(this.configDialog.id+"-testURL");if(l){l.value=this.options.testURL}},scope:this}})}else{this.configDialog.setOptions({actionUrl:i})}this.configDialog.show();b.stopEvent(j)}}})();
06-08-2009 11:14 AM
m.getAttribute is not a function
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.