Forum Stats

  • 3,851,981 Users
  • 2,264,055 Discussions
  • 7,904,923 Comments

Discussions

weblogic Portal Node/Content Modified Date...

658205
658205 Member Posts: 39
edited Sep 9, 2008 1:43PM in WebLogic Portal
Hi... I am using WLP 8.1 and I have created a node called "Node1" at 11-Jan-2008 10:35:49 EDT 2008 and I updated/modified (add/delete/update) some content of that node at Aug 22 09:52:21 EDT 2008 and again at Aug 27 10:14:52 EST 2008 and again modified it on "Sep 4 2008 11:25:43 EST 2008" ..But Node1.getModifiedDate() is giving as Aug 22 09:52:21 EDT 2008. I was expecting recent modified date (Sep 4 2008 11:25:43 EST 2008).
Does anyone know how to get the recent modified date of a node?
Modifying the content also modifies Node, right?

Thaks in advance....

Pradeep Peddi.

Edited by: user3890858 on Sep 8, 2008 12:13 PM
«1

Answers

  • 648793
    648793 Member Posts: 96
    What date you see on the portal admin tool now? getModifiedDate will return you the date what you see on the portal admin tool as Last Modified. Can you check it again?

    Are you using workflow?
  • 658205
    658205 Member Posts: 39
    edited Sep 8, 2008 3:38PM
    Thanks for the reply...Yes you are correct getModifiedDate is giving the date what I see on Portal Admin tool and it is Aug 22 09:52:21 EDT 2008. But that date was one of the modified dates.
    I added lot of content and deleted some content on Sep 4 2008 11:25:43 EST 2008 so this should be the last modified date, right? Do you know how to get this date?
    Yes I am using workflow.

    Edited by: user3890858 on Sep 8, 2008 12:37 PM
  • 648793
    648793 Member Posts: 96
    I would see only two possibilities. Either you are confused about the content you have modified or during modification due to some error your content was not saved so its still using the old content as well as its properties.

    Can you run a quick test by modifying the content now, do not change any thing just edit it and save it again. that should change the modified date. Once the date is changed on the portal admin tool, try running your example again.
  • 658205
    658205 Member Posts: 39
    After I modified a content its last modified date is giving perfect but corresponding date is not shown for its node. I even tested it now. Content's modified date is perfect butnot node's modified date. Node's last modified date is still showing Aug 22 2008.

    Pradeep.
  • 648793
    648793 Member Posts: 96
    Try logging out and loging in again. That may show right date :)
  • 658205
    658205 Member Posts: 39
    I did everything...inside content is saved properly and modified dates are perfect but nodes' date is different...I didn't understand where it is going wrong...I am surprised by this wierd behavior of weblogic...
  • 648793
    648793 Member Posts: 96
    Ohh, i thought that you mean your code node1.getLastModified() is giving u right date but you are not seeing it right date on portal admin tool. Are you sure you are accessing the right node? Can you try to print some content from the node and crosscheck if you are working on the same node? There could be something wrong with you search or getNode parameters.
  • 658205
    658205 Member Posts: 39
    edited Sep 8, 2008 4:52PM
    I have three different nodes and printing modified dates for those nodes(For testing purpose I even hard coded the node name and printing modified date along with node name)...Admin portal tool date and date displayed with my code is Aug 22 09:52:21 EDT 2008 which is wrong...
    I know some times small fixes take lot of time... but I donno how much time its gonna take for this case ...Any solution for this?

    Edited by: user3890858 on Sep 8, 2008 1:52 PM
  • 648793
    648793 Member Posts: 96
    Can you post your code as well as your CMS structure?
  • 658205
    658205 Member Posts: 39
    I am sure you will be confused if I post the code because its a JSP page...I am posting small part of the code...my main concentration is from cm:getNode tag....


    <%

    /* Context Repository Name stored in portlet preference name "contentRepositoryName" */
    String contentRepositoryName = "";

    /* Presentation Context */
    WindowPresentationContext windowCtx = WindowPresentationContext.getWindowPresentationContext(request);
    /* Portlet Window Title */
    String windowTitle=null;
    PortletPreferences prefs=null;
    String contentPath = null;
    /* Array of valida and invalid links stored in server */
    Node alllinks[] = null;
    try
    {
    //prefs = PortletBackingContext.getPortletBackingContext(request).getPreferences(request);
    prefs = PortletPresentationContext.getPortletPresentationContext(request).getPreferences(request);
    } catch (Exception e)
    {
    String string="Exception retrieving PortletBackingContext. Exception is: " + e.toString();
    logException(string);
    }
    // Retrieve portlet preference values.
    if (prefs!=null)
    {
    try
    {
    contentRepositoryName = prefs.getValue("contentRepositoryName", "");
    minLinkCount = Integer.parseInt(prefs.getValue("minimumLinks","" ));
    cacheTimeOut=Integer.parseInt(prefs.getValue("cacheTimeOut","" ));
    } catch (Exception e)
    {
    String logmsg="Exception retrieving preferences from portlet for: contentRepositoryName. Exception is: " + e.toString();
    logException(logmsg);
    }
    }
    contentPath = contentRepositoryName.toString() + windowCtx.getTitle();
    //System.out.println("content path is "+contentPath);
    windowTitle=windowCtx.getTitle();
    %>
    <cm:getNode path="<%=contentPath %>" id="contentlinks"/>
    <%
    try
    {
    if(contentPath.equals("/BEA Repository/Provider Content/News & Updates"))
    System.out.println();
    long time1=System.currentTimeMillis();
    long time2=System.currentTimeMillis();
    if (contentlinks !=null)
    {
    /*************** Modified Date testing**************************/
    if(contentlinks.getPath().equals("/BEA Repository/Provider Content/News & Updates"))
    {
    Calendar cal=contentlinks.getModifiedDate();
    System.out.println(contentlinks.getPath()+"'s modified date is "+cal.getTime());
    }

    long currentTime=System.currentTimeMillis();
    long cacheValidity=(currentTime-cacheLoadTime)/(1000*60);
    //System.out.println("cache validity in minutes is "+cacheValidity);
    if(linksHash.get(contentPath)!=null&&(cacheValidity<3)){
    //System.out.println(contentPath+" ------- links from cache");
    time1=System.currentTimeMillis();
    alllinks=(Node[])linksHash.get(contentPath);
    time2=System.currentTimeMillis();
    System.out.println("Time taken from CACHE is "+(time2-time1));
    }
    else{
    //System.out.println(contentPath+" -------- links from repository");
    time1=System.currentTimeMillis();
    alllinks = contentlinks.getContentChildren();
    reLoadCache=true;
    //cacheLoadTime=System.currentTimeMillis();
    time2=System.currentTimeMillis();
    System.out.println("Time taken from CONTENT REPOSITORY is "+(time2-time1));
    linksHash.put(contentPath,alllinks);
    }
    if(reLoadCache&&contentPath.equals("/BEA Repository/Provider Content/Related Links")){
    cacheLoadTime=System.currentTimeMillis();
    reLoadCache=false;
    }

    }
    } catch (Exception e)
    {
    String logmsg="Exception retrieving content from CMS for folder: " + windowCtx.getTitle() +
    ". Exception is: " + e.toString();
    logException(logmsg);
    }
This discussion has been closed.