Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Event Handling Basics

352 views

Published on

MintJams Content Repository 5 allows you to start event handling using user-friendly tools and JavaScript.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Event Handling Basics

  1. 1. Event Handling Basics MintJams Content Repository (C) 2016 MintJams Inc.
  2. 2. Tools: 2 Content Repository 5.10.3 Content Management Tools Standard 5.1.3
  3. 3. Installing: 3 Please refer to the following documents: Creating a Web Application with JavaScript + jQuery http://www.slideshare.net/mintjams/creating-a-web-application-with-javascript-jquery
  4. 4. Demo MintJams Content Repository Event Handling Basics You can start event handling using user-friendly tools and JavaScript.
  5. 5. Facets MintJams Content Repository Event Handling Basics mintjams:event.listener mintjams:event.types mintjams:event.script.type mintjams:event.script.inline
  6. 6. Facets: mintjams:event.listener 6 Description: Sets whether or not this event listener is enabled. An event listener that is enabled may execute the script to resource change, while an event listener that is not enabled cannot execute the script to resource change. Type: Yes/No Name: Event Listener Setting:
  7. 7. Facets: mintjams:event.types 7 Description: A combination of one or more event type. Type: Choice Name: Event Type Setting:
  8. 8. Facets: mintjams:event.script.type 8 Description: The mime type. An event listener let you obtain a script engine based on mime type. Type: Single line of text Name: Script Type Setting:
  9. 9. Facets: mintjams:event.script.inline 9 Description: The script language source to be executed. Type: Multiple lines of text Name: Script Source Setting:
  10. 10. Other Facets: 10 mintjams:event.script.path The path to an external script file. mintjams:event.coreThreads The number of threads to keep in the pool, even if they are idle. mintjams:event.maxThreads The maximum number of threads to allow in the pool.
  11. 11. Policies MintJams Content Repository Event Handling Basics event.listener
  12. 12. Policies: event.listener 12 Description: The policy that enables you to configure the file as an event file. Name: Event Listener Setting:
  13. 13. Files MintJams Content Repository Event Handling Basics fileupload
  14. 14. Files: fileupload 14 Description: The event listener that listens for the events in the folder "/WEB-INF/upload". Path: /WEB-INF/upload/.metadata/fileupload Setting:
  15. 15. Files: fileupload: Script Source 15 (function() { if (resource.isCollection()) { return; } if (event.getType().isResourceAdded()) { log.info(resource.getPath() + ' is uploaded.'); } else if (event.getType().isResourceRemoved()) { log.info(resource.getPath() + ' is removed.'); } })(); Ignore the folders Add event Remove event Write a log Write a log
  16. 16. Implicit Objects MintJams Content Repository Event Handling Basics event resource log
  17. 17. Implicit Objects: event 17 Description: The event triggering the execution of the script. Class: jp.co.mintjams.osgi.service.observation.ResourceEvent
  18. 18. Implicit Objects: resource 18 Description: The file or the folder triggering the execution of the script. Class: jp.co.mintjams.osgi.service.resource.Resource
  19. 19. Implicit Objects: log 19 Description: The LoggerAPI object. Class: jp.co.mintjams.osgi.service.script.LoggerAPI
  20. 20. Other Implicit Objects: 20 EscapeAPI The EscapeAPI object. SearchAPI The SearchAPI object. ClassLoaderAPI The ClassLoaderAPI object. SessionAPI The SessionAPI object. CredentialsAPI The CredentialsAPI object. TextAPI The TextAPI object. RuntimeAPI The RuntimeAPI object. BpmnAPI (Optional) The BpmnAPI object.
  21. 21. Reference: 21 CR5 Scripting API 5.10: https://www.mintjams.jp/javadoc/cr5-scripting-api/5.10/index.html
  22. 22. Content Repository https://www.mintjams.jp/products/contentrepository.html 22
  23. 23. MintJams https://www.mintjams.jp/ 23

×