Profile attributes may be useful if you need to the add additional level of security to your data.
Below I quote a short description of this feature from JasperReports Server User Guide -> Advanced Domain Features -> The DomEL Syntax -> Profile Attributes :
'A profile attribute is a name-value pair inserted in a user object, such as a user or role. It is ordinarily used to extend the object’s standard access grants, but it has other uses, as well. It can be added to objects by database tools or custom code'
The field length of this attribute in JasperReports Server Repository and JasperReports Server user interface is restricted to 255 characters. Some of the solutions require the length of this field that is longer then the length that is adjusted by default.
To increase the length of the Profile Attribute field three steps should be done (JasperReports Server v5.0.1):
- The length of this field should be increased in the JasperReports Server Repository
- The length of this field should be increased in <jasperserver-pro>WEB-INFapplicationContext-rest-services.xml
- The length of this field should be increased in <jasperserver-pro>scriptsattributes.model.js
Below I provide the detailed description that shows how to do this:
I use PostgreSQL as the JasperReports Repository. The value related to the Profile Attribute field is stored in jiprofileattribute table and is named attrvalue.
Plese refer to the screenshot below on which is shown sequense of commands that was used to increase the length of the attrvalue field.
Open the file, <jasperserver-pro>WEB-INFapplicationContext-rest-services.xml, and change the numeric value according to the changes that were done in the jiprofileattribute table
<property name="maxLengthAttrValue"> <value type="int">7000</value> </property>
Open the file, <jasperserver-pro>scriptsattributes.model.js, and change the value MAX_LENGTH_OF_VALUE to the value that you want.
exports.settings = { MAX_LENGTH_OF_NAME: 255, MAX_LENGTH_OF_VALUE: 7000 }
To apply the changes that have been done the application server should be restarted.
Thank you for your attention to this article.
Alex
Recommended Comments