content-type

Rename a SharePoint list content type

I need to rename the content type I created a couple months back and have been using for a document library, assigned site columns to, created document library views for and have added workflow to. It appears that this is quite simple to do under the site settings for content type. However it is often the simple, apparently straight for...

Rails app crashes and burns when sending a GET request with Content-Type header set

I have created a rails application that has a simple RESTful json API. This has worked for a while, but now we have run into a problem. The javascript framework that makes requests adds a "Content-Type" header to all requests . . . including GET requests. It sets the header to "application/json" and causes the rails app to crash and burn...

Is the OnAdded field event fired when a content type is added to a list

Say I have a custom field type called MyCoolField that I have deployed in a solution. This solution also contains a an SPEventReceivers that has overridden ItemAdded, ItemUpdated, and ItemDeleting. All the specifics of this particular field type are probably not super relevant, but one things to note is that inside of the "OnAdded" met...

Add a lookup field to a content type in sharepoint

How can I add a lookup field to a content type in sharepoint using the xml definition? (I'm getting errors). Things to note: - The lookup list will exist when the content type is added to the document library. - The lookup list will always have the same name. - The lookup list has a space in the name. This is what I've added to the xml...

What is best practice for updating "New Item" on SharePoint form for a custom content type?

When creating a new list item based on a content type, the "New" dropdown box gives you a list of custom content types to choose from. When selecting the content type, you're taken to a form to fill out. At the top of this form it says "New Item." What is best practice for updating this label to show the actual content type name rather ...

What are the killer uses of Content Types for Lists (not Document Libraries)?

I've seen a lot of blogs, articles and discussions across the web that lead me to believe that custom Content Types are must-use functionality in a SharePoint site - especially where no-code customization of SharePoint/MOSS sites are concerned. However, after a few hours of directed research on the subject, the uses of Content Types (fo...

Django - How to get only 2 object for a combination of fields with a queryset

If I have Model.objects.all() I want to get only one object for any content_object=foo, object_id=N. How can I do that? Say I am ordering by -datetime. If I can get only one object in the queryset for any content_type=foo, object_id=N ... it should be the latest.. How to specify that I only want 1 object for any combination of cont...

What are default respond_to formats for Ruby On Rails and how to go about adding new ones?

So here is what I have: def index @profiles = Profile.all respond_to do |format| format.html # index.html.erb format.xml { render :xml => @profiles } format.json { render :json => @profiles } end end I would like to add rss, atom and possibly some custom ones such as one that returns the image for ...

Canonical vs Requested Type in Content Negotation

So I was wondering what should be done with HTTP Content Negotiation regarding requests where the returned data may have multiple valid MIME types. For example if say I have some arbitrary data that has the following possible MIME types: text/data,application/x-data,application/data+xml Given that there are multiple MIME types possib...

How to set content-type when using initWithContentsOfUrl

Basically I want to set Content-Type: application/json; in order to call a dot net web service and have it return json to an iphone application. At the moment I have NSString * jsonres = [[NSString alloc] initWithContentsOfURL:url]; What do I need instead in order to issue a blocking request ? ...

How to serve .RTFs

I support a web-application that displays reports from a database. Occassionally, a report will contain an attachment (which is typically an image/document which is stored in the database as well). We serve the attachment via a dynamic .htm resource which streams the attachment from the database, and populates the content-type based on ...

ASP.NET MVC: How do I send "text/xml" to all browsers but IE?

I need to be able to send the content type "text/xml" to Firefox and Safari, to allow them to render inline SVG in one of my pages. This works, as long as the content type is "text/xml". However, when IE hits the page, if the content type is not "text/html" it tries to render the XML document tree, rather than the XHTML content of the ...

How to limit the resource formats in the Rails routes file

When routing resources in Rails the optional format attribute is automatically appended to the generated routes. This is so that the resource in question can be requested as either XML, HTML etc. Which formats that is actually allowed is usually described in the controller using respond_to. But in many cases you only want to support HTM...

Modifying content type INPUT page?

Lets say I create a content type, called "product". Now, if I wish to change the way product nodes are displayed, i would edit "node-product.tpl.php". Easy enough. But what if I want to edit the INPUT page? I.e. The page where you CREATE the node? Is there any easy way to do this? ...

Adding forced preview to node and change submit button value in Drupal?

This question is two-fold: Is there any way to force a user to first preview a SPECIFIC node before submitting it? i.e. Not all nodes using /admin/content/node-settings ... but only ONE specific node. Is there any way to change the labels to instead of saying "submit" and "preview", rather say "Process" and "Review"? ...

Changing the Node Creation Title in Drupal?

Let's say I have a node called "product". When I create such a node, it will always display: "Create product" as the title of the node. How do I change this title WHEN CREATING THE NODE? ...

Does requiring POST plus custom Content-Type prevent CSRF?

My team is building a site that uses AJAX calls to WCF services for all state changes. Those services only accept a request if its method is POST and its Content-Type is 'application/json'. Assuming that our site has no XSS vulnerabilities, is this sufficient protection against CSRF for our WCF services? Is it possible for an attacker...

CakePHP RequestHandler: setContent/renderAs/respondAs .. what?

Can someone please explain these functions: RequestHandlerComponent::renderAs() RequestHandlerComponent::respondAs() RequestHandlerComponent::setContent() It feels slightly redundant to have all three of them (as public methods anyway). If I want to respond to a request with a PDF file, does that mean I'd have to call all three fun...

Sharepoint content type not in page properties list

Hi, I think I have done everything right but my content type won't appear in the page properties. Here's what I did: Created 2 content types, one deriving from "Welcome Page" and one deriving from "Article Page" Created "Site Columns" and added them to my content types Opened Sharepoint designer to create a page layouts based on my C...

Grouping non-cck fields in Drupal?

Currently you can only assign field groups to cck fields created on a content type. I want to be able to assign a field group to all the standard items (title, description and taxonomy) so as to group them together. Is there a way to do this without doing a form_alter? ...