Nested component refresh after edit - aem

Here is the issue I'm facing, I've got very simple component A and B, A is used inside of component B
using a data-sly-resource
I can edit the component A but I need to manually refresh the page or edit the component B if I want to see my change applied.
I tried to add the cq:listener, but no luck
<cq:listeners
jcr:primaryType="cq:EditListenersConfig"
afteredit="REFRESH_PAGE"
/>
Here is my .content.xml for A component :
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="component A"
jcr:primaryType="cq:Component"
jcr:title="Component A"
allowedParents="[ */*parsys]"
componentGroup="testComponent"/>
Here is my .content.xml for B component :
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Component"
jcr:title="Component"
componentGroup="testComponent"/>
Here is the cq:editConfig of component A
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
cq:dialogMode="floating"
jcr:primaryType="cq:EditConfig">
<cq:listeners
jcr:primaryType="cq:EditListenersConfig"
afteredit="REFRESH_PAGE"/>
</jcr:root>
I'm using AEM 6.2.
Anyone who could help with this one ?
Thanks

In the cq:editConfig node of component A (which I understand to be the inner component), have you tried:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="cq:EditConfig">
<cq:listeners
jcr:primaryType="cq:EditListenersConfig"
afteredit="REFRESH_PARENT"/>
</jcr:root>
This will force the parent component B to refresh when editing component A. I'm using this approach for a custom Layout/Grid component.

I had the same issue and observed that component A (Inner component) is not properly initiated under content page structure when the page initially loads.
For example:
/content
-my_page
-jcr:content
-root
-Component B
+Component A (this needs to be initiate)
So What I did simply added the "cq:template" and nested "component A" and set the component resources path with sling:resourceType = {String}component-path
This approach helped me to solve my issue :), try this way. cq:listener approach didn't work for me.

Related

AEM6.5 cannot user path for selecting video in video component

We would like the editors to be able to use the path selector as well as drag and drop when they select an MP4 file for the video component. At the moment only the drag and drop for video file works. That means, only when you drag and drop an MP4 file from Assets will this be taken into account for the video component. For the image component one can drag an drop an image from Assets or select it using the path.
I am attaching the video component _cq_diaglog/.content.xml
<file jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog/fileupload"
name="./videoFile"
fieldLabel="Video"
fileNameParameter="./videoFileName"
fileReferenceParameter="./videoFileReference"
title="MP4-Video"
mimeTypes="[video/mp4]"
uploadUrl="${suffix.path}"
allowUpload="{Boolean}${not empty cqDesign.allowUpload ? cqDesign.allowUpload : false}"
autoStart="{Boolean}false"
multiple="{Boolean}false"
required="{Boolean}true"
useHTML5="{Boolean}true"
class="cq-droptarget"/>
as well as the video component _cq_editConfig.xml
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="cq:EditConfig">
<cq:dropTargets jcr:primaryType="cq:DropTargetConfig">
<video
jcr:primaryType="nt:unstructured"
accept="[video/mp4]"
groups="[media]"
propertyName="./videoFileReference"/>
</cq:dropTargets>
</jcr:root>
I am also attaching two screenhost pictures from the editor where we would like the editors to be able to select a video by browsing the path:
It turned out the Videos in DAM did not have thumbnails under Renditions. After adding thumbnail renditions for a video one can add it using the Path selector. Everything was ok with code and configuration just content was missing.

How to remove gray screen before splash screen - Ionic 4

