Umbraco Library Options
Gregorius
Posted: Wednesday, August 02, 2006 7:54:11 AM

Rank: Addict

Joined: 7/29/2006
Posts: 507
Location: Melbourne, Australia
Hey all,

Well i'm making some serious progress with my understanding of Umbraco.. i had one of those moments last night, when everything just seemed to slot into place... like that missing piece to the puzzle that you've been looking for for so long. :)

That missing piece for me was finding the refernce to the Umbraco library... I can't find it again now, but i'm sure its there somewhere... and then that got me thinking about how i can have my own assemblies referenced in that way through umbraco... so using my assembly for database access and business logic, and umbraco just to call the required functions, and receive the presentation information from my functions.

still not sure about what lies in between the .NET code and Umbraco (xml files, etc)... so hoping somebody can point me in the right direction... should i be getting a copy of the source code to figure this out (and if so where do i get it)? are there some documents or useful blogs that might shed some more light? I'm really interested in how to build fully-fledged web applications using umbraco as a framework to handle the presentation layer... but it seems all manuals etc are aimed towards basic website creators.

thanks guys... i must say i'm loving this umbraco journey (well the installation sucked, but since then i'm learning it all really quickly).

Greg

Wishes he could work with Umbraco all the time.
cpalm
Posted: Wednesday, August 02, 2006 10:22:45 AM

Rank: Aficionado

Joined: 7/19/2006
Posts: 164
Yes, you see the picture :-)

Create your own xslt library where you have all of your .net code and then return xml to your xslt.
This way you keep your presentation layer total flexible

I don't think there is a updated umbraco.library reference
The easy way is to download <a href="http://www.aisto.com/roeder/dotnet/">Reflector for .NET</a> and just drop the umbraco.dll into it and browse to the umbraco.library then you can see all methods (and how the work internal)

Here is a dump from reflector containing all methods in umbraco.library

public static string CurrentDate();
public static string DateAdd(DateTime Date, string AddType, int add);
public static string DateAdd(string Date, string AddType, int add);
public static int DateDiff(DateTime firstDate, DateTime secondDate, string diffType);
public static int DateDiff(string firstDate, string secondDate, string diffType);
public static bool DateGreaterThan(string firstDate, string secondDate);
public static bool DateGreaterThanOrEqual(string firstDate, string secondDate);
public static bool DateGreaterThanOrEqualToday(string firstDate);
public static bool DateGreaterThanToday(string firstDate);
public static string FormatDateTime(string Date, string Format);
private static void generateXmlDocument(int parentId, XmlNode parentNode);
public static Domain[] GetCurrentDomains(int NodeId);
public static XPathNodeIterator GetCurrentMember();
public static string GetDictionaryItem(string Key);
public static XPathNodeIterator GetDictionaryItems(string Key);
public static string GetItem(string alias);
public static string GetItem(int nodeID, string alias);
public static XPathNodeIterator GetMedia(int MediaId, bool Deep);
public static XPathNodeIterator GetMember(int MemberId);
public static string GetMemberName(int MemberId);
public static string GetNodeFromLevel(string path, int level);
public static string GetPreValueAsString(int Id);
public static XPathNodeIterator GetPreValues(int DataTypeId);
public static string GetPropertyTypeName(string ContentTypeAlias, string PropertyTypeAlias);
public static Random GetRandom();
public static Random GetRandom(int seed);
public static Relation[] GetRelatedNodes(int NodeId);
public static XPathNodeIterator GetRelatedNodesAsXml(int NodeId);
private static string getUrlByDomain(int DocumentId, string tempUrl, bool atDomain, string currentDomain, bool emptyOnSameDomain);
public static string GetWeekDay(string Date);
public static XPathNodeIterator GetXmlAll();
public static XPathNodeIterator GetXmlDocument(string Path, bool Relative);
public static XPathNodeIterator GetXmlDocumentByUrl(string Url);
public static XPathNodeIterator GetXmlNodeById(string id);
public static XPathNodeIterator GetXmlNodeByXPath(string xpathQuery);
public static XPathNodeIterator GetXmlNodeCurrent();
public static bool HasAccess(int NodeId, string Path);
public static bool IsLoggedOn();
public static bool IsProtected(int DocumentId, string Path);
public static int LastIndexOf(string Text, string Value);
public static string LongDate(string Date);
public static string LongDate(string Date, bool WithTime, string TimeSplitter);
public static string LongDateWithDayName(string Date, string DaySplitter, bool WithTime, string TimeSplitter, string GlobalAlias);
public static string NiceUrl(int nodeID);
private static string niceUrlDo(int nodeID, int startNodeDepth);
public static string NiceUrlFullPath(int nodeID);
public string PageElement(string key);
public int PageId();
public string PageName();
public static void PublishDocument(Guid nodeID, bool publishChildren, User u);
public static void PublishSingleNode(int DocumentId);
public static void PublishSingleNodeDo(int DocumentId);
public static string QueryForNode(string id);
public static string RemoveFirstParagraphTag(string text);
public static string RenderMacroContent(string Text, int PageId);
public static string RenderTemplate(int PageId);
public static string RenderTemplate(int PageId, int TemplateId);
public static string Replace(string text, string oldValue, string newValue);
public static string ReplaceLineBreaks(string text);
public static string RePublishNodes(int nodeID);
public static void RePublishNodesDotNet(int nodeID);
public static string Request(string key);
public static string RequestCookies(string key);
public static string RequestForm(string key);
public static string RequestQueryString(string key);
public static string RequestServerVariables(string key);
public static void SaveXmlCache(XmlDocument Xd, bool WithDCT);
public static void SendMail(string FromMail, string ToMail, string Subject, string Body, bool IsHtml);
public static string Session(string key);
public static string SessionId();
public static void setSession(string key, string value);
public static string ShortDate(string Date);
public static string ShortDate(string Date, bool WithTime, string TimeSplitter);
public static string ShortDateWithGlobal(string Date, string GlobalAlias);
public static string ShortDateWithTimeAndGlobal(string Date, string GlobalAlias);
public static string ShortTime(string Date);
public static XPathNodeIterator Split(string StringToSplit, string Separator);
public static string StripHtml(string text);
public static string Tidy(string StringToTidy, bool LiveEditing);
public static string TruncateString(string Text, int MaxLength, string AddString);
public static void UnPublishSingleNode(int DocumentId);
private static void XmlChanged();

