SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
Moving an old-style product to Plone 3
    Plone Conference 2008 - Washington D.C.


                      Ricardo Alves
                    rsa@eurotux.com


                      October 27, 2008




    Ricardo Alves rsa@eurotux.com   Moving an old-style product to Plone 3
Contents

Contents




  1   About the Example


  2   Get it to work


  3   Benefit from Plone 3




             Ricardo Alves rsa@eurotux.com    Moving an old-style product to Plone 3
About the Example

TuxLiveFM




  Product
      Add-on for Plone 2.5
      Archetypes-based content types
      Mixin classes
      New portlet
      Skin layers




            Ricardo Alves rsa@eurotux.com     Moving an old-style product to Plone 3
About the Example

TuxLiveFM – Structure

  Products/
      TuxLiveFM/
          Extensions/
              Install.py
          __init__.py
          config.py
          content/
              show.py
              episode.py
              series.py
              __init__.py
          skins/
              tuxfmlive/
                   portlet_lastepisode.pt
                   radioshow_view.pt
                   radioepisode_view.pt
                   tuxlivefm.css.dtml
                   search_episodes.pt
          license.txt
          readme.txt
          version.txt


            Ricardo Alves rsa@eurotux.com     Moving an old-style product to Plone 3
Get it to work

Get it to work




       Fix broken code due to API changes
       (CMFCorePermissions, ...)
       Use GenericSetup for product installation
       Migrate portlets




             Ricardo Alves rsa@eurotux.com      Moving an old-style product to Plone 3
Get it to work

Product Installation


  Define a profile using GenericSetup

  TuxLiveFM/configure.zcml

  <configure
    xmlns=quot;http://namespaces.zope.org/zopequot;
    xmlns:genericsetup=quot;http://namespaces.zope.org/genericsetupquot;
    i18n_domain=quot;TuxLiveFMquot;>

    <genericsetup:registerProfile
      name=quot;tuxlivefmquot;
      title=quot;TuxLiveFMquot;
      directory=quot;profiles/defaultquot;
      description=quot;TuxLiveFM product.quot;
      provides=quot;Products.GenericSetup.interfaces.EXTENSIONquot;
      />

  </configure>


            Ricardo Alves rsa@eurotux.com      Moving an old-style product to Plone 3
Get it to work

Product Installation - Types




  TuxLiveFM/Extensions/Install.py

  ...
        # install types
        classes = listTypes(PROJECT_NAME)
        installTypes(self, out, classes, PROJECT_NAME)
  ...




            Ricardo Alves rsa@eurotux.com      Moving an old-style product to Plone 3
Get it to work

Product Installation - Types




  profiles/default/types.xml

  <?xml version=quot;1.0quot;?>
  <object name=quot;portal_typesquot; meta_type=quot;Plone Types Toolquot;>
  <object name=quot;RadioShowquot;
      meta_type=quot;Factory-based Type Information with dynamic viewsquot;/>
  <object name=quot;RadioEpisodequot;
      meta_type=quot;Factory-based Type Information with dynamic viewsquot;/>
  </object>




            Ricardo Alves rsa@eurotux.com      Moving an old-style product to Plone 3
Get it to work

Product Installation - Types


  profiles/default/types/RadioShow.xml

  <?xml version=quot;1.0quot;?>
  <object name=quot;RadioShowquot;
     meta_type=quot;Factory-based Type Information with dynamic viewsquot;
     i18n:domain=quot;plonequot;
     xmlns:i18n=quot;http://xml.zope.org/namespaces/i18nquot;>
   <property name=quot;titlequot; i18n:translate=quot;quot;>Radio Show</property>
   <property name=quot;descriptionquot;
        i18n:translate=quot;quot;>Describes a Radio Show.</property>
   <property name=quot;content_iconquot;>document_icon.gif</property>
   <property name=quot;content_meta_typequot;>RadioShow</property>
   <property name=quot;productquot;>tuxfm</property>
   <property name=quot;factoryquot;>addRadioShow</property>
   <property name=quot;immediate_viewquot;>base_view</property>
   <property name=quot;global_allowquot;>True</property>
   <property name=quot;filter_content_typesquot;>True</property>
   <property name=quot;allowed_content_typesquot;>
   ...



            Ricardo Alves rsa@eurotux.com      Moving an old-style product to Plone 3
Get it to work

Product Installation - Skins




   TuxLiveFM/Extensions/Install.py

   ...
         # install skins
         install_subskin(self, out, GLOBALS)
   ...




             Ricardo Alves rsa@eurotux.com      Moving an old-style product to Plone 3
Get it to work

