Move allowed_addables functionality to Silva Folders

Bug #101103 reported by Jan-Wijbrand Kolman
12
Affects Status Importance Assigned to Milestone
Silva
Fix Released
Wishlist
Andy Altepeter

Bug Description

The restriction for allowed addables currently can be set on Silva Publications.
Sometimes it is useful to alos restrict addables on a Silva Folder basis.

Tags: silva-future
Kit Blake (kitblake)
Changed in silva:
importance: Low → Wishlist
Revision history for this message
Andy Altepeter (aaltepet) wrote :

it this something you want to do?

Changed in silva:
assignee: nobody → kitblake
Revision history for this message
Kit Blake (kitblake) wrote :

This request goes back to 2004 and I don't recall it being repeated since then. I suppose it depends on our long term thinking for the difference between publications and folders. If we steadily migrate publication functionality into folders, eventually the only difference will be the transparency in the SMI. And we could make a setting where a editor could say, this folder should be transparent, this one not. We could even show a different icon (which is the main advantage to having two container types, you know a publication is not transparent).

What do other people think?

Revision history for this message
Eric Casteleijn (thisfred) wrote :

Less code is good, let content types is good, so I'm all for getting rid of publications, and having a transparency setting. I suppose we'd have to check with silva-dev and silva-general though: people may have built other functionality that *does* depend on this distinction.

Revision history for this message
Eric Casteleijn (thisfred) wrote :

But that's a longer term comment and not really answering Andy's question: I don't think there's any reason not to move the allowed_addables functionality today, it will only make things less confusing, and the abovementioned steps easier.

Revision history for this message
Andy Altepeter (aaltepet) wrote :

This was a quick and easy change -- update macro_middlegroup.pt, so the button displays for all container types, and move the stuff in Silva/views/edit/Container/Publication up one level.

Now, there is nothing in views/edit/Container/Publication.

This change was made in the Silva trunk.

Changed in silva:
milestone: none → 2.2
status: Confirmed → Fix Committed
Revision history for this message
Kit Blake (kitblake) wrote :

A simple test shows this working, unassigning.

Changed in silva:
assignee: kitblake → nobody
Revision history for this message
Kit Blake (kitblake) wrote :

Spoke too soon. If, in a Silva root, I create a subfolder, then when I edit the addables in the subfolder it seems to work. However, when I return to the root, I find the same settings. So it seems that, even though I'm in a subfolder, I'm actually editing the addables of the parent root or publication. Can you reproduce this?

Changed in silva:
assignee: nobody → aaltepet
status: Fix Committed → In Progress
Revision history for this message
Andy Altepeter (aaltepet) wrote :

Drat, this is going to be more work than I originally thought, and also require an upgrader.

Three methods: get_silva_addables_allowed_in_publication and is_silva_addables_acquired and set_silva_addables_allowed_in_publication, and _addables_allowed_in_publication all need to be moved to the Folder class.

I would recommend changing their names, replacing 'publication' with 'container'. This means the upgrader needs to:
1) change _addables_allowed_in_publication to end in '_container' for any IPublication (including the SilvaRoot and possible SilvaNewsPublications, perhaps others?)
2) add _addables_allowed_in_container to all other containers

I'll work in an upgrader for this.

Revision history for this message
Kit Blake (kitblake) wrote :

Remember that this was only a 'nice to have feature'. Nobody has actually requested it. If we weren't doing an upgrade anyway (for 2.2, right?) I'd say let's can the idea and rollback the moved templates. That's certainly easy.

Revision history for this message
Andy Altepeter (aaltepet) wrote :

The allowed addables api has been moved to Folder, with the api methods changing from having 'publication' to 'container' in the method names. An upgrader is provided in upgrade_220.py to bring all IContainers in line with this change, the tests in test_addables have been updated, as well as the addables adapter.

Changed in silva:
status: In Progress → Fix Committed
Changed in silva:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.