Wednesday 11 January 2012

Get Node Properties

<%@page import="javax.jcr.Session,javax.jcr.Node,org.apache.sling.jcr.resource.JcrResourceUtil,
com.day.cq.tagging.Tag,
com.day.cq.tagging.TagManager,com.day.cq.tagging.JcrTagManagerFactory"
%>



<%
     //Node node;

    Session session = slingRequest.getResourceResolver().adaptTo(Session.class);
    TagManager tagManager =   sling.getService(JcrTagManagerFactory.class).getTagManager(session);
    Tag tag = tagManager.resolve("/apps/webexample_siva/components/content/contact"); 

    //specify the path which you want to get
    Node node = tag.adaptTo(Node.class);
    String name= node.getName();
     
%>

//Iterate node properties and displays node property name and value

<%
     for(PropertyIterator propeIterator = node.getProperties() ; propeIterator.hasNext();)
     {
         Property prop= propeIterator.nextProperty();
         if(!prop.getDefinition().isMultiple())
         {
             
             %>
             
             <%=prop.getName() %> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=prop.getString() %> <br />
             <%
             
         }
         
     }
%>


Tuesday 10 January 2012

SCHEDULED PUBLISH

Method 1:

 Select the page that you want to publish in future.. 
    1. Right click on the page.
           --> Expand On/Off Time under the Blog Tab
           --> Set On time at which the page to be activated
       --> click 'Ok' 
    2. Active page

Method 2:

  Select Activate from the menu
  -- select Activelater  and set date & time

Result: The Scheduled page will be stored in the Publishing server but it will published on Scheduled time only.

On/Off Time Behavior:

On Time:
The date and time at which the published page will be activated. When published this page will be kept dormant until the specified time. Leave these fields empty for pages you want to publish immediately (the normal scenario).

Off Time:
The time at which the published page will be deactivated. Again leave these fields empty for pages you want to publish immediately.

Ref: http://dev.day.com/docs/en/cq/current/getting_started/first_steps_for_authors.html