Difference between currentstyle and currentdesign in AEM - aem

In AEM speak - what is the exact conceptual difference between between currentstyle and currentdesign objects available after including the tag in template / component?

Just to add some clarify to what's already here:
Global content (that is, component values that are common across multiple instances of the same template) are stored as "styles" and edited via a "design dialog".
They are stored as follows:
/etc/designs/<design>/jcr:content/<template>/<component>
So, for the component logo in the template homepage, using the default design:
currentStyle is /etc/designs/default/jcr:content/homepage/logo
currentDesign is /etc/designs/default

currentStyle is of type com.day.cq.wcm.api.designer.Style(1) whereas currentDesign is an instance of com.day.cq.wcm.api.designer.Design (2).
The Design object contains information about the design that is used with the current object, it is most of the time set in the cq:designPath property of the page's template.
If you have the Design object, you can get Style objects for each included Cell(3) from it. On the other hand you can get the surrounding Design, if you have the Style.
So the Design is something like a container object for the Styles used in the included Cells.
In this path
/etc/designs/geometrixx/jcr:content/page/image
image is a Cell, the design path is /etc/designs/geometrixx and the Style object attached to the Cell object has two properties: maxHeight and maxWidth.
(1): https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/index.html?com/day/cq/wcm/api/designer/Design.html
(2): https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/index.html?com/day/cq/wcm/api/designer/Style.html
(3): https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/index.html?com/day/cq/wcm/api/designer/Cell.html

I would say it is more like:
/etc/designs/<design>/jcr:content/<resource-type-of-page>/<component>
so that different templates having the same page resource type will share the same style

Related

Group AEM (6.2) component configurations

