04-02-2012 02:51 PM
<?xml version='1.0' encoding='UTF-8'?>
<template-instance>
<template-type>org/alfresco/document-details</template-type>
<properties>
<pageFamily>documentlibrary</pageFamily>
<container>documentLibrary</container>
</properties>
<components>
<!– Title –>
<component>
<region-id>title</region-id>
<sub-components>
<sub-component id="default">
…
…
…
<!– Custom Component –>
<component>
<region-id>doclib-custom</region-id>
<url>/components/diffhook</url>
<!–<url>/components/documentlibrary/doclib-custom</url>–>
</component>
</components>
</template-instance>
<webscript>
<shortname>Document Diff Hook</shortname>
<description>document-diff hook for declarative.json</description>
<family>family_docdiff_hook</family>
<url>/components/diffhook</url>
</webscript>
alfresco/web-extension/site-webscripts/ext/documentdiff/components/diffhook.get.html.ftl<div>${diffhook.msg}</div>
the .msg try to hook at the repo-extension project that is simply the Simple Declarative Web Script Project from the Java backed Wiki page…
var connector = remote.connect("alfresco/service");
var data = connector.get("/documentdiff/declarative.json");
// create json object from data
var result = eval('(' + data + ')');
model.diffhook = result["declarative"];
<module>
<id>Blog Module (Add Region)</id>
<customizations>
<customization>
<targetPackageRoot>org.alfresco</targetPackageRoot>
<sourcePackageRoot>blog.demo.customization</sourcePackageRoot>
</customization>
</customizations>
</module>
alfresco/templates/blog/demo/customization/document-details.ftl
<@region id="additional-content" target="node-header" action="after" scope="global" />
alfresco/web-extension/site-data/components/global.additional-content.xml
<component>
<region-id>additional-content</region-id>
<source-id>global</source-id>
<scope>global</scope>
<uri>/blog/demo/new-content</uri>
</component>
04-03-2012 04:24 AM
04-03-2012 07:09 AM
It is very hard to help you without knowing what the actual error is, you mind sending over the actual error you get in as much detail as possible?
var connector = remote.connect("alfresco");
var data = connector.get("/documentdiff/declarative.json");
// create json object from data
var result = eval('(' + data + ')');
model.diffhook = result["declarative"];
alfresco/web-extension/site-webscripts/ext/documentdiff/components/diffhook.get.desc.xml
<webscript>
<shortname>Document Diff Hook</shortname>
<description>document-diff hook for declarative.json</description>
<family>family_docdiff_hook</family>
<url>/components/diffhook</url>
</webscript>
alfresco/web-extension/site-webscripts/ext/documentdiff/components/diffhook.get.html.ftl<div>${diffhook.msg}</div>
to clarify I report the declarative.get.json.ftl from the Simple Declarative Web Script that show how it handle the json response..{ "msg" : "Hello ${person.properties.userName}: ${speak}"}
However if I should guess what the error might be my vote would be that the following line:yep this was a try that I've forgotten in the code when I posted it, had already been corrected, thanks anyway
var connector = remote.connect("alfresco/service");
should be:
var connector = remote.connect("alfresco");
Cheers, Erik
PS. If you haven't seen it there is a thread that contains Share documentation at:yes I've also seen this, I already knew many of the links thanks
https://forums.alfresco.com/en/viewtopic.php?f=48&t=43694
Rather than referring to "the poor documentation and the wiki are of little help" please consider either come with a distinct list of requirements with what you miss in the documentation OR create and contribute it yourself after you have learned it. We are doing the best we can.I apologize if I was not very fair, mine was just an opinion but imho it's very difficult to understand the Alfresco mechanism and "conventions over configuration", above all the AMP packaging practice (that none of the developers have used in the examples on his blog, this would help, for example), the maven alfresco archetype is in an ambiguous state (the wiki is not accurate pointing on outdated resources and bugged pom.xml and the documentation in this way it's poor)..
04-03-2012 08:54 AM
04-27-2012 04:31 AM
PS. I will make sure your thoughts are picked up by our community officer and documentation team.thanks a lot
model.diffhook = result;
and not model.diffhook = result["declarative"];
because isn't a list but only one json object.
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.