Using the Core Service API, is there any way to retrieve the fields of a component without having to resort to querying the underlying XML or using a third party(?) wrapper class?
It's fairly simple when using the TOM.NET API
Tridion.ContentManager.ContentManagement.Component component = [get a component];
var componentFields = new Tridion.ContentManager.ContentManagement.Fields.ItemFields(component.Content, component.Schema);
var summary = ((Tridion.ContentManager.ContentManagement.Fields.TextField)componentFields["summary"]).Value;
But when I start using the Core Service API it seems a little more complicated as there is no Tridion.ContentManager.ContentManagement.Fields.ItemFields class to wrap around the component.Content.
I understand Frank van Puffelen has written a set of classes to implement this wrapper functionality but I am a bit wary of using code that is not officially supported by SDL (or is it?).
At the moment it seems to me the functionality to gracefully retrieve fields from a component using the Core Service API has not been fully implemented. I hope I will be proved wrong!
If you are looking for an official wrapper to access the ComponentData content, there is not such a thing as that.
Frank's classes are not officially supported, it is open source code(under the MIT License), but it is built using a supported API, so you should be ok using it.
On the other hand it is not such an extensive piece of code, so if you have an issue, you can probably try to solve it yourself. As already other fellow developers did, as you can see on the page comments.
This question has been asked before, more than once actually..
For example: How to set content to a component without loading XML in SDL Tridion using core services?.
Related
Currently I have a requirement to validate(server side) forms in ASP.net (not MVC). We have several fields in our form which gets data from active directory. Instead of using inbuilt .net validation control, the requirement was to use a configuration setting for all validations, which can be easily edited.I am planning to use XML(or any other similar alternative) as configuration Editor.
Initially I thought (still thinking) this is simple task to achieve. But when I searched for similar implementation, i couldn't find one. Some of the implementation which i saw uses a very complex approach. The whole idea was to keep the validation settings as simple and as dynamic as possible.
I would appreciate if anyone can direct me to a similar implementation or give suggestions with respect to this.
After some research I found this article very useful. It introduced me the validation block in Enterprise Library 5.0 which can be customized as per our requirement.
Every tutorial/example i can find for meteor shows a single view application. I would like to build something a little more complex. I'm unclear how to approach multiple views...preferably in a way that's somewhat scalable?
The iron-router package lets you access different views (layouts) by nice, REST-ful human-friendly clean URLs. It supports parameters in the URL, "loading" templates, waiting for subscriptions to finish loading, before and after hooks etc.
At this point you can only create Single Page applications with Meteor. Note that Single Page, doesn't mean you can't have several views - use iron-router for that.
But by design, Meteor serves a big fat unique JavaScript/HTML/CSS application down to the browser, though there's a feature request to allow incremental loading. It is then up to the application (or more precisely, the JavaScript framework), to dynamically render its views in order to display different "pages".
I was wondering the same thing and it took me way too much time getting something started. I finally got a paged app working solidly by using Backbone views and routes, so I created a simple boilerplate project to make setting up an app like this easier in the future.
Live demo here: backbone-boilerplate.meteor.com
Source code here: github.com/justinmc/meteor-backbone-boilerplate
Have you looked at madewith.meteor.com?
A bunch of apps there have multiple views using Backbone also Jonathan Kingston who created britto has started simple meteor framework called Stellar
At this stage of the game not sure if there really are best practices. But these two seem to be the current flow.
You can also make a tabbed interface for multiple views. There is a package project "Smart package for generating a tabbed interface with pushState" github project here: https://github.com/possibilities/meteor-tabs
The best solution right now is using a routing package (router is basic but works). The workflow is something like this:
declare routes; return a template name for each route
place the reactive helper provided by the package in your body tag
the reactive helper will return the template associated to that route
you create a template for each route and optionally set custom publish functions
Router will give you browser history (client side).
Note that at this time there are some limitation on the way Meteor handles html/js. They are load all at the same time. The bright side is that once the app is loaded, page transitions will be instant.
Assuming I'm stuck with asp.net web forms (I'd love to use MVC partial views), are there any good alternatives to asp.net AJAX 4.0 client-side templates?
In other words, is there some way to specify some html, with placeholders for data properties, to which I could then bind a JSON result. Are there any good jQuery plugins to do this?
I ask because based on the results I'm seeing from Google, this library doesn't seem to be widely used—most search results are from 2008-2010. This question seems to confirm that suspicion.
EDIT
I despise answering my own question, but this link (jQuery Templates) seems to me to be the best bet. If anyone else has any input, please post.
Definitely consider jQuery Templates. We use them quite extensively in WebForms with ScriptServices as a data provider. There is a very small learning curve.
Also check out KnockoutJS, which integrates seamlessly.
Adam, coincidentally, I am using JQuery to retrieve some server side data calling Web Services via Ajax and binding the result on the client side. On my particular case, I am only showing data in a tabular manner, so I am using the jquery datatables plugin (which is fantastic, in my opinion; the API is well documented and easy to extend if you need to).
If you need to show data differently, I think you'll need to write quite a good amount of boilerplate javascript code.
EDIT: I just saw your link reagarding Jquery Templates and looks really cool. I didn't know it existed :) Thanks!
As part of our current project we are dropping MS Word in favour of an intranet-based document Editor; either one that we get off-the-shelf (tinyMCE/CKeditor) or we'll roll our own. We are using ASP.NET and Ext.NET (extjs) for development currently.
I'm trying to copy 3 features (IMO) Google Docs have nailed: pagination, headers and footers. Their implementation is an ideal setup.
Does anyone know if these are using CSS alone to generate the effects of paged documents? Or is there an underlying server-side tech. at play?
CSS alone cannot handle pagination, you need server-side help for this.
I am overriding a lot of SAP's Portal functionality in my current project. I have to create a custom fixed width framework, custom iView trays, custom KM API functionality, and more.
With all of these custom parts, I will not be using a lot of the style functionality implemented by SAP's Theme editor. What I would like to do is create an external CSS, store it outside of the Portal and reference it. Storing externally will allow for easier updates rather than storing the CSS within a portal application. It would also allow for all custom pieces to have their styles in once place.
Unfortunately, I've not found a way to gain access to the HEAD portion of the page that allows me to insert an external stylesheet. Portal Applications can do so using the IResource object to gain access to internal references, but not items on another server.
I'm looking for any ideas that would allow me to gain this functionality. I have x-posted on SAP's SDN, but I suspect I'll get a better answer here.
I'd consider it dirty hack, but as a non-Portal developer I'd consider using JavaScript to insert a new link element in the head pointing to your new CSS file. Of course you'd have a flash of un-styled content because the script probably won't run until after part of the page has been downloaded and rendered, but it may be an adequate solution.
I hate that I'm answering my own question, but I did find a potential solution that's not documented well and in typical SAP fashion uses deprecated methods. So it might be a slightly less dirty hack than what Eric suggested. I found it through an unrelated SDN forum post.
Basically, you dive into the request object and gather the PortalNode. Once you have that, you ask it for a value of a IPortalResponse. This object can be cast to a PortalHtmlResponse. That object has a deprecated method called getHtmlDocument. Using that method, you can use some Html mirror objects to get the head and insert new links.
Sample:
IPortalNode node = request.getNode().getPortalNode();
IPortalResponse resp = (IPortalResponse) node.getValue(IPortalResponse.class.getName());
if (resp instanceof PortalHtmlResponse) {
PortalHtmlResponse htmlResp = (PortalHtmlResponse) resp;
HtmlDocument doc = htmlResp.getHtmlDocument();
HtmlHead myHead = doc.getHead();
HtmlLink cssLink = new HtmlLink("http://myserver.com/css/mycss.css");
cssLink.setType("text/css");
cssLink.setRel("stylesheet");
myHead.addElement(cssLink);
}