Getting HTML of Smart Form Content in Ektron - ektron

I am working in Ektron 8.0.
I have created a smart form configuration in Settings,I assigned this particular smart form configuration for
a Folder and created a Smart form content.Now i am trying to access the Smart Form content programmatically.
I am getting the "XML" data as the content.Html property.Is there is any way i can get the HTML data corresponding to a smartform content,rather than these XML data?

There are a few ways to this, here are two.
XSLT:
<CMS:ContentBlock runat="server" Visible="true" DisplayXslt="/xmlfiles/SmartForm.xslt" DefaultContentID="23" />
The SmartForm.xslt file translates the xml into formatted html.
Use XSD to access SmartForm Content on the code behind.
This article explains the process.
http://developer.ektron.com/Templates/KBDetail.aspx?id=603
You need to get a copy of the .xsd file and use it to create an object definition for your smart form.
Use the xsd.exe tool to create a class. The command looks like this.
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\xsd.exe" "C:\inetpub\site\xsd\SmartFormContet.xsd" /classes /language:CS /namespace:SmartForm.SmartFormContent
This will generate a class file named SmartFormContet.cs
Copy this file and paste into the code behind of the page.
Deserialize the XML from the Content.Html property.

Related

Attaching a WYSIWYG Library to a Dynamically Generated Input

In a VUE.JS 2 application I'm working on, there is a series of form fields dynamically generated from a JSON Schema. As the Schemas change so do the inputs. (We are using a modified version of this library : https://gitlab.com/formschema/native/tree/feature/new-architecture.
I'd like to attach a Basic WYSIWYG to a particular textarea that was dynamically generated. All the libraries I've come accross need you to manually add the Tag to the template with attributes. Since the form is dynamically generated this seems difficult to do.
Is there a simpler vuejs way to attach a WYSIWYG Editor to a textarea? Perhaps by linking it to a certain ID. The textarea comes prepopulated with data from an API, and that info would need to be included. Any insight is appreciated. I've looked at the following libraries with no success:
https://github.com/ckeditor/ckeditor5-vue
https://github.com/froala/vue-froala-wysiwyg
https://github.com/davidroyer/vue2-editor

Sensenet: Define Content Type with File Upload

How Can I define an content type with a field that contains an file? I think I should use binary type data to do it that but I don't know how to do the rest...
This example uses image upload, but I'm don't know how to define a field as a simple file upload...
The "File" content type is designed to upload any kind of file. In the example - what you said - described a specialized content type with image related metadata. You should try to use the File content type. If its metadata is not good enough for you, you can create an inherited content type with the desired field set.
As Zoltan has written in sensenet there is a predefined content type called File to handle any kind of file you want. If you inherit your custom CTD from this type (parentType="File") it will automatically have a Binary field to store file's binary data when upload and you can define additional fields for custom metas.
If you want to use a content type inherited differently you can use a Binary field to store any kind of data, but will lose built in upload functionality (Upload page). In the other hand on the New/Edit page there will be the File upload's Browse button beside your custom field.
With this it's important to set properly the visibility configurations. If it's set to Hide then you won't be able to upload a file from the New or Edit page.
<Field name="CustomField" type="Binary">
<DisplayName>Custom Field</DisplayName>
<Configuration>
<VisibleBrowse>Hide</VisibleBrowse>
<VisibleEdit>Show</VisibleEdit>
<VisibleNew>Show</VisibleNew>
</Configuration>
</Field>

How to load properties from an external file in SOAP UI?

Currently, when I tried with an external csv/excel, some junk values are getting updated as properties. Please provide an external file snapshot on how to provide property values to import it in SOAP UI.
Have you tried using the Custom Properties import/export feature? It uses an xml document.
You can find it by clicking on your Project/TestSuite/TestCase/TestStep, then looking in the bottom-left corner. Click on the "Custom Properties" tab. There should be property import and export buttons.
There may also be something here which could help you:
http://www.soapui.org/Scripting-Properties/working-with-properties.html
first you should save your external file like this *.properties (like test.properties file type .properties). inside file there should be key=value Recordlike this

File uploading from within a custom form tag in Spring MVC

Context
Part of the administrator side of our application requires the user to edit various types of content, which involves using a rich text editor or using files to generate content that can be seen by the 'client side' users of the application. It's kind of a domain-specific CMS lite.
Because this 'content' can be used in various parts of the application, it is included as a seperate relation in some of our domain entities. We decided to make our own tag library that defines some form fields that can be used to edit this content when an administrator edits an entity that includes a piece of content.
Question
What we'd like to be able to do is the following.
<form:form modelAttribute=...>
<olo:content-editor path="content"/>
<!-- Other form fields for this entity -->
<form:.../>
<form:.../>
</form:form>
The olo:content-editor tag then generates a number of form fields based on what type of content is needed. This means it may (or, depending on the type of content, may not!) generate the filebased-content tag which contains:
<input type="file" name="file/>
Which can be used to replace the file associated with the file based content.
The problem is that the Spring docs indicate that the file upload requires the form to have the enctype to define that it's sending multipart form data. As the file upload is part of the tag and not the form itself, we find this is undesirable. We would like to be able to use our olo:content-editor tag in forms without having to change the form enctype attribute. Is this possible?
Possible solutions
We can think of two client-side hacks that may resolve our problem, but both seem to be rather ugly solutions:
Include a script in filebased content tag that changes the form enctype when it's loaded, so that it is always set to the appropriate type. (Very ugly.)
Submit the file data as a regular hidden form field, of which the data is set by using the HTML5 File API (administrators use a compliant browser. This seems far less ugly but still not an optimal solution.)

How to dynamically associate html content through Onet.xml in Content Editor WebPart?

We are using SharePoint Foundation 2010
We have a custom site definition where in Onet.xml we have placed a Content Editor Web Part on a Custom ASPX page having encoded html content in it just like how it is described in this article.
Issue with this approach is that following this approach makes the HTML content static and can not be dynamically changed for each user.
Is there a way i can make Onet.xml refer an HTML file from a SharePoint folder e.g. Layouts, so that when content gets changed in the HTML file, it gets reflected for each user on their custom page ?
Got it, I think I will be using Page Viewer Web Part instead of Content Editor Web Part which would make my life simpler. I would add an html file path from say Layouts folder and refer it in my Page Viewer Web Part. This way my content would remain dynamic.