System Admin wird nun der Gruppe Site-wide Administrators hinzugefügt (#1214)
git-svn-id: https://svn.libreccm.org/ccm/trunk@1595 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
27796f0c86
commit
4d8a32df3a
|
|
@ -21,6 +21,7 @@ package com.arsdigita.loader;
|
||||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.globalization.Charset;
|
import com.arsdigita.globalization.Charset;
|
||||||
import com.arsdigita.globalization.Locale;
|
import com.arsdigita.globalization.Locale;
|
||||||
|
import com.arsdigita.kernel.Group;
|
||||||
import com.arsdigita.kernel.EmailAddress;
|
import com.arsdigita.kernel.EmailAddress;
|
||||||
import com.arsdigita.kernel.Kernel;
|
import com.arsdigita.kernel.Kernel;
|
||||||
import com.arsdigita.kernel.KernelExcursion;
|
import com.arsdigita.kernel.KernelExcursion;
|
||||||
|
|
@ -221,7 +222,7 @@ public class CoreLoader extends PackageLoader {
|
||||||
private String getResource() {
|
private String getResource() {
|
||||||
return (String) get(m_resource);
|
return (String) get(m_resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve systems recognized character sets.
|
* Retrieve systems recognized character sets.
|
||||||
*
|
*
|
||||||
|
|
@ -315,7 +316,7 @@ public class CoreLoader extends PackageLoader {
|
||||||
// Used to invoke static class LoaderImpl - method load() in
|
// Used to invoke static class LoaderImpl - method load() in
|
||||||
// com.arsdigita.search.lucene.IndexId. Same procedure is invoked by
|
// com.arsdigita.search.lucene.IndexId. Same procedure is invoked by
|
||||||
// the initializer each time the system starts. So it's redundant here.
|
// the initializer each time the system starts. So it's redundant here.
|
||||||
// Using initializer code is favourable because it may be conditionally
|
// Using initializer code is favourable because it may be conditionally
|
||||||
// performed, depending on configuration (Lucene or Intermedia).
|
// performed, depending on configuration (Lucene or Intermedia).
|
||||||
// But the currently given implementation requires the loader
|
// But the currently given implementation requires the loader
|
||||||
// instruction here to let the code initialization time (i.e. at each
|
// instruction here to let the code initialization time (i.e. at each
|
||||||
|
|
@ -327,7 +328,7 @@ public class CoreLoader extends PackageLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param rootNode
|
* @param rootNode
|
||||||
* @deprecated will be removed without replacement. Naot needed anymore
|
* @deprecated will be removed without replacement. Naot needed anymore
|
||||||
*/
|
*/
|
||||||
|
|
@ -387,7 +388,7 @@ public class CoreLoader extends PackageLoader {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ensure that at least one User with universal "admin" permission exists
|
* Ensure that at least one User with universal "admin" permission exists
|
||||||
* after installation.
|
* after installation.
|
||||||
*/
|
*/
|
||||||
private void createSystemAdministrator() {
|
private void createSystemAdministrator() {
|
||||||
|
|
@ -445,6 +446,15 @@ public class CoreLoader extends PackageLoader {
|
||||||
(new UniversalPermissionDescriptor
|
(new UniversalPermissionDescriptor
|
||||||
(PrivilegeDescriptor.ADMIN, sa));
|
(PrivilegeDescriptor.ADMIN, sa));
|
||||||
|
|
||||||
|
// Add system administrator to site-wide administrator group
|
||||||
|
GroupCollection groupColl = Group.retrieveAll();
|
||||||
|
// FIXME: String for Site-wide Admininistrators is hardcoded because
|
||||||
|
// this group in inserted via sql-command during setup
|
||||||
|
groupColl.filter("Site-wide Administrators");
|
||||||
|
if(groupColl.next()) {
|
||||||
|
groupColl.getGroup().addMember(sa);
|
||||||
|
}
|
||||||
|
|
||||||
s_log.debug("Adding administrator: \"" + givenName + " " +
|
s_log.debug("Adding administrator: \"" + givenName + " " +
|
||||||
familyName + "\" <" + emailAddress + ">");
|
familyName + "\" <" + emailAddress + ">");
|
||||||
s_log.debug("CoreLoader: method createSystemAdministrator() completed.");
|
s_log.debug("CoreLoader: method createSystemAdministrator() completed.");
|
||||||
|
|
@ -455,17 +465,17 @@ public class CoreLoader extends PackageLoader {
|
||||||
* Setup Login application. Loads type into database and instances the
|
* Setup Login application. Loads type into database and instances the
|
||||||
* single default instance.
|
* single default instance.
|
||||||
* Has to be public access in order to enable script Upgrade664 to use it.
|
* Has to be public access in order to enable script Upgrade664 to use it.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static void loadLoginApp() {
|
public static void loadLoginApp() {
|
||||||
|
|
||||||
ApplicationType loginType =
|
ApplicationType loginType =
|
||||||
new ApplicationType("login",
|
new ApplicationType("login",
|
||||||
Login.BASE_DATA_OBJECT_TYPE );
|
Login.BASE_DATA_OBJECT_TYPE );
|
||||||
loginType.setDescription("CCM user login application");
|
loginType.setDescription("CCM user login application");
|
||||||
loginType.save();
|
loginType.save();
|
||||||
|
|
||||||
|
|
||||||
Application login = Application.createApplication(loginType,
|
Application login = Application.createApplication(loginType,
|
||||||
"register",
|
"register",
|
||||||
"CCM Login",
|
"CCM Login",
|
||||||
|
|
@ -481,14 +491,14 @@ public class CoreLoader extends PackageLoader {
|
||||||
* Has to be public access in order to enable script Upgrade664 to use it.
|
* Has to be public access in order to enable script Upgrade664 to use it.
|
||||||
*/
|
*/
|
||||||
public static void loadAdminApp() {
|
public static void loadAdminApp() {
|
||||||
|
|
||||||
ApplicationType adminType =
|
ApplicationType adminType =
|
||||||
new ApplicationType("admin",
|
new ApplicationType("admin",
|
||||||
Admin.BASE_DATA_OBJECT_TYPE );
|
Admin.BASE_DATA_OBJECT_TYPE );
|
||||||
adminType.setDescription("CCM user and group administration");
|
adminType.setDescription("CCM user and group administration");
|
||||||
adminType.save();
|
adminType.save();
|
||||||
|
|
||||||
|
|
||||||
Application admin = Application.createApplication(adminType,
|
Application admin = Application.createApplication(adminType,
|
||||||
"admin",
|
"admin",
|
||||||
"CCM Admin",
|
"CCM Admin",
|
||||||
|
|
@ -504,11 +514,11 @@ public class CoreLoader extends PackageLoader {
|
||||||
*/
|
*/
|
||||||
public static void loadPermissionsApp() {
|
public static void loadPermissionsApp() {
|
||||||
|
|
||||||
/* NOTE:
|
/* NOTE:
|
||||||
* The wording in the title parameter of ApplicationType determines
|
* The wording in the title parameter of ApplicationType determines
|
||||||
* the name of the subdirectory for the XSL stylesheets.
|
* the name of the subdirectory for the XSL stylesheets.
|
||||||
* It gets "urlized", i.e. trimming leading and trailing blanks and
|
* It gets "urlized", i.e. trimming leading and trailing blanks and
|
||||||
* replacing blanks between words and illegal characters with an hyphen
|
* replacing blanks between words and illegal characters with an hyphen
|
||||||
* and converted to lower case.
|
* and converted to lower case.
|
||||||
* Example: "Permissions" will become "permissions".
|
* Example: "Permissions" will become "permissions".
|
||||||
*/
|
*/
|
||||||
|
|
@ -517,7 +527,7 @@ public class CoreLoader extends PackageLoader {
|
||||||
Permissions.BASE_DATA_OBJECT_TYPE );
|
Permissions.BASE_DATA_OBJECT_TYPE );
|
||||||
type.setDescription("CCM permissions administration");
|
type.setDescription("CCM permissions administration");
|
||||||
type.save();
|
type.save();
|
||||||
|
|
||||||
Application app = Application.createApplication(type,
|
Application app = Application.createApplication(type,
|
||||||
"permissions",
|
"permissions",
|
||||||
"CCM Permissions",
|
"CCM Permissions",
|
||||||
|
|
@ -533,7 +543,7 @@ public class CoreLoader extends PackageLoader {
|
||||||
* database and instantiate the (only) application instance.
|
* database and instantiate the (only) application instance.
|
||||||
*
|
*
|
||||||
* Public static access needed by upgrade script Upgrade664
|
* Public static access needed by upgrade script Upgrade664
|
||||||
* @return webDevType ApplicationType
|
* @return webDevType ApplicationType
|
||||||
*/
|
*/
|
||||||
public static void loadWebDev() {
|
public static void loadWebDev() {
|
||||||
|
|
||||||
|
|
@ -549,12 +559,12 @@ public class CoreLoader extends PackageLoader {
|
||||||
null);
|
null);
|
||||||
webDev.setDescription("The default WEB developer service instance.");
|
webDev.setDescription("The default WEB developer service instance.");
|
||||||
webDev.save();
|
webDev.save();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load core's basic portal infrastructure.
|
* Load core's basic portal infrastructure.
|
||||||
*/
|
*/
|
||||||
private void loadPortal() {
|
private void loadPortal() {
|
||||||
s_log.info("Adding resource type: portal");
|
s_log.info("Adding resource type: portal");
|
||||||
|
|
@ -568,7 +578,7 @@ public class CoreLoader extends PackageLoader {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads supported mime types from a file and ???.
|
* Reads supported mime types from a file and ???.
|
||||||
*
|
*
|
||||||
* Run once during initial load.
|
* Run once during initial load.
|
||||||
*/
|
*/
|
||||||
private void loadMimeTypes() {
|
private void loadMimeTypes() {
|
||||||
|
|
@ -586,7 +596,7 @@ public class CoreLoader extends PackageLoader {
|
||||||
(new InputStreamReader(is), row.getParameters());
|
(new InputStreamReader(is), row.getParameters());
|
||||||
|
|
||||||
while (loader.next()) {
|
while (loader.next()) {
|
||||||
|
|
||||||
row.load(loader);
|
row.load(loader);
|
||||||
|
|
||||||
s_log.info("Adding mimetype: " + row.getType() + " (" +
|
s_log.info("Adding mimetype: " + row.getType() + " (" +
|
||||||
|
|
@ -595,7 +605,7 @@ public class CoreLoader extends PackageLoader {
|
||||||
(row.getType(), row.getJavaClass(), row.getObjectType());
|
(row.getType(), row.getJavaClass(), row.getObjectType());
|
||||||
mime.setLabel(row.getLabel());
|
mime.setLabel(row.getLabel());
|
||||||
mime.setFileExtension(row.getDefaultExtension());
|
mime.setFileExtension(row.getDefaultExtension());
|
||||||
|
|
||||||
if (mime instanceof TextMimeType) {
|
if (mime instanceof TextMimeType) {
|
||||||
((TextMimeType) mime).setAllowINSOConvert
|
((TextMimeType) mime).setAllowINSOConvert
|
||||||
("1".equals(row.getSizerOrINSO()));
|
("1".equals(row.getSizerOrINSO()));
|
||||||
|
|
@ -603,11 +613,11 @@ public class CoreLoader extends PackageLoader {
|
||||||
if (mime instanceof ImageMimeType) {
|
if (mime instanceof ImageMimeType) {
|
||||||
((ImageMimeType) mime).setImageSizer(row.getSizerOrINSO());
|
((ImageMimeType) mime).setImageSizer(row.getSizerOrINSO());
|
||||||
}
|
}
|
||||||
String[] extensions =
|
String[] extensions =
|
||||||
StringUtils.split(row.getExtensions(), ',');
|
StringUtils.split(row.getExtensions(), ',');
|
||||||
for (int i = 0; i < extensions.length; i++) {
|
for (int i = 0; i < extensions.length; i++) {
|
||||||
MimeTypeExtension ext =
|
MimeTypeExtension ext =
|
||||||
MimeTypeExtension.create(extensions[i],
|
MimeTypeExtension.create(extensions[i],
|
||||||
mime.getMimeType());
|
mime.getMimeType());
|
||||||
ext.save();
|
ext.save();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue