item.setTitle( title );
item.setLink( link );
item.setDescription( description );
Content content = null;
try {
content = this.getContentMarkup( this.getURL( provider ) ).getContent();
//BEGIN reorg of the item list so that the new entry begins at the top
Vector v = new Vector();
Item[] items = content.getChannel().getItem();
for ( int i = 0; i < items.length; ++i ) {
v.addElement( items[i] );
}
v.insertElementAt( item, 0 );
//now build this into a new array
Item[] newItems = new Item[ v.size() ];
v.copyInto( newItems );
content.getChannel().removeAllItem();
//now go through all the new items and add those
for ( int i = 0; i < newItems.length; ++i ) {
content.getChannel().addItem( newItems[i] );
}
//END reorg of the item list so that the new entry begins at the top
//save the portlet markup after you have made the changes.