CCM NG: Some small things

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5082 8810af33-2d31-482b-a856-94f89814c4df
jensp 2017-10-25 15:51:30 +00:00
parent 66c1c8baeb
commit b32a48f922
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.web.CcmApplication;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
@ -133,9 +134,11 @@ public class CMSApplicationPage extends Page {
.getConfig().getPresenterClass();
final PresentationManager presenter;
try {
presenter = presenterClass.class.getDeclaredConstructor().newInstance();
} catch (InstantiationException |
IllegalAccessException ex) {
presenter = presenterClass.getDeclaredConstructor().newInstance();
} catch (InstantiationException
| IllegalAccessException
| NoSuchMethodException
| InvocationTargetException ex) {
throw new RuntimeException("Failed to create PresentationManager",
ex);
}
@ -197,20 +200,22 @@ public class CMSApplicationPage extends Page {
public void setXMLParameter(String name, String value) {
parameters.put(name, value);
}
/**
/**
* Overwrites bebop.Page#generateXMLHelper to add the name of the user
* logged in to the pageElement (displayed as part of the header).
*
* @param state
* @param parent
*
* @return pageElement for use in generateXML
*/
@Override
protected Element generateXMLHelper(final PageState state,
protected Element generateXMLHelper(final PageState state,
final Document parent) {
/* Retain elements already included. */
Element pageElement = super.generateXMLHelper(state,parent);
Element pageElement = super.generateXMLHelper(state, parent);
/* Add name of user logged in. */
// 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();
// User user = Web.getWebContext().getUser();
if (user.isPresent()) {
pageElement.addAttribute("name",user.get().getName());
pageElement.addAttribute("name", user.get().getName());
}
return pageElement;

View File

@ -108,8 +108,12 @@ public class AssetManager {
final T asset;
try {
asset = assetType.class.getDeclaredConstructor().newInstance();
} catch (IllegalAccessException | InstantiationException ex) {
asset = assetType.getDeclaredConstructor().newInstance();
} catch (IllegalAccessException
| InstantiationException
| NoSuchMethodException
| SecurityException
| InvocationTargetException ex) {
throw new UnexpectedErrorException(ex);
}
@ -117,11 +121,11 @@ public class AssetManager {
asset.getTitle().addValue(locale, title);
assetRepo.save(asset);
categoryManager.addObjectToCategory(asset,
folder,
categoryManager.addObjectToCategory(asset,
folder,
CmsConstants.CATEGORIZATION_TYPE_FOLDER);
permissionManager.copyPermissions(folder, asset, true);
return asset;
}

View File

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

View File

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

View File

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

View File

@ -34,6 +34,11 @@ create table CCM_CMS.ITEM_LIST_COMPONENTS (
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
add constraint FKr9w6qafqrbi83nncn7f6ufas7
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)
);
create table CCM_CMS.ITEM_LIST_ORDER (
ITEM_LIST_ID int8 not null,
LIST_ORDER varchar(255)
);
alter table CCM_CMS.CATEGORIZED_ITEM_COMPONENTS
add constraint FKlraxqtl9cnntdo0qovq340y7b
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.toolbox.ui.LayoutPanel;
import org.libreccm.categorization.Category;
import static com.arsdigita.ui.admin.AdminUiConstants.*;
/**

View File

@ -1081,7 +1081,7 @@
*/
.v-vaadin-version:after {
content: "8.1.3";
content: "8.1.5";
}
.v-widget {
@ -9764,6 +9764,19 @@ td.v-inline-datefield-calendarpanel-time .v-label {
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 {
position: relative;
}

View File

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