SlideShare a Scribd company logo
1 of 24
Transforming Safe
HTML
PRAKHAR JOSHI (GSOC’15)
How I started Contributed to Plone
 Plone is one of the most frequent organization that is part of Google
Summer of Code.
 The IRC people really helped a lot during the initial phase.
 Awesome Documentation.
 Came across the ticket
https://dev.plone.org/ticket/14929 proposed by Tom when I was
looking for some project and he has also tried to do the changes
accordingly but there were lot of constraint of test cases that made
it less possible to work on it.
Cont..
 Plone.transform was a try for the same during GSOC’07.
 Finally decided to create a separate project for creating safe html
transform using lxml and not of CMF Default.
 We also thought about using intelligent text from html transform.
 Finally created a new add-on experimental.safe_html_transform.
 It uses lxml to filter html.
Difficulties working with Plone
 Plone is not a piece of cake for anyone new.
 The Plone code base is too vast.
 Things were alien for 1-2 months.
 It was difficult for me to figure out from where to start.
 The safe_html of portal_transform is quite old.
 It was difficult to understand the code of old html filter which was
using CMF Default, SGML Parser.
Fun With Plone
 Learnt how to work in team.
 Learnt a lot of new things related to plone and how awesome plone
is.
 How to write efficient code and how to document the work that
have been done.
 Test Driven Development. One of the best part of plone.
 Got to interact with cool people.
 Got to know about the unique and new beers of Europe.
The main aim of the project
 This is to be done with CMF Default in Plone and in this project also :-
The new safe_Html Filter
 Lot of things required to setup the add-on.
 Generic setup of the transform.
 Register safe_html for the browser.
 Add control panel for filter to the browser.
 Create interface for filter under browser.
 Setup profile for the transform by registering browser layer and control
panel under the profile module.
 Deregister Profile as to replace the existing one with a transform of the
same name, since TinyMCE and p.a.controlpanel address safe_html by
it’s Transform name, rather than asking for one MIME to another MIME.
(safe_html = getattr(getToolByName(self, 'portal_transforms'),
'safe_html'))
Automatic register and deregister
for safe_html
 Functions for register and deregister of the product.
 Register safe_html on the installation of the add on.
 Deregistration of the old safe_html from the portal_transform.
 when any developer just install safe_html, the old safe_html will
deregister and the new safe_html will get registered.
 People who are just using plone site will use safe_html by adding an
add-on in their “@@overview-controlpanel” and add
experimental.safe_html_trasform.
 The old safe_html from portal_transform will be deregistered
and the new safe_html that add-on one will get registered.
Cont..
 Codes :-
 <genericsetup:registerProfile
name="default"
title="experimental.safe_html_transform"
directory="profiles/default"
description="Installs the experimental.safe_html_transform add-
on."
provides="Products.GenericSetup.interfaces.EXTENSION"
/>
 <genericsetup:registerProfile
name="uninstall"
title="experimental.safe_html_transform uninstall"
directory="profiles/uninstall"
description="Uninstalls the experimental.safe_html_transform package"
provides="Products.GenericSetup.interfaces.EXTENSION"
/>
New Releases at plone , releases
my sweat.
 This was the time when CMF Plone 5.0.dev was released.
 Not able to detect the issue as where CMF Plone was used as I have
already pinned the CMF Plone.
 Plone.app.widget was not pinned and that is using CMF Plone so it
was creating an error and it took me a lot of time to solve
 This was one of the scariest experience of my GSOC project.
Getting Control Panel for add-on
 Two ways to create Control Panel
 Either to overwrite the old cntrol panel of PortalTransform safe_html.
 Create a separate control panel for our new safe_html add-on.
 I choose the 2nd way to create a control panel and created a
separate control panel for the add-on.
Cont..
 Register the control panel.
