I know Alfresco stores messages and i18n labels for the UI in ".properties" files,
I would like to know what are the Alfresco conventions to write those files
How it is better to write those key?
It is correct to write form.form-id.title=myTitle or should I use another convention?
Do you use another prefix like the namespace (myc.form.form-id.title=myTitle)
Thanks to all
Indeed, if you want to set labels in properties files for a custom form, you have to keep Alfresco standards. See comments in tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml :
If a type has been specified without a title element in the content model, or you need to support multiple languages, then an i18n file is needed on the Repo AMP/JAR extension side for the type to be visible when creating rules:
custom_customModel.type.custom_mytype.title=My SubType
Used by the "Change Type" action. For the type to have a localised label add relevant i18n string(s) in a Share AMP/JAR extension:
type.custom_mytype=My SubType
But if you define your own properties in custom Java code and spring beans, maybe could you keep choose the most comprehensive name for a user or admin sys which will have to configure your properties.
To answer to your question, I don't know any standard for these new properties.
Hope it helps
Related
I wonder how to make some fields of an entity extension searchable in the administration through the "/api/search/my-entity" api-endpoint. By default they are not considered during search as it looks like.
I found the answer by debugging the search-endpoint:
The association-Field of the EntityExtension needs to have a SearchRanking-flag:
...->addFlags(new SearchRanking(SearchRanking::ASSOCIATION_SEARCH_RANKING))
Then you can add SearchRanking-flags in the EntityExtensionDefinition as you like, e.g.:
(new StringField('test', 'test'))->addFlags(new SearchRanking(SearchRanking::HIGH_SEARCH_RANKING)),
After that the fields are searchable via the search-endpoint :)
As far as the API is concerned, search functionality should automatically be generated following your custom entity definitions.
When it comes to facilitate Admin search for your entity, you need to add some code to the administration component as described in the docs: https://developer.shopware.com/docs/guides/plugins/plugins/administration/search-custom-data (even though it looks not fully up-to-date w.r.t to the current Shopware versions).
I have been trying to add attributes like for example "hobby" or like "height" of a person but not able to add . I can only add predefined attributes.
Is there any way to add custom attributes in my ldap server or like define a new object where I can specify my own custom objects. Please help me with all steps if available.
You cannot add arbitrary attributes to an entry over LDAP.
You must extend the schema on the server first, which is an administrative action. How to do this is pretty well documented in OpenLDAP's manuals.
Is there any way to specify custom paths for resources?
Example: <Resource name="User" path="/manageUsers" {...}>
If it's not possible "per resource", can we for example have all the CRUD pages be under a same basepath like: /crud/{/$resource.name} but keep the custom routes without that basepath.
Thank you very much.
EDIT #1
For context, we are building an admin panel that will have a lot of flows, basically step-by-step creation of resources. So I applaud the react-admin library for what it does (manage the CRUD part), but I want more flexibility in how the URLs are going to be.
I will need to have a section called /manageUsers/ that will have some data like a dashboard, and then the list could be /manageUsers/list/.
And then I may need another section called /customers/ that would list directly on that page.
EDIT #2
To give another use case, I'm trying to use graphQL as the dataProvider, and I had to rename all my resources since the rest API is using users where as the graphQL resource is User. So all my urls are now different!
I hope that makes it a bit more clear.
Is there any way to specify custom paths for resources?
No, this is not supported at the moment. One way to tackle this would be to use manageUsers as the resource name and translate it to User in your dataProvider.
I will need to have a section called /manageUsers/ that will have some data like a dashboard, and then the list could be /manageUsers/list/.
Definitely not supported by default either. However, you can replace the default Resource component with your own. It actually just creates routes for the resource inside a React Router switch. Note that you'll probably have to override the redirect prop of some components (such as Edit) because, when passed list, they expect the list to be at the resource root path.
I had to rename all my resources since the rest API is using users where as the graphQL resource is User
That's the dataProvider job to translate resources names into what your backend expect. Use resource names that make sense for your users (url wise).
Can anyone provide me sample code to develop a struts i18n application containing two jsp pages with two buttons (a single toggle button) to switch b/t two languages?
I am a new to struts.
You can start with this link for some introductory info into internationalized messages then basically, for Struts i18n messages, you would use the <bean:message> tag. The Action class has a method you can use to set your desired locale in session scope and the message tags will pick it up from there.
There are plenty of examples you can find on the web (even if not as specific as you demanded :D). Maybe this article can get you started.
Download sample app from Struts site These sample application are packaged as WAR files. You can import HelloWorld.war from your eclipse and run index.jsp
You don't really need Struts to accomplish internationalization. You can use the JSTL formatting tags. You can use the fmt:bundle tag in your JSP to set the resource bundle to use. Basically a resource bundle is a collection of property files, one for each language that your application supports, that have a common base name. The fmt:message tag will print a message from the resource bundle based on a key. The last thing you need to do is to use the fmt:setLocale tag to actually set the locale (in other words, which of the resource files in the bundle to use) based on what language you want to display.
A good place to start is here:
http://docs.oracle.com/javaee/1.4/tutorial/doc/JSTL6.html
I'm investigating the use of Eclipse as a platform and I am trying to figure out how a plugin provides configuration. For example, say I have a plugin to display a user defined message. Further, I want that user defined message to be configured by the user. What is the standard way for the user to edit this message in the platform? Is there any documentation for this?
As you mentions in the comments, the article Preferences in the Eclipse Workbench UI described the way developers define preference pages for their plug-ins.
By use of the preference store in conjunction with the preferences dialog and provided field editors a plug-in developer can quickly put together a user interface for managing preferences.
The color preference page is an example of a simple page that uses a single JFace field editor to manage its values
That way, you can define several type of custom values configured by the user:
text field
set of predefined values (dropdown list)
array of values
Example:
Found it: http://www.eclipse.org/articles/Article-Preferences/preferences.htm Wow, Stackoverflow helps a lot! You only need to post and it magically comes up in Google
Sorry to VonC but I had already found it before he posted the answer :-/