Is there a way to rebuild shape table?

Topics: Core, General, Troubleshooting, Writing modules
Developer
Jan 31, 2012 at 10:45 PM

Like in subject - anyone knows how to rebuild the shape table without having to restart the whole application (eg. touching the web.config file to force restart)? Shape table is cached but it looks like there is no easy way to invalidate that cache and force refresh?

Jan 31, 2012 at 11:40 PM

Normally it happens automatically when the file system changes; how are you modifying it without that being the case?

Developer
Feb 1, 2012 at 12:13 AM

Thanks, I know that. But the problem is I need to rebuild it from code, so without any actual changes to the filesystem... I can just touch web.config file to force restarting the whole app, but that looks like an overkill.

01-02-2012 00:40 użytkownik "randompete" <notifications@codeplex.com> napisał:

From: randompete

Normally it happens automatically when the file system changes; how are you modifying it without that being the case?

Read the full discussion online.

To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)

To start a new discussion for this project, email orchard@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com

Coordinator
Feb 1, 2012 at 1:26 AM

Rebuilding the shape table without touching the filesystem ... It's like I already figure what the module is for ;)

Right now there is no way to do this, and by the way, changing the filesystem should restart the host. Which means that if you do it from the admin, it would restart it. But being able to do it programmatically would be an issue in farms too. Do the FS is the best approach

Developer
Feb 1, 2012 at 2:25 AM
And I guess it's exactly what you think it is;)

Ok, I'll go the filesystem way. For the future it would be nice to have a token being monitored inside the shape table-building logic. So we could trigger it using ISignals and force refresh.
I'll open an issue for that. It shouldn't be that much work though - I could provide a patch.

2012/2/1 sebastienros <notifications@codeplex.com>

From: sebastienros

Rebuilding the shape table without touching the filesystem ... It's like I already figure what the module is for ;)

Right now there is no way to do this, and by the way, changing the filesystem should restart the host. Which means that if you do it from the admin, it would restart it. But being able to do it programmatically would be an issue in farms too. Do the FS is the best approach

Read the full discussion online.

To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)

To start a new discussion for this project, email orchard@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com




--
Piotr Szmyd
There's no place like 127.0.0.1...

Feb 1, 2012 at 2:43 AM

If you replaced IShapeTableLocator with your own implementation you could probably do whatever you liked ...

Developer
Feb 1, 2012 at 4:23 AM

Yeah, but it's still the underlying IShapeTableManager that is responsible for caching shape tables. I don't want to replace the manager - it would be too dirty, although it's a solution I also take into account...

Developer
Feb 1, 2012 at 5:59 AM

I created an issue regarding this: http://orchard.codeplex.com/workitem/18400

Coordinator
Feb 1, 2012 at 5:43 PM

You could also add a generic shape to the table, like DynamicShape, which would have all the information of dynamically created shapes, and with the events would morph to the correct shape based on the metadata.

Feb 1, 2012 at 7:10 PM

Piotr - why exactly is it that you need to do this? (Sebastien's last comment made me curious) I'm just wondering if maybe Clay behaviors can help here instead of having to change the shape table implementation...

Developer
Feb 1, 2012 at 10:06 PM

I've finally found some time to finish a module that should be published a while ago:) Allowing users to create shape alternates and new shapes from inside admin screen, without touching .cshtml files.

Those shapes are not being stored in the filesystem, so I have a hard time refreshing the shape table cache after changes are made. It's not impossible though, of course - only slightly problematic;)

Developer
Feb 2, 2012 at 2:55 PM

I found out a way to invalidate the cache. One would have to create a separate IShapeTableProvider and Monitor/Trigger a token inside the Discover method. Tokens are propagated to parents so parent cache entry will get invalidated too if any child entry gets invalidated.

Posted a comment in http://orchard.codeplex.com/workitem/18400