Hello what is the new way in Umbraco 7 to write out this method in a .cs file for a website that is being rendered in WebForms, that is attaching to a Document Type, called AccordionGroup in Umbraco -> Settings -> Document Types:
public static AccordionGroup ParseDocument(Document aDocument)
{
AccordionGroup theAccordionGroup = new AccordionGroup();
theAccordionGroup.ID = aDocument.Id;
if(aDocument.getProperty("headline") != null)
{
theAccordionGroup.Headline = aDocument.getProperty("headline").Value.ToString();
}
return theAccordionGroup;
}
public static Document ToDocument(XmlNode aXmlNode)
{
int theID = 0;
XmlNode theIDNode = aXmlNode.SelectSingleNode("ID");
XmlNode theHeadlineNode = aXmlNode.SelectSingleNode("Headline");
if (theIDNode != null) int.TryParse(theIDNode.InnerText, out theID);
if (theID > 0)
{
Document theDocument = new Document(theID);
theDocument.getProperty("headline").Value = theHeadlineNode == null ? "" : theHeadlineNode.InnerText;
return theDocument;
}
return null;
}
Or is this no longer being used? Thanks!
Using the following namespaces:
using umbraco.NodeFactory;
using umbraco.cms.businesslogic.media;
using umbraco.cms.businesslogic.web;
Also, should I be using different namespaces? If so, which one?
Yes, but the Document object doesn't exist in the New API's. Should I be using the Content object? Basically, I am only using these .cs files to collect the information on nodes and output them inside User Controls. The documentation I read on Document, says that it is used to update, create, or add properties... So, not even sure that I need it. Perhaps someone can help me understand why it would be needed in this case? All I want to do is get the information and have it outputted in a class file's properties. I have a Parse method already for doing this, which seems to work fine... Ofcourse, uses Node, which is loading fine, but not entirely sure that that should be used in the new Umbraco 7 version.
deprecated umbraco.cms.businesslogic.web.Document
Hello what is the new way in Umbraco 7 to write out this method in a .cs file for a website that is being rendered in WebForms, that is attaching to a Document Type, called AccordionGroup in Umbraco -> Settings -> Document Types:
Or is this no longer being used? Thanks!
Using the following namespaces:
Also, should I be using different namespaces? If so, which one?
Hi Solomon
Have you tried searching the documentation for the new API's here? http://our.umbraco.org/documentation/Reference/
/Jan
Yes, but the Document object doesn't exist in the New API's. Should I be using the Content object? Basically, I am only using these .cs files to collect the information on nodes and output them inside User Controls. The documentation I read on Document, says that it is used to update, create, or add properties... So, not even sure that I need it. Perhaps someone can help me understand why it would be needed in this case? All I want to do is get the information and have it outputted in a class file's properties. I have a Parse method already for doing this, which seems to work fine... Ofcourse, uses Node, which is loading fine, but not entirely sure that that should be used in the new Umbraco 7 version.
Sounds like you're looking for the Model stuff? http://our.umbraco.org/documentation/Reference/Management-v6/Models/Content or do I misunderstood you? :)
/Jan
is working on a reply...