Product Installation - Skins



   profiles/default/skins.xml

   <?xml version=quot;1.0quot;?>
   <object name=quot;portal_skinsquot; allow_any=quot;Falsequot;
     cookie_persistence=quot;Falsequot; default_skin=quot;TuxLiveFMquot;>

    <object name=quot;tuxlivefm_templatesquot;
       meta_type=quot;Filesystem Directory Viewquot;
       directory=quot;Products.TuxLiveFm:skins/tuxlivefm_templatesquot;/>

    <skin-path name=quot;TuxLiveFMquot; based-on=quot;Plone Defaultquot;>
     <layer name=quot;tuxlivefm_templatesquot; insert-after=quot;customquot;/>
    </skin-path>

   </object>




               Ricardo Alves rsa@eurotux.com      Moving an old-style product to Plone 3
Get it to work

Product Installation - CSS


  TuxLiveFM/Extensions/Install.py

  ...
        # register stylesheets
        css_tool = getToolByName(self, ’portal_css’)
        stylesheets = css_tool.getResources()
        stylesheet_ids = [x.getId() for x in stylesheets]

        if ’tuxlivefm.css’ not in stylesheet_ids:
            css_tool.registerStylesheet(
                ’tuxlivefm.css’,
                expression=’’,
                media=’screen’,
                rel=’stylesheet’,
                rendering=’import’)
  ...



             Ricardo Alves rsa@eurotux.com      Moving an old-style product to Plone 3
Get it to work

Product Installation - CSS




  profiles/default/cssregistry.xml

  <?xml version=quot;1.0quot;?>
  <object name=quot;portal_cssquot;>

    <stylesheet title=quot;quot; cacheable=quot;Truequot; compression=quot;safequot;
      cookable=quot;Truequot; enabled=quot;1quot; expression=quot;quot;
      id=quot;tuxlivefm.cssquot; media=quot;screenquot; rel=quot;stylesheetquot;
      rendering=quot;importquot;/>

  </object>




              Ricardo Alves rsa@eurotux.com      Moving an old-style product to Plone 3
Get it to work

Migrate portlets




      Convert legacy portlets, or
      Create classic portlet
   <assignment
       manager=quot;plone.rightcolumnquot;
       category=quot;content_typequot;
       key=quot;RadioShowquot;
       type=quot;portlets.Classicquot;>
    <property name=quot;templatequot;>portlet_lastepisode</property>
    <property name=quot;macroquot;>portlet</property>
   </assignment>




            Ricardo Alves rsa@eurotux.com      Moving an old-style product to Plone 3
Benefit from Plone 3

New Components for specialized behavior

      Define interfaces

      class IRadioSeries(Interface):

           def lastEpisodeURL(self):
               quot;quot;quot; Returns the URL of the last episode available.
               quot;quot;quot;

           def searchEpisodes(self, **kwargs):
               quot;quot;quot; Perform search in the available episodes.
               quot;quot;quot;

      Replace mixin class with an adapter
        <adapter factory=quot;.content.series.RadioSeriesquot;
           for=quot;.interfaces.IRadioShowquot;
           provides=quot;.interfaces.IRadioSeriesquot;
           />


             Ricardo Alves rsa@eurotux.com     Moving an old-style product to Plone 3
Benefit from Plone 3

Use browser views




      Add browser view EpisodeSearchView
      Move related methods to the view class.

  class SearchEpisodesView(BrowserView):

      def searchEpisodes(self, **kwargs):
          series = IRadioSeries(self.context)
          return series.searchEpisodes(**kwargs)




           Ricardo Alves rsa@eurotux.com     Moving an old-style product to Plone 3
Benefit from Plone 3

Deprecate old code




      Use zope.deprecation for modules to be removed
      Deprecation period of one or two feature releases
      import zope.deprecation
      zope.deprecation.deprecated(’ShowSeriesMixin’,
      quot;Products.TuxLiveFM.content.series.ShowSeriesMixin has quot;
      quot;been deprecated and will be removed in version 0.3.quot;)

      Move deprecated templates to another layer.




             Ricardo Alves rsa@eurotux.com     Moving an old-style product to Plone 3
Benefit from Plone 3

Use Zope 3 Interfaces with Archetypes



      Define Zope 3 schema interface for content types
      from zope import schema
      ...
      class IRadioShow(Interface):
          body = schema.Text(title=_(u’Body’))
      ...

      Use ATFieldProperty as a bridge from fields to Python properties
      from Products.Archetypes import public as atapi
      ...
          body = atapi.ATFieldProperty(’body’)
      ...




            Ricardo Alves rsa@eurotux.com     Moving an old-style product to Plone 3
Benefit from Plone 3

