SlideShare a Scribd company logo

cornerstone.soup Lighning Talk on Plone Conference 2009

shows how to use cornerstone.soup, a lightweight mass-data storage inside zodb for zope2 and plone

1 of 10
Download to read offline
Plone Conference 2009
                         Budapest
                    Lightning Talk

    cornerstone.soup
     isolated container
   for queryable records

Jens Klein <jens@bluedynamics.com>

           2010-10-29
                           Creative Commons Namensnennung-
                           Keine kommerzielle Nutzung-
                           Keine Bearbeitung 3.0 Österreich Lizenz
Use-Cases

Need Container for many entities (mass-data)
of non-CMSish content, like:
    –   Votes,
    –   Data from a Poll,
    –   Orders in a Webshop,
    –   measuring data,
    –   (fill in your use-case here)


tested with Plone 3.3

                                        Creative Commons Namensnennung-
                                        Keine kommerzielle Nutzung-
                                        Keine Bearbeitung 3.0 Österreich Lizenz
Soup Characteristics

●   isolated: all in one persistent local utility;
●   stores generic „Records“:
        –   persistent items
        –   with attributes passed in at construction time as
             keyword arguments.
●   has its own local index (ZopeToolKit);
●   fetches items by query.



                                                Creative Commons Namensnennung-
                                                Keine kommerzielle Nutzung-
                                                Keine Bearbeitung 3.0 Österreich Lizenz
Recipe
                               Cook your own Soup
Heat editor in a large soucepan, subclass the soup      1
object and give it an appropriate id:

  >>> from cornerstone.soup import Soup
  >>> class MySoup(Soup):
  ...     id = u'mysoup'




                                             Creative Commons Namensnennung-
                                             Keine kommerzielle Nutzung-
                                             Keine Bearbeitung 3.0 Österreich Lizenz
Recipe
                               Cook your own Soup
Provide a Catalog Factory and cook for 2-3 minutes, until 2
softened but not colored.

  >>>   from zope.interface import implements
  >>>   from zope.catalog.catalog import Catalog
  >>>   from zope.catalog.field import FieldIndex
  >>>   from cornerstone.soup.interfaces import ICatalogFactory
  >>>   class MyCatalogFactory(object):
  ...       implements(ICatalogFactory)
  ...
  ...       def __call__(self):
  ...           catalog = Catalog()
  ...           catalog[u'name'] = FieldIndex(field_name='name',
  ...                                      field_callable=False)
  ...           return catalog



                                                Creative Commons Namensnennung-
                                                Keine kommerzielle Nutzung-
                                                Keine Bearbeitung 3.0 Österreich Lizenz
Recipe
                                Cook your own Soup
Add one utility registered under the same name as      3
the soup-id, stirring, for 20 seconds:

  <utility
     name="mysoup"
     factory=".mymodule.MyCatalogFactory"
     provides="cornerstone.soup.interfaces.ICatalogFactory"
  />




                                               Creative Commons Namensnennung-
                                               Keine kommerzielle Nutzung-
                                               Keine Bearbeitung 3.0 Österreich Lizenz

Recommended

Ausfallsichere Kultur mit Plone
Ausfallsichere Kultur mit PloneAusfallsichere Kultur mit Plone
Ausfallsichere Kultur mit PloneJens Klein
 
FISE Integration with Python and Plone
FISE Integration with Python and PloneFISE Integration with Python and Plone
FISE Integration with Python and PloneJens Klein
 
Plone is so semantic, isn't it?
Plone is so semantic,  isn't it?Plone is so semantic,  isn't it?
Plone is so semantic, isn't it?Jens Klein
 
YAFOWIL - Webformulare in Python ohne Kopfschmerzen
YAFOWIL - Webformulare in Python ohne KopfschmerzenYAFOWIL - Webformulare in Python ohne Kopfschmerzen
YAFOWIL - Webformulare in Python ohne KopfschmerzenJens Klein
 
Schlangenhochzeit in-der Wolke - Pyramid auf Google Appengine
Schlangenhochzeit in-der Wolke - Pyramid auf Google AppengineSchlangenhochzeit in-der Wolke - Pyramid auf Google Appengine
Schlangenhochzeit in-der Wolke - Pyramid auf Google AppengineJens Klein
 
