Hi,
I have written a service and added some properties using @Property . While configuring the service from web console, I have to show some user friendly message or some alert to an author if he/she enters more than the allowed items/count(Max count: 5). Is it possible to validate these fields? Pls let me know.
Thanks,
AryA
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
I would expect, that an administrator (or someone, who is supposed to change the OSGI configuration) is allowed to read logfiles, so you can validate your parameters in the code. There is no possibility to add validation logic in the felix config forms. When you have a multi-value parameter, you can limit the maximum number of entries via the property, and this setting is validated (the UI doesn't let you create more than 5 entries for example).
Jörg
Views
Replies
Total Likes
Views
Replies
Total Likes
I am not aware of how to let authors know through the Felix web console where you install the OSGi bundle and place it into an active state. One option that you have is to write an error message in the AEM log file if the property contains an invalid value.
Also - take a look at this AEM topic:
http://docs.adobe.com/docs/en/cq/current/deploying/configuring_osgi.html
Views
Replies
Total Likes
Hi,
I would expect, that an administrator (or someone, who is supposed to change the OSGI configuration) is allowed to read logfiles, so you can validate your parameters in the code. There is no possibility to add validation logic in the felix config forms. When you have a multi-value parameter, you can limit the maximum number of entries via the property, and this setting is validated (the UI doesn't let you create more than 5 entries for example).
Jörg
Views
Replies
Total Likes
Jorg,
ya. But admin might not know what is the exact issue. Can u pls share how can I declare multi-value parameter? Pls let me know how can I limit the maximum number of entries via the property
Thanks A lot,
AryA.
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi,
you can do something like this:
@Property(label="limited parameter", description="use at max 5", cardinality=5) private String[] myParams;
See the documentation of cardinality on http://felix.apache.org/documentation/subprojects/apache-felix-maven-scr-plugin/scr-annotations.html...
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies