FacebookTwitterLinkedIn
Login / Register

Login / Register

IUG FORUM

Stay always connected!
  1. Sarah Frieldsmith
  2. Sierra/ Millennium/ Encore
  3. Monday, April 17 2017, 04:22 PM
  4.  Subscribe via email
We upgraded our SDA clients to use Java 8. Since the upgrade, most of our spine label print templates have stopped working. I did a lot of testing, and it appears that the culprit is the use of the "replace" method. If I use "replaceAll" instead of "replace", the templates are happy. However, replaceAll is not always what I want. I do have a ticket open with Innovative with no movement for the past month.

Has anyone had this issue and successfully resolved it?

Sarah Frieldsmith
Integrated Library Systems Supervisor
Sacramento Public Library

sfrieldsmith@saclibrary.org
Comment
The emoji it inserted is actually a closing parenthesis.
  1. Guest
  2. 5 days ago
There are no comments made yet.
Add Comment
Accepted Answer
Sarah Frieldsmith Accepted Answer
0
Votes
Undo
For posterity (or anyone with the same problem), Ryan suggested trying "replaceFirst" instead of replace, and it worked! Off to update all my templates....

Sarah

sfrieldsmith@saclibrary.org
Comment
There are no comments made yet.
Add Comment
Ryan Ewers Accepted Answer
0
Votes
Undo
Hi Sarah, I had a similar issue but with a different method. Any line with ".contains" would make it so they would not print. The fix was to change it so it looks like it does below. Could you copy and paste the problem line to this discussion?

<textFieldExpression class="java.lang.String"><![CDATA[($F{patron_last_name} != null ? ($F{patron_last_name}.length()< 4 ? $F{patron_last_name} : $F{patron_last_name}.substring( 0,4 )) : "";)]]></textFieldExpression>

rewers@auroragov.org
Comment
There are no comments made yet.
Add Comment
Sarah Frieldsmith Accepted Answer
0
Votes
Undo
This is our shortest statement (that is not currently working unless we use "replaceAll" in lieu of "replace";):


(($F{callAlphaStart}.matches("^[A-Z].*")) ?
((!$F{callSubf}.equals("") ? ($F{callSubf}.replace("BRAILLE ", "BRAILLE\n").replace("CD ", "CD\n").replace("CD-ROM ", "CD-ROM\n").replace("DVD ", "DVD\n").replace("DVD-ROM ", "DVD-ROM\n").replace("GENEALOGY ", "GENEALOGY\n").replace(" LARGE", "\nLARGE").replace("PRINT ", "PRINT\n").replace("OVERSIZE ", "OVERSIZE\n").replace("PLAYAWAY ", "PLAYAWAY\n").replace("REFERENCE ", "REFERENCE\n") + "\n") : "") +
$F{callField}.trim().replace("BIOGRAPHY ", "BIOGRAPHY\n").replaceAll(" 1", "\n1").replaceAll(" 2", "\n2").replace(" v.", "\nv.") +
(!$F{itemv}.equals("") ? ("\n" + $F{itemv}.trim()) : ""))
:
((!$F{callSubf}.equals("") ? ($F{callSubf} + "\n") : "") +
$F{callField}.trim().replace(" ", "\n") +
(!$F{itemv}.equals("") ? ("\n" + $F{itemv}.trim()) : ""))
)



sfrieldsmith@saclibrary.org

sfrieldsmith@saclibrary.org
Comment
There are no comments made yet.
Add Comment
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,pdf,ppt,pptx,doc,docx,xls,xlsx,,txt,rtf,jrxml
• Remove Upload Files (Maximum File Size: 2 MB)
You may insert polls into your post. The poll would then appear in the post.
Vote Options
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.