Big Fat FastPlone - Scale up, speed up
Big Fat FastPlone - Scale up, speed upBig Fat FastPlone - Scale up, speed up
Big Fat FastPlone - Scale up, speed upJens Klein
 
Was ist Plone?
Was ist Plone?Was ist Plone?
Was ist Plone?Jens Klein
 

More Related Content

More from Jens Klein

RelStorage Plone Zope RDB Storage Backend
RelStorage Plone Zope RDB Storage BackendRelStorage Plone Zope RDB Storage Backend
RelStorage Plone Zope RDB Storage BackendJens Klein
 
Plone Performance, Profiling, Power-Consumption
Plone Performance, Profiling, Power-ConsumptionPlone Performance, Profiling, Power-Consumption
Plone Performance, Profiling, Power-ConsumptionJens Klein
 
RelStorage - an alternative ZODB Backend
RelStorage - an alternative ZODB BackendRelStorage - an alternative ZODB Backend
RelStorage - an alternative ZODB BackendJens Klein
 
AGX - Tree Transformations with Python - Lightning Talk at Plone Conference 2009
AGX - Tree Transformations with Python - Lightning Talk at Plone Conference 2009AGX - Tree Transformations with Python - Lightning Talk at Plone Conference 2009
AGX - Tree Transformations with Python - Lightning Talk at Plone Conference 2009Jens Klein
 
Projekte mit Plone
Projekte mit PloneProjekte mit Plone
Projekte mit PloneJens Klein
 
Plone - Community, Entwicklung, Support
Plone - Community, Entwicklung, SupportPlone - Community, Entwicklung, Support
Plone - Community, Entwicklung, SupportJens Klein
 
Plone Conference 2007 Naples: Lightning Talk Daidalos
Plone Conference 2007 Naples: Lightning Talk DaidalosPlone Conference 2007 Naples: Lightning Talk Daidalos
Plone Conference 2007 Naples: Lightning Talk DaidalosJens Klein
 

More from Jens Klein (7)

RelStorage Plone Zope RDB Storage Backend
RelStorage Plone Zope RDB Storage BackendRelStorage Plone Zope RDB Storage Backend
RelStorage Plone Zope RDB Storage Backend
 
Plone Performance, Profiling, Power-Consumption
Plone Performance, Profiling, Power-ConsumptionPlone Performance, Profiling, Power-Consumption
Plone Performance, Profiling, Power-Consumption
 
RelStorage - an alternative ZODB Backend
RelStorage - an alternative ZODB BackendRelStorage - an alternative ZODB Backend
RelStorage - an alternative ZODB Backend
 
AGX - Tree Transformations with Python - Lightning Talk at Plone Conference 2009
AGX - Tree Transformations with Python - Lightning Talk at Plone Conference 2009AGX - Tree Transformations with Python - Lightning Talk at Plone Conference 2009
AGX - Tree Transformations with Python - Lightning Talk at Plone Conference 2009
 
Projekte mit Plone
Projekte mit PloneProjekte mit Plone
Projekte mit Plone
 
Plone - Community, Entwicklung, Support
Plone - Community, Entwicklung, SupportPlone - Community, Entwicklung, Support
Plone - Community, Entwicklung, Support
 
Plone Conference 2007 Naples: Lightning Talk Daidalos
Plone Conference 2007 Naples: Lightning Talk DaidalosPlone Conference 2007 Naples: Lightning Talk Daidalos
Plone Conference 2007 Naples: Lightning Talk Daidalos
 

Recently uploaded

Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17Ana-Maria Mihalceanu
 
Leveraging SLF4j for Effective Logging in IBM App Connect Enterprise.docx
Leveraging SLF4j for Effective Logging in IBM App Connect Enterprise.docxLeveraging SLF4j for Effective Logging in IBM App Connect Enterprise.docx
Leveraging SLF4j for Effective Logging in IBM App Connect Enterprise.docxVotarikari Shravan
 
Act Like an Owner, Challenge Like a VC by former CPO, Tripadvisor
Act Like an Owner,  Challenge Like a VC by former CPO, TripadvisorAct Like an Owner,  Challenge Like a VC by former CPO, Tripadvisor
Act Like an Owner, Challenge Like a VC by former CPO, TripadvisorProduct School
 
The Future of Product, by Founder & CEO, Product School
The Future of Product, by Founder & CEO, Product SchoolThe Future of Product, by Founder & CEO, Product School
The Future of Product, by Founder & CEO, Product SchoolProduct School
 
