Sitecore GlassMapper with Helix - glass-mapper

We need to make choice between Sitecore Extensions and Glass Mapper along with T4 to get the Data for Sitecore Items for our project. Can you guys help me challenges you face using Glass Mapper when you use GlassMapper for first time
I know its generic questions but it would be great if you could help me with challenges you face using Glassmapper,Habitat and T4.

We recently implemented Glass Mapper withe Helix. Crated a ORM project in foundation having all Glass configs and startup classes there which is referenced all other prjs (both Foundation and Feature).
Things to consider-
1. Create a DI prj in foundation and refer it in Glass prj for class you may want to register e.g.:- ISitecoreContext, IRenderingContext etc.
2. Although Glass prj is referred in all other prj's you may have to install Glass itself in all prjs removing configs and statup.cs(s) file just to have reference which is a tedious job.(May be there is a good way of doing this, but we have implemented this way)
3. Over the time there may be new versions of Glass mapper which may conflict with previous prj's
TIP:- you may consider to create a powershell script for adding a new module from Package manager itself. Please look at this link - http://blog.marcduiker.nl/2016/12/28/hands-on-with-sitecore-helix-using-powershell-add-module.html
Hope this helps.

Related

Oracle Forms Round Corners Button

I am inserting a push button in oracle form builder but I want to customize its corners in round shape just like below mentioned image.
Any help willl be highly appreciated!
I've never done that (didn't have to & I'm quite happy with buttons as they are), but - it seems that you'll have to use PJC (Pluggable Java Components) and Java Beans. These are terms you should be searching for; one resource is A non rectangular button's PJC; see if it helps.
As mentioned, you would need to create a Plugable Java Component (PJC) if you want round ended buttons. The demos that Oracle used to provide included an example of such a PJC, however they are no longer available. So some Google searching might be needed if you want to find them.
The good news is that there are plans to introduce this functionality as a feature in a future release. If added to the product, you would no longer need to use a PJC. Unfortunately, the release date of that version cannot be shared at this time. For the latest information about Oracle Forms, refer to:
https://www.oracle.com/application-development/technologies/forms/forms.html

How to integrate Microsoft.CodeAnalysis in a VSIX extension

As the title says, I would like to build a VS extension that's able to react to certain changes made on the editor window (for various languages). Not necessarily an adornment.
To do this I would like to be able to analyse the editor document through the Roslyn service API (that if I understood well is now part for the Microsoft.CodeAnalysis).
Can someone indicate some documentation?
What's the best practice to do this?
What are the interface to import via MEF?
As example you can export a custom ISuggestedActionsSourceProvider to add new feature in the light bulb, you can use ExportCodeRefactoringProviderAttribute to add a new refactoring, also you can export IClassifierProvider and ITagProvider to classificate a elements in the text editor, import ITextDocumentFactoryService to retrieve the current VS Document by ITextBuffer and etc.
Also you wouldn't be enough to use only Microsoft.CodeAnalysis for some kind of analyzing, so you will need to add a some additional packages in these cases. As example these packages can be Microsoft.CodeAnalysis.EditorFeatures.Text, Microsoft.CodeAnalysis.Workspaces.Common and etc.
If you want to get from community the more concrete answer you should concrete what exactly do you want in the question.
Also you can check a more useful links and examples: Roslynator are refactoring and analyzing a code, Getting start editor extensions, Light bulb guide, Classification elements for highlighting

Upgrading MVC 3 to MVC 6 What is the best way

