You can access and change the runtime settings of module properties, as illustrated in the following example:
private void changeModuleSettings(IPortalComponentRequest request) { IModuleContext moduleContext = ModuleHelper.getModuleContext(request); // Get property value String modulePropertyValue = moduleContext.getProperty("propertyID"); // Set property value IWorkspacesRuntime workspacesRuntime = RuntimeFactory.getWorkspacesRuntime(); IModuleSettingsFactory moduleSettingsFactory = (IModuleSettingsFactory)workspacesRuntime.getService(IModuleContextFactory.class); IModuleSettings moduleSettings = moduleSettingsFactory.getModuleSettings(moduleContext); moduleSettings.getModuleProperty("propertyID").setValue("newValue"); moduleSettingsFactory.saveModuleSettings(moduleSettings); // Iterate through all properties IModuleProperty[] moduleProperties = moduleSettings.getModuleProperties(); for(int i=0; imoduleProperties.length; i++) { IModuleProperty moduleProperty = moduleProperties[i]; // Do something } }
Package
The relevant API is contained in the com.sap.workspaces.module.settings.property package.