Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > API get documetn type form View modes: 
User avatar
Member
Member
eagleag - 7/25/2011 5:55:18 AM
   
API get documetn type form
HI,
ANyway to get a document type form throw api?
I mean the whole form and use some kentco control to dispay it?
any simple display form control?

dont want to use USer Contribution webpart.

thanks

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 7/25/2011 6:06:14 AM
   
RE:API get documetn type form
Hi,

you could create/select/delete a new document using API. The API example you could find here:
Creating a new document

If you mean that you would like to get a list of fields related to some document type, here is an example:


DataClassInfo classInfo = DataClassInfoProvider.GetDataClass(ClassId);
FormInfo formInfo = new FormInfo(classInfo.ClassFormDefinition);


The created document is a standard one and you can display it the same way as documents created in the UI in the CMS Desk.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
eagleag - 7/25/2011 6:36:07 AM
   
RE:API get documetn type form
any control u can pass he info to and wil show form?

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 7/25/2011 6:56:50 AM
   
RE:API get documetn type form
Hello,

You can use for example CMSForm control. There are these main properties in this control:

BasicForm (BasicForm)
NodeId (int)
FormName (string) - cms.news.default
AlternativeFormFullName (string) – cms.user.editform
FormMode (FormModeEnum - Insert, Update, InsertNewCultureVersion)
SiteName (string)
CultureCode (string)

You can find the working sample in the User contribution, esp. in this control:

~\CMSModules\Content\Controls\UserContributions\EditForm.ascx


Best regards,
Helena Grulichova