Liferay error message does not show file size? - liferay-6

I used liferay-ui:error to display error message when users upload a file:
in action method:
SessionErrors.add(actionRequest, UserPortraitSizeException.class.getName());
in jsp:
<liferay-ui:error exception="<%= UserPortraitSizeException.class %>"
message="please-enter-a-file-with-a-valid-file-size-no-larger-than-x" />
It worked. The message was showed, except the limit size that I set in portal-ext.properties [users.image.max.size=307200] does not appear
The message was:
Please enter a file with a valid file size no larger than {0}k.
Am I missing something? (I am using lifera 6.1)

You have to format your message using LanguageUtil.java's utility method .
I.e.
LanguageUtil.format(themeDisplay.getLocale()," please-enter-a-file-with-a-valid-file-size-no-larger-than-x",Propsutil.get(" users.image.max.size "))
Just another information for language messages having {n}, where n is number.
This is used when you want to have message with some custom dynamic attribute, and you have to provide dynamic attribute as arguments of liferay-ui:message tag.
For Example:
<liferay-ui:message key="abc" arguments='<%=new Object[]{"King","Thanks"}%>'/>
and in language properties file you have,
abc= You are {0}, {1}
then it will result in message
"You are King, Thanks"
Regards,

Related

Custom Error Messages in CITRUS Test Results

I want to use my custom error messages in my citrus test results.
Example:
Original Error Message: java.io.FileNotFoundException: D:\expectedOutput\Smaple.xml (The system cannot find the file specified).
Custom Message: Hey The File was not found in your directory Please check. (Need to print like this in my test results failure message).
Please check the image hereenter image description here
You can not change this message in particular as this is coming from the thrown Java exception. You could implement your own TestReporter and/or TestListener though to translate the error into something matching your needs.
Something like: https://citrusframework.org/samples/reporting/

How to resolve TinyButStrong's 'at least one tag corresponding to w:tr is not found' error?

I'm creating a project to mail merge a given .odt file and provide a .odt output. When i'm performing the mail merge operation it provides me this error
TinyButStrong Error in block's definition [CiviCRM.display_name...]: at least one tag corresponding to w:tr is not found. Check opening tags, closing tags and embedding levels.
Myfilecontent.odt
[CRM. display_name;block=w:tr]
Date: 2/3/2020
Dear [CRM.postal_greeting;block=w:tr],
Thank you for joining the event...
I have no idea how to resolve this. could someone help me to solve it?
Thanks in advance!
Update
After i replaced w:tr with tbs:row, still I'm receiving a similar error
TinyButStrong Error in block's definition [CRM.display_name...]: at
least one tag corresponding to tbs:row is not found. Check opening
tags, closing tags and embedding levels.
w:tr is an XML entity for Ms Word , not ODT.
You should use the alias block=tbs:row so that its is format independent.

"SAPUI5 component ID is potentially invalid" on submitting SAPUI5 Application to ABAP System

When I am trying to upload app to ABAP-Repository using SE38 and /UI5/UI5_REPOSITORY_LOAD I get following error message:
SAPUI5 component ID SAPUI5.BRUTTOUMSATZ2 in SAPUI5 repository ZBRUTTOUMSATZ is potentially invalid.
Submitting the Project via eclipse brings up the same error message.
Does anyone know how to fix this issue or what might cause this ? I didn't find any documentation on this error message.
The application runs fine when hosted on a local Jetty-Server.
A component name should follow these rules, according to the long text of error message /ui5/app_api (019).
Consist only of alphanumerical characters
Contain only lowercase letters in the first except the last segment
May contain camel case in the last segment
Not begin with a number
Not contain special characters
Contain a dot as separator of the namespace
Not be longer than 40 letters for each segment (separated by a dot)
submitting to ABAP-Repository has way more strict naming conventions then mentioned in your answer. I think the application name cannot be longer then 16 signs ... otherwise you cannot submit.

JSON schema validation failed: resource: String does not match pattern:^/[^/~!#\$%^|\s`#&*()\-+={}\[\]:;"'<>,?/\|\\]+(/[^/~!#\

I'm trying to embed Jasper Reports into APEX App. I'm able to gather reports from samples (samples on JasperCommunity website), however, when I'm trying to get created by me and colleagues reports - every time I have the same error:
JSON schema validation failed: resource: String does not match pattern: ^/[^/~!#\$%^|\s#&*()\-+={}\[\]:;"'<>,?/\|\\]+(/[^/~!#\$%^|\s#&()-+={}[]:;"'<>,?/\|\]+)$.
In other words I can't get any of our reports apart from the samples (e.g. /public/Samples/Reports/03._Store_Segment_Performance_Report"). I think the case is that the path to the Report is wrong, but I've tried all possible and impossible options and none of them works. Anyone any ideas please ?! Thanks
P.S. APEX 4.2.6, JasperServer 6.0. And finally, I can get samples Reports ONLY under the JasperAdmin user, simple User always got an error - 'Access Denied'. Why ?!?!?!
Sorted.
If anyone interested - when specify the actual path, in Jasper: right click on Report(or Dashboard, AdHocView etc.) and copy the path from it. As it differs from when you point mouse on it (e.g. adding the underscores etc.), and paste this actual path into your javascript code into HTML section in your web app. Thanks

How to save message file in RAW format

One of our client does not know how to save/generate/produce/provide swift messages in its raw format via their swift alliance system, neither do i. By raw format i mean following format
{1:F21XXXXXXXXXXXX7108170239}{4:{177:1112071543}{451:0}}{1:F01XXXXXXXXXXXX7108170239}{2:O9502137111207XXXXXXXXXXXX54153885641112071537N}{4:
:20:XXXXXXXXXXXXXX
:25:XXXXXXXXXX
:28C:00237/00001
:60F:C090513AUD1162994,30
:61:1112061207D110,00NCHKFDD388407 //071211WDM9103
291111 GUJ
:61:1112061207D200,00NCHK3927611471 //071211WDM9104
090911 KAR
:62F:C090513AUD1610881,52
:64:C090513AUD1610881,52
-}{5:{CHK:XXXXXXXXXXXX}}{S:{COP:S}}
Is there any way/interface to integrate with SWIFT and extract these files Or is there any possibility to schedule SWIFT to generate these files Or even manual steps to do it?
Edit 1
Messages are saved by creating a profile from the application and setting connection type to "File Transfer". It will then keep generating files in ISO format to a shared location.
to get output file from swift you need to configure message partner CBSOUT
to do so do the following
enter to swift application SAE or SAA with super user.
click on
Application interface.
from the list right click on
CBSOUT and then enable
to configure CBSOUT double click on it.
Data format :select RJE
output path name : put the folder you want to store the files
output the extension : put the file extension example :out or txt.
session initiation select Auto.
number of message =1
finish.
good lucky.
byeeeeeee
Messages are saved by creating a profile from the application and setting connection type to "File Transfer". It will then keep generating files in ISO format to a shared location.