Can we dynamically create "sub components"


#1

Can we dynamically create “sub components” which use the same component resources but different base paths.

Example: Basepath: localhost:5555/shop/x localhost:5555/shop/y localhost:5555/shop/z Use: localhost:5555/shop


#2

Hi ardi and welcome to the community.

You can create subcomponents, or using Scipio terminology, a single component with multiple webapps mounted on the same base path (mount-point). If I remember correctly, they cannot be loaded dynamically OOTB. I’d have to investigate further in order to give you a proper answer.

Btw, if you can share, what’s exactly the reason of doing this? is it for multi-language store where each path corresponds to a language? or more like a marketplace? if so, there may be different alternatives to achieve that.


#3

Hi,

i guess we could think of it as a multi-language store or say a marketplace where we could dynamically create new marketplaces with a new basepath as the above example, localhost:5555/shop/ardi or localhost:5555/shop/minifreak for example all using the initial component localhost:5555/shop and what changes inside is say the themes, the data this marketplace has.


#4

I think that a multi-language store is a simpler scenario. It could be done by having a single store connected to multiple websites so each website would define the custom path for its corresponding language (also themes, etc.)

One the other hand, a marketplace is a bit trickier and there are several ways to achieve that. A simple one could be having multiple stores connected to a single website, then create path aliases. Note that you may need some minor datamodel changes here, like linking the WebSitePathAlias entity to the ProductStore entity. Than could be done by just extending the WebSitePathAlias or just adding a new entity that links both.


#5

Can we have something like session based urls, when we have groups of users (eg. group-m1, group-m2)which can login on specific urls (localhost/shop/group-m1, localhost/shop/group-m2), while if trying to switch from m1 to m2 it requires to login again, having in mind that every other request map should be added after it. I don’t want to go with components cause that means that I have to duplicate directories even though the logic is pretty much the same (98%) and it can’t be done dynamically.


#6

Hi ardi,

and welcome to the community. If you understand correctly, you’d like to create an app in which people sign up for a paid marketplace service and get to create their own online stores, correct?

If so, technically the foundation is there, but you’d have to build the application yourself. Over at ilscipio we built a few stores like this in the past and usually create a new component in which customers access their account and then a modified version of the shop that would better fit the needs.

Jonatan is correct that in your registration form, you’d then want to also create a few editional configurations per account (like the website entry, which then determines the path a store is mapped to). But you will still need to implement this on your own, as it will be a specific form of shop-in-shop setup you are trying to achieve here.


#7

When the user logs in for example in shop component, can we add a path keyword which is related to the user(not same for all users) (example: /ardi) to the basepath (example: localhost:5555/shop) so we link the user to the new “basepath” (localhost:5555/shop/ardi) and every page (request) they visit(do) we add the path component ( localhost:5555/shop/ardi/somerequest)


#8

You could build that, yes, but it is not built-in to the software out of the box.

I would suggest that you add a filter to the shop’s web.xml. Then you can control the requests a bit better. Internally it would all be forwards to the appropriate screens.


#9

If you bind stores to paths (requires customization), users (customers) can belong to only those stores, so once they login will be redirected to their corresponding store. Not sure if that is what you really mean though, I mean, that wouldn’t make any sense if customers are supposed to browse all the stores catalogs.