Pragmatic UI testing with Compose Semantics.pdf
Pragmatic UI testing with Compose Semantics.pdfPragmatic UI testing with Compose Semantics.pdf
Pragmatic UI testing with Compose Semantics.pdfinfogdgmi
 
Enterprise Architecture As Strategy - Book Review
Enterprise Architecture As Strategy - Book ReviewEnterprise Architecture As Strategy - Book Review
Enterprise Architecture As Strategy - Book ReviewAshraf Fouad
 
"The Transformative Power of AI and Open Challenges" by Dr. Manish Gupta, Google
"The Transformative Power of AI and Open Challenges" by Dr. Manish Gupta, Google"The Transformative Power of AI and Open Challenges" by Dr. Manish Gupta, Google
"The Transformative Power of AI and Open Challenges" by Dr. Manish Gupta, GoogleISPMAIndia
 
Building Bridges: Merging RPA Processes, UiPath Apps, and Data Service to bu...
Building Bridges:  Merging RPA Processes, UiPath Apps, and Data Service to bu...Building Bridges:  Merging RPA Processes, UiPath Apps, and Data Service to bu...
Building Bridges: Merging RPA Processes, UiPath Apps, and Data Service to bu...DianaGray10
 
LF Energy Webinar: Introduction to TROLIE
LF Energy Webinar: Introduction to TROLIELF Energy Webinar: Introduction to TROLIE
LF Energy Webinar: Introduction to TROLIEDanBrown980551
 
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...Product School
 
How to write an effective Cyber Incident Response Plan
How to write an effective Cyber Incident Response PlanHow to write an effective Cyber Incident Response Plan
How to write an effective Cyber Incident Response PlanDatabarracks
 
Artificial Intelligence, Design, and More-than-Human Justice
Artificial Intelligence, Design, and More-than-Human JusticeArtificial Intelligence, Design, and More-than-Human Justice
Artificial Intelligence, Design, and More-than-Human JusticeJosh Gellers
 
"How we created an SRE team in Temabit as a part of FOZZY Group in conditions...
"How we created an SRE team in Temabit as a part of FOZZY Group in conditions..."How we created an SRE team in Temabit as a part of FOZZY Group in conditions...
"How we created an SRE team in Temabit as a part of FOZZY Group in conditions...Fwdays
 
Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24
Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24
Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24Umar Saif
 
Relationship Counselling: From Disjointed Features to Product-First Thinking ...
Relationship Counselling: From Disjointed Features to Product-First Thinking ...Relationship Counselling: From Disjointed Features to Product-First Thinking ...
Relationship Counselling: From Disjointed Features to Product-First Thinking ...Product School
 
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...Product School
 
Power of 2024 - WITforce Odyssey.pptx.pdf
Power of 2024 - WITforce Odyssey.pptx.pdfPower of 2024 - WITforce Odyssey.pptx.pdf
Power of 2024 - WITforce Odyssey.pptx.pdfkatalinjordans1
 
AI MODELS USAGE IN FINTECH PRODUCTS: PM APPROACH & BEST PRACTICES by Kasthuri...
AI MODELS USAGE IN FINTECH PRODUCTS: PM APPROACH & BEST PRACTICES by Kasthuri...AI MODELS USAGE IN FINTECH PRODUCTS: PM APPROACH & BEST PRACTICES by Kasthuri...
AI MODELS USAGE IN FINTECH PRODUCTS: PM APPROACH & BEST PRACTICES by Kasthuri...ISPMAIndia
 
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...Product School
 

Recently uploaded (20)

Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
 
Leveraging SLF4j for Effective Logging in IBM App Connect Enterprise.docx
Leveraging SLF4j for Effective Logging in IBM App Connect Enterprise.docxLeveraging SLF4j for Effective Logging in IBM App Connect Enterprise.docx
Leveraging SLF4j for Effective Logging in IBM App Connect Enterprise.docx
 
Act Like an Owner, Challenge Like a VC by former CPO, Tripadvisor
Act Like an Owner,  Challenge Like a VC by former CPO, TripadvisorAct Like an Owner,  Challenge Like a VC by former CPO, Tripadvisor
Act Like an Owner, Challenge Like a VC by former CPO, Tripadvisor
 
