public static void AddActionToContentCollection(IPolicyResponseObject pro, IAction3 action, bool skipRootContainer, bool triggeredPolicy) { ResolvedAction resAction = new ResolvedAction(); PolicyResponseAction pra = new PolicyResponseAction(); pra.Action = action; pra.InternalProperties = new MockActionPropertySet(); for (int index = 0; index < pro.ContentCollection.Count; ++index) { ContentItem contentItem = pro.ContentCollection[index] as ContentItem; if (null == contentItem) continue; if (skipRootContainer && (0 == index) && (contentItem.File.IsCollection)) continue; if (resAction.ContentCollection == null) resAction.ContentCollection = new Collection<IContentItem>(); resAction.ContentCollection.Add(contentItem); resAction.ResponseAction = pra; if (pro.ResolvedActionCollection == null) (pro as PolicyResponseObject).ResolvedActionCollection = new Collection<IResolvedAction>(); if(!pro.ResolvedActionCollection.Contains(resAction)) pro.ResolvedActionCollection.Add(resAction); AddActionToContentItem(contentItem, pra, triggeredPolicy); } }
internal PolicyResponseAction(ICachedAction cachedAction, string name, string description, bool isExceptionAction) { m_Action = cachedAction.Action; m_Precedence = cachedAction.Precedence; m_AllowOverride = cachedAction.AllowOverride; m_ActionProperties = cachedAction.Properties; m_Type = cachedAction.Type; m_isExceptionAction = isExceptionAction; m_Name = name; m_Description = description; m_CustomProperties.Add("ExceptionAction", m_isExceptionAction.ToString()); }
private void LoadCleanAction() { if (_cleanAction != null) return; if (Workshare.Interop.Options.OptionApi.GetBool("EnableLightSpeedClean")) { _cleanAction = LoadCleanAction(LightspeedCleanAssemblyName, LightspeedCleanAssemblyClass); } else { _cleanAction = LoadCleanAction(DomCleanAssemblyName, DomCleanAssemblyClass); } }
private void LoadPDFCleanAction() { if (_pdfCleanAction != null) return; _pdfCleanAction = LoadCleanAction(PdfcleanAssemblyName, PdfcleanAssemblyClass); }
public static bool DoesActionSupportFolders(IAction3 action) { return action.Capabilities.SupportsContainers; }
/// <summary> /// Interim helping hand till the block action model is resolved. Block/Alert and Workflow instance /// arent going to be IAction3 actions any longer but should be an integral part of the engine. /// </summary> /// <param name="action"></param> /// <returns></returns> public static bool IsBlockAction(IAction3 action) { return IsBlockAction( action.GetType().FullName ); }
public override void Initialize() { if (m_resolvedAction == null) { throw new InvalidOperationException("Cannot initialize, no Action supplied"); } Workshare.PolicyContent.Action action = m_resolvedAction.Action; m_actionType = action.Type; m_name = action.Name; // Extract the general properties from the custom properties so that we can // make them concrete. foreach (Workshare.PolicyContent.ActionProperty property in action.ActionProperties) { m_internalProperties[property.Name] = CloneActionProperty(property); switch (property.Name) { case "Description": m_description = property.Value; break; } } m_action2 = ActionFactory.CreateAction(action.Assembly, action.ClassName); foreach (UIContentItem contentItem in m_contentItems.Values) { contentItem.Action = this; contentItem.Initialize(); } }
/// <summary> /// Populate the IResourceAction with the IAction3 /// </summary> /// <param name="action">The action being used to populate the ResourceAction</param> public void SetAction(IAction3 action) { if (string.IsNullOrEmpty(action.Name)) m_name = "Action_" + Guid.NewGuid().ToString(); else m_name = action.Name; m_SupportedFileCollectionCapabilities = SupportedFileSet.CopyFileCollection(action.SupportedFileCollection); m_SupportedFileCollectionSetting = SupportedFileSet.CopyFileCollection(action.SupportedFileCollection); m_isExplicit = action.GetType().FullName.StartsWith("Workshare.Policy.Actions.BlockUserAction"); m_languageSupport = action.LanguageSupport; m_canCoexist = !action.GetType().FullName.StartsWith("Workshare.Policy.Actions.BlockUserAction"); m_template = false; m_blocking = action.GetType().FullName.StartsWith("Workshare.Policy.Actions.BlockUserAction"); if (m_blocking) { m_allowTransparent = false; } m_supportsContainers = action.Capabilities.SupportsContainers; m_supportsMime = action.Capabilities.SupportsMime; }