Download presentation
Presentation is loading. Please wait.
Published byOsborn Mathews Modified over 8 years ago
1
#SummitNow Enhanced Script API Nov 2013 Axel Faust, PRODYNA AG
2
#SummitNow About… Enhanced Script Environment /AFaust/alfresco-enhanced-script-environment Addons for Repository + Share Community + Enterprise 4.x Eclipse Public License
3
#SummitNow Motivation JavaScript at core of many projects Script developers are „ubiquitous“ Support of rapid extension Pain points / project triggers limitations: IDE, QA tools, extensibility https://issues.alfresco.com/jira/browse/ALF-13631
4
#SummitNow #1 - Handling doclib filters filter.get alfresco.js documentlist.js doclist.get filters.lib.js
5
#SummitNow #1 - Customizing doclib filters filter.get doclist.getfilters.lib.js /my/filter.get Customization
6
#SummitNow #1 - Customizing doclib filters doclist.getfilters.lib.js doclist.get*filters.lib.js* /alfresco/extension
7
#SummitNow #2 – Workflow scripts DBMS my-workflow v1.0my-workflow v1.1 … Subject I18n in Alfresco 4.2 Customization?
8
#SummitNow #3 – (Ad-hoc) Mass update Archive / Read-only Update permissions Stop workflows Remove ownership … Duration / robustness? a) 10² items b) 10³ items c) 10 x items
9
#SummitNow Dynamic Imports
10
#SummitNow Script inclusions X = concat(B, C, A) Merge Enhanced Script Environment Script A B C B C doSth1(); importScript(B); B C importScript(C); doSth2();
11
#SummitNow Extensible script import API
12
#SummitNow Predefined script locator types Repository & Share: classpath, registry Repository: xpath, nodeRef, legacy Share / Surf: storePath
13
#SummitNow Advanced usages Registry lookup independent of physical location Selective script import based on Alfresco Version
14
#SummitNow Advanced usages Isolated execution context Pre-defined properties as result contract Alternative to value passing: callback function
15
#SummitNow Doclib filters - revisited filter.lib.js (sub-project: /patch-modules/repository)
16
#SummitNow Doclib filters - revisited myFilter.js Bootstrap: /alfresco/extension/registeredScripts/documentlibrary-v2-filters/
17
#SummitNow Batch Processing
18
#SummitNow Existing Java Framework (Repo) TF BPWP TC BP BPW 1) 2) 3) 4) 5), 6), 7) BP – Batch Processor BPWP – … Work Provider BPW – … Worker TF – Thread Factory TC – Txn Callback Setup 1)Get (next) work 2)Create batches 3)Scheduling Execution 4)Parallel execution 5)Before batch 6)Process item of batch 7)After batch FrameworkCustom
19
#SummitNow New JavaScript API No txnBatch txnScript txn Simple callback: { fn: function(){}, scope: object } Scoped callback: function (){}
20
#SummitNow Example usage
21
#SummitNow Scope & Synchronization Rhino, JS or JS API not thread-safe by default Guards in batch processing API Local scope per batch Read-write synchronization on access / invocation Invocation synchronization based on function name
22
#SummitNow Details & Misc
23
#SummitNow Methods of API extension Processor Processor Extension EnhancedScript Processor Scope Contributor Script Processor High-level API extensions (mostly Rhino-agnostic) Low-level API extensions with full Rhino integration Enhanced ScriptProcessor Partial re- implementation
24
#SummitNow Other features Logging Custom loggers per script Logger inheritance on import Parameterized logging Debugging Support for Eclipse JSDT Temporary deactivation of compilation cache Version information JavaScript constants Repository server descriptor
25
#SummitNow Enhancements / future features? Value type handling (i.e. String vs. string) Clean / proper surfacing of sensitive APIs Policy filter Authentication / tenant utilities Proof-of-concept Script processor using Nashorn (JDK 8)
26
#SummitNow Try it out yourself /AFaust/alfresco-enhanced-script-environment (framework + patch project for doclib filters) Compatible with JavaScript Console 0.6.0-rc1
27
#SummitNow
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.