How to add multi line string property on DSL - dsl

I am developing a workflow designer by DSL tools (Domain Specific Language) in Visual Studio,
I want to add a multi line string property as a domain property on one of my domain classes.
When I add it as string, it's only 1 line of string.
This is what I am looking for, something like Notes in DSL designer.

I found the solution, in case somebody else is looking for it too.
So we need to add UITypeEditor, by adding this as CustomAttribute on domain property
[System.ComponentModel.Editor(
typeof(System.ComponentModel.Design.MultilineStringEditor),
typeof(System.Drawing.Design.UITypeEditor))]
Also System.design.dll should be added to solution too
More info at https://msdn.microsoft.com/en-us/library/cc512860.aspx?f=255&MSPPError=-2147217396

Related

Kentcio v9 Smart Search Dialog with Results search mode localization

How can i localize the drop down option for the search mode? I did some digging and was able to adjust the localization for the search form labels but i'm at loss here.
The CMS Module SearchDialog.ascx call the drop down list here, but i can't see where the values come from.
<cms:CMSDropDownList runat="server" ID="drpSearchMode" CssClass="DropDownField" />
Go to the localization App and create resource strings for
"srch.dialog.AllWords"
"srch.dialog.AnyWord"
"srch.dialog.anywordorsynonyms"
"srch.dialog.ExactPhrase"
Believe those are the 4 you need.
I couldn't find official documentation that helps much with this, though there have been articles in the past on older versions. However, one trick I've used previously is to look in the ~/CMSResources/cms.resx file, find the localized string there, and add a new one with the same key to the Localization module in Kentico. That is, add a new resource string in Kentico with the same key (the naming will be different depending on your version of Kentico).
Here's the docs discussing setting up a multilingual interface: https://docs.kentico.com/display/K9/Setting+up+a+multilingual+user+interface
And here's a screenshot of the resx file:
So in your case I'd create a new resource string within Kentico called "srch.dialog.allwords" as an example and that should overwrite and take priority over whatever is in the .resx file, plus you can manage it via the Kentico admin. There may be a quicker or more reliable way to view the list of default resource strings but in my recent installs of Kentico, the list is hidden from the admin interface.
Alternatively, of course, you could manage the resource strings via various .resx files as in the documentation, but I try to manage as much of these pieces via Kentico as possible for convenience.

What is the best practice for overriding strings in Orchard CMS?

I often have the situation where the wording of specific strings from various modules or core features needs to be changed for specific tenants & themes in Orchard CMS.
For example, I may have a client that prefers to have the shopping cart checkout button say "Checkout Now" rather than "Go to checkout" which is a string contained within a view in a shopping module.
I can simply override the razor view in my theme and change the string, however views often are quite complex, and it doesn't feel right overriding a view just to change one string.
Another approach I have tried is to define a po translation file within my theme to override the string from the module. This works because the strings in the module are defined using the T() syntax. However, I've noticed that as soon as I define an override for a string within my theme, this override effects all tenants, instead of just the one tenant that has this theme enabled. I'm inclined to think that translations within modules/themes should be ignored from tenants where they are not enabled.
So I'm left wondering what the best approach for this scenario is?
The localisation/po file approach would be ok if tenants ignored po files from themes that aren't enabled, but then again, it would be really nice if there was a module or feature in core that allowed you to specify string overrides via the admin interface. I guess it's more of a "rewording" task than a "translation" task.
The preferred way of doing this is through template overrides. If you don't want to do that, you can actually break shapes down, and delegate the rendering to smaller templates that are easier to override. This is done by simply refactoring the part of a template that you want to be able to override individually into a separate template. This post explains how to do that: http://weblogs.asp.net/bleroy/creating-shapes-on-the-fly
If you're not willing to do that, you can use this module to get strings from the database instead of po files: http://gallery.orchardproject.net/List/Modules/Orchard.Module.Q42.DbTranslations It should be possible to modify it to fit your sceanrio.

Adding new section in control panel of Liferay

