Пример #1
0
 @Path("@currenttheme")
 public Object doGetCurrentTheme() {
   try {
     CoreSession session = ctx.getCoreSession();
     SiteTheme theme = site.getThemeManager().getTheme(session);
     return newObject(Docs.SITETHEME.type(), site, theme);
   } catch (ClientException e) {
     throw new WebResourceNotFoundException("Theme not found", e);
   }
 }
Пример #2
0
  @Path("@theme/{themeName}")
  public Object doGetTheme(@PathParam("themeName") String themeName) {
    try {
      CoreSession session = ctx.getCoreSession();
      SiteThemeManager tm = site.getThemeManager();
      SiteTheme theme = tm.getTheme(themeName, session);
      if (theme == null) {
        // This creates the default theme if not found
        theme = tm.getTheme(session);
      }

      return newObject(Docs.SITETHEME.type(), site, theme);
    } catch (ClientException e) {
      throw new WebResourceNotFoundException("Theme not found", e);
    }
  }