Esta conversación ha sido bloqueada debido a la inactividad. Cree una nueva publicación.
Nivel 1
Nivel 2
Iniciar sesión en la comunidad
Iniciar sesión para ver todas las insignias
Esta conversación ha sido bloqueada debido a la inactividad. Cree una nueva publicación.
Hi,
I m getting result if I am upload a .txt file in dam manually. below is the query
SELECT * FROM [dam:Asset] AS s WHERE CONTAINS(s.*, '" + mykeyword+ "') AND [jcr:path] like '/content/dam/myprojectfolder%'
but in second case if I created .txt file in dam using stream(which i am getting from some external system) then above query is not returning any result.
anyone share why i am not getting result in second case.
Thanks
¡Resuelto! Ir a solución.
Vistas
Respuestas
Total de me gusta
Hi @arpitv27529355 @ka786 I have figured it out.
jcr:mimeType was incorrect on below path for generated file stream.
/content/dam/myprojectfolder/mytextfile.txt/jcr:content/renditions/original/jcr:content
To fix this updated the code provided mimeType as "text/plain", below is the code
AssetManager assetManager=resourceResolver.adaptTo(AssetManager.class);
assetManager.createAsset(fileName, stream, "text/plain", true);
Vistas
Respuestas
Total de me gusta
Could you please check the node properties when you are getting from external system and when you are directly uploafing to dam.
Vistas
Respuestas
Total de me gusta
I have verified all the nodes and properties/values are same.
Vistas
Respuestas
Total de me gusta
Could you please upload both the files here
Vistas
Respuestas
Total de me gusta
Hi codingStar ,
Please verify when you are creating a txt file from Stream the jcr:primaryType of the assest should be [dam:Asset] not the nt:file or try using nt:base [which is considered to be parent node of all nodes] in query which will return all the nodes if any of the child nodes contain particular keyword.
SELECT * FROM nt:base AS s WHERE CONTAINS(s.*, '" + mykeyword+ "') AND [jcr:path] like '/content/dam/myprojectfolder%'
Regards,
Arpit Varshney
Vistas
Respuestas
Total de me gusta
Hi @arpitv27529355 @ka786 I have figured it out.
jcr:mimeType was incorrect on below path for generated file stream.
/content/dam/myprojectfolder/mytextfile.txt/jcr:content/renditions/original/jcr:content
To fix this updated the code provided mimeType as "text/plain", below is the code
AssetManager assetManager=resourceResolver.adaptTo(AssetManager.class);
assetManager.createAsset(fileName, stream, "text/plain", true);
Vistas
Respuestas
Total de me gusta
Vistas
me gusta
Respuestas
Vistas
me gusta
Respuestas
Vistas
me gusta
Respuestas