I want to add a new section in control panel of liferay and within that section I want to have my custom-portlet. I did it using ext. However I want to do it with hook . Is it possible ?
I don't think it would be that easy with a hook, because of the following reasons:
You can't modify in a Hook - the class com.liferay.portal.util.PortletCategoryKeys which contains the keys for displaying the different sections. The different sections are hard-coded in this class in a String array ALL.
You can't modify the logic of PortalImpl#isControlPanelPortlet() which uses the PortletCategoryKeys#ALL to determine if the request in question is for a control panel portlet.
Then you also have another method which you can't modify with a Hook and is used extensively PortalImpl#getControlPanelCategory()
Doing it with a hook:
I have not tried this but I think if you need to do it with a hook you would have to change all those JSPs which make use of PortletCategoryKeys#ALL and the methods of PortalImpl as stated above, and provide your custom implementation for all these methods in the JSP.
I would really like to know how you implemented it with an EXT may be just the steps or the methods you have overridden. So that I can try to convert those in terms of a hook.
This is as far as my understanding goes. Hope this helps.
With the advent of Marketplace, ControlPanel has a new category named "Marketplace" and that section is introduced in a plugin. However, I never checked if 6.1 GA2 introduced a new section that this plugin just fills. Check the marketplace plugin if you can find a trace of this section implemented there.
On the other hand, nobody has yet named any section that definitely required a new section (though some have asked me how to solve the same problem). For this reason, you might want to re-think the requirement and choose one of the existing sections. If you don't, at least I'd be interested in the name and purpose of the new section - I might find a first one actually justifying this kind of implementation...

How to integrate a "shortcode" feature in Sharepoint wikis

I would like to "customize" my sharepoint wiki by doing something very simple.
I would like to be able to run a regex on wiki pages looking for [math] and [\math] tags, then take the expression written in the middle (assume this value is stored in a variable x) and replace the whole block by
"<img src='http://latex.codecogs.com/gif.latex?" + x +"'/>"
So for example, the shortcode [math]a^2+b^2=c^2[\math] should end up being displayed as an image as follows (thanks to this online tool):
I have never developed anything in sharepoint, and I've been using it for a week.
Can anybody tell me how I should proceed to add such a feature (if it's possible)?
You can use existing solution like ShortPoint.
Sure - this is simmply done via two methods - 1) You could modify the page directly using SharePoint designer - fly in the code where you want it, 2) The better way - add your code to text file, upload the text file to a document library then use the Content Editor web part, drop it on the page, point it (through the properties) to the text file.
Note: The Content Editor part will allow you to modify the background HTML/Script, however, it has a nasty habit of overriding your code and I've had it actually duplicate itself (adding repeat scripts). Using the Text file eliminiates that issue.
If i understand you correctly, I don't think that the content editor web part is the solution you are looking for. I believe you are wanting to implement a shortcodes solution such as that found in WordPress, correct? In that case, the issue becomes a bit more complex. To really get any kind of custom code that would execute at the necessary stages, you would need a custom solution either implementing additional functionality in the existing rich text editor, or roll your own custom rich text editor.
At that point, you would have complete control over how the content is parsed and interpreted, so you could have both server-side and client side processing. You could make use of templating engines like mustache or handlebars.
To do this, you would need to write your own Custom field type, inherit from SPFieldMultiLineText, override the property FieldRenderingControl, and return your custom control. That way you have the option of implementing it in several different places (custom pege fields in a page layout, custom webparts, custom lists, etc.) and you still get the benefits you want from the out-of-the-box control.

How Can I Define IP Address Field in SharePoint List

I'm creating a list using visual studio 2010, I want the list to contains I-P-Address field which i figured out is not available out of the box, so i guess i need to define that field.
how can i define that field type pro-grammatically?
Edit: I followed the tutorial Here to create Custom Field but when i was adding list from visual studio i tried to change type to Ip Address but i couldnt find it!
thanks in advance.
I don't think this is Visual Studio 2010 you are using. A list wizard like you are showing is not part of VS2010, but rather one of the upcoming features of the new Visual Studio - or you might be using some Add-In. You will most probably not be able to see your custom field type in a dropdown box like that in any case. You can use the regular declerative way to create a list with your fieldtype (or programatically).
In short: Use the declerative way (or programmatic way) to declare your list. VS 11 won't be able to show your custom field type - that would be pretty magic as your field type could do pretty much anything (custom field renderers, validation etc.) - no way you could just "display" that in a wizard.

Resources