Skip to content

Instantly share code, notes, and snippets.

View douglascrp's full-sized avatar

Douglas C. R. Paes douglascrp

View GitHub Profile
@douglascrp
douglascrp / Adicionar usuário aos sites existentes
Last active February 27, 2018 15:22
Ajustar permissão de usuário
//var usuario = people.getPerson("gestaoonline");
//logger.warn(usuario.properties["cm:userName"]);
var sites = siteService.getSites("", "", -1);
logger.warn(sites.length);
for (var i = 0; i < sites.length; i++) {
var site = sites[i];
@douglascrp
douglascrp / triggerLdapSync.js
Last active August 30, 2017 12:00 — forked from AFaust/printAlfrescoLog.js
How to trigger Alfresco LDAP sync with JavaScript
var ctxt, scheduler;
// get Spring context and Quartz scheduler
ctxt = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
scheduler = ctxt.getBean('schedulerFactory', Packages.org.quartz.Scheduler);
// fire (unless explicitly defined in Job detail Spring bean, scheduler group is always DEFAULT)
scheduler.triggerJob('ldapPeopleJobDetail', 'DEFAULT');
#!/bin/bash
#
# Criação de pasta com CURL
#
# Usage: cria_pasta_nativa.sh
#
# ./cria_pasta_nativa.sh novaPasta
#
ALFRESCO_SERVER=http://servidor:8080/alfresco
#!/bin/bash
#
# Criação de pasta com CURL
#
# Usage: cria_pasta_customizada.sh
#
# ./cria_pasta_customizada.sh novaPasta
#
ALFRESCO_SERVER=http://servidor:8080/alfresco
#!/bin/bash
#
# Atualização de pasta com CURL
#
# Usage: atualiza-pasta.sh
#
# ./atualiza-pasta.sh
#
ALFRESCO_SERVER=http://servidor:8080/alfresco
@douglascrp
douglascrp / enable_disable_folder_rules.js
Last active October 1, 2017 01:22
How to enable/disable Alfresco folder rules using JavaScript
var context = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
var ruleService = context.getBean('RuleService', Packages.org.alfresco.service.cmr.rule.RuleService);
logger.warn("Before disabling: " + ruleService.isEnabled());
logger.warn("Disabling rules");
ruleService.disableRules();
logger.warn("After disabling: " + ruleService.isEnabled());
var pageSize = 100; // no more than 1000!!!
var currentPage = 0;
var currentPageSize = -1;
//var q = 'TYPE:"cm:folder" AND cm:created:[MIN TO MAX]';
var q = 'TYPE:"cm:content" AND cm:created:[MIN TO MAX]';
var sort1 = { column: 'cm:created', ascending: true };
var paging = { maxItems: pageSize, skipCount: 0 };
var def = { query: q, store: 'archive://SpacesStore', language: 'fts-alfresco', sort: [sort1], page: paging };
du -h -d 1 | sort -rh | head -5
@douglascrp
douglascrp / Alfresco useful workflow console commands.txt
Last active August 16, 2018 20:04
Useful workflow console commands
show definitions all
undeploy definition name activiti$workflow-name
deploy activiti alfresco/module/module-id/workflow/workflow.bpmn
update task activiti$241225 namespace:property=2018-08-10T12:00:00-03:00
delete all workflows imeanit
@douglascrp
douglascrp / 1_README.md
Created January 9, 2017 16:04 — forked from Daniel15/1_README.md
Complete Google Drive File Picker example

Google Drive File Picker Example

This is an example of how to use the Google Drive file picker and Google Drive API to retrieve files from Google Drive using pure JavaScript. At the time of writing (14th July 2013), Google have good examples for using these two APIs separately, but no documentation on using them together.

Note that this is just sample code, designed to be concise to demonstrate the API. In a production environment, you should include more error handling.

See a demo at http://stuff.dan.cx/js/filepicker/google/