Skip to content

Instantly share code, notes, and snippets.

View aborroy's full-sized avatar
💭
Hyland Developer Evangelist

Angel Borroy aborroy

💭
Hyland Developer Evangelist
View GitHub Profile
@aborroy
aborroy / encode-base64.js
Created March 7, 2024 15:38
Encode to Base64 the content of an Alfresco node using Repository JavaScript
var ctxt = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
var contentService = ctxt.getBean('contentService', Packages.org.alfresco.service.cmr.repository.ContentService);
var inputStream = contentService.getReader(
new org.alfresco.service.cmr.repository.NodeRef(document.nodeRef),
org.alfresco.service.namespace.QName.createQName(org.alfresco.service.namespace.NamespaceService.CONTENT_MODEL_1_0_URI, "content")).getContentInputStream();
var base64Content = java.util.Base64.getEncoder().encodeToString(org.apache.commons.io.IOUtils.toByteArray(inputStream));
logger.log(base64Content);
@aborroy
aborroy / CMIS Browser.postman_collection.json
Created June 3, 2019 10:19
Sample Postman Collection for Alfresco CMIS Browser Binding
{
"info": {
"_postman_id": "1a503b3a-0f92-4c6b-bc32-51cbee05616a",
"name": "CMIS Browser",
"description": "CMIS Broser sample catalog.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Get Repositories Information",