Has someone managed to remove the gray screen when launching an ionic app from an android device?
Is there a way to remove this annoying gray screen?
I found a solution it's working fine for me using 5 steps.
1.) Create a file name colors.xml inside project\platforms\android\app\src\main\res\values
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="gray">#fff</color>
<color name="black">#fff</color>
</resources>
2.) Then create a new file styles.xml inside project\platforms\android\app\src\main\res\values
<resources>
<style name="SplashTheme" parent="#android:style/Theme.DeviceDefault.NoActionBar">
<item name="android:windowBackground">#drawable/background_splash</item>
</style>
</resources>
3.) Then open AndroidManifest.xml from project\platforms\android\app\src\main, then search android:theme="#android:style/Theme.DeviceDefault.NoActionBar" and replace with android:theme="#style/SplashTheme"
4.) Create a folder name drawable inside project\platforms\android\app\src\main\res
5.) Inside drawable folder create a new file having name background_splash.xml and the code is below.
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="#color/black"/>
</layer-list>
That's all.
Hope its help.
for me i added this code in style.xml file: /Users/User/Development/project/platforms/android/app/src/main/res/values/styles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">#android:color/transparent</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">false</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
</resources>
and edited my AndroidManifest.xml File : android:theme="#style/SplashTheme" added that to the activity
Add
xmlns:android="http://schemas.android.com/apk/res/android"
and
xmlns:cdv="http://cordova.apache.org/ns/1.0"
( if not present) inside you widget tag in you config.xml present in the root of your project.
Then replace android:theme value of your main activity with
#android:style/Theme.Light.NoTitleBar.Fullscreen
Thats it. You need not add any custom styles (If you don't want).

Round corners of buttons and colour change for android button

I want to following features in buttons in android button:
Buttons should change colours when clicked
Some specific buttons have features like the background color of button should remain changed until we press another button.
For rounded corners you can use below code :
#drawable/rounderd_corner.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#android:color/transparent" />
<stroke
android:width="1dp"
android:color="#color/YOUR_COLOR" />
<corners
android:bottomLeftRadius="8dp"
android:bottomRightRadius="8dp"
android:topLeftRadius="8dp"
android:topRightRadius="8dp" />
And For selector Buttons use below #drawable/select_button_color.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#color/YOUR_COLOR" />
<corners
android:bottomLeftRadius="8dp"
android:bottomRightRadius="8dp"
android:topLeftRadius="8dp"
android:topRightRadius="8dp" />
And Change background resource when button is clicked
For circular and for changing color when selected/not-selected button you can use following code snippet
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="false">
<shape android:shape="oval">
<solid android:color="#color/colorPrimary"/>
</shape>
</item>
<item android:state_pressed="true">
<shape android:shape="oval">
<solid android:color="#color/colorPrimaryDark"/>
</shape>
</item>
</selector>
And you problem will be solved, hope it helps.

cq:editConfig not applying outside of parsys

Cross-post from Adobe Community Forums: http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__qugo-we_have_an_imagecom.html
We have an image component, its _cq_editConfig.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
cq:disableTargeting="{Boolean}true"
jcr:primaryType="cq:EditConfig">
<cq:dropTargets jcr:primaryType="nt:unstructured">
<image
jcr:primaryType="cq:DropTargetConfig"
accept="[image/.*]"
groups="[media]"
propertyName="./fileReference">
</image>
</cq:dropTargets>
</jcr:root>
We have a page component ("Blurb") which includes this component as the "featuredImage", as well as a "body" parsys which allows the same component to be used:
<div>
<h1>*Page Title</h1>
<cq:include path="pageTitle" resourceType="sitename/components/plainText"/>
</div>
<div>
<h1>*Featured Image</h1>
<cq:include path="featuredImage" resourceType="sitename/components/image"/>
</div>
<div>
<h1>*Body</h1>
<cq:include path="body" resourceType="sitename/components/page/blurb/parsys"/>
</div>
If I place a sitename/components/image component in the parsys, I can drag an image from the content finder onto the component to set it. The featuredImage, however, will not accept the drag-n-drop from the content finder (the "not allowed" cursor appears, dropping the image does nothing). If I open the featureImage's edit dialog, I can drag a content finder image to there. I am the admin user, there are no permission restrictions.
The same issue applies to text components configured for inline editing. When the text component is placed in the body parsys (or any parsys), the inline editor works. When the text component is placed outside of the parsys (Page Title in the example above), the inline editor will not appear.
Interestingly, when I change the Blurb page component use foundation components, the featuredImage drag-n-drop works, but the pageTitle inline editing does not.
<div>
<h1>*Page Title</h1>
<cq:include path="pageTitle" resourceType="foundation/components/text"/>
</div>
<div>
<h1>*Featured Image</h1>
<cq:include path="featuredImage" resourceType="foundation/components/image"/>
</div>
<div>
<h1>*Body</h1>
<cq:include path="body" resourceType="sitename/components/page/blurb/parsys"/>
</div>
Is this a WCM bug? Are our components' cq:editConfig definitions missing something?
EDIT: This is running on AEM 5.6.1.
Our Image component's .content.xml:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Component"
jcr:title="Image (Custom)"
sling:resourceSuperType="foundation/components/image"
allowedParents="[*/parsys]"
componentGroup="Site Name Group"/>
And dialog.xml:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Dialog"
xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
<advanced
jcr:primaryType="cq:Widget"
path="/apps/sitename/components/image/tab_advanced.infinity.json"
xtype="cqinclude"/>
<image
jcr:primaryType="cq:Widget"
path="/apps/sitename/old/components/image/dialog/items/image.infinity.json"
xtype="cqinclude"/>
</items>
</jcr:root>
And the cqinclude'd /apps/sitename/components/image/tab_advanced.infinity.json
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Panel"
title="Advanced">
<items jcr:primaryType="cq:WidgetCollection">
<image
jcr:primaryType="cq:Widget"
collapsed="{Boolean}false"
collapsible="{Boolean}true"
title="Image"
xtype="dialogfieldset">
<items jcr:primaryType="cq:WidgetCollection">
<title
jcr:primaryType="cq:Widget"
allowBlank="{Boolean}false"
fieldDescription="Required Field: If the Alt Text field is left blank, the image title will be used instead. "
fieldLabel="Image Title"
maxLength="{Long}60"
name="./jcr:title"
xtype="textfield"/>
<linkUrl
jcr:primaryType="cq:Widget"
fieldDescription="Optional Field: use the link field to specify where the image ought to link to."
fieldLabel="Link to"
name="./linkUrl"
regex="/^\\S*$/"
regexText="Please enter a valid link"
xtype="pathfield"/>
<alt
jcr:primaryType="cq:Widget"
fieldDescription="Optional Field: When text is entered into the Alt text field it will be used instead of the image Title. If the image is used as a link, the Alt text is used for the name of the link. For example <a href="http://slipsum.com/"> Visit Samuel L. Ipsum</a>"
fieldLabel="Alt Text"
maxLength="{Long}100"
name="./alt"
xtype="textfield"/>
<description
jcr:primaryType="cq:Widget"
fieldDescription="Optional Field: used to populate the image caption"
fieldLabel="Caption"
maxLength="{Long}256"
name="./jcr:caption"
xtype="textarea"/>
</items>
</image>
</items>
</jcr:root>
And /apps/sitename/old/components/image/dialog/items/image.infinity.json
<image
jcr:primaryType="cq:Widget"
allowUpload="{Boolean}false"
ddGroups="[media]"
fileNameParameter="./fileName"
fileReferenceParameter="./fileReference"
name="./file"
requestSuffix=".img.png"
title="Image"
xtype="html5smartimage"/>
Sample package for testing (with the text component inline editing) at: http://s000.tinyupload.com/index.php?file_id=05420490884931180108
Since I don't have the full source I can only guess which problem you are actually experiencing. I see one of the following as the possible reasons:
You either do not provide the CQ editor classes as described here
Your custom parsys is misconfigured, try replacing it with the foundation one.
I tried to reproduce the issue, but didn't succeeded, it's working for me. I created this sample project for you.

How to hide some menu items - Zend Navigation

I am using zend navigation in my site and I have the following navigation.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<nav>
<page1>
<label>Site</label>
<uri>/</uri>
<pages>
<page1_1>
<label>Home</label>
<uri>/</uri>
</page1_1>
<page1_2>
<label>News</label>
<uri>/news</uri>
</page1_2>
<page1_3>
<label>Contact</label>
<uri>/contact</uri>
</page1_3>
</pages>
</page1>
</nav>
</config>
Then I render the menu like below
<?=$this->navigation()->menu();?>
Output
- Site
- Home
- News
- Contact
Wanted Output
- Site
- Home
- Contact
How can I remove News item from the menu without affect other menu rendering?
Vou can hide menu entries with visible flag, that you add to the entry you would like to hide, in your case <page1_2>...</page1_2>:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<nav>
<page1>
<label>Site</label>
<uri>/</uri>
<pages>
...
<page1_2>
<label>News</label>
<uri>/news</uri>
<visible>0</visible>
</page1_2>
...
</pages>
</page1>
</nav>
</config>
Only use 0 or 1 within the xml file because false or true aren't recognized. All possible options you will find at Zend Framework: Documentation: Pages - Zend Framework Manual.
If you want the invisible entry in the breadcrumbs menu you can temporally disable the visible flag by adding setRenderInvisible( true )
<?= $this->navigation()->breadcrumbs()->setRenderInvisible( true ); ?>
All options of this helper you find here.
Try using this:
<visible>0</visible>