aem

Is there a way to programmatically set metadata of an asset?

久未见 提交于 2019-12-13 00:13:25
问题 I added a custom metadata in CQ5 with name ./dc:sample . Is there a way I can programmatically set this metadata for an asset? I've written a workflow that intercepts the uploaded assets and replaces them with inputstream sent from the third party service. I accomplish this by doing the following in my workflow. Rendition rendition = resource.adaptTo(Rendition.class); Asset asset = rendition.getAsset(); InputStream newInputStream = myService.sendFile(is); asset.addRendition(rendition.getName(

Select value from xtype selection type checkbox CQ5

我的梦境 提交于 2019-12-12 21:21:17
问题 Hello I am running an issue right now. I would like to make the checkbox state: checked but I could not make the defaultValue="value" <channels jcr:primaryType="cq:Widget" fieldLabel="Channels" defaultValue="Value" name="channels" options="/bin/sample/private/getJSON.json" optionsValueField="Value" type="checkbox" xtype="selection"> I have tried to do this: Getting Default Checked Checkbox in CQ5 but it didn't solve the issue. 回答1: This is an example of what I have used to set the default

How to remove a property of a CQ node in JAVA

僤鯓⒐⒋嵵緔 提交于 2019-12-12 18:28:44
问题 how can I remove the property of a node in JAVA code? I have tried something like - node.setProperty(propertyName, null); Is there something specific which I can try? 回答1: Supposing that you have a typo with your "setProperty" method, you may be getting ambigous method error. You should do type casting if so: node.setProperty(propertyName, (Value)null); or use remove method node.getProperty(propertyName).remove(); session.save(); 回答2: you are missing session.save(); 来源: https://stackoverflow

is it possible to include files in the touch UI dialog?

别来无恙 提交于 2019-12-12 17:20:41
问题 is it possible to include files in a touch UI dialog? I understand how to include a file inside the classic UI dialog which I've gave an example below. Is this possible for Touch UI dialog if so how do I accomplish this? <livecopy jcr:primaryType="cq:Widget" path="/apps/stackoverflow/components/page/page/tab_stackoverflow.infinity.json" xtype="cqinclude"/> 回答1: Yes. Use the resource type granite/ui/components/foundation/include to do similar operation in Touch UI. <livecopy jcr:primaryType=

Disable auto-adding of <p> tag

試著忘記壹切 提交于 2019-12-12 15:46:28
问题 I'm trying to remove auto-adding of <p> tag in CQ5(Version 5.6.0.20130125). I've tried to add these properties to the text component I'm using but with no effect.(source) removeSingleParagraphContainer true singeParagraphContainerReplacement (empty string) I've also tried this solution. Again, no effect. Is it possible to disable auto-adding of <p> tag? Thanks for any ideas EDIT I've tried this answer but CQ still adds <p> tags to my code. For example, I have this HTML code <strong

AEM DefaultValue written to JCR

左心房为你撑大大i 提交于 2019-12-12 13:32:52
问题 I noticed that when I set my defaultValue for a dropdown, altho it is correctly selected in the drop down when I first add my component to the page it does not write the defaultValue to the corresponding JCR until I edit the component and save it. Even if I just open the corresponding dialog and click OK now my component works as expected because the values have been added to the JCR. I am sure there is an important piece that I am missing here, does anyone knows how defaultValues that are

AEM Sightly - Is it possible to create custom data-sly attributes?

北城余情 提交于 2019-12-12 13:23:53
问题 I was wondering if there is a way to create custom attributes, e.g.: <div data-sly-myAttribute="${whatever}"></div> Just like custom JSP tags. EDIT : As of May 4, 2014, it was not possible, according to this blog. Is there any news on this? 回答1: No, it's not possible to create your own block elements since that implementation will not conform to the specification [0]. There are more subtleties involved than just adding a new plugin, one of them being block elements priority when multiple

What's the purpose of resourceResolver.adaptTo(Session.class) in Apache Sling?

≯℡__Kan透↙ 提交于 2019-12-12 10:41:53
问题 I am new to Apache Sling, CQ5, etc. In our codebase, we have a code snippet similar to this: void perform(SlingHttpServletRequest request, SlingHttpServletResponse response) { ResourceResolver resourceResolver = request.getResourceResolver(); Session session = resourceResolver.adaptTo(Session.class); PageManager pageManager = resourceResolver.adaptTo(PageManager.class); } What's adapTo doing here? Also is there a good documentation/user manual available I can read to get started using Sling,

CQ5 Remove Render-Blocking JavaScript

感情迁移 提交于 2019-12-12 09:47:23
问题 I'm working on this document to remove blocking js: Remove Blocking JS However with CQ5 we include js via: <cq:includeClientLib js="headlibs"/> How can I modify script tag like: <script async src="my.js"> So I can remove blocking JS. 回答1: The cq:includeClientLib does not have any options to do this. You can try using the com.day.cq.widget.HtmlLibraryManager interface to get the path of JS file, the tag is a is a convenience wrapper of this interface. com.day.cq.widget.HtmlLibraryManager

JMX: Read attribute from Server

守給你的承諾、 提交于 2019-12-12 08:59:30
问题 We're using Adobe CQ (5.5) as CMS. Now, our CQ environment consists of one author server, where users can create content, and 2 publish servers which serve the content to the internet. Now there's a replication agent which pushs content from the author server to both publish server. Unfortunately some articles block the queue of the replication agents, so no more new content is beeing published. This is not much of a problem, as it is easy to fix. The real problem is that we don't notice this