I'm looking into Sharepoint 2010 Feature upgrade framework and all over the net I'm seeing examples of how to upgrade a feature by adding a new field to a existing content type and this is done like this:
<UpgradeActions>
<VersionRange BeginVersion="0.0.0.0" EndVersion="0.9.9.9">
<ApplyElementManifests>
<ElementManifest Location="SomeFunctionality_Iteration2\Elements.xml" />
</ApplyElementManifests>
<AddContentTypeField ContentTypeId="0x010073f25e2ac37846bb8e884770fb7307c7"
FieldId="{536DC46C-DC26-4DB0-A97C-7C21E4362A85}" PushDown="TRUE"/>
<AddContentTypeField ContentTypeId="0x010073f25e2ac37846bb8e884770fb7307c7"
FieldId="{4E7A6719-011A-47EA-B983-A4941D688CA6}" PushDown="TRUE"/>
What i don't understand is how would i perform an upgrade to a feature which would rename,*delete* or change any other property a field declaratively from the content type the feature already deployed.
All over the net I'm seeing examples of how to add a Field, but how do i change properties of existing ones using Feature Versioning and Upgrading.
Thanks!
You have to do that using code in the Feature receiver (in Feature_Updating). There's no way to delete or rename a Field using CAML.
Related
I am busy with configuring our new TFS 2015 server (on premises) and trying to get the new vnext builds to work properly.
What I now have are some extra powershell scripts that increase the version number of my assemblies.
It also changes the buildnumber in TFS by calling the API method (see tfs rest api). My json body only sends the new build number (eg. {"buildNumber": "1.0.1.1234"}) and this works fine.
Now I have added some major, minor and patch version variables in the build definition for the version. Once the build is done this should be updated and so I thought to do the same kind of thing and just send an update API call to the corresponding builddefinition endpoint. The documentation says the revision number is mandatory so I have added that. For the rest I only added the changed variables.
The api call works, but the nasty thing is that it will update the whole definition and clear out all the other settings which I did not provide in the json body. I also tried first getting the defintion through the API, changing the json values for the variables and send that back but that didnt work correct also.
So does anybody know a good solution for this?
As a workaround what I did for now is adding a dummy build definition (eg. "_ProjectVersion") totally empty except for the variables and my build task now uses that build definition to get the latest version numbers and update them. So the api call still empties that whole build definition but since it only contains my variables I dont mind.
I am also doing this in powershell since all scripting should be automated and done in powershell.
The problem I have is that the API call to get the json of an existing BuildDefinition returns invalid json when managed in powershell.
For example the "#{multipliers=[]; will fail with 'must have at least one value' even though a 'json validator' may report as Valid. The correct json is {"multipliers": "[]",
I am trying to build a custom module based on the 'basic' template, with extra fields without using the module builder.
I have looked trough the SugarCRM 6.5 documentation, bought the book SuiteCRM for Developers and looked trough the sources of existing modules, but I still can not figure out how to put a working module together.
Does a minimal module template exists anywhere? What I am looking for is a fully working module with one extra field, which can be deployed on a SuiteCRM instance. I can take it from there.
There's no minimal module template that I know of, you may want to consider creating a test module through module builder and exporting that to see what the parts are.
Usually though modules have the following files. Example uses the module ABC_Sport.
custom/Extension/application/Ext/Include/ABC_Sport.php
This adds the module to the module list and adds the beans. I.e.
$beanList['ABC_Sport'] = 'ABC_Sport';
$beanFiles['ABC_Sport'] = 'modules/ABC_Sport/ABC_Sport.php';
$moduleList[] = 'ABC_Sport';
custom/Extension/application/Ext/Include/en_us.ABC_Sport.php
(Note you may want to add files for different languages).
Next up you'll need to create the bean file in
modules/ABC_Sport/ABC_Sport.php
and the vardefs in
modules/ABC_Sport/vardefs.php
I'm not totally sure if the metadata files are required or not but you'll also likely want to add the editviewdefs,detailviewdefs and listviewdefs.
I'm working my way through the book and the Sports Store examples, and generally finding it to be full of great, informative content.
But in Chapter 10 (listing 10-14), we walk though the simple act of adding some validation attributes to the product class, and this breaks the app because VS says the model backing the EFDbContext context has changed (we've only added the validation attributes), and suggests that we enable Code First Migrations to update the database.
The book moves forward without addressing the problem. I am finding that I can't enable migrations because I get this:
PM> enable-migrations -enableautomaticmigrations
No context type was found in the assembly 'SportsStore.WebUI'.
There's no errata for the book, and I'm not sure how to make EF happy without doing the automatic migrations.
Does anyone have experience with this issue in the book, or know how I can move forward after changing my context backing model without migrations enabled?
Remember that you set the default project to WebUI, when you open your package manager console it is set to your default project (WebUI) which does not have the database context, it is located on your Domain project, what you need to do is change the default project from WebUI to Domain, not on your solution settings but on your package manager console. heres a SS:
I want to migrate an application from VB6.0 to VB.net.
I migrate it myself and get an error on this two lines. The error says "ExecWB is not a member of System.Windows.Forms.WebBrowser"!!The same error with the ExecWB Method. I dont find any solution or any equivalent code in .net for that. Do I need an imprt or reference or equivalent type?
Please help.
eQuery = webBrowser.QueryStatusWB(SHDocVw.OLECMDID.OLECMDID_COPY)
webBrowser.ExecWB(SHDocVw.OLECMDID.OLECMDID_PAGESETUP,
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT, Nothing, Nothing)
webBrowser?
Thank you
There are two different WebBrowser things, the WebBrowser Object and the WebBrowser Control. The object is the ActiveX version that you were using in VB6 while the control was completely redesigned to follow .Net standards. While there may be some common methods, properties and events between the two they are not really related.
You can continue to use the ActiveX version in .Net just fine if you want. You'll need to add a reference to it either via the Add References menu or by adding the Microsoft Web Browser object to your toolbox. If you want to use the .Net version then you'll need to find the updated way to do your specific tasks.
A 30s Google search returned this article that suggests you can use late binding on the ActiveXInstance property to access the methods directly.
Note that this method is marked as "infrastructure use only" and may well be subject to change/removal, etc at a later date.
I have a multiple-site Sitecore project. I know how to deal with error pages via the webconfig's ErrorPage, ItemNotFoundUrl, LayoutNotFoundUrl, LinkItemNotFoundUrl for one site.
However, I'm wanting to display a different error pages for each site. How can I accomplish this?
In any case, you can probably store the URLs of the error pages for each site as attributes of the /configuration/sitecore/sites/site elements in web.config by extending the Sitecore.Sites.SiteContext class (see for information about extending existing classes).
The SDN forum post provides more information specifically about the 404 /ItemNotFound condition, including an example of an extension of Sitecore.SItes.SiteContext.
For ItemNotFoundUrl, I think it depends on whether you use an item or a file as the 404 page. If you handle 404 with items, then after the item resolver, add a processor to the httpRequestBegin pipeline to set the context item to the 404 item for that site if the context item is null. If you use files, then I think override Sitecore.Pipelines.HttpRequest.ExecuteRequest.HandleItemNotFound() and Sitecore.Resources.Media.MediaRequestHandler.DoProcessRequest() and update the corresponding references in the web.config file.
For ErrorPage, I think you would have to override Sitecore.Pipelines.RenderLayout.SecurityCheck.Process and update the corresponding reference in web.config.
For LayoutNotFoundUrl, I think you would have to override Sitecore.Pipelines.HttpRequest.ExecuteRequest.HandleLayoutNotFound, and update the corresponding reference in web.config.
For LinkItemNotFoundUrl, I would probably add a processor to the renderField pipeline to perform replacement of the default value of the setting with the value that applies for the context site.
If this is a common requirement, we should turn it into a Sitecore Shared Source project, or add it to an existing project.
There's an entry in the SDN scrapbook about how to do this for a multi-site install.
There is a Shared Source project which should fit the requirements is most parts. It's called Sitecore Error Manager.
Hope that helps.