GUAC-1378: Add "html" property to manifest.

This commit is contained in:
Michael Jumper
2016-02-19 00:06:49 -08:00
parent c01e8c6a9a
commit 29a071587b
2 changed files with 56 additions and 0 deletions

View File

@@ -89,6 +89,12 @@ public class Extension {
*/ */
private final Map<String, Resource> cssResources; private final Map<String, Resource> cssResources;
/**
* Map of all HTML patch resources defined within the extension, where each
* key is the path to that resource within the extension.
*/
private final Map<String, Resource> htmlResources;
/** /**
* Map of all translation resources defined within the extension, where * Map of all translation resources defined within the extension, where
* each key is the path to that resource within the extension. * each key is the path to that resource within the extension.
@@ -352,6 +358,7 @@ public class Extension {
// Define static resources // Define static resources
cssResources = getClassPathResources("text/css", manifest.getCSSPaths()); cssResources = getClassPathResources("text/css", manifest.getCSSPaths());
javaScriptResources = getClassPathResources("text/javascript", manifest.getJavaScriptPaths()); javaScriptResources = getClassPathResources("text/javascript", manifest.getJavaScriptPaths());
htmlResources = getClassPathResources("text/html", manifest.getHTMLPaths());
translationResources = getClassPathResources("application/json", manifest.getTranslationPaths()); translationResources = getClassPathResources("application/json", manifest.getTranslationPaths());
staticResources = getClassPathResources(manifest.getResourceTypes()); staticResources = getClassPathResources(manifest.getResourceTypes());
@@ -431,6 +438,19 @@ public class Extension {
return cssResources; return cssResources;
} }
/**
* Returns a map of all declared HTML patch resources associated with this
* extension, where the key of each entry in the map is the path to that
* resource within the extension .jar. HTML patch resources are declared
* within the extension manifest.
*
* @return
* All declared HTML patch resources associated with this extension.
*/
public Map<String, Resource> getHTMLResources() {
return htmlResources;
}
/** /**
* Returns a map of all declared translation resources associated with this * Returns a map of all declared translation resources associated with this
* extension, where the key of each entry in the map is the path to that * extension, where the key of each entry in the map is the path to that

View File

@@ -67,6 +67,12 @@ public class ExtensionManifest {
*/ */
private Collection<String> cssPaths; private Collection<String> cssPaths;
/**
* The paths of all HTML patch resources within the .jar of the extension
* associated with this manifest.
*/
private Collection<String> htmlPaths;
/** /**
* The paths of all translation JSON files within this extension, if any. * The paths of all translation JSON files within this extension, if any.
*/ */
@@ -232,6 +238,36 @@ public class ExtensionManifest {
this.cssPaths = cssPaths; this.cssPaths = cssPaths;
} }
/**
* Returns the paths to all HTML patch resources within the extension. These
* paths are defined within the manifest by the "html" property as an array
* of strings, where each string is a path relative to the root of the
* extension .jar.
*
* @return
* A collection of paths to all HTML patch resources within the
* extension.
*/
@JsonProperty("html")
public Collection<String> getHTMLPaths() {
return htmlPaths;
}
/**
* Sets the paths to all HTML patch resources within the extension. These
* paths are defined within the manifest by the "html" property as an array
* of strings, where each string is a path relative to the root of the
* extension .jar.
*
* @param htmlPatchPaths
* A collection of paths to all HTML patch resources within the
* extension.
*/
@JsonProperty("html")
public void setHTMLPaths(Collection<String> htmlPatchPaths) {
this.htmlPaths = htmlPatchPaths;
}
/** /**
* Returns the paths to all translation resources within the extension. * Returns the paths to all translation resources within the extension.
* These paths are defined within the manifest by the "translations" * These paths are defined within the manifest by the "translations"