AnsweredAssumed Answered

Problems creating new webscript

Question asked by lemmy on Sep 13, 2011
Latest reply on Sep 13, 2011 by lemmy
Hi,

I'm trying to create a new webscript. webscripts\list\thumbnails.* is pretty much what I need. So I copied and renamed 3 files to pictures.*. I've updated pictures.get.desc.xml

pictures.get.desc.xml
<webscript>
  <shortname>List of pictures</shortname>
  <description>List of pictures</description>
  <url>/list/pictures</url>
</webscript>

pictures.get.html.ftl
<!– pictures start –>
<#if articles??>
   <!– if articles –>
    <#if articles.title??>
        <div class="interior-header">
            <h2 class="full-h">${articles.title}</h2>
            <#if articles.description??><p class="intheader-paragraph">${articles.description}</p></#if>
        </div>
    </#if>
   
    <div class="interior-content">
        <#if articles.assets?size == 0>
            ${msg('list.none')}
        <#else>
            <#if subTitle??><h3>${msg(subTitle)}</h3></#if>               
            <ul class="portfolio-wrapper">
                <#list articles.assets as article>     
                    <li>
                        <a href="<@makeurl asset=article force='long'/>${linkParam!''}"><img src="<@makeurl asset=article rendition='mediumPublicationThumbnail'/>" alt="${asset.title!''}" class="img-border" /></a>
                        <h3><a href="<@makeurl asset=article force='long'/>${linkParam!''}">${article.title!article.name}</a></h3>
                        <#if article.description??><p><@truncate value=article.description chars=100/></p></#if>
                    </li>
                </#list>
            </ul>
        </#if>
    </div>
</#if>
<!– pictures end –>

pictures.js

// Get the collection of articles indicated in the component properties
model.articles = collectionService.getCollection(context.properties.section.id, args.collection);

// If a link page is specified in the component properties then pass this to the view
if (args.linkPage != null)
{
   model.linkParam = '?view='+args.linkPage;
}

//If a sub title is specified in the component properties then pass this to the view
if (args.subTitle != null)
{
   model.subTitle = args.subTitle;
}

I shall be used in article1 page.
article1.xml

<?xml version="1.0" encoding="UTF-8"?>
<page>
   <id>articlepage1</id>
   <description>news article style page with medium image</description>
   <template-instance>two-block</template-instance>
   <authentication>none</authentication>
   <components>
      <component>
         <region-id>left1</region-id>
         <url>/article/style1</url>
      </component>      
      <component>
         <region-id>right1</region-id>
         <url>/related/articles</url>
      </component>   
      <component>
         <region-id>right2</region-id>
         <url>/facebook/like</url>
      </component>
      <component>
         <region-id>right3</region-id>
         <url>/list/pictures</url>
      </component>
   </components>
</page>

Requesting the corresponding url shows the first and last html-remarks in pictures.get.html.ftl but not <!– if articles –> The JavaScript Debugger is working but it doesn't stop in pictures.js. Refreshing webscripts with http://localhost:8080/alfresco/service/index or http://localhost:8080/share/service/index doesn't effect anything.

Am I missing something?

Thanks,
Lemmy

Outcomes