Alain Hernandez Lopez | 1 Jun 03:41 2007
Picon

Problem with Thread

Hello  
My problem is the fallowing one, I have a called tool PST, which has an
instance of a thread, that is to say, it creates a thread in his
constructor and starts the thread. Now, when zope is restarted and it
rises, thread remain like slept, So that it doesn't do what it must do. 
My question is,   
Exists some mechanism or event, so that when the Zope begins, you can
say to the thread, hey you wake up.

Greetings Alain
Excuse my English 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Alain Hernandez Lopez | 1 Jun 04:37 2007
Picon

(no subject)

Hello 

My problem is the following one, I have two products, KC and PST. The KC is a BaseFolder which is compose by a called content type DownloadedDocument. The PST is a tool which has a thread that after making several tasks has the responsibility to create the objects DownloadedDocument in product KC, from a list previously obtained. For create objects DownloadedDocument, I have implemented the method manage_addDownloadedDocument which I show next. All march ok until arrives at the instruction _setObject (you go, obj), where sends the fallowing error to me: ConnectionStateError: Shouldn't load state for 0x014765 when the connection is c losed.  Perfectly it creates the objects but when he treat to save it in the zope database (to make it persistent) fails, and I don't know what I have to do to fix this problem. Please if somebody has some idea of how I can fix this, and it can help me.

 

This is the code of the method

def manage_addDownloadedDocument(self, id,title="",text="", REQUEST=None):

 

    """

 

    This is our factory function and creates

 

    an empty DownloadedDocument object

 

    """

 

    #Calls the JMBoring constructor

 

    obj = DownloadedDocument(id,title,text)

 

    #Associates the boringObj with the given id

 

    #and makes it persist on the ZMI

 

    self._setObject(id, obj)

 

   

Greetings Alain

Excuse my English

 

 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers
Alain Hernandez Lopez | 1 Jun 04:38 2007
Picon

Problem with manage_add method

Hello 

My problem is the following one, I have two products, KC and PST. The KC is a BaseFolder which is compose by a called content type DownloadedDocument. The PST is a tool which has a thread that after making several tasks has the responsibility to create the objects DownloadedDocument in product KC, from a list previously obtained. For create objects DownloadedDocument, I have implemented the method manage_addDownloadedDocument which I show next. All march ok until arrives at the instruction _setObject (you go, obj), where sends the fallowing error to me: ConnectionStateError: Shouldn't load state for 0x014765 when the connection is c losed.  Perfectly it creates the objects but when he treat to save it in the zope database (to make it persistent) fails, and I don't know what I have to do to fix this problem. Please if somebody has some idea of how I can fix this, and it can help me.

 

This is the code of the method

def manage_addDownloadedDocument(self, id,title="",text="", REQUEST=None):

 

    """

 

    This is our factory function and creates

 

    an empty DownloadedDocument object

 

    """

 

    #Calls the JMBoring constructor

 

    obj = DownloadedDocument(id,title,text)

 

    #Associates the boringObj with the given id

 

    #and makes it persist on the ZMI

 

    self._setObject(id, obj)

 

   

Greetings Alain

Excuse my English

 

 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers
Laurence Rowe | 1 Jun 05:44 2007
Picon

Re: Google Gears is out

Alexander Limi wrote:
> …somebody want to add support for offline Plone access? ;)
> 
> http://gears.google.com/
> 
> For more info on how it works:
> http://code.google.com/support/bin/answer.py?answer=69200&topic=11629
> 

Well... here's a first attempt.

     https://svn.plone.org/svn/collective/plonegears/trunk

Install the google gears extxension in your browser first. Tested with 
Plone 3.0 svn. Put it in your Products directory. Requires simplejson 
library. Quick install. Click take offline in the user menu. Switch to 
work offline. Edit tab should now be be accessable, though it is missing 
some resources.

Laurence

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Plone-developers mailing list
Plone-developers <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-developers
Duncan Booth | 1 Jun 10:15 2007
X-Face
Picon

Re: Google Gears is out

Justizin <justizin@...> wrote:
> We'll need a much richer AJAX interface before we can pretend to use
> something like this with any level of triviality.  Let me know when
> Plone3 returns to moving in the direction of asynchronous content view
> loading.
> 
I'm sorry, but I disagree completely with that. However it is probably 
just down to a different idea of what an offline Plone would look like, 
so I'll describe how I think such a beast might work.

There are at least two basic use scenarios:

The simple(?) one is letting people select part of the Plone site to be 
browsable offline. That ought to be fairly straightforward within gears. 
There should be some browsable view where you can select pages or 
complete folders to be available offline, and some mechanism (i.e. 
another screen) for telling gears to go and synchronise (in the 
background) the offline content with the current site.

When browsing offline the skin probably wants a few changes which I 
expect could be done by substituting some of the css and maybe 
javascript. For example a lot of actions in the standard skin would 
simply be hidden and you wouldn't want any AJAX functionality since you 
won't have a server with which to interact. Otherwise it's a glorified 
cache.

The harder one is editing offline. For that I would discard the Plone 
skin entirely. Gears gives you a sql database, so the initial setup 
would download your content schemata and set up tables based to store 
fields for each content type. I'd use the same screens I suggested above 
to select parts of the site to be made available offline to let you 
specify which areas you want to be able to edit. I'd imagine you would 
select at most a very small section to be editable and a more of the 
site to be browsable.

The edit screen I imagine to be a very simple table layout of titles and 
fields but preferably with a click-to-edit interface rather than a form. 
You'ld have a limited set of widgets, and I'd imagine that not all 
fields would be editable offline: e.g. a picklist where the vocabulary 
was generated dynamically wouldn't be editable, but one with a static 
vocabulary would. Probably non-editable fields would store a local copy 
of the displayed value but not let you edit it.

There would probably also be limitations on which content types could be 
handled offline: I expect that any complex content types would require 
custom handling.

When a field is edited the new value is saved in the local database (but 
the downloaded value has to be kept also). You wouldn't be able to see 
your edits in the Plone skin (viewing the page would show you the 
original version but with a warning message on the page saying that it 
is out of date).

New content could also be created offline in the same way: a very plain 
interface based on the schema

When you go online, your edits would be uploaded. There has to be some 
scheme to handle conflicts: either the Lotus Notes way of creating a 
duplicate content object marked as a conflict, or a 3-way merge with 
conflicts flagged. The synchronisation screen would show you conflicted 
pages and give you some means to resolve the conflicts.

In summary, Plone (or a Plone product) would need to grow a mechanism 
for delivering the content as fields and for synchronising changes, but 
the simpler and less scripting there is in the Plone UI the easier 
something like this would be.

On a slightly different note, I'm wondering whether kupu (a future 
version, not kupu 1.4) can leverage Gears (with simple and clean 
degradation for users who don't have Gears installed).

I haven't checked yet whether the file capture functions let you bypass 
the need for a server roundtrip to get at file contents, but if it does 
them it may be possible to offer an 'insert file' button to insert html 
off the local disc. 'insert image' could let you select a local image 
also without having to think of it as a separate 'upload' stage. That 
might require some changes server-side: it would be nice to have a 
general mechanism where you could upload images or files simply by 
adding some fields to an ordinary edit-form submission and have the 
content type decide whether to store them internally (if it is a 
composite document type), or externally (for ordinary pages).

Other things kupu might do if Gears is present could include regular 
local saves, and possibly a non-broken undo/redo. Then if IE were to 
crash the next time you visited the page you could be offered recovery 
of your edits.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Maurits van Rees | 1 Jun 12:36 2007
Picon

Re: Problem with Thread

Alain Hernandez Lopez, on 2007-06-01:
> Hello  
> My problem is the fallowing one, I have a called tool PST, which has an
> instance of a thread, that is to say, it creates a thread in his
> constructor and starts the thread. Now, when zope is restarted and it
> rises, thread remain like slept, So that it doesn't do what it must do. 
> My question is,   
> Exists some mechanism or event, so that when the Zope begins, you can
> say to the thread, hey you wake up.
>
> Greetings Alain
> Excuse my English 

Two thoughts:

- zope.app.appsetup defines some events that might helpt here, like
  IProcessStartingEvent.  I have not used those myself though.

- When zope starts up, the __init__.py of all products is called.  So
  you could put some code in there that takes care of this.

Hm, I wonder if this gets harder to do well when there are multiple
Plone sites in your Zope instance.

--

-- 
Maurits van Rees | http://maurits.vanrees.org/ [NL]
            Work | http://zestsoftware.nl/
"Do not worry about your difficulties in computers,
 I can assure you mine are still greater."

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Reinout van Rees | 1 Jun 13:12 2007

Re: plone.org improvements

Maurits van Rees wrote:
> Justizin, on 2007-05-30:
>> On 5/30/07, Maurits van Rees wrote:
>>> But it *is* GS-aware! :)  See:
>>>
>>> CacheSetup/less profiles/default/cachesettings.xml
>>>
>>> Ah, but that is only on trunk and not in the CacheSetup that is in the
>>> Plone 2.5.3 tarball.
>>>
>> Ah, I keep forgetting that.  trunk needs testing.
> 
> Some of Zest's clients are happily using it with Plone 2.5.  No
> complaints.  Needs Zope 2.9.6 or higher to function properly I
> believe, but Plone 2.5.3 already recommends 2.9.7.

It is not really the head of trunk, though, what we're using:

CacheSetup -r37140 
https://svn.plone.org/svn/collective/CacheFu/CacheSetup/trunk

In later versions of cachesetup, some plone 2.5-incompatible imports are 
being done without fallback. We fixed up most/all of them on the 
sorrento sprint branches of the various products.

Would it be OK to move over the sorrento changes to trunk? Then it could 
become a 1.1 version that works on 2.5 and, mostly, 3.0. The imports 
were changed, but no other 2.5-incompatible work was done, iirc.

Reinout

--

-- 
Reinout van Rees  - Programmer at http://zestsoftware.nl/
http://vanrees.org/weblog/     mailto:reinout@...
"White space, the opposite of black hole?" -- Joris slob

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Martin Aspeli | 1 Jun 13:50 2007
Picon
Picon

Re: Problem with Thread


Maurits van Rees-3 wrote:
> 
> Alain Hernandez Lopez, on 2007-06-01:
>> Hello  
>> My problem is the fallowing one, I have a called tool PST, which has an
>> instance of a thread, that is to say, it creates a thread in his
>> constructor and starts the thread. Now, when zope is restarted and it
>> rises, thread remain like slept, So that it doesn't do what it must do. 
>> My question is,   
>> Exists some mechanism or event, so that when the Zope begins, you can
>> say to the thread, hey you wake up.
>>
>> Greetings Alain
>> Excuse my English 
> 
> Two thoughts:
> 
> - zope.app.appsetup defines some events that might helpt here, like
>   IProcessStartingEvent.  I have not used those myself though.
> 
> - When zope starts up, the __init__.py of all products is called.  So
>   you could put some code in there that takes care of this.
> 
> Hm, I wonder if this gets harder to do well when there are multiple
> Plone sites in your Zope instance.
> 

Please don't use this list for this type of question - use plone-users
instead.

Martin

--

-- 
View this message in context: http://www.nabble.com/Problem-with-Thread-tf3849840s6745.html#a10911422
Sent from the Core Developers mailing list archive at Nabble.com.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Joscha Krutzki | 1 Jun 14:10 2007
Picon

Opendocument transformation with Sax or lxml/XSLT?

Hi,

I'm working on the GSOC Opendocument import/index/preview project. I can use Sax  or lxml / XSLT for this, I prefer lxml  / XSLT but would like to hear your opinion:

Sax:
 
+ fast, less memory consumption
+ only Python

lxml and XSLT

+ reusable XSLT Transformation
+ is useful for other things too
- new dependency (it could replace elementree)


Greetings Joscha

--
Joscha Krutzki
Adalbertstr. 73
10997 Berlin
030/63226730
0179/7466360
[ Link zur Vcard: http://jokasis.de/Joscha_Krutzki.vcf ]
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers
Viðar Svansson | 1 Jun 14:21 2007
Picon

Ideas for my GSoC project

Hi Plone developers,

My name is Vidar Svansson and I am one of Plone's Google Summer of Code students. My project is Genesis, the next code generator, mentored by Reinout van Rees. First of all I just want to thank you all for the opportunity and thanks for all the help I have received already. You can reach me on #plone under the nick 'pjesi'.

I have been studying ArchGenXML and how we could improve the usability and functionality. One of my problems though is that I only have rough idea how the ideal generated code should look like for Plone 3.0-3.5. If anyone wants to come up with suggestions on this then I would love to listen.

I have some ideas on the generator which I would love to get some feedback on regarding the model editing. It seems to me that the UML tools are not the perfect fit for the content types and the result is a lot of "hacky" stereotypes and tagged values. Example such as state machines can only be associated with one class and interfaces can't have attributes just to name a couple. My idea is that perhaps we could use our own model editor which is specialised for Plone/Zope development.

Now this might sound extremely complex task, but actually there is quite a lot of tool support for this kind of editors.

The Eclipse Graphical Modeling Framework (GMF) [1] allows you to define your own graphical modeling editor based on your metamodel inside Eclipse. This implies that you could only draw models that represent valid products and automatic validation can be provided. Eclipse would then replace the UML editor you are currently using, and you could generate the code inside the IDE as well so the entire development could take place within Eclipse (or the generated product edited using external editor for those who like).

The openArchitectureWare's Xtext [2] is another framework which can parse textual models based on the metamodel. This could be python-ish abstraction of the product which expresses the same thing as its graphical equivalent. The great thing about this is that experienced user could be up and running with a product super fast as he can type a lot faster than he can draw. The biggest advantage of this representation is that it is super easy to version it. Diffing and merging of XML is no fun and almost impossible. Having simple text artifacts makes versioning of models super easy. It might also be easy to include some custom code inside the model.

The two above could then be transformed from one to the other, so the textual version could be versioned but the graphical version actually used to edit it, for example.

For those who prefer the good old UML tools, then UML profiles can also be used to map to the metamodel, making it completely transparent to them.

Since everything can be based on the same metamodel, the same generator can be used for all representations. The metamodel is written in the Eclipse Modeling Framework (EMF) [3].

I am aware that many developers would not like to use Eclipse. However, it does not need to be used as a IDE but rather just as the modeling tool. The generator could still be invoked from the command line.

If you have any feedback on how you would like to develop your models in the futures, or think I am out of my mind :) then please let me know. I would love to hear about what kind of improvements from AGX you would like to see as well.

Cheers,
Vidar

[1] http://www.eclipse.org/gmf
[2] http://www.eclipse.org/gmt/oaw
[3] http://www.eclipse.org/emf

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Plone-developers mailing list
Plone-developers@...
https://lists.sourceforge.net/lists/listinfo/plone-developers

Gmane