[
https://issues.apache.org/jira/browse/CLEREZZA-29?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Oliver Strässer updated CLEREZZA-29:
------------------------------------
Priority: Critical (was: Major)
Description:
can you provide a funtion in scala wich checks a given property, and if the
property is set, the return value is the string representation of this
property.
if the value isn't set, the returnvalue is an "" string .
i don't want to wrote everytime the folloeing code:
{if((res/DC.title).length > 0){res/dc("title")*}else {""}}
or :
{if((res/dc("description")).length >
0){XML.loadString(res/dc("description")*)}else {""}}
To Functions (One for XML and one for normal String is ok)
Better is:
{if((res/acp("statusTextForParticipants")).length > 0){
try {
XML.loadString(res/acp("statusTextForParticipants")*)
} catch {
case e:Exception =>
res/acp("statusTextForParticipants")*;
}
}else {""}}
or an functionm wich generates valid xml from string (escaped / not escaped //
is an xmlliteral or not)
, when the string is copied from microsoft word, like this. Hard to explain.
THIS IS VERY IMPORTANT, BECAUSE YOU CAN'T RELY ON THAT THE USER GENERATE VALID
XML CONTENT
was:
can you provide a funtion in scala wich checks a given property, and if the
property is set, the return value is the string representation of this
property.
if the value isn't set, the returnvalue is an "" string .
i don't want to wrote everytime the folloeing code:
{if((res/DC.title).length > 0){res/dc("title")*}else {""}}
or :
{if((res/dc("description")).length >
0){XML.loadString(res/dc("description")*)}else {""}}
To Functions (One for XML and one for normal String is ok)
> Wish for Scala function
> -----------------------
>
> Key: CLEREZZA-29
> URL: https://issues.apache.org/jira/browse/CLEREZZA-29
> Project: Clerezza
> Issue Type: Improvement
> Environment: Scala Pages
> Reporter: Oliver Strässer
> Priority: Critical
>
> can you provide a funtion in scala wich checks a given property, and if the
> property is set, the return value is the string representation of this
> property.
> if the value isn't set, the returnvalue is an "" string .
> i don't want to wrote everytime the folloeing code:
>
> {if((res/DC.title).length > 0){res/dc("title")*}else {""}}
>
> or :
>
> {if((res/dc("description")).length >
> 0){XML.loadString(res/dc("description")*)}else {""}}
> To Functions (One for XML and one for normal String is ok)
> Better is:
> {if((res/acp("statusTextForParticipants")).length > 0){
> try {
>
> XML.loadString(res/acp("statusTextForParticipants")*)
> } catch {
> case e:Exception =>
> res/acp("statusTextForParticipants")*;
> }
> }else {""}}
> or an functionm wich generates valid xml from string (escaped / not escaped
> // is an xmlliteral or not)
> , when the string is copied from microsoft word, like this. Hard to explain.
> THIS IS VERY IMPORTANT, BECAUSE YOU CAN'T RELY ON THAT THE USER GENERATE
> VALID XML CONTENT
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.