내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

setProperty("Name", String[])

Avatar

Level 3

Hi,

 

When I use the method setProperty("Name", String[]) only the Name and type are added to the JCR. The Value is empty. But if I use setProperty("Name", "Value") everything is fine. 

pageResource = page.adaptTo(Resource.class); Resource jcrContentResource = pageResource.getChild(JcrConstants.JCR_CONTENT); Node pageNode = jcrContentResource.adaptTo(Node.class); try { String[] tempIds = ids.toArray(new String[ids.size()]); pageNode.setProperty("cq:tags", tempIds); LOG.debug("Stuff of tags: "+tempIds[0]); LOG.debug("Tag size: "+tempIds.length); resourceResolver.commit(); } catch (Exception e) { LOG.error(e.getMessage(), e); }

Please see attached image.

What code be the problem?

 

Note: CQ version is 5.6.1

Thank you.

Cheers,

Viren.

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Level 10

Hi Viren,

When you are setting the property cq:tags, the array should contain the existing tags otherwise they are ignored and can/will be removed.

 

You should usually not work with raw cq:tags properties, but use the tagging API [1]

[1] http://docs.adobe.com/docs/en/cq/current/developing/tagging.html

원본 게시물의 솔루션 보기

2 답변 개

Avatar

Level 5
Level 5

Hi,

Please refer this https://forums.adobe.com/thread/1105563?tstart=0 for adding a multi valued properties to the Node.

Avatar

정확한 답변 작성자:
Level 10

Hi Viren,

When you are setting the property cq:tags, the array should contain the existing tags otherwise they are ignored and can/will be removed.

 

You should usually not work with raw cq:tags properties, but use the tagging API [1]

[1] http://docs.adobe.com/docs/en/cq/current/developing/tagging.html