Lightning Talks Session 2
-
Upload
independent -
Category
Documents
-
view
7 -
download
0
Transcript of Lightning Talks Session 2
Splunk – Log Management Benefits
Benefits of Splunk Log Management
•Investigate security threats faster.
•Reduce operational complexity and cost.
•Generate reports in seconds.
Splunk – Log Management Benefits
Benefits of Splunk Log Management
•Investigate security threats faster.
•Reduce operational complexity and cost.
•Generate reports in seconds.
Splunk – REST API
Splunk provides a RestFul API for
•Communication Splunk Web-Splunk Instance.
•Configure and Manage Splunk Instance.
•Integrate your own application with Splunk.
Alfresco-Splunk. Configuring Splunk
Steps for Splunk configuration
• Creates data input.
• Execute Test Search.
• Define Alerts.
Alfresco-Splunk.
What is necessary in Alfresco
• AMP project for alfresco.
• Splunk SDK.
• AMP project for share.
• Dashlet
Alfresco-Splunk.
What is necessary in Alfresco
• AMP project for alfresco.
• Splunk SDK.
• AMP project for share.
• Dashlet
Alfresco-Splunk.
What is necessary in Alfresco
• AMP project for alfresco.
• Splunk SDK.
• AMP project for share.
• Dashlet
Resources
Resources used to do this presentation:
• Splunk Web site.
• http://www.splunk.com
• Alfresco Wiki
• http://wiki.alfresco.com
What about MyBatis ?
Persistence framework
• 11 years old, formerly known as iBatis
• Maps methods to SQL statements
• Doesn’t map Java objects to database table, unlike ORM (Hibernate etc)
SQL statements manually defined using XML or annotations
• Full control of SQL execution
• Let’s use all DB functionality (views, stored procedures, etc)
• Easy coding: statements are executed with a single line
Alfresco & MyBatis: a growing love story !
MyBatis usage in Alfresco
• Since 2008
• Progressive Hibernate removal
• Now only MyBatis are used (*)
Technical gains
• Stability
• Very large deployments support
• Performance improvements
(*): Hibernate library stills in Alfresco for jBPM
MyBatis in custom extension: use cases
Custom access to existing tables
• Often for tables outside of Alfresco’s meta-model
• alf_activity_*
• alf_audit_*
• … • Often for custom search queries
• When standard Alfresco services don’t provide it
Access to custom tables
• Sometime new features don’t fit into Alfresco’s meta-model
How-to, step-by-step
Step 1. Spring context • For MyBatis infrastructure
Step 2. MyBatis configuration
• To reference types and mappers Step 3. MyBatis mapper
• Where SQL statements templates are stored Step 4. Call SQL session template
• From you java code Step 5. Deal with vendor-specific SQL
• Only if needed
How-to, step-by-step
Step 1. Spring context • For MyBatis infrastructure
Step 2. MyBatis configuration
• To reference types and mappers Step 3. MyBatis mapper
• Where SQL statements templates are stored Step 4. Call SQL session template
• From you java code Step 5. Deal with vendor-specific SQL
• Only if needed
Step 1. Spring context
<!-- MyBatis config --> <bean id="my_extension_SqlSessionFactory" class="org.alfresco.ibatis.HierarchicalSqlSessionFactoryBean"> <property name="useLocalCaches" value="${mybatis.useLocalCaches}"/> <property name="resourceLoader" ref="dialectResourceLoader"/> <property name="dataSource" ref="activitiesDataSource"/> <property name="configLocation"> <value>classpath:alfresco/module/my_extension/ibatis/my-SqlMapConfig.xml</value> </property> </bean> <!-- MyBatis-Spring sqlSessionTemplate --> <bean id="my_extension_SqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate"> <constructor-arg index="0" ref="my_extension_mySqlSessionFactory"/> </bean>
alfresco/module/my_extension/ibatis/ibatis-context.xml
Step 2. MyBatis configuration
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <typeAliases> <typeAlias alias="InputType" type="com.company.my_extension.InputType"/> <typeAlias alias="OutputType" type="com.company.my_extension.OutputType"/> </typeAliases> <mappers> <mapper resource="alfresco/module/my_extension/ibatis/#resource.dialect#/my-SqlMap.xml"/> </mappers> </configuration>
alfresco/module/my_extension/ibatis/my-SqlMapConfig.xml
Step 3. MyBatis mapper
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="my_extension"> <select id="search_query1" parameterType="InputType" resultType="OutputType"> select post_user_id as userId, count(post_user_id) as count from alf_activity_post where site_network = #{site} group by post_user_id order by count desc; </select> </mapper>
alfresco/module/my_extension/ibatis/org.hibernate.dialect.Dialect/my-SqlMap.xml
InputType
+site
OutputType
+userId
+count
Step 4. Call SQL session template
<bean id="my_extension_myDAO" class="com.company.my_extension.ibatis.MyDAOImpl"> <property name="template" ref= "my_extension_SqlSessionTemplate" /> </bean>
protected SqlSessionTemplate template; public final void setTemplate (SqlSessionTemplate sqlSessionTemplate) { this.template = sqlSessionTemplate;
} public List<OutputType> executeSearchQuery1(InputType input) { List<OutputType> results = (List<OutputType>)template.selectList("my_extension.search_query1", input); return results; }
com.company.my_extension.ibatis.MyDAOImpl
alfresco/module/my_extension/ibatis/my-SqlMapConfig.xml
Step 5. Deal with vendor-specific SQL
Optional
• Only needed if standard SQL doesn’t fit Multiple mappers files
• Default file
• …/ibatis/org.hibernate.dialect.Dialect/my-SqlMap.xml • Dedicated file for each dialect
• …/ibatis/org.hibernate.dialect.MySQLInnoDBDialect/my-SqlMap.xml
• …/ibatis/org.hibernate.dialect.PostgreSQLDialect/my-SqlMap.xml
• …
Real-world example
Social Tops extension
• Dashlet showing "Top People"
• based on their activities,
• with configurable policy for scores calculation.
• Opensource
• GitHub repository
• 2nd at 2012 Dashlet Challenge
Best practices…
Prefer high-level repository query language when possible
Be aware of vendor-specific SQL Implement schema upgrade patch for custom tables Use Alfresco implementation as example Use MyBatis documentation
Best practices…
Prefer high-level repository query language when possible
Be aware of vendor-specific SQL Implement schema upgrade patch for custom tables Use Alfresco implementation as example Use MyBatis documentation
Best practices…
Prefer high-level repository query language when possible
Be aware of vendor-specific SQL Implement schema upgrade patch for custom tables Use Alfresco implementation as example Use MyBatis documentation
Best practices…
Prefer high-level repository query language when possible
Be aware of vendor-specific SQL Implement schema upgrade patch for custom tables Use Alfresco implementation as example Use MyBatis documentation
Best practices…
Prefer high-level repository query language when possible
Be aware of vendor-specific SQL Implement schema upgrade patch for custom tables Use Alfresco implementation as example Use MyBatis documentation
Best practices…
Prefer high-level repository query language when possible
Be aware of vendor-specific SQL Implement schema upgrade patch for custom tables Use Alfresco implementation as example Use MyBatis documentation
Get this presentation from SlideShare.net
Stay in touch on Twitter:
@slemarchand
Social Tops
http://slemarchand.github.com/social-tops
SQLI Group
http://entreprise-digitale.com
http://sqli.com
Get this presentation from SlideShare.net
Stay in touch on Twitter:
@slemarchand
Social Tops
http://slemarchand.github.com/social-tops
SQLI Group
http://entreprise-digitale.com
http://sqli.com
Get this presentation from SlideShare.net
Stay in touch on Twitter:
@slemarchand
Social Tops
http://slemarchand.github.com/social-tops
SQLI Group
http://entreprise-digitale.com
http://sqli.com
Implementing portlets using WebScripts
Piergiorgio Lucidi Open Source ECM Specialist
Alfresco Trainer / Wiki Gardener / Contributor
Author / Technical Reviewer @ Packt Publishing
PMC Member @ Apache Software Foundation
Project Leader / Committer @ JBoss
Implementing portlets using WebScripts
Piergiorgio Lucidi Open Source ECM Specialist
Alfresco Trainer / Wiki Gardener / Contributor
Author / Technical Reviewer @ Packt Publishing
PMC Member @ Apache Software Foundation
Project Leader / Committer @ JBoss
What is a portal?
• A portal is an application focused on • Aggregating apps based on different technologies • Creating user oriented and dynamic websites • Page-centric approach
• Portlets / Apps / Gadgets
• Enterprise services
• Authentication
• Authorization
• Personalization
• Export / Import
• APIs for integrations
What is a portal?
• A portal is an application focused on • Aggregating apps based on different technologies • Creating user oriented and dynamic websites • Page-centric approach
• Portlets / Apps / Gadgets
• Enterprise services
• Authentication
• Authorization
• Personalization
• Export / Import
• APIs for integrations
What is a portlet?
A portlet is an application that •Contains specific business logic
• Provides a fragment of content
• Potentially the output fragment can be dynamic for each user
•A permission can be given for
• The entire portal
• Page
• Portlet
•Can be implemented using bridging and wrappers
Why exposing WebScripts as portlets?
• Agile and quick approach
• Reuse of existing components
• Modularization
• It’s fun ^__^
Exposing WebScripts as portlets
WebScriptPortlet • alfresco.war
• WebScripts
Pure Spring WebScripts
ProxyPortlet • share.war
• Surf pages • Surf components
• WebScripts Spring Surf
WebScriptPortlet – Deployment scenario
WebScriptPortlet • JVM
• Portal
• alfresco.war
• portlet.xml
• Presentation
• Take contents directly from the
local Alfresco
• Single tier architecture
JVM
Portal
Alfresco
WebScriptPortlet – Parameters
• scriptUrl
• URL of the WebScript
• Authenticator factory • jsr168.webclient
• Cookie
• jsr168
• Portal session
WebScriptPortlet – How it works
Rendering phases:
1. The portal starts to render the page
2. Alfresco starts to render the WebScript
3. Alfresco will authenticate user
4. WebScript is executed using the user permissions
5. The controller will return results in the FTL
6. Alfresco ends to render the WebScript in the portlet
7. The portal finishes to render the page
WebScriptPortlet – Best Practices
• Divide all the functionalities in simple views • Each atomic feature matched with a WebScript
• Use Ajax calls with the ticket session • Any other interaction needed for the WebScript UI
• Don’t overload the WebScript • Keep it simple!!!
ProxyPortlet – Deployment scenario
ProxyPortlet • JVM
• Portal
• share.war
• portlet.xml
• 2-tiers architecture
• Presentation tier
• Share.war
• Data tier
• alfresco.war
• Remote calls against the
remote repository
JVM
Portal
Share
JVM
Alfresco
ProxyPortlet – How it works
Rendering phases:
1. The portal starts to render the page
2. Share starts to render the Surf page
3. Surf starts to render the component
4. Share invokes Alfresco using external authentication
5. Alfresco executes the Data WebScript
6. The returned JSON will be used in the FTL
7. Share ends to render the Surf page
8. The portal finishes to render the portlet
ProxyPortlet – Best Practices
• Configure SSO between Alfresco and the portal • External authentication
• Each request from Share will have an HTTP header
• Alfresco will delegate the portal for authentication
• Divide each functionality thinking about usability
• Use Ajax calls for creating dynamic UI
• Don’t overload Surf pages and components • Keep it simple!!!
ProxyPortlet – Best Practices
• Configure SSO between Alfresco and the portal • External authentication
• Each request from Share will have an HTTP header
• Alfresco will delegate the portal for authentication
• Divide each functionality thinking about usability
• Use Ajax calls for creating dynamic UI
• Don’t overload Surf pages and components • Keep it simple!!!
Org Chart in Alfresco
• If the company is big, you have an org chart hierarchy in real life and need it in Alfresco
Org Chart in Alfresco
• Org chart UI allows to browse units and roles and understand who is responsible for what
Org Chart Picker
• Org chart picker can be used in workflows to find a person in charge in company structure by role
Org Chart Picker Configuration
• It is really simple to configure – you just add one line into share
config
<field id=“alvex:reviewer"
label-id="alvex.workflow.bpm_assignee“
set="assignees">
<control template="/com/alvexcore/orgchart-picker.ftl" />
</field>
• That's it! Now Share will render org chart picker to choose
alvex:reviewer from company structure.
Use Case #2: Role-Based Tasks
• Sometimes you need pre-defined assignees for certain tasks in
workflow
• If an employee is going to business trip, two approvals are required – from the manager
(who is directly responsible for daily business) and from accountant (who will pay the
expenses after all).
Role-Based Tasks Are Context-Aware
• Who is the manager and who is the accountant depends on where
the employee is in company structure – the roles are context-aware
in real life
Role-Based Tasks Are Context-Aware
• Who is the manager and who is the accountant depends on where
the employee is in company structure – the roles are context-aware
in real life
• Just users / groups are not enough, they are fixed and do not take workflow
context into account
<userTask id="managerReview"
activiti:assignee=“Head Office->Department One::Manager ">
Org chart unit is set
explicitly by name
Role-Based Tasks: Simple Example
Role-Based Tasks: Context Awareness
<userTask id="managerReview"
activiti:assignee=“{0}::Manager">
Determine org chart unit
current user belongs to
<userTask id="managerReview"
activiti:assignee=“{0}::Manager">
Determine org chart unit
current user belongs to
Role-Based Tasks: Context Awareness
Role-Based Tasks: Relative Addressing
<userTask id="managerReview"
activiti:assignee=“{-1}::Manager">
Org chart unit one step up from
The unit current user belongs to
Role-Based Tasks: Roles Inheritance
In real life we never have every role set for each org chart unit. Mostly roles are defined for org chart branch, configured for the unit on the top and are meant to cover the whole branch.
Role-Based Tasks: Roles Inheritance
<userTask id=“accountantReview"
activiti:assignee=“{0}::Accountant">
There is no accountant set for
this unit. Org chart will search
up the tree to find accountant
'inherited' from upper level.
Separate Delegations for Each Role
If you are team lead for some group and member of the board at the same time – most probably when you are out of office you need to delegate these duties to different people.
Separate Delegations for Each Role
If you are team lead for some group and member of the board at the same time – most probably when you are out of office you need to delegate these duties to different people.
Delegations Are Transparent for Workflows
• If you are out of office – new tasks will take roles delegation into account and
will be routed to the users who are appointed to replace you.
Delegations Are Transparent for Workflows
• If you are out of office – new tasks will take roles delegation into account and
will be routed to the users who are appointed to replace you.
• Who is responsible for 'Accountant' role for this unit? - Danny
• Is Danny available? - No, he is out of office now
• Who replaces Danny for this role? - Emma
• Task is assigned to Emma
Org Chart Usage and APIs
• Default org chart usage
• Web-based GUI for administration
• Org chart picker to appoint users from company structure
• Role-based task assignment in workflows
• Org chart APIs for your customizations
• Java API
• JavaScript API (root scope object ‘orgchart’)
• REST API
Org chart extension is part of Alvex
Download and use:
http://www.alvexcore.com/
Documentation:
http://docs.alvexcore.com/
Fork on Github and join development:
https://github.com/ITDSystems/alvex
Follow Alvex news on Twitter:
@itdsystems
Org chart extension is part of Alvex
Download and use:
http://www.alvexcore.com/
Documentation:
http://docs.alvexcore.com/
Fork on Github and join development:
https://github.com/ITDSystems/alvex
Follow Alvex news on Twitter:
@itdsystems
Configuration example
<type name="alvexwf:executeTask">
<parent>bpm:workflowTask</parent>
<mandatory-aspects>
<aspect>alvexrwf:relatedWorkflows</aspect>
</mandatory-aspects>
</type>
Configuration example
<appearance>
<field id=“” set="">
<control template="/alvex/related_workflows_control.ftl">
<control-param name="definitionsFilter">(activiti$)
</control-param>
</control>
</field>
</appearance>
Additional questions
• Attach parent workflow documents to related workflow
• Check out documents from related workflow to a parent after
completing
• …
Result
• You can build one standard workflow definition for many similar
business processes
• You can reuse simple workflow-units in different business
processes
Result
• You can build one standard workflow definition for many similar
business processes
• You can reuse simple workflow-units in different business
processes
• You can build new workflow on the fly using simple workflow-units
Alvex provides different features for real life
workflow building
• Document uploader on the task page
• Discussions integrated into workflow
• Access rights control for workflows
• My Team Tasks dashlet for Managers
• …
Alvex provides different features for real life
workflow building
• Document uploader on the task page
• Discussions integrated into workflow
• Access rights control for workflows
• My Team Tasks dashlet for Managers
• …
Download and use:
http://www.alvexcore.com/
Fork on Github and join development:
https://github.com/ITDSystems/alvex
Follow Alvex news on Twitter:
@itdsystems
* Workflow example and usernames used in this presentation are
completely fictional and has nothing to do with real life
Download and use:
http://www.alvexcore.com/
Fork on Github and join development:
https://github.com/ITDSystems/alvex
Follow Alvex news on Twitter:
@itdsystems
* Workflow example and usernames used in this presentation are
completely fictional and has nothing to do with real life
Lothar Märkle
http://www.ecm4u.de
http://www.ecm-market.de
@LotharMaerkle
http://thinkalfresco.blogspot.com
Reuse examples
• File plans and archiving • OCR integration • Extended Viewer capabilities
• Annotation • E-Mail • CAD
• Extended scripting capabilities • Sending template driven multipart mails • Form controls • Master data synchronization • ….
Reuse examples
• File plans and archiving • OCR integration • Extended Viewer capabilities
• Annotation • E-Mail • CAD
• Extended scripting capabilities • Sending template driven multipart mails • Form controls • Master data synchronization • ….
Reuse examples continued
• Document models • Workflows • Audit log mining for compliance • Monitoring • Maintenance • Operation and management • Mailroom automation • Metadata extraction • Document transformation • ….
Reuse examples continued
• Document models • Workflows • Audit log mining for compliance • Monitoring • Maintenance • Operation and management • Mailroom automation • Metadata extraction • Document transformation • ….
Lothar Märkle
http://www.ecm4u.de
http://www.ecm-market.de
@LotharMaerkle
http://thinkalfresco.blogspot.com
Lothar Märkle
http://www.ecm4u.de
http://www.ecm-market.de
@LotharMaerkle
http://thinkalfresco.blogspot.com
Data Producers
PathMapping
Application
• An application define how data is mapped, extracted, and recorded
without affecting data required by other applications
• The data generate by “data producers” are passing to application
through the path mappings
Data extractors and data generators
Data Generator
• A DataGenerator is a component that produces data without any input i.e. data
is produced when a data path is active, but is independent of the values at that
path.
• A DataExtractor is a component that uses input data to produce some output,
either transforming the data or merely outputting the data verbatim
Data Extractor
AuditQuery
Consult each audit application component by a
customizable query
Normal query (all results)
• curl -u <admin user>:<password>
"http://<hostname>:<port>/alfresco/service/api/audit/query/<application
name>?verbose=true
Optional parameters
• forward (true|false), sorted upward (true)/ downward (false) by date time
• limit (true|false), limit the number of results.
• toId, return the results until id specified
• value, the value to filter
• fromTime/toTime, returns the result by the time interval specified (millisecond)
Log4j: syslog appender and additivity
log4j.properties (appender)
log4j.appender.syslog=org.apache.log4j.net.SyslogAppender
log4j.appender.syslog.syslogHost=localhost
log4j.appender.syslog.layout=org.apache.log4j.PatternLayout
log4j.appender.syslog.layout.conversionPattern=%m%n
log4j.appender.syslog.Facility=local4
log4j.properties (additivity)
log4j.logger.org.alfresco.audit.LogAuditImpl=INFO,syslog
log4j.additivity.org.alfresco.audit.LogAuditImpl = false
Log4j: syslog appender and additivity
log4j.properties (appender)
log4j.appender.syslog=org.apache.log4j.net.SyslogAppender
log4j.appender.syslog.syslogHost=localhost
log4j.appender.syslog.layout=org.apache.log4j.PatternLayout
log4j.appender.syslog.layout.conversionPattern=%m%n
log4j.appender.syslog.Facility=local4
log4j.properties (additivity)
log4j.logger.org.alfresco.audit.LogAuditImpl=INFO,syslog
log4j.additivity.org.alfresco.audit.LogAuditImpl = false
Demo
Pause the rules and manually start the
video because the presentation
software is not obeying Asimov’s 2nd
Law of Robotics.
Visualizing Documents in Alfresco and
Bringing Beautiful Navigation and Content
Analytics
Bhagya Nirmaan Silva
Visualizing Documents in Alfresco and
Bringing Beautiful Navigation and Content
Analytics
Bhagya Nirmaan Silva
What we are going to see
Why you want interactive navigation and content analytics? Ways to provide navigation and content analytics How you can do it with Alfresco The future of interactive navigation on Alfresco
Content?
Users are generating content all the time… More content means users are more likely to forget where their content is.
User Stories
As a User, I want to locate a document when I have forgotten where I stored it. As a User, I want to know what my repository looks like.
User Stories
As a User, I just don’t know where I put my content it or what it had, maybe I wanted to hide the file somewhere deep inside the repository and now I want it back.
Why visual matters?
Humans perceive faster using visual guides. Visualization provides a context for search and navigation.
D3?
Data Driven Documents. Enables bringing data to life using HTML, SVG and CSS3 Follows web standards. Data driven approach to DOM manipulation
How to get these together?
Webscripts, Dashlets and Site Pages? 1. Use a webscript to receive the repository content metadata as a tree. 2. Create a dashlet/site page, include d3.js 3. Write your visualization code. and 4. Pass the content metadata tree and it takes care of the rest.
Where to go from here?
Optimizations and clustering of content to make navigation and analytics much faster.
Any questions?
Talk to me during the DevCon. =) [email protected] about.me/bhagyas twitter.com/bhagyas fb.me/bhagyas linkedin.com/in/bhagyas [email protected]
Contact us! web www.zaizi.com In www.linkedin.com/company/zaizi fb www.facebook.com/ZaiziLtd
Bhagya Nirmaan Silva [email protected]
Contact us! web www.zaizi.com In www.linkedin.com/company/zaizi fb www.facebook.com/ZaiziLtd
Bhagya Nirmaan Silva [email protected]