SlideShare a Scribd company logo
1 of 22
Porting a Custom
Transformer to the New
Transform Service
Alan Davis
Learn. Connect. Collaborate.
ACS 6.0 Transformers
ACS repo
Command
Transformer
Transformer
Proxy
Engine
Transformer
Command
101010
Learn. Connect. Collaborate.
ACS 6.0 Transformers
ACS repo
Command
Transformer
Transformer
Proxy
Engine
Transformer
Command
101010
Learn. Connect. Collaborate.
ACS 6.0 Transformers
ACS repo
Command
Transformer
Transformer
Proxy
Engine
Transformer
Command
101010
Learn. Connect. Collaborate.
ACS 6.1 Transformers
ACS repo
Command
Transformer
Transformer
Proxy
Rendition Service 2
(asynchronous)
Engine
Transformer
Command
Transform
Service
Router
101010
Learn. Connect. Collaborate.
ACS 6.1 Transformers
ACS repo
Command
Transformer
Transformer
Proxy
Rendition Service 2
(asynchronous)
Engine
Transformer
Command
Transform
Service
Router
101010
Learn. Connect. Collaborate.
The Proxy
AbstractContentTransformer2
transformInternal(…)
MyTransformer
transformInternal(…)
AbstractContentTransformer2
transformInternal(…)
MyTransformer
transformLocal(…)
transformRemote(…)
AbstractRemoteContentTransformer
remoteTransformerClient
transformInternal(…)
transformLocal(…)
transformRemote((…)
@Override
protected void transformRemote(
RemoteTransformerClient remoteTransformerClient,
ContentReader reader, ContentWriter writer,
TransformationOptions options,
String sourceMimetype, String targetMimetype,
String sourceExtension, String targetExtension,
String targetEncoding) throws Exception
{
long timeout = options.getTimeoutMs();
String language = getLanguage(options);
String dialect = getDialect(options);
remoteTransformerClient.request(reader, writer,
sourceMimetype, sourceExtension,
targetExtension, timeout, logger,
”language", language,
”dialect", dialect);
}
Learn. Connect. Collaborate.
The Proxy
AbstractContentTransformer2
transformInternal(…)
MyTransformer
transformInternal(…)
AbstractContentTransformer2
transformInternal(…)
MyTransformer
transformLocal(…)
transformRemote(…)
AbstractRemoteContentTransformer
remoteTransformerClient
transformInternal(…)
transformLocal(…)
transformRemote((…)
@Override
protected void transformRemote(
RemoteTransformerClient remoteTransformerClient,
ContentReader reader, ContentWriter writer,
TransformationOptions options,
String sourceMimetype, String targetMimetype,
String sourceExtension, String targetExtension,
String targetEncoding) throws Exception
{
long timeout = options.getTimeoutMs();
String language = getLanguage(options);
String dialect = getDialect(options);
remoteTransformerClient.request(reader, writer,
sourceMimetype, sourceExtension,
targetExtension, timeout, logger,
”language", language,
”dialect", dialect);
}
Learn. Connect. Collaborate.
Docker Image
The Transform Engine
Spring Boot App
Command
XxxController
transform(…)
processTransform(…)
alfresco-transformer-base
AbstractTransformerController
public void processTransform(
File sourceFile, File targetFile,
Map<String, String> transformOptions,
Long timeout)
{
// Code to build command line options
commandExecutor.run(options, sourceFile,
targetFile, timeout);
}
@PostMapping(value = "/transform", consumes =
MediaType.MULTIPART_FORM_DATA_VALUE)
public ResponseEntity<Resource> transform(
HttpServletRequest request,
@RequestParam("file")
MultipartFile sourceMultipartFile,
@RequestParam("targetExtension")
String targetExtension,
@RequestParam("language") String language,
@RequestParam("dialect") String dialect,
@RequestParam(value = "timeout",
required = false) Long timeout)
{
// Code to obtain source file
// Code to build command line options
commandExecutor.run(options, sourceFile,
targetFile, timeout);
// Code to return target file as an attachment
}
Learn. Connect. Collaborate.
Docker Image
The Transform Engine
Spring Boot App
Command
XxxController
transform(…)
processTransform(…)
alfresco-transformer-base
AbstractTransformerController
public void processTransform(
File sourceFile, File targetFile,
Map<String, String> transformOptions,
Long timeout)
{
// Code to build command line options
commandExecutor.run(options, sourceFile,
targetFile, timeout);
}
@PostMapping(value = "/transform", consumes =
MediaType.MULTIPART_FORM_DATA_VALUE)
public ResponseEntity<Resource> transform(
HttpServletRequest request,
@RequestParam("file")
MultipartFile sourceMultipartFile,
@RequestParam("targetExtension")
String targetExtension,
@RequestParam("language") String language,
@RequestParam("dialect") String dialect,
@RequestParam(value = "timeout",
required = false) Long timeout)
{
// Code to obtain source file
// Code to build command line options
commandExecutor.run(options, sourceFile,
targetFile, timeout);
// Code to return target file as an attachment
}
Learn. Connect. Collaborate.
Configuration
ACS repo
Transform
Service
transform-service-
config.json
Transform Service
Registry
??
…
{
"name": "pdfRenderer",
"transformOptions": [
{"value": {"name": "page"}},
{"value": {"name": "width"}},
{"value": {"name": "height"}},
{"value": {"name": "allowPdfEnlargement"}},
{"value": {"name": "maintainPdfAspectRatio"}}
],
"supportedSourceAndTargetList": [
{"sourceExt": "pdf", "targetExt": "png" }
]
},
…
Rendition Service 2
Proxy
Learn. Connect. Collaborate.
Configuration
ACS repo
Transform
Service
transform-service-
config.json
Transform Service
Registry
??
…
{
"name": "pdfRenderer",
"transformOptions": [
{"value": {"name": "page"}},
{"value": {"name": "width"}},
{"value": {"name": "height"}},
{"value": {"name": "allowPdfEnlargement"}},
{"value": {"name": "maintainPdfAspectRatio"}}
],
"supportedSourceAndTargetList": [
{"sourceExt": "pdf", "targetExt": "png" }
]
},
…
Rendition Service 2
Proxy
Learn. Connect. Collaborate.
Configuration
ACS repo
Transform
Service
transform.service.enabled=true
local.transform.service.enabled=true
alfresco-pdf-renderer.url=http://localhost:8090/
img.url=http://localhost:8091/
jodconverter.url=http://localhost:8092/
tika.url=http://localhost:8093/
transform-service-
config.json
alfresco-
global.properties
Transform Service
Registry
??
…
{
"name": "pdfRenderer",
"transformOptions": [
{"value": {"name": "page"}},
{"value": {"name": "width"}},
{"value": {"name": "height"}},
{"value": {"name": "allowPdfEnlargement"}},
{"value": {"name": "maintainPdfAspectRatio"}}
],
"supportedSourceAndTargetList": [
{"sourceExt": "pdf", "targetExt": "png" }
]
},
…
Rendition Service 2
Proxy
Learn. Connect. Collaborate.
Configuration
ACS repo
Transform
Service
transform.service.enabled=true
local.transform.service.enabled=true
alfresco-pdf-renderer.url=http://localhost:8090/
img.url=http://localhost:8091/
jodconverter.url=http://localhost:8092/
tika.url=http://localhost:8093/
transform-service-
config.json
alfresco-
global.properties
Transform Service
Registry
??
…
{
"name": "pdfRenderer",
"transformOptions": [
{"value": {"name": "page"}},
{"value": {"name": "width"}},
{"value": {"name": "height"}},
{"value": {"name": "allowPdfEnlargement"}},
{"value": {"name": "maintainPdfAspectRatio"}}
],
"supportedSourceAndTargetList": [
{"sourceExt": "pdf", "targetExt": "png" }
]
},
…
Rendition Service 2
Proxy
Learn. Connect. Collaborate.
When is the Transform Service called?
ACS repo
Transform
ServiceTransform Service
Registry
…
{
"name": "pdfRenderer",
"transformOptions": [
{"value": {"name": "page"}},
{"value": {"name": "width"}},
{"value": {"name": "height"}},
{"value": {"name": "allowPdfEnlargement"}},
{"value": {"name": "maintainPdfAspectRatio"}}
],
"supportedSourceAndTargetList": [
{"sourceExt": "pdf", "targetExt": "png" }
]
},
…
Rendition Service 2
Proxy
• Rendition Service 2 has been called:
– V1 REST API
– on content update
– original Rendition Service
• RenditionDefinition2 exist
• Transform Service supports the transform
Transformer
Learn. Connect. Collaborate.
When is the Transform Service called?
ACS repo
Transform
ServiceTransform Service
Registry
…
{
"name": "pdfRenderer",
"transformOptions": [
{"value": {"name": "page"}},
{"value": {"name": "width"}},
{"value": {"name": "height"}},
{"value": {"name": "allowPdfEnlargement"}},
{"value": {"name": "maintainPdfAspectRatio"}}
],
"supportedSourceAndTargetList": [
{"sourceExt": "pdf", "targetExt": "png" }
]
},
…
Rendition Service 2
Proxy
• Rendition Service 2 has been called:
– V1 REST API
– on content update
– original Rendition Service
• RenditionDefinition2 exist
• Transform Service supports the transform
Transformer
Learn. Connect. Collaborate.
Simplification of Transform Options
Transformation
Options
<bean id="renditionDefinition2DocLib" class="org.alfresco.repo.rendition2.RenditionDefinition2I
<constructor-arg name="renditionName" value="doclib"/>
<constructor-arg name="targetMimetype" value="image/png"/>
<constructor-arg name="transformOptions">
<map>
<entry key="resizeWidth" value="100"/>
<entry key="resizeHeight" value="100"/>
<entry key="allowEnlargement" value="false" />
<entry key="maintainAspectRatio" value="true"/>
<entry key="thumbnail" value="true"/>
<entry key="timeout" value="${system.thumbnail.definition.default.timeoutMs}" />
</map>
</constructor-arg>
<constructor-arg name="registry" ref="renditionDefinitionRegistry2"/>
</bean>
Transform Options
key value
key value
key value
Learn. Connect. Collaborate.
Simplification of Transform Options
Transformation
Options
<bean id="renditionDefinition2DocLib" class="org.alfresco.repo.rendition2.RenditionDefinition2I
<constructor-arg name="renditionName" value="doclib"/>
<constructor-arg name="targetMimetype" value="image/png"/>
<constructor-arg name="transformOptions">
<map>
<entry key="resizeWidth" value="100"/>
<entry key="resizeHeight" value="100"/>
<entry key="allowEnlargement" value="false" />
<entry key="maintainAspectRatio" value="true"/>
<entry key="thumbnail" value="true"/>
<entry key="timeout" value="${system.thumbnail.definition.default.timeoutMs}" />
</map>
</constructor-arg>
<constructor-arg name="registry" ref="renditionDefinitionRegistry2"/>
</bean>
Transform Options
key value
key value
key value
Learn. Connect. Collaborate.
Future No promises - It might not happen
• Public access to
– alfresco-transformer-base
– sample transformers
• Local Router
– for use by the community
– help develop new Engines
• Remaining transformers
• New transforms metadata extraction
document analysis
AI
translation
image to text
text to voice
Learn. Connect. Collaborate.
Future No promises - It might not happen
• Public access to
– alfresco-transformer-base
– sample transformers
• Local Router
– for use by the community
– help develop new Engines
• Remaining transformers
• New transforms metadata extraction
document analysis
AI
translation
image to text
text to voice
Learn. Connect. Collaborate.
Future No promises - It might not happen
• Public access to
– alfresco-transformer-base
– sample transformers
• Local Router
– for use by the community
– help develop new Engines
• Remaining transformers
• New transforms metadata extraction
document analysis
AI
translation
image to text
text to voice
Porting a Custom
Transformer to the New
Transform Service
Thank you!

More Related Content

Similar to Alfresco 2019 DevCon lightning talk alan davis

ScalaDays Amsterdam - Don't block yourself
ScalaDays Amsterdam - Don't block yourselfScalaDays Amsterdam - Don't block yourself
ScalaDays Amsterdam - Don't block yourselfFlavio W. Brasil
 
Cassandra 2.1 boot camp, Overview
Cassandra 2.1 boot camp, OverviewCassandra 2.1 boot camp, Overview
Cassandra 2.1 boot camp, OverviewJoshua McKenzie
 
Dev309 from asgard to zuul - netflix oss-final
Dev309  from asgard to zuul - netflix oss-finalDev309  from asgard to zuul - netflix oss-final
Dev309 from asgard to zuul - netflix oss-finalRuslan Meshenberg
 
Server-Side Push: Comet, Web Sockets come of age (OSCON 2013)
Server-Side Push: Comet, Web Sockets come of age (OSCON 2013)Server-Side Push: Comet, Web Sockets come of age (OSCON 2013)
Server-Side Push: Comet, Web Sockets come of age (OSCON 2013)Brian Sam-Bodden
 
Streamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache AmbariStreamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache AmbariAlejandro Fernandez
 
2014 Taverna tutorial REST services
2014 Taverna tutorial REST services2014 Taverna tutorial REST services
2014 Taverna tutorial REST servicesmyGrid team
 
Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...
Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...
Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...Twilio Inc
 
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...Amazon Web Services
 
How to perform debounce in react
How to perform debounce in reactHow to perform debounce in react
How to perform debounce in reactBOSC Tech Labs
 
Designing and Implementing a Real-time Data Lake with Dynamically Changing Sc...
Designing and Implementing a Real-time Data Lake with Dynamically Changing Sc...Designing and Implementing a Real-time Data Lake with Dynamically Changing Sc...
Designing and Implementing a Real-time Data Lake with Dynamically Changing Sc...Databricks
 
PostgreSQL High-Availability and Geographic Locality using consul
PostgreSQL High-Availability and Geographic Locality using consulPostgreSQL High-Availability and Geographic Locality using consul
PostgreSQL High-Availability and Geographic Locality using consulSean Chittenden
 
Server Side Swift with Swag
Server Side Swift with SwagServer Side Swift with Swag
Server Side Swift with SwagJens Ravens
 
Meet Up - Spark Stream Processing + Kafka
Meet Up - Spark Stream Processing + KafkaMeet Up - Spark Stream Processing + Kafka
Meet Up - Spark Stream Processing + KafkaKnoldus Inc.
 
Streamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache AmbariStreamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache AmbariJayush Luniya
 
Apache Con NA 2013 - Cassandra Internals
Apache Con NA 2013 - Cassandra InternalsApache Con NA 2013 - Cassandra Internals
Apache Con NA 2013 - Cassandra Internalsaaronmorton
 
Streaming Way to Webscale: How We Scale Bitly via Streaming
Streaming Way to Webscale: How We Scale Bitly via StreamingStreaming Way to Webscale: How We Scale Bitly via Streaming
Streaming Way to Webscale: How We Scale Bitly via StreamingAll Things Open
 
Integrating SAP the Java EE Way - JBoss One Day talk 2012
Integrating SAP the Java EE Way - JBoss One Day talk 2012Integrating SAP the Java EE Way - JBoss One Day talk 2012
Integrating SAP the Java EE Way - JBoss One Day talk 2012hwilming
 

Similar to Alfresco 2019 DevCon lightning talk alan davis (20)

ScalaDays Amsterdam - Don't block yourself
ScalaDays Amsterdam - Don't block yourselfScalaDays Amsterdam - Don't block yourself
ScalaDays Amsterdam - Don't block yourself
 
Cassandra 2.1 boot camp, Overview
Cassandra 2.1 boot camp, OverviewCassandra 2.1 boot camp, Overview
Cassandra 2.1 boot camp, Overview
 
Dev309 from asgard to zuul - netflix oss-final
Dev309  from asgard to zuul - netflix oss-finalDev309  from asgard to zuul - netflix oss-final
Dev309 from asgard to zuul - netflix oss-final
 
Server-Side Push: Comet, Web Sockets come of age (OSCON 2013)
Server-Side Push: Comet, Web Sockets come of age (OSCON 2013)Server-Side Push: Comet, Web Sockets come of age (OSCON 2013)
Server-Side Push: Comet, Web Sockets come of age (OSCON 2013)
 
Streamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache AmbariStreamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache Ambari
 
Streamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache AmbariStreamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache Ambari
 
2014 Taverna tutorial REST services
2014 Taverna tutorial REST services2014 Taverna tutorial REST services
2014 Taverna tutorial REST services
 
Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...
Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...
Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...
 
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...
(DEV309) From Asgard to Zuul: How Netflix’s Proven Open Source Tools Can Help...
 
How to perform debounce in react
How to perform debounce in reactHow to perform debounce in react
How to perform debounce in react
 
Designing and Implementing a Real-time Data Lake with Dynamically Changing Sc...
Designing and Implementing a Real-time Data Lake with Dynamically Changing Sc...Designing and Implementing a Real-time Data Lake with Dynamically Changing Sc...
Designing and Implementing a Real-time Data Lake with Dynamically Changing Sc...
 
PostgreSQL High-Availability and Geographic Locality using consul
PostgreSQL High-Availability and Geographic Locality using consulPostgreSQL High-Availability and Geographic Locality using consul
PostgreSQL High-Availability and Geographic Locality using consul
 
Server Side Swift with Swag
Server Side Swift with SwagServer Side Swift with Swag
Server Side Swift with Swag
 
Meet Up - Spark Stream Processing + Kafka
Meet Up - Spark Stream Processing + KafkaMeet Up - Spark Stream Processing + Kafka
Meet Up - Spark Stream Processing + Kafka
 
Streamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache AmbariStreamline Hadoop DevOps with Apache Ambari
Streamline Hadoop DevOps with Apache Ambari
 
Apache Con NA 2013 - Cassandra Internals
Apache Con NA 2013 - Cassandra InternalsApache Con NA 2013 - Cassandra Internals
Apache Con NA 2013 - Cassandra Internals
 
Time for Functions
Time for FunctionsTime for Functions
Time for Functions
 
Streaming Way to Webscale: How We Scale Bitly via Streaming
Streaming Way to Webscale: How We Scale Bitly via StreamingStreaming Way to Webscale: How We Scale Bitly via Streaming
Streaming Way to Webscale: How We Scale Bitly via Streaming
 
Scala modules
Scala modulesScala modules
Scala modules
 
Integrating SAP the Java EE Way - JBoss One Day talk 2012
Integrating SAP the Java EE Way - JBoss One Day talk 2012Integrating SAP the Java EE Way - JBoss One Day talk 2012
Integrating SAP the Java EE Way - JBoss One Day talk 2012
 

Recently uploaded

Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Erbil Polytechnic University
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm Systemirfanmechengr
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating SystemRashmi Bhat
 
National Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfNational Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfRajuKanojiya4
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgsaravananr517913
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
Risk Management in Engineering Construction Project
Risk Management in Engineering Construction ProjectRisk Management in Engineering Construction Project
Risk Management in Engineering Construction ProjectErbil Polytechnic University
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...Erbil Polytechnic University
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingBootNeck1
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solidnamansinghjarodiya
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the weldingMuhammadUzairLiaqat
 
BSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptxBSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptxNiranjanYadav41
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 

Recently uploaded (20)

Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm System
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating System
 
National Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfNational Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdf
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
Risk Management in Engineering Construction Project
Risk Management in Engineering Construction ProjectRisk Management in Engineering Construction Project
Risk Management in Engineering Construction Project
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event Scheduling
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solid
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the welding
 
BSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptxBSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptx
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 

Alfresco 2019 DevCon lightning talk alan davis

  • 1. Porting a Custom Transformer to the New Transform Service Alan Davis
  • 2. Learn. Connect. Collaborate. ACS 6.0 Transformers ACS repo Command Transformer Transformer Proxy Engine Transformer Command 101010
  • 3. Learn. Connect. Collaborate. ACS 6.0 Transformers ACS repo Command Transformer Transformer Proxy Engine Transformer Command 101010
  • 4. Learn. Connect. Collaborate. ACS 6.0 Transformers ACS repo Command Transformer Transformer Proxy Engine Transformer Command 101010
  • 5. Learn. Connect. Collaborate. ACS 6.1 Transformers ACS repo Command Transformer Transformer Proxy Rendition Service 2 (asynchronous) Engine Transformer Command Transform Service Router 101010
  • 6. Learn. Connect. Collaborate. ACS 6.1 Transformers ACS repo Command Transformer Transformer Proxy Rendition Service 2 (asynchronous) Engine Transformer Command Transform Service Router 101010
  • 7. Learn. Connect. Collaborate. The Proxy AbstractContentTransformer2 transformInternal(…) MyTransformer transformInternal(…) AbstractContentTransformer2 transformInternal(…) MyTransformer transformLocal(…) transformRemote(…) AbstractRemoteContentTransformer remoteTransformerClient transformInternal(…) transformLocal(…) transformRemote((…) @Override protected void transformRemote( RemoteTransformerClient remoteTransformerClient, ContentReader reader, ContentWriter writer, TransformationOptions options, String sourceMimetype, String targetMimetype, String sourceExtension, String targetExtension, String targetEncoding) throws Exception { long timeout = options.getTimeoutMs(); String language = getLanguage(options); String dialect = getDialect(options); remoteTransformerClient.request(reader, writer, sourceMimetype, sourceExtension, targetExtension, timeout, logger, ”language", language, ”dialect", dialect); }
  • 8. Learn. Connect. Collaborate. The Proxy AbstractContentTransformer2 transformInternal(…) MyTransformer transformInternal(…) AbstractContentTransformer2 transformInternal(…) MyTransformer transformLocal(…) transformRemote(…) AbstractRemoteContentTransformer remoteTransformerClient transformInternal(…) transformLocal(…) transformRemote((…) @Override protected void transformRemote( RemoteTransformerClient remoteTransformerClient, ContentReader reader, ContentWriter writer, TransformationOptions options, String sourceMimetype, String targetMimetype, String sourceExtension, String targetExtension, String targetEncoding) throws Exception { long timeout = options.getTimeoutMs(); String language = getLanguage(options); String dialect = getDialect(options); remoteTransformerClient.request(reader, writer, sourceMimetype, sourceExtension, targetExtension, timeout, logger, ”language", language, ”dialect", dialect); }
  • 9. Learn. Connect. Collaborate. Docker Image The Transform Engine Spring Boot App Command XxxController transform(…) processTransform(…) alfresco-transformer-base AbstractTransformerController public void processTransform( File sourceFile, File targetFile, Map<String, String> transformOptions, Long timeout) { // Code to build command line options commandExecutor.run(options, sourceFile, targetFile, timeout); } @PostMapping(value = "/transform", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public ResponseEntity<Resource> transform( HttpServletRequest request, @RequestParam("file") MultipartFile sourceMultipartFile, @RequestParam("targetExtension") String targetExtension, @RequestParam("language") String language, @RequestParam("dialect") String dialect, @RequestParam(value = "timeout", required = false) Long timeout) { // Code to obtain source file // Code to build command line options commandExecutor.run(options, sourceFile, targetFile, timeout); // Code to return target file as an attachment }
  • 10. Learn. Connect. Collaborate. Docker Image The Transform Engine Spring Boot App Command XxxController transform(…) processTransform(…) alfresco-transformer-base AbstractTransformerController public void processTransform( File sourceFile, File targetFile, Map<String, String> transformOptions, Long timeout) { // Code to build command line options commandExecutor.run(options, sourceFile, targetFile, timeout); } @PostMapping(value = "/transform", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public ResponseEntity<Resource> transform( HttpServletRequest request, @RequestParam("file") MultipartFile sourceMultipartFile, @RequestParam("targetExtension") String targetExtension, @RequestParam("language") String language, @RequestParam("dialect") String dialect, @RequestParam(value = "timeout", required = false) Long timeout) { // Code to obtain source file // Code to build command line options commandExecutor.run(options, sourceFile, targetFile, timeout); // Code to return target file as an attachment }
  • 11. Learn. Connect. Collaborate. Configuration ACS repo Transform Service transform-service- config.json Transform Service Registry ?? … { "name": "pdfRenderer", "transformOptions": [ {"value": {"name": "page"}}, {"value": {"name": "width"}}, {"value": {"name": "height"}}, {"value": {"name": "allowPdfEnlargement"}}, {"value": {"name": "maintainPdfAspectRatio"}} ], "supportedSourceAndTargetList": [ {"sourceExt": "pdf", "targetExt": "png" } ] }, … Rendition Service 2 Proxy
  • 12. Learn. Connect. Collaborate. Configuration ACS repo Transform Service transform-service- config.json Transform Service Registry ?? … { "name": "pdfRenderer", "transformOptions": [ {"value": {"name": "page"}}, {"value": {"name": "width"}}, {"value": {"name": "height"}}, {"value": {"name": "allowPdfEnlargement"}}, {"value": {"name": "maintainPdfAspectRatio"}} ], "supportedSourceAndTargetList": [ {"sourceExt": "pdf", "targetExt": "png" } ] }, … Rendition Service 2 Proxy
  • 13. Learn. Connect. Collaborate. Configuration ACS repo Transform Service transform.service.enabled=true local.transform.service.enabled=true alfresco-pdf-renderer.url=http://localhost:8090/ img.url=http://localhost:8091/ jodconverter.url=http://localhost:8092/ tika.url=http://localhost:8093/ transform-service- config.json alfresco- global.properties Transform Service Registry ?? … { "name": "pdfRenderer", "transformOptions": [ {"value": {"name": "page"}}, {"value": {"name": "width"}}, {"value": {"name": "height"}}, {"value": {"name": "allowPdfEnlargement"}}, {"value": {"name": "maintainPdfAspectRatio"}} ], "supportedSourceAndTargetList": [ {"sourceExt": "pdf", "targetExt": "png" } ] }, … Rendition Service 2 Proxy
  • 14. Learn. Connect. Collaborate. Configuration ACS repo Transform Service transform.service.enabled=true local.transform.service.enabled=true alfresco-pdf-renderer.url=http://localhost:8090/ img.url=http://localhost:8091/ jodconverter.url=http://localhost:8092/ tika.url=http://localhost:8093/ transform-service- config.json alfresco- global.properties Transform Service Registry ?? … { "name": "pdfRenderer", "transformOptions": [ {"value": {"name": "page"}}, {"value": {"name": "width"}}, {"value": {"name": "height"}}, {"value": {"name": "allowPdfEnlargement"}}, {"value": {"name": "maintainPdfAspectRatio"}} ], "supportedSourceAndTargetList": [ {"sourceExt": "pdf", "targetExt": "png" } ] }, … Rendition Service 2 Proxy
  • 15. Learn. Connect. Collaborate. When is the Transform Service called? ACS repo Transform ServiceTransform Service Registry … { "name": "pdfRenderer", "transformOptions": [ {"value": {"name": "page"}}, {"value": {"name": "width"}}, {"value": {"name": "height"}}, {"value": {"name": "allowPdfEnlargement"}}, {"value": {"name": "maintainPdfAspectRatio"}} ], "supportedSourceAndTargetList": [ {"sourceExt": "pdf", "targetExt": "png" } ] }, … Rendition Service 2 Proxy • Rendition Service 2 has been called: – V1 REST API – on content update – original Rendition Service • RenditionDefinition2 exist • Transform Service supports the transform Transformer
  • 16. Learn. Connect. Collaborate. When is the Transform Service called? ACS repo Transform ServiceTransform Service Registry … { "name": "pdfRenderer", "transformOptions": [ {"value": {"name": "page"}}, {"value": {"name": "width"}}, {"value": {"name": "height"}}, {"value": {"name": "allowPdfEnlargement"}}, {"value": {"name": "maintainPdfAspectRatio"}} ], "supportedSourceAndTargetList": [ {"sourceExt": "pdf", "targetExt": "png" } ] }, … Rendition Service 2 Proxy • Rendition Service 2 has been called: – V1 REST API – on content update – original Rendition Service • RenditionDefinition2 exist • Transform Service supports the transform Transformer
  • 17. Learn. Connect. Collaborate. Simplification of Transform Options Transformation Options <bean id="renditionDefinition2DocLib" class="org.alfresco.repo.rendition2.RenditionDefinition2I <constructor-arg name="renditionName" value="doclib"/> <constructor-arg name="targetMimetype" value="image/png"/> <constructor-arg name="transformOptions"> <map> <entry key="resizeWidth" value="100"/> <entry key="resizeHeight" value="100"/> <entry key="allowEnlargement" value="false" /> <entry key="maintainAspectRatio" value="true"/> <entry key="thumbnail" value="true"/> <entry key="timeout" value="${system.thumbnail.definition.default.timeoutMs}" /> </map> </constructor-arg> <constructor-arg name="registry" ref="renditionDefinitionRegistry2"/> </bean> Transform Options key value key value key value
  • 18. Learn. Connect. Collaborate. Simplification of Transform Options Transformation Options <bean id="renditionDefinition2DocLib" class="org.alfresco.repo.rendition2.RenditionDefinition2I <constructor-arg name="renditionName" value="doclib"/> <constructor-arg name="targetMimetype" value="image/png"/> <constructor-arg name="transformOptions"> <map> <entry key="resizeWidth" value="100"/> <entry key="resizeHeight" value="100"/> <entry key="allowEnlargement" value="false" /> <entry key="maintainAspectRatio" value="true"/> <entry key="thumbnail" value="true"/> <entry key="timeout" value="${system.thumbnail.definition.default.timeoutMs}" /> </map> </constructor-arg> <constructor-arg name="registry" ref="renditionDefinitionRegistry2"/> </bean> Transform Options key value key value key value
  • 19. Learn. Connect. Collaborate. Future No promises - It might not happen • Public access to – alfresco-transformer-base – sample transformers • Local Router – for use by the community – help develop new Engines • Remaining transformers • New transforms metadata extraction document analysis AI translation image to text text to voice
  • 20. Learn. Connect. Collaborate. Future No promises - It might not happen • Public access to – alfresco-transformer-base – sample transformers • Local Router – for use by the community – help develop new Engines • Remaining transformers • New transforms metadata extraction document analysis AI translation image to text text to voice
  • 21. Learn. Connect. Collaborate. Future No promises - It might not happen • Public access to – alfresco-transformer-base – sample transformers • Local Router – for use by the community – help develop new Engines • Remaining transformers • New transforms metadata extraction document analysis AI translation image to text text to voice
  • 22. Porting a Custom Transformer to the New Transform Service Thank you!