Vervollständigung Multilanguage Support, insb. MPA Sektionstabelle.

git-svn-id: https://svn.libreccm.org/ccm/trunk@2213 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2013-06-16 12:58:36 +00:00
parent 95e4e1fd99
commit eaf4bb489f
12 changed files with 77 additions and 51 deletions

View File

@ -69,7 +69,7 @@ public class EventPropertiesStep extends SimpleEditStep {
editSheet = new EventPropertyForm(itemModel, this);
add(EDIT_SHEET_NAME,
"Edit",
GlobalizationUtil.globalize("cms.ui.edit"),
new WorkflowLockedComponentAccess(editSheet, itemModel),
editSheet.getSaveCancelSection().getCancelButton());

View File

@ -29,3 +29,6 @@ cms.contenttypes.ui.mparticle.section_table.link_delete=delete
cms.contenttypes.ui.mparticle.section_table.link_move=move
cms.contenttypes.ui.mparticle.section_table.link_edit=edit
cms.contenttypes.ui.mparticle.section.create_break=Create page break
cms.contenttypes.ui.mparticle.image.delete_button=Delete Image
cms.contenttypes.ui.mparticle.section_table.link_move_below=move belowe here
cms.contenttypes.ui.mparticle.section_table.link_not_defined=(No action possible)

View File

@ -1,4 +1,4 @@
mparticle.authoring.body_text.description=Edit the body text in sections
mparticle.authoring.body_text.description=Bearbeitung des Haupttextes in Abschnitten
cms.contenttypes.ui.mparticle.add_new_section=Neuen Abschnitt hinzuf\u00fcgen
cms.contenttypes.ui.mparticle.add_section=Abschnitt hinzuf\u00fcgen
cms.contenttypes.ui.mparticle.an_item_with_name_already_exists=Ein Element mit dem Namen existiert bereits.
@ -17,7 +17,7 @@ cms.contenttypes.ui.mparticle.no_sections_yet=Zur Zeit keine Abschnitte
cms.contenttypes.ui.mparticle.no_text_available=Kein Text verf\u00fcgbar
cms.contenttypes.ui.mparticle.section_text_asset=Section text asset
cms.contenttypes.ui.mparticle.section.title=Titel des Abschnitts:
cms.contenttypes.ui.mparticle.section.select_image=Select image:
cms.contenttypes.ui.mparticle.section.select_image=Bild ausw\u00e4hlen:
cms.contenttypes.ui.mparticle.submission_cancelled=Vorlage verworfen
cms.contenttypes.ui.mparticle.view_all_sections=Alle Abschnitte anschauen
cms.contenttypes.ui.mparticle.no_launch_date=Ver\u00f6ffentlichungsdatum fehlt
@ -29,3 +29,6 @@ cms.contenttypes.ui.mparticle.section_table.link_delete=l\u00f6schen
cms.contenttypes.ui.mparticle.section_table.link_move=verschieben
cms.contenttypes.ui.mparticle.section_table.link_edit=bearbeiten
cms.contenttypes.ui.mparticle.section.create_break=Seitenumbruch einf\u00fcgen
cms.contenttypes.ui.mparticle.image.delete_button=Bild Entfernen
cms.contenttypes.ui.mparticle.section_table.link_move_below=unterhalb verschieben
cms.contenttypes.ui.mparticle.section_table.link_not_defined=(Keine Aktion m\u00f6glich)

View File

@ -29,3 +29,6 @@ cms.contenttypes.ui.mparticle.section_table.link_delete=delete
cms.contenttypes.ui.mparticle.section_table.link_move=move
cms.contenttypes.ui.mparticle.section_table.link_edit=edit
cms.contenttypes.ui.mparticle.section.create_break=Create section break
cms.contenttypes.ui.mparticle.image.delete_button=Delete Image
cms.contenttypes.ui.mparticle.section_table.link_move_below=move belowe here
cms.contenttypes.ui.mparticle.section_table.link_not_defined=(No action possible)

View File

@ -76,8 +76,9 @@ public class ImageUploadSection extends FormSection
add(m_currentImage);
add(m_imageDisplay);
m_spacer = new Label("");
add(m_spacer);
m_deleteImage = new Submit("Delete Image");
add(m_spacer);
m_deleteImage = new Submit(MPArticleGlobalizationUtil.globalize(
"cms.contenttypes.ui.mparticle.current_image"));
add(m_deleteImage);
add(new Label(
MPArticleGlobalizationUtil
@ -118,14 +119,14 @@ public class ImageUploadSection extends FormSection
m_currentImage.setVisible(state, false);
m_imageDisplay.setVisible(state, false);
m_spacer.setVisible(state, false);
m_deleteImage.setVisible(state, false);
m_spacer.setVisible(state, false);
m_deleteImage.setVisible(state, false);
if ( image != null ) {
data.put(m_name + CAPTION, image.getDescription());
m_currentImage.setVisible(state, true);
m_imageDisplay.setVisible(state, true);
m_spacer.setVisible(state, true);
m_deleteImage.setVisible(state, true);
m_spacer.setVisible(state, true);
m_deleteImage.setVisible(state, true);
}
}

View File

@ -58,7 +58,7 @@ public class MultiPartArticleEdit extends SimpleEditStep {
setDefaultEditKey("edit");
MultiPartArticleForm form = getForm(itemModel);
add("edit",
"Edit",
GlobalizationUtil.globalize("cms.ui.edit"),
new WorkflowLockedComponentAccess(form, itemModel),
form.getSaveCancelSection().getCancelButton()
);

View File

@ -41,8 +41,6 @@ public class MultiPartArticleEditForm extends MultiPartArticleForm
public MultiPartArticleEditForm(ItemSelectionModel itemModel,
SimpleEditStep step) {
//I assume this was a typo, so I corrected it:
//super("MutliPartArticleEditForm", itemModel);
super("MultiPartArticleEditForm", itemModel);
addSubmissionListener(this);
m_step = step;

View File

@ -148,7 +148,8 @@ public class MultiPartArticleViewSections extends ResettableContainer
MultiPartArticle article = (MultiPartArticle)m_selArticle
.getSelectedObject(state);
article.changeSectionRank((BigDecimal)m_moveSection.getSelectedKey(state), 1);
article.changeSectionRank(
(BigDecimal)m_moveSection.getSelectedKey(state), 1);
m_moveSection.setSelectedKey(state, null);
}
});

View File

@ -31,6 +31,7 @@ import com.arsdigita.bebop.table.TableColumn;
import com.arsdigita.bebop.table.TableColumnModel;
import com.arsdigita.bebop.table.TableModel;
import com.arsdigita.bebop.table.TableModelBuilder;
import com.arsdigita.cms.CMS;
import com.arsdigita.cms.ContentItem;
import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.SecurityManager;
@ -256,17 +257,30 @@ public class SectionTable extends Table
if ( columnIndex == COL_INDEX_TITLE ) {
return m_section.getTitle();
} else if ( columnIndex == COL_INDEX_EDIT ) {
return "edit";
//return new Label(MPArticleGlobalizationUtil.globalize(
// "cms.contenttypes.ui.mparticle.section_table.link_edit")
// );
//return "edit";
return new Label(
MPArticleGlobalizationUtil.globalize(
"cms.contenttypes.ui.mparticle.section_table.link_edit")
);
} else if ( columnIndex == COL_INDEX_DELETE ) {
return "delete";
// return "delete";
return new Label(
MPArticleGlobalizationUtil.globalize(
"cms.contenttypes.ui.mparticle.section_table.link_delete")
);
} else if ( columnIndex == COL_INDEX_MOVE ) {
if ( m_moveSection.getSelectedKey(m_state) == null ) {
return "move";
// return "move";
return new Label(
MPArticleGlobalizationUtil.globalize(
"cms.contenttypes.ui.mparticle.section_table.link_move")
);
} else {
return "move below here";
// return "move below here";
return new Label(
MPArticleGlobalizationUtil.globalize(
"cms.contenttypes.ui.mparticle.section_table.link_move_below")
);
}
}
@ -283,9 +297,11 @@ public class SectionTable extends Table
}
/**
*
*/
public class SectionTableCellRenderer extends LockableImpl
implements TableCellRenderer
{
implements TableCellRenderer {
private boolean m_active;
@ -302,26 +318,33 @@ public class SectionTable extends Table
Object key, int row, int column ) {
Component ret = null;
SecurityManager sm = Utilities.getSecurityManager(state);
// SecurityManager sm = Utilities.getSecurityManager(state);
SecurityManager sm = CMS.getSecurityManager(state);
ContentItem item = (ContentItem)m_selArticle.getSelectedObject(state);
boolean active = m_active &&
sm.canAccess(state.getRequest(), SecurityManager.EDIT_ITEM,
item);
boolean active = m_active && sm.canAccess(state.getRequest(),
SecurityManager.EDIT_ITEM,
item);
if ( value instanceof Component ) {
ret = (Component)value;
} else {
if ( value == null ) {
ret = new Label("", false);
if ( value instanceof Label ) {
if ( active ) {
ret = new ControlLink((Component)value);
} else {
if ( active ) {
ret = new ControlLink(value.toString());
} else {
ret = new Label(value.toString());
}
} // if ( value == null )
} // if ( value instanceof Component )
ret = (Component)value;
}
} else if ( value instanceof String ) {
// Backwards compatibility, should be removed asap!
if ( active ) {
ret = new ControlLink(value.toString());
} else {
ret = new Label(value.toString());
}
} else {
ret = new Label(MPArticleGlobalizationUtil.globalize(
"cms.contenttypes.ui.mparticle.section_table.link_not_defined"),
false);
}
return ret;
}

View File

@ -60,11 +60,8 @@ public class PressReleasePropertiesStep extends SimpleEditStep {
BasicPageForm editSheet;
editSheet = new PressReleasePropertyForm( itemModel, this);
// SecurityPropertyEditor#add currently accepts just a String as label
// parameter. As soon as it is refactored, a GlobalizedMessage or a
// Label should be used.
add( EDIT_SHEET_NAME,
"Edit",
GlobalizationUtil.globalize("cms.ui.edit"),
new WorkflowLockedComponentAccess(editSheet, itemModel),
editSheet.getSaveCancelSection().getCancelButton() );

View File

@ -27,15 +27,12 @@ import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.Service;
import com.arsdigita.cms.contenttypes.util.ServiceGlobalizationUtil;
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
import com.arsdigita.domain.DomainObject;
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
import com.arsdigita.cms.util.GlobalizationUtil;
import java.text.DateFormat;
/**
* Authoring step to edit the simple attributes of the Service content type (and
* its subclasses). The attributes edited are 'name', 'title', 'summary',
@ -58,7 +55,7 @@ public class ServicePropertiesStep extends SimpleEditStep {
editSheet = new ServicePropertyForm(itemModel,this);
add(EDIT_SHEET_NAME,
"Edit", // currently just a String is acepted!
GlobalizationUtil.globalize("cms.ui.edit"),
new WorkflowLockedComponentAccess(editSheet, itemModel),
editSheet.getSaveCancelSection().getCancelButton());

View File

@ -57,19 +57,21 @@ public class GenericAddressPropertyForm extends BasicPageForm
FormSubmissionListener {
private static final Logger s_log = Logger.getLogger(GenericAddressPropertyForm.class);
public static final String ID = "Address_edit";
private GenericAddressPropertiesStep m_step;
public static final String ADDRESS = GenericAddress.ADDRESS;
public static final String POSTAL_CODE = GenericAddress.POSTAL_CODE;
public static final String CITY = GenericAddress.CITY;
public static final String STATE = GenericAddress.STATE;
public static final String ISO_COUNTRY_CODE = GenericAddress.ISO_COUNTRY_CODE;
public static final String ID = "Address_edit";
public GenericAddressPropertyForm(ItemSelectionModel itemModel) {
this(itemModel, null);
}
public GenericAddressPropertyForm(ItemSelectionModel itemModel, GenericAddressPropertiesStep step) {
public GenericAddressPropertyForm(ItemSelectionModel itemModel,
GenericAddressPropertiesStep step) {
super(ID, itemModel);
m_step = step;
addSubmissionListener(this);
@ -93,7 +95,6 @@ public class GenericAddressPropertyForm extends BasicPageForm
.globalize("cms.contenttypes.ui.address.postal_code")));
ParameterModel postalCodeParam = new StringParameter(POSTAL_CODE);
TextField postalCode = new TextField(postalCodeParam);
/* XXX NumberListener ?*/
add(postalCode);
add(new Label(ContenttypesGlobalizationUtil
@ -115,7 +116,6 @@ public class GenericAddressPropertyForm extends BasicPageForm
countryParam.addParameterListener(new StringInRangeValidationListener(0, 2));
SingleSelect country = new SingleSelect(countryParam);
country.addOption(new Option("",
new Label(GlobalizationUtil
.globalize("cms.ui.select_one"))));