<!-- Filter Control Panel -->
<browser:page
name="safe_html_transform-settings"
for="Products.CMFPlone.interfaces.IPloneSiteRoot"
layer="..interfaces.IExperimentalSafeHtmlTransformLayer"
class=".controlpanel.FilterControlPanel"
permission="experimental.safe_html.controlpanel.Filtering“
/>
Cont..
 Adding Permissions for control panel
<configure
xmlns="http://namespaces.zope.org/zope">
<permission id="experimental.safe_html.controlpanel.Filtering"
title="Plone Site Setup: Filtering">
<role name="Manager"/>
<role name="Site Administrator"/>
</permission>
</configure>
The Transform Finally…
 This is the script for filtering safe_html using lxml.
 Converting the whole document into the tree form and then parsing
each node of the tree anf filtering accordingly.
 Used the Cleaner class of lxml for creating Html Filter.
 On add-on installation this transform have to filter the HTML instaed
of the safe_html transform of Portal_transform.
Why we need to port the transform
to lxml ?
 To remove the CMF Default dependencies.
 To make the filtering faster.
 To make the filtering accurate and more optimized.
Testing the transform
 Used Unit test to test the transform.
 Using sample HTML to test the transform.
 Using Automated Robot test and integration tests for testing the
whole add-on.
How to make tinyMCE uses our new
transform in place of old transform?
 It uses getToolByName in portal_transform to get the required
transform.
 Rename our new transform to safe_html instead of some other
name.
 we changed the name of our transform same as old one so that
tinyMCE sense it like a normal thing and no change. :P
Things I learnt during the project
 How to work with test driven Development (TDD).
 How work in collaboration with people on a project.
 How to work on big projects.
 How to catch errors from the error logs.
 How to keep logs for the huge projects. (Blogging, task managers
etc)
Plans ahead
 Looking forward to learn more about plone
 As of right now a lot more to learn, a lot more to develop and a lot
more to code.
Thank You!!

More Related Content

Viewers also liked

Whitney Wheeler Resume (1) (4).PDF
Whitney Wheeler Resume (1) (4).PDFWhitney Wheeler Resume (1) (4).PDF
Whitney Wheeler Resume (1) (4).PDFWhitney Wheeler
 
App Sharing - Wezeit - LI Yan
App Sharing - Wezeit - LI YanApp Sharing - Wezeit - LI Yan
App Sharing - Wezeit - LI Yan妍 李
 
Recent Events in Fund History
Recent Events in Fund HistoryRecent Events in Fund History
Recent Events in Fund HistoryKurtosys Systems
 
20131212 - Sydney - Garvan Institute - Human Genetics and Big Data
20131212 - Sydney - Garvan Institute - Human Genetics and Big Data20131212 - Sydney - Garvan Institute - Human Genetics and Big Data
20131212 - Sydney - Garvan Institute - Human Genetics and Big DataAllen Day, PhD
 
Aplicaciones multimedia y plataformas
Aplicaciones multimedia y plataformasAplicaciones multimedia y plataformas
Aplicaciones multimedia y plataformasDGS
 
How to Work a Trade Show
How to Work a Trade Show How to Work a Trade Show
How to Work a Trade Show UIResearchPark
 
Atchley Signs
Atchley SignsAtchley Signs
Atchley Signsdobda.1
 
Social Media and LinkedIn for IFAs and Financial Planners - Full-day workshop...
Social Media and LinkedIn for IFAs and Financial Planners - Full-day workshop...Social Media and LinkedIn for IFAs and Financial Planners - Full-day workshop...
Social Media and LinkedIn for IFAs and Financial Planners - Full-day workshop...Philip Calvert
 
Mapa conceptual. GESTIÓN DE PROYECTO
Mapa conceptual. GESTIÓN DE PROYECTOMapa conceptual. GESTIÓN DE PROYECTO
Mapa conceptual. GESTIÓN DE PROYECTOMarcela Leon
 
Linked in is it working for you
Linked in is it working for youLinked in is it working for you
Linked in is it working for youLesley Morrissey
 
Развитие лидерства
Развитие лидерстваРазвитие лидерства
Развитие лидерстваKatie Danilova
 
Hadoop and Genomics - What you need to know - Cambridge - Sanger Center and EBI
Hadoop and Genomics - What you need to know - Cambridge - Sanger Center and EBIHadoop and Genomics - What you need to know - Cambridge - Sanger Center and EBI
Hadoop and Genomics - What you need to know - Cambridge - Sanger Center and EBIAllen Day, PhD
 
Smart Systems Revolutionizing Ag - Jason Bull
Smart Systems Revolutionizing Ag - Jason BullSmart Systems Revolutionizing Ag - Jason Bull
Smart Systems Revolutionizing Ag - Jason BullUIResearchPark
 
The Geology of South Raasay Dissertation
The Geology of South Raasay DissertationThe Geology of South Raasay Dissertation
The Geology of South Raasay DissertationJonathan Edwards
 
VR Introduction
VR IntroductionVR Introduction
VR IntroductionAdam Chen
 
How to Create a Content Marketing Tactical Plan for LinkedIn
How to Create a Content Marketing Tactical Plan for LinkedInHow to Create a Content Marketing Tactical Plan for LinkedIn
How to Create a Content Marketing Tactical Plan for LinkedInLinkedIn
 
Service Design meets UX Design
Service Design meets UX DesignService Design meets UX Design
Service Design meets UX DesignFranziska Semer
 

Viewers also liked (20)

Whitney Wheeler Resume (1) (4).PDF
Whitney Wheeler Resume (1) (4).PDFWhitney Wheeler Resume (1) (4).PDF
Whitney Wheeler Resume (1) (4).PDF
 
Svarka ageev
Svarka ageevSvarka ageev
Svarka ageev
 
PDHPE
PDHPEPDHPE
PDHPE
 
App Sharing - Wezeit - LI Yan
App Sharing - Wezeit - LI YanApp Sharing - Wezeit - LI Yan
App Sharing - Wezeit - LI Yan
 
Recent Events in Fund History
Recent Events in Fund HistoryRecent Events in Fund History
Recent Events in Fund History
 
20131212 - Sydney - Garvan Institute - Human Genetics and Big Data
20131212 - Sydney - Garvan Institute - Human Genetics and Big Data20131212 - Sydney - Garvan Institute - Human Genetics and Big Data
20131212 - Sydney - Garvan Institute - Human Genetics and Big Data
 
Aplicaciones multimedia y plataformas
Aplicaciones multimedia y plataformasAplicaciones multimedia y plataformas
Aplicaciones multimedia y plataformas
 
How to Work a Trade Show
How to Work a Trade Show How to Work a Trade Show
How to Work a Trade Show
 
Atchley Signs
Atchley SignsAtchley Signs
Atchley Signs
 
Social Media and LinkedIn for IFAs and Financial Planners - Full-day workshop...
Social Media and LinkedIn for IFAs and Financial Planners - Full-day workshop...Social Media and LinkedIn for IFAs and Financial Planners - Full-day workshop...
Social Media and LinkedIn for IFAs and Financial Planners - Full-day workshop...
 
Mapa conceptual. GESTIÓN DE PROYECTO
Mapa conceptual. GESTIÓN DE PROYECTOMapa conceptual. GESTIÓN DE PROYECTO
Mapa conceptual. GESTIÓN DE PROYECTO
 
Linked in is it working for you
Linked in is it working for youLinked in is it working for you
Linked in is it working for you
 
Развитие лидерства
Развитие лидерстваРазвитие лидерства
Развитие лидерства
 
Hadoop and Genomics - What you need to know - Cambridge - Sanger Center and EBI
Hadoop and Genomics - What you need to know - Cambridge - Sanger Center and EBIHadoop and Genomics - What you need to know - Cambridge - Sanger Center and EBI
Hadoop and Genomics - What you need to know - Cambridge - Sanger Center and EBI
 
