Hi Team,
Please any body suggest me how to make OSGi property value should mandatory. Please find the below screenshot
Regards,
Jaganath
Solved! Go to Solution.
Exactly - you are consuming these values in Java code. If in your Java code - the OSGi value is empty - set a default value in your code so your logic does not break. See this articel for more information - Reading OSGi Configuration Values for Adobe Experience Manager 6.3
Views
Replies
Total Likes
Do you mean for a custom service or general ones?
Views
Replies
Total Likes
For general OSGi configurations - see - Configuring OSGi
However no mention of how to make any one field mandatory.
Thanks Smacdonal,
Yes its custom OSGi services and also is it possible to make mandatory the sling:OsgiConfig property fields as below.
Views
Replies
Total Likes
Yes , nowhere its mentioned.
Views
Replies
Total Likes
Dear Jaggu,
Not aware of such setting.
You are viewing it of slightly wrong angle. Normally, your OSGi config get's consumes in OSGi Service.
There you can take these parameters via Java method.
Such as @Activate or @Modified, there you can always make you validations for the user input.
In cases when config isEmpty or isInvalid, you don't have to add that config in. Instead, in OSGi you can define default value.
In case if I'm wrong you can verify implementation of felix/configadmin at trunk · apache/felix · GitHub where you would find the code that's running inside your configAdmin. *Update correct place to look at javascript felix/config.js at trunk · apache/felix · GitHub
Alternatively, you can look at awesome writeup/talk by Jörg Sling Context-Aware configuration
With this sytem you can use Touch UI and can make any input pre-validated by standard AEM UI systems.
Hope this helps.
Regards,
Peter
Views
Replies
Total Likes
Thanks for your response, you are correct Peter but in OSGi we are using some key for lead submit. In case this property is blank then the whole system is breaking even though there is default value. So we need validation for not blank.
Regards,
Jaggu
Views
Replies
Total Likes
Hi Jaggu,
That sounds like not very durable design if a single mis-config can break 'whole system'. Consider changing your OSGi code in a way that default value is always set. E.g. your Java code know's what the defaults are.
Regards,
Peter
Exactly - you are consuming these values in Java code. If in your Java code - the OSGi value is empty - set a default value in your code so your logic does not break. See this articel for more information - Reading OSGi Configuration Values for Adobe Experience Manager 6.3
Views
Replies
Total Likes
Thanks Smacdonald.
Views
Replies
Total Likes
Thanks Peter, I need one more calcification can I give position to OSGi fields means in OSGi one field is coming on middle can I move this filed to top.
Views
Replies
Total Likes
Views
Likes
Replies