Skip to content

Instantly share code, notes, and snippets.

View korutx's full-sized avatar
💻
PMF

Michel David korutx

💻
PMF
View GitHub Profile
@korutx
korutx / alfresco-test-mail.js
Created February 26, 2018 17:27
Test Alfresco Mail
var mail = actions.create('mail');
mail.parameters.from = "[email protected]";
mail.parameters.to = '[email protected]';
mail.parameters.template = root.childByNamePath("Company Home/Data Dictionary/Email Templates/notify_user_email.ftl");
mail.parameters.text = "some text, in case template is not found";
mail.execute(companyhome);
@korutx
korutx / alfresco-global.properties
Created February 26, 2018 14:56
Alfresco disable outbound email notification
# add this prop to alfresco-global-properties
dev.email.not.sent=true
delete from alf_node_properties where node_id='178588';
delete from alf_node_aspects where id='178588';
delete from alf_child_assoc where child_node_id='178588';
delete from alf_node where id='178588';
<?xml version='1.0' encoding='UTF-8'?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:hz="http://www.hazelcast.com/schema/config"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.hazelcast.com/schema/config
http://www.hazelcast.com/schema/config/hazelcast-spring.xsd">
<bean id="mycustom.resources" class="org.springframework.extensions.surf.util.ResourceBundleBootstrapComponent">
var client = mqtt.connect('ws://host:port', {
username: 'username',
clientId: 'client-id',
password: 'password'
});
client.subscribe('endpoint');
client.on('message', function (topic, payload) {
var evt = topic.toString(), args = payload.toString();
var node = search.findNode('<nodeRef>');
var assocname = '<thumbnailname>';
var nodeThumbnail = node.childAssocs['rn:rendition'].filter(function(assoc){
return assoc.name == assocname;
})[0];
if(nodeThumbnail){
logger.log(nodeThumbnail.nodeRef);
}
var assocname = '<thumbnailname>';
var node = document.childAssocs['rn:rendition'].filter(function(assoc){
return assoc.name == assocname;
})[0];
if(node){
logger.log(node.remove());
}