Sixth sense technology
Sixth sense technologySixth sense technology
Sixth sense technology
 
Smart Systems Revolutionizing Ag - Jason Bull
Smart Systems Revolutionizing Ag - Jason BullSmart Systems Revolutionizing Ag - Jason Bull
Smart Systems Revolutionizing Ag - Jason Bull
 
The Geology of South Raasay Dissertation
The Geology of South Raasay DissertationThe Geology of South Raasay Dissertation
The Geology of South Raasay Dissertation
 
VR Introduction
VR IntroductionVR Introduction
VR Introduction
 
How to Create a Content Marketing Tactical Plan for LinkedIn
How to Create a Content Marketing Tactical Plan for LinkedInHow to Create a Content Marketing Tactical Plan for LinkedIn
How to Create a Content Marketing Tactical Plan for LinkedIn
 
Service Design meets UX Design
Service Design meets UX DesignService Design meets UX Design
Service Design meets UX Design
 

Similar to Transforming safe html

Django tutorial
Django tutorialDjango tutorial
Django tutorialKsd Che
 
Taming the Legacy Beast: Turning wild old code into a sleak new thoroughbread.
Taming the Legacy Beast: Turning wild old code into a sleak new thoroughbread.Taming the Legacy Beast: Turning wild old code into a sleak new thoroughbread.
Taming the Legacy Beast: Turning wild old code into a sleak new thoroughbread.Chris Laning
 
How to outsource the pain of drupal translation to smartling from loparev
How to outsource the pain of drupal translation to smartling from loparevHow to outsource the pain of drupal translation to smartling from loparev
How to outsource the pain of drupal translation to smartling from loparevOleksii Bogush
 
PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)
PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)
PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)Joshua Warren
 
Behavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWestBehavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWestJoshua Warren
 
Slim PHP when you don't need the kitchen sink
Slim PHP   when you don't need the kitchen sinkSlim PHP   when you don't need the kitchen sink
Slim PHP when you don't need the kitchen sinkJoe Ferguson
 
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...Jitendra Bafna
 
Create Your Own Framework by Fabien Potencier
Create Your Own Framework by Fabien PotencierCreate Your Own Framework by Fabien Potencier
Create Your Own Framework by Fabien PotencierHimel Nag Rana
 
Joomla 1.0X to 1.5X migration. A Guide
Joomla 1.0X to 1.5X migration. A GuideJoomla 1.0X to 1.5X migration. A Guide
Joomla 1.0X to 1.5X migration. A GuideParth Lawate
 
Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010guest5639fa9
 
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose presoTest Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose presoElad Elrom
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsEffizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsDECK36
 
BDD with SpecFlow and Selenium
BDD with SpecFlow and SeleniumBDD with SpecFlow and Selenium
BDD with SpecFlow and SeleniumLiraz Shay
 
Where's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind PloneWhere's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind PloneVincenzo Barone
 
pnwphp - PHPSpec & Behat: Two Testing Tools That Write Code For You
pnwphp - PHPSpec & Behat: Two Testing Tools That Write Code For Youpnwphp - PHPSpec & Behat: Two Testing Tools That Write Code For You
pnwphp - PHPSpec & Behat: Two Testing Tools That Write Code For YouJoshua Warren
 

Similar to Transforming safe html (20)

Django tutorial
Django tutorialDjango tutorial
Django tutorial
 
Introduction to python scrapping
Introduction to python scrappingIntroduction to python scrapping
Introduction to python scrapping
 
Taming the Legacy Beast: Turning wild old code into a sleak new thoroughbread.
Taming the Legacy Beast: Turning wild old code into a sleak new thoroughbread.Taming the Legacy Beast: Turning wild old code into a sleak new thoroughbread.
Taming the Legacy Beast: Turning wild old code into a sleak new thoroughbread.
 
