public bool TryFindPage(string Url, out IPage page) { var serializer = new XmlSerializer(typeof(Page)); page = null; //Create WCF Client using (var client = new TridionBrokerServiceClient()) { //Create XML Document to hold Xml returned from WCF Client var pageContent = new XmlDocument(); pageContent.LoadXml(client.FindPageByUrl(PublicationId, Url)); //Load XML into Reader for deserialization using (var reader = new XmlNodeReader(pageContent.DocumentElement)) { try { page = (IPage)serializer.Deserialize(reader); LoadComponentModelsFromComponentFactory(page); return(true); } catch (Exception) { //return false; //throw new FieldHasNoValueException(); } } } return(false); }
public bool TryFindPageContent(string Url, out string pageContent) { pageContent = string.Empty; using (var client = new TridionBrokerServiceClient()) { pageContent = client.FindPageByUrl(PublicationId, Url); if (pageContent != string.Empty) { return(true); } } return(false); }
public bool TryFindPage(string Url, out IPage page) { var serializer = new XmlSerializer(typeof(Page)); page = null; //Create WCF Client using (var client = new TridionBrokerServiceClient()) { //Create XML Document to hold Xml returned from WCF Client var pageContent = new XmlDocument(); pageContent.LoadXml(client.FindPageByUrl(PublicationId, Url)); //Load XML into Reader for deserialization using (var reader = new XmlNodeReader(pageContent.DocumentElement)) { try { page = (IPage)serializer.Deserialize(reader); LoadComponentModelsFromComponentFactory(page); return true; } catch (Exception) { //return false; //throw new FieldHasNoValueException(); } } } return false; }
public bool TryFindPageContent(string Url, out string pageContent) { pageContent = string.Empty; using (var client = new TridionBrokerServiceClient()) { pageContent = client.FindPageByUrl(PublicationId, Url); if (pageContent != string.Empty) { return true; } } return false; }