I'm currently building a component that has TouchUI configuration properties separated with three tabs (Standard, CASL, GDPR). Each tab has the same set of options available and my current config names are similar to the following:
./standardMarketingText
./standardThirdpartyText
./gdprMarketingText
./gdprThirdpartyText
./caslMarketingText
./caslThirdpartyText
(There are several other options for standard,gdpr,casl but I left them out for brevity)
While this works, I'm hoping to instead store the values in the JCR as a JSON node per category. For example:
casl = {"marketingText"="m test", "thirdpartyText"="tp test"}
gdpr = {"marketingText"="gdpr m test", "thirdpartyText"="gdpr tp test"}
This way I can load all "casl" (or others) options at once when I need them (there isn't a case where I would only load one "casl" option)
I have attempted using granite/ui/components/foundation/form/multifield however, it asks to "Add field". I only want one set of each, and not provide the ability to add another set of properties under each tab. Is there a way to accomplish this without overriding the multifield resourceType?
There are multiple ways to achieve what you are looking at, I would look at the reusability as there are similar named properties for different categories (in your case tabs). To group them you could do that at node level by correctly defining the name property for each tab.
For above provided values, you could do something like -
./standard/marketingText
./standard/thirdpartyText
./gdpr/marketingText
./gdpr/thirdpartyText
./casl/marketingText
./casl/thirdpartyText
Your each tab stores the properties in named node (standard, gdpr, casl). In addition you could have a single SlingModel/WCMUsePojo that can adapt to these nodes to provide the Pojo with accessor to property values.
As far as getting JSON is concerned, your SlingModel or WCMUsePojo can provide a method to return JSON based string for the values.

How to Create or edit existing PCB template (Title block) in Altium Designer v17

I would like to create a personalize PCB template (Title block) for my company which include company information and logo. So I wanted to know how can I use or edit existing PCB sheet templates according to my needs?
Pariksit.
THIS ISN'T A QUESTION ABOUT PROGRAMMING. I'll answer but don't worry if someone delete the question.
I like to create my own title blocks. You can do that creating a schematic component and introducing the parameters you want.
In your schematic library, add a new component called Title_Block. Use lines and strings to create the fields.
I put these strings in red to show that are special strings starting with '=' sign.
These special strings will be replaced automatically by Altium when you create a parameters with the same name. I put some Altium default parameters (SheetNumber, SheetTotal, CurrentDate and Title) and two that we'll create (VersionRevision and Project). You can see other default special strings here: Schematic Text Strings.
In your schematic sheet, disable the Title Block to introduce yours. Right click on the schematic, Options > Sheet..., and uncheck the Title Block box.
Create your own parameters on Project > Project Options tab Parameters like this:
Now, when you add the component called _Title_Block it seems like this:
In Schematic Page,
Design->Project Template ->Choose a File
Now, following location will be open.
C:\Users\Public\Documents\Altium\AD16\Templates
Here, you can find like A3,A4 different template for Schematic and PCB also.
You can Edit that as per requirement.
To Edit or Change the logo in Template sheet:
Place->Drawing tool->Graphic.

TYPO3 Extbase/Fluid: Change SPLIT_PATTERN_SHORTHANDSYNTAX in StandaloneView

how to change the default SPLIT_PATTERN_SHORTHANDSYNTAX ({value}) by using the StandaloneView?
My Problem:
I have to render several LaTeX pages with different content. So I will use FLUID (Template/Partials). However there is the same Problem as in JS.... Is it possible to change the default "{value}" width ###value###???
The SPLIT_PATTERN_SHORTHANDSYNTAX static variable is defined in the TemplateParser.php but how can I change this dynamically by using a PHPView or StandaloneView?
Best regards Jürgen
This is not possible to do and a feature request to add this capability has been discussed and rejected. Please see https://github.com/TYPO3Fluid/Fluid/issues/106 for more information. Consider using CDATA wrapping to protect (parts of) your template from being processed as Fluid.

Fluidpages Flux Configuration inheritance incomplete

I'm currently using TYPO3 6.1.8-dev to build a flux/fluidpages (GitHub Master) powered template and managed to have it running on the root pages, though, I have issues with the sub-pages, in terms of value inheritance.
I've implemented the following scenario:
A Flux Flexform Configuration is used, if there is no TypoScript override variable set, retrieved from TS Setup.
The Flexform fields have the following names:
gridsettings.topRow_use (checkbox)
gridsettings.topRow_cols (select)
After the Flexform Configuration, I use these fields to build the backend grid, after I mix in some static values of a TypoScript configuration with:
{v:iterator.merge(a:'{gridsettings}', b:'{tssettings}') -> v:var.set(name:'gridsettings')}
This works for every page with explicit settings in the page properties, but not for sub-pages, which should just inherit the parents settings.
In the case of sub-pages the gridsettings array is null, and only my TS settings are visible.
I'd like to have the convenience to just create a new sub-page, and add content to the inherited backend-layout grid without any further interaction in the page settings.
How can I solve this issue?
Two parts to this:
1) To solve the problem that you manually must merge TS with FlexForm settings, use the prefix settings. in all your field names. This special, reserved variable name will be used by both Extbase and Fluid without requiring you to transfer it, and your FlexForm settings will be merged (on top of) your TS settings.
2) Inheritance requires the exact same page template on parent and child page, or that child page sets parent decides as option for which template to use. There could be other causes for failing inheritance (for example, the use of default on any of your fields - since you don't include your Flux form structure this is impossible to determine) but mismatching parent/child template is the most common. Also, make sure your Flux is up-to-date; there have been bugfixes recently related to inheritance.

How to use TableViewer in WindowBuilderPro?

I have to create a table in my wizard page and I want to create it using TableViewer. I'm using WindowBuilderPro for designing my wizard page. The TableViewer control is available in the palette of WindowBuilderPro but I'm not getting how to use it properly.
Has any body used the same?
Thanks a lot in advance!!
You have two ways of filling the TableViewer with contents (similar to TableViewers in JFace):
You can define a content provider and a label provider manually. A content provider has to return a set of Objects, that represent each line of the table; while the TableLabelProvider translates the returned objects to texts in the columns. The content and label providers are to set in the Properties box on the left. In this case, the resulting code should look like the following snippets: http://wiki.eclipse.org/JFaceSnippets#Snippet001TableViewer or http://wiki.eclipse.org/JFaceSnippets#Snippet007FullSelection.
On the other hand you could define JFace Data Bindings to fill the table with contents. In this case you have to define a corresponding binding, that returns the list of all contents; additionally you have to create a label provider, that works similar to the previous one.
There is also a way to fill the table content using a newer API then supported directly by WindowBuilder: you could create TableViewerColumns, and ColumnLabelProviders for each column, thus resulting in much nicer code for Label Providers (and also this API is newer, so it should be preferred for new JFace based code) - but in this case you have to create your code manually. See the JFace Table tutorial from Lars Vogel.
Additionally, if you don't know the JFace Viewer framework from before, I suggest reading the first few questions listed in the JFace FAQ to gain a better understanding of the ideas (and the tutorial from Lars Vogel is also nice for this reason).