Django by rj
Django by rjDjango by rj
Django by rj
 
How to outsource the pain of drupal translation to smartling from loparev
How to outsource the pain of drupal translation to smartling from loparevHow to outsource the pain of drupal translation to smartling from loparev
How to outsource the pain of drupal translation to smartling from loparev
 
HTML literals, the JSX of the platform
HTML literals, the JSX of the platformHTML literals, the JSX of the platform
HTML literals, the JSX of the platform
 
Django - basics
Django - basicsDjango - basics
Django - basics
 
PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)
PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)
PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)
 
Behavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWestBehavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWest
 
Slim PHP when you don't need the kitchen sink
Slim PHP   when you don't need the kitchen sinkSlim PHP   when you don't need the kitchen sink
Slim PHP when you don't need the kitchen sink
 
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
 
Create Your Own Framework by Fabien Potencier
Create Your Own Framework by Fabien PotencierCreate Your Own Framework by Fabien Potencier
Create Your Own Framework by Fabien Potencier
 
Joomla 1.0X to 1.5X migration. A Guide
Joomla 1.0X to 1.5X migration. A GuideJoomla 1.0X to 1.5X migration. A Guide
Joomla 1.0X to 1.5X migration. A Guide
 
Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010Test Driven Development (TDD) Preso 360|Flex 2010
Test Driven Development (TDD) Preso 360|Flex 2010
 
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose presoTest Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
Test Driven Development (TDD) with FlexUnit 4 - 360|Flex San Jose preso
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsEffizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
 
BDD with SpecFlow and Selenium
BDD with SpecFlow and SeleniumBDD with SpecFlow and Selenium
BDD with SpecFlow and Selenium
 
PYTHON...0...0.pptx
PYTHON...0...0.pptxPYTHON...0...0.pptx
PYTHON...0...0.pptx
 
Where's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind PloneWhere's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind Plone
 
pnwphp - PHPSpec & Behat: Two Testing Tools That Write Code For You
pnwphp - PHPSpec & Behat: Two Testing Tools That Write Code For Youpnwphp - PHPSpec & Behat: Two Testing Tools That Write Code For You
pnwphp - PHPSpec & Behat: Two Testing Tools That Write Code For You
 

Recently uploaded

Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 

Recently uploaded (20)

Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 

Transforming safe html

  • 2. How I started Contributed to Plone  Plone is one of the most frequent organization that is part of Google Summer of Code.  The IRC people really helped a lot during the initial phase.  Awesome Documentation.  Came across the ticket https://dev.plone.org/ticket/14929 proposed by Tom when I was looking for some project and he has also tried to do the changes accordingly but there were lot of constraint of test cases that made it less possible to work on it.
  • 3. Cont..  Plone.transform was a try for the same during GSOC’07.  Finally decided to create a separate project for creating safe html transform using lxml and not of CMF Default.  We also thought about using intelligent text from html transform.  Finally created a new add-on experimental.safe_html_transform.  It uses lxml to filter html.
  • 4. Difficulties working with Plone  Plone is not a piece of cake for anyone new.  The Plone code base is too vast.  Things were alien for 1-2 months.  It was difficult for me to figure out from where to start.  The safe_html of portal_transform is quite old.  It was difficult to understand the code of old html filter which was using CMF Default, SGML Parser.
  • 5. Fun With Plone  Learnt how to work in team.  Learnt a lot of new things related to plone and how awesome plone is.  How to write efficient code and how to document the work that have been done.  Test Driven Development. One of the best part of plone.  Got to interact with cool people.  Got to know about the unique and new beers of Europe.
  • 6. The main aim of the project  This is to be done with CMF Default in Plone and in this project also :-
  • 7. The new safe_Html Filter  Lot of things required to setup the add-on.  Generic setup of the transform.  Register safe_html for the browser.  Add control panel for filter to the browser.  Create interface for filter under browser.  Setup profile for the transform by registering browser layer and control panel under the profile module.  Deregister Profile as to replace the existing one with a transform of the same name, since TinyMCE and p.a.controlpanel address safe_html by it’s Transform name, rather than asking for one MIME to another MIME. (safe_html = getattr(getToolByName(self, 'portal_transforms'), 'safe_html'))
  • 8. Automatic register and deregister for safe_html  Functions for register and deregister of the product.  Register safe_html on the installation of the add on.  Deregistration of the old safe_html from the portal_transform.  when any developer just install safe_html, the old safe_html will deregister and the new safe_html will get registered.  People who are just using plone site will use safe_html by adding an add-on in their “@@overview-controlpanel” and add experimental.safe_html_trasform.  The old safe_html from portal_transform will be deregistered and the new safe_html that add-on one will get registered.
  • 9. Cont..  Codes :-  <genericsetup:registerProfile name="default" title="experimental.safe_html_transform" directory="profiles/default" description="Installs the experimental.safe_html_transform add- on." provides="Products.GenericSetup.interfaces.EXTENSION" />  <genericsetup:registerProfile name="uninstall" title="experimental.safe_html_transform uninstall" directory="profiles/uninstall" description="Uninstalls the experimental.safe_html_transform package" provides="Products.GenericSetup.interfaces.EXTENSION" />
  • 10. New Releases at plone , releases my sweat.  This was the time when CMF Plone 5.0.dev was released.  Not able to detect the issue as where CMF Plone was used as I have already pinned the CMF Plone.  Plone.app.widget was not pinned and that is using CMF Plone so it was creating an error and it took me a lot of time to solve  This was one of the scariest experience of my GSOC project.
  • 11.
  • 12.
  • 13. Getting Control Panel for add-on  Two ways to create Control Panel  Either to overwrite the old cntrol panel of PortalTransform safe_html.  Create a separate control panel for our new safe_html add-on.  I choose the 2nd way to create a control panel and created a separate control panel for the add-on.
  • 14. Cont..  Register the control panel. <!-- Filter Control Panel --> <browser:page name="safe_html_transform-settings" for="Products.CMFPlone.interfaces.IPloneSiteRoot" layer="..interfaces.IExperimentalSafeHtmlTransformLayer" class=".controlpanel.FilterControlPanel" permission="experimental.safe_html.controlpanel.Filtering“ />
  • 15. Cont..  Adding Permissions for control panel <configure xmlns="http://namespaces.zope.org/zope"> <permission id="experimental.safe_html.controlpanel.Filtering" title="Plone Site Setup: Filtering"> <role name="Manager"/> <role name="Site Administrator"/> </permission> </configure>
  • 16. The Transform Finally…  This is the script for filtering safe_html using lxml.  Converting the whole document into the tree form and then parsing each node of the tree anf filtering accordingly.  Used the Cleaner class of lxml for creating Html Filter.  On add-on installation this transform have to filter the HTML instaed of the safe_html transform of Portal_transform.
  • 17. Why we need to port the transform to lxml ?  To remove the CMF Default dependencies.  To make the filtering faster.  To make the filtering accurate and more optimized.
  • 18. Testing the transform  Used Unit test to test the transform.  Using sample HTML to test the transform.  Using Automated Robot test and integration tests for testing the whole add-on.
  • 19.
  • 20. How to make tinyMCE uses our new transform in place of old transform?  It uses getToolByName in portal_transform to get the required transform.  Rename our new transform to safe_html instead of some other name.  we changed the name of our transform same as old one so that tinyMCE sense it like a normal thing and no change. :P
  • 21.
  • 22. Things I learnt during the project  How to work with test driven Development (TDD).  How work in collaboration with people on a project.  How to work on big projects.  How to catch errors from the error logs.  How to keep logs for the huge projects. (Blogging, task managers etc)
  • 23. Plans ahead  Looking forward to learn more about plone  As of right now a lot more to learn, a lot more to develop and a lot more to code.