Deployer extension to fetch component fields in tridion

87 views Asked by At

I am writing the deployer extension to read the component fields in Tridion using java code. I am able to get the component presentation content, but it is in compressed format as i am using dd4t templates in CMS. Below is the string i am getting.

H4sIAAAAAAAEANVYbW/iOBD+K1akk+4k4JyEt/KNA6rbu/Ii4FZ72q5ObmLA2sRBjtNuVPjvazsh2JDSwu52exIf6vFkPM88Y89MH61eFK4jiim3Oo/WDYr5JLkLSLzCfh9xbHUsCKFdVb85hB31syrWFN+TmEQ0V3Kg3axCt+rac9vpOFcdaAulmbfCIZKGp1HEBwEOxTkjFMoveihcI7KkQu2dL9bcCzvtar3VaFTbQjYnPDDUthXrmuDAj6W52SpiPFd5tHKLmrBivUdBgoXuR6sOfwHRYgGwF9EoTMEiIMsVj8GCRSHohiGiAPAI9JM7RMCv/Q9//GZ9qlijJMSMeIUZIZJQ5yTEuuyG0M/YL2Kobylv5+lauAYr1ocJ4qscZi+iXCj/7iUxj8Qyh7hbGzj+xulDxPy94W0RmwL4MeYZusdAAaeAYZ4wChaI4RgQuo/DHv+bgn8KeZeiIOXEizlD3mdCl17k65Eo39cjIxMVuptZ92aw+Ws87XdHm+5wWBW4N/9u6vakN9/YzWF3KtK9O5n+5FA8BacsNNIne46/cC0ce5kegp8MSnfqKSBOCRDnLQJxngHilgBx3yIQ9wSQ8WKBWayhyAUahG8H8F2LD6w12+4zBUiBOKo+daP6ZDpG6VGiLMpmPJRMZ1UKnFemVnliLHK3SnllZEmorAM6lr3wu/JronArorJzvIxYunu6CVuLuheDGxLLRNxta/TYIhEatmOdEQEdzGEIHq0+jj1G1lykkvRA1cLcj0xfSodDmRDoi6qapd7kztzeGhjE8sDgRJRgynM38pgMMUc+4qhIsK2Rka6oVuIkp64lpWl2q54aHHNCkQTCI/25MeT/fz4P8TxHadbVvBMGWfYVCo4IFqX/UoJPm7+I7nbrkO5ThyjyewkTB3mpxnshelXKd6eeoty9OpNyDcpzbP8z6xesZn+XsVp4ULBq+H17m316AXv1Vss+ZE8aUywNsrZ7HPgTQYFePQ53TnNWb7Zr8JuIa788+MeuldWRXGuEH56AVuychua0Wq8OTXPtGNq2nPLCi+xQu8h0snPpvWiPVE7aRoLYbusKaskhmhsg6guoAvkIbU0szbN6uKIlexkKyQPxCU9nHDG9QTXl5z8fRTNmN/cd24v5uzIx79zegTxcHzpblpw7nQH1S2BK6cUg60Zb+qNBZq6W0nuckNdR4IvOVQBWHbWnCkeRibAqctFsfe06hFVHy83zBuX/Lvgvy/b0vdEclziOnC8uUQuK01JfWq554rTBSJoeP1AxMD9tpGEaqUOQ3zBRBe4YYmlu5+D62kchsps1cCH6gjYcrgM1y4j5IuHrhF9HLETiXlp/zoc34JqhpZxcSkeflpyPHHcOGx232Wk0arYafY6v/D3BD9oVUEt9XvHyJ0UMYKLJWv6IyaU0e40KKvofV0/D3TsH+r2JoiPupxSFxLM6nCVYDjEi0cd0gpbyiO1XvbkohNEUAAA=

Can any one please help me to find out encoding format or how to deseriliaze this string in Java.

1

There are 1 answers

1
Quirijn On

If you set the DD4T templates to 'Compress Output', the data is GZIPped and Base64 encoded. You can decode it in the opposite order:

  1. Decode with Base64
  2. Unzip with GZIP

Alternatively, you can set Compress Output to false and publish readable JSON. You could do this on development only, if you like.

Or you could simply use the DD4T page factory to handle this. Just call PageFactory.deserialize and pass in the compressed JSON as a parameter.