The Future of Product, by Founder & CEO, Product School
The Future of Product, by Founder & CEO, Product SchoolThe Future of Product, by Founder & CEO, Product School
The Future of Product, by Founder & CEO, Product School
 
Pragmatic UI testing with Compose Semantics.pdf
Pragmatic UI testing with Compose Semantics.pdfPragmatic UI testing with Compose Semantics.pdf
Pragmatic UI testing with Compose Semantics.pdf
 
Enterprise Architecture As Strategy - Book Review
Enterprise Architecture As Strategy - Book ReviewEnterprise Architecture As Strategy - Book Review
Enterprise Architecture As Strategy - Book Review
 
"The Transformative Power of AI and Open Challenges" by Dr. Manish Gupta, Google
"The Transformative Power of AI and Open Challenges" by Dr. Manish Gupta, Google"The Transformative Power of AI and Open Challenges" by Dr. Manish Gupta, Google
"The Transformative Power of AI and Open Challenges" by Dr. Manish Gupta, Google
 
Building Bridges: Merging RPA Processes, UiPath Apps, and Data Service to bu...
Building Bridges:  Merging RPA Processes, UiPath Apps, and Data Service to bu...Building Bridges:  Merging RPA Processes, UiPath Apps, and Data Service to bu...
Building Bridges: Merging RPA Processes, UiPath Apps, and Data Service to bu...
 
LF Energy Webinar: Introduction to TROLIE
LF Energy Webinar: Introduction to TROLIELF Energy Webinar: Introduction to TROLIE
LF Energy Webinar: Introduction to TROLIE
 
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
Harnessing the Power of GenAI for Exceptional Product Outcomes by Booking.com...
 
How to write an effective Cyber Incident Response Plan
How to write an effective Cyber Incident Response PlanHow to write an effective Cyber Incident Response Plan
How to write an effective Cyber Incident Response Plan
 
Artificial Intelligence, Design, and More-than-Human Justice
Artificial Intelligence, Design, and More-than-Human JusticeArtificial Intelligence, Design, and More-than-Human Justice
Artificial Intelligence, Design, and More-than-Human Justice
 
"How we created an SRE team in Temabit as a part of FOZZY Group in conditions...
"How we created an SRE team in Temabit as a part of FOZZY Group in conditions..."How we created an SRE team in Temabit as a part of FOZZY Group in conditions...
"How we created an SRE team in Temabit as a part of FOZZY Group in conditions...
 
Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24
Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24
Progress Report: Ministry of IT under Dr. Umar Saif Aug 23-Feb'24
 
Relationship Counselling: From Disjointed Features to Product-First Thinking ...
Relationship Counselling: From Disjointed Features to Product-First Thinking ...Relationship Counselling: From Disjointed Features to Product-First Thinking ...
Relationship Counselling: From Disjointed Features to Product-First Thinking ...
 
In sharing we trust. Taking advantage of a diverse consortium to build a tran...
In sharing we trust. Taking advantage of a diverse consortium to build a tran...In sharing we trust. Taking advantage of a diverse consortium to build a tran...
In sharing we trust. Taking advantage of a diverse consortium to build a tran...
 
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
Synergy in Leadership and Product Excellence: A Blueprint for Growth by CPO, ...
 
Power of 2024 - WITforce Odyssey.pptx.pdf
Power of 2024 - WITforce Odyssey.pptx.pdfPower of 2024 - WITforce Odyssey.pptx.pdf
Power of 2024 - WITforce Odyssey.pptx.pdf
 
AI MODELS USAGE IN FINTECH PRODUCTS: PM APPROACH & BEST PRACTICES by Kasthuri...
AI MODELS USAGE IN FINTECH PRODUCTS: PM APPROACH & BEST PRACTICES by Kasthuri...AI MODELS USAGE IN FINTECH PRODUCTS: PM APPROACH & BEST PRACTICES by Kasthuri...
AI MODELS USAGE IN FINTECH PRODUCTS: PM APPROACH & BEST PRACTICES by Kasthuri...
 
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
Cultivating Entrepreneurial Mindset in Product Management: Strategies for Suc...
 

