Exemplo n.º 1
0
 /**
  * Gets a unique fileName for a sample.
  *
  * @param style
  * @return
  */
 private String getSampleFileName(StyleInfo style) {
   String prefix = "";
   if (style.getWorkspace() != null) {
     prefix = style.getWorkspace().getName() + "_";
   }
   String fileName = prefix + style.getName() + "." + DEFAULT_SAMPLE_FORMAT;
   return fileName;
 }
Exemplo n.º 2
0
 /**
  * Gets an SLD resource for the given style.
  *
  * @param style
  * @return
  */
 private Resource getStyleResource(StyleInfo style) {
   String[] prefix = new String[0];
   if (style.getWorkspace() != null) {
     prefix = new String[] {"workspaces", style.getWorkspace().getName()};
   }
   String fileName = style.getFilename();
   String[] pathParts = (String[]) ArrayUtils.addAll(prefix, new String[] {"styles", fileName});
   String path = Paths.path(pathParts);
   return loader.get(path);
 }
Exemplo n.º 3
0
 /**
  * Gets a unique name for a style, considering the workspace definition, in the form
  * worspacename:stylename (or stylename if the style is global).
  *
  * @param styleInfo
  * @return
  */
 private String getStyleName(StyleInfo styleInfo) {
   return styleInfo.getWorkspace() != null
       ? (styleInfo.getWorkspace().getName() + ":" + styleInfo.getName())
       : styleInfo.getName();
 }