Hi,
I want to check if a constructed org.dspace.app.xmlui.wing.Message actually has
a translation in Java code. How would i go about this?
This is for a change to the submission forms where i have been asked to provide
different text for the buttons for each "Describe" form. I want to use
configured messages for multiple pages in a step. To do this i did the
following.
In org.dspace.app.xmlui.aspect.submission.AbstractStep modified this method
with a check for a message key ending with ".pageX"
public void addSubmissionProgressList(Division div) throws WingException {
//each entry in progress bar is placed under this "submit-progress" div
List progress = div.addList("submit-progress", List.TYPE_PROGRESS);
//get Map of progress bar information
//key: entry # (i.e. step & page),
//value: entry name key (i.e. display name)
Map<String, String> progBarInfo =
this.submissionInfo.getProgressBarInfo();
//add each entry to progress bar
for (Map.Entry<String, String> progBarEntry : progBarInfo.entrySet()) {
//Since we are using XML-UI, we need to prepend the heading key
with "xmlui.Submission."
String entryNameKey = "xmlui.Submission." + progBarEntry.getValue();
//the value of entryNum is current step & page
//(e.g. 1.2 is page 2 of step 1)
StepAndPage currentStepAndPage = new
StepAndPage(progBarEntry.getKey());
//check if there is a configured message for this step and page
if (currentStepAndPage.getPage() > 0 &&
progBarEntry.getValue().equals("submit.progressbar.describe")) {
String pageSpecificKey = entryNameKey + ".page" +
currentStepAndPage.getPage();
// here is where i need to make sure there is a translation for
the calculated step and page key ??
if (message(pageSpecificKey) != null) {
entryNameKey = pageSpecificKey;
} }
//add a button to progress bar for this step & page
addJumpButton(progress, message(entryNameKey), currentStepAndPage);
}
}
And additions in messages.xml
<!-- submission progress bar messages -->
<message key="xmlui.Submission.submit.progressbar.initial-questions">Initial
Questions</message>
<message key="xmlui.Submission.submit.progressbar.describe">Describe</message>
<message key="xmlui.Submission.submit.progressbar.describe.page1">Describe
Essentials</message>
<message key="xmlui.Submission.submit.progressbar.describe.page2">Describe
Non-Essentials</message>
<message key="xmlui.Submission.submit.progressbar.describe.page3">Describe Org
Specifics</message>
<message key="xmlui.Submission.submit.progressbar.upload">Upload</message>
<message key="xmlui.Submission.submit.progressbar.verify">Review</message>
<message key="xmlui.Submission.submit.progressbar.creative-commons">Creative
Commons</message>
<message key="xmlui.Submission.submit.progressbar.CClicense">CC
License</message>
<message key="xmlui.Submission.submit.progressbar.license">License</message>
<message key="xmlui.Submission.submit.progressbar.complete">Complete</message>
As you can see i have hard coded a check, what is preferable is if I can make
sure that there is a message translation available, and use that as the bases
for using a non-standard button label. Some sort of
"canTranslate(message(pageSpecificKey)" which won't result in the text
"un-translated" configured in the aspect xml file.
Nothing in DSpaceI18NTransformer standsout as a possible checking function.
Maybe I have been staring at this code for too long.
On a side matter, is it possible to configure the editor review task's edit of
the item metadata to use a different set of forms then the original submission?
For our organisation, some metadata fields are only relevant to the editor's
review of the item and aren't expected to be completed by the submitter?
Thanks
Kevin
--
------------------------------------------------------------------------
The information contained within this transmission is for the
use of the intended recipient only and may contain confidential
and/or legally privileged material and/or material the subject
of copyright and/or personal information and/or sensitive
information that is subject to the Privacy Act 1988. Any review,
re-transmission, disclosure, dissemination or other use of, or
taking of any action in reliance upon, this information by
persons or entities other than the intended recipient is
prohibited. If you have received this email in error please
notify the AIMS Privacy Officer on (07) 4753 4444 and delete
all copies of this transmission together with any attachments.
------------------------------------------------------------------------
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette