CCM NG: Some small things

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5082 8810af33-2d31-482b-a856-94f89814c4df
pull/2/head
jensp 2017-10-25 15:51:30 +00:00
parent 76c1f63714
commit 8209244a33
12 changed files with 71 additions and 24 deletions

View File

@ -36,6 +36,7 @@ import org.libreccm.security.Shiro;
import org.libreccm.security.User; import org.libreccm.security.User;
import org.libreccm.web.CcmApplication; import org.libreccm.web.CcmApplication;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
@ -133,9 +134,11 @@ public class CMSApplicationPage extends Page {
.getConfig().getPresenterClass(); .getConfig().getPresenterClass();
final PresentationManager presenter; final PresentationManager presenter;
try { try {
presenter = presenterClass.class.getDeclaredConstructor().newInstance(); presenter = presenterClass.getDeclaredConstructor().newInstance();
} catch (InstantiationException | } catch (InstantiationException
IllegalAccessException ex) { | IllegalAccessException
| NoSuchMethodException
| InvocationTargetException ex) {
throw new RuntimeException("Failed to create PresentationManager", throw new RuntimeException("Failed to create PresentationManager",
ex); ex);
} }
@ -198,11 +201,13 @@ public class CMSApplicationPage extends Page {
parameters.put(name, value); parameters.put(name, value);
} }
/** /**
* Overwrites bebop.Page#generateXMLHelper to add the name of the user * Overwrites bebop.Page#generateXMLHelper to add the name of the user
* logged in to the pageElement (displayed as part of the header). * logged in to the pageElement (displayed as part of the header).
*
* @param state * @param state
* @param parent * @param parent
*
* @return pageElement for use in generateXML * @return pageElement for use in generateXML
*/ */
@Override @Override
@ -210,7 +215,7 @@ public class CMSApplicationPage extends Page {
final Document parent) { final Document parent) {
/* Retain elements already included. */ /* Retain elements already included. */
Element pageElement = super.generateXMLHelper(state,parent); Element pageElement = super.generateXMLHelper(state, parent);
/* Add name of user logged in. */ /* Add name of user logged in. */
// Note: There are at least 2 ways in the API to determin the user // Note: There are at least 2 ways in the API to determin the user
@ -221,7 +226,7 @@ public class CMSApplicationPage extends Page {
final Optional<User> user = shiro.getUser(); final Optional<User> user = shiro.getUser();
// User user = Web.getWebContext().getUser(); // User user = Web.getWebContext().getUser();
if (user.isPresent()) { if (user.isPresent()) {
pageElement.addAttribute("name",user.get().getName()); pageElement.addAttribute("name", user.get().getName());
} }
return pageElement; return pageElement;

View File

@ -108,8 +108,12 @@ public class AssetManager {
final T asset; final T asset;
try { try {
asset = assetType.class.getDeclaredConstructor().newInstance(); asset = assetType.getDeclaredConstructor().newInstance();
} catch (IllegalAccessException | InstantiationException ex) { } catch (IllegalAccessException
| InstantiationException
| NoSuchMethodException
| SecurityException
| InvocationTargetException ex) {
throw new UnexpectedErrorException(ex); throw new UnexpectedErrorException(ex);
} }

View File

@ -25,6 +25,7 @@ import org.libreccm.security.RequiresPrivilege;
import org.librecms.CmsConstants; import org.librecms.CmsConstants;
import org.librecms.contentsection.privileges.AdminPrivileges; import org.librecms.contentsection.privileges.AdminPrivileges;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -230,9 +231,12 @@ public class LifecycleManager {
final Object object; final Object object;
try { try {
object = listenerClass.class.getDeclaredConstructor().newInstance(); object = listenerClass.getDeclaredConstructor().newInstance();
} catch (IllegalAccessException } catch (IllegalAccessException
| InstantiationException ex) { | InstantiationException
| NoSuchMethodException
| SecurityException
| InvocationTargetException ex) {
LOGGER.error("Failed to create instance of LifecycleEventListener " LOGGER.error("Failed to create instance of LifecycleEventListener "
+ "of class \"{}\".", + "of class \"{}\".",
listenerClass.getName()); listenerClass.getName());
@ -275,9 +279,11 @@ public class LifecycleManager {
final Object object; final Object object;
try { try {
object = listenerClass.class.getDeclaredConstructor().newInstance(); object = listenerClass.getDeclaredConstructor().newInstance();
} catch (IllegalAccessException } catch (IllegalAccessException
| InstantiationException ex) { | InstantiationException
| InvocationTargetException
| NoSuchMethodException ex) {
LOGGER.error("Failed to create instance of PhaseEventListener " LOGGER.error("Failed to create instance of PhaseEventListener "
+ "of class \"{}\".", + "of class \"{}\".",
listenerClass.getName()); listenerClass.getName());

View File

@ -37,7 +37,7 @@ public class ThemeConfiguration implements Serializable {
/** /**
* The theme associated with this configuration. * The theme associated with this configuration.
*/ */
@Column(name = "THEME") @Column(name = "THEME_NAME")
private String theme; private String theme;
/** /**

View File

@ -23,6 +23,8 @@ import com.arsdigita.cms.workflow.TaskURLGenerator;
import org.libreccm.core.UnexpectedErrorException; import org.libreccm.core.UnexpectedErrorException;
import org.librecms.contentsection.ContentItem; import org.librecms.contentsection.ContentItem;
import java.lang.reflect.InvocationTargetException;
import javax.enterprise.context.RequestScoped; import javax.enterprise.context.RequestScoped;
/** /**
@ -45,9 +47,11 @@ public class CmsTaskManager {
.getTaskType().getUrlGenerator(); .getTaskType().getUrlGenerator();
final TaskURLGenerator urlGenerator; final TaskURLGenerator urlGenerator;
try { try {
urlGenerator = urlGeneratorClass.class.getDeclaredConstructor().newInstance(); urlGenerator = urlGeneratorClass.getDeclaredConstructor().newInstance();
} catch (IllegalAccessException } catch (IllegalAccessException
| InstantiationException ex) { | InstantiationException
| NoSuchMethodException
| InvocationTargetException ex) {
throw new UnexpectedErrorException(ex); throw new UnexpectedErrorException(ex);
} }

View File

@ -34,6 +34,11 @@ create table CCM_CMS.ITEM_LIST_COMPONENTS (
primary key (COMPONENT_MODEL_ID) primary key (COMPONENT_MODEL_ID)
); );
create table CCM_CMS.ITEM_LIST_ORDER (
ITEM_LIST_ID bigint not null,
LIST_ORDER varchar(255)
);
alter table CCM_CMS.CATEGORIZED_ITEM_COMPONENT alter table CCM_CMS.CATEGORIZED_ITEM_COMPONENT
add constraint FKr9w6qafqrbi83nncn7f6ufas7 add constraint FKr9w6qafqrbi83nncn7f6ufas7
foreign key (COMPONENT_MODEL_ID) foreign key (COMPONENT_MODEL_ID)

View File

@ -0,0 +1,3 @@
alter table CCM_CMS.PAGE_THEME_CONFIGURATIONS
add column THEME_NAME varchar(255)

View File

@ -34,6 +34,11 @@ create table CCM_CMS.ITEM_LIST_COMPONENTS (
primary key (COMPONENT_MODEL_ID) primary key (COMPONENT_MODEL_ID)
); );
create table CCM_CMS.ITEM_LIST_ORDER (
ITEM_LIST_ID int8 not null,
LIST_ORDER varchar(255)
);
alter table CCM_CMS.CATEGORIZED_ITEM_COMPONENTS alter table CCM_CMS.CATEGORIZED_ITEM_COMPONENTS
add constraint FKlraxqtl9cnntdo0qovq340y7b add constraint FKlraxqtl9cnntdo0qovq340y7b
foreign key (COMPONENT_MODEL_ID) foreign key (COMPONENT_MODEL_ID)

View File

@ -0,0 +1,3 @@
alter table CCM_CMS.PAGE_THEME_CONFIGURATIONS
add column THEME_NAME varchar(255)

View File

@ -33,8 +33,6 @@ import com.arsdigita.bebop.parameters.StringParameter;
import com.arsdigita.globalization.GlobalizedMessage; import com.arsdigita.globalization.GlobalizedMessage;
import com.arsdigita.toolbox.ui.LayoutPanel; import com.arsdigita.toolbox.ui.LayoutPanel;
import org.libreccm.categorization.Category;
import static com.arsdigita.ui.admin.AdminUiConstants.*; import static com.arsdigita.ui.admin.AdminUiConstants.*;
/** /**

View File

@ -1081,7 +1081,7 @@
*/ */
.v-vaadin-version:after { .v-vaadin-version:after {
content: "8.1.3"; content: "8.1.5";
} }
.v-widget { .v-widget {
@ -9764,6 +9764,19 @@ td.v-inline-datefield-calendarpanel-time .v-label {
box-shadow: inset 0 0 0 1px #c8dbed; box-shadow: inset 0 0 0 1px #c8dbed;
} }
.v-tree8-scroller-vertical {
border: none;
}
.v-tree8-scroller-horizontal {
border: none;
}
.v-tree8-header-deco, .v-tree8-footer-deco, .v-tree8-horizontal-scrollbar-deco {
border: none;
background: transparent;
}
.v-treegrid { .v-treegrid {
position: relative; position: relative;
} }

View File

@ -46,8 +46,9 @@ public class EntitiesTestCore {
InstantiationException, InstantiationException,
IllegalAccessException, IllegalAccessException,
IllegalArgumentException, IllegalArgumentException,
NoSuchMethodException,
InvocationTargetException { InvocationTargetException {
final Object obj = entityClass.class.getDeclaredConstructor().newInstance(); final Object obj = entityClass.getDeclaredConstructor().newInstance();
final Field[] fields = entityClass.getDeclaredFields(); final Field[] fields = entityClass.getDeclaredFields();
for (Field field : fields) { for (Field field : fields) {