I want to create a separate db/schema using the TenantAdminService. In the Alfresco SDK I've created a tenant using a four argument method createMethod executed as a init method:
this.tenantAdminService.createTenant(
"aaa.com", // username
"aaa.com".toCharArray(), // password
"D:\\alfresco-solution\\alfresco-dev\\tenants\\aaa.com", // content store
"jdbc:postgresql://localhost:5432/alfresco_aaa" ); // Tenant DB URL (initial empty db)
It creates a new tenant with new content store but the database remains empty. It doesn't replicate/create a schema.
Another issue is that if I execute this in a WebScript it tells me that: Tenant is disabled: aaa.com
Solved! Go to Solution.
At the moment, yes. And I don't know of any plans to change that, given how multi-tenancy will likely be removed from the core of the product in an upcoming version.
The interface TenantAdminService contains the comment
// experimental (unsupported)
public void createTenant(String tenantDomain, char[] adminRawPassword, String contentRoot, String dbUrl);
It is unfortunate that this experimental API has been exposed in a public release. Within the implementation it is stated that the operation expects the schema to be already bootstrapped in the referenced dabase - it will not bootstrap the tables itself. Also, even if the DB were bootstrapped, it would not be used at runtime since the active JDBC data source is not using the DB URL stored for the tenant when creating the actual DB connections.
So actually it doesn't do anything special. It just reference a db and that's all?
At the moment, yes. And I don't know of any plans to change that, given how multi-tenancy will likely be removed from the core of the product in an upcoming version.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.