This chapter describes the process of indicating a skin as the default skin to be used. For t
org.eclipse.stardust.engine.core.spi.preferences.IStaticConfigurationProvider$Factoryservices to the META-INF folder, where you
put the service factoryNow this jar file can be imported in your Portal project as described in section Importing a Skin provided as Plugin Jar of chapter Creating and Using Custom Skins.
The following example implementation shows a configuration that sets a previously designed skin named custom as default skin.
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.stardust.engine.core.spi.preferences.IStaticConfigurationProvider;
public class CustomSkinStaticConfigurationProvider
implements IStaticConfigurationProvider, IStaticConfigurationProvider.Factory
{
private static final IStaticConfigurationProvider INSTANCE = new CustomSkinStaticConfigurationProvider();
public static final String M_PORTAL = "ipp-portal-common";
public static final String V_PORTAL_CONFIG = "configuration";
public static final String F_SKIN = "prefs.skin";
public static final String PREF_ID = "preference";
public static final String CUSTOM_SKIN = "custom";
/**
* Get the moduleId which the static preferences are provided for
*/
public String getModuleId()
{
return M_PORTAL;
}
/**
* lookup default preferences for the specified preferencesId.
*/
public Map getPreferenceDefaults(String preferencesId)
{
Map preferencesDefault = new HashMap<String, String>();
String prefKey = getModuleId() + "." + V_PORTAL_CONFIG + "." + F_SKIN;
preferencesDefault.put(prefKey, CUSTOM_SKIN);
return preferencesDefault;
}
/**
* Get the preferenceIds for which the static configuration provider provides
* preferences for.
*/
public List getPreferenceIds()
{
return Collections.singletonList(PREF_ID);
}
/**
*
*/
public IStaticConfigurationProvider getProvider()
{
return INSTANCE;
}
}
The plugin jar structure could look like the following:
CustomSkinStaticConfigurationProvider.class
META-INF/
MANIFEST.MF
custom
services/
org.eclipse.stardust.engine.core.spi.preferences.IStaticConfigurationProvider$Factory
spring/
plugin-project-context.xml
plugin-projectUi-context.xml
xhtml/
public/
skins/
custom/
images/
custom.css
login.css