Some minor formatting, some Globalikzation keys added.

git-svn-id: https://svn.libreccm.org/ccm/trunk@2526 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2014-02-18 09:44:37 +00:00
parent 648076f171
commit 757675c0e6
13 changed files with 84 additions and 43 deletions

View File

@ -58,9 +58,10 @@ public class Initializer extends CompoundInitializer {
final String url = RuntimeConfig.getConfig().getJDBCURL(); final String url = RuntimeConfig.getConfig().getJDBCURL();
final int database = DbHelper.getDatabaseFromURL(url); final int database = DbHelper.getDatabaseFromURL(url);
add(new PDLInitializer(new ManifestSource("ccm-atoz.pdl.mf", add(new PDLInitializer(new ManifestSource(
new NameFilter(DbHelper. "ccm-atoz.pdl.mf",
getDatabaseSuffix(database), "pdl")))); new NameFilter(DbHelper.getDatabaseSuffix(database), "pdl"))
));
} }
/** /**

View File

@ -1067,3 +1067,4 @@ cms.ui.remove_home_folder=Remove home folder
cms.ui.move.category=Move category "{0}" to cms.ui.move.category=Move category "{0}" to
cms.ui.category.move=Move category cms.ui.category.move=Move category
cms.ui.category.cantmoved=This category can't be moved cms.ui.category.cantmoved=This category can't be moved
cms.ui.authoring.error_conflicts_with_this_url=There are conflicts with this URL. Specifically, there is at least one item in the same category as this item with the name (url) of

View File

@ -1061,3 +1061,4 @@ cms.ui.remove_home_folder=Start-Ordner zur\u00fccksetzen
cms.ui.move.category=Verschiebe Kategorie "{0}" nach cms.ui.move.category=Verschiebe Kategorie "{0}" nach
cms.ui.category.move=Kategorie verschieben cms.ui.category.move=Kategorie verschieben
cms.ui.category.cantmoved=Diese Kategorie kann nicht verschoben werden cms.ui.category.cantmoved=Diese Kategorie kann nicht verschoben werden
cms.ui.authoring.error_conflicts_with_this_url=Es gibt Konflikte mit dieser URL. Insbesondere gibt es mindestens ein Dokument in der gleichen Kategorie wie dieser mit dem Namen (URL)

View File

@ -115,3 +115,4 @@ cms.ui.remove_home_folder=Remove home folder
cms.ui.move.category=Move category "{0}" to cms.ui.move.category=Move category "{0}" to
cms.ui.category.move=Move category cms.ui.category.move=Move category
cms.ui.category.cantmoved=This category can't be moved cms.ui.category.cantmoved=This category can't be moved
cms.ui.authoring.error_conflicts_with_this_url=There are conflicts with this URL. Specifically, there is at least one item in the same category as this item with the name (url) of

View File

@ -589,3 +589,4 @@ cms.ui.remove_home_folder=
cms.ui.move.category=Move category "{0}" to cms.ui.move.category=Move category "{0}" to
cms.ui.category.move=Move category cms.ui.category.move=Move category
cms.ui.category.cantmoved=This category can't be moved cms.ui.category.cantmoved=This category can't be moved
cms.ui.authoring.error_conflicts_with_this_url=There are conflicts with this URL. Specifically, there is atleast one item in the same category as this item with the name (url) of

View File

@ -139,7 +139,8 @@ public abstract class BasicItemForm extends FormSection
/** /**
* */ * Currently, to insert javascript code the Label Widget is "abused".
*/
private Label m_script = new Label( private Label m_script = new Label(
"<script language=\"javascript\" src=\"/javascript/manipulate-input.js\"></script>", "<script language=\"javascript\" src=\"/javascript/manipulate-input.js\"></script>",
false); false);
@ -189,7 +190,7 @@ public abstract class BasicItemForm extends FormSection
titleWidget.setHint(getTitleHint()); titleWidget.setHint(getTitleHint());
add(titleWidget); add(titleWidget);
// For some content types it is maybe useful to change the label of // For some content types it may be useful to change the label of
// the name (or URL) field to something different than 'name (url)'. // the name (or URL) field to something different than 'name (url)'.
// This can now be accomplished by overwriting the getNameLabel() method. // This can now be accomplished by overwriting the getNameLabel() method.
// (jensp 2011-01-28) // (jensp 2011-01-28)
@ -273,6 +274,13 @@ public abstract class BasicItemForm extends FormSection
validateNameUniqueness(parent, event, newName); validateNameUniqueness(parent, event, newName);
} }
/**
*
* @param parent
* @param event
* @param newName
* @throws FormProcessException
*/
public void validateNameUniqueness(Folder parent, FormSectionEvent event, public void validateNameUniqueness(Folder parent, FormSectionEvent event,
String newName) String newName)
throws FormProcessException { throws FormProcessException {
@ -359,11 +367,9 @@ public abstract class BasicItemForm extends FormSection
while (query.next()) { while (query.next()) {
itemID = (BigDecimal) query.get("itemID"); itemID = (BigDecimal) query.get("itemID");
if (!list.contains(itemID)) { if (!list.contains(itemID)) {
StringBuffer buffer = StringBuffer buffer = new StringBuffer((String) GlobalizationUtil
new StringBuffer("There are conflicts with this URL. " .globalize("cms.ui.authoring.error_conflicts_with_this_url")
+ "Specifically, there is at least one item " .localize() );
+ "in the same category as this item with "
+ "the name (url) of ");
buffer.append(url); buffer.append(url);
throw new FormProcessException(buffer.toString()); throw new FormProcessException(buffer.toString());
} }

View File

@ -124,6 +124,11 @@ public class CreationSelector extends MetaForm {
} }
/**
*
* @param state
* @return
*/
@Override @Override
public Form buildForm(PageState state) { public Form buildForm(PageState state) {
BigDecimal typeID = (BigDecimal)m_typeSel.getSelectedKey(state); BigDecimal typeID = (BigDecimal)m_typeSel.getSelectedKey(state);
@ -151,7 +156,11 @@ public class CreationSelector extends MetaForm {
return returnForm; return returnForm;
} }
// Add the item_id parameter /**
* Add the item_id parameter.
*
* @param p
*/
@Override @Override
public void register(Page p) { public void register(Page p) {
super.register(p); super.register(p);
@ -159,7 +168,13 @@ public class CreationSelector extends MetaForm {
p.addComponentStateParam(this, m_bundleId); p.addComponentStateParam(this, m_bundleId);
} }
// Get the creation component /**
* Get the creation component.
*
* @param kit
* @param type
* @return
*/
protected Component instantiateKitComponent protected Component instantiateKitComponent
(final AuthoringKit kit, final ContentType type) { (final AuthoringKit kit, final ContentType type) {
String creatorName = kit.getCreateComponent(); String creatorName = kit.getCreateComponent();
@ -197,29 +212,6 @@ public class CreationSelector extends MetaForm {
return (Folder) m_folderSel.getSelectedObject(s); return (Folder) m_folderSel.getSelectedObject(s);
} }
// public final void xsetContentBundle(PageState s, ContentBundle bundle) {
// m_bundleSel.setSelectedObject(s, bundle);
// }
// public final ContentBundle xgetContentBundle(final PageState state) {
// final ContentBundle current = (ContentBundle)
// m_bundleSel.getSelectedItem(state);
// if (current == null) {
// final Folder folder = getFolder(state);
// final ContentBundle bundle = new ContentBundle();
// bundle.setParent(folder);
// bundle.setContentSection(folder.getContentSection());
// m_bundleSel.setSelectedObject(state, bundle);
// return bundle;
// } else {
// return current;
// }
// }
/** /**
* Return the currently selected content section. New items created by * Return the currently selected content section. New items created by
* creation components will belong to this section. This is the content * creation components will belong to this section. This is the content

View File

@ -178,15 +178,28 @@ public abstract class NewItemForm extends Form {
public abstract ContentSection getContentSection(PageState state); public abstract ContentSection getContentSection(PageState state);
/**
*
* @param state
* @return
*/
public BigDecimal getTypeID(PageState state) { public BigDecimal getTypeID(PageState state) {
return (BigDecimal) m_typeWidget.getValue(state); return (BigDecimal) m_typeWidget.getValue(state);
} }
/**
*
* @return
*/
public final SingleSelect getTypeSelect() { public final SingleSelect getTypeSelect() {
return m_typeWidget; return m_typeWidget;
} }
// Generate XML - show/hide labels/widgets /**
* Generate XML - show/hide labels/widgets
* @param state
* @param parent
*/
@Override @Override
public void generateXML(PageState state, Element parent) { public void generateXML(PageState state, Element parent) {

View File

@ -118,8 +118,8 @@ public class PageCreate extends BasicPageForm
return m_workflowSection; return m_workflowSection;
} }
/** create a new item id /**
* * Create a new item id.
*/ */
public void init(FormSectionEvent e) throws FormProcessException { public void init(FormSectionEvent e) throws FormProcessException {
// this is currently a no-op // this is currently a no-op

View File

@ -82,6 +82,7 @@ import java.util.Date;
import java.util.Iterator; import java.util.Iterator;
import java.util.TooManyListenersException; import java.util.TooManyListenersException;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
@ -208,7 +209,8 @@ public class PageCreateDynamic extends FormSection
m_parentComponent = (CreationComponent) tempComponent; m_parentComponent = (CreationComponent) tempComponent;
} }
} catch (Exception e) { } catch (Exception e) {
// could not instantiate parent's creation component -- start from scratch... // could not instantiate parent's creation component
// -- start from scratch...
} }
} else { } else {
m_parentComponent = new PageCreate(m_itemModel, parent); m_parentComponent = new PageCreate(m_itemModel, parent);
@ -231,7 +233,8 @@ public class PageCreateDynamic extends FormSection
//setMethod(Form.POST); //setMethod(Form.POST);
//setEncType("multipart/form-data"); //setEncType("multipart/form-data");
} else { } else {
add(new Label(GlobalizationUtil.globalize("cms.ui.authoring.invalid_create_component"))); add(new Label(GlobalizationUtil.globalize(
"cms.ui.authoring.invalid_create_component")));
} }
} }
@ -383,7 +386,9 @@ public class PageCreateDynamic extends FormSection
if(getSaveCancelSection().getCancelButton().isSelected(state)) { if(getSaveCancelSection().getCancelButton().isSelected(state)) {
m_parent.redirectBack(state); m_parent.redirectBack(state);
throw new FormProcessException( (String) GlobalizationUtil.globalize("cms.ui.authoring.submission_cancelled").localize()); throw new FormProcessException( (String) GlobalizationUtil
.globalize("cms.ui.authoring.submission_cancelled")
.localize());
} }
} }

View File

@ -28,13 +28,27 @@ import com.arsdigita.persistence.SessionManager;
import java.math.BigDecimal; import java.math.BigDecimal;
/**
*
*
*/
final class ChildUniqueValidationListener implements ParameterListener { final class ChildUniqueValidationListener implements ParameterListener {
private final FolderRequestLocal m_parent; private final FolderRequestLocal m_parent;
/**
* Constructor.
* @param parent
*/
public ChildUniqueValidationListener(final FolderRequestLocal parent) { public ChildUniqueValidationListener(final FolderRequestLocal parent) {
m_parent = parent; m_parent = parent;
} }
/**
*
* @param e
* @throws FormProcessException
*/
public final void validate(final ParameterEvent e) public final void validate(final ParameterEvent e)
throws FormProcessException { throws FormProcessException {
final PageState state = e.getPageState(); final PageState state = e.getPageState();
@ -45,6 +59,12 @@ final class ChildUniqueValidationListener implements ParameterListener {
} }
} }
/**
*
* @param parent
* @param name
* @throws FormProcessException
*/
private void validateNameUniqueness(final Folder parent, private void validateNameUniqueness(final Folder parent,
final String name) final String name)
throws FormProcessException { throws FormProcessException {