TuxLiveFM – Structure
  Products/
      TuxLiveFM/
          __init__.py
          config.py
          interfaces.py
          browser/
              search_episodes.py
              search_episodes.pt
          profiles/
              default/
                   types/
                   types.xml
                   skins.xml
                   cssregistry.xml
                   portlets.xml
                   actionicons.xml
          content/
              show.py
              episode.py
              series.py
          skins/
              tuxfmlive/
                   radioshow_view.pt
                   radioepisode_view.pt
                   tuxlivefm.css.dtml
                   portlet_lastepisode.pt
              tuxfmlive_deprecated/
                   search_episodes.pt
          license.txt
          readme.txt
          version.txt

                Ricardo Alves rsa@eurotux.com     Moving an old-style product to Plone 3
Benefit from Plone 3

Eggify the Product




  Use paster to create the package structure:
  paster create -t plone

  Products.TuxLiveFM/
      Products/
           TuxLiveFM/
           ...
      docs
      Products.TuxLiveFM.egg-info/
      setup.cfg
      README.txt
      setup.py




            Ricardo Alves rsa@eurotux.com     Moving an old-style product to Plone 3
Benefit from Plone 3

References




     Plone Upgrade Guide –
     http://plone.org/documentation/manual/
     upgrade-guide/version/2.5-3.0/products
     TuxLiveFM in the collective (soon)




             Ricardo Alves rsa@eurotux.com     Moving an old-style product to Plone 3
Questions

Questions




                      Questions?




            Ricardo Alves rsa@eurotux.com    Moving an old-style product to Plone 3

Más contenido relacionado

Último

A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 

Último (20)

