Compare commits

..

99 Commits

Author SHA1 Message Date
Sebastien Ros
cd9bccef96 Supportin VS2017 in build.cmd
Fixes #7657
2017-04-24 11:13:42 -07:00
Sebastien Ros
358c57464e Merge branch 'refs/heads/1.10.x' into 1.10.2 2017-04-13 12:42:46 -07:00
Sebastien Ros
5d892feceb Merge branch 'refs/heads/1.10.x' into 1.10.2 2017-04-13 12:39:38 -07:00
ViRuSTriNiTy
a200e35923 [Fixes #5745] Calling RoleService.Renamed() after it's been renamed (#7653)
[Fixes #5745]
2017-04-13 12:29:47 -07:00
Sebastien Ros
d384110253 Logging errors during Media Upload 2017-04-13 12:12:14 -07:00
Sebastien Ros
d17930395c Merge branch '1.10.x' into 1.10.2 2017-04-11 16:48:35 -07:00
Sebastien Ros
5eef9c654c Fixing NRE on upgrade 2017-04-11 16:48:06 -07:00
Sebastien Ros
54575ab513 Merge branch 'refs/heads/1.10.x' into 1.10.2 2017-04-11 10:11:10 -07:00
ViRuSTriNiTy
55c43ad236 [Fixes #6979] Added operator IsNull and IsNotNull to date time filter
Fixes #6979
2017-04-06 12:25:08 -07:00
Sébastien Ros
1870e3eb04 Fixing Author tokenization for RssPart
Fixes #7629
2017-04-06 12:06:57 -07:00
GiuseppeMusso-Laser
d8079dec26 Fix on Content Picker Field rendering (#7631)
Fixes #7630
2017-04-05 11:38:41 -07:00
Sébastien Ros
ac4f7c05c9 Update README.md 2017-04-04 11:43:44 -07:00
Sebastien Ros
98e0b43c26 Updating version number 2017-04-03 12:21:56 -07:00
Sebastien Ros
17c7c77e3c Merge remote-tracking branch 'origin/1.10.x' into 1.10.2 2017-04-03 11:16:23 -07:00
Benedek Farkas
185ad6b1eb Adding LangVersion 5 setting to each csproj's Debug and Release target (#7641)
Fixes #7639
2017-04-03 10:38:41 -07:00
Lombiq
dbb5668d49 Framework: Removing C# 6 code from LocalizationStreamParser 2017-04-01 20:20:01 +02:00
andy
d686d688a4 add comments to audit module (#7635)
* add comments to audit module

* Improve it as @DanielStolt  suggest

* Apply trailing periods consistently
2017-03-31 22:36:39 +02:00
GiuseppeMusso-Laser
5361b29a9c Taxonomies: added index on TermContentItem table. (#7594)
Fixes #7593
2017-03-31 12:51:56 -07:00
Matteo Piovanelli
86ec07007f Allows draft ContentItems in ContentPickerField (#7624)
Fixes #7623
2017-03-31 12:31:15 -07:00
GiuseppeMusso-Laser
2eeef52077 Localization: default culture set to site culture for new content items. (#7626)
Fixes #7625
2017-03-31 12:29:54 -07:00
ViRuSTriNiTy
c228421051 [Fixes #7633] Orchard.Mvc.Routes - Added support for multiple IRouteProvider implementations per module in StandardExtensionRouteProvider (#7634)
[Fixes #7633]
2017-03-31 12:11:12 -07:00
Sebastien Ros
a23e9ea764 Merge branch '1.10.x' into 1.10.2 2017-03-27 15:39:59 -07:00
Sebastien Ros
e41e9079d3 Fixing content file marker for tests 2017-03-27 13:21:35 -07:00
Lombiq
d85954fa6d Implementing user-configurable Lucene indexing analyzer selection, resolves #3887 2017-03-23 00:45:57 +01:00
Lombiq
a709e37ddc Fixing that Taxonomy Fields attached to the User content type didn't work in the User editor (#4479) 2017-03-16 22:02:56 +01:00
siyamandayubi
87bdf9c413 Fix MySQL support (#7607)
Fixes #7602
2017-03-16 12:04:52 -07:00
LorenzoFrediani-Laser
d2889e46e3 Changed UpgradeFrom1 to UpdateFrom1 on Migration (#7612)
Fixes #7611
2017-03-16 12:03:41 -07:00
GiuseppeMusso-Laser
134bac44c3 Tags: added index on ContentTagRecord table. (#7591) 2017-03-09 12:14:28 -08:00
andy
9ec312a1c3 Use Compose to make code stronger and consistent (#7582) 2017-03-02 16:03:27 -05:00
Sipke Schoorstra
097119466a Revert "Updated GroupInfo name for AuditTrail settings."
This reverts commit 9f98d3151b.
2017-02-28 21:17:48 +01:00
Sipke Schoorstra
9f98d3151b Updated GroupInfo name for AuditTrail settings.
#Fixes 7583
2017-02-28 14:37:39 +01:00
Daniel Stolt
234d5214dd Added missing SnippetDescriptor property to Snippet element shape. 2017-02-14 06:44:36 +02:00
GiuseppeMusso-Laser
33bdfd0551 Feature to remove a Publish Later task (#7438) 2017-02-09 12:43:19 -08:00
Hannan Azam Khan
ac978b665b Fixes #7493 TextFieldDriver doesn't export its tag if content is empty (#7510)
* TextFieldDriver doesn't export its tag if content is empty
* Null check implemented , string.Empty returned
* TextFieldDriver doesn't export its tag if content is empty #7493
* TextFieldDriver doesn't export its tag if content is empty #7493
2017-02-09 14:00:18 +01:00
Lombiq
8dde994bde MediaLibrary: Fixing that removing TitlePart from a type with MediaPart causes the type to be unusable due to an implicit dependency, fixes #6047 2017-02-04 15:49:19 +01:00
Lombiq
f28da9894a Fixing redirect on tenants with a URL prefix, fixes #4605 2017-02-03 17:16:18 +01:00
Hannan Azam Khan
8c1ffe2564 [Fixes #7486] Possibility of exporting individual Form Submissions (#7495) 2017-02-02 12:24:13 -08:00
Carl Woodhouse
5a0fe4e105 [Fixes #5596] blueprint harvesting caching (#7549)
Fixes #5596
2017-02-02 12:23:07 -08:00
Carl Woodhouse
2c26c65f63 [Fixes #7479] Unwrapping of TargetInvocationException causes partial stacktrace loss (#7550)
Fixes #7479
2017-02-02 12:22:00 -08:00
Lombiq
654a9e1884 Framework: Fixing that a non-zero MaxPageSize site setting was not applied when the page size is 0, #7541 2017-01-27 03:29:31 +01:00
Sebastien Ros
149346ce68 Merge remote-tracking branch 'refs/remotes/origin/1.10.x' into 1.10.2 2017-01-24 16:37:22 -08:00
Sebastien Ros
9b6c2315de Fixing unit tests 2017-01-24 11:40:20 -08:00
Sebastien Ros
68c10bce60 Improving IsLocalUrl 2017-01-24 08:50:12 -08:00
Carl Woodhouse
8615422e27 Redis: Improving Redis extensions use of keys (#7532) (#5958 re-applied) 2017-01-24 15:25:08 +01:00
Lombiq
06a2e0d6b1 Users: Removing unnecessary file copied to the Users module (see UserResolverSelector.cs)
Same change as 5e17db3afd
2017-01-23 22:49:34 +01:00
Lombiq
6e476243c6 Core: Removing empty folders 2017-01-23 22:38:03 +01:00
Lombiq
eff27ec05e Framework: Removing unused file (ContentManagement\Handlers\IdentifyDependenciesContext.cs) 2017-01-23 22:22:03 +01:00
Lombiq
0869f957bd Fixing that SpecFlow tests were not ran using the tools from the NUnit NuGet package 2017-01-20 18:38:34 +01:00
Matteo Piovanelli
c795cdb871 [Fixes #7348] Changed the SummaryAdmin view to have the same "New Translation" link as the Editor view (#7513)
Fixes #7348
2017-01-19 12:44:48 -08:00
Sebastien Ros
8bd74c947e Fixing log typo
Fixes #7520
2017-01-19 12:37:03 -08:00
Sebastien Ros
b7dd2f6055 Merge branch 'refs/heads/1.10.x' into 1.10.2 2017-01-19 12:05:05 -08:00
bedegaming-aleksej
3b7ec4cb89 [Fixes #7515] Add RemoveContentDefinition recipe step (#7516) 2017-01-13 11:07:29 -08:00
Sebastien Ros
acb93df3ec Merge branch '1.10.x' into 1.10.2 2017-01-12 14:40:22 -08:00
Sebastien Ros
3ac09df891 Fixing Gallery search
Fixes #7497
2017-01-12 12:38:33 -08:00
Benedek Farkas
863d2e4e6b Fixing that the content fields' values in a new content item were reset when building their editor (#7505) (#7507)
Fixes #7505
2017-01-12 12:13:42 -08:00
Matt Varblow
ddfcfd7379 Add UserParameters token object (#7482)
Fixes #7481
2017-01-12 12:08:40 -08:00
Lombiq
8456716d8b Make each JobsQueue tasks execute in its own transaction, see #5365 2017-01-06 20:43:31 +01:00
Hannan Azam Khan
fe4a116cb4 [Fixes #6316] Update Alias when importing AutoroutePart (#7485)
Fixes #6316
2017-01-05 12:37:18 -08:00
Sebastien Ros
4f57ecb487 Fixing unit test 2017-01-03 13:45:09 -08:00
Sebastien Ros
7a9f86dac6 Adding vsvars32.bat is vsvarall cannot be found 2017-01-03 13:42:27 -08:00
Sebastien Ros
6df57dd098 Fixing settings group info matching
Fixes #7371
2017-01-03 13:24:08 -08:00
Sebastien Ros
cccb358ce1 Fixing QueryHints.Empty mutable usage
Fixes #7358
2017-01-03 13:08:32 -08:00
Arman Forghani
db7832db37 [Fixes #1531] IThemeSelector.GetTheme() gets called several times. (#7491)
Fixes #1531
2016-12-31 12:21:43 -08:00
Lombiq
48e2a6a1b4 Fixing that JobsQueue will fail if there are a large number of tasks, fixes #5365
JobsQueue now works in batches to prevent transaction timeouts and the manual job execution feature uses batches as well. This is a fix for the immediate issue, further fixes are needed around the background task infrastructure, see the linked issue.
2016-12-28 20:16:47 +01:00
Hannan Azam Khan
8425fb4829 [Fixes #7452] Media Library: Replacing a media item in recent section (#7484)
Fixes #7452
2016-12-22 12:15:00 -08:00
Matt Varblow
923646c27f [Fixes 7474] Add Canvas in Page commands (#7475)
Fixes #7474.
Create layout with a Canvas root element so it can be edited in the Orchard admin.
2016-12-15 12:27:04 -08:00
GiuseppeMusso-Laser
27a9bae394 [Fixes 6890] Admin Menu: fix for "Content" item visibility. (#7464)
Fixes #6890
2016-12-12 08:15:15 -08:00
Hermes Sbicego
3bda4acee1 [#7396] Implements UnassignRoleActivity (#7414)
Fixes #7396
2016-12-08 13:05:18 -08:00
Hermes Sbicego
bc66cdb36c [Fixes #7413] Refactor taxonomies and terms permissions (#7456)
Fixes #7413 

* Taxonomies:
 - AdminController: Added Actions to AdminController in order to manage Create/Edit: Only Users with Permission.CreateTaxonomy can Edit/Create a Taxonomy
 - Views/Admin/Index.cshtml: Conditional display of ActionLink Create/Edit in Admin/Index.cshtml based on Permission.CreateTaxonomy
 - Views/Admin/Index.cshtml: Conditional display of ActionLink Delete in Admin/Index.cshtml based on Permission.ManageTaxonomies
 - TaxonomyPartHandler: Adding context.Metadata.EditorRouteValues for Taxonomy
Terms:
 - Paring Action/Permission based on existing Permissions
 - Views/TermAdmin/Index.cshtml: Conditional display of ActionLink Create/Edit/Move/Delete based on right Permissions
 - TermPartHandler: Adding context.Metadata.EditorRouteValues for Taxonomy
AdminMenu:
 - The AdminMenu was shown only if a User had ManageTaxonomies Permission; In that way, Roles who have the Create/Edit/Delete Term Permission could not access Index/Edit forms: specializing permissions on Navigation grants access to users belonging to those Roles.

* Removed redundant check over SiteOwner permission
2016-12-08 12:48:25 -08:00
mhodorogea
9f60edc7f5 [Fixes #7451] Encoding of taxonomies in the dynamic forms (#7458)
Fixes #7451
2016-12-08 12:44:23 -08:00
JOSHUA NOGALES
e35b71e1dc [Fixes #7425] Session Locator | Isolation Levels not respected in Sites.config (#7466)
Fixes #7425
2016-12-08 12:32:21 -08:00
Chris Payne
6ab9ffc7da [Fixes #4941] Adds Url property to dynamic menu shape (#7468)
Fixes #4941
2016-12-08 12:30:42 -08:00
Xceno Malloy
5c6dd3e34f [Fixes: #7462] Orchard.OutputCache - Possible NRE in DefaultTagCache ctor when accessing the WorkContext (#7463)
Fixes #7462
2016-12-08 12:20:54 -08:00
Sebastien Ros
d0b65cb60b [Fixes #7427] Fixing Blog Post permission
The SummaryAdmin was not using the dedicated permissions.
The default content handler can convert to the owner variation before the blogpost handler.

Fixes #7427
2016-12-07 12:15:24 -08:00
MarcoViglione-Laser
6f3193e52b [Fixes ##7430] Added support for culture neutral patterns (#7449)
Fixes ##7430
2016-12-02 08:07:43 -08:00
LorenzoFrediani-Laser
a7f51c13d4 [Fixes #7404] Users own media folder name provider (#7454)
Fixes #7404
2016-12-01 13:14:52 -08:00
bedegaming-aleksej
4b2e1ca19d [Fixes #7441] Adapt export steps flag to work with refactored steps (#7442)
Fixes #7441
2016-12-01 13:08:06 -08:00
Hermes Sbicego
8a328902fd ProjectionManager Extension (#7417)
- Defined a new interface IProjectionManagerExtension that inherits from IProjectionManager
- ProjectionManager now implements IProjectionManagerExtension, so we can pass a part to GetCount and GetContentItems
- GetCount and GetContentItems transform the part into a Content token, so you can filter data with informations contained in the Projection itself
2016-12-01 13:00:13 -08:00
ViRuSTriNiTy
83f47ac148 [Fixes #7446] Orchard.Users - Allow umlauts in UserPart.EmailPattern (#7447)
Fixes #7446
2016-12-01 12:50:45 -08:00
GiuseppeMusso-Laser
750824b197 [Fixes #7443] Jobs Queue menu item visibility for site owners only. (#7444)
Fixes #7443
2016-12-01 12:43:52 -08:00
GiuseppeMusso-Laser
7045c40406 [Fixes #7436] Added a using of System.Linq in CSharp scripting. (#7437)
Fixes #7436
2016-12-01 12:35:01 -08:00
Lombiq
eed3ee6871 Adding the ability to enable HTTP Strict Transport Security from the SSL module, fixes #6612 2016-11-24 23:38:20 +01:00
GiuseppeMusso-Laser
e6d4d0c9d4 Fix DateTime parsed in ISO 8601 format. (#7433)
Fixes #7432
2016-11-22 18:41:40 -08:00
Matteo Piovanelli
0ea47a5554 Fixed the tenant name validation (#7429) 2016-11-22 18:39:40 -08:00
Szymon Seliga
d8f423888a [Fixes #7378] Fixed tenant name validation regex, not to allow numbers. (#7399)
[Fixes #7378]
2016-11-18 10:25:31 -08:00
Hermes Sbicego
4299239482 Implements what described in #6688 (#7356)
Fixes #6688
2016-11-17 13:02:54 -08:00
Hannan Azam Khan
7e859f2ccf Default Tag Cache from HttpContext (#7280)
Fixes #7240
2016-11-17 12:54:04 -08:00
Matteo Piovanelli
4584da9214 Content picker localization culture dropdown (#7388) 2016-11-17 12:49:35 -08:00
Matteo Piovanelli
f697fbb06a Implements ContentPicker localization options discussed in #7352 (#7391)
* Squashed commit of the following:

commit bd1e2bf3d386a1d6f12a5d062639929a17ba6c46
Author: matteo.piovanelli <matteo.piovanelli@laser-group.com>
Date:   Thu Nov 10 12:02:09 2016 +0100

    Added notifications about what the localization methods for ContentPickerField will do or have done.

commit 04eb7074dcfef2c8beb65f0322821dc654902cfb
Author: matteo.piovanelli <matteo.piovanelli@laser-group.com>
Date:   Wed Nov 9 17:48:59 2016 +0100

    Added the TryTranslate option and its suboptions

commit fad9fa87f3f3a8c555d088e8971dd04a337cf4dc
Author: matteo.piovanelli <matteo.piovanelli@laser-group.com>
Date:   Wed Nov 9 15:31:44 2016 +0100

    Added a new feature to the ContentPicker module.
    So far, it stops saving/publication when the items in the ContentPickerField are the "wrong" culture

commit b90629dc3e
Merge: 578b21b c486355
Author: matteo.piovanelli <matteo.piovanelli@laser-group.com>
Date:   Tue Nov 8 09:37:30 2016 +0100

    Merge remote-tracking branch 'remotes/OrchardCMS.Orchard/1.10.x' into Laser/1.10.x

commit 578b21b75e
Merge: 395976f 3c53ffb
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Fri Nov 4 13:45:51 2016 +0100

    Merge branch 'feature/6688_RequestTokens_Chaintext' into Laser/1.10.x

commit 3c53ffb09a
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Fri Nov 4 13:43:38 2016 +0100

    - replaced Regex.Replace with String.Trim(char[]) as suggested
    - ran Orchard.Tokens.Tests: 66/66 passed

commit 395976fa60
Merge: 708ed79 a15557e
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Fri Oct 28 16:34:50 2016 +0200

    Merge branch 'Laser/1.10.x' of https://github.com/LaserSrl/Orchard into Laser/1.10.x

commit 708ed79ccb
Merge: 5fe0b69 68acf26
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Fri Oct 28 16:32:52 2016 +0200

    Merge branch '1.10.x' of https://github.com/LaserSrl/Orchard into Laser/1.10.x

commit 5fe0b69c6b
Merge: 0daad70 e3a7059
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Fri Oct 28 16:32:31 2016 +0200

    Merge branch 'feature/6196_SupportForAttachments' into Laser/1.10.x

commit e3a7059edf
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Fri Oct 28 15:22:48 2016 +0200

    - Addition of an existing png (OrchardLogo.png) as attachment within "Test Smtp Settings" Section, in order to demonstrate functionality of support for attachments in email

commit f095dea5e5
Merge: 7b09747 68acf26
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Fri Oct 28 12:37:55 2016 +0200

    Merge remote-tracking branch 'remotes/OrchardCMS.Orchard/1.10.x' into feature/6688_RequestTokens_Chaintext

commit a15557e5f3
Merge: 0daad70 ce8a61e
Author: matteo.piovanelli <matteo.piovanelli@laser-group.com>
Date:   Thu Oct 27 17:10:53 2016 +0200

    Merge branch 'issues/7346_WidgetsViewQueryString' into Laser/1.10.x

commit 0daad70219
Merge: 927d18b 7b09747
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Thu Oct 27 09:07:58 2016 +0200

    Merge remote-tracking branch 'remotes/Laser.Orchard/feature/6688_RequestTokens_Chaintext' into 1.10.x

commit 7b09747fc9
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Thu Oct 27 09:05:17 2016 +0200

    inserted a better explanation on how to use the chains

commit 927d18b1c2
Merge: f8cbc63 17ebdd2
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Wed Oct 26 19:00:44 2016 +0200

    Merge remote-tracking branch 'remotes/Laser.Orchard/feature/6688_RequestTokens_Chaintext' into 1.10.x

commit 17ebdd2bfc
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Wed Oct 26 18:57:48 2016 +0200

    - typo

commit f8cbc63fc0
Merge: 9f42664 1b511b2
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Wed Oct 26 18:53:11 2016 +0200

    Merge branch 'feature/6688_RequestTokens_Chaintext' into 1.10.x

commit 1b511b2692
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Wed Oct 26 18:50:35 2016 +0200

    - Implement what described in #6688

    Supported Syntaxes for Request and Form tokens are:
    1. QueryString:(param1) or Form:(param1)
    2. QueryString:param1 or Form:param1
    3. QueryString:(param1).SomeOtherTextToken or Form:(param1).SomeOtherTextToken

    If you want to Chain TextTokens you have to use the 3rd syntax
    the element (here param1) has been surrounded with brackets in order to preserve backward compatibility.

commit ce8a61ed86
Author: matteo.piovanelli <matteo.piovanelli@laser-group.com>
Date:   Wed Oct 26 11:46:24 2016 +0200

    Fixes #7346

commit 9f4266401a
Merge: 60aa1cc f6cfe32
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Tue Oct 25 09:20:57 2016 +0200

    Merge branch '1.10.x' of https://github.com/LaserSrl/Orchard into 1.10.x

commit 60aa1cc2f4
Merge: c1b1c4d 7a16cf5
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Tue Oct 25 09:20:28 2016 +0200

    Merge branch '1.10.x' of https://github.com/OrchardCMS/Orchard into 1.10.x

commit c1b1c4dc06
Merge: bf2201c e50bd60
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Tue Oct 25 09:19:54 2016 +0200

    Merge remote-tracking branch 'remotes/Laser.Orchard/feature/6196_SupportForAttachments' into 1.10.x

commit e50bd607b7
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Tue Oct 25 09:18:24 2016 +0200

    - Formatted Code (Rebracer)

commit f6cfe324b1
Merge: 7a16cf5 bf2201c
Author: matteo.piovanelli <matteo.piovanelli@laser-group.com>
Date:   Mon Oct 24 09:24:57 2016 +0200

    Merge remote-tracking branch 'remotes/Laser.Orchard/1.10.x' into 1.10.x
    Ho fatto pull della 1.10 remota di Orchard

commit bf2201c2a9
Merge: 67af300 580b79c
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Fri Oct 21 18:40:21 2016 +0200

    Merge branch 'feature/6196_SupportForAttachments' into 1.10.x

    # Conflicts:
    #	src/Orchard.Web/Modules/Orchard.Email/Services/SmtpMessageChannel.cs

commit 580b79c24d
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Fri Oct 21 11:46:08 2016 +0200

    - Added attachments logic

commit 67af300783
Merge: d4d4a32 a4c816b
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Fri Oct 21 11:56:13 2016 +0200

    Merge branch 'feature/6196_SupportForAttachments' into 1.10.x

commit a4c816b291
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Fri Oct 21 11:55:38 2016 +0200

    - missing Attachments Key fix

commit d4d4a322bc
Merge: 297e586 2bb81ee
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Fri Oct 21 11:46:40 2016 +0200

    Merge branch 'feature/6196_SupportForAttachments' into 1.10.x

commit 2bb81eef31
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Fri Oct 21 11:46:08 2016 +0200

    - Added attachments logic

commit 297e586a19
Merge: 54a1bdf 548b5d7
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Fri Oct 21 09:39:11 2016 +0200

    Merge branch 'feature/5790_partecipate_in_cache_key_generation' into 1.10.x

commit 548b5d7d8f
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Fri Oct 21 09:37:07 2016 +0200

    - Method renamed
    - try catch removed

commit 54a1bdf03a
Merge: b7ee130 794b9b0
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Wed Oct 19 17:51:29 2016 +0200

    Merge remote-tracking branch 'remotes/Laser.Orchard/feature/5790_partecipate_in_cache_key_generation' into 1.10.x

commit 794b9b0252
Merge: 1dcee8a 350cbbd
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Wed Oct 19 17:44:35 2016 +0200

    Merge branch 'feature/5790_partecipate_in_cache_key_generation' of https://github.com/LaserSrl/Orchard into feature/5790_partecipate_in_cache_key_generation

commit 1dcee8aae8
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Wed Oct 19 16:30:12 2016 +0200

    - typo chaching > caching

    - added EventHandler in order to partecipate in cachekey generation

commit 350cbbd183
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Wed Oct 19 17:40:58 2016 +0200

    - typo chaching > caching

commit b7ee130847
Merge: c9e14f9 58e59e2
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Wed Oct 19 16:32:13 2016 +0200

    Merge remote-tracking branch 'remotes/Laser.Orchard/feature/5790_partecipate_in_cache_key_generation' into 1.10.x

commit 58e59e2fca
Author: HermesSbicego-Laser <hermes.sbicego@laser-group.com>
Date:   Wed Oct 19 16:30:12 2016 +0200

    - added EventHandler in order to partecipate in cachekey generation

commit c9e14f9b82
Author: matteo.piovanelli <matteo.piovanelli@laser-group.com>
Date:   Mon Oct 17 12:54:53 2016 +0200

    Modified the OutputCache Module based on the enhancement proposed in Issue 5811,
    by adding a VaryByRequestCookies property to the CacheSettingsPart to enable the generation of the Cache Key based on cookies

* Changed the view as reccomended by @sebastienros in his comments

* Added culture information to the contentpickerfield editor view

* Fixed a bug in the handler (!= instead of ==)

* showing displaytext in warnings and notifications rather than content item's id

* Cleanup. I
ContentPickerFieldLocalizationDriver Editor methods are executed correctly on validation errors, so they load the additional javascript correctly
2016-11-17 12:47:58 -08:00
Thierry Fleury
1254a11b8d Sort Taxonomies Terms failed
Fixes #6795
2016-11-17 12:47:15 -08:00
hacko-bede
203fd95079 Delete scheduled task when content is published
Fixes #6840
2016-11-17 12:37:55 -08:00
Marek Dzikiewicz
fab73d7157 LocalizationStreamParser should not fail on faulty PO files
Closes #7387
2016-11-14 10:56:47 -08:00
Lombiq
c48635540b Adding import/export for the RenderingMode property of ShapePart 2016-11-07 22:24:43 +01:00
Lombiq
8f2411dbf9 Adding the ability to select whether a Template (content item) will be rendered on the frontend, admin, or both. Fixes #5579. 2016-11-07 21:41:43 +01:00
Another Developer
68acf2694d Fix Event Bus for null exception (#7360)
EventsInterceptor fails when it tries to locate a generic method on an implementation with a return type. A null check has been added to avoid the exception.

Fixes #4718 
Dixes #4584
2016-10-27 14:56:27 -07:00
jtkech
b160dc731d Allow the initial value of some fields to be tokenized (#6613)
Fixes #6613 
Fixes #6237
2016-10-27 13:15:47 -07:00
jtkech
d59f5b511b Update Module.txt (#6945) 2016-10-27 13:09:34 -07:00
Matteo Piovanelli
85326ead8c [Fixes #7346] Allowing cultures and layers to be selected in Widgets
Fixes #7346
2016-10-27 12:40:14 -07:00
Matthew Harris
d91aa41be3 [Fixes #7339] Orchard.Widgets - Refactor #7251 (#7342)
Fixes #7339
2016-10-27 12:24:30 -07:00
441 changed files with 3495 additions and 1348 deletions

View File

@@ -1,22 +1,18 @@
for /f "usebackq tokens=*" %%i in (`lib\vswhere\vswhere -latest -version "[15.0,16.0)" -requires Microsoft.Component.MSBuild -property installationPath`) do (
set InstallDir=%%i
)
FOR %%b in (
"%VS140COMNTOOLS%..\..\VC\vcvarsall.bat"
"%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
"%ProgramFiles%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
"%VS120COMNTOOLS%..\..\VC\vcvarsall.bat"
"%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
"%ProgramFiles%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
"%VS110COMNTOOLS%..\..\VC\vcvarsall.bat"
"%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"
"%ProgramFiles%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"
"%InstallDir%\Common7\Tools\VsMSBuildCmd.bat"
"%VS140COMNTOOLS%\Common7\Tools\vsvars32.bat"
) do (
if exist %%b (
call %%b x86
call %%b
goto build
)
)
echo "Unable to detect suitable environment. Build may not succeed."
:build

View File

@@ -167,11 +167,12 @@
</Target>
<Target Name="Spec" DependsOnTargets="Package-Stage">
<CreateItem Include="$(CompileFolder)\*.Specs.dll">
<!-- Running SpecFlow tests -->
<CreateItem Include="$(CompileFolder)\*.Specs.*dll">
<Output TaskParameter="Include" ItemName="SpecAssemblies" />
</CreateItem>
<NUnit Assemblies="@(SpecAssemblies)" ToolPath="$(NUnitPackageToolsFolder)" />
<NUnit Assemblies="@(SpecAssemblies)" ToolPath="@(NUnitPackageToolsFolder)" WorkingDirectory="$(CompileFolder)" OutputXmlFile="$(BuildFolder)\Orchard.Specs.xml" />
</Target>
<!-- Packaging (Stage) -->

View File

@@ -22,7 +22,7 @@ Our mission is to empower our users and foster a dedicated and diverse community
## Project Status
Orchard is currently in version **[1.10.1](https://github.com/OrchardCMS/Orchard/releases/tag/1.10.1)**: It contains bugfixes and the more impactful changes and new features added in the latest major version (*1.10*).
Orchard is currently in version **[1.10.2](https://github.com/OrchardCMS/Orchard/releases/tag/1.10.2)**: It contains bugfixes and the more impactful changes and new features added in the latest major version (*1.10*).
We invite participation by the developer community in shaping the projects direction, so that we can publicly validate our designs and development approach.
All our releases are available on our [Releases](https://github.com/OrchardCMS/Orchard/releases) page, and it's easy to [Install Orchard using the Web Platform Installer](http://docs.orchardproject.net/Documentation/Installing-Orchard) as well. We encourage interested developers to check out the source code on the Orchard GitHub site and get involved with the project.

BIN
lib/vswhere/vswhere.exe Normal file

Binary file not shown.

View File

@@ -42,6 +42,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -51,6 +52,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<LangVersion>5</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

View File

@@ -36,6 +36,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -47,6 +48,7 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">

View File

@@ -44,6 +44,7 @@
<CodeAnalysisRuleSet>..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -55,6 +56,7 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">

View File

@@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10.2")]
[assembly: AssemblyFileVersion("1.10.2")]

View File

@@ -44,6 +44,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -54,6 +55,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">

View File

@@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10.2")]
[assembly: AssemblyFileVersion("1.10.2")]

View File

@@ -44,6 +44,7 @@
<CodeAnalysisRuleSet>..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -55,6 +56,7 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">

View File

@@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10.2")]
[assembly: AssemblyFileVersion("1.10.2")]

View File

@@ -14,7 +14,6 @@ using Orchard.ContentManagement.MetaData.Builders;
using Orchard.ContentManagement.Records;
using Orchard.Core.Common.Handlers;
using Orchard.Core.Common.Models;
using Orchard.Data;
using Orchard.Environment;
using Orchard.Environment.Configuration;
using Orchard.Environment.Extensions;
@@ -69,6 +68,7 @@ namespace Orchard.Tests.Modules.Indexing {
builder.RegisterType<IndexingTaskManager>().As<IIndexingTaskManager>();
builder.RegisterType<DefaultContentManager>().As<IContentManager>();
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
builder.RegisterType<StubWorkContextAccessor>().As<IWorkContextAccessor>();
builder.RegisterType<Signals>().As<ISignals>();
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterInstance(_contentDefinitionManager.Object);

View File

@@ -9,6 +9,7 @@ using Orchard.Environment.Configuration;
using Orchard.FileSystems.AppData;
using Orchard.Indexing;
using Orchard.Tests.FileSystems.AppData;
using Orchard.Tests.Stubs;
namespace Orchard.Tests.Modules.Indexing {
public class LuceneIndexProviderTests {
@@ -35,6 +36,7 @@ namespace Orchard.Tests.Modules.Indexing {
_appDataFolder = AppDataFolderTests.CreateAppDataFolder(_basePath);
var builder = new ContainerBuilder();
builder.RegisterType<StubWorkContextAccessor>().As<IWorkContextAccessor>();
builder.RegisterType<DefaultLuceneAnalyzerProvider>().As<ILuceneAnalyzerProvider>();
builder.RegisterType<DefaultLuceneAnalyzerSelector>().As<ILuceneAnalyzerSelector>();
builder.RegisterType<LuceneIndexProvider>().As<IIndexProvider>();

View File

@@ -8,6 +8,7 @@ using Orchard.Environment.Configuration;
using Orchard.FileSystems.AppData;
using Orchard.Indexing;
using Orchard.Tests.FileSystems.AppData;
using Orchard.Tests.Stubs;
namespace Orchard.Tests.Modules.Indexing {
public class LuceneSearchBuilderTests {
@@ -34,6 +35,7 @@ namespace Orchard.Tests.Modules.Indexing {
_appDataFolder = AppDataFolderTests.CreateAppDataFolder(_basePath);
var builder = new ContainerBuilder();
builder.RegisterType<StubWorkContextAccessor>().As<IWorkContextAccessor>();
builder.RegisterType<DefaultLuceneAnalyzerProvider>().As<ILuceneAnalyzerProvider>();
builder.RegisterType<DefaultLuceneAnalyzerSelector>().As<ILuceneAnalyzerSelector>();
builder.RegisterType<LuceneIndexProvider>().As<IIndexProvider>();

View File

@@ -44,6 +44,7 @@
<CodeAnalysisRuleSet>..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -55,6 +56,7 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">

View File

@@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10.2")]
[assembly: AssemblyFileVersion("1.10.2")]

View File

@@ -17,8 +17,9 @@ namespace Orchard.Tests.Modules.Recipes.RecipeHandlers {
builder.RegisterType<RecipeExecutionLogger>().AsSelf();
builder.RegisterType<StubRecipeExecutionStep>().As<IRecipeExecutionStep>().AsSelf().SingleInstance();
builder.RegisterType<RecipeExecutionStepHandler>().SingleInstance();
builder.RegisterType<RecipeExecutionStepResolver>().As<IRecipeExecutionStepResolver>().SingleInstance();
_container = builder.Build();
_container = builder.Build();
}
[Test]

View File

@@ -205,7 +205,8 @@ namespace Orchard.Tests.Modules.Users.Controllers {
@"Ima.Fool@example.com",
@"""Ima.Fool""@example.com",
@"""Ima Fool""@example.com",
"2xxx1414@i.ua"
"2xxx1414@i.ua",
"Dreißig-öffentliche-Ämter-in-Übersee@Beispiel.de"
)]
string email)
{

View File

@@ -39,5 +39,21 @@ namespace Orchard.Tests.Localization {
Assert.AreEqual("Foo \"{0}\"", translations["~/themes/mytheme/views/myview.cshtml|foo \"{0}\""]);
}
[Test]
public void ShouldHandleUnclosedQuote() {
var parser = new LocalizationStreamParser();
var text = new StringBuilder();
text.AppendLine("#: ~/Themes/MyTheme/Views/MyView.cshtml");
text.AppendLine("msgctxt \"");
text.AppendLine("msgid \"Foo \\\"{0}\\\"\"");
text.AppendLine("msgstr \"Foo \\\"{0}\\\"\"");
var translations = new Dictionary<string, string>();
parser.ParseLocalizationStream(text.ToString(), translations, false);
Assert.AreEqual("Foo \"{0}\"", translations["|foo \"{0}\""]);
}
}
}

View File

@@ -44,6 +44,7 @@
<CodeAnalysisRuleSet>..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -55,6 +56,7 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">

View File

@@ -33,5 +33,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10.2")]
[assembly: AssemblyFileVersion("1.10.2")]

View File

@@ -6,7 +6,7 @@ using Orchard.Utility.Extensions;
namespace Orchard.Tests.Utility.Extensions {
[TestFixture]
public class HttpRequestExtensionsTests {
[Test]
public void IsLocalUrlShouldReturnFalseWhenUrlIsNullOrEmpty() {
var request = new StubHttpRequest();
@@ -21,6 +21,7 @@ namespace Orchard.Tests.Utility.Extensions {
var request = new StubHttpRequest();
Assert.That(request.IsLocalUrl("//"), Is.False);
Assert.That(request.IsLocalUrl(" //"), Is.False);
}
[Test]
@@ -28,6 +29,7 @@ namespace Orchard.Tests.Utility.Extensions {
var request = new StubHttpRequest();
Assert.That(request.IsLocalUrl("/\\"), Is.False);
Assert.That(request.IsLocalUrl(" /\\"), Is.False);
}
[Test]
@@ -35,6 +37,7 @@ namespace Orchard.Tests.Utility.Extensions {
var request = new StubHttpRequest();
Assert.That(request.IsLocalUrl("/"), Is.True);
Assert.That(request.IsLocalUrl("\t/"), Is.True);
Assert.That(request.IsLocalUrl("/контакты"), Is.True);
Assert.That(request.IsLocalUrl("/ "), Is.True);
Assert.That(request.IsLocalUrl("/abc-def"), Is.True);
@@ -46,6 +49,18 @@ namespace Orchard.Tests.Utility.Extensions {
request.Headers.Add("Host", "localhost");
Assert.That(request.IsLocalUrl("http://localhost"), Is.True);
Assert.That(request.IsLocalUrl("https://localhost"), Is.True);
}
[Test]
public void IsLocalUrlShouldReturnFalseForNonHttpSchemes() {
var request = new StubHttpRequest();
request.Headers.Add("Host", "localhost");
Assert.That(request.IsLocalUrl("httpx://localhost"), Is.False);
Assert.That(request.IsLocalUrl("foo://localhost"), Is.False);
Assert.That(request.IsLocalUrl("data://localhost"), Is.False);
Assert.That(request.IsLocalUrl("mailto://localhost"), Is.False);
}
[Test]

View File

@@ -23,6 +23,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
<UseVSHostingProcess>false</UseVSHostingProcess>
<CodeAnalysisRuleSet>..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
@@ -34,6 +35,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />

View File

@@ -32,8 +32,8 @@ using System.Security;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10.2")]
[assembly: AssemblyFileVersion("1.10.2")]
// Enable web application to call this assembly in Full Trust
[assembly: AllowPartiallyTrustedCallers]

View File

@@ -44,6 +44,7 @@
<CodeAnalysisRuleSet>..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -54,6 +55,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">

View File

@@ -33,5 +33,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10.2")]
[assembly: AssemblyFileVersion("1.10.2")]

View File

@@ -26,8 +26,8 @@
-->
<!--
<component instance-scope="per-lifetime-scope"
type="Orchard.Data.SessionLocator, Orchard.Framework"
service="Orchard.Data.ISessionLocator">
type="Orchard.Data.TransactionManager, Orchard.Framework"
service="Orchard.Data.ITransactionManager">
<properties>
<property name="IsolationLevel" value="ReadUncommitted" />
</properties>

View File

@@ -46,7 +46,7 @@ namespace Orchard.Core.Common.Drivers {
return ContentShape("Fields_Common_Text_Edit", GetDifferentiator(field, part),
() => {
var settings = field.PartFieldDefinition.Settings.GetModel<TextFieldSettings>();
var text = part.IsNew() ? settings.DefaultValue : field.Value;
var text = part.IsNew() && String.IsNullOrEmpty(field.Value) ? settings.DefaultValue : field.Value;
var viewModel = new TextFieldDriverViewModel {
Field = field,
@@ -84,8 +84,7 @@ namespace Orchard.Core.Common.Drivers {
}
protected override void Exporting(ContentPart part, TextField field, ExportContentContext context) {
if (!String.IsNullOrEmpty(field.Value))
context.Element(field.FieldDefinition.Name + "." + field.Name).SetAttributeValue("Text", field.Value);
context.Element(field.FieldDefinition.Name + "." + field.Name).SetAttributeValue("Text", field.Value);
}
protected override void Describe(DescribeMembersContext context) {

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: The common module introduces content parts that are going to be used by most content types (common, body, identity).
FeatureDescription: Core content parts.

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: The containers module introduces container and containable behaviors for content items.
FeatureDescription: Container and containable parts to enable parent-child relationships between content items.

View File

@@ -3,16 +3,19 @@ using Orchard.ContentManagement;
using Orchard.ContentManagement.MetaData;
using Orchard.Core.Contents.Settings;
using Orchard.Localization;
using Orchard.Security;
using Orchard.UI.Navigation;
namespace Orchard.Core.Contents {
public class AdminMenu : INavigationProvider {
private readonly IContentDefinitionManager _contentDefinitionManager;
private readonly IContentManager _contentManager;
private readonly IAuthorizer _authorizer;
public AdminMenu(IContentDefinitionManager contentDefinitionManager, IContentManager contentManager) {
public AdminMenu(IContentDefinitionManager contentDefinitionManager, IContentManager contentManager, IAuthorizer authorizer) {
_contentDefinitionManager = contentDefinitionManager;
_contentManager = contentManager;
_authorizer = authorizer;
}
public Localizer T { get; set; }
@@ -20,10 +23,17 @@ namespace Orchard.Core.Contents {
public void GetNavigation(NavigationBuilder builder) {
var contentTypeDefinitions = _contentDefinitionManager.ListTypeDefinitions().OrderBy(d => d.Name);
builder.AddImageSet("content")
.Add(T("Content"), "1.4", menu => menu
.Permission(Permissions.EditOwnContent)
.Add(T("Content Items"), "1", item => item.Action("List", "Admin", new { area = "Contents", id = "" }).LocalNav()));
var listableContentTypes = contentTypeDefinitions.Where(ctd => ctd.Settings.GetModel<ContentTypeSettings>().Listable);
ContentItem listableCi = null;
foreach(var contentTypeDefinition in listableContentTypes) {
listableCi = _contentManager.New(contentTypeDefinition.Name);
if(_authorizer.Authorize(Permissions.EditContent, listableCi)) {
builder.AddImageSet("content")
.Add(T("Content"), "1.4", menu => menu
.Add(T("Content Items"), "1", item => item.Action("List", "Admin", new { area = "Contents", id = "" }).LocalNav()));
break;
}
}
var contentTypes = contentTypeDefinitions.Where(ctd => ctd.Settings.GetModel<ContentTypeSettings>().Creatable).OrderBy(ctd => ctd.DisplayName);
if (contentTypes.Any()) {
builder.Add(T("New"), "-1", menu => {

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: The contents module enables the creation of custom content types.
Features:

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: The dashboard module is providing the dashboard screen of the admininstration UI of the application.
FeatureDescription: Standard admin dashboard.

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: The Feeds module is providing RSS feeds to content items.
FeatureDescription: RSS feeds for content items.

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: The navigation module creates and manages a simple navigation menu for the front-end of the application and allows you to add content items to the admin menu.
FeatureDescription: Menu management.

View File

@@ -37,6 +37,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -48,6 +49,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
@@ -397,7 +399,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
<Folder Include="Views\Gamma\" />
</ItemGroup>
<ItemGroup>
<Content Include="Contents\Views\Content.cshtml" />

View File

@@ -30,6 +30,6 @@ using System.Security;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10.2")]
[assembly: AssemblyFileVersion("1.10.2")]

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: The dashboard module is providing the reports screen of the application.
FeatureDescription: Reports management.

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: The scheduling module enables background task scheduling.
FeatureDescription: Scheduled background tasks.

View File

@@ -189,7 +189,7 @@ namespace Orchard.Core.Settings.Metadata {
private void Apply(ContentTypeDefinition model, ContentTypeDefinitionRecord record) {
record.DisplayName = model.DisplayName;
record.Settings = _settingsFormatter.Map(model.Settings).ToString();
record.Settings = Compose(_settingsFormatter.Map(model.Settings));
var toRemove = record.ContentTypePartDefinitionRecords
.Where(partDefinitionRecord => model.Parts.All(part => partDefinitionRecord.ContentPartDefinitionRecord.Name != part.PartDefinition.Name))
@@ -215,7 +215,7 @@ namespace Orchard.Core.Settings.Metadata {
}
private void Apply(ContentPartDefinition model, ContentPartDefinitionRecord record) {
record.Settings = _settingsFormatter.Map(model.Settings).ToString();
record.Settings = Compose(_settingsFormatter.Map(model.Settings));
var toRemove = record.ContentPartFieldDefinitionRecords
.Where(partFieldDefinitionRecord => model.Fields.All(partField => partFieldDefinitionRecord.Name != partField.Name))

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: The settings module creates site settings that other modules can contribute to.
FeatureDescription: Site settings.

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: The shapes module contains core shape templates and display hooks.
FeatureDescription: Core shape templates and display hooks.

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: The title module enables content items to have titles.
FeatureDescription: Title content part.

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: The XmlRpc module enables creation of contents from client applications such as LiveWriter.
FeatureDescription: XML-RPC opt-in implementation.

View File

@@ -0,0 +1,69 @@
using Lucene.Models;
using Lucene.Services;
using Lucene.ViewModels;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers;
using Orchard.Indexing;
using Orchard.Localization;
using Orchard.UI.Notify;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
namespace Lucene.Drivers {
public class LuceneSettingsPartDriver : ContentPartDriver<LuceneSettingsPart> {
private readonly IIndexManager _indexManager;
private readonly IEnumerable<ILuceneAnalyzerSelector> _analyzerSelectors;
private readonly INotifier _notifier;
public Localizer T { get; set; }
public LuceneSettingsPartDriver(IIndexManager indexManager, IEnumerable<ILuceneAnalyzerSelector> analyzerSelectors, INotifier notifier) {
_indexManager = indexManager;
_analyzerSelectors = analyzerSelectors;
_notifier = notifier;
T = NullLocalizer.Instance;
}
protected override DriverResult Editor(LuceneSettingsPart part, dynamic shapeHelper) {
return ContentShape("Parts_LuceneSettings_Edit", () => {
MaintainMappings(part);
return shapeHelper.EditorTemplate(
TemplateName: "Parts.LuceneSettings",
Model: new LuceneSettingsPartEditViewModel {
LuceneAnalyzerSelectorMappings = part.LuceneAnalyzerSelectorMappings.ToArray(),
LuceneAnalyzerSelectors = _analyzerSelectors.Select(analyzerSelector =>
new SelectListItem { Text = T(analyzerSelector.Name).Text, Value = analyzerSelector.Name })
},
Prefix: Prefix);
});
}
protected override DriverResult Editor(LuceneSettingsPart part, IUpdateModel updater, dynamic shapeHelper) {
var viewModel = new LuceneSettingsPartEditViewModel();
if (updater.TryUpdateModel(viewModel, Prefix, null, null)) {
_notifier.Warning(T("Don't forget to rebuild your index in case you have changed its analyzer."));
part.LuceneAnalyzerSelectorMappings = viewModel.LuceneAnalyzerSelectorMappings;
MaintainMappings(part);
}
return Editor(part, shapeHelper);
}
private void MaintainMappings(LuceneSettingsPart part) {
var analyzerProviderNames = _analyzerSelectors.Select(analyzerProvider => analyzerProvider.Name);
var indexNames = _indexManager.GetSearchIndexProvider().List();
var maintainedMappings = part.LuceneAnalyzerSelectorMappings.ToList();
// Removing mappings which contain a removed/invalid index or analyzer provider.
maintainedMappings.RemoveAll(mapping => !indexNames.Contains(mapping.IndexName) || !analyzerProviderNames.Contains(mapping.AnalyzerName));
// Adding new mappings for the new indexes.
foreach (var indexName in indexNames) {
if (!maintainedMappings.Any(mapping => mapping.IndexName == indexName)) {
maintainedMappings.Add(new LuceneAnalyzerSelectorMapping { IndexName = indexName, AnalyzerName = "Default" });
}
}
part.LuceneAnalyzerSelectorMappings = maintainedMappings;
}
}
}

View File

@@ -0,0 +1,39 @@
using Lucene.Models;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Handlers;
using Orchard.Localization;
using Orchard.Services;
using System.Collections.Generic;
namespace Lucene.Handlers {
public class LuceneSettingsPartHandler : ContentHandler {
public Localizer T { get; set; }
public LuceneSettingsPartHandler(IJsonConverter jsonConverter) {
T = NullLocalizer.Instance;
Filters.Add(new ActivatingFilter<LuceneSettingsPart>("Site"));
OnActivated<LuceneSettingsPart>((context, part) => {
part.LuceneAnalyzerSelectorMappingsField.Loader(() => {
return string.IsNullOrEmpty(part.LuceneAnalyzerSelectorMappingsSerialized)
? new List<LuceneAnalyzerSelectorMapping>()
: jsonConverter.Deserialize<List<LuceneAnalyzerSelectorMapping>>(part.LuceneAnalyzerSelectorMappingsSerialized);
});
part.LuceneAnalyzerSelectorMappingsField.Setter((value) => {
part.LuceneAnalyzerSelectorMappingsSerialized = value == null ? "[]" : jsonConverter.Serialize(value);
return value;
});
});
}
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
if (context.ContentItem.ContentType != "Site") return;
base.GetItemMetadata(context);
context.Metadata.EditorGroupInfo.Add(new GroupInfo(T("Lucene Settings")) { Id = "LuceneSettings" });
}
}
}

View File

@@ -38,6 +38,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -47,6 +48,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
@@ -97,8 +99,12 @@
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="Drivers\LuceneSettingsPartDriver.cs" />
<Compile Include="Handlers\LuceneSettingsPartHandler.cs" />
<Compile Include="Models\LuceneAnalyzerSelectorMapping.cs" />
<Compile Include="Models\LuceneDocumentIndex.cs" />
<Compile Include="Models\LuceneSearchHit.cs" />
<Compile Include="Models\LuceneSettingsPart.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Services\DefaultLuceneAnalyzerSelector.cs" />
<Compile Include="Services\DefaultLuceneAnalyzerProvider.cs" />
@@ -108,6 +114,7 @@
<Compile Include="Services\LuceneIndexProvider.cs" />
<Compile Include="Services\LuceneSearchBuilder.cs" />
<Compile Include="Services\SearchBits.cs" />
<Compile Include="ViewModels\LuceneSettingsPartEditViewModel.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Module.txt" />
@@ -127,6 +134,13 @@
<ItemGroup>
<Content Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="Placement.info" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\EditorTemplates\Parts.LuceneSettings.cshtml" />
</ItemGroup>
<ItemGroup />
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>

View File

@@ -0,0 +1,6 @@
namespace Lucene.Models {
public class LuceneAnalyzerSelectorMapping {
public string IndexName { get; set; }
public string AnalyzerName { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
using Lucene.Models;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Utilities;
using System.Collections.Generic;
namespace Lucene.Models {
public class LuceneSettingsPart : ContentPart {
public string LuceneAnalyzerSelectorMappingsSerialized {
get { return this.Retrieve(x => x.LuceneAnalyzerSelectorMappingsSerialized); }
set { this.Store(x => x.LuceneAnalyzerSelectorMappingsSerialized, value); }
}
private readonly LazyField<IEnumerable<LuceneAnalyzerSelectorMapping>> _luceneAnalyzerSelectorMappings = new LazyField<IEnumerable<LuceneAnalyzerSelectorMapping>>();
internal LazyField<IEnumerable<LuceneAnalyzerSelectorMapping>> LuceneAnalyzerSelectorMappingsField { get { return _luceneAnalyzerSelectorMappings; }
}
public IEnumerable<LuceneAnalyzerSelectorMapping> LuceneAnalyzerSelectorMappings {
get { return _luceneAnalyzerSelectorMappings.Value; }
set { _luceneAnalyzerSelectorMappings.Value = value; }
}
}
}

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: The Lucene module enables the site to be indexed using Lucene.NET. The index generated by this module can then be used by the search module to provide an integrated full-text search experience to a web site.
FeatureDescription: Lucene indexing services.

View File

@@ -0,0 +1,5 @@
<Placement>
<Match ContentType="Site">
<Place Parts_LuceneSettings_Edit="Content: 1@LuceneSettings" />
</Match>
</Placement>

View File

@@ -30,6 +30,6 @@ using System.Security;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10.2")]
[assembly: AssemblyFileVersion("1.10.2")]

View File

@@ -1,34 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Lucene.Models;
using Lucene.Net.Analysis;
using Lucene.Net.Analysis.Standard;
using Orchard;
using Orchard.ContentManagement;
using System.Collections.Generic;
using System.Linq;
namespace Lucene.Services {
public class DefaultLuceneAnalyzerProvider : ILuceneAnalyzerProvider {
private readonly IWorkContextAccessor _wca;
private IEnumerable<ILuceneAnalyzerSelector> _analyzerSelectors;
public DefaultLuceneAnalyzerProvider(IEnumerable<ILuceneAnalyzerSelector> analyzerSelectors) {
public DefaultLuceneAnalyzerProvider(IEnumerable<ILuceneAnalyzerSelector> analyzerSelectors, IWorkContextAccessor wca) {
_analyzerSelectors = analyzerSelectors;
_wca = wca;
}
public Analyzer GetAnalyzer(string indexName) {
var luceneSettingsPart = _wca
.GetContext()
.CurrentSite
.As<LuceneSettingsPart>();
if (luceneSettingsPart == null) {
return new StandardAnalyzer(LuceneIndexProvider.LuceneVersion);
}
var currentIndexMapping = luceneSettingsPart
.LuceneAnalyzerSelectorMappings
.FirstOrDefault(mapping => mapping.IndexName == indexName);
if (currentIndexMapping == null) {
return new StandardAnalyzer(LuceneIndexProvider.LuceneVersion);
}
var analyzer = _analyzerSelectors
.Where(x => x.Name == currentIndexMapping.AnalyzerName)
.Select(x => x.GetLuceneAnalyzer(indexName))
.Where(x => x != null)
.OrderByDescending(x => x.Priority)
.Select(x => x.Analyzer)
.FirstOrDefault();
if (analyzer != null) {
return analyzer;
}
return new StandardAnalyzer(LuceneIndexProvider.LuceneVersion);
return analyzer != null ? analyzer : new StandardAnalyzer(LuceneIndexProvider.LuceneVersion);
}
}
}

View File

@@ -12,5 +12,7 @@ namespace Lucene.Services {
Analyzer = new StandardAnalyzer(LuceneIndexProvider.LuceneVersion)
};
}
public string Name { get { return "Default"; } }
}
}

View File

@@ -1,11 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Orchard;
using Orchard;
namespace Lucene.Services {
public interface ILuceneAnalyzerSelector : IDependency {
LuceneAnalyzerSelectorResult GetLuceneAnalyzer(string indexName);
string Name { get; }
}
}

View File

@@ -0,0 +1,14 @@
using Lucene.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Lucene.ViewModels {
public class LuceneSettingsPartEditViewModel {
public LuceneAnalyzerSelectorMapping[] LuceneAnalyzerSelectorMappings { get; set; }
public IEnumerable<SelectListItem> LuceneAnalyzerSelectors { get; set; }
}
}

View File

@@ -0,0 +1,26 @@
@model Lucene.ViewModels.LuceneSettingsPartEditViewModel
@using System.Linq
<fieldset>
<legend>@T("Lucene Settings")</legend>
@if (!Model.LuceneAnalyzerSelectorMappings.Any()) {
@T("There is currently no mapping. Create an index first.")
}
else {
<ul>
@for (int i = 0; i < Model.LuceneAnalyzerSelectorMappings.Length; i++) {
<li>
@Html.HiddenFor(m => Model.LuceneAnalyzerSelectorMappings[i].IndexName)
@Html.LabelFor(m => Model.LuceneAnalyzerSelectorMappings[i].AnalyzerName, T("Analyzer name for the \"{0}\" index", Model.LuceneAnalyzerSelectorMappings[i].IndexName))
@Html.DropDownListFor(m => Model.LuceneAnalyzerSelectorMappings[i].AnalyzerName, new SelectList(
Model.LuceneAnalyzerSelectors,
"Text",
"Value",
Model.LuceneAnalyzerSelectorMappings[i].AnalyzerName
))
</li>
}
</ul>
}
</fieldset>

View File

@@ -37,6 +37,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -47,6 +48,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="MarkdownSharp, Version=1.5.1.0, Culture=neutral, processorArchitecture=MSIL">

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: The Markdown module enables rich text contents to be created using the Markdown syntax.
FeatureDescription: Markdown editor.

View File

@@ -26,6 +26,6 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10.2")]
[assembly: AssemblyFileVersion("1.10.2")]

View File

@@ -3,14 +3,26 @@ using System.Collections.Generic;
using System.Linq;
using System.Collections.Concurrent;
using Orchard.Alias.Implementation.Map;
using Orchard.Alias.Implementation.Updater;
namespace Orchard.Alias.Implementation.Holder {
public class AliasHolder : IAliasHolder {
public AliasHolder() {
private readonly Lazy<IAliasHolderUpdater> _aliasHolderUpdater;
private readonly ConcurrentDictionary<string, AliasMap> _aliasMaps;
public AliasHolder(Lazy<IAliasHolderUpdater> aliasHolderUpdater) {
_aliasHolderUpdater = aliasHolderUpdater;
_aliasMaps = new ConcurrentDictionary<string, AliasMap>(StringComparer.OrdinalIgnoreCase);
}
private readonly ConcurrentDictionary<string, AliasMap> _aliasMaps;
private ConcurrentDictionary<string, AliasMap> GetOrRefreshAliasMaps() {
lock (_aliasMaps) {
if (_aliasMaps.Count == 0)
_aliasHolderUpdater.Value.Refresh();
}
return _aliasMaps;
}
public void SetAliases(IEnumerable<AliasInfo> aliases) {
var grouped = aliases.GroupBy(alias => alias.Area ?? String.Empty, StringComparer.InvariantCultureIgnoreCase);
@@ -25,7 +37,7 @@ namespace Orchard.Alias.Implementation.Holder {
}
public void SetAlias(AliasInfo alias) {
foreach (var map in _aliasMaps.Values) {
foreach (var map in GetOrRefreshAliasMaps().Values) {
map.Remove(alias);
}
@@ -33,11 +45,11 @@ namespace Orchard.Alias.Implementation.Holder {
}
public IEnumerable<AliasMap> GetMaps() {
return _aliasMaps.Values;
return GetOrRefreshAliasMaps().Values;
}
public AliasMap GetMap(string areaName) {
return _aliasMaps.GetOrAdd(areaName ?? String.Empty, key => new AliasMap(key));
return GetOrRefreshAliasMaps().GetOrAdd(areaName ?? String.Empty, key => new AliasMap(key));
}
public void RemoveAlias(AliasInfo aliasInfo) {

View File

@@ -2,7 +2,7 @@ Name: Alias
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: Maps friendly urls to specific module actions.
FeatureDescription: Maps friendly urls to specific module actions.

View File

@@ -37,6 +37,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -47,6 +48,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />

View File

@@ -30,6 +30,6 @@ using System.Security;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10.2")]
[assembly: AssemblyFileVersion("1.10.2")]

View File

@@ -44,7 +44,6 @@
<tr>
<th scope="col">@T("Alias")</th>
<th scope="col">@T("Route")</th>
<th scope="col">&nbsp;</th>
</tr>
</thead>
@foreach (var aliasEntry in Model.AliasEntries) {

View File

@@ -2,7 +2,7 @@ Name: AntiSpam
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: Provides anti-spam services to protect your content from malicious submissions.
Features:

View File

@@ -37,6 +37,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -47,6 +48,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />

View File

@@ -29,6 +29,6 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10.2")]
[assembly: AssemblyFileVersion("1.10.2")]

View File

@@ -3,7 +3,7 @@ Path: ArchiveLater
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: The ArchiveLater module introduces scheduled archiving functionality.
FeatureDescription: Scheduled archiving.

View File

@@ -38,6 +38,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -47,6 +48,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />

View File

@@ -30,6 +30,6 @@ using System.Security;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10.2")]
[assembly: AssemblyFileVersion("1.10.2")]

View File

@@ -2,21 +2,63 @@
using Orchard.Data.Conventions;
namespace Orchard.AuditTrail.Models {
/// <summary>
/// Audit Trail Event Record in the database.
/// </summary>
public class AuditTrailEventRecord {
public virtual int Id { get; set; }
/// <summary>
/// The time when the event occurred.
/// </summary>
public virtual DateTime CreatedUtc { get; set; }
/// <summary>
/// The user name of the user who caused the event to occur.
/// </summary>
public virtual string UserName { get; set; }
/// <summary>
/// The name of the event.
/// </summary>
public virtual string EventName { get; set; }
/// <summary>
/// The full name of the event.
/// </summary>
public virtual string FullEventName { get; set; }
/// <summary>
/// The category the event belongs to.
/// </summary>
public virtual string Category { get; set; }
/// <summary>
/// The data of the event.
/// </summary>
[StringLengthMax]
public virtual string EventData { get; set; }
/// <summary>
/// The filter key of the event.
/// </summary>
public virtual string EventFilterKey { get; set; }
/// <summary>
/// The filter data of the event.
/// </summary>
public virtual string EventFilterData { get; set; }
/// <summary>
/// The comment of the event.
/// </summary>
[StringLengthMax]
public virtual string Comment { get; set; }
/// <summary>
/// The IP address of the user who caused the event to occur.
/// </summary>
public virtual string ClientIpAddress { get; set; }
}
}

View File

@@ -1,6 +1,18 @@
namespace Orchard.AuditTrail.Models {
/// <summary>
/// The created audit trail event result
/// </summary>
public class AuditTrailEventRecordResult {
/// <summary>
/// The created <see cref="AuditTrailEventRecord"/>
/// </summary>
public AuditTrailEventRecord Record { get; set; }
/// <summary>
/// Determines whether AuditTrailEventRecordResult is disabled for <see cref="AuditTrailEventRecord"/> .
/// </summary>
public bool IsDisabled { get; set; }
}
}

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: Provides a log for recording and viewing back-end changes.
Features:

View File

@@ -36,6 +36,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -46,6 +47,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Iesi.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">

View File

@@ -32,6 +32,6 @@ using System.Security;
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10.2")]
[assembly: AssemblyFileVersion("1.10.2")]

View File

@@ -16,6 +16,10 @@ using Orchard.Services;
using Orchard.Settings;
namespace Orchard.AuditTrail.Services {
/// <summary>
/// Manage the audit trail.
/// </summary>
public class AuditTrailManager : Component, IAuditTrailManager {
private readonly IRepository<AuditTrailEventRecord> _auditTrailRepository;
private readonly IAuditTrailEventProvider _providers;
@@ -52,6 +56,14 @@ namespace Orchard.AuditTrail.Services {
_clientHostAddressAccessor = clientHostAddressAccessor;
}
/// <summary>
/// Gets a page of event records from the audit trail.
/// </summary>
/// <param name="page">The page number to get records from.</param>
/// <param name="pageSize">The number of records to get.</param>
/// <param name="orderBy">The value to order by.</param>
/// <param name="filters">Optional. An object to filter the records on.</param>
/// <returns>A page of event records.</returns>
public IPageOfItems<AuditTrailEventRecord> GetRecords(
int page,
int pageSize,
@@ -102,10 +114,20 @@ namespace Orchard.AuditTrail.Services {
};
}
/// <summary>
/// Gets a single event record from the audit trail by ID.
/// </summary>
/// <param name="id">The event record ID.</param>
/// <returns>A single event record.</returns>
public AuditTrailEventRecord GetRecord(int id) {
return _auditTrailRepository.Get(id);
}
/// <summary>
/// Builds a shape tree of filter displays.
/// </summary>
/// <param name="filters">Input for each filter builder.</param>
/// <returns>A tree of shapes.</returns>
public dynamic BuildFilterDisplay(Filters filters) {
var filterDisplay = (dynamic)_shapeFactory.Create("AuditTrailFilter");
var filterDisplayContext = new DisplayFilterContext(_shapeFactory, filters, filterDisplay);
@@ -123,6 +145,17 @@ namespace Orchard.AuditTrail.Services {
return filterDisplay;
}
/// <summary>
/// Records an audit trail event.
/// </summary>
/// <typeparam name="T">The audit trail event provider type to determine the scope of the event name.</typeparam>
/// <param name="eventName">The shorthand name of the event</param>
/// <param name="user">The user to associate with the event. This is typically the currently loggedin user.</param>
/// <param name="properties">A property bag of custom event data that could be useful for <see cref="IAuditTrailEventHandler"/> implementations. These values aren't stored. Use the eventData parameter to persist additional data with the event.</param>
/// <param name="eventData">A property bag of custom event data that will be stored with the event record.</param>
/// <param name="eventFilterKey">The name of a custom key to use when filtering events.</param>
/// <param name="eventFilterData">The value of a custom filter key to filter on.</param>
/// <returns>The created audit trail event record if the specified event was not disabled.</returns>
public AuditTrailEventRecordResult CreateRecord<T>(string eventName, IUser user, IDictionary<string, object> properties = null, IDictionary<string, object> eventData = null, string eventFilterKey = null, string eventFilterData = null) where T : IAuditTrailEventProvider {
var eventDescriptor = DescribeEvent<T>(eventName);
if (!IsEventEnabled(eventDescriptor))
@@ -165,26 +198,49 @@ namespace Orchard.AuditTrail.Services {
};
}
/// <summary>
/// Describes all audit trail events provided by the system.
/// </summary>
/// <returns>A list of audit trail category descriptors.</returns>
public IEnumerable<AuditTrailCategoryDescriptor> DescribeCategories() {
var context = DescribeProviders();
return context.Describe();
}
/// <summary>
/// Describes all audit trail event providers.
/// </summary>
public DescribeContext DescribeProviders() {
var context = new DescribeContext();
_providers.Describe(context);
return context;
}
/// <summary>
/// Describes a single audit trail event.
/// </summary>
/// <param name="record">The audit trail event record for which to find its descriptor.</param>
/// <returns>A single audit trail event descriptor.</returns>
public AuditTrailEventDescriptor DescribeEvent(AuditTrailEventRecord record) {
return DescribeEvent(record.FullEventName) ?? AuditTrailEventDescriptor.Basic(record);
}
/// <summary>
/// Describes a single audit trail event.
/// </summary>
/// <typeparam name="T">The scope of the specified event name.</typeparam>
/// <param name="eventName">The shorthand name of the event.</param>
/// <returns>A single audit trail event descriptor.</returns>
public AuditTrailEventDescriptor DescribeEvent<T>(string eventName) where T : IAuditTrailEventProvider {
var fullyQualifiedEventName = EventNameExtensions.GetFullyQualifiedEventName<T>(eventName);
return DescribeEvent(fullyQualifiedEventName);
}
/// <summary>
/// Describes a single audit trail event.
/// </summary>
/// <param name="fullyQualifiedEventName">The fully qualified event name to describe.</param>
/// <returns>A single audit trail event descriptor.</returns>
public AuditTrailEventDescriptor DescribeEvent(string fullyQualifiedEventName) {
var categoryDescriptors = DescribeCategories();
var eventDescriptorQuery =

View File

@@ -5,7 +5,17 @@ using Newtonsoft.Json;
using Orchard.Logging;
namespace Orchard.AuditTrail.Services {
/// <summary>
/// A service responsible for serializing and deserializing audit trail event data.
/// </summary>
public class EventDataSerializer : Component, IEventDataSerializer {
/// <summary>
/// Serialize event data.
/// </summary>
/// <param name="eventData">eventData to be serialized.</param>
/// <returns>The serialized data.</returns>
public string Serialize(IDictionary<string, object> eventData) {
try {
var json = JsonConvert.SerializeObject(eventData, Formatting.None);
@@ -18,6 +28,11 @@ namespace Orchard.AuditTrail.Services {
return null;
}
/// <summary>
/// Deserialize event data.
/// </summary>
/// <param name="eventData">eventData to be deserialized.</param>
/// <returns>The deserialized generic dictionary</returns>
public IDictionary<string, object> Deserialize(string eventData) {
if (String.IsNullOrWhiteSpace(eventData))
return new Dictionary<string, object>();

View File

@@ -6,7 +6,12 @@ using Orchard.Collections;
using Orchard.Security;
namespace Orchard.AuditTrail.Services {
/// <summary>
/// Manage the audit trail.
/// </summary>
public interface IAuditTrailManager : IDependency {
/// <summary>
/// Gets a page of event records from the audit trail.
/// </summary>

View File

@@ -1,8 +1,24 @@
using System.Collections.Generic;
namespace Orchard.AuditTrail.Services {
/// <summary>
/// A service responsible for serializing and deserializing audit trail event data.
/// </summary>
public interface IEventDataSerializer : IDependency {
/// <summary>
/// Serialize event data.
/// </summary>
/// <param name="eventData">eventData to be serialized.</param>
/// <returns>The serialized data.</returns>
string Serialize(IDictionary<string, object> eventData);
/// <summary>
/// Deserialize event data.
/// </summary>
/// <param name="eventData">eventData to be deserialized.</param>
/// <returns>The deserialized generic dictionary</returns>
IDictionary<string, object> Deserialize(string eventData);
}
}

View File

@@ -1,10 +1,20 @@
using Orchard.ContentManagement.MetaData;
using System;
using System.Collections.Generic;
using System.Linq;
using Orchard.Autoroute.Models;
using Orchard.Autoroute.Settings;
using Orchard.ContentManagement.MetaData;
using Orchard.Core.Contents.Extensions;
using Orchard.Data.Migration;
using Orchard.Localization.Services;
namespace Orchard.Autoroute
{
public class Migrations : DataMigrationImpl {
namespace Orchard.Autoroute {
public class Migrations : DataMigrationImpl {
private readonly ICultureManager _cultureManager;
public Migrations(ICultureManager cultureManager) {
_cultureManager = cultureManager;
}
public int Create() {
SchemaBuilder.CreateTable("AutoroutePartRecord",
@@ -49,5 +59,46 @@ namespace Orchard.Autoroute
return 4;
}
public int UpdateFrom4() {
// Adding some culture neutral patterns if they don't exist
var autoroutePartDefinitions = ContentDefinitionManager.ListTypeDefinitions()
.Where(t => t.Parts.Any(p => p.PartDefinition.Name.Equals(typeof(AutoroutePart).Name)))
.Select(s => new { contentTypeName = s.Name, autoroutePart = s.Parts.First(x => x.PartDefinition.Name == "AutoroutePart") });
foreach (var partDefinition in autoroutePartDefinitions) {
var settingsDictionary = partDefinition.autoroutePart.Settings;
var settings = settingsDictionary.GetModel<AutorouteSettings>();
if (!settings.Patterns.Any(x => String.IsNullOrWhiteSpace(x.Culture))) {
string siteCulture = _cultureManager.GetSiteCulture();
List<string> newPatterns = new List<string>();
if (settings.Patterns.Any(x => String.Equals(x.Culture, siteCulture, StringComparison.OrdinalIgnoreCase))) {
var siteCulturePatterns = settings.Patterns.Where(x => String.Equals(x.Culture, siteCulture, StringComparison.OrdinalIgnoreCase)).ToList();
foreach (RoutePattern pattern in siteCulturePatterns) {
newPatterns.Add(String.Format("{{\"Name\":\"{0}\",\"Pattern\":\"{1}\",\"Description\":\"{2}\"}}", pattern.Name, pattern.Pattern, pattern.Description));
}
}
else {
newPatterns.Add(String.Format("{{\"Name\":\"{0}\",\"Pattern\":\"{1}\",\"Description\":\"{2}\"}}", "Title", "{Content.Slug}", "my-title"));
}
if (settingsDictionary.ContainsKey("AutorouteSettings.PatternDefinitions")) {
string oldPatterns = settingsDictionary["AutorouteSettings.PatternDefinitions"];
if (oldPatterns.StartsWith("[") && oldPatterns.EndsWith("]"))
newPatterns.Add(oldPatterns.Substring(1, oldPatterns.Length - 2));
}
ContentDefinitionManager.AlterTypeDefinition(partDefinition.contentTypeName, cfg => cfg
.WithPart("AutoroutePart", builder => builder
.WithSetting("AutorouteSettings.PatternDefinitions", "[" + String.Join(",", newPatterns) + "]")
));
}
}
return 5;
}
}
}

View File

@@ -2,7 +2,7 @@ Name: Autoroute
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: Description for the module
Features:

View File

@@ -37,6 +37,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -47,6 +48,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />

View File

@@ -30,6 +30,6 @@ using System.Security;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10.2")]
[assembly: AssemblyFileVersion("1.10.2")]

View File

@@ -50,19 +50,24 @@ namespace Orchard.Autoroute.Providers.ContentDefinition {
public void ContentPartAttached(ContentPartAttachedContext context) {
if (context.ContentPartName == "AutoroutePart") {
//Create pattern and default pattern for each culture installed
// Create pattern and default pattern for each culture installed and for the neutral culture
//get cultures
// Get cultures
var SiteCultures = _cultureManager.ListCultures().ToList();
//Create Patterns and DefaultPatterns
// Adding a null culture for the culture neutral pattern
List<string> cultures = new List<string>();
cultures.Add(null);
cultures.AddRange(SiteCultures);
// Create Patterns and DefaultPatterns
var settings = new AutorouteSettings {
Patterns = new List<RoutePattern>()
};
List<RoutePattern> newPatterns = new List<RoutePattern>();
List<DefaultPattern> newDefaultPatterns = new List<DefaultPattern>();
foreach (string culture in SiteCultures) {
foreach (string culture in cultures) {
newPatterns.Add(new RoutePattern {
Name = "Title",
Description = "my-title",

View File

@@ -135,35 +135,47 @@ namespace Orchard.Autoroute.Services {
public RoutePattern GetDefaultPattern(string contentType, string culture) {
var settings = GetTypePartSettings(contentType).GetModel<AutorouteSettings>();
var defaultPattern = settings.DefaultPatterns.FirstOrDefault(x => x.Culture == culture);
var defaultPatternIndex = defaultPattern != null ? defaultPattern.PatternIndex : "0";
if (String.IsNullOrWhiteSpace(defaultPatternIndex))
defaultPatternIndex = "0";
if (settings.UseCulturePattern) {
var defaultPatternIndex = "0";
if (!settings.DefaultPatterns.Any(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase))) {
var patternIndex = String.IsNullOrWhiteSpace(settings.DefaultPatternIndex) ? "0" : settings.DefaultPatternIndex;
// Lazy updating from old setting.
if (String.Equals(culture, _cultureManager.GetSiteCulture(), StringComparison.OrdinalIgnoreCase)) {
settings.DefaultPatterns.Add(new DefaultPattern { PatternIndex = patternIndex, Culture = culture });
return settings.Patterns.Where(x => x.Culture == null).ElementAt(Convert.ToInt32(defaultPatternIndex));
if (!settings.DefaultPatterns.Any(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase))) {
// If no default pattern exists for the language return the default culture neutral pattern if it exists, else a generic pattern
if (settings.Patterns.Any(x => String.IsNullOrEmpty(x.Culture))) {
defaultPatternIndex = GetDefaultPatternIndex(contentType, null);
return settings.Patterns.Where(x => String.IsNullOrEmpty(x.Culture)).ElementAt(Convert.ToInt32(defaultPatternIndex));
}
else {
return new RoutePattern { Name = "Title", Description = "my-title", Pattern = "{Content.Slug}", Culture = culture };
}
}
else {
settings.DefaultPatterns.Add(new DefaultPattern { PatternIndex = "0", Culture = culture });
return new RoutePattern { Name = "Title", Description = "my-title", Pattern = "{Content.Slug}", Culture = culture };
// If patterns for the specified culture exist search one of them, else search a culture neutral pattern
var patternCultureSearch = settings.Patterns.Any(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase)) ? culture : null;
defaultPatternIndex = GetDefaultPatternIndex(contentType, patternCultureSearch);
if (settings.Patterns.Any()) {
if (settings.Patterns.Where(x => x.Culture == patternCultureSearch).ElementAt(Convert.ToInt32(defaultPatternIndex)) != null) {
return settings.Patterns.Where(x => x.Culture == patternCultureSearch).ElementAt(Convert.ToInt32(defaultPatternIndex));
}
}
}
else {
// Using the culture neutral pattern
if (settings.Patterns.Any(x => String.IsNullOrEmpty(x.Culture))) {
var defaultPatternIndex = GetDefaultPatternIndex(contentType, null);
// If no default culture neutral pattern exist use the default pattern
if (!settings.DefaultPatterns.Any(x => String.IsNullOrEmpty(x.Culture))) {
var patternIndex = String.IsNullOrWhiteSpace(settings.DefaultPatternIndex) ? "0" : settings.DefaultPatternIndex;
settings.DefaultPatterns.Add(new DefaultPattern { PatternIndex = patternIndex, Culture = null });
}
return settings.Patterns.Where(x => String.IsNullOrEmpty(x.Culture)).ElementAt(Convert.ToInt32(defaultPatternIndex));
}
}
// Return a default pattern if set.
var patternCultureSearch = settings.Patterns.Any(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase)) ? culture : null;
if (settings.Patterns.Any()) {
if (settings.Patterns.Where(x => x.Culture == patternCultureSearch).ElementAt(Convert.ToInt32(defaultPatternIndex)) != null) {
return settings.Patterns.Where(x => x.Culture == patternCultureSearch).ElementAt(Convert.ToInt32(defaultPatternIndex));
};
}
// Return a default pattern if none is defined.
// Return a default pattern if none is defined
return new RoutePattern { Name = "Title", Description = "my-title", Pattern = "{Content.Slug}", Culture = culture };
}
@@ -222,6 +234,23 @@ namespace Orchard.Autoroute.Services {
return contentDefinition.Parts.First(x => x.PartDefinition.Name == "AutoroutePart").Settings;
}
private string GetDefaultPatternIndex(string contentType, string culture) {
var settings = GetTypePartSettings(contentType).GetModel<AutorouteSettings>();
DefaultPattern defaultPattern = null;
if (String.IsNullOrEmpty(culture))
defaultPattern = settings.DefaultPatterns.FirstOrDefault(x => String.IsNullOrEmpty(x.Culture));
else
defaultPattern = settings.DefaultPatterns.FirstOrDefault(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase));
var defaultPatternIndex = defaultPattern != null ? defaultPattern.PatternIndex : "0";
if (String.IsNullOrWhiteSpace(defaultPatternIndex))
defaultPatternIndex = "0";
return defaultPatternIndex;
}
private static int? GetSlugVersion(string path, string potentialConflictingPath) {
int v;
var slugParts = potentialConflictingPath.Split(new[] { path }, StringSplitOptions.RemoveEmptyEntries);

View File

@@ -91,7 +91,7 @@ namespace Orchard.Autoroute.Services {
return false;
}
return a.Keys.All(x => String.Equals(a[x], b[x].ToString(), StringComparison.OrdinalIgnoreCase));
return a.Keys.All(x => String.Equals(a[x], Convert.ToString(b[x]), StringComparison.OrdinalIgnoreCase));
}
}
}

View File

@@ -28,56 +28,55 @@ namespace Orchard.Autoroute.Settings {
var settings = definition.Settings.GetModel<AutorouteSettings>();
//get cultures
// Get cultures
settings.SiteCultures = _cultureManager.ListCultures().ToList();
//get default site culture
// Get default site culture
settings.DefaultSiteCulture = _cultureManager.GetSiteCulture();
//if a culture is not set on the pattern we set it to the default site culture for backward compatibility
if (!settings.Patterns.Any(x => String.Equals(x.Culture, settings.DefaultSiteCulture, StringComparison.OrdinalIgnoreCase))) {
foreach (RoutePattern pattern in settings.Patterns.Where(x => String.IsNullOrWhiteSpace(x.Culture))) {
settings.Patterns.Where(x => x.GetHashCode() == pattern.GetHashCode()).FirstOrDefault().Culture = settings.DefaultSiteCulture;
}
}
//Adding Patterns for the UI
// Adding Patterns for the UI
List<RoutePattern> newPatterns = new List<RoutePattern>();
// Adding a null culture for the culture neutral pattern
List<string> cultures = new List<string>();
cultures.Add(null);
cultures.AddRange(settings.SiteCultures);
int current = 0;
foreach (string culture in settings.SiteCultures) {
foreach (string culture in cultures) {
// Adding all existing patterns for the culture
foreach (RoutePattern routePattern in settings.Patterns.Where(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase))) {
if (settings.Patterns.Any(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase))) {
newPatterns.Add(settings.Patterns[current]);
} else {
newPatterns.Add(new RoutePattern {
Name = "Title",
Description = "my-title",
Pattern = "{Content.Slug}",
Culture = settings.DefaultSiteCulture
});
}
newPatterns.Add(settings.Patterns[current]);
current++;
}
//We add a pattern for each culture if there is none
// Adding a pattern for each culture if there is none
if (!settings.Patterns.Where(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase)).Any()) {
newPatterns.Add(new RoutePattern { Culture = culture, Name = "Title", Description = "my-title", Pattern = "{Content.Slug}" });
}
//we add a new empty line for each culture
// Adding a new empty line for each culture
newPatterns.Add(new RoutePattern { Culture = culture, Name = null, Description = null, Pattern = null });
// if the content type has no defaultPattern for autoroute, then assign one
if (!settings.DefaultPatterns.Any(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase))) {
//if we are in the default culture check the old setting
// If the content type has no defaultPattern for autoroute, assign one
bool defaultPatternExists = false;
if (String.IsNullOrEmpty(culture))
defaultPatternExists = settings.DefaultPatterns.Any(x => String.IsNullOrEmpty(x.Culture));
else
defaultPatternExists = settings.DefaultPatterns.Any(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase));
if (!defaultPatternExists) {
// If in the default culture check the old setting
if (String.Equals(culture, _cultureManager.GetSiteCulture(), StringComparison.OrdinalIgnoreCase)) {
var defaultPatternIndex = settings.DefaultPatternIndex;
if (!String.IsNullOrWhiteSpace(defaultPatternIndex)) {
var patternIndex = defaultPatternIndex;
settings.DefaultPatterns.Add(new DefaultPattern { Culture = settings.DefaultSiteCulture, PatternIndex = patternIndex });
} else {
}
else {
settings.DefaultPatterns.Add(new DefaultPattern { PatternIndex = "0", Culture = culture });
}
} else {
}
else {
settings.DefaultPatterns.Add(new DefaultPattern { PatternIndex = "0", Culture = culture });
}
}
@@ -96,25 +95,51 @@ namespace Orchard.Autoroute.Settings {
Patterns = new List<RoutePattern>()
};
//get cultures
// Get cultures
settings.SiteCultures = _cultureManager.ListCultures().ToList();
if (updateModel.TryUpdateModel(settings, "AutorouteSettings", null, null)) {
//TODO need to add validations client and/or server side here
// remove empty patterns
// If some default pattern is an empty pattern set it to the first pattern for the language
List<DefaultPattern> newDefaultPatterns = new List<DefaultPattern>();
foreach (var defaultPattern in settings.DefaultPatterns) {
RoutePattern correspondingPattern = null;
if (string.IsNullOrEmpty(defaultPattern.Culture))
correspondingPattern = settings.Patterns.Where(x => String.IsNullOrEmpty(x.Culture)).ElementAt(Convert.ToInt32(defaultPattern.PatternIndex));
else
correspondingPattern = settings.Patterns.Where(x => String.Equals(x.Culture, defaultPattern.Culture, StringComparison.OrdinalIgnoreCase)).ElementAt(Convert.ToInt32(defaultPattern.PatternIndex));
if (String.IsNullOrWhiteSpace(correspondingPattern.Name) && String.IsNullOrWhiteSpace(correspondingPattern.Pattern) && String.IsNullOrWhiteSpace(correspondingPattern.Description))
newDefaultPatterns.Add(new DefaultPattern { Culture = defaultPattern.Culture, PatternIndex = "0" });
else
newDefaultPatterns.Add(defaultPattern);
}
settings.DefaultPatterns = newDefaultPatterns;
// Remove empty patterns
var patterns = settings.Patterns;
patterns.RemoveAll(p => String.IsNullOrWhiteSpace(p.Name) && String.IsNullOrWhiteSpace(p.Pattern) && String.IsNullOrWhiteSpace(p.Description));
//If there is no default pattern for each culture we set default ones
// Adding a null culture for the culture neutral pattern
List<string> cultures = new List<string>();
cultures.Add(null);
cultures.AddRange(settings.SiteCultures);
//If there is no pattern for some culture create a default one
List<RoutePattern> newPatterns = new List<RoutePattern>();
int current = 0;
foreach (string culture in settings.SiteCultures) {
foreach (string culture in cultures) {
if (settings.Patterns.Any(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase))) {
foreach (RoutePattern routePattern in settings.Patterns.Where(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase))) {
newPatterns.Add(settings.Patterns[current]);
current++;
}
} else {
}
else {
newPatterns.Add(new RoutePattern {
Name = "Title",
Description = "my-title",
@@ -128,7 +153,7 @@ namespace Orchard.Autoroute.Settings {
settings.Patterns = newPatterns;
// update the settings builder
// Update the settings builder
settings.Build(builder);
}

View File

@@ -1,11 +1,15 @@
@model Orchard.Autoroute.Settings.AutorouteSettings
@using Orchard.Utility.Extensions;
@{
Script.Require("AutorouteBrowser");
Style.Require("AutorouteSettings");
int patternCount = 0;
int patternCultureCount = 0;
List<string> cultures = new List<string>();
cultures.Add(null);
cultures.AddRange(Model.SiteCultures);
}
<fieldset>
<div>
@@ -40,10 +44,10 @@
int i = 1;
string cssClass = "";
}
<li class="first selected"><a class="culture" href="#cat-@Model.DefaultSiteCulture">@Model.DefaultSiteCulture</a></li>
@foreach (var culture in Model.SiteCultures) {
if (culture != Model.DefaultSiteCulture) {
cssClass = i == Model.SiteCultures.Count - 1 ? "last" : "middle";
<li class="first selected"><a class="culture" href="#cat-culture-neutral">@T("All cultures")</a></li>
@foreach (var culture in cultures) {
if (!String.IsNullOrEmpty(culture)) {
cssClass = i == cultures.Count - 1 ? "last" : "middle";
<li class="@cssClass" style="@(Model.UseCulturePattern == false ? "display:none;" : "")"><a class="culture" href="#cat-@culture">@culture</a></li>
i++;
}
@@ -51,8 +55,8 @@
</ul>
</div>
<div id="content">
@foreach (var culture in Model.SiteCultures) {
<fieldset id="cat-@culture" class="items @(culture == Model.DefaultSiteCulture ? "default" : "")" style="@(culture == Model.DefaultSiteCulture ? "display:block;" : "display:none;")">
@foreach (var culture in cultures) {
<fieldset id="cat-@(String.IsNullOrEmpty(culture) ? "culture-neutral" : culture)" class="items @(String.IsNullOrEmpty(culture) ? "default" : "")" style="@(String.IsNullOrEmpty(culture) ? "display:block;" : "display:none;")">
<table class="autoroute-settings-patterns">
<tr>
<th class="autoroute-settings-default">@T("Default")</th>
@@ -63,7 +67,7 @@
</tr>
@for (int index = 0; index < Model.Patterns.Where(x => x.Culture == culture).Count(); index++) {
<tr>
<td>@Html.RadioButtonFor(m => m.DefaultPatterns[Model.SiteCultures.IndexOf(culture)].Culture, culture + "|" + patternCultureCount, patternCultureCount.ToString() == Model.DefaultPatterns[Model.SiteCultures.IndexOf(culture)].PatternIndex ? new { @checked = "checked" } : null)</td>
<td>@Html.RadioButtonFor(m => m.DefaultPatterns[cultures.IndexOf(culture)].Culture, culture + "|" + patternCultureCount, patternCultureCount.ToString() == Model.DefaultPatterns[cultures.IndexOf(culture)].PatternIndex ? new { @checked = "checked" } : null)</td>
<td>@Html.TextBoxFor(m => m.Patterns[patternCount].Name, new { @class = "text" })</td>
<td>@Html.TextBoxFor(m => m.Patterns[patternCount].Pattern, new { @class = "tokenized text" })</td>
<td>@Html.TextBoxFor(m => m.Patterns[patternCount].Description, new { @class = "text" })</td>

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: Microsoft Open Technologies, Inc
Website: http://msopentech.com
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: Provides integration of Microsoft Azure Media Services functionality into Orchard.
Features:

View File

@@ -36,6 +36,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -46,6 +47,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="FluentNHibernate, Version=2.0.3.0, Culture=neutral, processorArchitecture=MSIL">

View File

@@ -32,6 +32,6 @@ using System.Security;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10.2")]
[assembly: AssemblyFileVersion("1.10.2")]

View File

@@ -44,6 +44,7 @@
<CodeAnalysisRuleSet>..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -55,6 +56,7 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Autofac">

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: Provides a set of Orchard service implementations targeting Microsoft Azure services.
Category: Hosting

View File

@@ -36,6 +36,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -46,6 +47,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>5</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Iesi.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">

View File

@@ -31,6 +31,6 @@ using System.Security;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.10.1")]
[assembly: AssemblyFileVersion("1.10.1")]
[assembly: AssemblyVersion("1.10.2")]
[assembly: AssemblyFileVersion("1.10.2")]

View File

@@ -26,7 +26,7 @@ namespace Orchard.Blogs {
}
private void BuildMenu(NavigationItemBuilder menu) {
var blogs = _blogService.Get().Where(x => _authorizationService.TryCheckAccess(Permissions.MetaListOwnBlogs, _workContextAccessor.GetContext().CurrentUser, x)).ToArray();
var blogs = _blogService.Get().Where(x => _authorizationService.TryCheckAccess(Permissions.MetaListBlogs, _workContextAccessor.GetContext().CurrentUser, x)).ToArray();
var blogCount = blogs.Count();
var singleBlog = blogCount == 1 ? blogs.ElementAt(0) : null;

View File

@@ -1,36 +1,24 @@
using System;
using System.Linq;
using Orchard.Blogs.Models;
using Orchard.Blogs.Services;
using Orchard.Commands;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Aspects;
using Orchard.Core.Common.Models;
using Orchard.Security;
using Orchard.Settings;
using Orchard.Widgets.Models;
using Orchard.Widgets.Services;
namespace Orchard.Blogs.Commands {
public class BlogWidgetCommands : DefaultOrchardCommandHandler {
private readonly IWidgetsService _widgetsService;
private readonly IWidgetCommandsService _widgetCommandsService;
private readonly IBlogService _blogService;
private readonly ISiteService _siteService;
private readonly IMembershipService _membershipService;
private readonly IContentManager _contentManager;
private BlogPart blog;
public BlogWidgetCommands(
IWidgetsService widgetsService,
IWidgetCommandsService widgetCommandsService,
IBlogService blogService,
ISiteService siteService,
IMembershipService membershipService,
IContentManager contentManager) {
_widgetsService = widgetsService;
_widgetCommandsService = widgetCommandsService;
_blogService = blogService;
_siteService = siteService;
_membershipService = membershipService;
_contentManager = contentManager;
RenderTitle = true;
@@ -75,11 +63,21 @@ namespace Orchard.Blogs.Commands {
public void CreateRecentBlogPostsWidget() {
var type = "RecentBlogPosts";
var widget = CreateStandardWidget(type);
// Check any custom parameters that could cause creating the widget to fail.
blog = GetBlog(BlogId, BlogPath);
if (blog == null) {
Context.Output.WriteLine(T("Creating {0} widget failed: blog was not found.", type));
return;
}
// Create the widget using the standard parameters.
var widget = _widgetCommandsService.CreateBaseWidget(
Context, type, Title, Name, Zone, Position, Layer, Identity, RenderTitle, Owner, null, false, null);
if (widget == null) {
return;
}
// Publish the successfully created widget.
widget.As<RecentBlogPostsPart>().BlogId = blog.Id;
// Setting count to 0 means all posts. It's an optional parameter and defaults to 5.
@@ -90,7 +88,8 @@ namespace Orchard.Blogs.Commands {
}
}
_contentManager.Publish(widget.ContentItem);
// Publish the successfully created widget.
_widgetCommandsService.Publish(widget);
Context.Output.WriteLine(T("{0} widget created successfully.", type).Text);
}
@@ -100,64 +99,28 @@ namespace Orchard.Blogs.Commands {
public void CreateBlogArchivesWidget() {
var type = "BlogArchives";
var widget = CreateStandardWidget(type);
// Check any custom parameters that could cause creating the widget to fail.
blog = GetBlog(BlogId, BlogPath);
if (blog == null) {
Context.Output.WriteLine(T("Creating {0} widget failed: blog was not found.", type));
return;
}
// Create the widget using the standard parameters.
var widget = _widgetCommandsService.CreateBaseWidget(
Context, type, Title, Name, Zone, Position, Layer, Identity, RenderTitle, Owner, null, false, null);
if (widget == null) {
return;
}
// Set the custom parameters.
widget.As<BlogArchivesPart>().BlogId = blog.Id;
_contentManager.Publish(widget.ContentItem);
// Publish the successfully created widget.
_widgetCommandsService.Publish(widget);
Context.Output.WriteLine(T("{0} widget created successfully.", type).Text);
}
private WidgetPart CreateStandardWidget(string type) {
var widgetTypeNames = _widgetsService.GetWidgetTypeNames().ToList();
if (!widgetTypeNames.Contains(type)) {
Context.Output.WriteLine(T("Creating widget failed: type {0} was not found. Supported widget types are: {1}.",
type,
string.Join(" ", widgetTypeNames)));
return null;
}
var layer = GetLayer(Layer);
if (layer == null) {
Context.Output.WriteLine(T("Creating {0} widget failed: layer {1} was not found.", type, Layer));
return null;
}
blog = GetBlog(BlogId, BlogPath);
if (blog == null) {
Context.Output.WriteLine(T("Creating {0} widget failed: blog was not found.", type));
return null;
}
var widget = _widgetsService.CreateWidget(layer.ContentItem.Id, type, T(Title).Text, Position, Zone);
if (!String.IsNullOrWhiteSpace(Name)) {
widget.Name = Name.Trim();
}
widget.RenderTitle = RenderTitle;
if (String.IsNullOrEmpty(Owner)) {
Owner = _siteService.GetSiteSettings().SuperUser;
}
var owner = _membershipService.GetUser(Owner);
widget.As<ICommonPart>().Owner = owner;
if (widget.Has<IdentityPart>() && !String.IsNullOrEmpty(Identity)) {
widget.As<IdentityPart>().Identifier = Identity;
}
return widget;
}
private LayerPart GetLayer(string layer) {
var layers = _widgetsService.GetLayers();
return layers.FirstOrDefault(layerPart => String.Equals(layerPart.Name, layer, StringComparison.OrdinalIgnoreCase));
}
private BlogPart GetBlog(int blogId, string blogPath) {
return _contentManager.Get<BlogPart>(blogId) ?? _blogService.Get(blogPath);
}

View File

@@ -2,7 +2,7 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.10.1
Version: 1.10.2
OrchardVersion: 1.9
Description: The Orchard Blogs module is implementing basic blogging features.
FeatureDescription: A simple web log.

Some files were not shown because too many files have changed in this diff Show More