12-25-2009 10:51 PM
<html>
<head>
</head>
<body>
Test dashlet
<div id="treeDiv1">gee</div>
<script type="text/javascript">//<![CDATA[
var tempobject = [ { type: "text", label: "node1" } ];
//instantiate the TreeView control:
var tree = new YAHOO.widget.TreeView("treeDiv1", tempobject);
//render it
tree.draw();
//]]></script>
</body>
</html>
- Registered it01-20-2010 06:13 PM
{
"dokumenti" : [
<#list companyhome.childByNamePath["Sites/"+args.company+"/documentLibrary"].children as child>
{
"name" : "${jsonUtils.encodeJSONString(child.properties.name)}" ,
"nodeRef" : <#if child.isContainer>"FOLDER"<#else>"${jsonUtils.encodeJSONString(child.nodeRef)}"</#if>,
"clientUser" : "${child.properties["custom:prop1]}",
"clientPay" : ${child.properties["custom:prop2"]}"
}<#if child_has_next>, </#if>
</#list>
]
}
01-20-2010 06:17 PM
01-20-2010 06:50 PM
<webscript>
<shortname>Document Property</shortname>
<description>Get doc properties for Share Upload dashlet</description>
<default>json</default>
<url>/sample/docprop.json</url>
<authentication>user</authentication>
<transaction>required</transaction>
</webscript>
01-20-2010 09:01 PM
01-21-2010 03:39 AM
Caused by: freemarker.core.InvalidReferenceException: Expression companyhome.childByNamePath["Sites/"+args.tvrtka+"/documentLibrary"] is undefined on line 3, column 8 in org/alfresco/sample/docprop.get.json.ftl.
Can you please point me to an example of how to past GET or POST argument from /share server-side .js or client .js to /alfresco webscript? I tried this in various ways, didn't work.
01-21-2010 06:46 AM
var connector = remote.connect("alfresco");
result = connector.get("/slingshot/doclib/container/" + siteId + "/" + containerId + "?type=" + toRepoType(appType));
if (result.status == 200)
{
var data = eval('(' + result + ')');
containerType = data.container.type;
}
01-21-2010 07:40 AM
var connector = remote.connect("alfresco");
result = connector.get("/sample/docprop.json?tvrtka=" + model.site );
if (result.status == 200)
{
var data = eval('(' + result + ')');
model.docprop = data["dokumenti"];
}
http://localhost:8080/alfresco/service/sample/docprop.json?tvrtka=testtvrtka
I get a valid json, when I call it through the remote.connect, it triggers the error:Caused by: freemarker.core.InvalidReferenceException: Expression companyhome.childByNamePath["Sites/"+args.tvrtka+"/documentLibrary"] is undefined on line 3, column 8 in org/alfresco/sample/docprop.get.json.ftl.
It's like a wall, can't get through it.
01-29-2010 09:18 AM
02-02-2010 06:52 PM
02-03-2010 04:21 AM
var tempobject = [ { type: "text", label: "node1" } ];Sorry, hadn't spotted this post until steve r replied… I use that pattern in the DocLib webscripts
x = json.stringify (tempobject);
model.x = x;
In the template:
jsonObject= JSON.parse(${x});
model.x = jsonUtils.toJSONString(tempobject);
YUI is effectively doing the JSON.parse() part in the DataSource code, so that should work ok as you've got it.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.