I am planning to upgrade MVC3 EF5 project to MVC6. I understand it will require a lot of manual changes all over in config files, project files, entity framework, etc. Before I spend hours, wanted to see what is the best way?
Option 1: to make changes in IDs, configures, assemblies, etc. in the existing project (it doesn't even open in VS2015 right now, like any other MVC3 project, Thank You Microsoft). Looking at the instructions for converting MVC3 to MVC4/5, I guess I will need to have an ambulance on the standby here :-) It amazes me that MS did not provide any tool or even clear instructions to help developers.
Option 2: Create a brand new project in VS2015, then add new controllers with the same name as found in the old projects, then copy and paste controller implementations. Views and non-controller classes should work without much changes (only change I can think of is that new versions of dependencies in imports may be incompatible and will need to be dealt with manually, but this would be the same in Option 1). Not sure how to deal with entity framework. Perhaps if I recreate the entity model from database again, it should generate a compatible code. But then there are probably about 100 stored procedure function imports. I guess I will need to create function imports manually one by one (Question here, will the existing function imports remain intact if Option 1 is followed? Is there a way to copy function imports from the old project?).
Sorry, I know this is a rather convoluted question. Just trying to solicit inputs from others who may have done this in the past. I understand both Option 1 and 2 will require hours of work.

XPage Osgi plug in development

background
I have designed many tools in the past year or so that is designed to help me program for XPages. These tools include primarily helper java classes, extended logging (making use of OpenLogger and my own stuff), and a few other things that I personally feel I cannot work without. It has been discussed with my employer, and we feel that it might be a good idea to start publishing these items to openNTF. Since these tools are made up of about 3 .nsfs, all designed to use the same java code, key javascript classes, css, and even a custom control or two, I would like to consolidate key items into a plug-in that can be installed at the server and client level. I want to do this consolidation before I even think about publishing any of the work I've done so far. It would just be far too much work to maintain, not just for me, but for potential users. I have not really found any information on how to do such a thing in google searches. I also have to make sure that I am able to make use of the ExtLib libraries, openNTF Domino API, and the Notes API.
my questions
How does one best go about designing such plug-ins? Must a designer
use eclipse, or is this it possible to do this directly in the Notes
Designer?
How does a designer best go about keeping a server and client up to date while designing and updating the plug-in code? Is this why GitHub is often used?
Where is the best place to get material to get started in this direction? I sort of feel lost in the woods, knowing I need to head north, but not having a compass for that first step.
Thank you very much for your input.
In my experience, I found that diving into plug-in development is a huge PITA until you get used to it, but it's definitely worth it overall.
As for whether you can use Designer for plugin development: yes, but you will likely eventually want to not do so. I started out by using Designer for this sort of thing for a while, presumably with the same sentiment as you: why bother installing another instance of Eclipse when I'm already sitting in one all day? However, between Designer's age (it's roughly equivalent to, I think, Eclipse 3.4), oddities when it comes to working sets between the "Applications" and "Project Explorer" views, and, in my case, my desire to use a Mac app, I ended up switching.
There are two major starting points: the XSP Starter Kit (http://www.openntf.org/internal/home.nsf/project.xsp?name=XSP%20Starter%20Kit) and Niklas Heidloff's video on setting up Eclipse for XPages development (http://www.openntf.org/main.nsf/blog.xsp?permaLink=NHEF-8RVB5H). The latter mentions the XPages SDK (http://www.openntf.org/internal/home.nsf/project.xsp?name=XPages%20SDK%20for%20Eclipse%20RCP), which is also useful. In my setup, I found the video largely useful, but some aspects either difficult to find (IBM's downloads are shifting sands) or optional (debugging, which will depend on whether or not you're using Eclipse on Windows).
Those resources should generally get you set up. The main thing to worry about when setting up your Eclipse environment will be making sure your Plug-In Execution Environment is properly done. If you're following the SDK setup instructions, that SHOULD get you where you need to be.
The next thing to know about is the way plugins are structured. Each plugin you want to install in Designer or Domino will also be paired with a feature project (a feature can house several plugins), and potentially an update site - the last one is optional if you just want to import the features into an Update Site NSF. That's how I often do my normal plugin development: export the paired feature to a directory and then import the feature into the server's Update Site NSF and then install in Designer from there using Application -> Install. You can also set things up so that you deploy into the server's plugin/feature directories instead of taking the step of installing into an update site if you'd prefer. GitHub doesn't really come into play for this aspect - it's more about sharing/collaborating with your code and also having a remote storage location for your git repositories (which I highly advise).
And as for the "lost in the woods" feeling: yep, you'll have that for a good while. There are lots of moving parts and esoteric concepts to get a hold of all at once. If you mostly follow the above links and then start with some basics from the XSP Starter Kit (which is itself a plugin project that you can pair with a feature) - say, printing text in the Activator class and making an implicit global variable just to make sure it works - that should help get your feet wet.
It's best done in Eclipse. You can debug your code running on the server from there, as well as run it directly from there. The editors are also more up-to-date. You want:
Eclipse for RCP and RAP developers
XPages SDK for Eclipse RCP (from OpenNTF)
XPages Debug Plugin (from OpenNTF - basically allows you to load the plugins to the Domino server dynamically, rather than exporting to an Update Site all the time)
XSP Starter Kit on OpenNTF is a good starting point for a plugin. There are various references to the library id, which has to be unique for your plugin. Basically, references to org.openntf.xsp.starter need changing to whatever you want to call your plugin. You're also best advised to remove what you don't need. I tend to work in a copy of the Starter, remove stuff, build and if there are errors with required classes (Activator.java obviously will be required and some others), then paste them back in from the Starter.
XPages OpenLog Logger is a good cross-reference, that was built from XPages Starter Kit. It's pretty much stripped down and you'll be able to see what had to be changed. A lot of the elements of the XSP Starter Kit correspond to Java classes you'll probably be familiar with from your XPages Java development.
GitHub etc tend to be used as source control, which is useful for working out what's changed from time to time.

Visual studio 2010 colourizers, intellisense and the rest. Where to start!

Ok, before I begin I realize that there is a lot of documentation on this subject but I have thus far failed to get even basic colourization working for VS2010.
My goal is to simply get to a point where I can open a document and everything is coloured red, from here I can implement the relevant parsing logic.
Here's what I have tried/found:
1) Downloaded all the relevent SDK's and such- Found the ook sample (http://code.msdn.microsoft.com/ookLanguage) - didn't build, didn't work.
2) Knowing almost nothing about MEF read through "Implementing a Language Service By Using the Managed Package Framework" - http://msdn.microsoft.com/en-us/library/bb166533(v=VS.100).aspx
This was pretty much a copy and paste of all the basic stuff here, and also updating some references which were out of date with the sample see: http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/a310fe67-afd2-4592-b295-3fc86fec7996
Now, I have got to a point where when running the package MEF appears to have hooked up correctly (I know this because with the debugger open I can see that the packages initialize and FDoIdle methods are being hit).
When I open a file of the extension I have registered with the ProvideLanguageExtensionAttribute everything dies as if in an endless loop, yet no debug symbols hit (though they are loaded).
Looking at the ook sample and the MEF examples they seem to be totally different approaches to the same problem. In the ook sample there are notions of Clasifications and Completion controllers which aren't mentioned in the MEF example. Also, they don't seem to create a Package or Language service, so I have no idea how it should work?
With the MEF example, my assumption is that I need to hook into the "IScanner.ScanTokenAndProvideInfoAboutIt" to provide syntax highlighting? Which would be fine if I could ever hit this method.
So my first question I guess is which approach should I be taking here? Or do they both somehow tie together?
My second questions is, where can I find a basic fully working project that implements bog standard basic syntax highlighting and intellisense or VS2010?
Thirdly, in the MEF example when I created a Package there were a bunch of test projects created for me. I appears that the integration tests launch the VS2010 test rig somehow, but the test fails. It would be good to write my service with tests but I have no idea what/how I can test each interaction so any references to testing Language services would be helpful.
Finally, please throw any resource/book links my way that I may find useful.
Cheers, Chris.
N.B. Sorry I realize this is part question part rant, but I have never been so confused.
First, the package example is not using MEF. Essentially everyplace that you mention MEF in your question is not actually MEF, but the managed package framework (MPF), also colloquially called the managed language service (MLS). You'd know if your extension was using MEF by two things: the vsixmanifest lists your assembly as containing a MEF component, and you see [Export] and [Import] attributes in the code.
The easiest way to do this is to use MEF. Since you have the SDK installed, you also have a template for an editor classifier project (under C# (or VB)->Extensibility->Editor classifier in the New Project dialog). You can certainly do this with a language service/colorizer/package, but there will be significantly more code than the equivalent classifier.
The Ook solution is the sample for this and should work; if it doesn't build/work, then can you send me email (noahric at microsoft) with what errors you are seeing so I can email the owner of that sample?
In general, you should also read my answer for the question on "How can I write a plugin for VS2010 using MEF?". That has links to other resources that should help.

Resources