cornerstone.soup Lighning Talk on Plone Conference 2009

  • 1. Plone Conference 2009 Budapest Lightning Talk cornerstone.soup isolated container for queryable records Jens Klein <jens@bluedynamics.com> 2010-10-29 Creative Commons Namensnennung- Keine kommerzielle Nutzung- Keine Bearbeitung 3.0 Österreich Lizenz
  • 2. Use-Cases Need Container for many entities (mass-data) of non-CMSish content, like: – Votes, – Data from a Poll, – Orders in a Webshop, – measuring data, – (fill in your use-case here) tested with Plone 3.3 Creative Commons Namensnennung- Keine kommerzielle Nutzung- Keine Bearbeitung 3.0 Österreich Lizenz
  • 3. Soup Characteristics ● isolated: all in one persistent local utility; ● stores generic „Records“: – persistent items – with attributes passed in at construction time as keyword arguments. ● has its own local index (ZopeToolKit); ● fetches items by query. Creative Commons Namensnennung- Keine kommerzielle Nutzung- Keine Bearbeitung 3.0 Österreich Lizenz
  • 4. Recipe Cook your own Soup Heat editor in a large soucepan, subclass the soup 1 object and give it an appropriate id: >>> from cornerstone.soup import Soup >>> class MySoup(Soup): ... id = u'mysoup' Creative Commons Namensnennung- Keine kommerzielle Nutzung- Keine Bearbeitung 3.0 Österreich Lizenz
  • 5. Recipe Cook your own Soup Provide a Catalog Factory and cook for 2-3 minutes, until 2 softened but not colored. >>> from zope.interface import implements >>> from zope.catalog.catalog import Catalog >>> from zope.catalog.field import FieldIndex >>> from cornerstone.soup.interfaces import ICatalogFactory >>> class MyCatalogFactory(object): ... implements(ICatalogFactory) ... ... def __call__(self): ... catalog = Catalog() ... catalog[u'name'] = FieldIndex(field_name='name', ... field_callable=False) ... return catalog Creative Commons Namensnennung- Keine kommerzielle Nutzung- Keine Bearbeitung 3.0 Österreich Lizenz
  • 6. Recipe Cook your own Soup Add one utility registered under the same name as 3 the soup-id, stirring, for 20 seconds: <utility name="mysoup" factory=".mymodule.MyCatalogFactory" provides="cornerstone.soup.interfaces.ICatalogFactory" /> Creative Commons Namensnennung- Keine kommerzielle Nutzung- Keine Bearbeitung 3.0 Österreich Lizenz
  • 7. Recipe Cook your own Soup 4 Add two local utilities to componentregistry.xml registered under the same name as the soup-id, and bring to boil. <utilities> <utility name="mysoup" factory="mymodule.MySoup" interface="cornerstone.soup.interfaces.ISoup" /> <utility name="mysoup" factory="five.intid.intid.OFSIntIds" interface="zope.app.intid.interfaces.IIntIds" /> </utilities> Creative Commons Namensnennung- Keine kommerzielle Nutzung- Keine Bearbeitung 3.0 Österreich Lizenz
  • 8. Recipe Cook your own Soup Start your Plone, turn heat to low, cover and 5 simmer for some minutes. Go to portal_setup and import your packages GenericSetup profile. Season and add a little more data if desired. >>> from zope.component import getUtility >>> from cornerstone.soup.interfaces import ISoup >>> soup = getUtility(ISoup, name=u'mysoup') >>> from cornerstone.soup import Record >>> rec = Record(name=u'rec1') >>> soup.add(rec) >>> rec = Record(name=u'rec2') >>> soup.add(rec) Creative Commons Namensnennung- Keine kommerzielle Nutzung- Keine Bearbeitung 3.0 Österreich Lizenz
  • 9. Enjoy your soup bon appetit! Query data: >>> soup.query(name=u'rec1') [<Record at /.../record-0>] >>> soup.query(name=u'rec2') [<Record at /.../record-1>] Modify data: >>> rec.data['name'] = u'rec1' >>> soup.reindex([rec]) >>> soup.query(name=u'rec1') [<Record at /.../record-0>, <Record at /.../record-1>] Creative Commons Namensnennung- Keine kommerzielle Nutzung- Keine Bearbeitung 3.0 Österreich Lizenz
  • 10. Ingredients and complete recipe http://pypi.python.org/pypi/cornerstone.soup Creative Commons Namensnennung- Keine kommerzielle Nutzung- Keine Bearbeitung 3.0 Österreich Lizenz