Anpassung und Vervollständigung ResourceBundles sowie Sprachumschaltung abgeschlossen.
git-svn-id: https://svn.libreccm.org/ccm/trunk@2195 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
c25964196a
commit
4845af7490
|
|
@ -1,9 +1,15 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ctd:content-types xmlns:ctd="http://xmlns.redhat.com/cms/content-types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
|
<ctd:content-types xmlns:ctd="http://xmlns.redhat.com/cms/content-types"
|
||||||
<ctd:content-type label="Agenda" description="An article type with image" objectType="com.arsdigita.cms.contenttypes.Agenda" classname="com.arsdigita.cms.contenttypes.Agenda">
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
|
||||||
|
<ctd:content-type label="Agenda"
|
||||||
|
description="An article type with image"
|
||||||
|
objectType="com.arsdigita.cms.contenttypes.Agenda"
|
||||||
|
classname="com.arsdigita.cms.contenttypes.Agenda">
|
||||||
|
|
||||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
|
<ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
|
||||||
|
|
||||||
<ctd:authoring-step
|
<ctd:authoring-step
|
||||||
labelKey="cms.contenttypes.shared.basic_properties.title"
|
labelKey="cms.contenttypes.shared.basic_properties.title"
|
||||||
labelBundle="com.arsdigita.cms.CMSResources"
|
labelBundle="com.arsdigita.cms.CMSResources"
|
||||||
descriptionKey="cms.contenttypes.shared.basic_properties.description"
|
descriptionKey="cms.contenttypes.shared.basic_properties.description"
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ctd:content-types xmlns:ctd="http://xmlns.redhat.com/cms/content-types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
|
<ctd:content-types xmlns:ctd="http://xmlns.redhat.com/cms/content-types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
|
||||||
<ctd:content-type label="FAQ Item"
|
<ctd:content-type label="FAQ Item"
|
||||||
description="An FAQ item type"
|
description="An FAQ item type"
|
||||||
objectType="com.arsdigita.cms.contenttypes.FAQItem"
|
objectType="com.arsdigita.cms.contenttypes.FAQItem"
|
||||||
classname="com.arsdigita.cms.contenttypes.FAQItem">
|
classname="com.arsdigita.cms.contenttypes.FAQItem">
|
||||||
|
<!--
|
||||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.authoring.FAQItemCreate">
|
<ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.authoring.FAQItemCreate">
|
||||||
|
-->
|
||||||
|
<ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
|
||||||
|
|
||||||
<ctd:authoring-step
|
<ctd:authoring-step
|
||||||
labelKey="cms.contenttypes.shared.basic_properties.title"
|
labelKey="cms.contenttypes.shared.basic_properties.title"
|
||||||
|
|
@ -15,9 +17,9 @@
|
||||||
component="com.arsdigita.cms.contenttypes.ui.FAQItemPropertiesStep"
|
component="com.arsdigita.cms.contenttypes.ui.FAQItemPropertiesStep"
|
||||||
ordering="1"/>
|
ordering="1"/>
|
||||||
|
|
||||||
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
|
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
|
||||||
|
|
||||||
</ctd:authoring-kit>
|
</ctd:authoring-kit>
|
||||||
</ctd:content-type>
|
</ctd:content-type>
|
||||||
</ctd:content-types>
|
</ctd:content-types>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,7 @@ public class FAQItem extends ContentPage {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search stuff to allow the content type to be searchable
|
// Search stuff to allow the content type to be searchable
|
||||||
|
@Override
|
||||||
public String getSearchSummary() {
|
public String getSearchSummary() {
|
||||||
return getQuestion();
|
return getQuestion();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
#(see src/WEB-INF/.../FAQItem.xml)
|
||||||
faq_item.authoring.basic_properties.description=Edit question and answer
|
faq_item.authoring.basic_properties.description=Edit question and answer
|
||||||
cms.contenttypes.ui.faq.question=Question:
|
cms.contenttypes.ui.faq.question=Question:
|
||||||
cms.contenttypes.ui.faq.answer=Answer:
|
cms.contenttypes.ui.faq.answer=Answer:
|
||||||
|
|
|
||||||
|
|
@ -28,18 +28,23 @@ import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||||
import com.arsdigita.cms.contenttypes.util.FAQGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.FAQGlobalizationUtil;
|
||||||
|
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Authoring step to edit the simple attributes of the FAQItem content
|
* Authoring step displays the simple attributes of the FAQItem content
|
||||||
* type (and its subclasses).
|
* type (and its subclasses) and provides a link to the edit form.
|
||||||
*/
|
*/
|
||||||
public class FAQItemPropertiesStep
|
public class FAQItemPropertiesStep extends SimpleEditStep {
|
||||||
extends SimpleEditStep {
|
|
||||||
|
|
||||||
/** The name of the editing sheet added to this step */
|
/** The name of the editing sheet added to this step */
|
||||||
public static final String EDIT_SHEET_NAME = "edit";
|
public static final String EDIT_SHEET_NAME = "edit";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
* @param itemModel
|
||||||
|
* @param parent
|
||||||
|
*/
|
||||||
public FAQItemPropertiesStep( ItemSelectionModel itemModel,
|
public FAQItemPropertiesStep( ItemSelectionModel itemModel,
|
||||||
AuthoringKitWizard parent ) {
|
AuthoringKitWizard parent ) {
|
||||||
super( itemModel, parent );
|
super( itemModel, parent );
|
||||||
|
|
@ -67,11 +72,21 @@ public class FAQItemPropertiesStep
|
||||||
itemModel ) {
|
itemModel ) {
|
||||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( itemModel );
|
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( itemModel );
|
||||||
|
|
||||||
sheet.add( FAQGlobalizationUtil.globalize("cms.ui.authoring.name_url"), FAQItem.NAME );
|
sheet.add( GlobalizationUtil
|
||||||
sheet.add( FAQGlobalizationUtil.globalize("cms.ui.authoring.page_title"), FAQItem.TITLE );
|
.globalize("cms.contenttypes.ui.title"),
|
||||||
sheet.add( FAQGlobalizationUtil.globalize("cms.contenttypes.ui.faq.question"), FAQItem.QUESTION );
|
FAQItem.TITLE );
|
||||||
sheet.add( FAQGlobalizationUtil.globalize("cms.contenttypes.ui.faq.answer"), FAQItem.ANSWER );
|
sheet.add( GlobalizationUtil
|
||||||
sheet.add( FAQGlobalizationUtil.globalize("cms.contenttypes.ui.faq.sectionName"), FAQItem.SECTION_NAME );
|
.globalize("cms.contenttypes.ui.name"),
|
||||||
|
FAQItem.NAME );
|
||||||
|
sheet.add( FAQGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.faq.question"),
|
||||||
|
FAQItem.QUESTION );
|
||||||
|
sheet.add( FAQGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.faq.answer"),
|
||||||
|
FAQItem.ANSWER );
|
||||||
|
sheet.add( FAQGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.faq.sectionName"),
|
||||||
|
FAQItem.SECTION_NAME );
|
||||||
|
|
||||||
return sheet;
|
return sheet;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.cms.contenttypes.FAQItem;
|
import com.arsdigita.cms.contenttypes.FAQItem;
|
||||||
import com.arsdigita.cms.contenttypes.util.FAQGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.InlinesiteGlobalizationUtil;
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
import com.arsdigita.bebop.event.FormInitListener;
|
import com.arsdigita.bebop.event.FormInitListener;
|
||||||
|
|
@ -39,9 +39,10 @@ import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
* Form to edit the basic properties of an FAQItem. This form can be
|
* Form to edit the basic properties of an FAQItem. This form can be
|
||||||
* extended to create forms for FAQItem subclasses.
|
* extended to create forms for FAQItem subclasses.
|
||||||
*/
|
*/
|
||||||
public class FAQItemPropertyForm
|
public class FAQItemPropertyForm extends BasicPageForm
|
||||||
extends BasicPageForm
|
implements FormProcessListener,
|
||||||
implements FormProcessListener, FormInitListener,FormSubmissionListener {
|
FormInitListener,
|
||||||
|
FormSubmissionListener {
|
||||||
|
|
||||||
private FAQItemPropertiesStep m_step;
|
private FAQItemPropertiesStep m_step;
|
||||||
|
|
||||||
|
|
@ -63,6 +64,7 @@ public class FAQItemPropertyForm
|
||||||
public FAQItemPropertyForm( ItemSelectionModel itemModel ) {
|
public FAQItemPropertyForm( ItemSelectionModel itemModel ) {
|
||||||
this(itemModel,null);
|
this(itemModel,null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new form to edit the FAQItem object specified by the item
|
* Creates a new form to edit the FAQItem object specified by the item
|
||||||
* selection model passed in.
|
* selection model passed in.
|
||||||
|
|
@ -83,7 +85,8 @@ public class FAQItemPropertyForm
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
add( new Label(FAQGlobalizationUtil.globalize("cms.contenttypes.ui.faq.question")) );
|
add( new Label(InlinesiteGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.faq.question")) );
|
||||||
ParameterModel questionParam
|
ParameterModel questionParam
|
||||||
= new StringParameter( QUESTION );
|
= new StringParameter( QUESTION );
|
||||||
questionParam
|
questionParam
|
||||||
|
|
@ -93,7 +96,8 @@ public class FAQItemPropertyForm
|
||||||
question.setRows( 5 );
|
question.setRows( 5 );
|
||||||
add( question );
|
add( question );
|
||||||
|
|
||||||
add( new Label(FAQGlobalizationUtil.globalize("cms.contenttypes.ui.faq.answer")) );
|
add( new Label(InlinesiteGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.faq.answer")) );
|
||||||
ParameterModel answerParam = new StringParameter( ANSWER );
|
ParameterModel answerParam = new StringParameter( ANSWER );
|
||||||
answerParam
|
answerParam
|
||||||
.addParameterListener( new NotNullValidationListener() );
|
.addParameterListener( new NotNullValidationListener() );
|
||||||
|
|
@ -102,7 +106,8 @@ public class FAQItemPropertyForm
|
||||||
answer.setRows( 5 );
|
answer.setRows( 5 );
|
||||||
add( answer );
|
add( answer );
|
||||||
|
|
||||||
add( new Label(FAQGlobalizationUtil.globalize("cms.contenttypes.ui.faq.sectionName")) );
|
add( new Label(InlinesiteGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.faq.sectionName")) );
|
||||||
ParameterModel sectionNameParam = new StringParameter( SECTION_NAME );
|
ParameterModel sectionNameParam = new StringParameter( SECTION_NAME );
|
||||||
TextField sectionName = new TextField(sectionNameParam);
|
TextField sectionName = new TextField(sectionNameParam);
|
||||||
add(sectionName);
|
add(sectionName);
|
||||||
|
|
|
||||||
|
|
@ -32,10 +32,10 @@ import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.cms.contenttypes.util.FAQGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.InlinesiteGlobalizationUtil;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* A page that will create a new FAQItem.
|
* A page that will create a new FAQItem.
|
||||||
*
|
*
|
||||||
* @author Dirk Gomez
|
* @author Dirk Gomez
|
||||||
|
|
@ -49,6 +49,12 @@ public class FAQItemCreate extends PageCreate {
|
||||||
|
|
||||||
private CreationSelector m_parent;
|
private CreationSelector m_parent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor initializes the form by delegating to parent class.
|
||||||
|
*
|
||||||
|
* @param itemModel
|
||||||
|
* @param parent
|
||||||
|
*/
|
||||||
public FAQItemCreate(ItemSelectionModel itemModel,
|
public FAQItemCreate(ItemSelectionModel itemModel,
|
||||||
CreationSelector parent) {
|
CreationSelector parent) {
|
||||||
|
|
||||||
|
|
@ -56,6 +62,10 @@ public class FAQItemCreate extends PageCreate {
|
||||||
m_parent = parent;
|
m_parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add form-specific widgets by overwriting parent class method.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
|
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
@ -65,7 +75,8 @@ public class FAQItemCreate extends PageCreate {
|
||||||
question.setCols(40);
|
question.setCols(40);
|
||||||
question.setRows(5);
|
question.setRows(5);
|
||||||
|
|
||||||
add(new Label(FAQGlobalizationUtil.globalize("cms.contenttypes.ui.faq.question")));
|
add(new Label(InlinesiteGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.faq.question")));
|
||||||
add(question);
|
add(question);
|
||||||
|
|
||||||
TextArea answer = new TextArea(ANSWER);
|
TextArea answer = new TextArea(ANSWER);
|
||||||
|
|
@ -73,10 +84,17 @@ public class FAQItemCreate extends PageCreate {
|
||||||
answer.setCols(40);
|
answer.setCols(40);
|
||||||
answer.setRows(5);
|
answer.setRows(5);
|
||||||
|
|
||||||
add(new Label(FAQGlobalizationUtil.globalize("cms.contenttypes.ui.faq.answer")));
|
add(new Label(InlinesiteGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.faq.answer")));
|
||||||
add(answer);
|
add(answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param e
|
||||||
|
* @throws FormProcessException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
public void process(FormSectionEvent e) throws FormProcessException {
|
public void process(FormSectionEvent e) throws FormProcessException {
|
||||||
|
|
||||||
FormData data = e.getFormData();
|
FormData data = e.getFormData();
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ public class FAQGlobalizationUtil implements Globalized {
|
||||||
|
|
||||||
/** Name of Java resource files to handle FAQ's globalisation. */
|
/** Name of Java resource files to handle FAQ's globalisation. */
|
||||||
final public static String BUNDLE_NAME =
|
final public static String BUNDLE_NAME =
|
||||||
"com.arsdigita.cms.contenttypes.FAQItemResources";
|
"com.arsdigita.cms.contenttypes.FAQItemResources";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This returns a globalized message using the package specific bundle,
|
* This returns a globalized message using the package specific bundle,
|
||||||
|
|
|
||||||
|
|
@ -18,13 +18,14 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.bebop.Component;
|
||||||
import com.arsdigita.cms.contenttypes.GlossaryItem;
|
import com.arsdigita.cms.contenttypes.GlossaryItem;
|
||||||
import com.arsdigita.cms.contenttypes.util.GlossaryGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.GlossaryGlobalizationUtil;
|
||||||
import com.arsdigita.bebop.Component;
|
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||||
|
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||||
|
|
||||||
|
|
@ -66,9 +67,15 @@ public class GlossaryItemPropertiesStep
|
||||||
itemModel ) {
|
itemModel ) {
|
||||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( itemModel );
|
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( itemModel );
|
||||||
|
|
||||||
sheet.add(GlossaryGlobalizationUtil.globalize("cms.ui.authoring.name_url"), GlossaryItem.NAME );
|
sheet.add(GlossaryGlobalizationUtil
|
||||||
sheet.add(GlossaryGlobalizationUtil.globalize("cms.contenttypes.ui.glossary.term"), GlossaryItem.TITLE );
|
.globalize("cms.contenttypes.ui.glossary.term"),
|
||||||
sheet.add(GlossaryGlobalizationUtil.globalize("cms.contenttypes.ui.glossary.definition"), GlossaryItem.DEFINITION );
|
GlossaryItem.TITLE );
|
||||||
|
sheet.add(GlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.name"),
|
||||||
|
GlossaryItem.NAME );
|
||||||
|
sheet.add(GlossaryGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.glossary.definition"),
|
||||||
|
GlossaryItem.DEFINITION );
|
||||||
|
|
||||||
return sheet;
|
return sheet;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,22 +18,25 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.cms.contenttypes.GlossaryItem;
|
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.event.FormInitListener;
|
import com.arsdigita.bebop.event.FormInitListener;
|
||||||
import com.arsdigita.bebop.event.FormProcessListener;
|
import com.arsdigita.bebop.event.FormProcessListener;
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||||
|
import com.arsdigita.cms.contenttypes.GlossaryItem;
|
||||||
|
import com.arsdigita.cms.contenttypes.util.GlossaryGlobalizationUtil;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form to edit the basic properties of an GlossaryItem. This form can be
|
* Form to edit the basic properties of an GlossaryItem. This form can be
|
||||||
* extended to create forms for GlossaryItem subclasses.
|
* extended to create forms for GlossaryItem subclasses.
|
||||||
*/
|
*/
|
||||||
public class GlossaryItemPropertyForm
|
public class GlossaryItemPropertyForm extends BasicPageForm
|
||||||
extends BasicPageForm
|
implements FormProcessListener,
|
||||||
implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
FormInitListener,
|
||||||
|
FormSubmissionListener {
|
||||||
|
|
||||||
private GlossaryItemPropertiesStep m_step;
|
private GlossaryItemPropertiesStep m_step;
|
||||||
|
|
||||||
|
|
@ -61,7 +64,8 @@ public class GlossaryItemPropertyForm
|
||||||
* work on
|
* work on
|
||||||
* @param step The GlossaryItemPropertiesStep which controls this form.
|
* @param step The GlossaryItemPropertiesStep which controls this form.
|
||||||
**/
|
**/
|
||||||
public GlossaryItemPropertyForm( ItemSelectionModel itemModel, GlossaryItemPropertiesStep step ) {
|
public GlossaryItemPropertyForm( ItemSelectionModel itemModel,
|
||||||
|
GlossaryItemPropertiesStep step ) {
|
||||||
super( ID, itemModel );
|
super( ID, itemModel );
|
||||||
m_step = step;
|
m_step = step;
|
||||||
addSubmissionListener(this);
|
addSubmissionListener(this);
|
||||||
|
|
@ -71,7 +75,10 @@ public class GlossaryItemPropertyForm
|
||||||
/**
|
/**
|
||||||
* Adds widgets to the form.
|
* Adds widgets to the form.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
|
|
||||||
|
/** Insert default widgets (title/name) */
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
GlossaryItemWidgetBuilder builder = new GlossaryItemWidgetBuilder();
|
GlossaryItemWidgetBuilder builder = new GlossaryItemWidgetBuilder();
|
||||||
|
|
@ -79,6 +86,16 @@ public class GlossaryItemPropertyForm
|
||||||
add(builder.makeDefinitionArea());
|
add(builder.makeDefinitionArea());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replace the default Label ("Title") by a module specific one.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected GlobalizedMessage getTitleLabel() {
|
||||||
|
return GlossaryGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.glossary.term");
|
||||||
|
}
|
||||||
|
|
||||||
/** Form initialisation hook. Fills widgets with data. */
|
/** Form initialisation hook. Fills widgets with data. */
|
||||||
public void init( FormSectionEvent fse ) {
|
public void init( FormSectionEvent fse ) {
|
||||||
FormData data = fse.getFormData();
|
FormData data = fse.getFormData();
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ import static com.arsdigita.cms.contenttypes.ui.GlossaryItemPropertyForm.DEFINIT
|
||||||
* @author <a href="http://sourceforge.net/users/timcarpenter/">timcarpenter</a>
|
* @author <a href="http://sourceforge.net/users/timcarpenter/">timcarpenter</a>
|
||||||
*/
|
*/
|
||||||
public class GlossaryItemWidgetBuilder {
|
public class GlossaryItemWidgetBuilder {
|
||||||
|
|
||||||
public TextArea makeDefinitionArea() {
|
public TextArea makeDefinitionArea() {
|
||||||
TextArea definition = null;
|
TextArea definition = null;
|
||||||
switch (GlossaryItem.getConfig().getDefinitionEditorType()) {
|
switch (GlossaryItem.getConfig().getDefinitionEditorType()) {
|
||||||
|
|
|
||||||
|
|
@ -18,17 +18,19 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.contenttypes.ui.authoring;
|
package com.arsdigita.cms.contenttypes.ui.authoring;
|
||||||
|
|
||||||
import com.arsdigita.cms.contenttypes.GlossaryItem;
|
|
||||||
import com.arsdigita.cms.Folder;
|
|
||||||
import com.arsdigita.cms.ContentBundle;
|
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
|
||||||
import com.arsdigita.cms.ui.authoring.PageCreate;
|
|
||||||
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
|
import com.arsdigita.cms.contenttypes.GlossaryItem;
|
||||||
import com.arsdigita.cms.contenttypes.ui.GlossaryItemWidgetBuilder;
|
import com.arsdigita.cms.contenttypes.ui.GlossaryItemWidgetBuilder;
|
||||||
|
import com.arsdigita.cms.Folder;
|
||||||
|
import com.arsdigita.cms.ContentBundle;
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.contenttypes.util.GlossaryGlobalizationUtil;
|
||||||
|
import com.arsdigita.cms.ui.authoring.PageCreate;
|
||||||
|
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||||
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A page that will create a new GlossaryItem.
|
* A page that will create a new GlossaryItem.
|
||||||
|
|
@ -60,6 +62,8 @@ public class GlossaryItemCreate extends PageCreate {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
|
|
||||||
|
/* Add the default widgets (title & name/url) */
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
GlossaryItemWidgetBuilder builder = new GlossaryItemWidgetBuilder();
|
GlossaryItemWidgetBuilder builder = new GlossaryItemWidgetBuilder();
|
||||||
|
|
@ -67,6 +71,16 @@ public class GlossaryItemCreate extends PageCreate {
|
||||||
add(builder.makeDefinitionArea());
|
add(builder.makeDefinitionArea());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replace the default Label ("Title") by a module specific one.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected GlobalizedMessage getTitleLabel() {
|
||||||
|
return GlossaryGlobalizationUtil
|
||||||
|
.globalize("cms.contenttypes.ui.glossary.term");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param e
|
* @param e
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package com.arsdigita.cms.contenttypes.util;
|
||||||
|
|
||||||
|
import com.arsdigita.globalization.Globalized;
|
||||||
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compilation of methods to simplify the handling of globalizing keys.
|
||||||
|
* Basically it adds the name of package's resource bundle files to the
|
||||||
|
* globalize methods and forwards to GlobalizedMessage, shortening the
|
||||||
|
* method invocation in the various application classes.
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:randyg@arsdigita.com">randyg@arsdigita.com</a>
|
||||||
|
* @version $Revision: #4 $ $Date: 2004/08/17 $
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class JobGlobalizationUtil implements Globalized {
|
||||||
|
|
||||||
|
/** Name of Java resource files to handle FAQ's globalisation. */
|
||||||
|
final public static String BUNDLE_NAME =
|
||||||
|
"com.arsdigita.cms.contenttypes.JobResources";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This returns a globalized message using the package specific bundle,
|
||||||
|
* provided by BUNDLE_NAME.
|
||||||
|
*/
|
||||||
|
public static GlobalizedMessage globalize(String key) {
|
||||||
|
return new GlobalizedMessage(key, BUNDLE_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a globalized message object, using the package specific bundle,
|
||||||
|
* as specified by BUNDLE_NAME. Also takes in an Object[] of arguments to
|
||||||
|
* interpolate into the retrieved message using the MessageFormat class.
|
||||||
|
*/
|
||||||
|
public static GlobalizedMessage globalize(String key, Object[] args) {
|
||||||
|
return new GlobalizedMessage(key, BUNDLE_NAME, args);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue