Verschiedene Fehlerkorrekturen und Dokumentation.

git-svn-id: https://svn.libreccm.org/ccm/trunk@1373 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2011-12-18 20:12:54 +00:00
parent bf2f522ae6
commit 1ab1853eef
9 changed files with 28 additions and 18 deletions

View File

@ -95,12 +95,8 @@ public class Paginator {
logger.debug(String.format("Applying limits: %d, %d", logger.debug(String.format("Applying limits: %d, %d",
getBegin(), getBegin(),
getEnd())); getEnd()));
/*if (getBegin() == getEnd()) { query.setRange(getBegin(), getEnd() + 1);
query.setRange(getBegin(), getEnd() + 1);
} else {*/
query.setRange(getBegin(), getEnd() + 1);
//}
} }
public int getPageCount() { public int getPageCount() {

View File

@ -59,18 +59,19 @@ public class Date extends Widget implements BebopConstants {
protected TextField m_day; protected TextField m_day;
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;
// Inner classes for the fragment widgets // Inner classes for the fragment widgets
protected class YearFragment extends SingleSelect { protected class YearFragment extends SingleSelect {
protected Date parent; protected Date parent;
private boolean autoCurrentYear; //Decide wether to set the current year if year is null
public YearFragment(String name, Date parent) { public YearFragment(String name, Date parent) {
super(name); super(name);
this.parent = parent; this.parent = parent;
} }
@Override @Override
protected ParameterData getParameterData(PageState ps) { protected ParameterData getParameterData(PageState ps) {
Object value = getValue(ps); Object value = getValue(ps);
@ -79,6 +80,10 @@ public class Date extends Widget implements BebopConstants {
} }
return new ParameterData(getParameterModel(), value); return new ParameterData(getParameterModel(), value);
} }
public void setAutoCurrentYear(final boolean autoCurrentYear) {
this.autoCurrentYear = autoCurrentYear;
}
@Override @Override
public Object getValue(PageState ps) { public Object getValue(PageState ps) {
@ -89,7 +94,7 @@ public class Date extends Widget implements BebopConstants {
} }
} }
Object value = parent.getFragmentValue(ps, Calendar.YEAR); Object value = parent.getFragmentValue(ps, Calendar.YEAR);
if (value == null) { if ((value == null) && autoCurrentYear) {
Calendar currentTime = GregorianCalendar.getInstance(); Calendar currentTime = GregorianCalendar.getInstance();
int currentYear = currentTime.get(Calendar.YEAR); int currentYear = currentTime.get(Calendar.YEAR);
value = new Integer(currentYear); value = new Integer(currentYear);
@ -195,6 +200,10 @@ public class Date extends Widget implements BebopConstants {
this(new DateParameter(name)); this(new DateParameter(name));
} }
public void setAutoCurrentYear(final boolean autoCurrentYear) {
((YearFragment) m_year).setAutoCurrentYear(autoCurrentYear);
}
public void setYearRange(int yearBegin, int yearEnd) { public void setYearRange(int yearBegin, int yearEnd) {
Assert.isUnlocked(this); Assert.isUnlocked(this);
if (yearBegin != m_year_begin || yearEnd != m_year_end) { if (yearBegin != m_year_begin || yearEnd != m_year_end) {

View File

@ -163,7 +163,7 @@ public class PublicationWithPublisher extends Publication {
* @param publisher The publisher of the publication. * @param publisher The publisher of the publication.
*/ */
public void setPublisher(Publisher publisher) { public void setPublisher(Publisher publisher) {
Publisher oldPublisher; final Publisher oldPublisher;
oldPublisher = getPublisher(); oldPublisher = getPublisher();
if (oldPublisher != null) { if (oldPublisher != null) {

View File

@ -33,10 +33,8 @@ import com.arsdigita.bebop.parameters.IntegerParameter;
import com.arsdigita.bebop.parameters.ParameterData; import com.arsdigita.bebop.parameters.ParameterData;
import com.arsdigita.bebop.parameters.ParameterModel; import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.bebop.parameters.StringParameter;
import com.arsdigita.cms.ContentType;
import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.contenttypes.PublicationWithPublisher; import com.arsdigita.cms.contenttypes.PublicationWithPublisher;
import com.arsdigita.cms.contenttypes.Publisher;
import com.arsdigita.cms.ui.ItemSearchWidget; import com.arsdigita.cms.ui.ItemSearchWidget;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;

View File

@ -54,7 +54,7 @@ public class PublicationWithPublisherSetPublisherSheet
1, 1,
PublicationGlobalizationUtil.globalize( PublicationGlobalizationUtil.globalize(
"publications.ui.with_publisher.publisher.remove").localize(), "publications.ui.with_publisher.publisher.remove").localize(),
TABLE_COL_EDIT)); TABLE_COL_DEL));
setModelBuilder(new PublicationWithPublisherSetPublisherSheetModelBuilder( setModelBuilder(new PublicationWithPublisherSetPublisherSheetModelBuilder(
itemModel)); itemModel));

View File

@ -29,7 +29,7 @@ public class SciProjectConfig extends AbstractConfig {
private final Parameter tabs; private final Parameter tabs;
public SciProjectConfig() { public SciProjectConfig() {
enableSubProjectsStep = enableSubProjectsStep =
new BooleanParameter( new BooleanParameter(
"com.arsdigita.cms.contenttypes.sciproject.enable_sub_projects_step", "com.arsdigita.cms.contenttypes.sciproject.enable_sub_projects_step",

View File

@ -7,7 +7,8 @@ import com.arsdigita.xml.Element;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
/** /**
* * Displays the description text for a project.
*
* @author Jens Pelzetter * @author Jens Pelzetter
* @version $Id$ * @version $Id$
*/ */

View File

@ -68,6 +68,7 @@ public class SciProjectPropertyForm
beginParam.allowSkipDay(true); beginParam.allowSkipDay(true);
final Calendar today = new GregorianCalendar(); final Calendar today = new GregorianCalendar();
final Date begin = new Date(beginParam); final Date begin = new Date(beginParam);
begin.setAutoCurrentYear(false);
begin.setYearRange(1970, (today.get(Calendar.YEAR) + 2)); begin.setYearRange(1970, (today.get(Calendar.YEAR) + 2));
add(begin); add(begin);
@ -87,6 +88,7 @@ public class SciProjectPropertyForm
endParam.allowSkipMonth(true); endParam.allowSkipMonth(true);
endParam.allowSkipDay(true); endParam.allowSkipDay(true);
Date end = new Date(endParam); Date end = new Date(endParam);
end.setAutoCurrentYear(false);
end.setYearRange(1970, (today.get(Calendar.YEAR) + 8)); end.setYearRange(1970, (today.get(Calendar.YEAR) + 8));
add(end); add(end);

View File

@ -25,7 +25,10 @@ import java.util.Locale;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
/** /**
* * Summary tab for projects, displays lifespan of the project, the short
* description, the project team (aka members), a contact, the involved
* organizations and the information about the funding of the project.
*
* @author Jens Pelzetter * @author Jens Pelzetter
* @version $Id$ * @version $Id$
*/ */
@ -350,7 +353,8 @@ public class SciProjectSummaryTab implements GenericOrgaUnitTab {
final long start = System.currentTimeMillis(); final long start = System.currentTimeMillis();
final XmlGenerator generator = new XmlGenerator(involved); final XmlGenerator generator = new XmlGenerator(involved);
generator.setUseExtraXml(false); generator.setUseExtraXml(false);
generator.generateXML(state, parent, ""); generator.setItemElemName("organization", "");
generator.generateXML(state, parent, "");
logger.debug(String.format("Generated XML for involved organization " logger.debug(String.format("Generated XML for involved organization "
+ "'%s' in %d ms.", + "'%s' in %d ms.",
involved.getName(), involved.getName(),