CCM NG/ccm-cms: Renaming folders
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4595 8810af33-2d31-482b-a856-94f89814c4df
parent
46ff680193
commit
82f51a1d70
|
|
@ -22,44 +22,52 @@ import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
import org.libreccm.categorization.Category;
|
import org.libreccm.categorization.Category;
|
||||||
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
import org.libreccm.configuration.ConfigurationManager;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements functionality for renaming a folder. Most code taken from FolderCreator. Need to refactor out base
|
* Implements functionality for renaming a folder. Most code taken from FolderCreator. Need to refactor out base
|
||||||
* functionality of FolderEditor & Creator.
|
* functionality of FolderEditor & Creator.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens >Pelzetter</a>
|
|
||||||
* @author <a href="mailto:jorris@arsdigita.com">Jon Orris</a>
|
* @author <a href="mailto:jorris@arsdigita.com">Jon Orris</a>
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens >Pelzetter</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class FolderEditor extends FolderForm {
|
public class FolderEditor extends FolderForm {
|
||||||
|
|
||||||
public FolderEditor(String name, FolderSelectionModel folder) {
|
public FolderEditor(final String name, final FolderSelectionModel folder) {
|
||||||
super(name, folder);
|
super(name, folder);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialise the form with name & label of folder being edited.
|
* Initialise the form with name & label of folder being edited.
|
||||||
* @param e
|
* @param event
|
||||||
* @throws com.arsdigita.bebop.FormProcessException
|
* @throws com.arsdigita.bebop.FormProcessException
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void init(FormSectionEvent e) throws FormProcessException {
|
public void init(final FormSectionEvent event) throws FormProcessException {
|
||||||
PageState s = e.getPageState();
|
final PageState state = event.getPageState();
|
||||||
FormData data = e.getFormData();
|
final FormData data = event.getFormData();
|
||||||
Category folder = getCurrentFolder(s);
|
final Category folder = getCurrentFolder(state);
|
||||||
data.put(NAME, folder.getName());
|
data.put(NAME, folder.getName());
|
||||||
data.put(TITLE, folder.getDisplayName());
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
|
final ConfigurationManager confManager = cdiUtil.findBean(ConfigurationManager.class);
|
||||||
|
final KernelConfig kernelConfig = confManager.findConfiguration(
|
||||||
|
KernelConfig.class);
|
||||||
|
data.put(TITLE,
|
||||||
|
folder.getTitle().getValue(kernelConfig.getDefaultLocale()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(FormSectionEvent e) throws FormProcessException {
|
public void process(final FormSectionEvent event) throws FormProcessException {
|
||||||
PageState s = e.getPageState();
|
final PageState state = event.getPageState();
|
||||||
FormData data = e.getFormData();
|
final FormData data = event.getFormData();
|
||||||
Category folder = getCurrentFolder(s);
|
final Category folder = getCurrentFolder(state);
|
||||||
|
|
||||||
updateFolder(folder, (String)data.get(NAME), (String)data.get(TITLE));
|
updateFolder(folder, (String)data.get(NAME), (String)data.get(TITLE));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ import com.arsdigita.bebop.parameters.TrimmedStringParameter;
|
||||||
import com.arsdigita.bebop.parameters.URLTokenValidationListener;
|
import com.arsdigita.bebop.parameters.URLTokenValidationListener;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||||
import com.arsdigita.globalization.GlobalizedMessage;
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
import com.arsdigita.util.Assert;
|
import com.arsdigita.util.Assert;
|
||||||
import com.arsdigita.web.Web;
|
import com.arsdigita.web.Web;
|
||||||
import com.arsdigita.xml.Element;
|
import com.arsdigita.xml.Element;
|
||||||
|
|
@ -46,6 +47,8 @@ import org.apache.logging.log4j.Logger;
|
||||||
import org.libreccm.categorization.Category;
|
import org.libreccm.categorization.Category;
|
||||||
import org.libreccm.categorization.CategoryRepository;
|
import org.libreccm.categorization.CategoryRepository;
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
import org.libreccm.configuration.ConfigurationManager;
|
||||||
|
import org.libreccm.l10n.GlobalizationHelper;
|
||||||
import org.librecms.CmsConstants;
|
import org.librecms.CmsConstants;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -62,9 +65,9 @@ import org.librecms.CmsConstants;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
public abstract class FolderForm extends FormSection
|
public abstract class FolderForm extends FormSection
|
||||||
implements FormInitListener,
|
implements FormInitListener,
|
||||||
FormProcessListener,
|
FormProcessListener,
|
||||||
FormValidationListener {
|
FormValidationListener {
|
||||||
|
|
||||||
public static final Logger LOGGER = LogManager.getLogger(FolderForm.class);
|
public static final Logger LOGGER = LogManager.getLogger(FolderForm.class);
|
||||||
|
|
||||||
|
|
@ -81,16 +84,16 @@ public abstract class FolderForm extends FormSection
|
||||||
* Currently, to insert javascript code the Label Widget is "abused".
|
* Currently, to insert javascript code the Label Widget is "abused".
|
||||||
*/
|
*/
|
||||||
private final Label m_script = new Label(String.format(
|
private final Label m_script = new Label(String.format(
|
||||||
"<script language=\"javascript\" src=\"%s/javascript/manipulate-input.js\"></script>",
|
"<script language=\"javascript\" src=\"%s/javascript/manipulate-input.js\"></script>",
|
||||||
Web.getWebappContextPath()),
|
Web.getWebappContextPath()),
|
||||||
false);
|
false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new folder form.
|
* Create a new folder form.
|
||||||
*
|
*
|
||||||
* @param name Name of the form
|
* @param name Name of the form
|
||||||
* @param currentFolder SelectionModel containing the current folder being
|
* @param currentFolder SelectionModel containing the current folder being
|
||||||
* operated on.
|
* operated on.
|
||||||
*
|
*
|
||||||
* @pre name != null && folder != null
|
* @pre name != null && folder != null
|
||||||
*/
|
*/
|
||||||
|
|
@ -137,7 +140,7 @@ public abstract class FolderForm extends FormSection
|
||||||
super(columnPanel);
|
super(columnPanel);
|
||||||
|
|
||||||
widgetSection = new FormSection(
|
widgetSection = new FormSection(
|
||||||
new ColumnPanel(columnPanel.getNumCols()));
|
new ColumnPanel(columnPanel.getNumCols()));
|
||||||
super.add(widgetSection, ColumnPanel.INSERT);
|
super.add(widgetSection, ColumnPanel.INSERT);
|
||||||
this.currentFolder = currentFolder;
|
this.currentFolder = currentFolder;
|
||||||
|
|
||||||
|
|
@ -169,20 +172,20 @@ public abstract class FolderForm extends FormSection
|
||||||
// it breaks URLs & potentially overwrites the user's
|
// it breaks URLs & potentially overwrites the user's
|
||||||
// customizations.
|
// customizations.
|
||||||
final TextField titleWidget = new TextField(new TrimmedStringParameter(
|
final TextField titleWidget = new TextField(new TrimmedStringParameter(
|
||||||
TITLE));
|
TITLE));
|
||||||
titleWidget.setLabel(getTitleLabel());
|
titleWidget.setLabel(getTitleLabel());
|
||||||
titleWidget.setHint(getTitleHint());
|
titleWidget.setHint(getTitleHint());
|
||||||
titleWidget.addValidationListener(new NotNullValidationListener());
|
titleWidget.addValidationListener(new NotNullValidationListener());
|
||||||
titleWidget.setOnFocus("if (this.form." + NAME + ".value == '') { "
|
titleWidget.setOnFocus("if (this.form." + NAME + ".value == '') { "
|
||||||
+ " defaulting = true; this.form." + NAME
|
+ " defaulting = true; this.form." + NAME
|
||||||
+ ".value = urlize(this.value); }");
|
+ ".value = urlize(this.value); }");
|
||||||
titleWidget.setOnKeyUp(
|
titleWidget.setOnKeyUp(
|
||||||
"if (defaulting) { this.form." + NAME
|
"if (defaulting) { this.form." + NAME
|
||||||
+ ".value = urlize(this.value) }");
|
+ ".value = urlize(this.value) }");
|
||||||
add(titleWidget);
|
add(titleWidget);
|
||||||
|
|
||||||
final TextField nameWidget = new TextField(new TrimmedStringParameter(
|
final TextField nameWidget = new TextField(new TrimmedStringParameter(
|
||||||
NAME));
|
NAME));
|
||||||
nameWidget.setLabel(getNameLabel());
|
nameWidget.setLabel(getNameLabel());
|
||||||
nameWidget.setHint(getNameHint());
|
nameWidget.setHint(getNameHint());
|
||||||
|
|
||||||
|
|
@ -195,11 +198,11 @@ public abstract class FolderForm extends FormSection
|
||||||
nameWidget.setMaxLength(190);
|
nameWidget.setMaxLength(190);
|
||||||
nameWidget.setOnFocus("defaulting = false");
|
nameWidget.setOnFocus("defaulting = false");
|
||||||
nameWidget.setOnBlur(
|
nameWidget.setOnBlur(
|
||||||
"if (this.value == '') "
|
"if (this.value == '') "
|
||||||
+ "{ defaulting = true; this.value = urlize(this.form."
|
+ "{ defaulting = true; this.value = urlize(this.form."
|
||||||
+ TITLE
|
+ TITLE
|
||||||
+ ".value) } "
|
+ ".value) } "
|
||||||
+ " else { this.value = urlize(this.value); }");
|
+ " else { this.value = urlize(this.value); }");
|
||||||
add(nameWidget);
|
add(nameWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -225,7 +228,7 @@ public abstract class FolderForm extends FormSection
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public abstract void init(final FormSectionEvent event)
|
public abstract void init(final FormSectionEvent event)
|
||||||
throws FormProcessException;
|
throws FormProcessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the form. Children have to override this method to save the
|
* Process the form. Children have to override this method to save the
|
||||||
|
|
@ -237,7 +240,7 @@ public abstract class FolderForm extends FormSection
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public abstract void process(final FormSectionEvent event)
|
public abstract void process(final FormSectionEvent event)
|
||||||
throws FormProcessException;
|
throws FormProcessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates the form. Checks for name uniqueness.
|
* Validates the form. Checks for name uniqueness.
|
||||||
|
|
@ -248,9 +251,9 @@ public abstract class FolderForm extends FormSection
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void validate(final FormSectionEvent event)
|
public void validate(final FormSectionEvent event)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
Category folder = (Category) currentFolder.getSelectedObject(event
|
Category folder = (Category) currentFolder.getSelectedObject(event
|
||||||
.getPageState());
|
.getPageState());
|
||||||
Assert.exists(folder);
|
Assert.exists(folder);
|
||||||
// validateNameUniqueness(folder, event);
|
// validateNameUniqueness(folder, event);
|
||||||
}
|
}
|
||||||
|
|
@ -271,9 +274,9 @@ public abstract class FolderForm extends FormSection
|
||||||
* Layout constraints are defined in each layout container as static ints.
|
* Layout constraints are defined in each layout container as static ints.
|
||||||
* Use a bitwise OR to specify multiple constraints.
|
* Use a bitwise OR to specify multiple constraints.
|
||||||
*
|
*
|
||||||
* @param component the component to add to this container
|
* @param component the component to add to this container
|
||||||
* @param constraints layout constraints (a bitwise OR of static ints in the
|
* @param constraints layout constraints (a bitwise OR of static ints in the
|
||||||
* particular layout)
|
* particular layout)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void add(final Component component, final int constraints) {
|
public void add(final Component component, final int constraints) {
|
||||||
|
|
@ -345,8 +348,8 @@ public abstract class FolderForm extends FormSection
|
||||||
*
|
*
|
||||||
* @param folder The folder to update
|
* @param folder The folder to update
|
||||||
* @param parent The new parent folder. May be null.
|
* @param parent The new parent folder. May be null.
|
||||||
* @param name The new name of the folder
|
* @param name The new name of the folder
|
||||||
* @param label The new label for the folder
|
* @param label The new label for the folder
|
||||||
*/
|
*/
|
||||||
final protected void updateFolder(final Category folder,
|
final protected void updateFolder(final Category folder,
|
||||||
final Category parent,
|
final Category parent,
|
||||||
|
|
@ -360,32 +363,36 @@ public abstract class FolderForm extends FormSection
|
||||||
* Updates a folder with a new name and label.
|
* Updates a folder with a new name and label.
|
||||||
*
|
*
|
||||||
* @param folder The folder to update
|
* @param folder The folder to update
|
||||||
* @param name The new name of the folder
|
* @param name The new name of the folder
|
||||||
* @param label The new label for the folder
|
* @param label The new label for the folder
|
||||||
*/
|
*/
|
||||||
final protected void updateFolder(final Category folder,
|
final protected void updateFolder(final Category folder,
|
||||||
final String name,
|
final String name,
|
||||||
final String label) {
|
final String label) {
|
||||||
folder.setName(name);
|
|
||||||
folder.setDisplayName(label);
|
|
||||||
|
|
||||||
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
|
final ConfigurationManager confManager = cdiUtil.findBean(ConfigurationManager.class);
|
||||||
|
final KernelConfig kernelConfig = confManager.findConfiguration(
|
||||||
|
KernelConfig.class);
|
||||||
|
|
||||||
|
folder.setName(name);
|
||||||
|
folder.setDisplayName(name);
|
||||||
|
folder.getTitle().addValue(kernelConfig.getDefaultLocale(), label);
|
||||||
|
|
||||||
final CategoryRepository categoryRepo = cdiUtil.findBean(
|
final CategoryRepository categoryRepo = cdiUtil.findBean(
|
||||||
CategoryRepository.class);
|
CategoryRepository.class);
|
||||||
categoryRepo.save(folder);
|
categoryRepo.save(folder);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current folder being operated on.
|
* Returns the current folder being operated on.
|
||||||
*
|
*
|
||||||
|
* @param state
|
||||||
* @return The current folder
|
* @return The current folder
|
||||||
*
|
*
|
||||||
* @pre state != null
|
|
||||||
* @post return != null
|
|
||||||
*/
|
*/
|
||||||
final protected Category getCurrentFolder(final PageState state) {
|
final protected Category getCurrentFolder(final PageState state) {
|
||||||
final Category folder = (Category) currentFolder
|
final Category folder = (Category) currentFolder
|
||||||
.getSelectedObject(state);
|
.getSelectedObject(state);
|
||||||
return folder;
|
return folder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import com.arsdigita.bebop.tree.TreeModel;
|
||||||
import com.arsdigita.bebop.tree.TreeModelBuilder;
|
import com.arsdigita.bebop.tree.TreeModelBuilder;
|
||||||
import com.arsdigita.bebop.tree.TreeNode;
|
import com.arsdigita.bebop.tree.TreeNode;
|
||||||
import com.arsdigita.cms.CMS;
|
import com.arsdigita.cms.CMS;
|
||||||
import com.arsdigita.ui.admin.applications.ApplicationInstanceTreeNode;
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
|
|
||||||
import org.librecms.contentsection.ContentSection;
|
import org.librecms.contentsection.ContentSection;
|
||||||
|
|
||||||
|
|
@ -40,6 +40,7 @@ import org.librecms.contentsection.Folder;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import org.libreccm.configuration.ConfigurationManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link com.arsdigita.bebop.tree.TreeModelBuilder} that produces trees
|
* A {@link com.arsdigita.bebop.tree.TreeModelBuilder} that produces trees
|
||||||
|
|
@ -51,17 +52,17 @@ import java.util.stream.Collectors;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
public class FolderTreeModelBuilder extends LockableImpl
|
public class FolderTreeModelBuilder extends LockableImpl
|
||||||
implements TreeModelBuilder {
|
implements TreeModelBuilder {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a tree model that lists the hierarchy of folders underneath the
|
* Make a tree model that lists the hierarchy of folders underneath the
|
||||||
* folder returned by {@link #getRoot getRoot}.
|
* folder returned by {@link #getRoot getRoot}.
|
||||||
*
|
*
|
||||||
* @param tree the tree in which the model is used
|
* @param tree the tree in which the model is used
|
||||||
* @param state represents the current request
|
* @param state represents the current request
|
||||||
*
|
*
|
||||||
* @return a tree model that lists the hierarchy of folders underneath the
|
* @return a tree model that lists the hierarchy of folders underneath the
|
||||||
* folder returned by {@link #getRoot getRoot}.
|
* folder returned by {@link #getRoot getRoot}.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public TreeModel makeModel(final Tree tree, final PageState state) {
|
public TreeModel makeModel(final Tree tree, final PageState state) {
|
||||||
|
|
@ -77,19 +78,19 @@ public class FolderTreeModelBuilder extends LockableImpl
|
||||||
final PageState state) {
|
final PageState state) {
|
||||||
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
final FolderTreeModelController controller = cdiUtil.findBean(
|
final FolderTreeModelController controller = cdiUtil.findBean(
|
||||||
FolderTreeModelController.class);
|
FolderTreeModelController.class);
|
||||||
|
|
||||||
return controller.hasChildren(node);
|
return controller.hasChildren(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Iterator<TreeNode> getChildren(final TreeNode node,
|
public Iterator<TreeNode> getChildren(final TreeNode node,
|
||||||
final PageState state) {
|
final PageState state) {
|
||||||
final String nodeKey = node.getKey().toString();
|
final String nodeKey = node.getKey().toString();
|
||||||
|
|
||||||
// Always expand root node
|
// Always expand root node
|
||||||
if (nodeKey.equals(getRoot(state).getKey().toString())
|
if (nodeKey.equals(getRoot(state).getKey().toString())
|
||||||
&& tree.isCollapsed(nodeKey, state)) {
|
&& tree.isCollapsed(nodeKey, state)) {
|
||||||
tree.expand(nodeKey, state);
|
tree.expand(nodeKey, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -99,24 +100,22 @@ public class FolderTreeModelBuilder extends LockableImpl
|
||||||
|
|
||||||
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
final FolderTreeModelController controller = cdiUtil.findBean(
|
final FolderTreeModelController controller = cdiUtil.findBean(
|
||||||
FolderTreeModelController.class);
|
FolderTreeModelController.class);
|
||||||
|
|
||||||
final List<Folder> subFolders = controller.getChildren(node);
|
final List<Folder> subFolders = controller.getChildren(node);
|
||||||
return subFolders.stream()
|
return subFolders.stream()
|
||||||
.map(folder -> generateTreeNode(folder))
|
.map(folder -> generateTreeNode(folder))
|
||||||
.collect(Collectors.toList())
|
.collect(Collectors.toList())
|
||||||
.iterator();
|
.iterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
private TreeNode generateTreeNode(final Folder folder) {
|
private TreeNode generateTreeNode(final Folder folder) {
|
||||||
final FolderTreeNode node = new FolderTreeNode(folder);
|
final FolderTreeNode node = new FolderTreeNode(folder);
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*return new DataQueryTreeModel(getRoot(state).getID(),
|
/*return new DataQueryTreeModel(getRoot(state).getID(),
|
||||||
"com.arsdigita.cms.getRootFolder",
|
"com.arsdigita.cms.getRootFolder",
|
||||||
"com.arsdigita.cms.getSubFolders") {
|
"com.arsdigita.cms.getSubFolders") {
|
||||||
|
|
@ -171,7 +170,7 @@ public class FolderTreeModelBuilder extends LockableImpl
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
protected Folder getRootFolder(final PageState state)
|
protected Folder getRootFolder(final PageState state)
|
||||||
throws IllegalStateException {
|
throws IllegalStateException {
|
||||||
|
|
||||||
final ContentSection section = CMS.getContext().getContentSection();
|
final ContentSection section = CMS.getContext().getContentSection();
|
||||||
return section.getRootDocumentsFolder();
|
return section.getRootDocumentsFolder();
|
||||||
|
|
@ -194,12 +193,17 @@ public class FolderTreeModelBuilder extends LockableImpl
|
||||||
public Object getElement() {
|
public Object getElement() {
|
||||||
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
final GlobalizationHelper globalizationHelper = cdiUtil.findBean(
|
final GlobalizationHelper globalizationHelper = cdiUtil.findBean(
|
||||||
GlobalizationHelper.class);
|
GlobalizationHelper.class);
|
||||||
final Locale locale = globalizationHelper.getNegotiatedLocale();
|
final Locale locale = globalizationHelper.getNegotiatedLocale();
|
||||||
if (folder.getTitle().hasValue(locale)) {
|
if (folder.getTitle().hasValue(locale)) {
|
||||||
return folder.getTitle().getValue(locale);
|
return folder.getTitle().getValue(locale);
|
||||||
} else {
|
} else {
|
||||||
final String value = folder.getTitle().getValue();
|
final ConfigurationManager confManager = cdiUtil.findBean(
|
||||||
|
ConfigurationManager.class);
|
||||||
|
final KernelConfig kernelConfig = confManager.findConfiguration(
|
||||||
|
KernelConfig.class);
|
||||||
|
final String value = folder.getTitle().getValue(kernelConfig.
|
||||||
|
getDefaultLocale());
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
return folder.getName();
|
return folder.getName();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -118,3 +118,5 @@ cms.ui.edit_folder=Rename the current folder
|
||||||
cms.ui.authoring.create_new=Create new
|
cms.ui.authoring.create_new=Create new
|
||||||
cms.ui.authoring.go=Go
|
cms.ui.authoring.go=Go
|
||||||
empty_text=
|
empty_text=
|
||||||
|
cms.contenttypes.ui.title=Title
|
||||||
|
cms.contenttypes.ui.name=Name (URL fragment)
|
||||||
|
|
|
||||||
|
|
@ -117,3 +117,5 @@ cms.ui.edit_folder=Aktuellen Ordner umbenennen
|
||||||
cms.ui.authoring.create_new=Neuer Inhalt
|
cms.ui.authoring.create_new=Neuer Inhalt
|
||||||
cms.ui.authoring.go=Anlegen
|
cms.ui.authoring.go=Anlegen
|
||||||
empty_text=
|
empty_text=
|
||||||
|
cms.contenttypes.ui.title=Titel
|
||||||
|
cms.contenttypes.ui.name=Name (URL-Fragment)
|
||||||
|
|
|
||||||
|
|
@ -86,3 +86,5 @@ cms.ui.edit_folder=Rename the current folder
|
||||||
cms.ui.authoring.create_new=Create new
|
cms.ui.authoring.create_new=Create new
|
||||||
cms.ui.authoring.go=Go
|
cms.ui.authoring.go=Go
|
||||||
empty_text=
|
empty_text=
|
||||||
|
cms.contenttypes.ui.title=Title
|
||||||
|
cms.contenttypes.ui.name=Name (URL fragment)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue