Platform platform = PlatformAccess.getPlatform();
PersistenceProvider persistenceService = platform.getPersistenceProvider();
CoreComponentRegistry componentRegistry = platform.getComponentRegistry();
AbstractComponent mySandbox = componentRegistry.newInstance(MineTaxonomyComponent.class.getName());
ComponentInitializer mysandboxCapability = mySandbox.getCapability(ComponentInitializer.class);
mysandboxCapability.setCreator(userId);
mysandboxCapability.setOwner(userId);
mySandbox.setDisplayName("My Sandbox");
AbstractComponent dropbox = componentRegistry.newInstance(TelemetryUserDropBoxComponent.class.getName());
ComponentInitializer dropboxCapability = dropbox.getCapability(ComponentInitializer.class);
dropboxCapability.setCreator("admin");
dropboxCapability.setOwner("*");
dropbox.setDisplayName(userId + "\'s drop box");
persistenceService.addNewUser(userId, disciplineComponent.getDisplayName(), mySandbox, dropbox);
disciplineComponent.componentSaved();
textField.setText(EM_STR);