Regards/Christian
<a href="http://www.cpalm.dk">www.cpalm.dk</a>

CPalm, www.cpalm.dk
Ronnie
Posted: Wednesday, August 02, 2006 10:25:18 AM
Rank: Devotee

Joined: 7/19/2006
Posts: 31
I made an howto on the wiki some time ago, try look at it :) <a href="http://en.wikibooks.org/wiki/Create_xslt_exstension_like_umbraco.Library_in_C">wiki</a>

.NET/Umbraco developer @ ebita ApS
Gregorius
Posted: Wednesday, August 02, 2006 10:30:33 AM

Rank: Addict

Joined: 7/29/2006
Posts: 507
Location: Melbourne, Australia
<i>Yes, you see the picture :-) </i>

yaaaay. 3 hours with umbraco and already its making more sense to me than 3 years with Mambo. granted i didnt really _try to understand the underlying mambo infrastructure, but it just seems Umbraco is really quite intuitive and ... well... neat. :)

<i>Create your own xslt library where you have all of your .net code and then return xml to your xslt.
This way you keep your presentation layer total flexible </i>

This is where i will probably become a bit unstuck.. having never used XML extensively before, there's probably a bit of a learning curve there for me. Guess i'll need the source for the Umbraco library, so i can work out how that's been coded, then mimic that for my own libraries. is somebody able to send me the source?

<i>I don't think there is a updated umbraco.library reference The easy way is to download Reflector for .NET and just drop the umbraco.dll into it and browse to the umbraco.library then you can see all methods (and how the work internal) </i>

Awesome, i'll check that out for sure. thansk for the tip

<i>Here is a dump from reflector containing all methods in umbraco.library </i>

Nice one, thanks for that. Printed and added to my reference book. :)


Wishes he could work with Umbraco all the time.
Gregorius
Posted: Wednesday, August 02, 2006 10:32:31 AM

Rank: Addict

Joined: 7/29/2006
Posts: 507
Location: Melbourne, Australia
<i>I made an howto on the wiki some time ago, try look at it :) wiki</i>

Thank you Ronnie... sorry i really should read through that entire wiki sometime soon.

Pity its not in VB. :( ahh well, i'll manage i guess.

Wishes he could work with Umbraco all the time.
Gregorius
Posted: Wednesday, August 02, 2006 10:57:24 AM

Rank: Addict

Joined: 7/29/2006
Posts: 507
Location: Melbourne, Australia
Anyone know how up to date this is?
http://www.umbraco.org/doc/umbraco.libraryMembers.html


Wishes he could work with Umbraco all the time.
Ronnie
Posted: Wednesday, August 02, 2006 11:14:41 AM
Rank: Devotee

Joined: 7/19/2006
Posts: 31
Dont know how updated it is...
Regarding the xslt extension documentation, maybe you could write one to VB users ;o)

//Ronnie



.NET/Umbraco developer @ ebita ApS
pph
Posted: Wednesday, August 02, 2006 11:15:09 AM
Rank: Aficionado

Joined: 7/19/2006
Posts: 165
Location: aalleren, Denmark
I think it's missing a handfull of the newer methods. Like getting prevalues, rendering macros and templates and getting media data.

The library source is commented pretty good in the newer versions, so you should probably take a look at that - it's in the svn.

Umbracian Personal blog: Objects.dk
Gregorius
Posted: Wednesday, August 02, 2006 11:44:38 AM

Rank: Addict

Joined: 7/29/2006
Posts: 507
Location: Melbourne, Australia
yeah i'll grab the source from the SVN (when i work that out - yet another thing to figure out hahaha)... probably the best way to learn it... will also help figure out how to create my own library to work with in umbraco :)

Wishes he could work with Umbraco all the time.
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.