/// <summary> /// reDeployAll set all media items to redeploy /// </summary> public void ReDeployAll() { MMedia[] media = MMedia.GetMedia(GetWebProject()); if (media != null && media.Length > 0) { for (int i = 0; i < media.Length; i++) { MMediaDeploy thisDeploy = MMediaDeploy.GetByMedia(GetCtx(), media[i].Get_ID(), Get_ID(), true, null); if (thisDeploy.IsDeployed()) { log.Log(Level.FINE, "Reset Deployed Flag on MediaItem" + media[i].Get_ID()); thisDeploy.SetIsDeployed(false); thisDeploy.Save(); } } } }
} // beforeSave /// <summary> /// after save /// </summary> /// <param name="newRecord">new</param> /// <param name="success">success</param> /// <returns>true if saved</returns> protected override bool AfterSave(bool newRecord, bool success) { if (!success) { return(success); } if (newRecord) { StringBuilder sb = new StringBuilder("INSERT INTO AD_TreeNodeCMM " + "(AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, " + "AD_Tree_ID, Node_ID, Parent_ID, SeqNo) " + "VALUES (") .Append(GetAD_Client_ID()).Append(",0, 'Y', SysDate, 0, SysDate, 0,") .Append(GetAD_Tree_ID()).Append(",").Append(Get_ID()) .Append(", 0, 999)"); int no = DataBase.DB.ExecuteQuery(sb.ToString(), null, Get_TrxName()); if (no > 0) { log.Fine("#" + no + " - TreeType=CMM"); } else { log.Warning("#" + no + " - TreeType=CMM"); } return(no > 0); } // Construct / Update Deployment Procedure MMediaServer[] theseServers = MMediaServer.GetMediaServer(_project); if (theseServers != null && theseServers.Length > 0) { for (int i = 0; i < theseServers.Length; i++) { MMediaDeploy thisDeploy = MMediaDeploy.GetByMedia(GetCtx(), Get_ID(), theseServers[i].Get_ID(), true, Get_TrxName()); if (thisDeploy.IsDeployed()) { thisDeploy.SetIsDeployed(false); thisDeploy.Save(); } } } return(success); } // afterSave