throws Exception {
String themeId = sitemapJSONObject.getString("themeId");
if (Validator.isNotNull(themeId)) {
Theme theme = ThemeLocalServiceUtil.fetchTheme(companyId, themeId);
if (theme == null) {
themeId = null;
}
}
if (Validator.isNull(themeId)) {
int pos = servletContextName.indexOf("-theme");
if (pos != -1) {
themeId =
servletContextName.substring(0, pos) +
PortletConstants.WAR_SEPARATOR + servletContextName;
themeId = PortalUtil.getJsSafePortletId(themeId);
Theme theme = ThemeLocalServiceUtil.fetchTheme(
companyId, themeId);
if (theme == null) {
themeId = null;
}