- Disabled placeholder text for hints. A hint is shown only if there is a real hint text

- Added an option to the Date widget to show the years in descending order
- Some fixes for ccm-sci-assets-publicationspersons, including the rendering in the Mandalay theme


git-svn-id: https://svn.libreccm.org/ccm/trunk@2809 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-08-13 09:51:55 +00:00
parent f9e7bc9c82
commit 0908a339fc
8 changed files with 56 additions and 24 deletions

View File

@ -43,8 +43,7 @@ abstract public class DescriptiveComponent extends SimpleComponent {
/** Property to store informational text for the user about the Link, e.g. /** Property to store informational text for the user about the Link, e.g.
* how to use it, or when to use it (or not to use it). */ * how to use it, or when to use it (or not to use it). */
private GlobalizedMessage m_hint = GlobalizationUtil private GlobalizedMessage m_hint; //= GlobalizationUtil.globalize("bebop.hint.no_entry_yet");
.globalize("bebop.hint.no_entry_yet");
/** Property to store a (localized) label (or title) of this widget. A /** Property to store a (localized) label (or title) of this widget. A
* label is the text (name) displayed for the user to identify and * label is the text (name) displayed for the user to identify and

View File

@ -59,6 +59,7 @@ public class Date extends Widget implements BebopConstants {
private int m_year_begin; private int m_year_begin;
private int m_year_end; private int m_year_end;
private Locale m_locale; private Locale m_locale;
private boolean yearAsc = true;
/** /**
* Inner class for the year fragment * Inner class for the year fragment
@ -70,6 +71,7 @@ public class Date extends Widget implements BebopConstants {
/** /**
* Constructor. * Constructor.
*
* @param name * @param name
* @param parent * @param parent
*/ */
@ -82,6 +84,7 @@ public class Date extends Widget implements BebopConstants {
/** /**
* *
* @param ps * @param ps
*
* @return * @return
*/ */
@Override @Override
@ -104,6 +107,7 @@ public class Date extends Widget implements BebopConstants {
/** /**
* *
* @param ps * @param ps
*
* @return * @return
*/ */
@Override @Override
@ -228,6 +232,7 @@ public class Date extends Widget implements BebopConstants {
/** /**
* Constructor. * Constructor.
*
* @param name * @param name
*/ */
public Date(String name) { public Date(String name) {
@ -250,17 +255,32 @@ public class Date extends Widget implements BebopConstants {
// a) skipYearAllowed is true // a) skipYearAllowed is true
// b) skipDayAllowed is true and skipMonthAllowed is true, to unset a date // b) skipDayAllowed is true and skipMonthAllowed is true, to unset a date
if (((IncompleteDateParameter) this.getParameterModel()).isSkipYearAllowed() if (((IncompleteDateParameter) this.getParameterModel()).isSkipYearAllowed()
|| (((IncompleteDateParameter) this.getParameterModel()).isSkipDayAllowed() || (((IncompleteDateParameter) this.getParameterModel()).isSkipDayAllowed()
&& ((IncompleteDateParameter) this.getParameterModel()).isSkipMonthAllowed())) { && ((IncompleteDateParameter) this.getParameterModel())
.isSkipMonthAllowed())) {
m_year.addOption(new Option("", "")); m_year.addOption(new Option("", ""));
} }
} }
for (int year = m_year_begin; year <= m_year_end; year += 1) { if (yearAsc) {
m_year.addOption(new Option(String.valueOf(year))); for (int year = m_year_begin; year <= m_year_end; year++) {
m_year.addOption(new Option(String.valueOf(year)));
}
} else {
for(int year = m_year_end; year >= m_year_begin; year--) {
m_year.addOption(new Option(String.valueOf(year)));
}
} }
} }
} }
public boolean getYearAsc() {
return yearAsc;
}
public void setYearAsc(final boolean yearAsc) {
this.yearAsc = yearAsc;
}
public void addYear(java.util.Date date) { public void addYear(java.util.Date date) {
Calendar cal = new GregorianCalendar(); Calendar cal = new GregorianCalendar();
cal.setTime(date); cal.setTime(date);
@ -276,6 +296,7 @@ public class Date extends Widget implements BebopConstants {
/** /**
* Returns a string naming the type of this widget. * Returns a string naming the type of this widget.
*
* @return * @return
*/ */
@Override @Override
@ -286,6 +307,7 @@ public class Date extends Widget implements BebopConstants {
/** /**
* Sets the <tt>MAXLENGTH</tt> attribute for the <tt>INPUT</tt> tag used to render this form * Sets the <tt>MAXLENGTH</tt> attribute for the <tt>INPUT</tt> tag used to render this form
* element. * element.
*
* @param length * @param length
*/ */
public void setMaxLength(int length) { public void setMaxLength(int length) {
@ -299,6 +321,7 @@ public class Date extends Widget implements BebopConstants {
/** /**
* The XML tag for this derived class of Widget. * The XML tag for this derived class of Widget.
*
* @return * @return
*/ */
@Override @Override

View File

@ -72,7 +72,7 @@ public class SciPublicationsPersonsService {
if (publicationsAsset == null) { if (publicationsAsset == null) {
SciPublicationsPersonsPersonsPublications.create(person); SciPublicationsPersonsPersonsPublications.create(person);
} else { } else {
final SciPublicationsPersonsPublicationsPersons publications = new SciPublicationsPersonsPublicationsPersons(publicationsAsset); final SciPublicationsPersonsPersonsPublications publications = new SciPublicationsPersonsPersonsPublications(publicationsAsset);
publications.update(); publications.update();
} }
} }

View File

@ -86,14 +86,16 @@ public class SciPublicationsPersonsPersonForm extends BasicItemForm {
final ParameterModel relationParam = new StringParameter(RELATION); final ParameterModel relationParam = new StringParameter(RELATION);
final SingleSelect relationSelect = new SingleSelect(relationParam); final SingleSelect relationSelect = new SingleSelect(relationParam);
relationSelect.addValidationListener(new NotNullValidationListener()); relationSelect.addValidationListener(new NotNullValidationListener());
relationSelect.addOption(new Option("", new Label(ContenttypesGlobalizationUtil.globalize(
"cms.ui.select_one"))));
try { try {
relationSelect.addPrintListener(new PrintListener() { relationSelect.addPrintListener(new PrintListener() {
@Override @Override
public void prepare(final PrintEvent event) { public void prepare(final PrintEvent event) {
final SingleSelect target = (SingleSelect) event.getTarget(); final SingleSelect target = (SingleSelect) event.getTarget();
target.clearOptions();
target.addOption(new Option("", new Label(ContenttypesGlobalizationUtil.globalize(
"cms.ui.select_one"))));
final RelationAttributeCollection relations = new RelationAttributeCollection( final RelationAttributeCollection relations = new RelationAttributeCollection(
SciPublicationsPersonsService.RELATION_ATTRIBUTE); SciPublicationsPersonsService.RELATION_ATTRIBUTE);
relations.addLanguageFilter(Kernel.getConfig().getDefaultLanguage()); relations.addLanguageFilter(Kernel.getConfig().getDefaultLanguage());

View File

@ -60,6 +60,7 @@
<line id="discussingPublications/heading">Wird in folgenden Publikationen behandelt</line> <line id="discussingPublications/heading">Wird in folgenden Publikationen behandelt</line>
<line id="discussedPublications/heading">Behandelt folgende Publikationen</line> <line id="discussedPublications/heading">Behandelt folgende Publikationen</line>
<line id="librarySignatures/heading">Bibliotheken</line> <line id="librarySignatures/heading">Bibliotheken</line>
<line id="relatedPersons/heading">Personen in dieser Publikation</line>
<line id="assignedTerms">Schlüsselwörter</line> <line id="assignedTerms">Schlüsselwörter</line>

View File

@ -58,6 +58,7 @@
<line id="assignedTerms">Keywords</line> <line id="assignedTerms">Keywords</line>
<line id="librarySignatures/heading">Libraries</line> <line id="librarySignatures/heading">Libraries</line>
<line id="relatedPersons/heading">Persons discussed by this publication</line>
<line id="articleInCollectedVolume/abstract">Abstract</line> <line id="articleInCollectedVolume/abstract">Abstract</line>
<line id="articleInCollectedVolume/authors">Authors</line> <line id="articleInCollectedVolume/authors">Authors</line>

View File

@ -79,6 +79,11 @@ XSL file for displaying the informations from the related persons asset.
<xsl:text>, </xsl:text> <xsl:text>, </xsl:text>
<xsl:value-of select="./titlepost"/> <xsl:value-of select="./titlepost"/>
</xsl:if> </xsl:if>
<xsl:if test="string-length(./@relation) &gt; 0">
<span>
<xsl:value-of select="concat(' (', ./@relation, ')')"/>
</span>
</xsl:if>
</li> </li>
</xsl:for-each> </xsl:for-each>
</ul> </ul>

View File

@ -106,6 +106,7 @@ public class ArticleInJournalPropertyForm
com.arsdigita.bebop.form.Date pubDate = com.arsdigita.bebop.form.Date pubDate =
new com.arsdigita.bebop.form.Date( new com.arsdigita.bebop.form.Date(
pubDateParam); pubDateParam);
pubDate.setYearAsc(false);
pubDate.setYearRange(1900, today.get(Calendar.YEAR) + 2); pubDate.setYearRange(1900, today.get(Calendar.YEAR) + 2);
pubDate.setLabel(PublicationGlobalizationUtil.globalize( pubDate.setLabel(PublicationGlobalizationUtil.globalize(
"publications.ui.articleinjournal.publicationDate")); "publications.ui.articleinjournal.publicationDate"));