I'm adding a new argument to my custom Build template. The argument is almost identical to the default Projects to Build argument under Required -> Items to Build. It simply shows a dialog window with a list of folders under current TFS Project. I can't figure out what the type of control is. I tried FolderBrowserDialog but it browses the computer rather than the TFS project itself. Any help would be appreciated.
You can set the Editor for this argument to:
Microsoft.TeamFoundation.Build.Controls.ServerFileBrowserEditor, Microsoft.TeamFoundation.Build.Controls
Or
Microsoft.TeamFoundation.Build.Controls.ServerFolderBrowserEditor, Microsoft.TeamFoundation.Build.Controls
See my blog for a detailed set of steps.
All of these types are Internal, so you can't reference them from your own code or see them easily. What you can do, is set them as Editor for a parameter you created in the Build Workflow. You need to specify Typename, Assemblyname. You can find these items in the MetaData section of your Build Template.
Add your argument to the workflow:
Open the Metadata property:
Set the editor for your property:
A multi-folder select dialog is not part of the Default UI Editors. You'd have to roll your own. Either use Reflector to see how the existing ones work, or use Reflection to invoke th existing editors as part of your new editor.
It's not going to be pretty code either way, but it would work.
Related
I am developing a .NET core application with Identity login which provides a Bootstrap form In the /Identity/Account/Login page.
I have imported Materialize CSS files in the wwwroot/lib folder and want to change the Login page's design with materialize css as well.
The problem is /Identity/Account/Login page doesn't exist in project structure. Then how should I approach to solve this problem?
One way would be to scaffold the login page, which would add it to your project structure. Then you would be able to make any changes you want. You would have to do the following (from the link I provided):
From Solution Explorer, right-click on the project > Add > New Scaffolded Item.
From the left pane of the Add Scaffold dialog, select Identity > ADD.
In the ADD Identity dialog, select the options you want (in your case Login).
Select your existing layout page, or your layout file will be overwritten with incorrect markup. When an existing _Layout.cshtml
file is selected, it is not overwritten.
For example ~/Pages/Shared/_Layout.cshtml for Razor Pages
~/Views/Shared/_Layout.cshtml for MVC projects
To use your existing data context, select at least one file to override. You must select at least one file to add your data context.
Select your data context class.
Select ADD.
To create a new user context and possibly create a custom user class for Identity:
Select the + button to create a new Data context class.
Select ADD.
Note: If you're creating a new user context, you don't have to select
a file to override.
Another way would be to look at the Login page source code and see HTML elements' ids and classes. Then you could override the default CSS by writing your own CSS that would be more specific than the default one.
From Asp.net Core 2.1, Identity UI code are not included in project structure.
You can see this line of code in StartUp file -> method ConfigureServices
services.AddDefaultIdentity<IdentityUser>()
.AddDefaultUI(UIFramework.Bootstrap4)
If you want to customize the UI, you have to generate this bunch of code by 2 ways:
1. Using Visual Studio: right click at project -> add -> new scafolded item -> identity -> and choose which you want to be generate.
2. Using CLI: from the project directory run this command-line
dotnet aspnet-codegenerator identity -dc WebApplication.Data.ApplicationDbContext
The default Identity pages you see are generated behind the scenes from this dll in your project:
Microsoft.AspNetCore.Identity.UI.Views.V3.dll
-- located here --
Dependencies >> SDK >> Microsoft.AspNetCore.App(2.2.0).
Follow #Marko Papic step by step instructions to generate the Identity pages (or partials) you'd like to override with your Material css. Within these (now view-able pages) is all the logic and naming references to the Identity classes, methods, properties etc you'll need to build your own custom page.
Additionally, you don't need to stick to the default Areas/Identity/Pages/Account... file location or razor syntax. You could, if you wanted to, create your own MVC versions, or vue.js in whatever file structure/representation you like.
I keep a project off to the side that has overridden all of the Identity UI pages ( checkbox Override all files that serves as a handy reference where I can bring over what I need as I need it.
#Marko Papic has provided a nice answer for you, I'l suggesst you select his answer as the correct one..
I have have made a folderish content type called supplier_folder, which displays a list of suppliers that can be added under it, and their information. I can add it through the navigation bar, but I would like to add it programatically during setup.
I have been following the tutorial on custom installer code (http://docs.plone.org/develop/addons/components/genericsetup.html#custom-installer-code-setuphandlers-py) and have looked at creating objects programatically (http://docs.plone.org/develop/plone/content/creating.html).
Unfortunately, the second article says I need to have a folder created. How can I get around this and add the supplier_folder object at the Plone Site outside of a folder?
IIRC, only users with role Manager or Site Administrator can add content to the root of the site; you can overcome this limitation in two ways:
by using the _constructInstance method as it bypasses the permissions when creating an item
by switching roles inside your code with plone.api.env.adopt_roles
I personally prefer the second one.
you can see an example of a pretty complex setuphandlers.py in interlegis.portalmodelo.policy package.
When you create a new Plone site, it's also creating some default content types.
Look at how Plone do: https://github.com/plone/Products.CMFPlone/blob/1471828ee97a8dd84396bad4a3286be514819869/Products/CMFPlone/setuphandlers.py#L119
There are a couple of ways to achieve this. The buildin mechanism is to use GenericSetup in combination with "structure" folder as described here: http://koansys.com/tech/create-plone-initial-content-with-generic-setup
In short you need the following:
Create a folder "structure" in your Generic Setup profile (in general, under profiles/default)
Create a .objects file with the following content: "suppliers,supplier_folder"
in "structure" create a folder "suppliers" with a .properties file and content:
[DEFAULT]
title = Suppliers
description = Some usefull description text
As far as I remember this is ok for simple structures likes your. If you have complex structures with folders and sub-folders and want more specific control you probably need to write python code. I made some stuff here: https://github.com/collective/zettwerk.setup/blob/master/zettwerk/setup/structure.py
But zettwerk.setup is not yet released, but you should be able to integrate the structure.py right into your project. Than you can the handle_structure method into your setuphandlers.py and passing a structure dict like this:
handle_structure(portal, [{'id': 'suppliers', 'portal_type': 'supplier_folder'}])
The advantage of this method is, that you can also control metadata like workflow state, default page setting, portlets, local roles and some others.
I want to alter the default code genaration of MVC CRUD ASP . NET.
Visual Studio.It generates pages of "Edit.cshtml/Insert.cshtml/Delete.cshtml"
I want to translate "Edit" to "Alterar" - "Insert" to "Inserir", and I would like that the razor file to be called "Alterar.cshtml" instead of "Edit.cshtml"
How can I do that?
Is it possible?
Yes, you can.
Based on this excellent blogpost by Scott Hanselman I changed the default template in a few steps. The difference between Scott's approach and mine is that he apparently made it in a way that keeps the global default but gives him a separate generator for each project. Since I didn't get it working immediately, I opted to instead just change the global template.
Go to C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ItemTemplates\CSharp\Web\MVC 4\CodeTemplates\AddController (some parts of the URI may vary in your situation
Optionally: grant yourselves write privileges on Controller.tt
Open Controller.tt in an editor of your choice and change what you want to change. Note that these are T4 templates so you have a wide variety of tools to your disposition if you want to do more advanced stuff.
Create a new ASP.NET MVC project
Go to the "Controllers" folder and add a new controller (not an api controller)
You don't have to change anything to get a differently named view: the view, including the file in which it is stored, is generated based on the name of the action method that creates it. If you generate the view from Alterar then the popup window will present you with the name "Alterar" for the file.
I created a content in my Plone 4.3 site (no grok here) with the very nice Dexterity through-the-web editor. Now I'd like to customize the default view for this content.
I've read Martn Aspelli's book but the problem is that through-the-web content does'nt have a specific interface (so I can't use it to create my specific view).
If you want to do this all through-the-web, then do the following:
Create a template for your view in the "custom" folder of
portal_skins (through the ZMI). You'll probably want to start with a
copy of something like the page template
(portal_skins/plone_content/document_view). Give it a name like
your_content_type_view. Test it by appending /your_content_type_view
to the URL for a sample object.
Edit the Factory Type Information (portal_types/your_content_type/Default
view method) to be your_content_type_view.
What you will have done is create a skin-level view for the type. This is different from the browser views that Martin is discussing, which do indeed require a class. The Dexterity development team is working on a way to provide TTW maintenance of browser views, but that's for a later version of Plone.
Meanwhile, if you later transfer your Dexterity content type to a Python add on, you'll be able to use your template, possibly unmodified for a browser view.
Can I avoid all the packaging and just create a Web application with a .ascx file and use that? The closest thing I can find is this article which is for 5.1 and does not completely work for v6.
http://mestanzasoft.wordpress.com/2011/03/27/creating-a-dotnetnuke-dnn-module-with-an-ascx-control/
So if there is a more up to date tutorial for v6 let me know please.
You should be able to choose Create New Module from the Host -> Extensions page, and then choose the control (which, I think, is what the blog post said). What specifically isn't working?
One thing that may be an issue you're running into is that the control needs to inherit from IModuleBase (probably via PortalModuleBase). You can't just drop a control that knows nothing about DNN in the website and get DNN to make it into a module (though you can make a thin wrapper around a control like that).
Yes you can.
If you go to Host > Module Definitions and click on Create New..., you will find there are there ways to create a new module:
New : That will allow you to create a simple module with single view control. You have to provide module information and create parent folder to do this.
Control: This will allow you to create new module from a control. If you don't want to create a new module folder and control at UI, you can just add a new folder to desktopmodules folder and drop an ascx control which inherits from DotNetNuke.Entities.PortalModuleBase and then use this option to provide correct folder and control that you have created and you are done.
Last option is to create it using manifest and generally useful when you want to split single module with multiple definition to different modules.
Please let me know if you have more questions.
Thanks
In DNN 6.0 you have to go to Host - Extensions...
then hover over the semi-transparent "Manage" button, which you can barely see (hidden behind the word EXTENSIONS, perhaps), and wait for the popup dialog, and THEN click "Create New Module".
:(