From 34ad93aff799b30ec574b4ec28a8461198079ffc Mon Sep 17 00:00:00 2001 From: Kevin Obee Date: Thu, 1 Aug 2013 17:03:46 +0100 Subject: [PATCH 01/22] Fix Issue#3 - removed framework version & compilation element --- src/Sitecore.Ship/content/web.config.transform | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Sitecore.Ship/content/web.config.transform b/src/Sitecore.Ship/content/web.config.transform index ce7bc94..40b4656 100644 --- a/src/Sitecore.Ship/content/web.config.transform +++ b/src/Sitecore.Ship/content/web.config.transform @@ -9,7 +9,6 @@ - From ddacb48dd7252ddbfb2e608a0f4b85805376d69f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Jun 2015 13:12:23 -0400 Subject: [PATCH 02/22] Added new DisableManifest parameter to the InstallPackage and InstallUploadPackage endpoints. --- src/Sitecore.Ship.Core/Domain/InstallPackage.cs | 5 +++++ .../Domain/InstallUploadPackage.cs | 5 +++++ src/Sitecore.Ship/Package/Install/InstallerModule.cs | 12 ++++++++++++ 3 files changed, 22 insertions(+) diff --git a/src/Sitecore.Ship.Core/Domain/InstallPackage.cs b/src/Sitecore.Ship.Core/Domain/InstallPackage.cs index 82ef554..57072b4 100644 --- a/src/Sitecore.Ship.Core/Domain/InstallPackage.cs +++ b/src/Sitecore.Ship.Core/Domain/InstallPackage.cs @@ -5,5 +5,10 @@ public class InstallPackage public string Path { get; set; } public bool DisableIndexing { get; set; } + + /// + /// Set to true to disable reporting of items contained in the package. + /// + public bool DisableManifest { get; set; } } } \ No newline at end of file diff --git a/src/Sitecore.Ship.Core/Domain/InstallUploadPackage.cs b/src/Sitecore.Ship.Core/Domain/InstallUploadPackage.cs index 6fa406c..82d096d 100644 --- a/src/Sitecore.Ship.Core/Domain/InstallUploadPackage.cs +++ b/src/Sitecore.Ship.Core/Domain/InstallUploadPackage.cs @@ -5,5 +5,10 @@ public class InstallUploadPackage public string PackageId { get; set; } public string Description { get; set; } public bool DisableIndexing { get; set; } + + /// + /// Set to true to disable reporting of items contained in the package. + /// + public bool DisableManifest { get; set; } } } \ No newline at end of file diff --git a/src/Sitecore.Ship/Package/Install/InstallerModule.cs b/src/Sitecore.Ship/Package/Install/InstallerModule.cs index 48b0e8c..08757f7 100644 --- a/src/Sitecore.Ship/Package/Install/InstallerModule.cs +++ b/src/Sitecore.Ship/Package/Install/InstallerModule.cs @@ -39,6 +39,12 @@ private dynamic InstallPackage(dynamic o) var manifest = _repository.AddPackage(package); _installationRecorder.RecordInstall(package.Path, DateTime.Now); + if (package.DisableManifest) + { + // Skip manifest reporting. Nancy will return an empty message body. + manifest = null; + } + return Response .AsJson(manifest, HttpStatusCode.Created) .WithHeader("Location", ShipServiceUrl.PackageLatestVersion); @@ -81,6 +87,12 @@ private dynamic InstallUploadPackage(dynamic o) _tempPackager.Dispose(); } + if (uploadPackage.DisableManifest) + { + // Skip manifest reporting. Nancy will return an empty message body. + manifest = null; + } + return Response .AsJson(manifest, HttpStatusCode.Created) .WithHeader("Location", ShipServiceUrl.PackageLatestVersion); From 132b2bcdfab8ebbdf02d2e7ebda136374b673657 Mon Sep 17 00:00:00 2001 From: Kevin Obee Date: Mon, 27 Jul 2015 16:46:24 +0100 Subject: [PATCH 03/22] Projects now built against NET 4.5. Platform assemblies tested from Sitecore 8.0 rev. 141212 (8.0 RTM). --- lib/Readme.md | 4 +++- src/Sitecore.Ship.AspNet/Sitecore.Ship.AspNet.csproj | 2 +- src/Sitecore.Ship.AspNet/app.config | 6 +++--- src/Sitecore.Ship.Core/Sitecore.Ship.Core.csproj | 2 +- .../Sitecore.Ship.Infrastructure.csproj | 2 +- src/Sitecore.Ship/Sitecore.Ship.csproj | 2 +- src/Sitecore.Ship/app.config | 6 +++--- src/Sitecore.Ship/packages.config | 2 +- 8 files changed, 14 insertions(+), 12 deletions(-) diff --git a/lib/Readme.md b/lib/Readme.md index 5bcc3b2..3f9e81a 100644 --- a/lib/Readme.md +++ b/lib/Readme.md @@ -7,4 +7,6 @@ The following files need to be placed in the folder: * Sitecore.Update.dll * Sitecore.Zip.dll -These files should be from a 6.x solution, NOT Sitecore 7 \ No newline at end of file +These files should be from a 8.x solution. + +Current testing based on Sitecore 8.0 rev. 141212 (8.0 RTM). \ No newline at end of file diff --git a/src/Sitecore.Ship.AspNet/Sitecore.Ship.AspNet.csproj b/src/Sitecore.Ship.AspNet/Sitecore.Ship.AspNet.csproj index b912571..1104d69 100644 --- a/src/Sitecore.Ship.AspNet/Sitecore.Ship.AspNet.csproj +++ b/src/Sitecore.Ship.AspNet/Sitecore.Ship.AspNet.csproj @@ -9,7 +9,7 @@ Properties Sitecore.Ship.AspNet Sitecore.Ship.AspNet - v4.0 + v4.5 512 diff --git a/src/Sitecore.Ship.AspNet/app.config b/src/Sitecore.Ship.AspNet/app.config index d497d8f..6df09bc 100644 --- a/src/Sitecore.Ship.AspNet/app.config +++ b/src/Sitecore.Ship.AspNet/app.config @@ -3,9 +3,9 @@ - - + + - + diff --git a/src/Sitecore.Ship.Core/Sitecore.Ship.Core.csproj b/src/Sitecore.Ship.Core/Sitecore.Ship.Core.csproj index 6b86010..e5f6f36 100644 --- a/src/Sitecore.Ship.Core/Sitecore.Ship.Core.csproj +++ b/src/Sitecore.Ship.Core/Sitecore.Ship.Core.csproj @@ -9,7 +9,7 @@ Properties Sitecore.Ship.Core Sitecore.Ship.Core - v4.0 + v4.5 512 diff --git a/src/Sitecore.Ship.Infrastructure/Sitecore.Ship.Infrastructure.csproj b/src/Sitecore.Ship.Infrastructure/Sitecore.Ship.Infrastructure.csproj index a5968e7..4c60e35 100644 --- a/src/Sitecore.Ship.Infrastructure/Sitecore.Ship.Infrastructure.csproj +++ b/src/Sitecore.Ship.Infrastructure/Sitecore.Ship.Infrastructure.csproj @@ -9,7 +9,7 @@ Properties Sitecore.Ship.Infrastructure Sitecore.Ship.Infrastructure - v4.0 + v4.5 512 diff --git a/src/Sitecore.Ship/Sitecore.Ship.csproj b/src/Sitecore.Ship/Sitecore.Ship.csproj index 8305ddf..bfdcf81 100644 --- a/src/Sitecore.Ship/Sitecore.Ship.csproj +++ b/src/Sitecore.Ship/Sitecore.Ship.csproj @@ -9,7 +9,7 @@ Properties Sitecore.Ship Sitecore.Ship - v4.0 + v4.5 512 ..\..\ true diff --git a/src/Sitecore.Ship/app.config b/src/Sitecore.Ship/app.config index d497d8f..6df09bc 100644 --- a/src/Sitecore.Ship/app.config +++ b/src/Sitecore.Ship/app.config @@ -3,9 +3,9 @@ - - + + - + diff --git a/src/Sitecore.Ship/packages.config b/src/Sitecore.Ship/packages.config index 5878cae..3f09925 100644 --- a/src/Sitecore.Ship/packages.config +++ b/src/Sitecore.Ship/packages.config @@ -3,5 +3,5 @@ - + \ No newline at end of file From 280afa55ad179e48c33fd4bbb384bb744f7a6a42 Mon Sep 17 00:00:00 2001 From: Kevin Obee Date: Mon, 27 Jul 2015 17:37:27 +0100 Subject: [PATCH 04/22] Minor changes to README to not update to NET 4.5 and the removal of Classic mode support in IIS --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6232d26..e775a1d 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The latest release versions of the Sitecore.Ship packages can be found on the Nu ### Installing the Package -Ensure that the website project is set to run with .NET Framework 4.0 +Ensure that the website project is set to run with .NET Framework 4.5 Run the following powershell command in the package manager console of the Visual Studio solution for the target website: @@ -33,7 +33,7 @@ Installing the package will do the following: * Add a new `packageInstallation` section to your `web.config` file. You can set configuration options in this section to enable remote access to the installer and to enable the package streaming functionality. These options are safe by default, that is, no remote access and package streaming disabled. **Note:** the configuration settings are ignored in this branch of Sitecore.Ship. -* Register a single new HTTP handler section in `` and `` +* Register a single new HTTP handler section in ``. Support for classic mode in IIS has been removed. * Add a `ship.config` Sitecore include file to the `App_Config\include` folder. From f9fa56d6a4bc58a4ce04513411bafa51230f8639 Mon Sep 17 00:00:00 2001 From: Kevin Obee Date: Tue, 18 Aug 2015 17:54:57 +0100 Subject: [PATCH 05/22] #26 Treat compiler warnings as errors applied to all src projects --- src/Sitecore.Ship.AspNet/Sitecore.Ship.AspNet.csproj | 1 + src/Sitecore.Ship.Core/Sitecore.Ship.Core.csproj | 1 + .../Sitecore.Ship.Infrastructure.csproj | 1 + src/Sitecore.Ship/Sitecore.Ship.csproj | 1 + 4 files changed, 4 insertions(+) diff --git a/src/Sitecore.Ship.AspNet/Sitecore.Ship.AspNet.csproj b/src/Sitecore.Ship.AspNet/Sitecore.Ship.AspNet.csproj index 1104d69..4055c1b 100644 --- a/src/Sitecore.Ship.AspNet/Sitecore.Ship.AspNet.csproj +++ b/src/Sitecore.Ship.AspNet/Sitecore.Ship.AspNet.csproj @@ -22,6 +22,7 @@ prompt 4 false + true pdbonly diff --git a/src/Sitecore.Ship.Core/Sitecore.Ship.Core.csproj b/src/Sitecore.Ship.Core/Sitecore.Ship.Core.csproj index e5f6f36..d2ad243 100644 --- a/src/Sitecore.Ship.Core/Sitecore.Ship.Core.csproj +++ b/src/Sitecore.Ship.Core/Sitecore.Ship.Core.csproj @@ -22,6 +22,7 @@ prompt 4 false + true pdbonly diff --git a/src/Sitecore.Ship.Infrastructure/Sitecore.Ship.Infrastructure.csproj b/src/Sitecore.Ship.Infrastructure/Sitecore.Ship.Infrastructure.csproj index 4c60e35..8ee46e0 100644 --- a/src/Sitecore.Ship.Infrastructure/Sitecore.Ship.Infrastructure.csproj +++ b/src/Sitecore.Ship.Infrastructure/Sitecore.Ship.Infrastructure.csproj @@ -22,6 +22,7 @@ prompt 4 false + true pdbonly diff --git a/src/Sitecore.Ship/Sitecore.Ship.csproj b/src/Sitecore.Ship/Sitecore.Ship.csproj index bfdcf81..46bdf7a 100644 --- a/src/Sitecore.Ship/Sitecore.Ship.csproj +++ b/src/Sitecore.Ship/Sitecore.Ship.csproj @@ -24,6 +24,7 @@ prompt 4 false + true pdbonly From 4ca956566d4f2d945d07b245cf41e53402067bb4 Mon Sep 17 00:00:00 2001 From: Kevin Obee Date: Tue, 18 Aug 2015 19:24:48 +0100 Subject: [PATCH 06/22] Transferring blueprint from apiary.io --- apiary.apib | 181 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 apiary.apib diff --git a/apiary.apib b/apiary.apib new file mode 100644 index 0000000..8999951 --- /dev/null +++ b/apiary.apib @@ -0,0 +1,181 @@ +FORMAT: 1A +HOST: http://polls.apiblueprint.org/ + +# Sitecore.Ship + +Polls is a simple API allowing consumers to view polls and vote in them. + +# Polls API Root [/] + +This resource does not have any attributes. Instead it offers the initial +API affordances in the form of the links in the JSON body. + +It is recommend to follow the “url” link values, +[Link](https://tools.ietf.org/html/rfc5988) or Location headers where +applicable to retrieve resources. Instead of constructing your own URLs, +to keep your client decoupled from implementation details. + +## Retrieve the Entry Point [GET] + ++ Response 200 (application/json) + + { + "questions_url": "/questions" + } + +## Group Question + +Resources related to questions in the API. + +## Question [/questions/{question_id}] + +A Question object has the following attributes: + ++ question ++ published_at - An ISO8601 date when the question was published. ++ url ++ choices - An array of Choice objects. + ++ Parameters + + question_id: 1 (required, number) - ID of the Question in form of an integer + +### View a Questions Detail [GET] + ++ Response 200 (application/json) + + { + "question": "Favourite programming language?", + "published_at": "2014-11-11T08:40:51.620Z", + "url": "/questions/1", + "choices": [ + { + "choice": "Swift", + "url": "/questions/1/choices/1", + "votes": 2048 + }, { + "choice": "Python", + "url": "/questions/1/choices/2", + "votes": 1024 + }, { + "choice": "Objective-C", + "url": "/questions/1/choices/3", + "votes": 512 + }, { + "choice": "Ruby", + "url": "/questions/1/choices/4", + "votes": 256 + } + ] + } + +## Choice [/questions/{question_id}/choices/{choice_id}] + ++ Parameters + + question_id: 1 (required, number) - ID of the Question in form of an integer + + choice_id: 1 (required, number) - ID of the Choice in form of an integer + +### Vote on a Choice [POST] + +This action allows you to vote on a question's choice. + ++ Response 201 + + + Headers + + Location: /questions/1 + +## Questions Collection [/questions{?page}] + ++ Parameters + + page: 1 (optional, number) - The page of questions to return + +### List All Questions [GET] + ++ Response 200 (application/json) + + + Headers + + Link: ; rel="next" + + + Body + + [ + { + "question": "Favourite programming language?", + "published_at": "2014-11-11T08:40:51.620Z", + "url": "/questions/1", + "choices": [ + { + "choice": "Swift", + "url": "/questions/1/choices/1", + "votes": 2048 + }, { + "choice": "Python", + "url": "/questions/1/choices/2", + "votes": 1024 + }, { + "choice": "Objective-C", + "url": "/questions/1/choices/3", + "votes": 512 + }, { + "choice": "Ruby", + "url": "/questions/1/choices/4", + "votes": 256 + } + ] + } + ] + +### Create a New Question [POST] + +You may create your own question using this action. It takes a JSON +object containing a question and a collection of answers in the +form of choices. + ++ question (string) - The question ++ choices (array[string]) - A collection of choices. + ++ Request (application/json) + + { + "question": "Favourite programming language?", + "choices": [ + "Swift", + "Python", + "Objective-C", + "Ruby" + ] + } + ++ Response 201 (application/json) + + + Headers + + Location: /questions/2 + + + Body + + { + "question": "Favourite programming language?", + "published_at": "2014-11-11T08:40:51.620Z", + "url": "/questions/2", + "choices": [ + { + "choice": "Swift", + "url": "/questions/2/choices/1", + "votes": 0 + }, { + "choice": "Python", + "url": "/questions/2/choices/2", + "votes": 0 + }, { + "choice": "Objective-C", + "url": "/questions/2/choices/3", + "votes": 0 + }, { + "choice": "Ruby", + "url": "/questions/2/choices/4", + "votes": 0 + } + ] + } From a4ee6737367a988665bcf2efd05b30553d7cd66f Mon Sep 17 00:00:00 2001 From: Sergi Gisbert Date: Fri, 21 Aug 2015 13:16:54 +0200 Subject: [PATCH 07/22] Add call to PublishService with List of Items --- .../Publish/InvokePublishingCommand.cs | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/Sitecore.Ship.AspNet/Publish/InvokePublishingCommand.cs b/src/Sitecore.Ship.AspNet/Publish/InvokePublishingCommand.cs index 7eac7a6..bf0f819 100644 --- a/src/Sitecore.Ship.AspNet/Publish/InvokePublishingCommand.cs +++ b/src/Sitecore.Ship.AspNet/Publish/InvokePublishingCommand.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using System.Linq; using System.Net; using System.Web; @@ -19,8 +20,8 @@ public InvokePublishingCommand(IPublishService publishService) _publishService = publishService; } - public InvokePublishingCommand() : this(new PublishService()) - { + public InvokePublishingCommand() : this(new PublishService()) + { } public override void HandleRequest(HttpContextBase context) @@ -32,7 +33,19 @@ public override void HandleRequest(HttpContextBase context) var now = DateTime.Now; var date = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second); - _publishService.Run(publishParameters); + if (publishParameters.Mode.ToLowerInvariant() == "listofitems") + { + using (var reader = new StreamReader(context.Request.InputStream)) + { + string values = reader.ReadToEnd(); + var itemsToPublish = Json.Decode(values); + _publishService.Run(itemsToPublish); + } + } + else + { + _publishService.Run(publishParameters); + } var json = Json.Encode(new { date }); @@ -47,15 +60,16 @@ public override void HandleRequest(HttpContextBase context) private static bool CanHandle(HttpContextBase context) { return context.Request.Url != null && - IsPublishModeUrl(context.Request.Url.PathAndQuery.ToLowerInvariant()) && + IsPublishModeUrl(context.Request.Url.PathAndQuery.ToLowerInvariant()) && context.Request.HttpMethod == "POST"; } private static bool IsPublishModeUrl(string urlPath) { - return urlPath.EndsWith("/services/publish/full") || - urlPath.EndsWith("/services/publish/smart") || - urlPath.EndsWith("/services/publish/incremental"); + return urlPath.EndsWith("/services/publish/full") || + urlPath.EndsWith("/services/publish/smart") || + urlPath.EndsWith("/services/publish/incremental") || + urlPath.EndsWith("/services/publish/listofitems"); } private static PublishParameters GetRequest(HttpRequestBase request) From 068230ceede045b98c5b16c13847b210e8d5a04c Mon Sep 17 00:00:00 2001 From: Kevin Obee Date: Sun, 23 Aug 2015 21:06:40 +0100 Subject: [PATCH 08/22] Added guidance to README to ensure that existing web.config files are included in the target .csproj --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e775a1d..cae429d 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ The latest release versions of the Sitecore.Ship packages can be found on the Nu Ensure that the website project is set to run with .NET Framework 4.5 +Ensure that the web.config file for the target project if already existing is included into your project. + Run the following powershell command in the package manager console of the Visual Studio solution for the target website: install-package Sitecore.Ship -Source From 288f5217527896b097d6a32874b6f39574075b85 Mon Sep 17 00:00:00 2001 From: Kevin Obee Date: Sun, 23 Aug 2015 22:14:24 +0100 Subject: [PATCH 09/22] #48 Remove support for IIS classic mode from wec.config.transform files --- src/Sitecore.Ship.AspNet/content/web.config.transform | 5 ----- src/Sitecore.Ship/content/web.config.transform | 5 ----- 2 files changed, 10 deletions(-) diff --git a/src/Sitecore.Ship.AspNet/content/web.config.transform b/src/Sitecore.Ship.AspNet/content/web.config.transform index 3b56747..02a23b3 100644 --- a/src/Sitecore.Ship.AspNet/content/web.config.transform +++ b/src/Sitecore.Ship.AspNet/content/web.config.transform @@ -4,11 +4,6 @@
- - - - - diff --git a/src/Sitecore.Ship/content/web.config.transform b/src/Sitecore.Ship/content/web.config.transform index a1faff4..195d387 100644 --- a/src/Sitecore.Ship/content/web.config.transform +++ b/src/Sitecore.Ship/content/web.config.transform @@ -8,11 +8,6 @@ - - - - - From d8b1cabd4e52558044844bdb2f6be0939d3fb522 Mon Sep 17 00:00:00 2001 From: Kevin Obee Date: Sun, 23 Aug 2015 22:44:42 +0100 Subject: [PATCH 10/22] #46 Add failing smoke test --- build/Build.proj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/Build.proj b/build/Build.proj index aac8805..359c594 100644 --- a/build/Build.proj +++ b/build/Build.proj @@ -68,7 +68,8 @@ - + + \ No newline at end of file From 00eed15e907ed52562972447874c32181df849cd Mon Sep 17 00:00:00 2001 From: Kevin Obee Date: Sun, 23 Aug 2015 23:31:38 +0100 Subject: [PATCH 11/22] #46 Fixes added to ensure InvokePublishingCommand handles the publish/listofitems JSON POST body robustly --- .../Publish/InvokePublishingCommand.cs | 22 +++++++-- .../Domain/ItemsToPublish.cs | 7 ++- .../PublishService.cs | 48 +++++++++++-------- 3 files changed, 54 insertions(+), 23 deletions(-) diff --git a/src/Sitecore.Ship.AspNet/Publish/InvokePublishingCommand.cs b/src/Sitecore.Ship.AspNet/Publish/InvokePublishingCommand.cs index bf0f819..a464c02 100644 --- a/src/Sitecore.Ship.AspNet/Publish/InvokePublishingCommand.cs +++ b/src/Sitecore.Ship.AspNet/Publish/InvokePublishingCommand.cs @@ -37,9 +37,25 @@ public override void HandleRequest(HttpContextBase context) { using (var reader = new StreamReader(context.Request.InputStream)) { - string values = reader.ReadToEnd(); - var itemsToPublish = Json.Decode(values); - _publishService.Run(itemsToPublish); + var values = reader.ReadToEnd(); + + if (string.IsNullOrEmpty(values)) + { + JsonResponse(string.Empty, HttpStatusCode.NoContent, context); + } + else + { + var itemsToPublish = Json.Decode(values); + + if (itemsToPublish == null) + { + JsonResponse(string.Empty, HttpStatusCode.BadRequest, context); + } + else + { + _publishService.Run(itemsToPublish); + } + } } } else diff --git a/src/Sitecore.Ship.Core/Domain/ItemsToPublish.cs b/src/Sitecore.Ship.Core/Domain/ItemsToPublish.cs index 1da9126..61dbd20 100644 --- a/src/Sitecore.Ship.Core/Domain/ItemsToPublish.cs +++ b/src/Sitecore.Ship.Core/Domain/ItemsToPublish.cs @@ -8,5 +8,10 @@ public class ItemsToPublish public List Items { get; set; } public string[] TargetDatabases { get; set; } public string[] TargetLanguages { get; set; } + + public ItemsToPublish() + { + Items = new List(); + } } -} +} \ No newline at end of file diff --git a/src/Sitecore.Ship.Infrastructure/PublishService.cs b/src/Sitecore.Ship.Infrastructure/PublishService.cs index 3eda9c6..bc9d13a 100644 --- a/src/Sitecore.Ship.Infrastructure/PublishService.cs +++ b/src/Sitecore.Ship.Infrastructure/PublishService.cs @@ -26,25 +26,35 @@ public PublishService() }; } - public void Run(ItemsToPublish itemsToPublish) - { - using (new SecurityModel.SecurityDisabler()) - { - var master = Sitecore.Configuration.Factory.GetDatabase("master"); - var languages = itemsToPublish.TargetLanguages.Select(LanguageManager.GetLanguage).ToArray(); - - foreach (var itemToPublish in itemsToPublish.Items) - { - var item = master.GetItem(new ID(itemToPublish)); - if (item != null) - { - Publishing.PublishManager.PublishItem(item, itemsToPublish.TargetDatabases.Select(Sitecore.Configuration.Factory.GetDatabase).ToArray(), languages, true, true); - } - } - } - } - - public void Run(PublishParameters publishParameters) + public void Run(ItemsToPublish itemsToPublish) + { + if (itemsToPublish == null) + { + throw new ArgumentNullException("itemsToPublish"); + } + + if (itemsToPublish.Items.Count == 0) + { + return; + } + + using (new SecurityModel.SecurityDisabler()) + { + var master = Sitecore.Configuration.Factory.GetDatabase("master"); + var languages = itemsToPublish.TargetLanguages.Select(LanguageManager.GetLanguage).ToArray(); + + foreach (var itemToPublish in itemsToPublish.Items) + { + var item = master.GetItem(new ID(itemToPublish)); + if (item != null) + { + Publishing.PublishManager.PublishItem(item, itemsToPublish.TargetDatabases.Select(Sitecore.Configuration.Factory.GetDatabase).ToArray(), languages, true, true); + } + } + } + } + + public void Run(PublishParameters publishParameters) { var publishingMode = publishParameters.Mode.ToLower(); From 9bf2faf3e917f8ca85430ea604b738327929f543 Mon Sep 17 00:00:00 2001 From: Kevin Obee Date: Mon, 24 Aug 2015 00:06:11 +0100 Subject: [PATCH 12/22] #46 Fixed InvokePublishingCommand return values --- .../Publish/InvokePublishingCommand.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Sitecore.Ship.AspNet/Publish/InvokePublishingCommand.cs b/src/Sitecore.Ship.AspNet/Publish/InvokePublishingCommand.cs index a464c02..d901eb5 100644 --- a/src/Sitecore.Ship.AspNet/Publish/InvokePublishingCommand.cs +++ b/src/Sitecore.Ship.AspNet/Publish/InvokePublishingCommand.cs @@ -54,6 +54,9 @@ public override void HandleRequest(HttpContextBase context) else { _publishService.Run(itemsToPublish); + var json = Json.Encode(new { date }); + + JsonResponse(json, HttpStatusCode.Accepted, context); } } } @@ -61,11 +64,10 @@ public override void HandleRequest(HttpContextBase context) else { _publishService.Run(publishParameters); - } + var json = Json.Encode(new { date }); - var json = Json.Encode(new { date }); - - JsonResponse(json, HttpStatusCode.Accepted, context); + JsonResponse(json, HttpStatusCode.Accepted, context); + } } else if (Successor != null) { From e3acae0027cbb8c2e25f75d403e3f7097ce6d198 Mon Sep 17 00:00:00 2001 From: Kevin Obee Date: Mon, 24 Aug 2015 00:23:03 +0100 Subject: [PATCH 13/22] Issue #44 - Smoke test added for specific example from https://github.com/kevinobee/Sitecore.Ship/issues/44 --- build/Build.proj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/Build.proj b/build/Build.proj index 359c594..2bc3cf9 100644 --- a/build/Build.proj +++ b/build/Build.proj @@ -24,7 +24,7 @@ - + $(ProjectRoot)\build\sitecore packages\SitecoreShip.zip $(ProjectRoot)\tests\acceptance-test\01-package.update @@ -70,6 +70,9 @@ + + + \ No newline at end of file From ab7dd3475377f0c4231ae403eef8a6c19e5de5c5 Mon Sep 17 00:00:00 2001 From: Kevin Obee Date: Mon, 24 Aug 2015 00:29:44 +0100 Subject: [PATCH 14/22] Tried to undo weird formatting that carried across from work StyleCop settings --- .../Publish/InvokePublishingCommand.cs | 142 +++++++++--------- .../PublishService.cs | 108 ++++++------- 2 files changed, 125 insertions(+), 125 deletions(-) diff --git a/src/Sitecore.Ship.AspNet/Publish/InvokePublishingCommand.cs b/src/Sitecore.Ship.AspNet/Publish/InvokePublishingCommand.cs index d901eb5..cfe7c52 100644 --- a/src/Sitecore.Ship.AspNet/Publish/InvokePublishingCommand.cs +++ b/src/Sitecore.Ship.AspNet/Publish/InvokePublishingCommand.cs @@ -11,36 +11,36 @@ namespace Sitecore.Ship.AspNet.Publish { - public class InvokePublishingCommand : CommandHandler - { - private readonly IPublishService _publishService; - - public InvokePublishingCommand(IPublishService publishService) - { - _publishService = publishService; - } - - public InvokePublishingCommand() : this(new PublishService()) - { - } - - public override void HandleRequest(HttpContextBase context) - { - if (CanHandle(context)) - { - var publishParameters = GetRequest(context.Request); - - var now = DateTime.Now; - var date = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second); - - if (publishParameters.Mode.ToLowerInvariant() == "listofitems") - { - using (var reader = new StreamReader(context.Request.InputStream)) - { - var values = reader.ReadToEnd(); + public class InvokePublishingCommand : CommandHandler + { + private readonly IPublishService _publishService; + + public InvokePublishingCommand(IPublishService publishService) + { + _publishService = publishService; + } + + public InvokePublishingCommand() : this(new PublishService()) + { + } + + public override void HandleRequest(HttpContextBase context) + { + if (CanHandle(context)) + { + var publishParameters = GetRequest(context.Request); + + var now = DateTime.Now; + var date = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second); + + if (publishParameters.Mode.ToLowerInvariant() == "listofitems") + { + using (var reader = new StreamReader(context.Request.InputStream)) + { + var values = reader.ReadToEnd(); if (string.IsNullOrEmpty(values)) - { + { JsonResponse(string.Empty, HttpStatusCode.NoContent, context); } else @@ -59,50 +59,50 @@ public override void HandleRequest(HttpContextBase context) JsonResponse(json, HttpStatusCode.Accepted, context); } } - } - } - else - { - _publishService.Run(publishParameters); + } + } + else + { + _publishService.Run(publishParameters); var json = Json.Encode(new { date }); JsonResponse(json, HttpStatusCode.Accepted, context); - } - } - else if (Successor != null) - { - Successor.HandleRequest(context); - } - } - - private static bool CanHandle(HttpContextBase context) - { - return context.Request.Url != null && - IsPublishModeUrl(context.Request.Url.PathAndQuery.ToLowerInvariant()) && - context.Request.HttpMethod == "POST"; - } - - private static bool IsPublishModeUrl(string urlPath) - { - return urlPath.EndsWith("/services/publish/full") || - urlPath.EndsWith("/services/publish/smart") || - urlPath.EndsWith("/services/publish/incremental") || - urlPath.EndsWith("/services/publish/listofitems"); - } - - private static PublishParameters GetRequest(HttpRequestBase request) - { - if (request.Url == null) throw new InvalidOperationException("Missing Url"); - - var publishRequest = new PublishParameters - { - Mode = request.Url.PathAndQuery.Split(new[] {'/'}).Last(), - Source = request.Form["source"] ?? "master", - Targets = request.Form["targets"].CsvStringToStringArray(new[] { "web" }), - Languages = request.Form["languages"].CsvStringToStringArray(new[] { "en" }) - }; - - return publishRequest; - } - } + } + } + else if (Successor != null) + { + Successor.HandleRequest(context); + } + } + + private static bool CanHandle(HttpContextBase context) + { + return context.Request.Url != null && + IsPublishModeUrl(context.Request.Url.PathAndQuery.ToLowerInvariant()) && + context.Request.HttpMethod == "POST"; + } + + private static bool IsPublishModeUrl(string urlPath) + { + return urlPath.EndsWith("/services/publish/full") || + urlPath.EndsWith("/services/publish/smart") || + urlPath.EndsWith("/services/publish/incremental") || + urlPath.EndsWith("/services/publish/listofitems"); + } + + private static PublishParameters GetRequest(HttpRequestBase request) + { + if (request.Url == null) throw new InvalidOperationException("Missing Url"); + + var publishRequest = new PublishParameters + { + Mode = request.Url.PathAndQuery.Split(new[] {'/'}).Last(), + Source = request.Form["source"] ?? "master", + Targets = request.Form["targets"].CsvStringToStringArray(new[] { "web" }), + Languages = request.Form["languages"].CsvStringToStringArray(new[] { "en" }) + }; + + return publishRequest; + } + } } \ No newline at end of file diff --git a/src/Sitecore.Ship.Infrastructure/PublishService.cs b/src/Sitecore.Ship.Infrastructure/PublishService.cs index bc9d13a..a036f49 100644 --- a/src/Sitecore.Ship.Infrastructure/PublishService.cs +++ b/src/Sitecore.Ship.Infrastructure/PublishService.cs @@ -12,19 +12,19 @@ namespace Sitecore.Ship.Infrastructure { - public class PublishService : IPublishService - { - private readonly Dictionary> _publishingActions; - - public PublishService() - { - _publishingActions = new Dictionary> - { - { "full", Publishing.PublishManager.Republish }, - { "smart", Publishing.PublishManager.PublishSmart }, - { "incremental", Publishing.PublishManager.PublishIncremental } - }; - } + public class PublishService : IPublishService + { + private readonly Dictionary> _publishingActions; + + public PublishService() + { + _publishingActions = new Dictionary> + { + { "full", Publishing.PublishManager.Republish }, + { "smart", Publishing.PublishManager.PublishSmart }, + { "incremental", Publishing.PublishManager.PublishIncremental } + }; + } public void Run(ItemsToPublish itemsToPublish) { @@ -55,45 +55,45 @@ public void Run(ItemsToPublish itemsToPublish) } public void Run(PublishParameters publishParameters) - { - var publishingMode = publishParameters.Mode.ToLower(); - - if (!_publishingActions.ContainsKey(publishingMode)) - { - throw new InvalidOperationException(string.Format("Invalid publishing mode ({0})", publishingMode)); - } - - PublishingTask(_publishingActions[publishingMode], publishParameters); - } - - public DateTime GetLastCompletedRun(PublishLastCompleted completeParameters) - { - // please note http://stackoverflow.com/questions/12416141/get-the-date-time-that-sitecore-last-published - - var source = Sitecore.Configuration.Factory.GetDatabase(completeParameters.Source); - var target = Sitecore.Configuration.Factory.GetDatabase(completeParameters.Target); - - var language = LanguageManager.GetLanguage(completeParameters.Language); - - - Assert.IsNotNull(source, "Source database {0} cannot be found".Formatted(completeParameters.Source)); - Assert.IsNotNull(source, "Target database {0} cannot be found".Formatted(completeParameters.Target)); - Assert.IsNotNull(language, "Language {0} cannot be found".Formatted(completeParameters.Language)); - - var date = source.Properties.GetLastPublishDate(target, language); - return date; - } - - private static void PublishingTask(Func publishType, PublishParameters publishParameters) - { - using (new SecurityModel.SecurityDisabler()) - { - var master = Sitecore.Configuration.Factory.GetDatabase(publishParameters.Source); - var targetDBs = publishParameters.Targets.Select(Sitecore.Configuration.Factory.GetDatabase).ToArray(); - var languages = publishParameters.Languages.Select(LanguageManager.GetLanguage).ToArray(); - - publishType(master, targetDBs, languages); - } - } - } + { + var publishingMode = publishParameters.Mode.ToLower(); + + if (!_publishingActions.ContainsKey(publishingMode)) + { + throw new InvalidOperationException(string.Format("Invalid publishing mode ({0})", publishingMode)); + } + + PublishingTask(_publishingActions[publishingMode], publishParameters); + } + + public DateTime GetLastCompletedRun(PublishLastCompleted completeParameters) + { + // please note http://stackoverflow.com/questions/12416141/get-the-date-time-that-sitecore-last-published + + var source = Sitecore.Configuration.Factory.GetDatabase(completeParameters.Source); + var target = Sitecore.Configuration.Factory.GetDatabase(completeParameters.Target); + + var language = LanguageManager.GetLanguage(completeParameters.Language); + + + Assert.IsNotNull(source, "Source database {0} cannot be found".Formatted(completeParameters.Source)); + Assert.IsNotNull(source, "Target database {0} cannot be found".Formatted(completeParameters.Target)); + Assert.IsNotNull(language, "Language {0} cannot be found".Formatted(completeParameters.Language)); + + var date = source.Properties.GetLastPublishDate(target, language); + return date; + } + + private static void PublishingTask(Func publishType, PublishParameters publishParameters) + { + using (new SecurityModel.SecurityDisabler()) + { + var master = Sitecore.Configuration.Factory.GetDatabase(publishParameters.Source); + var targetDBs = publishParameters.Targets.Select(Sitecore.Configuration.Factory.GetDatabase).ToArray(); + var languages = publishParameters.Languages.Select(LanguageManager.GetLanguage).ToArray(); + + publishType(master, targetDBs, languages); + } + } + } } \ No newline at end of file From 9b7047abbf0d672de84a789f714074a673e4a12e Mon Sep 17 00:00:00 2001 From: Kevin Obee Date: Mon, 24 Aug 2015 00:49:04 +0100 Subject: [PATCH 15/22] Fix minor build configuration issues --- build/Build.proj | 2 +- build/build.targets | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/Build.proj b/build/Build.proj index 2bc3cf9..83a3e3f 100644 --- a/build/Build.proj +++ b/build/Build.proj @@ -71,7 +71,7 @@ - + diff --git a/build/build.targets b/build/build.targets index cd4be11..7156601 100644 --- a/build/build.targets +++ b/build/build.targets @@ -97,6 +97,6 @@ - + \ No newline at end of file From 30795049f6a2cc6b6306e7bb838e0ce7e66f8106 Mon Sep 17 00:00:00 2001 From: Kevin Obee Date: Mon, 24 Aug 2015 00:52:35 +0100 Subject: [PATCH 16/22] #47 fix for Activator.CreateInstance for Sitecore.Ship against Sitecore 8.0 rev. 141212 --- src/Sitecore.Ship/DefaultBootstrapper.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Sitecore.Ship/DefaultBootstrapper.cs b/src/Sitecore.Ship/DefaultBootstrapper.cs index a3ba573..1df832b 100644 --- a/src/Sitecore.Ship/DefaultBootstrapper.cs +++ b/src/Sitecore.Ship/DefaultBootstrapper.cs @@ -33,8 +33,6 @@ protected override void ConfigureConventions(Nancy.Conventions.NancyConventions protected override void ConfigureApplicationContainer(TinyIoCContainer container) { - base.ConfigureApplicationContainer(container); - container.AutoRegister(new[] { typeof (IPackageRepository).Assembly, From d7d342cd1969cf42573e69a6067b8bd289473d5e Mon Sep 17 00:00:00 2001 From: Kevin Obee Date: Mon, 24 Aug 2015 01:36:53 +0100 Subject: [PATCH 17/22] Minor change to ItemsToPublish to make it safe to use by default --- .../Domain/ItemsToPublish.cs | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/Sitecore.Ship.Core/Domain/ItemsToPublish.cs b/src/Sitecore.Ship.Core/Domain/ItemsToPublish.cs index 61dbd20..dc91859 100644 --- a/src/Sitecore.Ship.Core/Domain/ItemsToPublish.cs +++ b/src/Sitecore.Ship.Core/Domain/ItemsToPublish.cs @@ -3,15 +3,17 @@ namespace Sitecore.Ship.Core.Domain { - public class ItemsToPublish - { - public List Items { get; set; } - public string[] TargetDatabases { get; set; } - public string[] TargetLanguages { get; set; } + public class ItemsToPublish + { + public List Items { get; set; } + public string[] TargetDatabases { get; set; } + public string[] TargetLanguages { get; set; } - public ItemsToPublish() - { - Items = new List(); - } - } + public ItemsToPublish() + { + Items = new List(); + TargetDatabases = new string[] { }; + TargetLanguages = new string[] { }; + } + } } \ No newline at end of file From 4d53ac933b7fbb3ebbdd5c67061348969b53f6e9 Mon Sep 17 00:00:00 2001 From: Kevin Obee Date: Sun, 23 Aug 2015 18:06:25 +0100 Subject: [PATCH 18/22] #45 initial load --- apiary.apib | 170 ++++++++-------------------------------------------- 1 file changed, 24 insertions(+), 146 deletions(-) diff --git a/apiary.apib b/apiary.apib index 8999951..7fed823 100644 --- a/apiary.apib +++ b/apiary.apib @@ -1,11 +1,11 @@ -FORMAT: 1A +FORMAT: 1A HOST: http://polls.apiblueprint.org/ # Sitecore.Ship -Polls is a simple API allowing consumers to view polls and vote in them. +Package is a simple API allowing consumers to install packages into a Sitecore instance. -# Polls API Root [/] +# Package API Root [/services/package] This resource does not have any attributes. Instead it offers the initial API affordances in the form of the links in the JSON body. @@ -20,162 +20,40 @@ to keep your client decoupled from implementation details. + Response 200 (application/json) { - "questions_url": "/questions" + "questions_url": "/questions" // TODO } -## Group Question +## Group Install Package -Resources related to questions in the API. +Resources related to installing packages using the API. -## Question [/questions/{question_id}] +## Install Package [/services/package/install] -A Question object has the following attributes: +TODO -+ question -+ published_at - An ISO8601 date when the question was published. -+ url -+ choices - An array of Choice objects. +### Install Package - Specify Server File Path [POST] -+ Parameters - + question_id: 1 (required, number) - ID of the Question in form of an integer ++ Request (multipart/form-data) -### View a Questions Detail [GET] - -+ Response 200 (application/json) - - { - "question": "Favourite programming language?", - "published_at": "2014-11-11T08:40:51.620Z", - "url": "/questions/1", - "choices": [ - { - "choice": "Swift", - "url": "/questions/1/choices/1", - "votes": 2048 - }, { - "choice": "Python", - "url": "/questions/1/choices/2", - "votes": 1024 - }, { - "choice": "Objective-C", - "url": "/questions/1/choices/3", - "votes": 512 - }, { - "choice": "Ruby", - "url": "/questions/1/choices/4", - "votes": 256 - } - ] - } - -## Choice [/questions/{question_id}/choices/{choice_id}] - -+ Parameters - + question_id: 1 (required, number) - ID of the Question in form of an integer - + choice_id: 1 (required, number) - ID of the Choice in form of an integer - -### Vote on a Choice [POST] - -This action allows you to vote on a question's choice. - -+ Response 201 - - + Headers - - Location: /questions/1 - -## Questions Collection [/questions{?page}] - -+ Parameters - + page: 1 (optional, number) - The page of questions to return - -### List All Questions [GET] - -+ Response 200 (application/json) - - + Headers - - Link: ; rel="next" - - + Body - - [ - { - "question": "Favourite programming language?", - "published_at": "2014-11-11T08:40:51.620Z", - "url": "/questions/1", - "choices": [ - { - "choice": "Swift", - "url": "/questions/1/choices/1", - "votes": 2048 - }, { - "choice": "Python", - "url": "/questions/1/choices/2", - "votes": 1024 - }, { - "choice": "Objective-C", - "url": "/questions/1/choices/3", - "votes": 512 - }, { - "choice": "Ruby", - "url": "/questions/1/choices/4", - "votes": 256 - } - ] - } - ] - -### Create a New Question [POST] - -You may create your own question using this action. It takes a JSON -object containing a question and a collection of answers in the -form of choices. - -+ question (string) - The question -+ choices (array[string]) - A collection of choices. - -+ Request (application/json) - - { - "question": "Favourite programming language?", - "choices": [ - "Swift", - "Python", - "Objective-C", - "Ruby" - ] - } + ----WebKitFormBoundaryE19zNvXGzXaLvS5C + Content-Disposition: form-data; name="path" + + d:\package.update + ----WebKitFormBoundaryE19zNvXGzXaLvS5C + Response 201 (application/json) + Headers - Location: /questions/2 + Location: /services/package/latestversion - + Body ++ Response 201 (application/json) + { + "Entries": [ { - "question": "Favourite programming language?", - "published_at": "2014-11-11T08:40:51.620Z", - "url": "/questions/2", - "choices": [ - { - "choice": "Swift", - "url": "/questions/2/choices/1", - "votes": 0 - }, { - "choice": "Python", - "url": "/questions/2/choices/2", - "votes": 0 - }, { - "choice": "Objective-C", - "url": "/questions/2/choices/3", - "votes": 0 - }, { - "choice": "Ruby", - "url": "/questions/2/choices/4", - "votes": 0 - } - ] - } + "ID": "110d559f-dea5-42ea-9c1c-8a5df7e70ef9", + "Path": "addeditems/master/sitecore/content/home" + } + ] + } \ No newline at end of file From c3df6080885c1f16e37e1492e85176d8ae848663 Mon Sep 17 00:00:00 2001 From: Kevin Obee Date: Sun, 13 Sep 2015 21:02:36 +0100 Subject: [PATCH 19/22] Initial defintition of the service root --- Sitecore.Ship.sln | 21 ++++++++++++--------- apiary.apib | 47 +++++------------------------------------------ 2 files changed, 17 insertions(+), 51 deletions(-) diff --git a/Sitecore.Ship.sln b/Sitecore.Ship.sln index 2ffbc07..98e5f82 100644 --- a/Sitecore.Ship.sln +++ b/Sitecore.Ship.sln @@ -1,6 +1,8 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 +# Visual Studio 2013 +VisualStudioVersion = 12.0.40629.0 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F0717179-F14B-4667-8D5A-5980EC935F0F}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{33043060-6D33-4018-9F77-A36E70771C93}" @@ -39,6 +41,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "packaging", "packaging", "{ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{D11D4F10-B2C8-4E1C-BF78-B192D303D20D}" ProjectSection(SolutionItems) = preProject + apiary.apib = apiary.apib docs\Assembly Linkage.dgml = docs\Assembly Linkage.dgml README.md = README.md EndProjectSection @@ -189,20 +192,20 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution + {923D9377-9025-425B-9698-1A38947CA973} = {2A29E5BC-9DE1-4299-AFD9-86F1CC77B921} + {05F4023A-A4F6-4844-8175-8D7E04C63913} = {33043060-6D33-4018-9F77-A36E70771C93} {F9CC137C-E000-4D1E-9997-B8E3D20F7E36} = {F0717179-F14B-4667-8D5A-5980EC935F0F} {A0ED41C4-D292-47BD-8457-A40267B4EA8C} = {F0717179-F14B-4667-8D5A-5980EC935F0F} - {CD35B0F4-791F-452A-A7BA-98D82A00007F} = {F0717179-F14B-4667-8D5A-5980EC935F0F} - {D8D5E56C-6E0A-4A70-AA85-E0F6DDD97B38} = {F0717179-F14B-4667-8D5A-5980EC935F0F} - {05F4023A-A4F6-4844-8175-8D7E04C63913} = {33043060-6D33-4018-9F77-A36E70771C93} - {923D9377-9025-425B-9698-1A38947CA973} = {2A29E5BC-9DE1-4299-AFD9-86F1CC77B921} - {62E649F4-4878-4EA3-BCF6-82CB86D2B685} = {2A29E5BC-9DE1-4299-AFD9-86F1CC77B921} - {9BF13B7F-07E4-43B3-9B90-E06EBB39CC53} = {2A29E5BC-9DE1-4299-AFD9-86F1CC77B921} - {6121509C-0554-4FD7-974B-97A81B9DF0F3} = {2A29E5BC-9DE1-4299-AFD9-86F1CC77B921} {4363354A-7FF5-492B-B7F6-B02802C52DE8} = {923D9377-9025-425B-9698-1A38947CA973} + {CD35B0F4-791F-452A-A7BA-98D82A00007F} = {F0717179-F14B-4667-8D5A-5980EC935F0F} {A4356DB1-04AC-48E9-B70B-6C6E0C38A96E} = {923D9377-9025-425B-9698-1A38947CA973} - {E24C421E-4CF0-40B8-AD95-FF35BBE890D2} = {923D9377-9025-425B-9698-1A38947CA973} + {62E649F4-4878-4EA3-BCF6-82CB86D2B685} = {2A29E5BC-9DE1-4299-AFD9-86F1CC77B921} {E18F1279-A765-4852-BF4C-CB401BDBC909} = {62E649F4-4878-4EA3-BCF6-82CB86D2B685} + {D8D5E56C-6E0A-4A70-AA85-E0F6DDD97B38} = {F0717179-F14B-4667-8D5A-5980EC935F0F} + {9BF13B7F-07E4-43B3-9B90-E06EBB39CC53} = {2A29E5BC-9DE1-4299-AFD9-86F1CC77B921} {20FEF273-8A20-4A33-A54F-5B91026A511E} = {9BF13B7F-07E4-43B3-9B90-E06EBB39CC53} {6B2A7E83-EDD3-4814-8EDD-508AF695BB59} = {9BF13B7F-07E4-43B3-9B90-E06EBB39CC53} + {6121509C-0554-4FD7-974B-97A81B9DF0F3} = {2A29E5BC-9DE1-4299-AFD9-86F1CC77B921} + {E24C421E-4CF0-40B8-AD95-FF35BBE890D2} = {923D9377-9025-425B-9698-1A38947CA973} EndGlobalSection EndGlobal diff --git a/apiary.apib b/apiary.apib index 7fed823..dfe028b 100644 --- a/apiary.apib +++ b/apiary.apib @@ -1,59 +1,22 @@ FORMAT: 1A -HOST: http://polls.apiblueprint.org/ +HOST: http://docs.sitecoreship.apiary.io/ # Sitecore.Ship Package is a simple API allowing consumers to install packages into a Sitecore instance. -# Package API Root [/services/package] +# Sitecore.Ship API Root [/services] -This resource does not have any attributes. Instead it offers the initial -API affordances in the form of the links in the JSON body. +Returns information on the currently installed Sitecore.Ship. -It is recommend to follow the “url” link values, -[Link](https://tools.ietf.org/html/rfc5988) or Location headers where -applicable to retrieve resources. Instead of constructing your own URLs, -to keep your client decoupled from implementation details. - -## Retrieve the Entry Point [GET] +## Retrieve information on the installed Sitecore.Ship [GET] + Response 200 (application/json) { - "questions_url": "/questions" // TODO + "sitecore.ship.version": "0.4.0" } -## Group Install Package - -Resources related to installing packages using the API. - -## Install Package [/services/package/install] - -TODO - -### Install Package - Specify Server File Path [POST] - -+ Request (multipart/form-data) - - ----WebKitFormBoundaryE19zNvXGzXaLvS5C - Content-Disposition: form-data; name="path" - - d:\package.update - ----WebKitFormBoundaryE19zNvXGzXaLvS5C - -+ Response 201 (application/json) - - + Headers - Location: /services/package/latestversion -+ Response 201 (application/json) - { - "Entries": [ - { - "ID": "110d559f-dea5-42ea-9c1c-8a5df7e70ef9", - "Path": "addeditems/master/sitecore/content/home" - } - ] - } \ No newline at end of file From f21f938b1b2719f8deabf0b75621813ac006c19b Mon Sep 17 00:00:00 2001 From: Kevin Obee Date: Sun, 13 Sep 2015 21:17:47 +0100 Subject: [PATCH 20/22] Minor text changes to the Apiary.Io content --- apiary.apib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apiary.apib b/apiary.apib index dfe028b..2e860a0 100644 --- a/apiary.apib +++ b/apiary.apib @@ -3,7 +3,7 @@ HOST: http://docs.sitecoreship.apiary.io/ # Sitecore.Ship -Package is a simple API allowing consumers to install packages into a Sitecore instance. +The package offers a simple API to help consumers install their packages into Sitecore over an internet connection. # Sitecore.Ship API Root [/services] From fa953e0cc5801622dd1ff51d6a58f8c29b2816fe Mon Sep 17 00:00:00 2001 From: Kevin Obee Date: Sun, 13 Sep 2015 21:38:03 +0100 Subject: [PATCH 21/22] Transferring blueprint from apiary.io --- apiary.apib | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/apiary.apib b/apiary.apib index 2e860a0..7ab5c25 100644 --- a/apiary.apib +++ b/apiary.apib @@ -1,22 +1,18 @@ -FORMAT: 1A +FORMAT: 1A HOST: http://docs.sitecoreship.apiary.io/ # Sitecore.Ship The package offers a simple API to help consumers install their packages into Sitecore over an internet connection. -# Sitecore.Ship API Root [/services] +## Sitecore.Ship API Root [/services] Returns information on the currently installed Sitecore.Ship. -## Retrieve information on the installed Sitecore.Ship [GET] +### Retrieve information on the installed Sitecore.Ship [GET] + Response 200 (application/json) { "sitecore.ship.version": "0.4.0" - } - - - - + } \ No newline at end of file From ed4ccdd004ac0d5130d589a9eb9102deb281894e Mon Sep 17 00:00:00 2001 From: The Gitter Badger Date: Fri, 18 Sep 2015 09:31:10 +0000 Subject: [PATCH 22/22] Add Gitter badge --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cae429d..1c9f023 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Sitecore.Ship +[![Join the chat at https://gitter.im/kevinobee/Sitecore.Ship](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/kevinobee/Sitecore.Ship?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + Sitecore.Ship is a lightweight means to install Sitecore Update packages via HTTP requests. @@ -81,7 +83,7 @@ The body of a successfull request will contain details of the package contents i {"Entries":[{"ID":"110d559f-dea5-42ea-9c1c-8a5df7e70ef9","Path":"addeditems/master/sitecore/content/home"}]} The request also takes an optional `DisableIndexing` parameter in the x-www-form-urlencoded form-data which defaults to *false*. When the parameter is set to *true* updating of search indexes during the package installation will be suspended. Disabling the search index updates will increase the speed at which packages are installed into the CMS. You can read more about this approach on Alex Shyba's -[blog](http://sitecoreblog.alexshyba.com/2010/04/sitecore-installation-wizard-disable.html "Sitecore Installation Wizard disable search index update during install") +[blog](http://sitecoreblog.alexshyba.com/2010/04/sitecore-installation-wizard-disable.html "Sitecore Installation Wizard � disable search index update during install")