示例#1
0
文件: Site.java 项目: nuxeo/lm-labs
 @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
文件: Site.java 项目: nuxeo/lm-labs
  @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);
    }
  }