public void _copyCampaign(ActionRequest req, ActionResponse res,PortletConfig config,ActionForm form, User user)
throws Exception {
Campaign c = (Campaign) req.getAttribute(WebKeys.CAMPAIGN_EDIT);
MailingList ml = (MailingList) InodeFactory.getChildOfClass(c, MailingList.class);
HTMLPage page = (HTMLPage) InodeFactory.getChildOfClass(c, HTMLPage.class);
Communication comm = (Communication) InodeFactory.getChildOfClass(c, Communication.class);
UserFilter userfilter = (UserFilter) InodeFactory.getChildOfClass(c, UserFilter.class);
Campaign copy = CampaignFactory.newInstance();
copy.setTitle( c.getTitle() + " (copy)");
copy.setFromEmail(c.getFromEmail());
copy.setFromName(c.getFromName());
copy.setCStartDate(c.getCStartDate());
copy.setSubject(c.getSubject());
copy.setMessage(c.getMessage());
copy.setOwner(c.getOwner());
copy.setUserId(c.getUserId());
copy.setCommunicationInode(c.getCommunicationInode());
copy.setUserFilterInode(c.getUserFilterInode());
//no sure if this is needed
HibernateUtil.saveOrUpdate(copy);
if(InodeUtils.isSet(ml.getInode())){
copy.addChild(ml);
}
if(InodeUtils.isSet(page.getInode())){
copy.addChild(page);
}