UncategorizedNo Comments

default thumbnail

I had a comment posted in another blog (Agile PX – Creating an Agile PLM Process Extension ) from Akshay who wanted to know how to get items from the Recently Visited and Navigator panes in the web client.  They figured out Recently Visited items, but not Navigator.  Navigator doesn’t appear to be persisted, so there is little help I can offer, but I thought readers may be interested in knowing how to get the Recent items.

The process flow is pretty simple:

  • Get the IUser of interest
  • Get the recently visited IFolder
  • Iterate over the IAgileObjects in the IFolder

 

recent visits

 

Here’s the Code

 

public static void main(String[] args) throws Exception {
        
        AgileSessionFactory factory = AgileSessionFactory.getInstance(agileURL);
        
        HashMap params = new HashMap();
        params.put(AgileSessionFactory.USERNAME, agileUsername);
        params.put(AgileSessionFactory.PASSWORD, agilePassword);
        session = factory.createSession(params);
    
        IUser me = session.getCurrentUser();
        IFolder folder = me.getFolder(FolderConstants.TYPE_RECENT_VISIT);
        ITwoWayIterator iterator = folder.getFolderIterator();
        
        IAgileObject visit;
        
        while (iterator.hasNext()) {
            visit = (IAgileObject) iterator.next();
            System.out.println(visit.getName());
        }
} 

 

Be the first to post a comment.

Add a comment