Welcome close

We've made some changes!

As you may have noticed, we've made some changes to the DevCenter to include the new Exchange site, a code community for Ektron developers. You may use the same username and password to login for both the Exchange and DevCenter. Your DevCenter profile has moved over to the Exchange site. You also may notice we have removed some profile functionality in favor of new functionality, including Activity Streams. We welcome your feedback about the site on the Exchange forum.

SEARCH : searchSite
This SectionSite Wide
API

RSS Feed Print Category View
Adding language version of smart form content through API
Zac
Posted: Tuesday, February 2, 2010 12:57 PM
Joined: 2/2/2010
Posts: 2


 

I am using Ektron version 7.5.3.11 and attempting to add content to a folder through the API.  I am able to use the AddContent method that accepts a content id and language id to add additional language versions of normal content items, but I am not able to do it for smart form based items.  The version of AddContent that supports the xml configuration ID does not provide a way to specify the content ID so I am unable to add language versions of content with it.

 

 

Is there a way to add new language versions to smart form content through the API?

 

 

 

thanks

 

-Zac


Zac
Posted: Thursday, May 13, 2010 8:25 AM
Joined: 2/2/2010
Posts: 2


Well, I answered my own question.  I have not found a way to do it through the recommended 'public' api, but I was able to get it to work by using code derived from the workarea code.  This requires the user to be logged into ektron, but that allows the code to put the correct 'last edited by' instead of always saying it is internal administrator.

The trick is to use the Ektron.Cms.ContentAPI class, rather than the Ektron.Cms.Api.Content.Content class.  It has two important methods: AddNewContentv2_0 and SaveContentV2_0.  Both take a Microsoft.VisualBasic.Collection object which holds all of the parameters.

To add a localized version of smart form data to an existing content item, you can pass a collection that contains the following keys:

"ContentType"

"ContentHtml"

"LockedContentLink"

"Comment"

"ContentID" // this is the key to adding new langs to existing content.  You can get PK violations here if the content already exists

"ContentLanguage"

"ContentMatadata"//I don't know what is supposed to go in here

"ContentTeaser"

"FolderID"

"SearchText"

"GoLive"

"EndDate"

"AssetID"

"AssetVersion"

"AssetFilename"

"MimeType"

"FileExtension"

"MimeName"

"ImageUrl"

"MediaAsset"

"ContentTitle"

"ManualAlias"

"ManualAliasID"

"Taxonomy"

"Image"

"MultiXmlID" // this is the smart form configuration ID

"MultiTemplateID"

"AddToQlink"

"IsSearchable"

some of the params could probably be skipped for normal content, stuff like the Asset data.  Note that I didn't do anything with metadata - that's a whole other basket of issues.  I don't know what the minimum set of data is, or if the order matters (I doubt it) but if you build a collection with those keys and fill in the data you want, you can do this.  After you fill the collection, call

contentApi.AddNewContentv2_0(YOURCOLLECTIONNAME)

contentApi.CheckContentInv2_0(contentId,"");

Remember that the current contentApi.ContentLanguage is what will be used to save the content, so you have to change that first to be the new language ID before ou call AddNewContent or CheckContentIn.


 

Jump to different Forum... 






Register for Synergy 2010

Articles
Design without Borders, yet with Structure
CMS400.NET and Adobe Flex
GeoMapping
EkML Ektron Markup Language
Taxonomy

[First] [Previous] [Next] [Last]


See All Articles