A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Destacado

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Destacado (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Moving an old-style product to Plone 3

  • 1. Moving an old-style product to Plone 3 Plone Conference 2008 - Washington D.C. Ricardo Alves rsa@eurotux.com October 27, 2008 Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 2. Contents Contents 1 About the Example 2 Get it to work 3 Benefit from Plone 3 Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 3. About the Example TuxLiveFM Product Add-on for Plone 2.5 Archetypes-based content types Mixin classes New portlet Skin layers Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 4. About the Example TuxLiveFM – Structure Products/ TuxLiveFM/ Extensions/ Install.py __init__.py config.py content/ show.py episode.py series.py __init__.py skins/ tuxfmlive/ portlet_lastepisode.pt radioshow_view.pt radioepisode_view.pt tuxlivefm.css.dtml search_episodes.pt license.txt readme.txt version.txt Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 5. Get it to work Get it to work Fix broken code due to API changes (CMFCorePermissions, ...) Use GenericSetup for product installation Migrate portlets Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 6. Get it to work Product Installation Define a profile using GenericSetup TuxLiveFM/configure.zcml <configure xmlns=quot;http://namespaces.zope.org/zopequot; xmlns:genericsetup=quot;http://namespaces.zope.org/genericsetupquot; i18n_domain=quot;TuxLiveFMquot;> <genericsetup:registerProfile name=quot;tuxlivefmquot; title=quot;TuxLiveFMquot; directory=quot;profiles/defaultquot; description=quot;TuxLiveFM product.quot; provides=quot;Products.GenericSetup.interfaces.EXTENSIONquot; /> </configure> Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 7. Get it to work Product Installation - Types TuxLiveFM/Extensions/Install.py ... # install types classes = listTypes(PROJECT_NAME) installTypes(self, out, classes, PROJECT_NAME) ... Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 8. Get it to work Product Installation - Types profiles/default/types.xml <?xml version=quot;1.0quot;?> <object name=quot;portal_typesquot; meta_type=quot;Plone Types Toolquot;> <object name=quot;RadioShowquot; meta_type=quot;Factory-based Type Information with dynamic viewsquot;/> <object name=quot;RadioEpisodequot; meta_type=quot;Factory-based Type Information with dynamic viewsquot;/> </object> Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 9. Get it to work Product Installation - Types profiles/default/types/RadioShow.xml <?xml version=quot;1.0quot;?> <object name=quot;RadioShowquot; meta_type=quot;Factory-based Type Information with dynamic viewsquot; i18n:domain=quot;plonequot; xmlns:i18n=quot;http://xml.zope.org/namespaces/i18nquot;> <property name=quot;titlequot; i18n:translate=quot;quot;>Radio Show</property> <property name=quot;descriptionquot; i18n:translate=quot;quot;>Describes a Radio Show.</property> <property name=quot;content_iconquot;>document_icon.gif</property> <property name=quot;content_meta_typequot;>RadioShow</property> <property name=quot;productquot;>tuxfm</property> <property name=quot;factoryquot;>addRadioShow</property> <property name=quot;immediate_viewquot;>base_view</property> <property name=quot;global_allowquot;>True</property> <property name=quot;filter_content_typesquot;>True</property> <property name=quot;allowed_content_typesquot;> ... Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 10. Get it to work Product Installation - Skins TuxLiveFM/Extensions/Install.py ... # install skins install_subskin(self, out, GLOBALS) ... Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 11. Get it to work Product Installation - Skins profiles/default/skins.xml <?xml version=quot;1.0quot;?> <object name=quot;portal_skinsquot; allow_any=quot;Falsequot; cookie_persistence=quot;Falsequot; default_skin=quot;TuxLiveFMquot;> <object name=quot;tuxlivefm_templatesquot; meta_type=quot;Filesystem Directory Viewquot; directory=quot;Products.TuxLiveFm:skins/tuxlivefm_templatesquot;/> <skin-path name=quot;TuxLiveFMquot; based-on=quot;Plone Defaultquot;> <layer name=quot;tuxlivefm_templatesquot; insert-after=quot;customquot;/> </skin-path> </object> Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 12. Get it to work Product Installation - CSS TuxLiveFM/Extensions/Install.py ... # register stylesheets css_tool = getToolByName(self, ’portal_css’) stylesheets = css_tool.getResources() stylesheet_ids = [x.getId() for x in stylesheets] if ’tuxlivefm.css’ not in stylesheet_ids: css_tool.registerStylesheet( ’tuxlivefm.css’, expression=’’, media=’screen’, rel=’stylesheet’, rendering=’import’) ... Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 13. Get it to work Product Installation - CSS profiles/default/cssregistry.xml <?xml version=quot;1.0quot;?> <object name=quot;portal_cssquot;> <stylesheet title=quot;quot; cacheable=quot;Truequot; compression=quot;safequot; cookable=quot;Truequot; enabled=quot;1quot; expression=quot;quot; id=quot;tuxlivefm.cssquot; media=quot;screenquot; rel=quot;stylesheetquot; rendering=quot;importquot;/> </object> Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 14. Get it to work Migrate portlets Convert legacy portlets, or Create classic portlet <assignment manager=quot;plone.rightcolumnquot; category=quot;content_typequot; key=quot;RadioShowquot; type=quot;portlets.Classicquot;> <property name=quot;templatequot;>portlet_lastepisode</property> <property name=quot;macroquot;>portlet</property> </assignment> Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 15. Benefit from Plone 3 New Components for specialized behavior Define interfaces class IRadioSeries(Interface): def lastEpisodeURL(self): quot;quot;quot; Returns the URL of the last episode available. quot;quot;quot; def searchEpisodes(self, **kwargs): quot;quot;quot; Perform search in the available episodes. quot;quot;quot; Replace mixin class with an adapter <adapter factory=quot;.content.series.RadioSeriesquot; for=quot;.interfaces.IRadioShowquot; provides=quot;.interfaces.IRadioSeriesquot; /> Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 16. Benefit from Plone 3 Use browser views Add browser view EpisodeSearchView Move related methods to the view class. class SearchEpisodesView(BrowserView): def searchEpisodes(self, **kwargs): series = IRadioSeries(self.context) return series.searchEpisodes(**kwargs) Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 17. Benefit from Plone 3 Deprecate old code Use zope.deprecation for modules to be removed Deprecation period of one or two feature releases import zope.deprecation zope.deprecation.deprecated(’ShowSeriesMixin’, quot;Products.TuxLiveFM.content.series.ShowSeriesMixin has quot; quot;been deprecated and will be removed in version 0.3.quot;) Move deprecated templates to another layer. Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 18. Benefit from Plone 3 Use Zope 3 Interfaces with Archetypes Define Zope 3 schema interface for content types from zope import schema ... class IRadioShow(Interface): body = schema.Text(title=_(u’Body’)) ... Use ATFieldProperty as a bridge from fields to Python properties from Products.Archetypes import public as atapi ... body = atapi.ATFieldProperty(’body’) ... Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 19. Benefit from Plone 3 TuxLiveFM – Structure Products/ TuxLiveFM/ __init__.py config.py interfaces.py browser/ search_episodes.py search_episodes.pt profiles/ default/ types/ types.xml skins.xml cssregistry.xml portlets.xml actionicons.xml content/ show.py episode.py series.py skins/ tuxfmlive/ radioshow_view.pt radioepisode_view.pt tuxlivefm.css.dtml portlet_lastepisode.pt tuxfmlive_deprecated/ search_episodes.pt license.txt readme.txt version.txt Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 20. Benefit from Plone 3 Eggify the Product Use paster to create the package structure: paster create -t plone Products.TuxLiveFM/ Products/ TuxLiveFM/ ... docs Products.TuxLiveFM.egg-info/ setup.cfg README.txt setup.py Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 21. Benefit from Plone 3 References Plone Upgrade Guide – http://plone.org/documentation/manual/ upgrade-guide/version/2.5-3.0/products TuxLiveFM in the collective (soon) Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3
  • 22. Questions Questions Questions? Ricardo Alves rsa@eurotux.com Moving an old-style product to Plone 3