GenericSetup, uninstall and propertiestool object

5 messages Options
Embed this post
Permalink
Francois Barriere () GenericSetup, uninstall and propertiestool object
Reply Threaded More More options
Print post
Permalink
Hello,

   I'm working on a very simple product (Plone 3.1.7) that sub-classes
a standard Archetype content type. This new type must be treated like the
File type and /view must be added to its URL by default. To do so, I have
a profiles/default/propertiestool.xml file that contains the following lines:

<object name="portal_properties" meta_type="Plone Properties Tool">
 <object name="site_properties" meta_type="Plone Property Sheet">
  <property name="typesUseViewActionInListings" type="lines" purge="False">
   <element value="myType"/>
  </property>
 </object>
</object>

This works fine and just adds "myType" to the list of types in the
"typesUseViewActionInListings" list.

I would like to have a clean uninstall for this type. The only way to
get back to the orinal list of type for this property is to create
an uninstall profile with profiles/uninstall/propertiestool.xml that
contains:

<object name="portal_properties" meta_type="Plone Properties Tool">
 <object name="site_properties" meta_type="Plone Property Sheet">
  <property name="typesUseViewActionInListings" type="lines" purge="True">
   <element value="Image"/>
   <element value="File"/>
  </property>
 </object>
</object>

Which hard-codes what should be the original content for the
"typesUseViewActionInListings" list.

Is there a way to remove a line from this list and avoid the
hard-coded list of "what-was-there-before"?

Francois.

--
   Francois BARRIERE                          ATMEL
                                              Zone Industrielle
   Tel: (33) 0 442 53 61 98                   13106 ROUSSET
E-Mail: [hidden email]           FRANCE
                 ---------------------------------
Everyone knows that debugging is twice as hard as writing a program
in the first place. So if you're as clever as you can be when you write it,
how will you ever debug it? (Brian Kernighan)
                 ---------------------------------
Raphael Ritz () Re: GenericSetup, uninstall and propertiestool object
Reply Threaded More More options
Print post
Permalink
Francois Barriere wrote:

[..]

> Which hard-codes what should be the original content for the
> "typesUseViewActionInListings" list.
>
> Is there a way to remove a line from this list and avoid the
> hard-coded list of "what-was-there-before"?

No. Not that I know of at least.

The reason for this is that GS was never intended to support an
uninstall but Plone's quickinstaller offers this nevertheless.

Raphael


>
> Francois.
>


_______________________________________________
Product-Developers mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/product-developers
Jean-Michel FRANCOIS () Re: Re: GenericSetup, uninstall and propertiestool object
Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
setup tool exist to help you setup your app.
portal quick installer also, most of the time developer don't create any uninstall script. But quickinstaller track created object, and if you uninstall just delete them.


In my opinion, don't try to uninstall anything, don't try to install modules on production server except if you know what you are doing. Uninstall is a pain and depends on the integration you have done.


Most of the time, i m starting by installing on a dev instance the product, next i m testing it, next i m reading the code, and finaly if the customer whant its feature i integrate it to the project (i apply the profile of the product, and next apply the integration profile that fix most of wrong configs done by other products)


My wish would be to delete quickinstaller and portal_setup on production server :)


--
Cordialement,
Jean-Michel FRANCOIS
Makina Corpus


Le Wednesday 11 March 2009 08:59:11 Raphael Ritz, vous avez écrit :


> Francois Barriere wrote:
>
> [..]
>
> > Which hard-codes what should be the original content for the
> > "typesUseViewActionInListings" list.
> >
> > Is there a way to remove a line from this list and avoid the
> > hard-coded list of "what-was-there-before"?
>
> No. Not that I know of at least.
>
> The reason for this is that GS was never intended to support an
> uninstall but Plone's quickinstaller offers this nevertheless.
>
> Raphael
>
> > Francois.
>
> _______________________________________________
> Product-Developers mailing list
> [hidden email]
> http://lists.plone.org/mailman/listinfo/product-developers




