kumarsivarajan / mollify

Automatically exported from code.google.com/p/mollify
0 stars 0 forks source link

After upload need solution to make an entry #588

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Steps before submitting issue:

I would like to modify item_id table for adding more columns like meta data, 
mime ,ext . I am very confused the call request happen on upload and refresh . 
file Data is inserted only after the first request  after the upload success . 
I would like to make this on after upload process .

 Can you idea how I can do this on my own ?

My Mollify version is 2.0-2_2 

Thanks

Original issue reported on code.google.com by psbhara...@gmail.com on 9 Jan 2015 at 12:18

GoogleCodeExporter commented 8 years ago
Item ids are handled by class ItemIdProvider, and it is designed so that it 
creates new id entries whenever it encounters files/folders that don't exist in 
the table. This way files can be added outside Mollify, for example uploading 
via ftp or copying inside server.

Not sure if it's due to your old version, but at least latest version does 
trigger the item id generation already in the upload.

Anyway, the new item id is created in ItemIdProvider function 
getOrCreateItemId, but there you won't have any your own info.

Latest version has events like "create_item", "create_folder", "upload" which 
you could simply listen in your own plugin, and insert your metadata when new 
items are created. I wouldn't extend item_id table for other stuff, like it's 
name says it is about item ids. I'd create separate table "item_metadata" etc 
which would contain all other random stuff, and which would have same lifecycle 
as item ids (for this you could register item id cleanup handler etc).

But unfortunately I cannot give implementation support (only guidance etc) for 
custom features like this, not even for latest version but even less for older 
versions.

Original comment by samuli.j...@gmail.com on 11 Jan 2015 at 8:05

GoogleCodeExporter commented 8 years ago
Thanks for your help. 

Original comment by psbhara...@gmail.com on 12 Jan 2015 at 4:54