Search in sources :

Example 1 with MNewsItem

use of org.compiere.model.MNewsItem in project adempiere by adempiere.

the class KIndexRerun method doIt.

//	prepare
/**
	 *  Perform process.
	 *  @return Message (clear text)
	 *  @throws Exception if not successful
	 */
protected String doIt() throws Exception {
    // ReIndex Container
    int[] containers = MContainer.getAllIDs("CM_Container", "CM_WebProject_ID=" + p_CM_WebProject_ID, get_TrxName());
    for (int i = 0; i < containers.length; i++) {
        MContainer thisContainer = new MContainer(getCtx(), containers[i], get_TrxName());
        thisContainer.reIndex(false);
    }
    // ReIndex News
    int[] newsChannels = MNewsChannel.getAllIDs("CM_NewsChannel", "CM_WebProject_ID=" + p_CM_WebProject_ID, get_TrxName());
    for (int i = 0; i < newsChannels.length; i++) {
        MNewsChannel thisChannel = new MNewsChannel(getCtx(), newsChannels[i], get_TrxName());
        thisChannel.reIndex(false);
        int[] newsItems = MNewsItem.getAllIDs("CM_NewsItem", "CM_NewsChannel_ID=" + newsChannels[i], get_TrxName());
        for (int k = 0; k < newsItems.length; k++) {
            MNewsItem thisItem = new MNewsItem(getCtx(), newsItems[k], get_TrxName());
            thisItem.reIndex(false);
        }
    }
    return "finished...";
}
Also used : MNewsChannel(org.compiere.model.MNewsChannel) MNewsItem(org.compiere.model.MNewsItem) MContainer(org.compiere.model.MContainer)

Aggregations

MContainer (org.compiere.model.MContainer)1 MNewsChannel (org.compiere.model.MNewsChannel)1 MNewsItem (org.compiere.model.MNewsItem)1