05-08-2014 11:28 PM
                        webscript: {
                            name: "aiias/symbolic-link/node/{nodeRef}",
                            stem: Alfresco.constants.PROXY_URI,
                            method: Alfresco.util.Ajax.POST,
                            params: {
                               nodeRef: nodeRef.uri
                            },
                        },
05-09-2014 12:28 AM
05-13-2014 04:54 AM
<?xml version="1.0" encoding="UTF-8" ?>
<webscript>
    <shortname>Symbolic Link</shortname>
    <description>Create a link to a document in another folder.</description>
    <url>/aiias/symbolic-link/site/{site}/{container}/{path}</url>
    <url>/aiias/symbolic-link/site/{site}/{container}</url>
    <url>/aiias/symbolic-link/node/{store_type}/{store_id}/{id}/{path}</url>
    <url>/aiias/symbolic-link/node/{store_type}/{store_id}/{id}</url>
    <url>/aiias/symbolic-link/node/{store_type}/{store_id}</url>
    <format default="json">argument</format>
    <authentication>user</authentication>
    <transaction>required</transaction>
    <lifecycle>internal</lifecycle>
</webscript>
<import resource="classpath:/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/action/action.lib.js">
/*
 * linkTo.post.js – Controller script for the linkTo action
 * Copyright (C) 2013  Eric MSP Veith <eric.veith@wb-fernstudium.de>
 */
/**
 * Entrypoint required by action.lib.js
 *
 * @method runAction
 * @param p_params {object} Object literal containing files array
 * @return {object|null} object representation of action results
 */
function runAction(p_params)
{
    var destNode = p_params.destNode;
    var files = p_params.files;
    var results = [];
    // Must have array of files
    if (!files || !files.length || files.length == 0) {
        status.setCode(status.STATUS_BAD_REQUEST, "No files given.");
        return;
    }
    
    files.forEach(function(ref, i) {
        var fileNode = search.findNode(ref);
        var result = {
            nodeRef: ref,
            action: "linkTo",
            success: false
        };
        if (null == fileNode) {
            results.push(result);
            return;
        }
        var symlink = destNode.createNode(fileNode.name, "app:filelink", {
              "cm:destination": fileNode
           });
        if (symlink) {
            symlink.save();
            
            result.id = symlink.name;
            result.nodeRef = symlink.nodeRef.toString();
            result.success = true;
        }
        results.push(result);
    });
    return results;
}
// Bootstrap the action script:
main();
05-13-2014 10:45 AM
classpath:alfresco/site-webscripts/****
classpath:alfresco/web-extension/site-webscripts/***
classpath:web-extension/****
classpath:alfresco/webscripts/***
classpath:webscripts/***
                                                                                                                                                                                                                                                                                                                                                       
repository path:  company home/data dictionary/extensionwebscripts
repository path:  company home/data dictionary/webscripts
classpath:alfresco/extension/templates/webscripts/***
classpath:alfresco/templates/webscripts/****
classpath:alfresco/webscripts/***
classpath:webscripts/***
					
				
			
			
				
			
			
			
			
			
			
			
		05-13-2014 10:46 AM
classpath:alfresco/site-webscripts/****
classpath:alfresco/web-extension/site-webscripts/***
classpath:web-extension/****
classpath:alfresco/webscripts/***
classpath:webscripts/***
                                                                                                                                                                                                                                                                                                                                                       
repository path:  company home/data dictionary/extensionwebscripts
repository path:  company home/data dictionary/webscripts
classpath:alfresco/extension/templates/webscripts/***
classpath:alfresco/templates/webscripts/****
classpath:alfresco/webscripts/***
classpath:webscripts/***
					
				
			
			
				
			
			
			
			
			
			
			
		05-13-2014 10:29 PM
2014-05-14 10:24:20,811  ERROR [extensions.webscripts.AbstractRuntime] [http-bio-8081-exec-14] Exception from executeScript - redirecting to status template error: 04140001 Failed to execute script 'classpath*:alfresco/site-webscripts/edu/aiias/symbolic-link/symbolic-link.post.json.js': null
 org.springframework.extensions.webscripts.WebScriptException: 04140001 Failed to execute script 'classpath*:alfresco/site-webscripts/edu/aiias/symbolic-link/symbolic-link.post.json.js': null
        at org.springframework.extensions.webscripts.processor.JSScriptProcessor.executeScript(JSScriptProcessor.java:200)
        at org.springframework.extensions.webscripts.AbstractWebScript.executeScript(AbstractWebScript.java:1305)
        at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:86)
        at org.springframework.extensions.webscripts.PresentationContainer.executeScript(PresentationContainer.java:70)
        at org.springframework.extensions.webscripts.LocalWebScriptRuntimeContainer.executeScript(LocalWebScriptRuntimeContainer.java:236)
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.