Exemplo n.º 1
0
 /**
  * Gets the wallpaper of the specified space. If the space or one of its parent have no specific
  * wallpaper set, then returns the default one.
  *
  * @see SilverpeasLook#getWallpaperOfSpace(java.lang.String)
  * @param spaceId the identifier of the space.
  * @return the URL of the wallpaper image or the default one if the space or its parents have no
  *     wallpaper.
  */
 public String getWallpaperOfSpaceOrDefaultOne(String spaceId) {
   String wallpaperURL = getWallpaperOfSpace(spaceId);
   if (!isDefined(wallpaperURL)) {
     GraphicElementFactory elementFactory =
         new GraphicElementFactory(GraphicElementFactory.defaultLookName);
     wallpaperURL = elementFactory.getIcon(DEFAULT_WALLPAPER_PROPERTY);
     if (!isDefined(wallpaperURL)) {
       wallpaperURL =
           FileServerUtils.getApplicationContext()
               + "/admin/jsp/icons/silverpeasV5/bandeauTop.jpg";
     }
   }
   return wallpaperURL;
 }
 /**
  * Method declaration
  *
  * @return
  * @see
  */
 public String getIconsPath() {
   /*
    * if (iconsPath == null) { ResourceLocator generalSettings = new
    * ResourceLocator("com.stratelia.webactiv.general", "fr"); iconsPath =
    * generalSettings.getString("ApplicationURL") +
    * GraphicElementFactory.getSettings().getString("IconsPath"); } return iconsPath;
    */
   return GraphicElementFactory.getIconsPath();
 }
  public String getContextualDiv() {
    String spaceIds = "";
    String componentId = gef.getComponentId();
    OrganizationController oc = gef.getMainSessionController().getOrganizationController();
    if (StringUtil.isDefined(componentId)) {
      List<SpaceInst> spaces = oc.getSpacePathToComponent(componentId);

      for (SpaceInst spaceInst : spaces) {
        String spaceId = spaceInst.getId();
        if (!spaceId.startsWith("WA")) {
          spaceId = "WA" + spaceId;
        }
        spaceIds += spaceId + " ";
      }
    }

    if (StringUtil.isDefined(spaceIds)) {
      ComponentInstLight component = oc.getComponentInstLight(componentId);
      return "<div class=\"" + spaceIds + component.getName() + " " + componentId + "\">";
    }
    return null;
  }
Exemplo n.º 4
0
 public String getCSSOfSpaceLook(String spaceId) {
   List<SpaceInst> path = organizationController.getSpacePath(spaceId);
   Collections.reverse(path);
   String cssURL = null;
   for (SpaceInst space : path) {
     if (StringUtil.isDefined(space.getLook())) {
       cssURL = GraphicElementFactory.getCSSOfLook(space.getLook());
     }
     if (StringUtil.isDefined(cssURL)) {
       break;
     }
   }
   return cssURL;
 }
  static {
    String iconsPath = GraphicElementFactory.getIconsPath();
    StringBuilder buffer = new StringBuilder();
    buffer.append("<td>\n");
    buffer.append("<table border=0 cellspacing=0 cellpadding=0>\n");
    buffer.append("<tr>\n");
    buffer
        .append("<td colspan=3 rowspan=3><img src=\"")
        .append(iconsPath)
        .append("/tabs/bt2_hg.gif\"></td>\n");
    buffer
        .append("<td bgcolor=#999999><img src=\"")
        .append(iconsPath)
        .append("/tabs/1px.gif\"></td>\n");
    buffer
        .append("<td colspan=3 rowspan=3><img src=\"")
        .append(iconsPath)
        .append("/tabs/bt2_hd.gif\"></td>\n");
    buffer.append("</tr>\n");
    buffer.append("<tr>\n");
    buffer
        .append("<td bgcolor=#FFFFFF width=1><img src=\"")
        .append(iconsPath)
        .append("/tabs/1px.gif\"></td>\n");
    buffer.append("</tr>\n");
    buffer.append("<tr>\n");
    buffer
        .append("<td class=ongletColorLight><img src=\"")
        .append(iconsPath)
        .append("/tabs/1px.gif\"></td>\n");
    buffer.append("</tr>\n");
    buffer.append("<tr>\n");
    buffer
        .append("<td bgcolor=#666666><img src=\"")
        .append(iconsPath)
        .append("/tabs/1px.gif\"></td>\n");
    buffer
        .append("<td bgcolor=#CCCCCC><img src=\"")
        .append(iconsPath)
        .append("/tabs/1px.gif\"></td>\n");
    buffer
        .append("<td class=ongletColorLight><img src=\"")
        .append(iconsPath)
        .append("/tabs/1px.gif\"></td>\n");
    printBeforeString = buffer.toString();

    buffer = new StringBuilder();
    buffer
        .append("<td class=ongletColorDark><img src=\"")
        .append(iconsPath)
        .append("/tabs/1px.gif\"></td>\n");
    buffer
        .append("<td bgcolor=#666666><img src=\"")
        .append(iconsPath)
        .append("/tabs/1px.gif\"></td>\n");
    buffer
        .append("<td bgcolor=#000000><img src=\"")
        .append(iconsPath)
        .append("/tabs/1px.gif\"></td>\n");
    buffer.append("</tr>\n");
    buffer.append("</table>\n");
    buffer.append("</td>\n");
    printAfterString = buffer.toString();

    buffer = new StringBuilder();
    buffer.append("<table width=\"100%\" border=0 cellspacing=0 cellpadding=0>\n");
    buffer.append("<tr>\n<td class=\"intfdcolor6\">\n");
    buffer.append("<img src=\"").append(iconsPath);
    buffer.append("/tabs/1px.gif\" width=\"1\" height=\"3\"></td>\n");
    buffer.append("</tr>\n");
    buffer.append("<tr>\n<td>\n");
    buffer.append("<img src=\"").append(iconsPath);
    buffer.append("/tabs/1px.gif\" width=\"1\" height=\"6\"></td>\n");
    buffer.append("</tr>\n");
    buffer.append("</table>\n");
    printEndString = buffer.toString();
  }