This post if part of a series about the File System Toolkit - a custom content delivery API for SDL Tridion. This post describes a few examples of Toolkit API. Model Factory The following example retrieves a Page model and a Component model. ModelFactory modelFactory = ModelFactory . INSTANCE ; TcmUri tcmUri = new TcmUri ( 6 , 1225 , 64 ); PageMeta model = modelFactory . getModel ( tcmUri ); tcmUri = new TcmUri ( 6 , 52 ); ComponentMeta componentMeta = modelFactory . getModel ( tcmUri ); Link Resolving The following examples resolve Binary, Component and Page links. LinkFactory linkFactory = LinkFactory . INSTANCE ; Link link = linkFactory . getBinaryLink ( 6 , 84 ); if ( link . isResolved ()) { String url = link . getUrl (); } // link to a Component link = linkFactory . getComponentLink ( 6 , 52 ); // link to a Component from a Page link = linkFactory . getComponentLink ( 6 , 1138 , 1118 ); // link to a Page link ...
talk is cheap. show me the code.