Liferay - How to i18n model-resources? - internationalization

How can I translate my custom model-resources?
Given the following default.xml:
<model-resource>
<model-name>de.foo.db.model.FooBar</model-name>
<portlet-ref>
<portlet-name>myportlet</portlet-name>
</portlet-ref>
<permissions>
<supports>
<action-key>DECLINE_OWNER</action-key>
<action-key>DECLINE_DEPARTMENT</action-key>
</supports>
<site-member-defaults/>
<guest-defaults/>
<guest-unsupported>
<action-key>DECLINE_OWNER</action-key>
<action-key>DECLINE_DEPARTMENT</action-key>
</guest-unsupported>
<owner-defaults/>
</permissions>
</model-resource>
When I want to define these permissions for a role Control-panel-> roles-> myRole-> define permissions
they get listed as:
model.resource.de.foo.db.model.FooBar:action.DECLINE_OWNER
model.resource.de.foo.db.model.FooBar:action.DECLINE_DEPARTMENT
But I'd like them to show up as:
FooBar: Decline own element
FooBar: Decline element for own department
I'm running Liferay 6.2 EE.

You can add below language properties for all actions in Language properties file.
action.DECLINE_OWNER=FooBar: Decline own element
action.DECLINE_DEPARTMENT= FooBar: Decline element for own department

Related

In Spring boot, I'm trying to create another .property file that functions like messages.property, Is that possible?

So I'm trying to create another .property file (called labels.properties) that i can use in Thymeleaf like this:
<div th:text=#{property.from.labels}></div>
Right now I just add labels.properties in the root of resource folder, for now its not working. The purpose of this is I want to separate the property file that handles the error messages from texts for labels & buttons.
Is that possible?
if yes, how to do it?
if yes again, can I do internationalization like adding labels_ja.properties (Japanese)?
You can customize the naming (and location) of the message bundles by configuring the spring.messages.basename property. For example:
spring.messages.basename=labels
By doing so, Spring will look for messages within classpath:labels.properties and classpath:labels_{locale}.properties, such as classpath:labels_ja.properties.
If you want to use this in addition to the regular messages.properties, you can use a comma separated value:
spring.messages.basename=messages,labels
The first one within that comma separated list will take priority over the other ones. If you have a property.from.labels in both messages.properties and labels.properties, the one within messages.properties would be chosen in this example.
This can also be found within the documentation about internationalization.

Using Master Document for report generation in Enterprise Architect V11 - store configuration and filters

fellows!
I have a problem with report generation from my model using a Master Document defining a complex documentation. I believe some of you can help me solve the problem.
Facts:
I have a complex project consisting of several views and packages, inluding domain model, use case model, business process model, etc.
The model is stored in shared (database) repository along with other projects.
I have created custom templates, TOC, cover page and stylesheets for the documentation.
I have created a Master Document package with the main template assigned defining the main document I want to have generated.
I have created several Model Document elements in that package to define individual chapters of the document, assigning adequate templates and model packages to each of them.
I have successfully generated the desired documentation.
I am using Enterprise Architect version 11.0.1107
Problem 1:
I would like to have generated several variants of the same documentation. Thus, I need to change the settings of the generation process like the options, exclude filters and element filters.
However, the settings is not remembered after the generation and I have to set all the settings again when generating documentation on the Master Document package.
Is there a way to save the settings for the Master Document? I have found the Report Specification element, but it does not work as expected (see Problem 2).
Problem 2:
I have tried to use Report Specification element to save the settings for the report generation. I have created that element in the same package as the Master Document is located, and also inside of that Master Document package.
In both cases, when generating the documentation for the first time, EA asked me to select the package. I selected the Master Document package and confirmed the generation. However, the generated document is empty as it clearly does not take the Model Document elements in the selected package into account.
Did I use the Report Specification incorectly? Should I use another package for the Report Specification element? Should I select another package when using the Report Specification for report generation?
Problem 3:
I tried to apply element filters and some other options to include only some of the elements in the report. Let's say I want only element with the version 1.1. So I set the filters to "version = 1.1" when generating the report from the Master Document package.
However, the report contained all elements, regardless their version. The same happened when I tried to exclude anonymous elements. Furthermore, for the next try the filter settings was lost again and I had to set it again before next generation (see Problem 1).
Where should I configure the filters? Should it be set when generating using the Master Document package? Should it be set somewhere for the Model Document elements? Should it be set in the templates (thus making them very specific rather than general)? In such case, should it be set for the model template or for the individual fragments?
Summary:
If you have any tips for combination of Master Document and Report Specification, as well as using the element filters when generating from the Master Document, I would be very grateful.
We do'nt use Report Specification element, but we store specific options into Resource Document. Use [Resource Document] button on Generate Documentation dialog. This specification is stored between Resources (see Resources Window) under Document Generation -> Defined Documents.I hope this solves problem 1 and 2
Problem 3 - EA has more ways, how select elements for generation, unfortunatelly you can't combine them (as far as I know). I would try to define custom find filter and use it.

How to correctly add constraints to the querybuilder node for CQ5 Reports

I'm working on creating a custom report report page in CQ5. I've got my reportbase and columnbase components set up correctly, by following the steps listed here. I am able to, for instance, pick up all the templates that are available, by setting the property nodeTypes to cq:Template
I want to add a constraint to it, say for example pick up templates whose jcr:title is foo. I created a node under querybuilder called propertyConstraints and added my constraints in the form of nodes below it, as describedhere. However, this does not work for me at all.
What is the correct way to add constraints to the querybuildernode? Has anyone tried this?
Also, once I get this working correctly, can I extend this example to return pages of a specific template?
Have you looked into the QueryBuilder API? Adobe's documentation discusses how to match 1 or more property values.
Create a node propertyConstraints under queryBuilder of type nt:unstructured
create another node under propertyConstraints with any name.
Add properties to this node :
name String jcr:title
value String foo

Drupal 7 Views Multiple Contextual Filters

I'm running Drupal 7 with Organic Groups. I cloned the "OG all user group content" view added an Entity Reference to it to be used as a field in one of my content types. My question is:
How can I use an additional contextual filter (Content Type) so that I can add an Argument to the Entity Reference field?
Entering the content type name isn't working: 1/article for example.
So I got the answer from:
https://drupal.stackexchange.com/questions/53861/how-to-show-nodes-of-a-content-type-using-contextual-filters-as-filters
Adding "Content Type" contextually typically requires a Node ID however; using PHP Code you can simply add:
return TRUE;
and this will allow you to enter the content type name (the physical name; i.e. OpenLayers Location field is named Location but the physical path is ol_locator_location).
When you edit the view in the Advanced link, you can see "Contextual Filter"; there you can add the field you added to the content type.

Sitecore: Retrieve user input during event or..?

I would like to add functionality to the Sitecore Content Editor. I want to perform some action when a developer adds an item through the content tree. I understand I can create an event handler (e.g. OnItemCreating) which all works. The problem is I need user input at this point. By at this point I mean OnItemCreating, so the input needs to be there before the item is created.
Are events capable of retrieving user input? If so: how? If not: any suggestions on a solution for the above?
I believe you can achieve this with a Command Template. Chapter 4 of the Data Definition Cookbook (PDF link) describes how you write these commands.
You can extend a pipeline (for instance, uiAddFromTemplate or uiDuplicateItem) with your own processor which prompts for the user input and handles it. See <processors> section in web.config for more details.

Resources