Programmatically adding new page with image , swf resources?

Hi , i m writing some table of content management system.
I’m developing app on vaadin framework over Liferay.

I want to add RichTextEditor and its contents to Liferay as new webpage.
System will return me page full URL.

Is there anything like that we can do ?

Example like:

 String new_link = xxx.getInstance().addNewPage("html contents...");
 xxx.getInstance().getPage(new_link).add("<some swf or image content as base64 or binary>");

Can someone give idea?