Fixed Konfigurationsprobleme bei themedirector, download default theme files nun möglich.
git-svn-id: https://svn.libreccm.org/ccm/trunk@1663 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
95cfddd23e
commit
56e687b58e
|
|
@ -117,10 +117,11 @@ com.arsdigita.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCat
|
|||
|
||||
|
||||
# ccm-themedirector application
|
||||
themedirector.default_theme_context=
|
||||
# themedirector.default_theme_manifest=ccm-zes-aplaws.web.mf
|
||||
# Required to point to the package containing the theme to copy from when creating
|
||||
# a new theme! (In addition to default_theme_path. Otherwise no files are copied!
|
||||
themedirector.default_theme_manifest=ccm-bundle.web.mf
|
||||
# Required to denote the dir containing the default theme!
|
||||
themedirector.default_theme_path=themes/static/aplaws-generic
|
||||
themedirector.file_extensions=bmp css gif jpeg jpg js png xml xsl
|
||||
|
||||
|
||||
# ccm-bundle (Loader only)
|
||||
|
|
|
|||
|
|
@ -118,10 +118,11 @@ com.arsdigita.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCat
|
|||
|
||||
|
||||
# ccm-themedirector application
|
||||
themedirector.default_theme_context=
|
||||
# themedirector.default_theme_manifest=ccm-zes-aplaws.web.mf
|
||||
# Required to point to the package containing the theme to copy from when creating
|
||||
# a new theme! (In addition to default_theme_path. Otherwise no files are copied!
|
||||
themedirector.default_theme_manifest=ccm-bundle.web.mf
|
||||
# Required to denote the dir containing the default theme!
|
||||
themedirector.default_theme_path=themes/static/aplaws-generic
|
||||
themedirector.file_extensions=bmp css gif jpeg jpg js png xml xsl
|
||||
|
||||
|
||||
# ccm-bundle (Loader only)
|
||||
|
|
|
|||
|
|
@ -133,8 +133,10 @@ com.arsdigita.london.subsite.root_category_picker=com.arsdigita.london.terms.ui.
|
|||
|
||||
|
||||
# ccm-themedirector application
|
||||
themedirector.default_theme_path=themes/static/aplaws
|
||||
# themedirector.default_theme_manifest=ccm-zes-aplaws.web.mf
|
||||
# Required to point to the package containing the theme to copy from when creating
|
||||
# a new theme! (In addition to default_theme_path. Otherwise no files are copied!
|
||||
themedirector.default_theme_manifest=ccm-ldn-aplaws.web.mf
|
||||
# Required to denote the dir containing the default theme!
|
||||
themedirector.default_theme_path=themes/static/aplaws
|
||||
|
||||
# ccm-auth-http application
|
||||
|
|
|
|||
|
|
@ -133,8 +133,10 @@ com.arsdigita.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCat
|
|||
|
||||
|
||||
# ccm-themedirector application
|
||||
themedirector.default_theme_context=
|
||||
# themedirector.default_theme_manifest=ccm-zes-aplaws.web.mf
|
||||
# Required to point to the package containing the theme to copy from when creating
|
||||
# a new theme! (In addition to default_theme_path. Otherwise no files are copied!
|
||||
themedirector.default_theme_manifest=ccm-ldn-aplaws.web.mf
|
||||
# Required to denote the dir containing the default theme!
|
||||
themedirector.default_theme_path=themes/static/aplaws
|
||||
|
||||
# ccm-auth-http application
|
||||
|
|
|
|||
|
|
@ -132,8 +132,10 @@ com.arsdigita.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCat
|
|||
|
||||
|
||||
# ccm-themedirector application
|
||||
themedirector.default_theme_context=
|
||||
# themedirector.default_theme_manifest=ccm-zes-aplaws.web.mf
|
||||
# Required to point to the package containing the theme to copy from when creating
|
||||
# a new theme! (In addition to default_theme_path. Otherwise no files are copied!
|
||||
themedirector.default_theme_manifest=ccm-ldn-aplaws.web.mf
|
||||
# Required to denote the dir containing the default theme!
|
||||
themedirector.default_theme_path=themes/static/aplaws
|
||||
|
||||
# ccm-auth-http application
|
||||
|
|
|
|||
|
|
@ -126,8 +126,10 @@ com.arsdigita.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCat
|
|||
|
||||
|
||||
# ccm-themedirector application
|
||||
themedirector.default_theme_context=
|
||||
# themedirector.default_theme_manifest=ccm-zes-aplaws.web.mf
|
||||
# Required to point to the package containing the theme to copy from when creating
|
||||
# a new theme! (In addition to default_theme_path. Otherwise no files are copied!
|
||||
themedirector.default_theme_manifest=ccm-ldn-aplaws.web.mf
|
||||
# Required to denote the dir containing the default theme!
|
||||
themedirector.default_theme_path=themes/static/aplaws
|
||||
|
||||
# ccm-auth-http application
|
||||
|
|
|
|||
|
|
@ -131,8 +131,10 @@ com.arsdigita.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCat
|
|||
|
||||
|
||||
# ccm-themedirector application
|
||||
themedirector.default_theme_context=
|
||||
# themedirector.default_theme_manifest=ccm-zes-aplaws.web.mf
|
||||
# Required to point to the package containing the theme to copy from when creating
|
||||
# a new theme! (In addition to default_theme_path. Otherwise no files are copied!
|
||||
themedirector.default_theme_manifest=ccm-ldn-aplaws.web.mf
|
||||
# Required to denote the dir containing the default theme!
|
||||
themedirector.default_theme_path=themes/static/aplaws
|
||||
|
||||
# ccm-auth-http application
|
||||
|
|
|
|||
|
|
@ -64,13 +64,20 @@ public class ThemeDirectorConfig extends AbstractConfig {
|
|||
}
|
||||
|
||||
// set of configuration parameters
|
||||
// /////////////////////////////////////////////////////////////////
|
||||
|
||||
/** Directory that all of the default themes are copied from. */
|
||||
private final Parameter m_defaultThemePath =
|
||||
new StringParameter
|
||||
("themedirector.default_theme_path",
|
||||
Parameter.OPTIONAL, "/themes/master/");
|
||||
|
||||
/** Servlet context path containing the theme. */
|
||||
/** Servlet context path containing the default theme.
|
||||
Previously ccm-themedirector used to be installed in its own
|
||||
web context. In this case the appropriate web context should
|
||||
be specified.
|
||||
Currently, it is installed as part of the main application,
|
||||
therefore it is empty by default. */
|
||||
private final Parameter m_defaultThemeContext =
|
||||
new StringParameter
|
||||
("themedirector.default_theme_context",
|
||||
|
|
@ -79,7 +86,7 @@ public class ThemeDirectorConfig extends AbstractConfig {
|
|||
|
||||
/** File containing the default themes directory. Used in conjuntion with
|
||||
com.arsdigita.themedirectory.default_directory_filter to dictate the
|
||||
final default directoroy. */
|
||||
final default directory. */
|
||||
private final Parameter m_defaultThemeManifest =
|
||||
new StringParameter
|
||||
("themedirector.default_theme_manifest",
|
||||
|
|
|
|||
|
|
@ -137,30 +137,30 @@ public class ThemeDownloadServlet extends BaseServlet implements ThemeDirectorCo
|
|||
DispatcherHelper.maybeCacheDisable(sresp);
|
||||
sresp.setContentType("application/zip; charset=UTF-8");
|
||||
|
||||
// The WebAppRoot should be something like this:
|
||||
// /var/ccm-devel/web/<username>/<projectname>/webapps/ccm-ldn-theme;
|
||||
// and we actually want the webapps directory
|
||||
File currentRoot = new File(Web.getServletContext().getRealPath("/"));
|
||||
File webapps = currentRoot.getParentFile();
|
||||
// Want the path in the filesystem to webcontext of this application
|
||||
// (i.e. context root / document root)
|
||||
File applicationRoot = new File(Web.getServletContext().getRealPath("/"));
|
||||
|
||||
// if we have a Theme, we send back either prod or dev, depending on
|
||||
// the url. If we don't have a theme, then we return everything.
|
||||
if (theme != null) {
|
||||
File downloadFiles = null;
|
||||
String prefix = null;
|
||||
// if we have a Theme, we send back either prod or dev, depending on
|
||||
// the url.
|
||||
File downloadFiles = null; // Path to the actual theme to download
|
||||
String prefix = null; // Wether devel or prod
|
||||
// If "themes-prod" is ever moved to a different directory,
|
||||
// we could then get rid of the "type" argument (see below in
|
||||
// DirectoryFilter)
|
||||
String type = null;
|
||||
// Determine the path, dependet of devel / prod
|
||||
if (sreq.getPathInfo().indexOf("/" + PUBLISHED_PREFIX) > -1) {
|
||||
prefix = PUBLISHED_PREFIX;
|
||||
downloadFiles = new File(currentRoot, PROD_THEMES_BASE_DIR);
|
||||
downloadFiles = new File(applicationRoot, PROD_THEMES_BASE_DIR);
|
||||
type = PROD_DIR_STUB;
|
||||
} else {
|
||||
downloadFiles = new File(currentRoot, DEV_THEMES_BASE_DIR);
|
||||
downloadFiles = new File(applicationRoot, DEV_THEMES_BASE_DIR);
|
||||
prefix = DEVELOPMENT_PREFIX;
|
||||
type = DEV_DIR_STUB;
|
||||
}
|
||||
|
||||
sresp.setHeader("Content-Disposition",
|
||||
"attachment; filename=\"" + prefix + theme.getURL() +
|
||||
".zip\"");
|
||||
|
|
@ -170,12 +170,19 @@ public class ThemeDownloadServlet extends BaseServlet implements ThemeDirectorCo
|
|||
Files.listFilesInTree(downloadFiles,
|
||||
new DirectoryFilter(theme.getURL(), type)),
|
||||
downloadFiles);
|
||||
|
||||
} else if (theme == null) {
|
||||
// we have to create our own config becuase no other
|
||||
// If we don't have a theme, then we return everything (i.e. the
|
||||
// web tree of each module installed).
|
||||
|
||||
// Get a list of all installed packages by querying
|
||||
// registry.properties from registry.
|
||||
// We have to create our own config instance because no other
|
||||
// classes provide access to one
|
||||
RegistryConfig rc = new RegistryConfig();
|
||||
rc.load();
|
||||
String[] packages = rc.getPackages();
|
||||
|
||||
ClassLoader loader = Thread.currentThread().getContextClassLoader();
|
||||
|
||||
sresp.setHeader("Content-Disposition",
|
||||
|
|
@ -191,18 +198,16 @@ public class ThemeDownloadServlet extends BaseServlet implements ThemeDirectorCo
|
|||
new ZipWriterManifestReader(is, out, current,
|
||||
packages[i]);
|
||||
reader.setFileName(packages[i]);
|
||||
reader.processFile();
|
||||
reader.processFile(); // 2012-05 (PB): Doesn't work!
|
||||
} else {
|
||||
s_log.warn("Unable to open up resource " + current);
|
||||
}
|
||||
}
|
||||
|
||||
// Special case add the auto-generated XSL fiel for content types
|
||||
// Special case add the auto-generated XSL file for content types
|
||||
Iterator paths = ContentType.getXSLFileURLs();
|
||||
out.putNextEntry(new ZipEntry("waf-xsl/themes/servlet/content-type/index.xsl"));
|
||||
IO.copy(multiplexXSLFiles(paths),
|
||||
out);
|
||||
|
||||
IO.copy(multiplexXSLFiles(paths), out);
|
||||
|
||||
out.close();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,13 +110,20 @@ public class ThemeControlPanel extends SelectionPanel implements ThemeDirectorCo
|
|||
getBody().connect(addThemeLink, m_themeForm);
|
||||
addAction(addThemeLink, ActionGroup.ADD);
|
||||
|
||||
getBody().add(new Label(GlobalizationUtil.globalize("theme.download_default_base_styles")));
|
||||
|
||||
// add the "Download default base styxle" form
|
||||
// PB 2012-05: Download in ThemeDownloadServlet doesn't work, commented
|
||||
// out for now. Not useful anyway because it downloads web tree of every
|
||||
// package installed, probably filtered by theme file extensions (xsl,
|
||||
// css, etc).
|
||||
/*
|
||||
getBody().add(new Label(GlobalizationUtil
|
||||
.globalize("theme.download_default_base_styles")));
|
||||
Link downloadFilesLink = new Link(new Label(GlobalizationUtil.globalize
|
||||
("theme.download_default_base_styles")),
|
||||
"download/" + ALL_STYLES_ZIP_NAME);
|
||||
addAction(downloadFilesLink, ActionGroup.ADD);
|
||||
|
||||
*/
|
||||
// add the "Select Standard Theme" form
|
||||
Form defaultThemeForm = createDefaultThemeForm();
|
||||
addAction( defaultThemeForm );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,10 +74,11 @@ public class ThemeXSLParameterGenerator implements XSLParameterGenerator,
|
|||
}
|
||||
|
||||
if (themeURL != null) {
|
||||
// modified as ccm-ldn-theme is no longer installed in its own context
|
||||
// modified as ccm-themedirector (previously ccm-ldn-theme) is
|
||||
// no longer installed in its own context
|
||||
// return "/" + WEB_APP_NAME + "/" + THEMES_DIR + "/" +
|
||||
// If we want to install it as a separate web application again we
|
||||
// should find a way to determin the name from a central configuration
|
||||
// should find a way to determine the name from a central configuration
|
||||
return "/" + THEMES_DIR + "/" +
|
||||
Web.getContext().getRequestURL().getContextPath() +
|
||||
baseDir + themeURL;
|
||||
|
|
|
|||
Loading…
Reference in New Issue