0

I consider using dotCMS and integrate it with other system by its rest API but in spite of ability to fetch content by its api I cannot fetch tempates defined in dotCMS.

With url api/content/type/xml/id/c12fe7e6-d338-49d5-973b-2d974d57015b I obtain as response following xml:

<contentlets>
  <content>
    <template>1763fa6e-91c0-464e-8b16-9a25d7ae6ce5</template>
    <modDate>2015-12-10 10:58:56.098</modDate>
    <cachettl>15</cachettl>
    <title>About Us</title>
    <httpsreq/>
    <showOnMenu>true</showOnMenu>
    <inode>84e2879a-7749-40f4-bded-9d59dbb2b1da</inode>
    <____DOTNAME____>About Us</____DOTNAME____>
    <disabledWYSIWYG>[]</disabledWYSIWYG>
    <seokeywords>dotCMS Content Management System</seokeywords>
    <host>48190c8c-42c4-46af-8d1a-0cd5db894797</host>
    <lastReview>2015-12-10 10:58:56.093</lastReview>
    <stInode>c541abb1-69b3-4bc5-8430-5e09e5239cc8</stInode>
    <owner>dotcms.org.1</owner>
    <friendlyname>About Us</friendlyname>
    <identifier>c12fe7e6-d338-49d5-973b-2d974d57015b</identifier>
    <redirecturl/>
    <canonicalUrl/>
    <pagemetadata>dotCMS</pagemetadata>
    <languageId>1</languageId>
    <seodescription>
        dotCMS Content Management System demo site - About Quest
    </seodescription>
    <folder>1049e7fe-1553-4731-bdf9-ba069f1dc08b</folder>
    <sortOrder>0</sortOrder>
    <modUser>dotcms.org.1</modUser>
  </content>
</contentlets>

Is there any possibility to fetch template by its id (here 1763fa6e-91c0-464e-8b16-9a25d7ae6ce5) and obtain html file as response or some xml with html content?

wawek
  • 1,577
  • 1
  • 13
  • 23

2 Answers2

0

Ok so after some hours of source code analysis I think I can assume that there is no rest api implemented by dotCMS. Instead of this we can use java api and fetch such components like templates, containers etc. by calling methods which are responsible for fetching these components from database. Then we can implement our own rest services.

wawek
  • 1,577
  • 1
  • 13
  • 23
0

Templates in dotCMS govern the display of "pages" which can be made up of multiple content objects. If you want to return a content object that has formatting applied to it, take a look at the widget API here:

http://dotcms.com/docs/latest/remote-widgets

and how it can be used here:

http://dotcms.com/docs/latest/remote-widgets

wezell
  • 573
  • 3
  • 7
  • I don't understand what widgets have in common with templates? And yes I would like to obtain html code which builds the template. I think that the best solution is to find template with Java API and then there is a method like getContainersForTemplate and this returns containers which have html body. Am I right? – wawek Dec 19 '15 at 11:35