Skip to content

Commit

Permalink
fix doc links (#6852)
Browse files Browse the repository at this point in the history
  • Loading branch information
pethers authored Dec 14, 2024
1 parent 09f7d5b commit 0f0b4d9
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.util.Locale;

import org.apache.commons.beanutils.BeanUtils;
import org.slf4j.Logger;
Expand Down Expand Up @@ -47,6 +48,9 @@ public final class PageItemPropertyClickListener extends AbstractPageItemRendere
/** The property. */
private final String property;

/** The lower case. */
private boolean lowerCase = false;

/**
* Instantiates a new page item property click listener.
*
Expand All @@ -60,10 +64,27 @@ public PageItemPropertyClickListener(final String page, final String property) {
this.property = property;
}

/**
* Instantiates a new page item property click listener.
*
* @param page the page
* @param property the property
* @param lowerCase the lower case
*/
public PageItemPropertyClickListener(final String page, final String property, final boolean lowerCase) {
super(page);
this.property = property;
this.lowerCase = lowerCase;
}

@Override
protected String getPageId(final Serializable t) {
try {
return BeanUtils.getProperty(t, property);
if (lowerCase) {
return BeanUtils.getProperty(t, property).toLowerCase(Locale.ENGLISH);
} else {
return BeanUtils.getProperty(t, property);
}
} catch (IllegalAccessException | InvocationTargetException |
NoSuchMethodException e) {
LOGGER.warn(LOG_MSG_PROBLEM_GETTING_PROPERTY_FROM_OBJECT_EXCEPTION,property,t,e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public final class CommitteeDocumentHistoryPageModContentFactoryImpl
"personReferenceId", "org", "docId", "label", "roleDescription" };

private static final PageItemPropertyClickListener LISTENER = new PageItemPropertyClickListener(
UserViews.DOCUMENT_VIEW_NAME, "docId");
UserViews.DOCUMENT_VIEW_NAME, "docId", true);

/**
* Instantiates a new committee document history page mod content factory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public final class DocumentsOverviewPageModContentFactoryImpl extends AbstractDo
"documentType", "docType", "debateName", "tempLabel", "numberValue", "systemDate", "kallId",
"documentFormat", "documentUrlText", "documentUrlHtml", "documentStatusUrlXml",
"committeeReportUrlXml" };
private static final PageItemPropertyClickListener LISTENER = new PageItemPropertyClickListener(UserViews.DOCUMENT_VIEW_NAME, "id");
private static final PageItemPropertyClickListener LISTENER = new PageItemPropertyClickListener(UserViews.DOCUMENT_VIEW_NAME, "id",true);

/** The paging util. */
@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public final class PartyDocumentHistoryPageModContentFactoryImpl extends Abstrac
private static final String[] HIDE_COLUMNS = { "id", "partyShortCode", "personReferenceId",
"numberValue", "orderNumber", "tempLabel", "label", "docId", "roleDescription" };
private static final PageItemPropertyClickListener LISTENER = new PageItemPropertyClickListener(
UserViews.DOCUMENT_VIEW_NAME, "docId");
UserViews.DOCUMENT_VIEW_NAME, "docId", true);
private static final String MEMBER_DOCUMENT_HISTORY = "Member Document history";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public final class PoliticianDocumentHistoryPageModContentFactoryImpl
private static final String[] HIDE_COLUMNS = { "id", "partyShortCode", "personReferenceId",
"numberValue", "orderNumber", "tempLabel", "referenceName", "docId", "label", "roleDescription" };
private static final PageItemPropertyClickListener LISTENER = new PageItemPropertyClickListener(
UserViews.DOCUMENT_VIEW_NAME, "docId");
UserViews.DOCUMENT_VIEW_NAME, "docId", true);

/**
* Instantiates a new politician document history page mod content factory
Expand Down

0 comments on commit 0f0b4d9

Please sign in to comment.