public override void Init(XCore.Mediator mediator, PropertyTable propertyTable, XmlNode viewConfiguration) { base.Init(mediator, propertyTable, viewConfiguration); XmlNode clerkConfiguration = ToolConfiguration.GetClerkNodeFromToolParamsNode(viewConfiguration); var subitemNames = XmlUtils.GetMandatoryAttributeValue(clerkConfiguration, "field").Split('.'); SubitemFlid = Cache.MetaDataCacheAccessor.GetFieldId(subitemNames[0].Trim(), subitemNames[1].Trim(), true); }
/// <summary> /// Read in the parameters to determine which sequence/collection we are editing. /// </summary> protected virtual void ReadParameters() { XmlNode node = ToolConfiguration.GetClerkNodeFromToolParamsNode(m_configurationParameters); // Set the clerk id if the parent control hasn't already set it. if (String.IsNullOrEmpty(m_vectorName)) { m_vectorName = ToolConfiguration.GetIdOfTool(node); } }
/// <summary> /// This method is called BY REFLECTION through the mediator from LinkListener.FollowActiveLink, because the assembly dependencies /// are in the wrong direction. It finds the name of the tool we need to invoke to edit a given list. /// </summary> /// <param name="parameters"></param> /// <returns></returns> public bool OnGetToolForList(object parameters) { var realParams = (object[])parameters; var list = (ICmPossibilityList)realParams[0]; var windowConfiguration = (XmlNode)m_mediator.PropertyTable.GetValue("WindowConfiguration"); foreach (XmlNode tool in windowConfiguration.SelectSingleNode(GetListToolsXPath()).ChildNodes) { var toolName = XmlUtils.GetManditoryAttributeValue(tool, "value"); var paramsNode = tool.SelectSingleNode(".//control/parameters[@clerk]"); if (paramsNode == null) { continue; } var clerkNode = ToolConfiguration.GetClerkNodeFromToolParamsNode(paramsNode); if (clerkNode == null) { continue; } var listNode = clerkNode.SelectSingleNode("recordList"); if (listNode == null) { continue; } var owner = XmlUtils.GetOptionalAttributeValue(listNode, "owner"); var listName = XmlUtils.GetOptionalAttributeValue(listNode, "property"); if (string.IsNullOrEmpty(owner) || string.IsNullOrEmpty(listName)) { continue; } var possibleList = PossibilityRecordList.GetListFromOwnerAndProperty(list.Cache, owner, listName); if (possibleList == list) { realParams[1] = toolName; return(true); } } // If it's not a known list, try custom. realParams[1] = GetCustomListToolName(list); return(true); }