portletSkins.add(skinService.merge(portalPortletSkins));
}
//
for (UIPortlet uiPortlet : uiportlets) {
SkinConfig skinConfig = getPortletSkinConfig(uiPortlet);
if (skinConfig == null) {
skinConfig = getDefaultPortletSkinConfig(uiPortlet);
}
if (skinConfig != null && !portalPortletSkins.contains(skinConfig)) {
portletSkins.add(skinConfig);
}
}
// Sort skins by priority
Collections.sort(portletSkins, new Comparator<Skin>() {
public int compare(Skin s1, Skin s2) {
if ((s1 instanceof SkinConfig) && (s2 instanceof SkinConfig)) {
SkinConfig o1 = (SkinConfig)s1;
SkinConfig o2 = (SkinConfig)s2;
if (o1.getCSSPriority() == o2.getCSSPriority())
return 1;// Can indicate others condition here
else if (o1.getCSSPriority() < 0)
return 1;
else if (o2.getCSSPriority() < 0)
return -1;
else
return o1.getCSSPriority() - o2.getCSSPriority();
} else {
return 0;
}
}
});