Nested modules

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
11/1/2012 5:37:38 PM
Gravatar
Total Posts 4

Nested modules

Hello,

firstable I would like to thank you for the amount of great work you did all, and for the lot amout of time I saved thanks to this.

I would like to create a custom feature, but I'd like to be sure to choose the good starting point. I saw some videos, got the code, looked at some implemented features to see where I was going to, and I think am starting to have a good idea of what to do.

But the point is that I want to create a page that displays exactly the same kind of content for each user, with the same structure of modules, but I'd like those modules to be connected to different instances depending on the logged user. For example, say I would like to have a single page home.aspx, displaying a blog and an htmlContent, but the instances displayed should be different depending on the user connected.

As far as I can see, I think I am obligated to create a feature for the structure of my page, and I would insert it on the home.aspx page at the center. This feature would contain other features hard coded, and the outer feature would need to retrieve the inner instances features and do the plumbing job. But I would no be able to use the built in mechanism to arrange the modules in the page since they would be inside an outer module; also, it would not bet very elegant to create a feature just for use in a unique page.

Of course it would be much better to work at the page level : the page would connect the instances to the modules depending on the user, but for this I dont see how to implement that in a way that would not break down the mojoPortal pattern.

Thank you for giving me any idea to do it the best way.

11/1/2012 5:53:21 PM
Gravatar
Total Posts 1196
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Nested modules

What you are talking about sounds very difficult and complicated. Will there be a small set of user categories that will see the same content, or will it be different for every user? If there are not very many user categories, I'd suggest creating a role for each category, and assign the appropriate users to each. Then you can have one page with the instances for each category, and specify that they can only be viewed by the corresponding role. In this case there would be no customization required. Administrator(s) would see and can edit all of the instances for each user group on one page, but users could only see the instances that correspond to their security role.

You can read more about the built-in role security on the Roles and Permissions page.

Hope that helps,

Jamie

11/1/2012 6:28:56 PM
Gravatar
Total Posts 4

Re: Nested modules

Thank you for your reply.

No, there won't be any categories of users seeing the same content (set of instances). They all would see the same page structure but each user would be able to modify its content only, and would be able to see other's content.

The problem here is that I would like to reuse existing features that perfectly match my need, I would like also to use the existing page structure to arrange the features and that match my need too, but I would like to change the mechanism that loads the modules to add to the page ID also the user ID to determine the module instance ID.

May be I could hard code something somewhat ugly at the page level, depending on say the presence of some tag in the page, for example a 'static' feature. If the 'static' feature is present, I would override the load mechanism of the modules, and also the instance creation / modification, so that the instance ID would not depend on the page ID but also of the User ID.

So, step 1 : create a "User dependent page" feature, with no parameters at all, only for tagging purpose.

step 2 : modify the code so that if a page has a "User dependent page" feature instance, it would create/modify/load modules depending on the page Id and the user ID.

Not so difficult, I guess, if I would know where to modify the code. The thing is at the database level, I don't know if it would be possible without change ?

11/1/2012 6:56:40 PM
Gravatar
Total Posts 1196
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Nested modules

It sounds like you may be talking about building a sort of social networking site. If so, you should look at Joe's response to a similar query in these forums before you go any further.

Jamie

11/2/2012 3:51:52 AM
Gravatar
Total Posts 4

Re: Nested modules

It' sounds like but it's not really a social network. All users will be trusted users, so I don't mind to let them maintain a blog.

Thinking a bit more about it, I think I will do something like that : each user would have to be approved.Then at connection time, a special feature inserted in the home page would check the presence of a specific page for the user. If not present, it would be created completely before from a template, at run time.

step1 : create a new feature called "User dependent page". This feature would have some parameters such as :
- template page URL
- page URL prefix

The logic of this feature would be to create a new page from an existing page, with the same module structure, and assign the module instances to be able to be modified by the connected user. The new page URL would be 'page URL prefix' + User ID, and would be a child page of the parent's template page. The creation would occur only if the 'page URL prefix' + User ID would not already exists.

step 2 : create a template page, with any kind of modules structure. This page should not be displayed on the site.

step 3 : insert a "User dependent page" in the home page, targeting this template page.

And voila. It would even be possible to have more than one user dependent page on the site. The big part of the job would be the module duplication because each kind of module target a specific set of data tables, but for this I can use a switch on the feature id and call the specific insert stored procedure.

11/5/2012 1:37:01 PM
Gravatar
Total Posts 18439

Re: Nested modules

None of the features are designed to be nested inside other features, they expect to be in pages and page security is enforced by whether the page contains the feature instance directly.

I would not try to force the existing features in mojoPortal to do what you want. Your needs demand custom features that you develop yourself so that the feature passes in the user id to retrieve user specific data. That is not a scenrario that mojoPortal features were designed for.

11/5/2012 3:07:36 PM
Gravatar
Total Posts 4

Re: Nested modules

I know I am bordeline with this idea but I was hoping the modules to be possibly nested, because the solution using a page template is heavier and demand more work. But since you say that features are expecting page as first container I think will be obligated to do something like that.

You must sign in to post in the forums. This thread is closed to new posts.