_______________________________________________
Product-Developers mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/product-developers
Francois Barriere () Re: Re: GenericSetup, uninstall and propertiestool object
Reply Threaded More More options
Print post
Permalink
On Wed, 11 Mar 2009 12:56:16 +0100
JeanMichel FRANCOIS <[hidden email]> wrote:

> setup tool exist to help you setup your app.
> portal quick installer also, most of the time developer don't create any
> uninstall script. But quickinstaller track created object, and if you
> uninstall just delete them.
>

   Yep, but the changes in the properties of an already existing object
   do not seem to be cleaned during uninstall.

> In my opinion, don't try to uninstall anything, don't try to install modules
> on production server except if you know what you are doing. Uninstall is a
> pain and depends on the integration you have done.
>

   My goal was to have a small/simple product to solve a problem that will
   be cleanly solved in a future version of Plone, so i would like to prepare
   the removal of my product without leaving too much crap in the database.

> Most of the time, i m starting by installing on a dev instance the product,
> next i m testing it, next i m reading the code, and finaly if the customer
> whant its feature i integrate it to the project (i apply the profile of the
> product, and next apply the integration profile that fix most of wrong configs
> done by other products)

   But as Plone evolves, some products are no longer necessary, or become
   outdated. So at some points you need to migrate and uninstall old products.
   It's where a clean uninstall helps...

   Anyway, thanks for your help (Raphael and jean-Michel), I finally fixed
   the issue in the Extension/Install.py script and removed the use of GS
   for this part.

Francois.

--
   Francois BARRIERE                          ATMEL
                                              Zone Industrielle
   Tel: (33) 0 442 53 61 98                   13106 ROUSSET
E-Mail: [hidden email]           FRANCE
                 ---------------------------------
Everyone knows that debugging is twice as hard as writing a program
in the first place. So if you're as clever as you can be when you write it,
how will you ever debug it? (Brian Kernighan)
                 ---------------------------------

_______________________________________________
Product-Developers mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/product-developers
spereverde () Re: Re: GenericSetup, uninstall and propertiestool object
Reply Threaded More More options
Print post
Permalink

Just tested this today, but it seems to work just fine:
  <property name="typesUseViewActionInListings" type="lines" purge="False">
    <element value="File" remove="True" />
  </property>

Francois Barriere wrote:
On Wed, 11 Mar 2009 12:56:16 +0100
JeanMichel FRANCOIS <jeanmichel.francois@makina-corpus.com> wrote:

> setup tool exist to help you setup your app.
> portal quick installer also, most of the time developer don't create any
> uninstall script. But quickinstaller track created object, and if you
> uninstall just delete them.
>

   Yep, but the changes in the properties of an already existing object
   do not seem to be cleaned during uninstall.

> In my opinion, don't try to uninstall anything, don't try to install modules
> on production server except if you know what you are doing. Uninstall is a
> pain and depends on the integration you have done.
>

   My goal was to have a small/simple product to solve a problem that will
   be cleanly solved in a future version of Plone, so i would like to prepare
   the removal of my product without leaving too much crap in the database.

> Most of the time, i m starting by installing on a dev instance the product,
> next i m testing it, next i m reading the code, and finaly if the customer
> whant its feature i integrate it to the project (i apply the profile of the
> product, and next apply the integration profile that fix most of wrong configs
> done by other products)

   But as Plone evolves, some products are no longer necessary, or become
   outdated. So at some points you need to migrate and uninstall old products.
   It's where a clean uninstall helps...

   Anyway, thanks for your help (Raphael and jean-Michel), I finally fixed
   the issue in the Extension/Install.py script and removed the use of GS
   for this part.

Francois.

--
   Francois BARRIERE                          ATMEL
                                              Zone Industrielle
   Tel: (33) 0 442 53 61 98                   13106 ROUSSET
E-Mail: francois.barriere@atmel.com           FRANCE
                 ---------------------------------
Everyone knows that debugging is twice as hard as writing a program
in the first place. So if you're as clever as you can be when you write it,
how will you ever debug it? (Brian Kernighan)
                 ---------------------------------

_______________________________________________
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers