I found the answer in share.
to consume a webscript:
in the page definition (under /site-data/pages)
<page>
<id>mypage</id>
<template-instance>mypage</template-instance>
<authentication>user</authentication>
<components>
<component>
<region-id>form</region-id>
<uri>/com/component/form-component</uri>
</component>
</components>
</page>
under template-instances
<?xml version='1.0' encoding='UTF-8'?>
<template-instance>
<template-type>mypage</template-type>
<components>
<component>
<region-id>form</region-id>
<uri>/com/component/form-component</uri>
</component>
</components>
</template-instance>
under site-webscripts/com/component/
I can create my component
form-component.get.desc.xml
form-component.get.js
for desc.xml, see other example in the code
form-component.get.js will have something like:
var nodeRef = page.url.args.nodeRef,
metadata = [],
connector = remote.connect("alfresco"),
result = connector.get("/customwebscript/" + nodeRef);
if (result.status == 200) {
metadata = JSON.parse(result);
}
model.metadata = metadata;
in the template
form-component.get.html.ftl
use response from webscript with freemarkers:
${metadata.value1}