diff --git a/.github/workflows/cloudscribe-develop.yml b/.github/workflows/cloudscribe-develop.yml index 261a8db..8bb9f37 100644 --- a/.github/workflows/cloudscribe-develop.yml +++ b/.github/workflows/cloudscribe-develop.yml @@ -1,39 +1,39 @@ -# This workflow will build a .NET project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net - -name: cloudscribe-syndication-develop-nuget-build - -on: - push: - branches: [ "develop" ] - workflow_dispatch: -# pull_request: -# branches: [ "develop" ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 8.0.x - - name: Setup NuGet - run: dotnet nuget add source ${{ secrets.NUGET_SOURCE_URL }} -u ${{secrets.NUGET_USERNAME }} -p ${{ secrets.NUGET_PASSWORD }} --store-password-in-clear-text - - name: Restore dependencies - run: dotnet restore - - name: Build - run: dotnet build -c Release - - name: Create NuGet package - run: dotnet pack -c Release - - name: Publish NuGet package - run: dotnet nuget push **/*.nupkg --source ${{ secrets.NUGET_SOURCE_URL }} - - name: Remote Repository Dispatch - uses: peter-evans/repository-dispatch@v3 - with: - token: ${{ secrets.GHB_PAT }} - repository: GreatHouseBarn/cloudscribe-testing - event-type: cs.Syndication +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: cloudscribe-syndication-develop-nuget-build + +on: + push: + branches: [ "develop" ] + workflow_dispatch: +# pull_request: +# branches: [ "develop" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Setup NuGet + run: dotnet nuget add source ${{ secrets.NUGET_SOURCE_URL }} -u ${{secrets.NUGET_USERNAME }} -p ${{ secrets.NUGET_PASSWORD }} --store-password-in-clear-text + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build -c Release + - name: Create NuGet package + run: dotnet pack -c Release + - name: Publish NuGet package + run: dotnet nuget push **/*.nupkg --source ${{ secrets.NUGET_SOURCE_URL }} + - name: Remote Repository Dispatch + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.GHB_PAT }} + repository: GreatHouseBarn/cloudscribe-testing + event-type: cs.Syndication diff --git a/.github/workflows/nuget-push-to-production.yml b/.github/workflows/nuget-push-to-production.yml index 269e626..de40787 100644 --- a/.github/workflows/nuget-push-to-production.yml +++ b/.github/workflows/nuget-push-to-production.yml @@ -1,56 +1,56 @@ -name: NuGet Push to Production - ESDM Nexus and nuget.org - -on: - workflow_dispatch: - -jobs: - push-nuget: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 8.0.x - - name: Exit if the branch is not master - run: | - if [[ "${{ github.ref }}" != "refs/heads/master" ]]; then - echo "Branch is not master, exiting." - exit 1 - fi - - name: Setup NuGet - run: dotnet nuget add source ${{ secrets.NUGET_SOURCE_URL }} -u ${{ secrets.NUGET_USERNAME }} -p ${{ secrets.NUGET_PASSWORD }} --store-password-in-clear-text --name esdm-nuget-testing - - name: Restore dependencies - run: dotnet restore - - name: Build - run: dotnet build -c Release - - name: Create NuGet package - run: dotnet pack -c Release - - name: Auth to other Nexus repo - run: dotnet nuget add source ${{ secrets.ESDM_NUGET_HOSTED_URL }} -u ${{ secrets.NUGET_USERNAME }} -p ${{ secrets.NUGET_PASSWORD }} --store-password-in-clear-text --name esdm-nuget-hosted - - name: Find and Push NuGet packages to Nexus - run: | - PACKAGES=$(find . -name "*.nupkg" | grep -E "cloudscribe|sts\.") - if [ -z "$PACKAGES" ]; then - echo "No matching package found. Exiting." - exit 1 - fi - echo "Found packages: $PACKAGES" - for PACKAGE in $PACKAGES; do - echo "Pushing $PACKAGE to Nexus" - dotnet nuget push "$PACKAGE" --source esdm-nuget-hosted --skip-duplicate || echo "WARNING - skipping duplicate package: $PACKAGE" - done - - name: Find and Push NuGet packages to nuget.org - env: - NUGET_ORG_API_KEY: ${{ secrets.NUGET_ORG_API_KEY }} - run: | - PACKAGES=$(find . -name "*.nupkg" | grep -E "cloudscribe|sts\.Common") - if [ -z "$PACKAGES" ]; then - echo "No matching package found. Exiting." - exit 1 - fi - echo "Found packages: $PACKAGES" - for PACKAGE in $PACKAGES; do - echo "Pushing $PACKAGE to nuget.org" - dotnet nuget push "$PACKAGE" --api-key "$NUGET_ORG_API_KEY" --source "https://api.nuget.org/v3/index.json" --skip-duplicate || { echo "WARNING - failed to upload package: $PACKAGE"; exit 1; } - done +name: NuGet Push to Production - ESDM Nexus and nuget.org + +on: + workflow_dispatch: + +jobs: + push-nuget: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Exit if the branch is not master + run: | + if [[ "${{ github.ref }}" != "refs/heads/master" ]]; then + echo "Branch is not master, exiting." + exit 1 + fi + - name: Setup NuGet + run: dotnet nuget add source ${{ secrets.NUGET_SOURCE_URL }} -u ${{ secrets.NUGET_USERNAME }} -p ${{ secrets.NUGET_PASSWORD }} --store-password-in-clear-text --name esdm-nuget-testing + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build -c Release + - name: Create NuGet package + run: dotnet pack -c Release + - name: Auth to other Nexus repo + run: dotnet nuget add source ${{ secrets.ESDM_NUGET_HOSTED_URL }} -u ${{ secrets.NUGET_USERNAME }} -p ${{ secrets.NUGET_PASSWORD }} --store-password-in-clear-text --name esdm-nuget-hosted + - name: Find and Push NuGet packages to Nexus + run: | + PACKAGES=$(find . -name "*.nupkg" | grep -E "cloudscribe|sts\.") + if [ -z "$PACKAGES" ]; then + echo "No matching package found. Exiting." + exit 1 + fi + echo "Found packages: $PACKAGES" + for PACKAGE in $PACKAGES; do + echo "Pushing $PACKAGE to Nexus" + dotnet nuget push "$PACKAGE" --source esdm-nuget-hosted --skip-duplicate || echo "WARNING - skipping duplicate package: $PACKAGE" + done + - name: Find and Push NuGet packages to nuget.org + env: + NUGET_ORG_API_KEY: ${{ secrets.NUGET_ORG_API_KEY }} + run: | + PACKAGES=$(find . -name "*.nupkg" | grep -E "cloudscribe|sts\.Common") + if [ -z "$PACKAGES" ]; then + echo "No matching package found. Exiting." + exit 1 + fi + echo "Found packages: $PACKAGES" + for PACKAGE in $PACKAGES; do + echo "Pushing $PACKAGE to nuget.org" + dotnet nuget push "$PACKAGE" --api-key "$NUGET_ORG_API_KEY" --source "https://api.nuget.org/v3/index.json" --skip-duplicate || { echo "WARNING - failed to upload package: $PACKAGE"; exit 1; } + done diff --git a/.gitignore b/.gitignore index 97e2565..6f80d77 100644 --- a/.gitignore +++ b/.gitignore @@ -1,201 +1,206 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.sln.docstates -.vs/* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -x64/ -build/ -bld/ -[Bb]in/ -[Oo]bj/ - -_bin* -*SQLite.Interop.dll -/nuget/*/lib/net45/*.dll -/nuget/nupkgs/ -/nuget/*/content/ -node_modules -bower_components -artifacts/* -project.lock.json - - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -#NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding addin-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -*.ncrunch* -_NCrunch_* -.*crunch*.local.xml - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml - -# NuGet Packages Directory -packages/ -## TODO: If the tool you use requires repositories.config uncomment the next line -#!packages/repositories.config - -# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets -# This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented) -!packages/build/ - -# Windows Azure Build Output -csx/ -*.build.csdef - -# Windows Store app package directory -AppPackages/ - -# Others -sql/ -*.Cache -ClientBin/ -[Ss]tyle[Cc]op.* -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -node_modules/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file to a newer -# Visual Studio version. Backup files are not needed, because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - - -src/demo.Web/wwwroot/lib* -src/demo.Web/wwwroot/js/* -src/demo.Web/wwwroot/css/site.min.css - -src/demo.Web/appsettings.local.overrides.json - - -.vscode/launch.json - -**/dp_keys/** -tools/** -!tools/packages.config - +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates +.vs/* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +x64/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +_bin* +*SQLite.Interop.dll +/nuget/*/lib/net45/*.dll +/nuget/nupkgs/ +/nuget/*/content/ +node_modules +bower_components +artifacts/* +project.lock.json + + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +#NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding addin-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +_NCrunch_* +.*crunch*.local.xml + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml + +# NuGet Packages Directory +packages/ +## TODO: If the tool you use requires repositories.config uncomment the next line +#!packages/repositories.config + +# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets +# This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented) +!packages/build/ + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + + +src/demo.Web/wwwroot/lib* +src/demo.Web/wwwroot/js/* +src/demo.Web/wwwroot/css/site.min.css + +src/demo.Web/appsettings.local.overrides.json + + +.vscode/launch.json + +**/dp_keys/** +tools/** +!tools/packages.config + + +# Local documentation files +CLAUDE.md +CLAUDE_CSCORE.md +cloudscribe-syndication-docs.html diff --git a/.travis-cake-backup.yml b/.travis-cake-backup.yml index d42253d..134806f 100644 --- a/.travis-cake-backup.yml +++ b/.travis-cake-backup.yml @@ -1,26 +1,26 @@ -dist: trusty -language: csharp -install: true -mono: latest -dotnet: 2.1.101 -sudo: required -addons: - apt: - packages: - - gettext - - libcurl4-openssl-dev - - libicu-dev - - libssl-dev - - libunwind8 - - zlib1g - -before_install: - - chmod +x build.sh - -script: - - ./build.sh - -cache: - directories: - - tools - +dist: trusty +language: csharp +install: true +mono: latest +dotnet: 2.1.101 +sudo: required +addons: + apt: + packages: + - gettext + - libcurl4-openssl-dev + - libicu-dev + - libssl-dev + - libunwind8 + - zlib1g + +before_install: + - chmod +x build.sh + +script: + - ./build.sh + +cache: + directories: + - tools + diff --git a/.travis.yml b/.travis.yml index ea3160f..4943b53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,16 @@ -language: csharp -solution: cloudscribe.Syndication.sln -sudo: false -dist: xenial -mono: none -dotnet: 3.0.100 -env: - global: - - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - - DOTNET_CLI_TELEMETRY_OPTOUT: 1 -os: - - linux - -script: - - if test "$TRAVIS_OS_NAME" == "linux"; then dotnet restore; fi - - dotnet build -c Release +language: csharp +solution: cloudscribe.Syndication.sln +sudo: false +dist: xenial +mono: none +dotnet: 3.0.100 +env: + global: + - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + - DOTNET_CLI_TELEMETRY_OPTOUT: 1 +os: + - linux + +script: + - if test "$TRAVIS_OS_NAME" == "linux"; then dotnet restore; fi + - dotnet build -c Release diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 43f12a5..6bfa1d8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ -# Contributing to cloudscribe - -This project is part of the cloudscribe set of projects which are all being managed under the same policies. -See the CONTRIBUTING.md file in the main cloudscribe repository: -https://github.com/joeaudette/cloudscribe/blob/master/CONTRIBUTING.md - +# Contributing to cloudscribe + +This project is part of the cloudscribe set of projects which are all being managed under the same policies. +See the CONTRIBUTING.md file in the main cloudscribe repository: +https://github.com/joeaudette/cloudscribe/blob/master/CONTRIBUTING.md + diff --git a/LICENSE b/LICENSE index 8dada3e..c0ee812 100644 --- a/LICENSE +++ b/LICENSE @@ -1,201 +1,201 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index 0234152..5a0a43f 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,47 @@ -# cloudscribe.Syndication -a re-useable RSS Feed generator for ASP.NET Core - -It was implemented for use in [cloudscribe SimpleContent](https://github.com/joeaudette/cloudscribe.SimpleContent), but could be used by anyone who would like to add [RSS Feed](http://cyber.law.harvard.edu/rss/rss.html) support to their web application. - -### Build Status - - - -[![CS Build Devel](https://img.shields.io/github/actions/workflow/status/cloudscribe/cloudscribe.Syndication/cloudscribe-develop.yml?branch=develop&event=push&style=for-the-badge&label=🚀%20Develop%20Branch)](https://github.com/cloudscribe/cloudscribe.Syndication/actions/workflows/cloudscribe-develop.yml) - -If you have questions please visit our community forum https://www.cloudscribe.com/forum - -## Rationale - why do we need this? - -You may notice that in the ASP.NET Core world, ways that we used to generate RSS Feeds don't currently exist. The [System.ServiceModel.Syndication](https://msdn.microsoft.com/en-us/library/system.servicemodel.syndication%28v=vs.110%29.aspx) namespace that can be used to build feeds in the full desktop framework have not yet been ported to .NET Core and I don't know if they have plans to implement that later or not. The other commonly used [Argotic Framework](https://argotic.codeplex.com/) has not been updated since 2008 and is not designed in a way that makes it easy to port. I needed a solution for my SimpleContent project and decided to implement something myself rather than wait for something else that may not be available for a while. I did borrow the model classes from Argotic in order to build cloudscribe.Syndication. - - -## How to use it in your own application - -To use it in your own application, add a reference in the dependencies section of your project.json - - "cloudscribe.Syndication.Web": "1.0.0-*" - -Then you need to implement your own [IChannelProvider](https://github.com/joeaudette/cloudscribe.Syndication/blob/master/src/cloudscribe.Syndication/Models/Rss/IChannelProvider.cs) to build the feed content. - -Then in the Startup.cs of your appplication, register your implementation with the dependency injection services like this: - - services.AddScoped(); - -You can see [my implementation](https://github.com/joeaudette/cloudscribe.SimpleContent/blob/master/src/cloudscribe.SimpleContent.Syndication/RssChannelProvider.cs) in the cloudscribe.SimpleContent.Syndication project, which should give you a good example of how to implement it from your own content models. - -Then it should work at yoursite/api/rss - -## What is provided - -* RssController which is the endpoint -* Logic for building the rss/xml result from the channel model - -## What is not provided or not provided yet - -* I included the Atom models from Argotic framework but have not implemented anything for Atom feeds. It should be fairly straightforward to implement something similar to what I have done for RSS but for my purposes RSS is all I really need right now and I'm not sure if I will later implement Atom feeds or not. Some people may want to implement both RSS and Atom but from my reading of best practices it is better to just have one feed. Certainly if someone else wants to implement it and submit a pull request that would be great! -* The demo.Web project in this solution is just a stub, not really a demo yet. I thought to implement a hard coded example of IChannelProvider and use it in a demo app but I have not done that yet and it is a low priority. The best available demo at the moment is my [cloudscribe.SimpleContent project](https://github.com/joeaudette/cloudscribe.SimpleContent). +# cloudscribe.Syndication +a re-useable RSS Feed generator for ASP.NET Core + +It was implemented for use in [cloudscribe SimpleContent](https://github.com/joeaudette/cloudscribe.SimpleContent), but could be used by anyone who would like to add [RSS Feed](http://cyber.law.harvard.edu/rss/rss.html) support to their web application. + +### Build Status + + + +[![CS Build Devel](https://img.shields.io/github/actions/workflow/status/cloudscribe/cloudscribe.Syndication/cloudscribe-develop.yml?branch=develop&event=push&style=for-the-badge&label=🚀%20Develop%20Branch)](https://github.com/cloudscribe/cloudscribe.Syndication/actions/workflows/cloudscribe-develop.yml) + +If you have questions please visit our community forum https://www.cloudscribe.com/forum + +## Rationale - why do we need this? + +You may notice that in the ASP.NET Core world, ways that we used to generate RSS Feeds don't currently exist. The [System.ServiceModel.Syndication](https://msdn.microsoft.com/en-us/library/system.servicemodel.syndication%28v=vs.110%29.aspx) namespace that can be used to build feeds in the full desktop framework have not yet been ported to .NET Core and I don't know if they have plans to implement that later or not. The other commonly used [Argotic Framework](https://argotic.codeplex.com/) has not been updated since 2008 and is not designed in a way that makes it easy to port. I needed a solution for my SimpleContent project and decided to implement something myself rather than wait for something else that may not be available for a while. I did borrow the model classes from Argotic in order to build cloudscribe.Syndication. + + +## How to use it in your own application + +To use it in your own application, add a reference in the dependencies section of your project.json + + "cloudscribe.Syndication.Web": "1.0.0-*" + +Then you need to implement your own [IChannelProvider](https://github.com/joeaudette/cloudscribe.Syndication/blob/master/src/cloudscribe.Syndication/Models/Rss/IChannelProvider.cs) to build the feed content. + +Then in the Startup.cs of your appplication, register your implementation with the dependency injection services like this: + + services.AddScoped(); + +You can see [my implementation](https://github.com/joeaudette/cloudscribe.SimpleContent/blob/master/src/cloudscribe.SimpleContent.Syndication/RssChannelProvider.cs) in the cloudscribe.SimpleContent.Syndication project, which should give you a good example of how to implement it from your own content models. + +Then it should work at yoursite/api/rss + +## What is provided + +* RssController which is the endpoint +* Logic for building the rss/xml result from the channel model + +## What is not provided or not provided yet + +* I included the Atom models from Argotic framework but have not implemented anything for Atom feeds. It should be fairly straightforward to implement something similar to what I have done for RSS but for my purposes RSS is all I really need right now and I'm not sure if I will later implement Atom feeds or not. Some people may want to implement both RSS and Atom but from my reading of best practices it is better to just have one feed. Certainly if someone else wants to implement it and submit a pull request that would be great! +* The demo.Web project in this solution is just a stub, not really a demo yet. I thought to implement a hard coded example of IChannelProvider and use it in a demo app but I have not done that yet and it is a low priority. The best available demo at the moment is my [cloudscribe.SimpleContent project](https://github.com/joeaudette/cloudscribe.SimpleContent). diff --git a/appveyor-cake-backup.yml b/appveyor-cake-backup.yml index 1995a0a..c6b545e 100644 --- a/appveyor-cake-backup.yml +++ b/appveyor-cake-backup.yml @@ -1,5 +1,5 @@ -image: Visual Studio 2017 -build_script: -- cmd: PowerShell -Version 2.0 .\build.ps1 -test: off - +image: Visual Studio 2017 +build_script: +- cmd: PowerShell -Version 2.0 .\build.ps1 +test: off + diff --git a/appveyor.yml b/appveyor.yml index b3919a0..e0815f9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,17 +1,17 @@ -image: Visual Studio 2019 -environment: - nodejs_version: "13.0.1" -# Install scripts. (runs after repo cloning) -install: - # Get the latest stable version of Node.js or io.js - - ps: Install-Product node $env:nodejs_version - - ps: $env:BuildNumber= $env:APPVEYOR_BUILD_NUMBER -init: - - git config --global core.autocrlf true -build_script: - - dotnet restore - - dotnet build -c Release -test: off - - +image: Visual Studio 2019 +environment: + nodejs_version: "13.0.1" +# Install scripts. (runs after repo cloning) +install: + # Get the latest stable version of Node.js or io.js + - ps: Install-Product node $env:nodejs_version + - ps: $env:BuildNumber= $env:APPVEYOR_BUILD_NUMBER +init: + - git config --global core.autocrlf true +build_script: + - dotnet restore + - dotnet build -c Release +test: off + + \ No newline at end of file diff --git a/build.cake b/build.cake index 7e8f468..0009e95 100644 --- a/build.cake +++ b/build.cake @@ -1,29 +1,29 @@ -#tool nuget:?package=xunit.runner.console&version=2.2.0 -#tool nuget:?package=xunit.runner.visualstudio&version=2.2.0 - -#load cake/paths.cake - -var target = Argument("Target", "Build"); -var configuration = Argument("Configuration", "Release"); - - -Task("Restore") - .Does(() => -{ - NuGetRestore(Paths.SolutionFile); -}); - -Task("Build") - .IsDependentOn("Restore") - .Does(() => -{ - MSBuild( - Paths.SolutionFile, - settings => settings.SetConfiguration(configuration) - .WithTarget("Build")); -}); - -Task("Default") - .IsDependentOn("Build"); - -RunTarget(target); +#tool nuget:?package=xunit.runner.console&version=2.2.0 +#tool nuget:?package=xunit.runner.visualstudio&version=2.2.0 + +#load cake/paths.cake + +var target = Argument("Target", "Build"); +var configuration = Argument("Configuration", "Release"); + + +Task("Restore") + .Does(() => +{ + NuGetRestore(Paths.SolutionFile); +}); + +Task("Build") + .IsDependentOn("Restore") + .Does(() => +{ + MSBuild( + Paths.SolutionFile, + settings => settings.SetConfiguration(configuration) + .WithTarget("Build")); +}); + +Task("Default") + .IsDependentOn("Build"); + +RunTarget(target); diff --git a/build.ps1 b/build.ps1 index 05b31be..ab7600b 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,234 +1,234 @@ -########################################################################## -# This is the Cake bootstrapper script for PowerShell. -# This file was downloaded from https://github.com/cake-build/resources -# Feel free to change this file to fit your needs. -########################################################################## - -<# - -.SYNOPSIS -This is a Powershell script to bootstrap a Cake build. - -.DESCRIPTION -This Powershell script will download NuGet if missing, restore NuGet tools (including Cake) -and execute your Cake build script with the parameters you provide. - -.PARAMETER Script -The build script to execute. -.PARAMETER Target -The build script target to run. -.PARAMETER Configuration -The build configuration to use. -.PARAMETER Verbosity -Specifies the amount of information to be displayed. -.PARAMETER ShowDescription -Shows description about tasks. -.PARAMETER DryRun -Performs a dry run. -.PARAMETER Experimental -Uses the nightly builds of the Roslyn script engine. -.PARAMETER Mono -Uses the Mono Compiler rather than the Roslyn script engine. -.PARAMETER SkipToolPackageRestore -Skips restoring of packages. -.PARAMETER ScriptArgs -Remaining arguments are added here. - -.LINK -https://cakebuild.net - -#> - -[CmdletBinding()] -Param( - [string]$Script = "build.cake", - [string]$Target, - [string]$Configuration, - [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")] - [string]$Verbosity, - [switch]$ShowDescription, - [Alias("WhatIf", "Noop")] - [switch]$DryRun, - [switch]$Experimental, - [switch]$Mono, - [switch]$SkipToolPackageRestore, - [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] - [string[]]$ScriptArgs -) - -[Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null -function MD5HashFile([string] $filePath) -{ - if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf)) - { - return $null - } - - [System.IO.Stream] $file = $null; - [System.Security.Cryptography.MD5] $md5 = $null; - try - { - $md5 = [System.Security.Cryptography.MD5]::Create() - $file = [System.IO.File]::OpenRead($filePath) - return [System.BitConverter]::ToString($md5.ComputeHash($file)) - } - finally - { - if ($file -ne $null) - { - $file.Dispose() - } - } -} - -function GetProxyEnabledWebClient -{ - $wc = New-Object System.Net.WebClient - $proxy = [System.Net.WebRequest]::GetSystemWebProxy() - $proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials - $wc.Proxy = $proxy - return $wc -} - -Write-Host "Preparing to run build script..." - -if(!$PSScriptRoot){ - $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent -} - -$TOOLS_DIR = Join-Path $PSScriptRoot "tools" -$ADDINS_DIR = Join-Path $TOOLS_DIR "Addins" -$MODULES_DIR = Join-Path $TOOLS_DIR "Modules" -$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe" -$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe" -$NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" -$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config" -$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum" -$ADDINS_PACKAGES_CONFIG = Join-Path $ADDINS_DIR "packages.config" -$MODULES_PACKAGES_CONFIG = Join-Path $MODULES_DIR "packages.config" - -# Make sure tools folder exists -if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) { - Write-Verbose -Message "Creating tools directory..." - New-Item -Path $TOOLS_DIR -Type directory | out-null -} - -# Make sure that packages.config exist. -if (!(Test-Path $PACKAGES_CONFIG)) { - Write-Verbose -Message "Downloading packages.config..." - try { - $wc = GetProxyEnabledWebClient - $wc.DownloadFile("https://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) } catch { - Throw "Could not download packages.config." - } -} - -# Try find NuGet.exe in path if not exists -if (!(Test-Path $NUGET_EXE)) { - Write-Verbose -Message "Trying to find nuget.exe in PATH..." - $existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_ -PathType Container) } - $NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1 - if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) { - Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)." - $NUGET_EXE = $NUGET_EXE_IN_PATH.FullName - } -} - -# Try download NuGet.exe if not exists -if (!(Test-Path $NUGET_EXE)) { - Write-Verbose -Message "Downloading NuGet.exe..." - try { - $wc = GetProxyEnabledWebClient - $wc.DownloadFile($NUGET_URL, $NUGET_EXE) - } catch { - Throw "Could not download NuGet.exe." - } -} - -# Save nuget.exe path to environment to be available to child processed -$ENV:NUGET_EXE = $NUGET_EXE - -# Restore tools from NuGet? -if(-Not $SkipToolPackageRestore.IsPresent) { - Push-Location - Set-Location $TOOLS_DIR - - # Check for changes in packages.config and remove installed tools if true. - [string] $md5Hash = MD5HashFile($PACKAGES_CONFIG) - if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or - ($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) { - Write-Verbose -Message "Missing or changed package.config hash..." - Remove-Item * -Recurse -Exclude packages.config,nuget.exe - } - - Write-Verbose -Message "Restoring tools from NuGet..." - $NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`"" - - if ($LASTEXITCODE -ne 0) { - Throw "An error occurred while restoring NuGet tools." - } - else - { - $md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII" - } - Write-Verbose -Message ($NuGetOutput | out-string) - - Pop-Location -} - -# Restore addins from NuGet -if (Test-Path $ADDINS_PACKAGES_CONFIG) { - Push-Location - Set-Location $ADDINS_DIR - - Write-Verbose -Message "Restoring addins from NuGet..." - $NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$ADDINS_DIR`"" - - if ($LASTEXITCODE -ne 0) { - Throw "An error occurred while restoring NuGet addins." - } - - Write-Verbose -Message ($NuGetOutput | out-string) - - Pop-Location -} - -# Restore modules from NuGet -if (Test-Path $MODULES_PACKAGES_CONFIG) { - Push-Location - Set-Location $MODULES_DIR - - Write-Verbose -Message "Restoring modules from NuGet..." - $NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$MODULES_DIR`"" - - if ($LASTEXITCODE -ne 0) { - Throw "An error occurred while restoring NuGet modules." - } - - Write-Verbose -Message ($NuGetOutput | out-string) - - Pop-Location -} - -# Make sure that Cake has been installed. -if (!(Test-Path $CAKE_EXE)) { - Throw "Could not find Cake.exe at $CAKE_EXE" -} - - - -# Build Cake arguments -$cakeArguments = @("$Script"); -if ($Target) { $cakeArguments += "-target=$Target" } -if ($Configuration) { $cakeArguments += "-configuration=$Configuration" } -if ($Verbosity) { $cakeArguments += "-verbosity=$Verbosity" } -if ($ShowDescription) { $cakeArguments += "-showdescription" } -if ($DryRun) { $cakeArguments += "-dryrun" } -if ($Experimental) { $cakeArguments += "-experimental" } -if ($Mono) { $cakeArguments += "-mono" } -$cakeArguments += $ScriptArgs - -# Start Cake -Write-Host "Running build script..." -&$CAKE_EXE $cakeArguments -exit $LASTEXITCODE +########################################################################## +# This is the Cake bootstrapper script for PowerShell. +# This file was downloaded from https://github.com/cake-build/resources +# Feel free to change this file to fit your needs. +########################################################################## + +<# + +.SYNOPSIS +This is a Powershell script to bootstrap a Cake build. + +.DESCRIPTION +This Powershell script will download NuGet if missing, restore NuGet tools (including Cake) +and execute your Cake build script with the parameters you provide. + +.PARAMETER Script +The build script to execute. +.PARAMETER Target +The build script target to run. +.PARAMETER Configuration +The build configuration to use. +.PARAMETER Verbosity +Specifies the amount of information to be displayed. +.PARAMETER ShowDescription +Shows description about tasks. +.PARAMETER DryRun +Performs a dry run. +.PARAMETER Experimental +Uses the nightly builds of the Roslyn script engine. +.PARAMETER Mono +Uses the Mono Compiler rather than the Roslyn script engine. +.PARAMETER SkipToolPackageRestore +Skips restoring of packages. +.PARAMETER ScriptArgs +Remaining arguments are added here. + +.LINK +https://cakebuild.net + +#> + +[CmdletBinding()] +Param( + [string]$Script = "build.cake", + [string]$Target, + [string]$Configuration, + [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")] + [string]$Verbosity, + [switch]$ShowDescription, + [Alias("WhatIf", "Noop")] + [switch]$DryRun, + [switch]$Experimental, + [switch]$Mono, + [switch]$SkipToolPackageRestore, + [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] + [string[]]$ScriptArgs +) + +[Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null +function MD5HashFile([string] $filePath) +{ + if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf)) + { + return $null + } + + [System.IO.Stream] $file = $null; + [System.Security.Cryptography.MD5] $md5 = $null; + try + { + $md5 = [System.Security.Cryptography.MD5]::Create() + $file = [System.IO.File]::OpenRead($filePath) + return [System.BitConverter]::ToString($md5.ComputeHash($file)) + } + finally + { + if ($file -ne $null) + { + $file.Dispose() + } + } +} + +function GetProxyEnabledWebClient +{ + $wc = New-Object System.Net.WebClient + $proxy = [System.Net.WebRequest]::GetSystemWebProxy() + $proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials + $wc.Proxy = $proxy + return $wc +} + +Write-Host "Preparing to run build script..." + +if(!$PSScriptRoot){ + $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent +} + +$TOOLS_DIR = Join-Path $PSScriptRoot "tools" +$ADDINS_DIR = Join-Path $TOOLS_DIR "Addins" +$MODULES_DIR = Join-Path $TOOLS_DIR "Modules" +$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe" +$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe" +$NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" +$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config" +$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum" +$ADDINS_PACKAGES_CONFIG = Join-Path $ADDINS_DIR "packages.config" +$MODULES_PACKAGES_CONFIG = Join-Path $MODULES_DIR "packages.config" + +# Make sure tools folder exists +if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) { + Write-Verbose -Message "Creating tools directory..." + New-Item -Path $TOOLS_DIR -Type directory | out-null +} + +# Make sure that packages.config exist. +if (!(Test-Path $PACKAGES_CONFIG)) { + Write-Verbose -Message "Downloading packages.config..." + try { + $wc = GetProxyEnabledWebClient + $wc.DownloadFile("https://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) } catch { + Throw "Could not download packages.config." + } +} + +# Try find NuGet.exe in path if not exists +if (!(Test-Path $NUGET_EXE)) { + Write-Verbose -Message "Trying to find nuget.exe in PATH..." + $existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_ -PathType Container) } + $NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1 + if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) { + Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)." + $NUGET_EXE = $NUGET_EXE_IN_PATH.FullName + } +} + +# Try download NuGet.exe if not exists +if (!(Test-Path $NUGET_EXE)) { + Write-Verbose -Message "Downloading NuGet.exe..." + try { + $wc = GetProxyEnabledWebClient + $wc.DownloadFile($NUGET_URL, $NUGET_EXE) + } catch { + Throw "Could not download NuGet.exe." + } +} + +# Save nuget.exe path to environment to be available to child processed +$ENV:NUGET_EXE = $NUGET_EXE + +# Restore tools from NuGet? +if(-Not $SkipToolPackageRestore.IsPresent) { + Push-Location + Set-Location $TOOLS_DIR + + # Check for changes in packages.config and remove installed tools if true. + [string] $md5Hash = MD5HashFile($PACKAGES_CONFIG) + if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or + ($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) { + Write-Verbose -Message "Missing or changed package.config hash..." + Remove-Item * -Recurse -Exclude packages.config,nuget.exe + } + + Write-Verbose -Message "Restoring tools from NuGet..." + $NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`"" + + if ($LASTEXITCODE -ne 0) { + Throw "An error occurred while restoring NuGet tools." + } + else + { + $md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII" + } + Write-Verbose -Message ($NuGetOutput | out-string) + + Pop-Location +} + +# Restore addins from NuGet +if (Test-Path $ADDINS_PACKAGES_CONFIG) { + Push-Location + Set-Location $ADDINS_DIR + + Write-Verbose -Message "Restoring addins from NuGet..." + $NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$ADDINS_DIR`"" + + if ($LASTEXITCODE -ne 0) { + Throw "An error occurred while restoring NuGet addins." + } + + Write-Verbose -Message ($NuGetOutput | out-string) + + Pop-Location +} + +# Restore modules from NuGet +if (Test-Path $MODULES_PACKAGES_CONFIG) { + Push-Location + Set-Location $MODULES_DIR + + Write-Verbose -Message "Restoring modules from NuGet..." + $NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$MODULES_DIR`"" + + if ($LASTEXITCODE -ne 0) { + Throw "An error occurred while restoring NuGet modules." + } + + Write-Verbose -Message ($NuGetOutput | out-string) + + Pop-Location +} + +# Make sure that Cake has been installed. +if (!(Test-Path $CAKE_EXE)) { + Throw "Could not find Cake.exe at $CAKE_EXE" +} + + + +# Build Cake arguments +$cakeArguments = @("$Script"); +if ($Target) { $cakeArguments += "-target=$Target" } +if ($Configuration) { $cakeArguments += "-configuration=$Configuration" } +if ($Verbosity) { $cakeArguments += "-verbosity=$Verbosity" } +if ($ShowDescription) { $cakeArguments += "-showdescription" } +if ($DryRun) { $cakeArguments += "-dryrun" } +if ($Experimental) { $cakeArguments += "-experimental" } +if ($Mono) { $cakeArguments += "-mono" } +$cakeArguments += $ScriptArgs + +# Start Cake +Write-Host "Running build script..." +&$CAKE_EXE $cakeArguments +exit $LASTEXITCODE diff --git a/build.sh b/build.sh index 6e14489..6fdb518 100644 --- a/build.sh +++ b/build.sh @@ -1,101 +1,101 @@ -#!/usr/bin/env bash - -########################################################################## -# This is the Cake bootstrapper script for Linux and OS X. -# This file was downloaded from https://github.com/cake-build/resources -# Feel free to change this file to fit your needs. -########################################################################## - -# Define directories. -SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -TOOLS_DIR=$SCRIPT_DIR/tools -NUGET_EXE=$TOOLS_DIR/nuget.exe -CAKE_EXE=$TOOLS_DIR/Cake/Cake.exe -PACKAGES_CONFIG=$TOOLS_DIR/packages.config -PACKAGES_CONFIG_MD5=$TOOLS_DIR/packages.config.md5sum - -# Define md5sum or md5 depending on Linux/OSX -MD5_EXE= -if [[ "$(uname -s)" == "Darwin" ]]; then - MD5_EXE="md5 -r" -else - MD5_EXE="md5sum" -fi - -# Define default arguments. -SCRIPT="build.cake" -TARGET="Default" -CONFIGURATION="Release" -VERBOSITY="verbose" -DRYRUN= -SHOW_VERSION=false -SCRIPT_ARGUMENTS=() - -# Parse arguments. -for i in "$@"; do - case $1 in - -s|--script) SCRIPT="$2"; shift ;; - -t|--target) TARGET="$2"; shift ;; - -c|--configuration) CONFIGURATION="$2"; shift ;; - -v|--verbosity) VERBOSITY="$2"; shift ;; - -d|--dryrun) DRYRUN="-dryrun" ;; - --version) SHOW_VERSION=true ;; - --) shift; SCRIPT_ARGUMENTS+=("$@"); break ;; - *) SCRIPT_ARGUMENTS+=("$1") ;; - esac - shift -done - -# Make sure the tools folder exist. -if [ ! -d "$TOOLS_DIR" ]; then - mkdir "$TOOLS_DIR" -fi - -# Make sure that packages.config exist. -if [ ! -f "$TOOLS_DIR/packages.config" ]; then - echo "Downloading packages.config..." - curl -Lsfo "$TOOLS_DIR/packages.config" https://cakebuild.net/download/bootstrapper/packages - if [ $? -ne 0 ]; then - echo "An error occurred while downloading packages.config." - exit 1 - fi -fi - -# Download NuGet if it does not exist. -if [ ! -f "$NUGET_EXE" ]; then - echo "Downloading NuGet..." - curl -Lsfo "$NUGET_EXE" https://dist.nuget.org/win-x86-commandline/latest/nuget.exe - if [ $? -ne 0 ]; then - echo "An error occurred while downloading nuget.exe." - exit 1 - fi -fi - -# Restore tools from NuGet. -pushd "$TOOLS_DIR" >/dev/null -if [ ! -f $PACKAGES_CONFIG_MD5 ] || [ "$( cat $PACKAGES_CONFIG_MD5 | sed 's/\r$//' )" != "$( $MD5_EXE $PACKAGES_CONFIG | awk '{ print $1 }' )" ]; then - find . -type d ! -name . | xargs rm -rf -fi - -mono "$NUGET_EXE" install -ExcludeVersion -if [ $? -ne 0 ]; then - echo "Could not restore NuGet packages." - exit 1 -fi - -$MD5_EXE $PACKAGES_CONFIG | awk '{ print $1 }' >| $PACKAGES_CONFIG_MD5 - -popd >/dev/null - -# Make sure that Cake has been installed. -if [ ! -f "$CAKE_EXE" ]; then - echo "Could not find Cake.exe at '$CAKE_EXE'." - exit 1 -fi - -# Start Cake -if $SHOW_VERSION; then - exec mono "$CAKE_EXE" -version -else - exec mono "$CAKE_EXE" $SCRIPT -verbosity=$VERBOSITY -configuration=$CONFIGURATION -target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}" -fi +#!/usr/bin/env bash + +########################################################################## +# This is the Cake bootstrapper script for Linux and OS X. +# This file was downloaded from https://github.com/cake-build/resources +# Feel free to change this file to fit your needs. +########################################################################## + +# Define directories. +SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +TOOLS_DIR=$SCRIPT_DIR/tools +NUGET_EXE=$TOOLS_DIR/nuget.exe +CAKE_EXE=$TOOLS_DIR/Cake/Cake.exe +PACKAGES_CONFIG=$TOOLS_DIR/packages.config +PACKAGES_CONFIG_MD5=$TOOLS_DIR/packages.config.md5sum + +# Define md5sum or md5 depending on Linux/OSX +MD5_EXE= +if [[ "$(uname -s)" == "Darwin" ]]; then + MD5_EXE="md5 -r" +else + MD5_EXE="md5sum" +fi + +# Define default arguments. +SCRIPT="build.cake" +TARGET="Default" +CONFIGURATION="Release" +VERBOSITY="verbose" +DRYRUN= +SHOW_VERSION=false +SCRIPT_ARGUMENTS=() + +# Parse arguments. +for i in "$@"; do + case $1 in + -s|--script) SCRIPT="$2"; shift ;; + -t|--target) TARGET="$2"; shift ;; + -c|--configuration) CONFIGURATION="$2"; shift ;; + -v|--verbosity) VERBOSITY="$2"; shift ;; + -d|--dryrun) DRYRUN="-dryrun" ;; + --version) SHOW_VERSION=true ;; + --) shift; SCRIPT_ARGUMENTS+=("$@"); break ;; + *) SCRIPT_ARGUMENTS+=("$1") ;; + esac + shift +done + +# Make sure the tools folder exist. +if [ ! -d "$TOOLS_DIR" ]; then + mkdir "$TOOLS_DIR" +fi + +# Make sure that packages.config exist. +if [ ! -f "$TOOLS_DIR/packages.config" ]; then + echo "Downloading packages.config..." + curl -Lsfo "$TOOLS_DIR/packages.config" https://cakebuild.net/download/bootstrapper/packages + if [ $? -ne 0 ]; then + echo "An error occurred while downloading packages.config." + exit 1 + fi +fi + +# Download NuGet if it does not exist. +if [ ! -f "$NUGET_EXE" ]; then + echo "Downloading NuGet..." + curl -Lsfo "$NUGET_EXE" https://dist.nuget.org/win-x86-commandline/latest/nuget.exe + if [ $? -ne 0 ]; then + echo "An error occurred while downloading nuget.exe." + exit 1 + fi +fi + +# Restore tools from NuGet. +pushd "$TOOLS_DIR" >/dev/null +if [ ! -f $PACKAGES_CONFIG_MD5 ] || [ "$( cat $PACKAGES_CONFIG_MD5 | sed 's/\r$//' )" != "$( $MD5_EXE $PACKAGES_CONFIG | awk '{ print $1 }' )" ]; then + find . -type d ! -name . | xargs rm -rf +fi + +mono "$NUGET_EXE" install -ExcludeVersion +if [ $? -ne 0 ]; then + echo "Could not restore NuGet packages." + exit 1 +fi + +$MD5_EXE $PACKAGES_CONFIG | awk '{ print $1 }' >| $PACKAGES_CONFIG_MD5 + +popd >/dev/null + +# Make sure that Cake has been installed. +if [ ! -f "$CAKE_EXE" ]; then + echo "Could not find Cake.exe at '$CAKE_EXE'." + exit 1 +fi + +# Start Cake +if $SHOW_VERSION; then + exec mono "$CAKE_EXE" -version +else + exec mono "$CAKE_EXE" $SCRIPT -verbosity=$VERBOSITY -configuration=$CONFIGURATION -target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}" +fi diff --git a/cake/paths.cake b/cake/paths.cake index 8b73697..afd5c19 100644 --- a/cake/paths.cake +++ b/cake/paths.cake @@ -1,20 +1,20 @@ -public static class Paths -{ - public static FilePath SolutionFile => "cloudscribe.Syndication.sln"; - -} - -public static FilePath Combine(DirectoryPath directory, FilePath file) -{ - return directory.CombineWithFilePath(file); -} - -public DirectoryPath VS2017InstallDirectory(ICakeContext context) -{ - var programFilesX86 = context.Environment.GetSpecialPath(SpecialPath.ProgramFilesX86); - string[] editions = { "Enterprise", "Professional", "Community" }; - - return editions - .Select(edition => Directory($"{programFilesX86}/Microsoft Visual Studio/2017/{edition}")) - .FirstOrDefault(path => context.DirectoryExists(path)); -} +public static class Paths +{ + public static FilePath SolutionFile => "cloudscribe.Syndication.sln"; + +} + +public static FilePath Combine(DirectoryPath directory, FilePath file) +{ + return directory.CombineWithFilePath(file); +} + +public DirectoryPath VS2017InstallDirectory(ICakeContext context) +{ + var programFilesX86 = context.Environment.GetSpecialPath(SpecialPath.ProgramFilesX86); + string[] editions = { "Enterprise", "Professional", "Community" }; + + return editions + .Select(edition => Directory($"{programFilesX86}/Microsoft Visual Studio/2017/{edition}")) + .FirstOrDefault(path => context.DirectoryExists(path)); +} diff --git a/cloudscribe.Syndication.sln b/cloudscribe.Syndication.sln index cfc7e20..0a2793e 100644 --- a/cloudscribe.Syndication.sln +++ b/cloudscribe.Syndication.sln @@ -1,36 +1,36 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26228.4 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{63280118-755A-4A12-BDF7-30981593FCA6}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F1D69817-76FE-4086-9D57-0D1E0186BD0C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "cloudscribe.Syndication", "src\cloudscribe.Syndication\cloudscribe.Syndication.csproj", "{CED035BC-D77B-4C0B-8137-01F3CB8196FA}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "cloudscribe.Syndication.Web", "src\cloudscribe.Syndication.Web\cloudscribe.Syndication.Web.csproj", "{61675CCF-BC50-488B-B18E-2E050C361286}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {CED035BC-D77B-4C0B-8137-01F3CB8196FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CED035BC-D77B-4C0B-8137-01F3CB8196FA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CED035BC-D77B-4C0B-8137-01F3CB8196FA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CED035BC-D77B-4C0B-8137-01F3CB8196FA}.Release|Any CPU.Build.0 = Release|Any CPU - {61675CCF-BC50-488B-B18E-2E050C361286}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {61675CCF-BC50-488B-B18E-2E050C361286}.Debug|Any CPU.Build.0 = Debug|Any CPU - {61675CCF-BC50-488B-B18E-2E050C361286}.Release|Any CPU.ActiveCfg = Release|Any CPU - {61675CCF-BC50-488B-B18E-2E050C361286}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {CED035BC-D77B-4C0B-8137-01F3CB8196FA} = {63280118-755A-4A12-BDF7-30981593FCA6} - {61675CCF-BC50-488B-B18E-2E050C361286} = {63280118-755A-4A12-BDF7-30981593FCA6} - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26228.4 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{63280118-755A-4A12-BDF7-30981593FCA6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F1D69817-76FE-4086-9D57-0D1E0186BD0C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "cloudscribe.Syndication", "src\cloudscribe.Syndication\cloudscribe.Syndication.csproj", "{CED035BC-D77B-4C0B-8137-01F3CB8196FA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "cloudscribe.Syndication.Web", "src\cloudscribe.Syndication.Web\cloudscribe.Syndication.Web.csproj", "{61675CCF-BC50-488B-B18E-2E050C361286}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CED035BC-D77B-4C0B-8137-01F3CB8196FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CED035BC-D77B-4C0B-8137-01F3CB8196FA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CED035BC-D77B-4C0B-8137-01F3CB8196FA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CED035BC-D77B-4C0B-8137-01F3CB8196FA}.Release|Any CPU.Build.0 = Release|Any CPU + {61675CCF-BC50-488B-B18E-2E050C361286}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {61675CCF-BC50-488B-B18E-2E050C361286}.Debug|Any CPU.Build.0 = Debug|Any CPU + {61675CCF-BC50-488B-B18E-2E050C361286}.Release|Any CPU.ActiveCfg = Release|Any CPU + {61675CCF-BC50-488B-B18E-2E050C361286}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {CED035BC-D77B-4C0B-8137-01F3CB8196FA} = {63280118-755A-4A12-BDF7-30981593FCA6} + {61675CCF-BC50-488B-B18E-2E050C361286} = {63280118-755A-4A12-BDF7-30981593FCA6} + EndGlobalSection +EndGlobal diff --git a/src/cloudscribe.Syndication.Web/Controllers/AtomController.cs b/src/cloudscribe.Syndication.Web/Controllers/AtomController.cs index c504d44..b3983eb 100644 --- a/src/cloudscribe.Syndication.Web/Controllers/AtomController.cs +++ b/src/cloudscribe.Syndication.Web/Controllers/AtomController.cs @@ -1,21 +1,21 @@ -// Copyright (c) Source Tree Solutions, LLC. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -// Author: Joe Audette -// Created: 2016-04-01 -// Last Modified: 2016-04-01 -// -// TODO: implement? having used my best google fu it seems best practice is to only provide one feed -// https://blog.superfeedr.com/feeds/rss/atom/best%20practice/feed-publishing-best-practices/ -// rather than both an rss feed and an atom feed -// since the rss feed is working and is probably all I really need I'm leaving this -// unimplemented for now. if someone else wants to implement it and send a pull request -// that would be great - -namespace cloudscribe.Syndication.Web.Controllers -{ - //http://www.atomenabled.org/developers/syndication/ - - //public class AtomController - //{ - //} -} +// Copyright (c) Source Tree Solutions, LLC. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Author: Joe Audette +// Created: 2016-04-01 +// Last Modified: 2016-04-01 +// +// TODO: implement? having used my best google fu it seems best practice is to only provide one feed +// https://blog.superfeedr.com/feeds/rss/atom/best%20practice/feed-publishing-best-practices/ +// rather than both an rss feed and an atom feed +// since the rss feed is working and is probably all I really need I'm leaving this +// unimplemented for now. if someone else wants to implement it and send a pull request +// that would be great + +namespace cloudscribe.Syndication.Web.Controllers +{ + //http://www.atomenabled.org/developers/syndication/ + + //public class AtomController + //{ + //} +} diff --git a/src/cloudscribe.Syndication.Web/Controllers/RssController.cs b/src/cloudscribe.Syndication.Web/Controllers/RssController.cs index 2ec7fc3..d14f40b 100644 --- a/src/cloudscribe.Syndication.Web/Controllers/RssController.cs +++ b/src/cloudscribe.Syndication.Web/Controllers/RssController.cs @@ -1,108 +1,108 @@ -// Copyright (c) Source Tree Solutions, LLC. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -// Author: Joe Audette -// Created: 2016-04-01 -// Last Modified: 2018-06-19 -// - - -using cloudscribe.Syndication.Models.Rss; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; -using System.Xml.Linq; - -namespace cloudscribe.Syndication.Web.Controllers -{ - [ApiExplorerSettings(IgnoreApi = true)] - public class RssController : Controller - { - public RssController( - ILogger logger, - IEnumerable channelProviders = null, - IChannelProviderResolver channelResolver = null, - IXmlFormatter xmlFormatter = null - ) - { - Log = logger; - ChannelProviders = channelProviders ?? new List(); - if (channelProviders is List) - { - var list = channelProviders as List; - if (list.Count == 0) - { - list.Add(new NullChannelProvider()); - } - } - - ChannelResolver = channelResolver ?? new DefaultChannelProviderResolver(); - XmlFormatter = xmlFormatter ?? new DefaultXmlFormatter(); - - } - - protected ILogger Log { get; private set; } - protected IChannelProviderResolver ChannelResolver { get; private set; } - protected IEnumerable ChannelProviders { get; private set; } - protected IChannelProvider CurrentChannelProvider { get; private set; } - protected IXmlFormatter XmlFormatter { get; private set; } - - [HttpGet] - [ResponseCache(CacheProfileName = "RssCacheProfile")] - [Route("api/rss")] - public virtual async Task Index() - { - CurrentChannelProvider = ChannelResolver.GetCurrentChannelProvider(ChannelProviders); - - if (CurrentChannelProvider == null) - { - Response.StatusCode = 404; - return new EmptyResult(); - } - - var currentChannel = await CurrentChannelProvider.GetChannel(); - - if (currentChannel == null) - { - Response.StatusCode = 404; - return new EmptyResult(); - } - - if (ShouldRedirect(currentChannel, HttpContext)) - { - Response.Redirect(currentChannel.RemoteFeedUrl, false); - } - - var xml = XmlFormatter.BuildXml(currentChannel); - - var processingInstruction = new XProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"/rss-style.xsl\""); - xml.AddFirst(processingInstruction); - - return new XmlResult(xml); - - } - - protected bool ShouldRedirect(RssChannel channel, HttpContext context) - { - if (string.IsNullOrEmpty(channel.RemoteFeedUrl)) return false; - if (string.IsNullOrEmpty(channel.RemoteFeedProcessorUseAgentFragment)) return false; - - var userAgentHeaders = context.Request.Headers["User-Agent"]; - if (userAgentHeaders.Count == 0) return true; - - var userAgent = userAgentHeaders[0]; - if (string.IsNullOrEmpty(userAgent)) return true; - - if (userAgent.Contains(channel.RemoteFeedProcessorUseAgentFragment)) - { - return false; - } - - return true; - - } - - } -} +// Copyright (c) Source Tree Solutions, LLC. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Author: Joe Audette +// Created: 2016-04-01 +// Last Modified: 2018-06-19 +// + + +using cloudscribe.Syndication.Models.Rss; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace cloudscribe.Syndication.Web.Controllers +{ + [ApiExplorerSettings(IgnoreApi = true)] + public class RssController : Controller + { + public RssController( + ILogger logger, + IEnumerable channelProviders = null, + IChannelProviderResolver channelResolver = null, + IXmlFormatter xmlFormatter = null + ) + { + Log = logger; + ChannelProviders = channelProviders ?? new List(); + if (channelProviders is List) + { + var list = channelProviders as List; + if (list.Count == 0) + { + list.Add(new NullChannelProvider()); + } + } + + ChannelResolver = channelResolver ?? new DefaultChannelProviderResolver(); + XmlFormatter = xmlFormatter ?? new DefaultXmlFormatter(); + + } + + protected ILogger Log { get; private set; } + protected IChannelProviderResolver ChannelResolver { get; private set; } + protected IEnumerable ChannelProviders { get; private set; } + protected IChannelProvider CurrentChannelProvider { get; private set; } + protected IXmlFormatter XmlFormatter { get; private set; } + + [HttpGet] + [ResponseCache(CacheProfileName = "RssCacheProfile")] + [Route("api/rss")] + public virtual async Task Index() + { + CurrentChannelProvider = ChannelResolver.GetCurrentChannelProvider(ChannelProviders); + + if (CurrentChannelProvider == null) + { + Response.StatusCode = 404; + return new EmptyResult(); + } + + var currentChannel = await CurrentChannelProvider.GetChannel(); + + if (currentChannel == null) + { + Response.StatusCode = 404; + return new EmptyResult(); + } + + if (ShouldRedirect(currentChannel, HttpContext)) + { + Response.Redirect(currentChannel.RemoteFeedUrl, false); + } + + var xml = XmlFormatter.BuildXml(currentChannel); + + var processingInstruction = new XProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"/rss-style.xsl\""); + xml.AddFirst(processingInstruction); + + return new XmlResult(xml); + + } + + protected bool ShouldRedirect(RssChannel channel, HttpContext context) + { + if (string.IsNullOrEmpty(channel.RemoteFeedUrl)) return false; + if (string.IsNullOrEmpty(channel.RemoteFeedProcessorUseAgentFragment)) return false; + + var userAgentHeaders = context.Request.Headers["User-Agent"]; + if (userAgentHeaders.Count == 0) return true; + + var userAgent = userAgentHeaders[0]; + if (string.IsNullOrEmpty(userAgent)) return true; + + if (userAgent.Contains(channel.RemoteFeedProcessorUseAgentFragment)) + { + return false; + } + + return true; + + } + + } +} diff --git a/src/cloudscribe.Syndication.Web/README.md b/src/cloudscribe.Syndication.Web/README.md index 3c8a296..3a55a3b 100644 --- a/src/cloudscribe.Syndication.Web/README.md +++ b/src/cloudscribe.Syndication.Web/README.md @@ -1,17 +1,17 @@ -# cloudscribe.Syndication.Web - -An ASP.NET Core MVC controller for exposing RSS feeds using cloudscribe.Syndication. - -## Usage - -1. Install the NuGet package: - ```shell - dotnet add package cloudscribe.Syndication.Web - ``` -2. Reference this library in your ASP.NET Core project and configure routes/controllers as needed. - -For more details, see the [GitHub repo](https://github.com/cloudscribe/cloudscribe.Syndication). - -## License - -Licensed under the Apache-2.0 License. +# cloudscribe.Syndication.Web + +An ASP.NET Core MVC controller for exposing RSS feeds using cloudscribe.Syndication. + +## Usage + +1. Install the NuGet package: + ```shell + dotnet add package cloudscribe.Syndication.Web + ``` +2. Reference this library in your ASP.NET Core project and configure routes/controllers as needed. + +For more details, see the [GitHub repo](https://github.com/cloudscribe/cloudscribe.Syndication). + +## License + +Licensed under the Apache-2.0 License. diff --git a/src/cloudscribe.Syndication.Web/XmlResult.cs b/src/cloudscribe.Syndication.Web/XmlResult.cs index c6fd238..b352366 100644 --- a/src/cloudscribe.Syndication.Web/XmlResult.cs +++ b/src/cloudscribe.Syndication.Web/XmlResult.cs @@ -1,64 +1,64 @@ -using Microsoft.AspNetCore.Mvc; -using System.Threading; -using System.Threading.Tasks; -using System.Xml.Linq; - -//http://tech-journals.com/jonow/2012/01/25/implementing-xml-rpc-services-with-asp-net-mvc -//http://www.aaron-powell.com/posts/2010-06-16-aspnet-mvc-xml-action-result.html -//http://www.aaron-powell.com/posts/2010-06-16-aspnet-mvc-xml-action-result.html -//https://github.com/myquay/Chq.XmlRpc.Mvc - -namespace cloudscribe.Syndication.Web -{ - public class XmlResult : ActionResult - { - public XDocument Xml { get; private set; } - public string ContentType { get; set; } - //public Encoding Encoding { get; set; } - - public XmlResult(XDocument xml) - { - this.Xml = xml; - this.ContentType = "text/xml"; - } - -////#if !DNXCORE50 -// public override void ExecuteResult(ActionContext context) -// { -// //context.HttpContext.Response.ContentType = this.ContentType; -// //XmlTextWriter writer = new XmlTextWriter(context.HttpContext.Response.Body, Encoding.UTF8); -// //Xml.WriteTo(writer); -// //writer.Close(); - -// context.HttpContext.Response.ContentType = this.ContentType; -// if (Xml != null) -// { -// Xml.Save(context.HttpContext.Response.Body, SaveOptions.DisableFormatting); - -// } -// } -////#endif - - public override async Task ExecuteResultAsync(ActionContext context) - { - context.HttpContext.Response.ContentType = this.ContentType; - - if (Xml != null) - { - await Xml.SaveAsync(context.HttpContext.Response.Body, SaveOptions.DisableFormatting, CancellationToken.None); - //Xml.Save(context.HttpContext.Response.Body, SaveOptions.DisableFormatting); - return; - - } - else - { - await base.ExecuteResultAsync(context); - } - } - } - - //public class Utf8StringWriter : StringWriter - //{ - // public override Encoding Encoding { get { return Encoding.UTF8; } } - //} -} +using Microsoft.AspNetCore.Mvc; +using System.Threading; +using System.Threading.Tasks; +using System.Xml.Linq; + +//http://tech-journals.com/jonow/2012/01/25/implementing-xml-rpc-services-with-asp-net-mvc +//http://www.aaron-powell.com/posts/2010-06-16-aspnet-mvc-xml-action-result.html +//http://www.aaron-powell.com/posts/2010-06-16-aspnet-mvc-xml-action-result.html +//https://github.com/myquay/Chq.XmlRpc.Mvc + +namespace cloudscribe.Syndication.Web +{ + public class XmlResult : ActionResult + { + public XDocument Xml { get; private set; } + public string ContentType { get; set; } + //public Encoding Encoding { get; set; } + + public XmlResult(XDocument xml) + { + this.Xml = xml; + this.ContentType = "text/xml"; + } + +////#if !DNXCORE50 +// public override void ExecuteResult(ActionContext context) +// { +// //context.HttpContext.Response.ContentType = this.ContentType; +// //XmlTextWriter writer = new XmlTextWriter(context.HttpContext.Response.Body, Encoding.UTF8); +// //Xml.WriteTo(writer); +// //writer.Close(); + +// context.HttpContext.Response.ContentType = this.ContentType; +// if (Xml != null) +// { +// Xml.Save(context.HttpContext.Response.Body, SaveOptions.DisableFormatting); + +// } +// } +////#endif + + public override async Task ExecuteResultAsync(ActionContext context) + { + context.HttpContext.Response.ContentType = this.ContentType; + + if (Xml != null) + { + await Xml.SaveAsync(context.HttpContext.Response.Body, SaveOptions.DisableFormatting, CancellationToken.None); + //Xml.Save(context.HttpContext.Response.Body, SaveOptions.DisableFormatting); + return; + + } + else + { + await base.ExecuteResultAsync(context); + } + } + } + + //public class Utf8StringWriter : StringWriter + //{ + // public override Encoding Encoding { get { return Encoding.UTF8; } } + //} +} diff --git a/src/cloudscribe.Syndication.Web/buildTransitive/cloudscribe.Syndication.Web.targets b/src/cloudscribe.Syndication.Web/buildTransitive/cloudscribe.Syndication.Web.targets index b506286..851373e 100644 --- a/src/cloudscribe.Syndication.Web/buildTransitive/cloudscribe.Syndication.Web.targets +++ b/src/cloudscribe.Syndication.Web/buildTransitive/cloudscribe.Syndication.Web.targets @@ -1,17 +1,17 @@ - - - - - - - - - - - - + + + + + + + + + + + + \ No newline at end of file diff --git a/src/cloudscribe.Syndication.Web/buildTransitive/rss-style.xsl b/src/cloudscribe.Syndication.Web/buildTransitive/rss-style.xsl index 51cd5e1..67fef57 100644 --- a/src/cloudscribe.Syndication.Web/buildTransitive/rss-style.xsl +++ b/src/cloudscribe.Syndication.Web/buildTransitive/rss-style.xsl @@ -1,46 +1,46 @@ - - - - - - - - <xsl:value-of select="/rss/channel/title"/> - - - - - - -
-

- -

-

- -

-
-
- - - -
- - -
+ + + + + + + + <xsl:value-of select="/rss/channel/title"/> + + + + + + +
+

+ +

+

+ +

+
+
+ + + +
+ + +
\ No newline at end of file diff --git a/src/cloudscribe.Syndication.Web/buildTransitive/rss.css b/src/cloudscribe.Syndication.Web/buildTransitive/rss.css index 145910c..8f9667e 100644 --- a/src/cloudscribe.Syndication.Web/buildTransitive/rss.css +++ b/src/cloudscribe.Syndication.Web/buildTransitive/rss.css @@ -1,59 +1,59 @@ -* { - box-sizing: border-box; - font-family: sans-serif; - line-height: 1.4; - margin: 0; - padding: 0; -} - -html { - background: #FFFFFF; - color: #212529; -} - -body { - padding: 1.5rem; -} - -a { - color: #337ab7; -} - - a:hover { - color: #296292; - } - -main, header { - margin-block-end: 3rem; - margin-inline: auto; - max-inline-size: 80ch; -} - -article { - margin-block-end: 3rem; -} - -h1 { - font-size: 2.5rem; - line-height: 1.2; - margin-block: 1rem; -} - -h2 { - font-size: 2rem; - margin-block: 2rem; -} - -h3 { - font-size: 1.75rem; - margin-block: 1rem; -} - -p { - font-size: 1.25rem; - margin-block-end: 1rem; -} - -small { - font-size: 1rem; +* { + box-sizing: border-box; + font-family: sans-serif; + line-height: 1.4; + margin: 0; + padding: 0; +} + +html { + background: #FFFFFF; + color: #212529; +} + +body { + padding: 1.5rem; +} + +a { + color: #337ab7; +} + + a:hover { + color: #296292; + } + +main, header { + margin-block-end: 3rem; + margin-inline: auto; + max-inline-size: 80ch; +} + +article { + margin-block-end: 3rem; +} + +h1 { + font-size: 2.5rem; + line-height: 1.2; + margin-block: 1rem; +} + +h2 { + font-size: 2rem; + margin-block: 2rem; +} + +h3 { + font-size: 1.75rem; + margin-block: 1rem; +} + +p { + font-size: 1.25rem; + margin-block-end: 1rem; +} + +small { + font-size: 1rem; } \ No newline at end of file diff --git a/src/cloudscribe.Syndication.Web/cloudscribe.Syndication.Web.csproj b/src/cloudscribe.Syndication.Web/cloudscribe.Syndication.Web.csproj index 5382022..7e10e96 100644 --- a/src/cloudscribe.Syndication.Web/cloudscribe.Syndication.Web.csproj +++ b/src/cloudscribe.Syndication.Web/cloudscribe.Syndication.Web.csproj @@ -1,38 +1,38 @@ - - - - asp.netcore mvc controller for rss feeds - 8.5.0 - net8.0 - Joe Audette - cloudscribe;syndication;rss;atom;feed - icon.png - https://github.com/cloudscribe/cloudscribe.Syndication - Apache-2.0 - https://github.com/cloudscribe/cloudscribe.Syndication.git - git - README.md - - - - - - - - - - - - - - - - - - - - - - - - + + + + asp.netcore mvc controller for rss feeds + 8.6.0 + net8.0 + Joe Audette + cloudscribe;syndication;rss;atom;feed + icon.png + https://github.com/cloudscribe/cloudscribe.Syndication + Apache-2.0 + https://github.com/cloudscribe/cloudscribe.Syndication.git + git + README.md + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/cloudscribe.Syndication/Guard.cs b/src/cloudscribe.Syndication/Guard.cs index ea0af4f..0818819 100644 --- a/src/cloudscribe.Syndication/Guard.cs +++ b/src/cloudscribe.Syndication/Guard.cs @@ -1,43 +1,43 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace cloudscribe.Syndication.Models -{ - public static class Guard - { - public static void ArgumentNotNull(object value, string name) - { - if (value == null) - { - throw new ArgumentNullException(name); - } - } - - public static void ArgumentNotNullOrEmptyString(string value, string name) - { - if (string.IsNullOrEmpty(value)) - { - throw new ArgumentNullException(name); - } - } - - - public static void ArgumentNotGreaterThan(int value, string name, int maximum) - { - if (value > maximum) - { - throw new ArgumentOutOfRangeException(name); - } - } - - public static void ArgumentNotLessThan(long value, string name, long minimum) - { - if (value < minimum) - { - throw new ArgumentOutOfRangeException(name); - } - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace cloudscribe.Syndication.Models +{ + public static class Guard + { + public static void ArgumentNotNull(object value, string name) + { + if (value == null) + { + throw new ArgumentNullException(name); + } + } + + public static void ArgumentNotNullOrEmptyString(string value, string name) + { + if (string.IsNullOrEmpty(value)) + { + throw new ArgumentNullException(name); + } + } + + + public static void ArgumentNotGreaterThan(int value, string name, int maximum) + { + if (value > maximum) + { + throw new ArgumentOutOfRangeException(name); + } + } + + public static void ArgumentNotLessThan(long value, string name, long minimum) + { + if (value < minimum) + { + throw new ArgumentOutOfRangeException(name); + } + } + } +} diff --git a/src/cloudscribe.Syndication/Models/Atom/Atom10Constants.cs b/src/cloudscribe.Syndication/Models/Atom/Atom10Constants.cs index d9dc9bb..73e86dc 100644 --- a/src/cloudscribe.Syndication/Models/Atom/Atom10Constants.cs +++ b/src/cloudscribe.Syndication/Models/Atom/Atom10Constants.cs @@ -1,46 +1,46 @@ -namespace cloudscribe.Syndication.Models.Atom -{ - public static class Atom10Constants - { - public const string AlternateTag = "alternate"; - public const string Atom10Namespace = "http://www.w3.org/2005/Atom"; - public const string Atom10Prefix = "a10"; - public const string AtomMediaType = "application/atom+xml"; - public const string AuthorTag = "author"; - public const string CategoryTag = "category"; - public const string ContentTag = "content"; - public const string ContributorTag = "contributor"; - public const string EmailTag = "email"; - public const string EntryTag = "entry"; - public const string FeedTag = "feed"; - public const string GeneratorTag = "generator"; - public const string HrefTag = "href"; - public const string HtmlMediaType = "text/html"; - public const string HtmlType = "html"; - public const string IdTag = "id"; - public const string LabelTag = "label"; - public const string LengthTag = "length"; - public const string LinkTag = "link"; - public const string LogoTag = "logo"; - public const string NameTag = "name"; - public const string PlaintextType = "text"; - public const string PublishedTag = "published"; - public const string RelativeTag = "rel"; - public const string RightsTag = "rights"; - public const string SchemeTag = "scheme"; - public const string SelfTag = "self"; - public const string SourceFeedTag = "source"; - public const string SourceTag = "src"; - public const string SpecificationLink = "http://atompub.org/2005/08/17/draft-ietf-atompub-format-11.html"; - public const string SubtitleTag = "subtitle"; - public const string SummaryTag = "summary"; - public const string TermTag = "term"; - public const string TitleTag = "title"; - public const string TypeTag = "type"; - public const string UpdatedTag = "updated"; - public const string UriTag = "uri"; - public const string XHtmlMediaType = "application/xhtml+xml"; - public const string XHtmlType = "xhtml"; - public const string XmlMediaType = "text/xml"; - } -} +namespace cloudscribe.Syndication.Models.Atom +{ + public static class Atom10Constants + { + public const string AlternateTag = "alternate"; + public const string Atom10Namespace = "http://www.w3.org/2005/Atom"; + public const string Atom10Prefix = "a10"; + public const string AtomMediaType = "application/atom+xml"; + public const string AuthorTag = "author"; + public const string CategoryTag = "category"; + public const string ContentTag = "content"; + public const string ContributorTag = "contributor"; + public const string EmailTag = "email"; + public const string EntryTag = "entry"; + public const string FeedTag = "feed"; + public const string GeneratorTag = "generator"; + public const string HrefTag = "href"; + public const string HtmlMediaType = "text/html"; + public const string HtmlType = "html"; + public const string IdTag = "id"; + public const string LabelTag = "label"; + public const string LengthTag = "length"; + public const string LinkTag = "link"; + public const string LogoTag = "logo"; + public const string NameTag = "name"; + public const string PlaintextType = "text"; + public const string PublishedTag = "published"; + public const string RelativeTag = "rel"; + public const string RightsTag = "rights"; + public const string SchemeTag = "scheme"; + public const string SelfTag = "self"; + public const string SourceFeedTag = "source"; + public const string SourceTag = "src"; + public const string SpecificationLink = "http://atompub.org/2005/08/17/draft-ietf-atompub-format-11.html"; + public const string SubtitleTag = "subtitle"; + public const string SummaryTag = "summary"; + public const string TermTag = "term"; + public const string TitleTag = "title"; + public const string TypeTag = "type"; + public const string UpdatedTag = "updated"; + public const string UriTag = "uri"; + public const string XHtmlMediaType = "application/xhtml+xml"; + public const string XHtmlType = "xhtml"; + public const string XmlMediaType = "text/xml"; + } +} diff --git a/src/cloudscribe.Syndication/Models/Atom/AtomCategory.cs b/src/cloudscribe.Syndication/Models/Atom/AtomCategory.cs index de2e85f..f253e2b 100644 --- a/src/cloudscribe.Syndication/Models/Atom/AtomCategory.cs +++ b/src/cloudscribe.Syndication/Models/Atom/AtomCategory.cs @@ -1,140 +1,140 @@ -using System; -using System.Globalization; - -namespace cloudscribe.Syndication.Models.Atom -{ - public class AtomCategory - { - public AtomCategory() - { - - } - - public AtomCategory(string term) - { - this.Term = term; - } - - private Uri commonObjectBaseUri; - /// - /// Gets or sets the base URI other than the base URI of the document or external entity. - /// - /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. - /// - /// - /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, - /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). - /// - public Uri BaseUri - { - get - { - return commonObjectBaseUri; - } - - set - { - commonObjectBaseUri = value; - } - } - - private CultureInfo commonObjectLanguage; - /// - /// Gets or sets the natural or formal language in which the content is written. - /// - /// A that represents the natural or formal language in which the content is written. The default value is a null reference. - /// - /// - /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. - /// - /// - public CultureInfo Language - { - get - { - return commonObjectLanguage; - } - - set - { - commonObjectLanguage = value; - } - } - - private string categoryLabel = string.Empty; - /// - /// Gets or sets the human-readable label of this category for display in end-user applications. - /// - /// The human-readable label of this category for display in end-user applications. - /// - /// - /// The property is language-sensitive, with the natural language of the value being specified by the property. - /// Entities represent their corresponding characters, not markup. - /// - /// - public string Label - { - get - { - return categoryLabel; - } - - set - { - if (string.IsNullOrEmpty(value)) - { - categoryLabel = string.Empty; - } - else - { - categoryLabel = value.Trim(); - } - } - } - - private Uri categoryScheme; - /// - /// Gets or sets an IRI that identifies the categorization scheme used by this category. - /// - /// A that represents a Internationalized Resource Identifier (IRI) that identifies the categorization scheme used by this category. - /// - /// See RFC 3987: Internationalized Resource Identifiers for the IRI technical specification. - /// See System.Uri for enabling support for IRIs within Microsoft .NET framework applications. - /// - public Uri Scheme - { - get - { - return categoryScheme; - } - - set - { - categoryScheme = value; - } - } - - private string categoryTerm = string.Empty; - /// - /// Gets or sets a string that identifies this category. - /// - /// A string that identifies this category. - /// The is a null reference (Nothing in Visual Basic). - /// The is an empty string. - public string Term - { - get - { - return categoryTerm; - } - - set - { - Guard.ArgumentNotNullOrEmptyString(value, "value"); - categoryTerm = value.Trim(); - } - } - - - } -} +using System; +using System.Globalization; + +namespace cloudscribe.Syndication.Models.Atom +{ + public class AtomCategory + { + public AtomCategory() + { + + } + + public AtomCategory(string term) + { + this.Term = term; + } + + private Uri commonObjectBaseUri; + /// + /// Gets or sets the base URI other than the base URI of the document or external entity. + /// + /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. + /// + /// + /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, + /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). + /// + public Uri BaseUri + { + get + { + return commonObjectBaseUri; + } + + set + { + commonObjectBaseUri = value; + } + } + + private CultureInfo commonObjectLanguage; + /// + /// Gets or sets the natural or formal language in which the content is written. + /// + /// A that represents the natural or formal language in which the content is written. The default value is a null reference. + /// + /// + /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. + /// + /// + public CultureInfo Language + { + get + { + return commonObjectLanguage; + } + + set + { + commonObjectLanguage = value; + } + } + + private string categoryLabel = string.Empty; + /// + /// Gets or sets the human-readable label of this category for display in end-user applications. + /// + /// The human-readable label of this category for display in end-user applications. + /// + /// + /// The property is language-sensitive, with the natural language of the value being specified by the property. + /// Entities represent their corresponding characters, not markup. + /// + /// + public string Label + { + get + { + return categoryLabel; + } + + set + { + if (string.IsNullOrEmpty(value)) + { + categoryLabel = string.Empty; + } + else + { + categoryLabel = value.Trim(); + } + } + } + + private Uri categoryScheme; + /// + /// Gets or sets an IRI that identifies the categorization scheme used by this category. + /// + /// A that represents a Internationalized Resource Identifier (IRI) that identifies the categorization scheme used by this category. + /// + /// See RFC 3987: Internationalized Resource Identifiers for the IRI technical specification. + /// See System.Uri for enabling support for IRIs within Microsoft .NET framework applications. + /// + public Uri Scheme + { + get + { + return categoryScheme; + } + + set + { + categoryScheme = value; + } + } + + private string categoryTerm = string.Empty; + /// + /// Gets or sets a string that identifies this category. + /// + /// A string that identifies this category. + /// The is a null reference (Nothing in Visual Basic). + /// The is an empty string. + public string Term + { + get + { + return categoryTerm; + } + + set + { + Guard.ArgumentNotNullOrEmptyString(value, "value"); + categoryTerm = value.Trim(); + } + } + + + } +} diff --git a/src/cloudscribe.Syndication/Models/Atom/AtomContent.cs b/src/cloudscribe.Syndication/Models/Atom/AtomContent.cs index df5c8fc..7bb3521 100644 --- a/src/cloudscribe.Syndication/Models/Atom/AtomContent.cs +++ b/src/cloudscribe.Syndication/Models/Atom/AtomContent.cs @@ -1,259 +1,259 @@ -using System; -using System.Globalization; - -namespace cloudscribe.Syndication.Models.Atom -{ - /// - /// Represents information that contains or links to the content of an . - /// - /// - /// - /// Atom Documents must conform to the following processing model rules. Atom Processors must interpret according to the first applicable rule. - /// - /// - /// - /// If the value of the property is text, the value of the property must not contain child elements. - /// Such text is intended to be presented to humans in a readable fashion. Thus, Atom Processors may collapse white space (including line breaks), - /// and display the text using typographic techniques such as justification and proportional fonts. - /// - /// - /// - /// - /// If the value of the property is html, the value of the property must not contain child elements - /// and should be suitable for handling as HTML. The HTML markup must be escaped. The HTML markup should be such that it could validly appear - /// directly within an HTML div element. Atom Processors that display the content may use the markup to aid in displaying it. - /// - /// - /// - /// - /// If the value of the property is xhtml, the the value of the property must be a single XHTML div element - /// and should be suitable for handling as XHTML. The XHTML div element itself must not be considered part of the content. Atom Processors that display the - /// content may use the markup to aid in displaying it. The escaped versions of characters represent those characters, not markup. - /// - /// - /// - /// - /// If the value is an XML media type or ends with +xml or /xml (case insensitive), - /// the content may include child elements and should be suitable for handling as the indicated media type. - /// If the is not provided, this would normally mean that the would contain a - /// single child element that would serve as the root element of the XML document of the indicated type. - /// - /// - /// - /// - /// If the value begins with text/ (case insensitive), the must not contain child elements. - /// - /// - /// - /// - /// For all other values , the must be a valid Base64 encoding, as described in - /// RFC 3548: The Base16, Base32, and Base64 Data Encodings, section 3. - /// When decoded, it should be suitable for handling as the indicated media type. In this case, the characters in - /// the Base64 encoding may be preceded and followed in the atom:content element by white space, and lines are - /// separated by a single newline (U+000A) character. - /// - /// - /// - /// - /// - public class AtomContent - { - - public AtomContent() - { - - } - - public AtomContent(string content) - { - this.Content = content; - } - - public AtomContent(string content, string encoding) : this(content) - { - this.ContentType = encoding; - } - - private Uri commonObjectBaseUri; - /// - /// Gets or sets the base URI other than the base URI of the document or external entity. - /// - /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. - /// - /// - /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, - /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). - /// - public Uri BaseUri - { - get - { - return commonObjectBaseUri; - } - - set - { - commonObjectBaseUri = value; - } - } - - private CultureInfo commonObjectLanguage; - /// - /// Gets or sets the natural or formal language in which the content is written. - /// - /// A that represents the natural or formal language in which the content is written. The default value is a null reference. - /// - /// - /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. - /// - /// - public CultureInfo Language - { - get - { - return commonObjectLanguage; - } - - set - { - commonObjectLanguage = value; - } - } - - private string contentValue = string.Empty; - /// - /// Gets or sets the local content of this entry. - /// - /// The local content of this entry. - /// - /// The property is language-sensitive, with the natural language of the value being specified by the property. - /// - public string Content - { - get - { - return contentValue; - } - - set - { - if (string.IsNullOrEmpty(value)) - { - contentValue = string.Empty; - } - else - { - contentValue = value.Trim(); - } - } - } - - private string contentMediaType = string.Empty; - /// - /// Gets or sets a value indicating the entity encoding of this content. - /// - /// A value indicating the entity encoding of this content. - /// - /// - /// The Atom specification defines three initial values for the type of entry content: - /// - /// - /// - /// html: The content must not contain child elements and should be suitable for handling as HTML. - /// The HTML markup must be escaped, and should be such that it could validly appear directly within an HTML div element. - /// Atom Processors that display the content may use the markup to aid in displaying it. - /// - /// - /// - /// - /// text: The content must not contain child elements. Such text is intended to be presented to humans in a readable fashion. - /// - /// - /// - /// - /// xhtml: The content must be a single XHTML div element and should be suitable for handling as XHTML. - /// The XHTML div element itself must not be considered part of the content. Atom Processors that display the content - /// may use the markup to aid in displaying it. The escaped versions of characters represent those characters, not markup. - /// - /// - /// - /// - /// - /// If the value is an XML media type or ends with +xml or /xml (case insensitive), - /// the content may include child elements and should be suitable for handling as the indicated media type. - /// If the is not provided, this would normally mean that the would contain a - /// single child element that would serve as the root element of the XML document of the indicated type. - /// - /// - /// If the content type is not one of those specified above, it must conform to the syntax of a MIME media type, but must not be a composite type. - /// See RFC 4288: Media Type Specifications and Registration Procedures for more details. - /// - /// - /// If the value begins with text/ (case insensitive), the must not contain child elements. - /// - /// - /// For all other values , the must be a valid Base64 encoding, as described in - /// RFC 3548: The Base16, Base32, and Base64 Data Encodings, section 3. - /// When decoded, it should be suitable for handling as the indicated media type. In this case, the characters in - /// the Base64 encoding may be preceded and followed in the atom:content element by white space, and lines are - /// separated by a single newline (U+000A) character. - /// - /// - /// If neither the nor the is provided, - /// Atom Processors must behave as though the property has a value of text. - /// - /// - public string ContentType - { - get - { - return contentMediaType; - } - - set - { - if (string.IsNullOrEmpty(value)) - { - contentMediaType = string.Empty; - } - else - { - contentMediaType = value.Trim(); - } - } - } - - private Uri contentSource; - /// - /// Gets or sets an IRI that identifies the remote location of this content. - /// - /// A that represents a Internationalized Resource Identifier (IRI) that identifies the remote location of this content. - /// - /// - /// If a property is specified, the property must be empty. - /// Atom Processors may use the IRI to retrieve the content and may choose to ignore remote content or to present it in a different manner than local content. - /// - /// - /// If a property is specified, the should be provided and must be a - /// MIME media type, rather than text, html, or xhtml. The value is advisory; - /// that is to say, when the corresponding URI (mapped from an IRI, if necessary) is dereferenced, if the server providing that content also provides - /// a media type, the server-provided media type is authoritative. - /// - /// See RFC 3987: Internationalized Resource Identifiers for the IRI technical specification. - /// See System.Uri for enabling support for IRIs within Microsoft .NET framework applications. - /// - public Uri Source - { - get - { - return contentSource; - } - - set - { - contentSource = value; - } - } - - } -} +using System; +using System.Globalization; + +namespace cloudscribe.Syndication.Models.Atom +{ + /// + /// Represents information that contains or links to the content of an . + /// + /// + /// + /// Atom Documents must conform to the following processing model rules. Atom Processors must interpret according to the first applicable rule. + /// + /// + /// + /// If the value of the property is text, the value of the property must not contain child elements. + /// Such text is intended to be presented to humans in a readable fashion. Thus, Atom Processors may collapse white space (including line breaks), + /// and display the text using typographic techniques such as justification and proportional fonts. + /// + /// + /// + /// + /// If the value of the property is html, the value of the property must not contain child elements + /// and should be suitable for handling as HTML. The HTML markup must be escaped. The HTML markup should be such that it could validly appear + /// directly within an HTML div element. Atom Processors that display the content may use the markup to aid in displaying it. + /// + /// + /// + /// + /// If the value of the property is xhtml, the the value of the property must be a single XHTML div element + /// and should be suitable for handling as XHTML. The XHTML div element itself must not be considered part of the content. Atom Processors that display the + /// content may use the markup to aid in displaying it. The escaped versions of characters represent those characters, not markup. + /// + /// + /// + /// + /// If the value is an XML media type or ends with +xml or /xml (case insensitive), + /// the content may include child elements and should be suitable for handling as the indicated media type. + /// If the is not provided, this would normally mean that the would contain a + /// single child element that would serve as the root element of the XML document of the indicated type. + /// + /// + /// + /// + /// If the value begins with text/ (case insensitive), the must not contain child elements. + /// + /// + /// + /// + /// For all other values , the must be a valid Base64 encoding, as described in + /// RFC 3548: The Base16, Base32, and Base64 Data Encodings, section 3. + /// When decoded, it should be suitable for handling as the indicated media type. In this case, the characters in + /// the Base64 encoding may be preceded and followed in the atom:content element by white space, and lines are + /// separated by a single newline (U+000A) character. + /// + /// + /// + /// + /// + public class AtomContent + { + + public AtomContent() + { + + } + + public AtomContent(string content) + { + this.Content = content; + } + + public AtomContent(string content, string encoding) : this(content) + { + this.ContentType = encoding; + } + + private Uri commonObjectBaseUri; + /// + /// Gets or sets the base URI other than the base URI of the document or external entity. + /// + /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. + /// + /// + /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, + /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). + /// + public Uri BaseUri + { + get + { + return commonObjectBaseUri; + } + + set + { + commonObjectBaseUri = value; + } + } + + private CultureInfo commonObjectLanguage; + /// + /// Gets or sets the natural or formal language in which the content is written. + /// + /// A that represents the natural or formal language in which the content is written. The default value is a null reference. + /// + /// + /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. + /// + /// + public CultureInfo Language + { + get + { + return commonObjectLanguage; + } + + set + { + commonObjectLanguage = value; + } + } + + private string contentValue = string.Empty; + /// + /// Gets or sets the local content of this entry. + /// + /// The local content of this entry. + /// + /// The property is language-sensitive, with the natural language of the value being specified by the property. + /// + public string Content + { + get + { + return contentValue; + } + + set + { + if (string.IsNullOrEmpty(value)) + { + contentValue = string.Empty; + } + else + { + contentValue = value.Trim(); + } + } + } + + private string contentMediaType = string.Empty; + /// + /// Gets or sets a value indicating the entity encoding of this content. + /// + /// A value indicating the entity encoding of this content. + /// + /// + /// The Atom specification defines three initial values for the type of entry content: + /// + /// + /// + /// html: The content must not contain child elements and should be suitable for handling as HTML. + /// The HTML markup must be escaped, and should be such that it could validly appear directly within an HTML div element. + /// Atom Processors that display the content may use the markup to aid in displaying it. + /// + /// + /// + /// + /// text: The content must not contain child elements. Such text is intended to be presented to humans in a readable fashion. + /// + /// + /// + /// + /// xhtml: The content must be a single XHTML div element and should be suitable for handling as XHTML. + /// The XHTML div element itself must not be considered part of the content. Atom Processors that display the content + /// may use the markup to aid in displaying it. The escaped versions of characters represent those characters, not markup. + /// + /// + /// + /// + /// + /// If the value is an XML media type or ends with +xml or /xml (case insensitive), + /// the content may include child elements and should be suitable for handling as the indicated media type. + /// If the is not provided, this would normally mean that the would contain a + /// single child element that would serve as the root element of the XML document of the indicated type. + /// + /// + /// If the content type is not one of those specified above, it must conform to the syntax of a MIME media type, but must not be a composite type. + /// See RFC 4288: Media Type Specifications and Registration Procedures for more details. + /// + /// + /// If the value begins with text/ (case insensitive), the must not contain child elements. + /// + /// + /// For all other values , the must be a valid Base64 encoding, as described in + /// RFC 3548: The Base16, Base32, and Base64 Data Encodings, section 3. + /// When decoded, it should be suitable for handling as the indicated media type. In this case, the characters in + /// the Base64 encoding may be preceded and followed in the atom:content element by white space, and lines are + /// separated by a single newline (U+000A) character. + /// + /// + /// If neither the nor the is provided, + /// Atom Processors must behave as though the property has a value of text. + /// + /// + public string ContentType + { + get + { + return contentMediaType; + } + + set + { + if (string.IsNullOrEmpty(value)) + { + contentMediaType = string.Empty; + } + else + { + contentMediaType = value.Trim(); + } + } + } + + private Uri contentSource; + /// + /// Gets or sets an IRI that identifies the remote location of this content. + /// + /// A that represents a Internationalized Resource Identifier (IRI) that identifies the remote location of this content. + /// + /// + /// If a property is specified, the property must be empty. + /// Atom Processors may use the IRI to retrieve the content and may choose to ignore remote content or to present it in a different manner than local content. + /// + /// + /// If a property is specified, the should be provided and must be a + /// MIME media type, rather than text, html, or xhtml. The value is advisory; + /// that is to say, when the corresponding URI (mapped from an IRI, if necessary) is dereferenced, if the server providing that content also provides + /// a media type, the server-provided media type is authoritative. + /// + /// See RFC 3987: Internationalized Resource Identifiers for the IRI technical specification. + /// See System.Uri for enabling support for IRIs within Microsoft .NET framework applications. + /// + public Uri Source + { + get + { + return contentSource; + } + + set + { + contentSource = value; + } + } + + } +} diff --git a/src/cloudscribe.Syndication/Models/Atom/AtomEntry.cs b/src/cloudscribe.Syndication/Models/Atom/AtomEntry.cs index 5ab0df8..602e4d4 100644 --- a/src/cloudscribe.Syndication/Models/Atom/AtomEntry.cs +++ b/src/cloudscribe.Syndication/Models/Atom/AtomEntry.cs @@ -1,390 +1,390 @@ -using System; -using System.Collections.ObjectModel; -using System.Globalization; - -namespace cloudscribe.Syndication.Models.Atom -{ - public class AtomEntry - { - - public AtomEntry() - { - - } - - /// - /// Initializes a new instance of the class using the supplied , , and . - /// - /// A object that represents a permanent, universally unique identifier for this entry. - /// A object that represents information that conveys a human-readable title for this entry. - /// - /// A that indicates the most recent instant in time when this entry was modified in a way the publisher considers significant. - /// The should be provided in Coordinated Universal Time (UTC). - /// - /// The is a null reference (Nothing in Visual Basic). - /// The is a null reference (Nothing in Visual Basic). - public AtomEntry(AtomId id, AtomTextConstruct title, DateTime utcUpdatedOn) - { - this.Id = id; - this.Title = title; - this.UpdatedOn = utcUpdatedOn; - } - - private Uri commonObjectBaseUri; - /// - /// Gets or sets the base URI other than the base URI of the document or external entity. - /// - /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. - /// - /// - /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, - /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). - /// - public Uri BaseUri - { - get - { - return commonObjectBaseUri; - } - - set - { - commonObjectBaseUri = value; - } - } - - private CultureInfo commonObjectLanguage; - /// - /// Gets or sets the natural or formal language in which the content is written. - /// - /// A that represents the natural or formal language in which the content is written. The default value is a null reference. - /// - /// - /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. - /// - /// - public CultureInfo Language - { - get - { - return commonObjectLanguage; - } - - set - { - commonObjectLanguage = value; - } - } - - - private Collection entryAuthors; - /// - /// Gets or sets the authors of this entry. - /// - /// A collection of objects that represent the authors of this entry. - /// - /// - /// An entry must contain one or more authors, unless the entry contains an object that contains an author or, - /// in an Atom Feed Document, the contains an author itself. - /// - /// - public Collection Authors - { - get - { - if (entryAuthors == null) - { - entryAuthors = new Collection(); - } - return entryAuthors; - } - } - - private Collection entryCategories; - /// - /// Gets or sets the categories associated with this entry. - /// - /// A collection of objects that represent the categories associated with this entry. - public Collection Categories - { - get - { - if (entryCategories == null) - { - entryCategories = new Collection(); - } - return entryCategories; - } - } - - private AtomContent entryContent; - /// - /// Gets or sets information that contains or links to the content of this entry. - /// - /// A object that represents information that contains or links to the content of this entry. - public AtomContent Content - { - get - { - return entryContent; - } - - set - { - entryContent = value; - } - } - - private Collection entryContributors; - /// - /// Gets or sets the entities who contributed to this entry. - /// - /// A collection of objects that represent the entities who contributed to this entry. - public Collection Contributors - { - get - { - if (entryContributors == null) - { - entryContributors = new Collection(); - } - return entryContributors; - } - } - - private static SyndicationContentFormat feedFormat = SyndicationContentFormat.Atom; - /// - /// Gets the that this syndication resource implements. - /// - /// The enumeration value that indicates the type of syndication format that this syndication resource implements. - public SyndicationContentFormat Format - { - get - { - return feedFormat; - } - } - - private AtomId entryId; - /// - /// Gets or sets a permanent, universally unique identifier for this entry. - /// - /// A object that represents a permanent, universally unique identifier for this entry. - /// - /// - /// When an Atom Document is relocated, migrated, syndicated, republished, exported, or imported, the content of its universally unique identifier must not change. - /// Put another way, an pertains to all instantiations of a particular ; revisions retain the same - /// content in their properties. It is suggested that the be stored along with the associated resource. - /// - /// - /// The is a null reference (Nothing in Visual Basic). - public AtomId Id - { - get - { - return entryId; - } - - set - { - Guard.ArgumentNotNull(value, "value"); - entryId = value; - } - } - - private Collection entryLinks; - /// - /// Gets or sets references from this entry to one or more Web resources. - /// - /// A collection of objects that represent references from this entry to one or more Web resources. - /// - /// - /// An entry must not contain more than one with a property of alternate - /// that has the same combination of and property values. - /// - /// - public Collection Links - { - get - { - if (entryLinks == null) - { - entryLinks = new Collection(); - } - return entryLinks; - } - } - - - private DateTime entryPublishedOn = DateTime.MinValue; - /// - /// Gets or sets a date-time indicating an instant in time associated with an event early in the life cycle of this entry. - /// - /// - /// A that indicates an instant in time associated with an event early in the life cycle of this entry. - /// The default value is , which indicates that no publication time was provided. - /// - /// - /// The should be provided in Coordinated Universal Time (UTC). - /// - public DateTime PublishedOn - { - get - { - return entryPublishedOn; - } - - set - { - entryPublishedOn = value; - } - } - - private AtomTextConstruct entryRights; - /// - /// Gets or sets information about rights held in and over this entry. - /// - /// A object that represents information about rights held in and over this entry. - /// - /// The property should not be used to convey machine-readable licensing information. - /// If an does not provide any rights information, then the of the containing feed, if present, is considered to apply to the entry. - /// - public AtomTextConstruct Rights - { - get - { - return entryRights; - } - - set - { - entryRights = value; - } - } - - - private AtomSource entrySource; - /// - /// Gets or sets the meta-data of the source feed that this entry was copied from. - /// - /// A object that represents the meta-data of the source feed that this entry was copied from. - /// - /// - /// The is designed to allow the aggregation of entries from different feeds while retaining information about an entry's source feed. - /// For this reason, Atom Processors that are performing such aggregation should include at least the required feed-level meta-data elements - /// (id, title, and updated) in the . - /// - /// - public AtomSource Source - { - get - { - return entrySource; - } - - set - { - entrySource = value; - } - } - - private AtomTextConstruct entrySummary; - /// - /// Gets or sets information that conveys a short summary, abstract, or excerpt for this entry. - /// - /// A object that represents information that conveys a short summary, abstract, or excerpt for this entry. - /// - /// - /// It is not advisable for the property to duplicate or because Atom Processors might assume there is a useful summary when there is none. - /// - /// - /// Entries must contain a in either of the following cases: - /// - /// - /// - /// The contains an property that has a property (and is thus empty). - /// - /// - /// - /// - /// The contains content that is encoded in Base64; i.e., the property of property - /// is a MIME media type, but is not an XML media type, - /// does not begin with text/, and does not end with /xml or +xml. - /// - /// - /// - /// - /// - public AtomTextConstruct Summary - { - get - { - return entrySummary; - } - - set - { - entrySummary = value; - } - } - - private AtomTextConstruct entryTitle; - /// - /// Gets or sets information that conveys a human-readable title for this entry. - /// - /// A object that represents information that conveys a human-readable title for this entry. - /// The is a null reference (Nothing in Visual Basic). - public AtomTextConstruct Title - { - get - { - return entryTitle; - } - - set - { - Guard.ArgumentNotNull(value, "value"); - entryTitle = value; - } - } - - - private DateTime entryUpdatedOn = DateTime.MinValue; - /// - /// Gets or sets a date-time indicating the most recent instant in time when this entry was modified in a way the publisher considers significant. - /// - /// - /// A that indicates the most recent instant in time when this entry was modified in a way the publisher considers significant. - /// Publishers may change the value of this element over time. The default value is , which indicates that no update time was provided. - /// - /// - /// The should be provided in Coordinated Universal Time (UTC). - /// - public DateTime UpdatedOn - { - get - { - return entryUpdatedOn; - } - - set - { - entryUpdatedOn = value; - } - } - - private static Version feedVersion = new Version(1, 0); - /// - /// Gets the of the that this syndication resource conforms to. - /// - /// The of the that this syndication resource conforms to. The default value is 2.0. - public Version Version - { - get - { - return feedVersion; - } - } - - } -} +using System; +using System.Collections.ObjectModel; +using System.Globalization; + +namespace cloudscribe.Syndication.Models.Atom +{ + public class AtomEntry + { + + public AtomEntry() + { + + } + + /// + /// Initializes a new instance of the class using the supplied , , and . + /// + /// A object that represents a permanent, universally unique identifier for this entry. + /// A object that represents information that conveys a human-readable title for this entry. + /// + /// A that indicates the most recent instant in time when this entry was modified in a way the publisher considers significant. + /// The should be provided in Coordinated Universal Time (UTC). + /// + /// The is a null reference (Nothing in Visual Basic). + /// The is a null reference (Nothing in Visual Basic). + public AtomEntry(AtomId id, AtomTextConstruct title, DateTime utcUpdatedOn) + { + this.Id = id; + this.Title = title; + this.UpdatedOn = utcUpdatedOn; + } + + private Uri commonObjectBaseUri; + /// + /// Gets or sets the base URI other than the base URI of the document or external entity. + /// + /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. + /// + /// + /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, + /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). + /// + public Uri BaseUri + { + get + { + return commonObjectBaseUri; + } + + set + { + commonObjectBaseUri = value; + } + } + + private CultureInfo commonObjectLanguage; + /// + /// Gets or sets the natural or formal language in which the content is written. + /// + /// A that represents the natural or formal language in which the content is written. The default value is a null reference. + /// + /// + /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. + /// + /// + public CultureInfo Language + { + get + { + return commonObjectLanguage; + } + + set + { + commonObjectLanguage = value; + } + } + + + private Collection entryAuthors; + /// + /// Gets or sets the authors of this entry. + /// + /// A collection of objects that represent the authors of this entry. + /// + /// + /// An entry must contain one or more authors, unless the entry contains an object that contains an author or, + /// in an Atom Feed Document, the contains an author itself. + /// + /// + public Collection Authors + { + get + { + if (entryAuthors == null) + { + entryAuthors = new Collection(); + } + return entryAuthors; + } + } + + private Collection entryCategories; + /// + /// Gets or sets the categories associated with this entry. + /// + /// A collection of objects that represent the categories associated with this entry. + public Collection Categories + { + get + { + if (entryCategories == null) + { + entryCategories = new Collection(); + } + return entryCategories; + } + } + + private AtomContent entryContent; + /// + /// Gets or sets information that contains or links to the content of this entry. + /// + /// A object that represents information that contains or links to the content of this entry. + public AtomContent Content + { + get + { + return entryContent; + } + + set + { + entryContent = value; + } + } + + private Collection entryContributors; + /// + /// Gets or sets the entities who contributed to this entry. + /// + /// A collection of objects that represent the entities who contributed to this entry. + public Collection Contributors + { + get + { + if (entryContributors == null) + { + entryContributors = new Collection(); + } + return entryContributors; + } + } + + private static SyndicationContentFormat feedFormat = SyndicationContentFormat.Atom; + /// + /// Gets the that this syndication resource implements. + /// + /// The enumeration value that indicates the type of syndication format that this syndication resource implements. + public SyndicationContentFormat Format + { + get + { + return feedFormat; + } + } + + private AtomId entryId; + /// + /// Gets or sets a permanent, universally unique identifier for this entry. + /// + /// A object that represents a permanent, universally unique identifier for this entry. + /// + /// + /// When an Atom Document is relocated, migrated, syndicated, republished, exported, or imported, the content of its universally unique identifier must not change. + /// Put another way, an pertains to all instantiations of a particular ; revisions retain the same + /// content in their properties. It is suggested that the be stored along with the associated resource. + /// + /// + /// The is a null reference (Nothing in Visual Basic). + public AtomId Id + { + get + { + return entryId; + } + + set + { + Guard.ArgumentNotNull(value, "value"); + entryId = value; + } + } + + private Collection entryLinks; + /// + /// Gets or sets references from this entry to one or more Web resources. + /// + /// A collection of objects that represent references from this entry to one or more Web resources. + /// + /// + /// An entry must not contain more than one with a property of alternate + /// that has the same combination of and property values. + /// + /// + public Collection Links + { + get + { + if (entryLinks == null) + { + entryLinks = new Collection(); + } + return entryLinks; + } + } + + + private DateTime entryPublishedOn = DateTime.MinValue; + /// + /// Gets or sets a date-time indicating an instant in time associated with an event early in the life cycle of this entry. + /// + /// + /// A that indicates an instant in time associated with an event early in the life cycle of this entry. + /// The default value is , which indicates that no publication time was provided. + /// + /// + /// The should be provided in Coordinated Universal Time (UTC). + /// + public DateTime PublishedOn + { + get + { + return entryPublishedOn; + } + + set + { + entryPublishedOn = value; + } + } + + private AtomTextConstruct entryRights; + /// + /// Gets or sets information about rights held in and over this entry. + /// + /// A object that represents information about rights held in and over this entry. + /// + /// The property should not be used to convey machine-readable licensing information. + /// If an does not provide any rights information, then the of the containing feed, if present, is considered to apply to the entry. + /// + public AtomTextConstruct Rights + { + get + { + return entryRights; + } + + set + { + entryRights = value; + } + } + + + private AtomSource entrySource; + /// + /// Gets or sets the meta-data of the source feed that this entry was copied from. + /// + /// A object that represents the meta-data of the source feed that this entry was copied from. + /// + /// + /// The is designed to allow the aggregation of entries from different feeds while retaining information about an entry's source feed. + /// For this reason, Atom Processors that are performing such aggregation should include at least the required feed-level meta-data elements + /// (id, title, and updated) in the . + /// + /// + public AtomSource Source + { + get + { + return entrySource; + } + + set + { + entrySource = value; + } + } + + private AtomTextConstruct entrySummary; + /// + /// Gets or sets information that conveys a short summary, abstract, or excerpt for this entry. + /// + /// A object that represents information that conveys a short summary, abstract, or excerpt for this entry. + /// + /// + /// It is not advisable for the property to duplicate or because Atom Processors might assume there is a useful summary when there is none. + /// + /// + /// Entries must contain a in either of the following cases: + /// + /// + /// + /// The contains an property that has a property (and is thus empty). + /// + /// + /// + /// + /// The contains content that is encoded in Base64; i.e., the property of property + /// is a MIME media type, but is not an XML media type, + /// does not begin with text/, and does not end with /xml or +xml. + /// + /// + /// + /// + /// + public AtomTextConstruct Summary + { + get + { + return entrySummary; + } + + set + { + entrySummary = value; + } + } + + private AtomTextConstruct entryTitle; + /// + /// Gets or sets information that conveys a human-readable title for this entry. + /// + /// A object that represents information that conveys a human-readable title for this entry. + /// The is a null reference (Nothing in Visual Basic). + public AtomTextConstruct Title + { + get + { + return entryTitle; + } + + set + { + Guard.ArgumentNotNull(value, "value"); + entryTitle = value; + } + } + + + private DateTime entryUpdatedOn = DateTime.MinValue; + /// + /// Gets or sets a date-time indicating the most recent instant in time when this entry was modified in a way the publisher considers significant. + /// + /// + /// A that indicates the most recent instant in time when this entry was modified in a way the publisher considers significant. + /// Publishers may change the value of this element over time. The default value is , which indicates that no update time was provided. + /// + /// + /// The should be provided in Coordinated Universal Time (UTC). + /// + public DateTime UpdatedOn + { + get + { + return entryUpdatedOn; + } + + set + { + entryUpdatedOn = value; + } + } + + private static Version feedVersion = new Version(1, 0); + /// + /// Gets the of the that this syndication resource conforms to. + /// + /// The of the that this syndication resource conforms to. The default value is 2.0. + public Version Version + { + get + { + return feedVersion; + } + } + + } +} diff --git a/src/cloudscribe.Syndication/Models/Atom/AtomFeed.cs b/src/cloudscribe.Syndication/Models/Atom/AtomFeed.cs index bb39e9c..cf5b96d 100644 --- a/src/cloudscribe.Syndication/Models/Atom/AtomFeed.cs +++ b/src/cloudscribe.Syndication/Models/Atom/AtomFeed.cs @@ -1,378 +1,378 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Globalization; - -namespace cloudscribe.Syndication.Models.Atom -{ - /// - /// Represents an Atom syndication feed, including metadata about the feed, and some or all of the entries associated with it. - /// - /// - /// - /// Atom is an an XML-based Web content and metadata syndication format that describes lists of related information known as feeds. - /// Feeds are composed of a number of items, known as entries, each with an extensible set of attached metadata. - /// - /// - /// This implementation conforms to the Atom 1.0 specification, which can be found - /// at http://www.atomenabled.org/developers/syndication/atom-format-spec.php. - /// - /// - /// If multiple objects with the same value appear in an Atom Feed Document, they represent the same entry. - /// Their timestamps should be different. If an Atom Feed Document contains multiple entries with the same , - /// Atom Processors may choose to display all of them or some subset of them. One typical behavior would be to display only the entry with the latest timestamp. - /// - /// - public class AtomFeed - { - public AtomFeed() - { - - } - - public AtomFeed(AtomId id, AtomTextConstruct title, DateTime utcUpdatedOn) - { - this.Id = id; - this.Title = title; - this.UpdatedOn = utcUpdatedOn; - } - - private Uri commonObjectBaseUri; - /// - /// Gets or sets the base URI other than the base URI of the document or external entity. - /// - /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. - /// - /// - /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, - /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). - /// - public Uri BaseUri - { - get - { - return commonObjectBaseUri; - } - - set - { - commonObjectBaseUri = value; - } - } - - - private CultureInfo commonObjectLanguage; - /// - /// Gets or sets the natural or formal language in which the content is written. - /// - /// A that represents the natural or formal language in which the content is written. The default value is a null reference. - /// - /// - /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. - /// - /// - public CultureInfo Language - { - get - { - return commonObjectLanguage; - } - - set - { - commonObjectLanguage = value; - } - } - - private Collection feedAuthors; - /// - /// Gets or sets the authors of this feed. - /// - /// A collection of objects that represent the authors of this feed. - /// - /// A must contain one or more authors, unless all of the feeds's child objects contain at least one author. - /// - /// The are considered to apply to any contained in this feed if the entry does not contain any authors and the entry's source does contain any authors. - /// - /// - public Collection Authors - { - get - { - if (feedAuthors == null) - { - feedAuthors = new Collection(); - } - return feedAuthors; - } - } - - private Collection feedCategories; - /// - /// Gets or sets the categories associated with this feed. - /// - /// A collection of objects that represent the categories associated with this feed. - public Collection Categories - { - get - { - if (feedCategories == null) - { - feedCategories = new Collection(); - } - return feedCategories; - } - } - - - private Collection feedContributors; - /// - /// Gets or sets the entities who contributed to this feed. - /// - /// A collection of objects that represent the entities who contributed to this feed. - public Collection Contributors - { - get - { - if (feedContributors == null) - { - feedContributors = new Collection(); - } - return feedContributors; - } - } - - - private IEnumerable feedEntries; - /// - /// Gets or sets the distinct content published in this feed. - /// - /// A collection of objects that represent distinct content published in this feed. - /// - /// This collection of objects is internally represented as a collection. - /// - /// The is a null reference (Nothing in Visual Basic). - public IEnumerable Entries - { - get - { - if (feedEntries == null) - { - feedEntries = new Collection(); - } - return feedEntries; - } - - set - { - Guard.ArgumentNotNull(value, "value"); - feedEntries = value; - } - - } - - private static SyndicationContentFormat feedFormat = SyndicationContentFormat.Atom; - /// - /// Gets the that this syndication resource implements. - /// - /// The enumeration value that indicates the type of syndication format that this syndication resource implements. - public SyndicationContentFormat Format - { - get - { - return feedFormat; - } - } - - private AtomGenerator feedGenerator; - /// - /// Gets or sets the agent used to generate this feed. - /// - /// A object that represents the agent used to generate this feed. The default value is a null reference. - public AtomGenerator Generator - { - get - { - return feedGenerator; - } - - set - { - feedGenerator = value; - } - } - - - private AtomId feedId; - /// - /// Gets or sets a permanent, universally unique identifier for this feed. - /// - /// A object that represents a permanent, universally unique identifier for this feed. - /// - /// - /// When an Atom Document is relocated, migrated, syndicated, republished, exported, or imported, the content of its universally unique identifier must not change. - /// Put another way, an pertains to all instantiations of a particular ; revisions retain the same - /// content in their properties. It is suggested that the be stored along with the associated resource. - /// - /// - /// The is a null reference (Nothing in Visual Basic). - public AtomId Id - { - get - { - return feedId; - } - - set - { - Guard.ArgumentNotNull(value, "value"); - feedId = value; - } - } - - private Collection feedLinks; - /// - /// Gets or sets references from this feed to one or more Web resources. - /// - /// A collection of objects that represent references from this feed to one or more Web resources. - /// - /// - /// A feed should contain one with a property of self. - /// This is the preferred URI for retrieving Atom Feed Documents representing this Atom feed. - /// - /// - /// A feed must not contain more than one with a property of alternate - /// that has the same combination of and property values. - /// - /// - public Collection Links - { - get - { - if (feedLinks == null) - { - feedLinks = new Collection(); - } - return feedLinks; - } - } - - private AtomLogo feedLogo; - /// - /// Gets or sets an image that provides visual identification for this feed. - /// - /// A object that represents an image that provides visual identification for this feed. The default value is a null reference. - /// - /// The image should have an aspect ratio of 2 (horizontal) to 1 (vertical). - /// - public AtomLogo Logo - { - get - { - return feedLogo; - } - - set - { - feedLogo = value; - } - } - - private AtomTextConstruct feedRights; - /// - /// Gets or sets information about rights held in and over this feed. - /// - /// A object that represents information about rights held in and over this feed. - /// - /// The property should not be used to convey machine-readable licensing information. - /// - public AtomTextConstruct Rights - { - get - { - return feedRights; - } - - set - { - feedRights = value; - } - } - - private AtomTextConstruct feedSubtitle; - /// - /// Gets or sets information that conveys a human-readable description or subtitle for this feed. - /// - /// A object that represents information that conveys a human-readable description or subtitle for this feed. - public AtomTextConstruct Subtitle - { - get - { - return feedSubtitle; - } - - set - { - feedSubtitle = value; - } - } - - private AtomTextConstruct feedTitle; - /// - /// Gets or sets information that conveys a human-readable title for this feed. - /// - /// A object that represents information that conveys a human-readable title for this feed. - /// The is a null reference (Nothing in Visual Basic). - public AtomTextConstruct Title - { - get - { - return feedTitle; - } - - set - { - Guard.ArgumentNotNull(value, "value"); - feedTitle = value; - } - } - - private DateTime feedUpdatedOn = DateTime.MinValue; - /// - /// Gets or sets a date-time indicating the most recent instant in time when this feed was modified in a way the publisher considers significant. - /// - /// - /// A that indicates the most recent instant in time when this feed was modified in a way the publisher considers significant. - /// Publishers may change the value of this element over time. The default value is , which indicates that no update time was provided. - /// - /// - /// The should be provided in Coordinated Universal Time (UTC). - /// - public DateTime UpdatedOn - { - get - { - return feedUpdatedOn; - } - - set - { - feedUpdatedOn = value; - } - } - - private static Version feedVersion = new Version(1, 0); - /// - /// Gets the of the that this syndication resource conforms to. - /// - /// The of the that this syndication resource conforms to. The default value is 2.0. - public Version Version - { - get - { - return feedVersion; - } - } - - } -} +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Globalization; + +namespace cloudscribe.Syndication.Models.Atom +{ + /// + /// Represents an Atom syndication feed, including metadata about the feed, and some or all of the entries associated with it. + /// + /// + /// + /// Atom is an an XML-based Web content and metadata syndication format that describes lists of related information known as feeds. + /// Feeds are composed of a number of items, known as entries, each with an extensible set of attached metadata. + /// + /// + /// This implementation conforms to the Atom 1.0 specification, which can be found + /// at http://www.atomenabled.org/developers/syndication/atom-format-spec.php. + /// + /// + /// If multiple objects with the same value appear in an Atom Feed Document, they represent the same entry. + /// Their timestamps should be different. If an Atom Feed Document contains multiple entries with the same , + /// Atom Processors may choose to display all of them or some subset of them. One typical behavior would be to display only the entry with the latest timestamp. + /// + /// + public class AtomFeed + { + public AtomFeed() + { + + } + + public AtomFeed(AtomId id, AtomTextConstruct title, DateTime utcUpdatedOn) + { + this.Id = id; + this.Title = title; + this.UpdatedOn = utcUpdatedOn; + } + + private Uri commonObjectBaseUri; + /// + /// Gets or sets the base URI other than the base URI of the document or external entity. + /// + /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. + /// + /// + /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, + /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). + /// + public Uri BaseUri + { + get + { + return commonObjectBaseUri; + } + + set + { + commonObjectBaseUri = value; + } + } + + + private CultureInfo commonObjectLanguage; + /// + /// Gets or sets the natural or formal language in which the content is written. + /// + /// A that represents the natural or formal language in which the content is written. The default value is a null reference. + /// + /// + /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. + /// + /// + public CultureInfo Language + { + get + { + return commonObjectLanguage; + } + + set + { + commonObjectLanguage = value; + } + } + + private Collection feedAuthors; + /// + /// Gets or sets the authors of this feed. + /// + /// A collection of objects that represent the authors of this feed. + /// + /// A must contain one or more authors, unless all of the feeds's child objects contain at least one author. + /// + /// The are considered to apply to any contained in this feed if the entry does not contain any authors and the entry's source does contain any authors. + /// + /// + public Collection Authors + { + get + { + if (feedAuthors == null) + { + feedAuthors = new Collection(); + } + return feedAuthors; + } + } + + private Collection feedCategories; + /// + /// Gets or sets the categories associated with this feed. + /// + /// A collection of objects that represent the categories associated with this feed. + public Collection Categories + { + get + { + if (feedCategories == null) + { + feedCategories = new Collection(); + } + return feedCategories; + } + } + + + private Collection feedContributors; + /// + /// Gets or sets the entities who contributed to this feed. + /// + /// A collection of objects that represent the entities who contributed to this feed. + public Collection Contributors + { + get + { + if (feedContributors == null) + { + feedContributors = new Collection(); + } + return feedContributors; + } + } + + + private IEnumerable feedEntries; + /// + /// Gets or sets the distinct content published in this feed. + /// + /// A collection of objects that represent distinct content published in this feed. + /// + /// This collection of objects is internally represented as a collection. + /// + /// The is a null reference (Nothing in Visual Basic). + public IEnumerable Entries + { + get + { + if (feedEntries == null) + { + feedEntries = new Collection(); + } + return feedEntries; + } + + set + { + Guard.ArgumentNotNull(value, "value"); + feedEntries = value; + } + + } + + private static SyndicationContentFormat feedFormat = SyndicationContentFormat.Atom; + /// + /// Gets the that this syndication resource implements. + /// + /// The enumeration value that indicates the type of syndication format that this syndication resource implements. + public SyndicationContentFormat Format + { + get + { + return feedFormat; + } + } + + private AtomGenerator feedGenerator; + /// + /// Gets or sets the agent used to generate this feed. + /// + /// A object that represents the agent used to generate this feed. The default value is a null reference. + public AtomGenerator Generator + { + get + { + return feedGenerator; + } + + set + { + feedGenerator = value; + } + } + + + private AtomId feedId; + /// + /// Gets or sets a permanent, universally unique identifier for this feed. + /// + /// A object that represents a permanent, universally unique identifier for this feed. + /// + /// + /// When an Atom Document is relocated, migrated, syndicated, republished, exported, or imported, the content of its universally unique identifier must not change. + /// Put another way, an pertains to all instantiations of a particular ; revisions retain the same + /// content in their properties. It is suggested that the be stored along with the associated resource. + /// + /// + /// The is a null reference (Nothing in Visual Basic). + public AtomId Id + { + get + { + return feedId; + } + + set + { + Guard.ArgumentNotNull(value, "value"); + feedId = value; + } + } + + private Collection feedLinks; + /// + /// Gets or sets references from this feed to one or more Web resources. + /// + /// A collection of objects that represent references from this feed to one or more Web resources. + /// + /// + /// A feed should contain one with a property of self. + /// This is the preferred URI for retrieving Atom Feed Documents representing this Atom feed. + /// + /// + /// A feed must not contain more than one with a property of alternate + /// that has the same combination of and property values. + /// + /// + public Collection Links + { + get + { + if (feedLinks == null) + { + feedLinks = new Collection(); + } + return feedLinks; + } + } + + private AtomLogo feedLogo; + /// + /// Gets or sets an image that provides visual identification for this feed. + /// + /// A object that represents an image that provides visual identification for this feed. The default value is a null reference. + /// + /// The image should have an aspect ratio of 2 (horizontal) to 1 (vertical). + /// + public AtomLogo Logo + { + get + { + return feedLogo; + } + + set + { + feedLogo = value; + } + } + + private AtomTextConstruct feedRights; + /// + /// Gets or sets information about rights held in and over this feed. + /// + /// A object that represents information about rights held in and over this feed. + /// + /// The property should not be used to convey machine-readable licensing information. + /// + public AtomTextConstruct Rights + { + get + { + return feedRights; + } + + set + { + feedRights = value; + } + } + + private AtomTextConstruct feedSubtitle; + /// + /// Gets or sets information that conveys a human-readable description or subtitle for this feed. + /// + /// A object that represents information that conveys a human-readable description or subtitle for this feed. + public AtomTextConstruct Subtitle + { + get + { + return feedSubtitle; + } + + set + { + feedSubtitle = value; + } + } + + private AtomTextConstruct feedTitle; + /// + /// Gets or sets information that conveys a human-readable title for this feed. + /// + /// A object that represents information that conveys a human-readable title for this feed. + /// The is a null reference (Nothing in Visual Basic). + public AtomTextConstruct Title + { + get + { + return feedTitle; + } + + set + { + Guard.ArgumentNotNull(value, "value"); + feedTitle = value; + } + } + + private DateTime feedUpdatedOn = DateTime.MinValue; + /// + /// Gets or sets a date-time indicating the most recent instant in time when this feed was modified in a way the publisher considers significant. + /// + /// + /// A that indicates the most recent instant in time when this feed was modified in a way the publisher considers significant. + /// Publishers may change the value of this element over time. The default value is , which indicates that no update time was provided. + /// + /// + /// The should be provided in Coordinated Universal Time (UTC). + /// + public DateTime UpdatedOn + { + get + { + return feedUpdatedOn; + } + + set + { + feedUpdatedOn = value; + } + } + + private static Version feedVersion = new Version(1, 0); + /// + /// Gets the of the that this syndication resource conforms to. + /// + /// The of the that this syndication resource conforms to. The default value is 2.0. + public Version Version + { + get + { + return feedVersion; + } + } + + } +} diff --git a/src/cloudscribe.Syndication/Models/Atom/AtomGenerator.cs b/src/cloudscribe.Syndication/Models/Atom/AtomGenerator.cs index 5ec6d0c..d1c34a4 100644 --- a/src/cloudscribe.Syndication/Models/Atom/AtomGenerator.cs +++ b/src/cloudscribe.Syndication/Models/Atom/AtomGenerator.cs @@ -1,140 +1,140 @@ -using System; -using System.Globalization; - -namespace cloudscribe.Syndication.Models.Atom -{ - /// - /// Represents an agent used to generate an , for debugging and other purposes. - /// - public class AtomGenerator - { - - public AtomGenerator() - { - - } - - public AtomGenerator(string content) - { - this.Content = content; - } - - private Uri commonObjectBaseUri; - /// - /// Gets or sets the base URI other than the base URI of the document or external entity. - /// - /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. - /// - /// - /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, - /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). - /// - public Uri BaseUri - { - get - { - return commonObjectBaseUri; - } - - set - { - commonObjectBaseUri = value; - } - } - - private CultureInfo commonObjectLanguage; - /// - /// Gets or sets the natural or formal language in which the content is written. - /// - /// A that represents the natural or formal language in which the content is written. The default value is a null reference. - /// - /// - /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. - /// - /// - public CultureInfo Language - { - get - { - return commonObjectLanguage; - } - - set - { - commonObjectLanguage = value; - } - } - - private string generatorText = "cloudscribe.Syndication"; - /// - /// Gets or sets a human-readable name for the generating agent. - /// - /// A human-readable name for the generating agent. - /// - /// Entities represent their corresponding characters, not markup. - /// - /// The is a null reference (Nothing in Visual Basic). - /// The is an empty string. - public string Content - { - get - { - return generatorText; - } - - set - { - Guard.ArgumentNotNullOrEmptyString(value, "value"); - generatorText = value.Trim(); - } - } - - private Uri generatorUri; - /// - /// Gets or sets an IRI that is relevant to the generating agent. - /// - /// A that represents a Internationalized Resource Identifier (IRI) that is relevant to the generating agent. - /// - /// See RFC 3987: Internationalized Resource Identifiers for the IRI technical specification. - /// See System.Uri for enabling support for IRIs within Microsoft .NET framework applications. - /// - public Uri Uri - { - get - { - return generatorUri; - } - - set - { - generatorUri = value; - } - } - - private string generatorVersion = "1.0"; - /// - /// Gets or sets the version of the generating agent. - /// - /// The version of the generating agent. - public string Version - { - get - { - return generatorVersion; - } - - set - { - if (string.IsNullOrEmpty(value)) - { - generatorVersion = string.Empty; - } - else - { - generatorVersion = value.Trim(); - } - } - } - - } -} +using System; +using System.Globalization; + +namespace cloudscribe.Syndication.Models.Atom +{ + /// + /// Represents an agent used to generate an , for debugging and other purposes. + /// + public class AtomGenerator + { + + public AtomGenerator() + { + + } + + public AtomGenerator(string content) + { + this.Content = content; + } + + private Uri commonObjectBaseUri; + /// + /// Gets or sets the base URI other than the base URI of the document or external entity. + /// + /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. + /// + /// + /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, + /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). + /// + public Uri BaseUri + { + get + { + return commonObjectBaseUri; + } + + set + { + commonObjectBaseUri = value; + } + } + + private CultureInfo commonObjectLanguage; + /// + /// Gets or sets the natural or formal language in which the content is written. + /// + /// A that represents the natural or formal language in which the content is written. The default value is a null reference. + /// + /// + /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. + /// + /// + public CultureInfo Language + { + get + { + return commonObjectLanguage; + } + + set + { + commonObjectLanguage = value; + } + } + + private string generatorText = "cloudscribe.Syndication"; + /// + /// Gets or sets a human-readable name for the generating agent. + /// + /// A human-readable name for the generating agent. + /// + /// Entities represent their corresponding characters, not markup. + /// + /// The is a null reference (Nothing in Visual Basic). + /// The is an empty string. + public string Content + { + get + { + return generatorText; + } + + set + { + Guard.ArgumentNotNullOrEmptyString(value, "value"); + generatorText = value.Trim(); + } + } + + private Uri generatorUri; + /// + /// Gets or sets an IRI that is relevant to the generating agent. + /// + /// A that represents a Internationalized Resource Identifier (IRI) that is relevant to the generating agent. + /// + /// See RFC 3987: Internationalized Resource Identifiers for the IRI technical specification. + /// See System.Uri for enabling support for IRIs within Microsoft .NET framework applications. + /// + public Uri Uri + { + get + { + return generatorUri; + } + + set + { + generatorUri = value; + } + } + + private string generatorVersion = "1.0"; + /// + /// Gets or sets the version of the generating agent. + /// + /// The version of the generating agent. + public string Version + { + get + { + return generatorVersion; + } + + set + { + if (string.IsNullOrEmpty(value)) + { + generatorVersion = string.Empty; + } + else + { + generatorVersion = value.Trim(); + } + } + } + + } +} diff --git a/src/cloudscribe.Syndication/Models/Atom/AtomIcon.cs b/src/cloudscribe.Syndication/Models/Atom/AtomIcon.cs index 4996c86..bfd6f8b 100644 --- a/src/cloudscribe.Syndication/Models/Atom/AtomIcon.cs +++ b/src/cloudscribe.Syndication/Models/Atom/AtomIcon.cs @@ -1,95 +1,95 @@ -using System; -using System.Globalization; - -namespace cloudscribe.Syndication.Models.Atom -{ - public class AtomIcon - { - - public AtomIcon() - { - - } - - /// - /// Initializes a new instance of the class using the supplied . - /// A that represents a Internationalized Resource Identifier (IRI) that identifies an image that provides iconic visual identification for this feed. - /// - /// The is a null reference (Nothing in Visual Basic). - public AtomIcon(Uri uri) - { - this.Uri = uri; - } - - private Uri commonObjectBaseUri; - /// - /// Gets or sets the base URI other than the base URI of the document or external entity. - /// - /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. - /// - /// - /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, - /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). - /// - public Uri BaseUri - { - get - { - return commonObjectBaseUri; - } - - set - { - commonObjectBaseUri = value; - } - } - - private CultureInfo commonObjectLanguage; - /// - /// Gets or sets the natural or formal language in which the content is written. - /// - /// A that represents the natural or formal language in which the content is written. The default value is a null reference. - /// - /// - /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. - /// - /// - public CultureInfo Language - { - get - { - return commonObjectLanguage; - } - - set - { - commonObjectLanguage = value; - } - } - - private Uri iconUri; - /// - /// Gets or sets an IRI that identifies an image that provides iconic visual identification for this feed. - /// - /// A that represents a Internationalized Resource Identifier (IRI) that identifies an image that provides iconic visual identification for this feed. - /// - /// See RFC 3987: Internationalized Resource Identifiers for the IRI technical specification. - /// See System.Uri for enabling support for IRIs within Microsoft .NET framework applications. - /// - /// The is a null reference (Nothing in Visual Basic). - public Uri Uri - { - get - { - return iconUri; - } - - set - { - Guard.ArgumentNotNull(value, "value"); - iconUri = value; - } - } - - } -} +using System; +using System.Globalization; + +namespace cloudscribe.Syndication.Models.Atom +{ + public class AtomIcon + { + + public AtomIcon() + { + + } + + /// + /// Initializes a new instance of the class using the supplied . + /// A that represents a Internationalized Resource Identifier (IRI) that identifies an image that provides iconic visual identification for this feed. + /// + /// The is a null reference (Nothing in Visual Basic). + public AtomIcon(Uri uri) + { + this.Uri = uri; + } + + private Uri commonObjectBaseUri; + /// + /// Gets or sets the base URI other than the base URI of the document or external entity. + /// + /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. + /// + /// + /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, + /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). + /// + public Uri BaseUri + { + get + { + return commonObjectBaseUri; + } + + set + { + commonObjectBaseUri = value; + } + } + + private CultureInfo commonObjectLanguage; + /// + /// Gets or sets the natural or formal language in which the content is written. + /// + /// A that represents the natural or formal language in which the content is written. The default value is a null reference. + /// + /// + /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. + /// + /// + public CultureInfo Language + { + get + { + return commonObjectLanguage; + } + + set + { + commonObjectLanguage = value; + } + } + + private Uri iconUri; + /// + /// Gets or sets an IRI that identifies an image that provides iconic visual identification for this feed. + /// + /// A that represents a Internationalized Resource Identifier (IRI) that identifies an image that provides iconic visual identification for this feed. + /// + /// See RFC 3987: Internationalized Resource Identifiers for the IRI technical specification. + /// See System.Uri for enabling support for IRIs within Microsoft .NET framework applications. + /// + /// The is a null reference (Nothing in Visual Basic). + public Uri Uri + { + get + { + return iconUri; + } + + set + { + Guard.ArgumentNotNull(value, "value"); + iconUri = value; + } + } + + } +} diff --git a/src/cloudscribe.Syndication/Models/Atom/AtomId.cs b/src/cloudscribe.Syndication/Models/Atom/AtomId.cs index f2e5efc..d712e42 100644 --- a/src/cloudscribe.Syndication/Models/Atom/AtomId.cs +++ b/src/cloudscribe.Syndication/Models/Atom/AtomId.cs @@ -1,164 +1,164 @@ -using System; -using System.Globalization; - -namespace cloudscribe.Syndication.Models.Atom -{ - /// - /// Represents a permanent, universally unique identifier for an or . - /// - /// - /// - /// - /// - /// When an Atom Document is relocated, migrated, syndicated, republished, exported, or imported, the content of its universally unique identifier must not change. - /// Put another way, an pertains to all instantiations of a particular or ; revisions retain the same - /// content in their properties. It is suggested that the be stored along with the associated resource. - /// - /// - /// The content of an must be created in a way that assures uniqueness. - /// Because of the risk of confusion between IRIs that would be equivalent if they were mapped to URIs and dereferenced, - /// the following normalization strategy should be applied when generating unique identifiers: - /// - /// - /// - /// Provide the scheme in lowercase characters. - /// - /// - /// - /// - /// Provide the host, if any, in lowercase characters. - /// - /// - /// - /// - /// Only perform percent-encoding where it is essential. - /// - /// - /// - /// - /// Use uppercase A through F characters when percent-encoding. - /// - /// - /// - /// - /// Prevent dot-segments from appearing in paths. - /// - /// - /// - /// - /// For schemes that define a default authority, use an empty authority if the default is desired. - /// - /// - /// - /// - /// For schemes that define an empty path to be equivalent to a path of "/", use "/". - /// - /// - /// - /// - /// For schemes that define a port, use an empty port if the default is desired. - /// - /// - /// - /// - /// Preserve empty fragment identifiers and queries. - /// - /// - /// - /// - /// Ensure that all components of the IRI are appropriately character normalized, e.g., by using NFC or NFKC. - /// - /// - /// - /// - /// - /// Instances of objects can be compared to determine whether an entry or feed is the same as one seen before. - /// Processors must compare objects on a character-by-character basis (in a case-sensitive fashion). - /// Comparison operations must be based solely on the IRI character strings and must not rely on dereferencing the IRIs or URIs mapped from them. - /// - /// - public class AtomId - { - public AtomId() - { - - } - - public AtomId(Uri uri) - { - this.Uri = uri; - } - - private Uri commonObjectBaseUri; - /// - /// Gets or sets the base URI other than the base URI of the document or external entity. - /// - /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. - /// - /// - /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, - /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). - /// - public Uri BaseUri - { - get - { - return commonObjectBaseUri; - } - - set - { - commonObjectBaseUri = value; - } - } - - private CultureInfo commonObjectLanguage; - /// - /// Gets or sets the natural or formal language in which the content is written. - /// - /// A that represents the natural or formal language in which the content is written. The default value is a null reference. - /// - /// - /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. - /// - /// - public CultureInfo Language - { - get - { - return commonObjectLanguage; - } - - set - { - commonObjectLanguage = value; - } - } - - private Uri idUri; - /// - /// Gets or sets an IRI that represents a permanent, universally unique identifier for this entity. - /// - /// A that represents a Internationalized Resource Identifier (IRI) that represents a permanent, universally unique identifier for this entity. - /// - /// This must represent an absolute URI. - /// See RFC 3987: Internationalized Resource Identifiers for the IRI technical specification. - /// See System.Uri for enabling support for IRIs within Microsoft .NET framework applications. - /// - /// The is a null reference (Nothing in Visual Basic). - public Uri Uri - { - get - { - return idUri; - } - - set - { - Guard.ArgumentNotNull(value, "value"); - idUri = value; - } - } - - } -} +using System; +using System.Globalization; + +namespace cloudscribe.Syndication.Models.Atom +{ + /// + /// Represents a permanent, universally unique identifier for an or . + /// + /// + /// + /// + /// + /// When an Atom Document is relocated, migrated, syndicated, republished, exported, or imported, the content of its universally unique identifier must not change. + /// Put another way, an pertains to all instantiations of a particular or ; revisions retain the same + /// content in their properties. It is suggested that the be stored along with the associated resource. + /// + /// + /// The content of an must be created in a way that assures uniqueness. + /// Because of the risk of confusion between IRIs that would be equivalent if they were mapped to URIs and dereferenced, + /// the following normalization strategy should be applied when generating unique identifiers: + /// + /// + /// + /// Provide the scheme in lowercase characters. + /// + /// + /// + /// + /// Provide the host, if any, in lowercase characters. + /// + /// + /// + /// + /// Only perform percent-encoding where it is essential. + /// + /// + /// + /// + /// Use uppercase A through F characters when percent-encoding. + /// + /// + /// + /// + /// Prevent dot-segments from appearing in paths. + /// + /// + /// + /// + /// For schemes that define a default authority, use an empty authority if the default is desired. + /// + /// + /// + /// + /// For schemes that define an empty path to be equivalent to a path of "/", use "/". + /// + /// + /// + /// + /// For schemes that define a port, use an empty port if the default is desired. + /// + /// + /// + /// + /// Preserve empty fragment identifiers and queries. + /// + /// + /// + /// + /// Ensure that all components of the IRI are appropriately character normalized, e.g., by using NFC or NFKC. + /// + /// + /// + /// + /// + /// Instances of objects can be compared to determine whether an entry or feed is the same as one seen before. + /// Processors must compare objects on a character-by-character basis (in a case-sensitive fashion). + /// Comparison operations must be based solely on the IRI character strings and must not rely on dereferencing the IRIs or URIs mapped from them. + /// + /// + public class AtomId + { + public AtomId() + { + + } + + public AtomId(Uri uri) + { + this.Uri = uri; + } + + private Uri commonObjectBaseUri; + /// + /// Gets or sets the base URI other than the base URI of the document or external entity. + /// + /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. + /// + /// + /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, + /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). + /// + public Uri BaseUri + { + get + { + return commonObjectBaseUri; + } + + set + { + commonObjectBaseUri = value; + } + } + + private CultureInfo commonObjectLanguage; + /// + /// Gets or sets the natural or formal language in which the content is written. + /// + /// A that represents the natural or formal language in which the content is written. The default value is a null reference. + /// + /// + /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. + /// + /// + public CultureInfo Language + { + get + { + return commonObjectLanguage; + } + + set + { + commonObjectLanguage = value; + } + } + + private Uri idUri; + /// + /// Gets or sets an IRI that represents a permanent, universally unique identifier for this entity. + /// + /// A that represents a Internationalized Resource Identifier (IRI) that represents a permanent, universally unique identifier for this entity. + /// + /// This must represent an absolute URI. + /// See RFC 3987: Internationalized Resource Identifiers for the IRI technical specification. + /// See System.Uri for enabling support for IRIs within Microsoft .NET framework applications. + /// + /// The is a null reference (Nothing in Visual Basic). + public Uri Uri + { + get + { + return idUri; + } + + set + { + Guard.ArgumentNotNull(value, "value"); + idUri = value; + } + } + + } +} diff --git a/src/cloudscribe.Syndication/Models/Atom/AtomLink.cs b/src/cloudscribe.Syndication/Models/Atom/AtomLink.cs index eddc6cb..f0f9956 100644 --- a/src/cloudscribe.Syndication/Models/Atom/AtomLink.cs +++ b/src/cloudscribe.Syndication/Models/Atom/AtomLink.cs @@ -1,268 +1,268 @@ -using System; -using System.Globalization; - -namespace cloudscribe.Syndication.Models.Atom -{ - /// - /// Represents a reference from an or to a Web resource. - /// - public class AtomLink - { - public AtomLink() - { - - } - - public AtomLink(Uri href) - { - this.Uri = href; - } - - private Uri commonObjectBaseUri; - /// - /// Gets or sets the base URI other than the base URI of the document or external entity. - /// - /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. - /// - /// - /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, - /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). - /// - public Uri BaseUri - { - get - { - return commonObjectBaseUri; - } - - set - { - commonObjectBaseUri = value; - } - } - - private CultureInfo commonObjectLanguage; - /// - /// Gets or sets the natural or formal language in which the content is written. - /// - /// A that represents the natural or formal language in which the content is written. The default value is a null reference. - /// - /// - /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. - /// - /// - public CultureInfo Language - { - get - { - return commonObjectLanguage; - } - - set - { - commonObjectLanguage = value; - } - } - - private CultureInfo linkResourceLanguage; - /// - /// Gets or sets the natural or formal language in which this Web resource content is written. - /// - /// A that represents the natural or formal language in which this resource content is written. The default value is a null reference. - /// - /// - /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. - /// - /// - public CultureInfo ContentLanguage - { - get - { - return linkResourceLanguage; - } - - set - { - linkResourceLanguage = value; - } - } - - private string linkMediaType = string.Empty; - /// - /// Gets or sets an advisory media type for this Web resource. - /// - /// An advisory MIME media type that provides a hint about the type of the representation that is expected to be returned by the Web resource. - /// - /// The advisory media type does not override the actual media type returned with the representation. - /// The value must conform to the syntax of a MIME media type as specified by RFC 4288: Media Type Specifications and Registration Procedures. - /// - public string ContentType - { - get - { - return linkMediaType; - } - - set - { - if (string.IsNullOrEmpty(value)) - { - linkMediaType = string.Empty; - } - else - { - linkMediaType = value.Trim(); - } - } - } - - private long linkLength = long.MinValue; - /// - /// Gets or sets an advisory length for this Web resource content in octets. - /// - /// An advisory length for this Web resource content in octets. The default value is , which indicates that no advisory length was specified. - /// - /// The does not override the actual content length of the representation as reported by the underlying protocol. - /// - /// The is less than zero. - public long Length - { - get - { - return linkLength; - } - - set - { - Guard.ArgumentNotLessThan(value, "value", 0); - linkLength = value; - } - } - - private string linkRelation = string.Empty; - /// - /// Gets or sets a value that indicates the link relation type of this Web resource. - /// - /// A value that indicates the link relation type. - /// - /// If the property is not specified, the must be interpreted as if the link relation type is alternate. - /// - /// The value of the property must be a string that is non-empty and matches either the isegment-nz-nc or - /// the IRI production in RFC 3987: Internationalized Resource Identifiers (IRIs). - /// Note that use of a relative reference other than a simple name is not allowed. If a name is given, implementations must consider the link relation type equivalent - /// to the same name registered within the IANA Registry of Link Relations (Section 7), - /// and thus to the IRI that would be obtained by appending the value of the rel attribute to the string "http://www.iana.org/assignments/relation/". - /// The value of property describes the meaning of the link, but does not impose any behavioral requirements on Atom Processors. - /// - /// - /// The Atom specification defines five initial values for the Registry of Link Relations: - /// - /// - /// - /// alternate: Signifies that the IRI in the value of the property - /// identifies an alternate version of the resource described by the containing element. - /// - /// - /// - /// - /// related: Signifies that the IRI in the value of the property - /// identifies a resource related to the resource described by the containing element. - /// - /// - /// - /// - /// self: Signifies that the IRI in the value of the property - /// identifies a resource equivalent to the containing element. - /// - /// - /// - /// - /// enclosure: Signifies that the IRI in the value of the property identifies - /// a related resource that is potentially large in size and might require special handling. - /// - /// - /// - /// - /// via: Signifies that the IRI in the value of the property identifies - /// a resource that is the source of the information provided in the containing element. - /// - /// - /// - /// - /// - public string Relation - { - get - { - return linkRelation; - } - - set - { - if (string.IsNullOrEmpty(value)) - { - linkRelation = string.Empty; - } - else - { - linkRelation = value.Trim(); - } - } - } - - private string linkTitle = string.Empty; - /// - /// Gets or sets human-readable information about this Web resource. - /// - /// Human-readable information about this Web resource. - /// - /// The property is language-sensitive, with the natural language of the value being specified by the property. - /// Entities represent their corresponding characters, not markup. - /// - public string Title - { - get - { - return linkTitle; - } - - set - { - if (string.IsNullOrEmpty(value)) - { - linkTitle = string.Empty; - } - else - { - linkTitle = value.Trim(); - } - } - } - - private Uri linkResourceLocation; - /// - /// Gets or sets an IRI that identifies the location of this Web resource. - /// - /// A that represents a Internationalized Resource Identifier (IRI) that identifies the location of this Web resource. - /// - /// See RFC 3987: Internationalized Resource Identifiers for the IRI technical specification. - /// See System.Uri for enabling support for IRIs within Microsoft .NET framework applications. - /// - /// The is a null reference (Nothing in Visual Basic). - public Uri Uri - { - get - { - return linkResourceLocation; - } - - set - { - Guard.ArgumentNotNull(value, "value"); - linkResourceLocation = value; - } - } - - - } -} +using System; +using System.Globalization; + +namespace cloudscribe.Syndication.Models.Atom +{ + /// + /// Represents a reference from an or to a Web resource. + /// + public class AtomLink + { + public AtomLink() + { + + } + + public AtomLink(Uri href) + { + this.Uri = href; + } + + private Uri commonObjectBaseUri; + /// + /// Gets or sets the base URI other than the base URI of the document or external entity. + /// + /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. + /// + /// + /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, + /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). + /// + public Uri BaseUri + { + get + { + return commonObjectBaseUri; + } + + set + { + commonObjectBaseUri = value; + } + } + + private CultureInfo commonObjectLanguage; + /// + /// Gets or sets the natural or formal language in which the content is written. + /// + /// A that represents the natural or formal language in which the content is written. The default value is a null reference. + /// + /// + /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. + /// + /// + public CultureInfo Language + { + get + { + return commonObjectLanguage; + } + + set + { + commonObjectLanguage = value; + } + } + + private CultureInfo linkResourceLanguage; + /// + /// Gets or sets the natural or formal language in which this Web resource content is written. + /// + /// A that represents the natural or formal language in which this resource content is written. The default value is a null reference. + /// + /// + /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. + /// + /// + public CultureInfo ContentLanguage + { + get + { + return linkResourceLanguage; + } + + set + { + linkResourceLanguage = value; + } + } + + private string linkMediaType = string.Empty; + /// + /// Gets or sets an advisory media type for this Web resource. + /// + /// An advisory MIME media type that provides a hint about the type of the representation that is expected to be returned by the Web resource. + /// + /// The advisory media type does not override the actual media type returned with the representation. + /// The value must conform to the syntax of a MIME media type as specified by RFC 4288: Media Type Specifications and Registration Procedures. + /// + public string ContentType + { + get + { + return linkMediaType; + } + + set + { + if (string.IsNullOrEmpty(value)) + { + linkMediaType = string.Empty; + } + else + { + linkMediaType = value.Trim(); + } + } + } + + private long linkLength = long.MinValue; + /// + /// Gets or sets an advisory length for this Web resource content in octets. + /// + /// An advisory length for this Web resource content in octets. The default value is , which indicates that no advisory length was specified. + /// + /// The does not override the actual content length of the representation as reported by the underlying protocol. + /// + /// The is less than zero. + public long Length + { + get + { + return linkLength; + } + + set + { + Guard.ArgumentNotLessThan(value, "value", 0); + linkLength = value; + } + } + + private string linkRelation = string.Empty; + /// + /// Gets or sets a value that indicates the link relation type of this Web resource. + /// + /// A value that indicates the link relation type. + /// + /// If the property is not specified, the must be interpreted as if the link relation type is alternate. + /// + /// The value of the property must be a string that is non-empty and matches either the isegment-nz-nc or + /// the IRI production in RFC 3987: Internationalized Resource Identifiers (IRIs). + /// Note that use of a relative reference other than a simple name is not allowed. If a name is given, implementations must consider the link relation type equivalent + /// to the same name registered within the IANA Registry of Link Relations (Section 7), + /// and thus to the IRI that would be obtained by appending the value of the rel attribute to the string "http://www.iana.org/assignments/relation/". + /// The value of property describes the meaning of the link, but does not impose any behavioral requirements on Atom Processors. + /// + /// + /// The Atom specification defines five initial values for the Registry of Link Relations: + /// + /// + /// + /// alternate: Signifies that the IRI in the value of the property + /// identifies an alternate version of the resource described by the containing element. + /// + /// + /// + /// + /// related: Signifies that the IRI in the value of the property + /// identifies a resource related to the resource described by the containing element. + /// + /// + /// + /// + /// self: Signifies that the IRI in the value of the property + /// identifies a resource equivalent to the containing element. + /// + /// + /// + /// + /// enclosure: Signifies that the IRI in the value of the property identifies + /// a related resource that is potentially large in size and might require special handling. + /// + /// + /// + /// + /// via: Signifies that the IRI in the value of the property identifies + /// a resource that is the source of the information provided in the containing element. + /// + /// + /// + /// + /// + public string Relation + { + get + { + return linkRelation; + } + + set + { + if (string.IsNullOrEmpty(value)) + { + linkRelation = string.Empty; + } + else + { + linkRelation = value.Trim(); + } + } + } + + private string linkTitle = string.Empty; + /// + /// Gets or sets human-readable information about this Web resource. + /// + /// Human-readable information about this Web resource. + /// + /// The property is language-sensitive, with the natural language of the value being specified by the property. + /// Entities represent their corresponding characters, not markup. + /// + public string Title + { + get + { + return linkTitle; + } + + set + { + if (string.IsNullOrEmpty(value)) + { + linkTitle = string.Empty; + } + else + { + linkTitle = value.Trim(); + } + } + } + + private Uri linkResourceLocation; + /// + /// Gets or sets an IRI that identifies the location of this Web resource. + /// + /// A that represents a Internationalized Resource Identifier (IRI) that identifies the location of this Web resource. + /// + /// See RFC 3987: Internationalized Resource Identifiers for the IRI technical specification. + /// See System.Uri for enabling support for IRIs within Microsoft .NET framework applications. + /// + /// The is a null reference (Nothing in Visual Basic). + public Uri Uri + { + get + { + return linkResourceLocation; + } + + set + { + Guard.ArgumentNotNull(value, "value"); + linkResourceLocation = value; + } + } + + + } +} diff --git a/src/cloudscribe.Syndication/Models/Atom/AtomLogo.cs b/src/cloudscribe.Syndication/Models/Atom/AtomLogo.cs index bafb37e..430c78a 100644 --- a/src/cloudscribe.Syndication/Models/Atom/AtomLogo.cs +++ b/src/cloudscribe.Syndication/Models/Atom/AtomLogo.cs @@ -1,93 +1,93 @@ -using System; -using System.Globalization; - -namespace cloudscribe.Syndication.Models.Atom -{ - /// - /// Represents an image that provides visual identification for an . - /// - public class AtomLogo - { - public AtomLogo() - { - - } - - public AtomLogo(Uri uri) - { - this.Uri = uri; - } - - private Uri commonObjectBaseUri; - /// - /// Gets or sets the base URI other than the base URI of the document or external entity. - /// - /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. - /// - /// - /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, - /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). - /// - public Uri BaseUri - { - get - { - return commonObjectBaseUri; - } - - set - { - commonObjectBaseUri = value; - } - } - - private CultureInfo commonObjectLanguage; - /// - /// Gets or sets the natural or formal language in which the content is written. - /// - /// A that represents the natural or formal language in which the content is written. The default value is a null reference. - /// - /// - /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. - /// - /// - public CultureInfo Language - { - get - { - return commonObjectLanguage; - } - - set - { - commonObjectLanguage = value; - } - } - - private Uri logoUri; - /// - /// Gets or sets an IRI that identifies an image that provides visual identification for this feed. - /// - /// A that represents a Internationalized Resource Identifier (IRI) that identifies an image that provides visual identification for this feed. - /// - /// See RFC 3987: Internationalized Resource Identifiers for the IRI technical specification. - /// See System.Uri for enabling support for IRIs within Microsoft .NET framework applications. - /// - /// The is a null reference (Nothing in Visual Basic). - public Uri Uri - { - get - { - return logoUri; - } - - set - { - Guard.ArgumentNotNull(value, "value"); - logoUri = value; - } - } - - - } -} +using System; +using System.Globalization; + +namespace cloudscribe.Syndication.Models.Atom +{ + /// + /// Represents an image that provides visual identification for an . + /// + public class AtomLogo + { + public AtomLogo() + { + + } + + public AtomLogo(Uri uri) + { + this.Uri = uri; + } + + private Uri commonObjectBaseUri; + /// + /// Gets or sets the base URI other than the base URI of the document or external entity. + /// + /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. + /// + /// + /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, + /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). + /// + public Uri BaseUri + { + get + { + return commonObjectBaseUri; + } + + set + { + commonObjectBaseUri = value; + } + } + + private CultureInfo commonObjectLanguage; + /// + /// Gets or sets the natural or formal language in which the content is written. + /// + /// A that represents the natural or formal language in which the content is written. The default value is a null reference. + /// + /// + /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. + /// + /// + public CultureInfo Language + { + get + { + return commonObjectLanguage; + } + + set + { + commonObjectLanguage = value; + } + } + + private Uri logoUri; + /// + /// Gets or sets an IRI that identifies an image that provides visual identification for this feed. + /// + /// A that represents a Internationalized Resource Identifier (IRI) that identifies an image that provides visual identification for this feed. + /// + /// See RFC 3987: Internationalized Resource Identifiers for the IRI technical specification. + /// See System.Uri for enabling support for IRIs within Microsoft .NET framework applications. + /// + /// The is a null reference (Nothing in Visual Basic). + public Uri Uri + { + get + { + return logoUri; + } + + set + { + Guard.ArgumentNotNull(value, "value"); + logoUri = value; + } + } + + + } +} diff --git a/src/cloudscribe.Syndication/Models/Atom/AtomPersonConstruct.cs b/src/cloudscribe.Syndication/Models/Atom/AtomPersonConstruct.cs index 102c713..16f452d 100644 --- a/src/cloudscribe.Syndication/Models/Atom/AtomPersonConstruct.cs +++ b/src/cloudscribe.Syndication/Models/Atom/AtomPersonConstruct.cs @@ -1,142 +1,142 @@ -using System; -using System.Globalization; - -namespace cloudscribe.Syndication.Models.Atom -{ - /// - /// Represents a person, corporation, or similar entity. - /// - public class AtomPersonConstruct - { - public AtomPersonConstruct() - { - } - - public AtomPersonConstruct(string name) - { - this.Name = name; - } - - private Uri commonObjectBaseUri; - /// - /// Gets or sets the base URI other than the base URI of the document or external entity. - /// - /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. - /// - /// - /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, - /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). - /// - public Uri BaseUri - { - get - { - return commonObjectBaseUri; - } - - set - { - commonObjectBaseUri = value; - } - } - - private CultureInfo commonObjectLanguage; - /// - /// Gets or sets the natural or formal language in which the content is written. - /// - /// A that represents the natural or formal language in which the content is written. The default value is a null reference. - /// - /// - /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. - /// - /// - public CultureInfo Language - { - get - { - return commonObjectLanguage; - } - - set - { - commonObjectLanguage = value; - } - } - - private string personConstructEmailAddress = string.Empty; - /// - /// Gets or sets the e-mail address associated with this entity. - /// - /// The e-mail address associated with this entity. - /// - /// The email address must conform to RFC 2822: Internet Message Format, 3.4.1, Addr-spec Specification. - /// - public string EmailAddress - { - get - { - return personConstructEmailAddress; - } - - set - { - if (string.IsNullOrEmpty(value)) - { - personConstructEmailAddress = string.Empty; - } - else - { - personConstructEmailAddress = value.Trim(); - } - } - } - - private string personConstructName; - /// - /// Gets or sets the human-readable name for this entity. - /// - /// The human-readable name for this entity. - /// - /// The property is language-sensitive, with the natural language of the value being specified by the property. - /// - /// The is a null reference (Nothing in Visual Basic). - /// The is an empty string. - public string Name - { - get - { - return personConstructName; - } - - set - { - Guard.ArgumentNotNullOrEmptyString(value, "value"); - personConstructName = value.Trim(); - } - } - - private Uri personConstructUri; - /// - /// Gets or sets the IRI associated with this entity. - /// - /// A that represents a Internationalized Resource Identifier (IRI) associated with this entity. - /// - /// See RFC 3987: Internationalized Resource Identifiers for the IRI technical specification. - /// See System.Uri for enabling support for IRIs within Microsoft .NET framework applications. - /// - public Uri Uri - { - get - { - return personConstructUri; - } - - set - { - personConstructUri = value; - } - } - - - } -} +using System; +using System.Globalization; + +namespace cloudscribe.Syndication.Models.Atom +{ + /// + /// Represents a person, corporation, or similar entity. + /// + public class AtomPersonConstruct + { + public AtomPersonConstruct() + { + } + + public AtomPersonConstruct(string name) + { + this.Name = name; + } + + private Uri commonObjectBaseUri; + /// + /// Gets or sets the base URI other than the base URI of the document or external entity. + /// + /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. + /// + /// + /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, + /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). + /// + public Uri BaseUri + { + get + { + return commonObjectBaseUri; + } + + set + { + commonObjectBaseUri = value; + } + } + + private CultureInfo commonObjectLanguage; + /// + /// Gets or sets the natural or formal language in which the content is written. + /// + /// A that represents the natural or formal language in which the content is written. The default value is a null reference. + /// + /// + /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. + /// + /// + public CultureInfo Language + { + get + { + return commonObjectLanguage; + } + + set + { + commonObjectLanguage = value; + } + } + + private string personConstructEmailAddress = string.Empty; + /// + /// Gets or sets the e-mail address associated with this entity. + /// + /// The e-mail address associated with this entity. + /// + /// The email address must conform to RFC 2822: Internet Message Format, 3.4.1, Addr-spec Specification. + /// + public string EmailAddress + { + get + { + return personConstructEmailAddress; + } + + set + { + if (string.IsNullOrEmpty(value)) + { + personConstructEmailAddress = string.Empty; + } + else + { + personConstructEmailAddress = value.Trim(); + } + } + } + + private string personConstructName; + /// + /// Gets or sets the human-readable name for this entity. + /// + /// The human-readable name for this entity. + /// + /// The property is language-sensitive, with the natural language of the value being specified by the property. + /// + /// The is a null reference (Nothing in Visual Basic). + /// The is an empty string. + public string Name + { + get + { + return personConstructName; + } + + set + { + Guard.ArgumentNotNullOrEmptyString(value, "value"); + personConstructName = value.Trim(); + } + } + + private Uri personConstructUri; + /// + /// Gets or sets the IRI associated with this entity. + /// + /// A that represents a Internationalized Resource Identifier (IRI) associated with this entity. + /// + /// See RFC 3987: Internationalized Resource Identifiers for the IRI technical specification. + /// See System.Uri for enabling support for IRIs within Microsoft .NET framework applications. + /// + public Uri Uri + { + get + { + return personConstructUri; + } + + set + { + personConstructUri = value; + } + } + + + } +} diff --git a/src/cloudscribe.Syndication/Models/Atom/AtomSource.cs b/src/cloudscribe.Syndication/Models/Atom/AtomSource.cs index ca8f187..d88eca9 100644 --- a/src/cloudscribe.Syndication/Models/Atom/AtomSource.cs +++ b/src/cloudscribe.Syndication/Models/Atom/AtomSource.cs @@ -1,304 +1,304 @@ -using System; -using System.Collections.ObjectModel; -using System.Globalization; - -namespace cloudscribe.Syndication.Models.Atom -{ - public class AtomSource - { - - public AtomSource() - { - - } - - public AtomSource(AtomId id, AtomTextConstruct title, DateTime utcUpdatedOn) - { - this.Id = id; - this.Title = title; - this.UpdatedOn = utcUpdatedOn; - } - - - private Uri commonObjectBaseUri; - /// - /// Gets or sets the base URI other than the base URI of the document or external entity. - /// - /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. - /// - /// - /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, - /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). - /// - public Uri BaseUri - { - get - { - return commonObjectBaseUri; - } - - set - { - commonObjectBaseUri = value; - } - } - - private CultureInfo commonObjectLanguage; - /// - /// Gets or sets the natural or formal language in which the content is written. - /// - /// A that represents the natural or formal language in which the content is written. The default value is a null reference. - /// - /// - /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. - /// - /// - public CultureInfo Language - { - get - { - return commonObjectLanguage; - } - - set - { - commonObjectLanguage = value; - } - } - - private Collection sourceAuthors; - /// - /// Gets or sets the authors of this source. - /// - /// A collection of objects that represent the authors of this source. - public Collection Authors - { - get - { - if (sourceAuthors == null) - { - sourceAuthors = new Collection(); - } - return sourceAuthors; - } - } - - private Collection sourceCategories; - /// - /// Gets or sets the categories associated with this source. - /// - /// A collection of objects that represent the categories associated with this source. - public Collection Categories - { - get - { - if (sourceCategories == null) - { - sourceCategories = new Collection(); - } - return sourceCategories; - } - } - - - private Collection sourceContributors; - /// - /// Gets or sets the entities who contributed to this source. - /// - /// A collection of objects that represent the entities who contributed to this source. - public Collection Contributors - { - get - { - if (sourceContributors == null) - { - sourceContributors = new Collection(); - } - return sourceContributors; - } - } - - private AtomGenerator sourceGenerator; - /// - /// Gets or sets the agent used to generate this source. - /// - /// A object that represents the agent used to generate this source. The default value is a null reference. - public AtomGenerator Generator - { - get - { - return sourceGenerator; - } - - set - { - sourceGenerator = value; - } - } - - private AtomIcon sourceIcon; - /// - /// Gets or sets an image that provides iconic visual identification for this source. - /// - /// A object that represents an image that provides iconic visual identification for this source. The default value is a null reference. - /// - /// The image should have an aspect ratio of one (horizontal) to one (vertical) and should be suitable for presentation at a small size. - /// - public AtomIcon Icon - { - get - { - return sourceIcon; - } - - set - { - sourceIcon = value; - } - } - - private AtomId sourceId; - /// - /// Gets or sets a permanent, universally unique identifier for this source. - /// - /// A object that represents a permanent, universally unique identifier for this source. - public AtomId Id - { - get - { - return sourceId; - } - - set - { - sourceId = value; - } - } - - - private Collection sourceLinks; - /// - /// Gets or sets references from this source to one or more Web resources. - /// - /// A collection of objects that represent references from this source to one or more Web resources. - public Collection Links - { - get - { - if (sourceLinks == null) - { - sourceLinks = new Collection(); - } - return sourceLinks; - } - } - - private AtomLogo sourceLogo; - /// - /// Gets or sets an image that provides visual identification for this source. - /// - /// A object that represents an image that provides visual identification for this source. The default value is a null reference. - /// - /// The image should have an aspect ratio of 2 (horizontal) to 1 (vertical). - /// - public AtomLogo Logo - { - get - { - return sourceLogo; - } - - set - { - sourceLogo = value; - } - } - - - private AtomTextConstruct sourceRights; - /// - /// Gets or sets information about rights held in and over this source. - /// - /// A object that represents information about rights held in and over this source. - /// - /// The property should not be used to convey machine-readable licensing information. - /// - public AtomTextConstruct Rights - { - get - { - return sourceRights; - } - - set - { - sourceRights = value; - } - } - - - private AtomTextConstruct sourceSubtitle; - /// - /// Gets or sets information that conveys a human-readable description or subtitle for this source. - /// - /// A object that represents information that conveys a human-readable description or subtitle for this source. - public AtomTextConstruct Subtitle - { - get - { - return sourceSubtitle; - } - - set - { - sourceSubtitle = value; - } - } - - - private AtomTextConstruct sourceTitle; - /// - /// Gets or sets information that conveys a human-readable title for this source. - /// - /// A object that represents information that conveys a human-readable title for this source. - public AtomTextConstruct Title - { - get - { - return sourceTitle; - } - - set - { - sourceTitle = value; - } - } - - - private DateTime sourceUpdatedOn = DateTime.MinValue; - /// - /// Gets or sets a date-time indicating the most recent instant in time when this source was modified in a way the publisher considers significant. - /// - /// - /// A that indicates the most recent instant in time when this source was modified in a way the publisher considers significant. - /// Publishers may change the value of this element over time. The default value is , which indicates that no update time was provided. - /// - /// - /// The should be provided in Coordinated Universal Time (UTC). - /// - public DateTime UpdatedOn - { - get - { - return sourceUpdatedOn; - } - - set - { - sourceUpdatedOn = value; - } - } - - - } -} +using System; +using System.Collections.ObjectModel; +using System.Globalization; + +namespace cloudscribe.Syndication.Models.Atom +{ + public class AtomSource + { + + public AtomSource() + { + + } + + public AtomSource(AtomId id, AtomTextConstruct title, DateTime utcUpdatedOn) + { + this.Id = id; + this.Title = title; + this.UpdatedOn = utcUpdatedOn; + } + + + private Uri commonObjectBaseUri; + /// + /// Gets or sets the base URI other than the base URI of the document or external entity. + /// + /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. + /// + /// + /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, + /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). + /// + public Uri BaseUri + { + get + { + return commonObjectBaseUri; + } + + set + { + commonObjectBaseUri = value; + } + } + + private CultureInfo commonObjectLanguage; + /// + /// Gets or sets the natural or formal language in which the content is written. + /// + /// A that represents the natural or formal language in which the content is written. The default value is a null reference. + /// + /// + /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. + /// + /// + public CultureInfo Language + { + get + { + return commonObjectLanguage; + } + + set + { + commonObjectLanguage = value; + } + } + + private Collection sourceAuthors; + /// + /// Gets or sets the authors of this source. + /// + /// A collection of objects that represent the authors of this source. + public Collection Authors + { + get + { + if (sourceAuthors == null) + { + sourceAuthors = new Collection(); + } + return sourceAuthors; + } + } + + private Collection sourceCategories; + /// + /// Gets or sets the categories associated with this source. + /// + /// A collection of objects that represent the categories associated with this source. + public Collection Categories + { + get + { + if (sourceCategories == null) + { + sourceCategories = new Collection(); + } + return sourceCategories; + } + } + + + private Collection sourceContributors; + /// + /// Gets or sets the entities who contributed to this source. + /// + /// A collection of objects that represent the entities who contributed to this source. + public Collection Contributors + { + get + { + if (sourceContributors == null) + { + sourceContributors = new Collection(); + } + return sourceContributors; + } + } + + private AtomGenerator sourceGenerator; + /// + /// Gets or sets the agent used to generate this source. + /// + /// A object that represents the agent used to generate this source. The default value is a null reference. + public AtomGenerator Generator + { + get + { + return sourceGenerator; + } + + set + { + sourceGenerator = value; + } + } + + private AtomIcon sourceIcon; + /// + /// Gets or sets an image that provides iconic visual identification for this source. + /// + /// A object that represents an image that provides iconic visual identification for this source. The default value is a null reference. + /// + /// The image should have an aspect ratio of one (horizontal) to one (vertical) and should be suitable for presentation at a small size. + /// + public AtomIcon Icon + { + get + { + return sourceIcon; + } + + set + { + sourceIcon = value; + } + } + + private AtomId sourceId; + /// + /// Gets or sets a permanent, universally unique identifier for this source. + /// + /// A object that represents a permanent, universally unique identifier for this source. + public AtomId Id + { + get + { + return sourceId; + } + + set + { + sourceId = value; + } + } + + + private Collection sourceLinks; + /// + /// Gets or sets references from this source to one or more Web resources. + /// + /// A collection of objects that represent references from this source to one or more Web resources. + public Collection Links + { + get + { + if (sourceLinks == null) + { + sourceLinks = new Collection(); + } + return sourceLinks; + } + } + + private AtomLogo sourceLogo; + /// + /// Gets or sets an image that provides visual identification for this source. + /// + /// A object that represents an image that provides visual identification for this source. The default value is a null reference. + /// + /// The image should have an aspect ratio of 2 (horizontal) to 1 (vertical). + /// + public AtomLogo Logo + { + get + { + return sourceLogo; + } + + set + { + sourceLogo = value; + } + } + + + private AtomTextConstruct sourceRights; + /// + /// Gets or sets information about rights held in and over this source. + /// + /// A object that represents information about rights held in and over this source. + /// + /// The property should not be used to convey machine-readable licensing information. + /// + public AtomTextConstruct Rights + { + get + { + return sourceRights; + } + + set + { + sourceRights = value; + } + } + + + private AtomTextConstruct sourceSubtitle; + /// + /// Gets or sets information that conveys a human-readable description or subtitle for this source. + /// + /// A object that represents information that conveys a human-readable description or subtitle for this source. + public AtomTextConstruct Subtitle + { + get + { + return sourceSubtitle; + } + + set + { + sourceSubtitle = value; + } + } + + + private AtomTextConstruct sourceTitle; + /// + /// Gets or sets information that conveys a human-readable title for this source. + /// + /// A object that represents information that conveys a human-readable title for this source. + public AtomTextConstruct Title + { + get + { + return sourceTitle; + } + + set + { + sourceTitle = value; + } + } + + + private DateTime sourceUpdatedOn = DateTime.MinValue; + /// + /// Gets or sets a date-time indicating the most recent instant in time when this source was modified in a way the publisher considers significant. + /// + /// + /// A that indicates the most recent instant in time when this source was modified in a way the publisher considers significant. + /// Publishers may change the value of this element over time. The default value is , which indicates that no update time was provided. + /// + /// + /// The should be provided in Coordinated Universal Time (UTC). + /// + public DateTime UpdatedOn + { + get + { + return sourceUpdatedOn; + } + + set + { + sourceUpdatedOn = value; + } + } + + + } +} diff --git a/src/cloudscribe.Syndication/Models/Atom/AtomTextConstruct.cs b/src/cloudscribe.Syndication/Models/Atom/AtomTextConstruct.cs index a904836..066abde 100644 --- a/src/cloudscribe.Syndication/Models/Atom/AtomTextConstruct.cs +++ b/src/cloudscribe.Syndication/Models/Atom/AtomTextConstruct.cs @@ -1,122 +1,122 @@ -using System; -using System.Globalization; - -namespace cloudscribe.Syndication.Models.Atom -{ - - /// - /// Represents human-readable text. - /// - public class AtomTextConstruct - { - - public AtomTextConstruct() - { - - } - - public AtomTextConstruct(string content) - { - this.Content = content; - } - - - - - private Uri commonObjectBaseUri; - /// - /// Gets or sets the base URI other than the base URI of the document or external entity. - /// - /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. - /// - /// - /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, - /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). - /// - public Uri BaseUri - { - get - { - return commonObjectBaseUri; - } - - set - { - commonObjectBaseUri = value; - } - } - - private CultureInfo commonObjectLanguage; - /// - /// Gets or sets the natural or formal language in which the content is written. - /// - /// A that represents the natural or formal language in which the content is written. The default value is a null reference. - /// - /// - /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. - /// - /// - public CultureInfo Language - { - get - { - return commonObjectLanguage; - } - - set - { - commonObjectLanguage = value; - } - } - - private string textConstructContent = string.Empty; - /// - /// Gets or sets the content of this human-readable text. - /// - /// The content of this human-readable text. - /// - /// The property is language-sensitive, with the natural language of the value being specified by the property. - /// - public string Content - { - get - { - return textConstructContent; - } - - set - { - if (String.IsNullOrEmpty(value)) - { - textConstructContent = String.Empty; - } - else - { - textConstructContent = value.Trim(); - } - } - } - - private AtomTextConstructType textConstructType = AtomTextConstructType.None; - /// - /// Gets or sets the entity encoding utilized by this human-readable text. - /// - /// - /// An enumeration value that represents the entity encoding utilized by this human-readable text. - /// The default value is . - /// - public AtomTextConstructType TextType - { - get - { - return textConstructType; - } - - set - { - textConstructType = value; - } - } - - } -} +using System; +using System.Globalization; + +namespace cloudscribe.Syndication.Models.Atom +{ + + /// + /// Represents human-readable text. + /// + public class AtomTextConstruct + { + + public AtomTextConstruct() + { + + } + + public AtomTextConstruct(string content) + { + this.Content = content; + } + + + + + private Uri commonObjectBaseUri; + /// + /// Gets or sets the base URI other than the base URI of the document or external entity. + /// + /// A that represents a base URI other than the base URI of the document or external entity. The default value is a null reference. + /// + /// + /// The value of this property is interpreted as a URI Reference as defined in RFC 2396: Uniform Resource Identifiers, + /// after processing according to XML Base, Section 3.1 (URI Reference Encoding and Escaping). + /// + public Uri BaseUri + { + get + { + return commonObjectBaseUri; + } + + set + { + commonObjectBaseUri = value; + } + } + + private CultureInfo commonObjectLanguage; + /// + /// Gets or sets the natural or formal language in which the content is written. + /// + /// A that represents the natural or formal language in which the content is written. The default value is a null reference. + /// + /// + /// The value of this property is a language identifier as defined by RFC 3066: Tags for the Identification of Languages, or its successor. + /// + /// + public CultureInfo Language + { + get + { + return commonObjectLanguage; + } + + set + { + commonObjectLanguage = value; + } + } + + private string textConstructContent = string.Empty; + /// + /// Gets or sets the content of this human-readable text. + /// + /// The content of this human-readable text. + /// + /// The property is language-sensitive, with the natural language of the value being specified by the property. + /// + public string Content + { + get + { + return textConstructContent; + } + + set + { + if (String.IsNullOrEmpty(value)) + { + textConstructContent = String.Empty; + } + else + { + textConstructContent = value.Trim(); + } + } + } + + private AtomTextConstructType textConstructType = AtomTextConstructType.None; + /// + /// Gets or sets the entity encoding utilized by this human-readable text. + /// + /// + /// An enumeration value that represents the entity encoding utilized by this human-readable text. + /// The default value is . + /// + public AtomTextConstructType TextType + { + get + { + return textConstructType; + } + + set + { + textConstructType = value; + } + } + + } +} diff --git a/src/cloudscribe.Syndication/Models/Atom/AtomTextConstructType.cs b/src/cloudscribe.Syndication/Models/Atom/AtomTextConstructType.cs index 4482358..e2a849f 100644 --- a/src/cloudscribe.Syndication/Models/Atom/AtomTextConstructType.cs +++ b/src/cloudscribe.Syndication/Models/Atom/AtomTextConstructType.cs @@ -1,37 +1,37 @@ -namespace cloudscribe.Syndication.Models.Atom -{ - /// - /// Represents the entity encoding utilized by human-readable text constructs. - /// - /// - /// - /// - /// - //[Serializable()] - public enum AtomTextConstructType - { - /// - /// No entity-encoding type specified. - /// - //[EnumerationMetadata(DisplayName = "", AlternateValue = "")] - None = 0, - - /// - /// Indicates that the human-readable text is Hyper-Text Markup Language (HTML) encoded. - /// - //[EnumerationMetadata(DisplayName = "HTML", AlternateValue = "html")] - Html = 1, - - /// - /// Indicates that the human-readable text is not encoded per a specific entity scheme. - /// - //[EnumerationMetadata(DisplayName = "Text", AlternateValue = "text")] - Text = 2, - - /// - /// Indicates that the human-readable text is Extensible Hyper-Text Markup Language (XHTML) encoded. - /// - //[EnumerationMetadata(DisplayName = "XHTML", AlternateValue = "xhtml")] - Xhtml = 3 - } -} +namespace cloudscribe.Syndication.Models.Atom +{ + /// + /// Represents the entity encoding utilized by human-readable text constructs. + /// + /// + /// + /// + /// + //[Serializable()] + public enum AtomTextConstructType + { + /// + /// No entity-encoding type specified. + /// + //[EnumerationMetadata(DisplayName = "", AlternateValue = "")] + None = 0, + + /// + /// Indicates that the human-readable text is Hyper-Text Markup Language (HTML) encoded. + /// + //[EnumerationMetadata(DisplayName = "HTML", AlternateValue = "html")] + Html = 1, + + /// + /// Indicates that the human-readable text is not encoded per a specific entity scheme. + /// + //[EnumerationMetadata(DisplayName = "Text", AlternateValue = "text")] + Text = 2, + + /// + /// Indicates that the human-readable text is Extensible Hyper-Text Markup Language (XHTML) encoded. + /// + //[EnumerationMetadata(DisplayName = "XHTML", AlternateValue = "xhtml")] + Xhtml = 3 + } +} diff --git a/src/cloudscribe.Syndication/Models/Rss/DefaultChannelProviderResolver.cs b/src/cloudscribe.Syndication/Models/Rss/DefaultChannelProviderResolver.cs index 97754a7..81a4b8a 100644 --- a/src/cloudscribe.Syndication/Models/Rss/DefaultChannelProviderResolver.cs +++ b/src/cloudscribe.Syndication/Models/Rss/DefaultChannelProviderResolver.cs @@ -1,16 +1,16 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace cloudscribe.Syndication.Models.Rss -{ - public class DefaultChannelProviderResolver : IChannelProviderResolver - { - public IChannelProvider GetCurrentChannelProvider( - IEnumerable channelProviders) - { - return channelProviders.FirstOrDefault(); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace cloudscribe.Syndication.Models.Rss +{ + public class DefaultChannelProviderResolver : IChannelProviderResolver + { + public IChannelProvider GetCurrentChannelProvider( + IEnumerable channelProviders) + { + return channelProviders.FirstOrDefault(); + } + } +} diff --git a/src/cloudscribe.Syndication/Models/Rss/DefaultXmlFormatter.cs b/src/cloudscribe.Syndication/Models/Rss/DefaultXmlFormatter.cs index 24b9e93..2d29e67 100644 --- a/src/cloudscribe.Syndication/Models/Rss/DefaultXmlFormatter.cs +++ b/src/cloudscribe.Syndication/Models/Rss/DefaultXmlFormatter.cs @@ -1,158 +1,158 @@ -// Copyright (c) Source Tree Solutions, LLC. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -// Author: Joe Audette -// Created: 2016-04-02 -// Last Modified: 2016-08-23 -// - -using System.Xml.Linq; - -namespace cloudscribe.Syndication.Models.Rss -{ - public class DefaultXmlFormatter : IXmlFormatter - { - public DefaultXmlFormatter() - { - - } - - public XDocument BuildXml(RssChannel channel) - { - //http://cyber.law.harvard.edu/rss/rss.html - //http://cyber.law.harvard.edu/rss/examples/rss2sample.xml - //http://www.mikesdotnetting.com/article/174/generating-rss-and-atom-feeds-in-webmatrix - //http://www.rssboard.org/rss-profile - - var rssChannel = new XElement(Rss20Constants.ChannelTag, - new XElement(Rss20Constants.TitleTag, channel.Title), - new XElement(Rss20Constants.LinkTag, channel.Link.ToString()), - new XElement(Rss20Constants.DescriptionTag, channel.Description), - new XElement(Rss20Constants.LanguageTag, channel.Language), - new XElement(Rss20Constants.PubDateTag, channel.PublicationDate.ToString("R")), - new XElement(Rss20Constants.DocsTag, Rss20Constants.SpecificationLink), - new XElement(Rss20Constants.TtlTag, channel.TimeToLive) - ); - - if(!string.IsNullOrEmpty(channel.ManagingEditor)) - { - rssChannel.Add(new XElement(Rss20Constants.ManagingEditorTag, channel.ManagingEditor)); - } - - if (!string.IsNullOrEmpty(channel.Webmaster)) - { - rssChannel.Add(new XElement(Rss20Constants.WebMasterTag, channel.Webmaster)); - } - - // image is optional - // The image MUST contain three child elements: link, title and url. It also MAY contain three - // OPTIONAL elements: description, height and width. - if ( - !(channel.Image == null) - && (channel.Image.Url != null) - && (channel.Image.Link != null) - && (!string.IsNullOrEmpty(channel.Image.Title)) - ) - { - var imageElement = new XElement(Rss20Constants.ImageTag, - new XElement(Rss20Constants.LinkTag, channel.Image.Link), - new XElement(Rss20Constants.TitleTag, channel.Image.Title), - new XElement(Rss20Constants.UrlTag, channel.Image.Url) - - ); - - if (!string.IsNullOrEmpty(channel.Image.Description)) - { - imageElement.Add(new XElement(Rss20Constants.DescriptionTag, channel.Image.Description)); - } - - // The image's height element contains the height, in pixels, of the image (OPTIONAL). - // The image MUST be no taller than 400 pixels. If this element is omitted, the image is - // assumed to be 31 pixels tall. - if (channel.Image.Height > int.MinValue) - { - imageElement.Add(new XElement(Rss20Constants.HeightTag, channel.Image.Height)); - } - - //The image's width element contains the width, in pixels, of the image (OPTIONAL). The image MUST be no wider than 144 pixels. - // If this element is omitted, the image is assumed to be 88 pixels wide. - if (channel.Image.Width > int.MinValue) - { - imageElement.Add(new XElement(Rss20Constants.WidthTag, channel.Image.Width)); - } - - rssChannel.Add(imageElement); - } - - if (!string.IsNullOrEmpty(channel.Copyright)) - { - rssChannel.Add(new XElement(Rss20Constants.CopyrightTag, channel.Copyright)); - } - - if (!string.IsNullOrEmpty(channel.Generator)) - { - rssChannel.Add(new XElement(Rss20Constants.GeneratorTag, channel.Generator)); - } - - XNamespace ns = Rss20Constants.AtomNamespace; - - if (channel.SelfLink != null) - { - rssChannel.Add( - new XElement(ns + Rss20Constants.LinkTag, - new XAttribute("href", channel.SelfLink), - new XAttribute("rel", "self"), - new XAttribute("type", "application/rss+xml") - )); - } - - foreach (var item in channel.Items) - { - AddItem(rssChannel, item); - } - - var rss = new XDocument( - new XDeclaration("1.0", "utf-8", "yes"), - new XElement(Rss20Constants.RssTag, - new XAttribute(Rss20Constants.VersionTag, Rss20Constants.Version), - new XAttribute(XNamespace.Xmlns + "atom", ns) - , - rssChannel - ) - ); - - return rss; - - } - - private void AddItem( - XElement channel, - RssItem item - ) - { - var rssItem = new XElement(Rss20Constants.ItemTag, - new XElement(Rss20Constants.TitleTag, item.Title), - new XElement(Rss20Constants.DescriptionTag, new XCData(item.Description)), - new XElement(Rss20Constants.LinkTag, item.Link.ToString()), - new XElement(Rss20Constants.GuidTag, item.Guid.Value), - new XElement(Rss20Constants.PubDateTag, item.PublicationDate.ToString("R")) - ); - - - - // author: A feed published by an individual SHOULD omit this element and use the managingEditor or - // webMaster channel elements to provide contact information. - - if (item.Categories.Count > 0) - { - foreach (var cat in item.Categories) - { - var ele = new XElement(Rss20Constants.CategoryTag, cat.Value); - rssItem.Add(ele); - } - } - - channel.Add(rssItem); - } - - } -} +// Copyright (c) Source Tree Solutions, LLC. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Author: Joe Audette +// Created: 2016-04-02 +// Last Modified: 2016-08-23 +// + +using System.Xml.Linq; + +namespace cloudscribe.Syndication.Models.Rss +{ + public class DefaultXmlFormatter : IXmlFormatter + { + public DefaultXmlFormatter() + { + + } + + public XDocument BuildXml(RssChannel channel) + { + //http://cyber.law.harvard.edu/rss/rss.html + //http://cyber.law.harvard.edu/rss/examples/rss2sample.xml + //http://www.mikesdotnetting.com/article/174/generating-rss-and-atom-feeds-in-webmatrix + //http://www.rssboard.org/rss-profile + + var rssChannel = new XElement(Rss20Constants.ChannelTag, + new XElement(Rss20Constants.TitleTag, channel.Title), + new XElement(Rss20Constants.LinkTag, channel.Link.ToString()), + new XElement(Rss20Constants.DescriptionTag, channel.Description), + new XElement(Rss20Constants.LanguageTag, channel.Language), + new XElement(Rss20Constants.PubDateTag, channel.PublicationDate.ToString("R")), + new XElement(Rss20Constants.DocsTag, Rss20Constants.SpecificationLink), + new XElement(Rss20Constants.TtlTag, channel.TimeToLive) + ); + + if(!string.IsNullOrEmpty(channel.ManagingEditor)) + { + rssChannel.Add(new XElement(Rss20Constants.ManagingEditorTag, channel.ManagingEditor)); + } + + if (!string.IsNullOrEmpty(channel.Webmaster)) + { + rssChannel.Add(new XElement(Rss20Constants.WebMasterTag, channel.Webmaster)); + } + + // image is optional + // The image MUST contain three child elements: link, title and url. It also MAY contain three + // OPTIONAL elements: description, height and width. + if ( + !(channel.Image == null) + && (channel.Image.Url != null) + && (channel.Image.Link != null) + && (!string.IsNullOrEmpty(channel.Image.Title)) + ) + { + var imageElement = new XElement(Rss20Constants.ImageTag, + new XElement(Rss20Constants.LinkTag, channel.Image.Link), + new XElement(Rss20Constants.TitleTag, channel.Image.Title), + new XElement(Rss20Constants.UrlTag, channel.Image.Url) + + ); + + if (!string.IsNullOrEmpty(channel.Image.Description)) + { + imageElement.Add(new XElement(Rss20Constants.DescriptionTag, channel.Image.Description)); + } + + // The image's height element contains the height, in pixels, of the image (OPTIONAL). + // The image MUST be no taller than 400 pixels. If this element is omitted, the image is + // assumed to be 31 pixels tall. + if (channel.Image.Height > int.MinValue) + { + imageElement.Add(new XElement(Rss20Constants.HeightTag, channel.Image.Height)); + } + + //The image's width element contains the width, in pixels, of the image (OPTIONAL). The image MUST be no wider than 144 pixels. + // If this element is omitted, the image is assumed to be 88 pixels wide. + if (channel.Image.Width > int.MinValue) + { + imageElement.Add(new XElement(Rss20Constants.WidthTag, channel.Image.Width)); + } + + rssChannel.Add(imageElement); + } + + if (!string.IsNullOrEmpty(channel.Copyright)) + { + rssChannel.Add(new XElement(Rss20Constants.CopyrightTag, channel.Copyright)); + } + + if (!string.IsNullOrEmpty(channel.Generator)) + { + rssChannel.Add(new XElement(Rss20Constants.GeneratorTag, channel.Generator)); + } + + XNamespace ns = Rss20Constants.AtomNamespace; + + if (channel.SelfLink != null) + { + rssChannel.Add( + new XElement(ns + Rss20Constants.LinkTag, + new XAttribute("href", channel.SelfLink), + new XAttribute("rel", "self"), + new XAttribute("type", "application/rss+xml") + )); + } + + foreach (var item in channel.Items) + { + AddItem(rssChannel, item); + } + + var rss = new XDocument( + new XDeclaration("1.0", "utf-8", "yes"), + new XElement(Rss20Constants.RssTag, + new XAttribute(Rss20Constants.VersionTag, Rss20Constants.Version), + new XAttribute(XNamespace.Xmlns + "atom", ns) + , + rssChannel + ) + ); + + return rss; + + } + + private void AddItem( + XElement channel, + RssItem item + ) + { + var rssItem = new XElement(Rss20Constants.ItemTag, + new XElement(Rss20Constants.TitleTag, item.Title), + new XElement(Rss20Constants.DescriptionTag, new XCData(item.Description)), + new XElement(Rss20Constants.LinkTag, item.Link.ToString()), + new XElement(Rss20Constants.GuidTag, item.Guid.Value), + new XElement(Rss20Constants.PubDateTag, item.PublicationDate.ToString("R")) + ); + + + + // author: A feed published by an individual SHOULD omit this element and use the managingEditor or + // webMaster channel elements to provide contact information. + + if (item.Categories.Count > 0) + { + foreach (var cat in item.Categories) + { + var ele = new XElement(Rss20Constants.CategoryTag, cat.Value); + rssItem.Add(ele); + } + } + + channel.Add(rssItem); + } + + } +} diff --git a/src/cloudscribe.Syndication/Models/Rss/IChannelProvider.cs b/src/cloudscribe.Syndication/Models/Rss/IChannelProvider.cs index 6faa3ef..a810294 100644 --- a/src/cloudscribe.Syndication/Models/Rss/IChannelProvider.cs +++ b/src/cloudscribe.Syndication/Models/Rss/IChannelProvider.cs @@ -1,12 +1,12 @@ -using System.Threading; -using System.Threading.Tasks; - -namespace cloudscribe.Syndication.Models.Rss -{ - public interface IChannelProvider - { - string Name { get; } - - Task GetChannel(CancellationToken cancellationToken = default(CancellationToken)); - } -} +using System.Threading; +using System.Threading.Tasks; + +namespace cloudscribe.Syndication.Models.Rss +{ + public interface IChannelProvider + { + string Name { get; } + + Task GetChannel(CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/cloudscribe.Syndication/Models/Rss/IChannelProviderResolver.cs b/src/cloudscribe.Syndication/Models/Rss/IChannelProviderResolver.cs index 2bb07e4..c44b053 100644 --- a/src/cloudscribe.Syndication/Models/Rss/IChannelProviderResolver.cs +++ b/src/cloudscribe.Syndication/Models/Rss/IChannelProviderResolver.cs @@ -1,14 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -namespace cloudscribe.Syndication.Models.Rss -{ - public interface IChannelProviderResolver - { - IChannelProvider GetCurrentChannelProvider( - IEnumerable channelProviders); - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; + +namespace cloudscribe.Syndication.Models.Rss +{ + public interface IChannelProviderResolver + { + IChannelProvider GetCurrentChannelProvider( + IEnumerable channelProviders); + } +} diff --git a/src/cloudscribe.Syndication/Models/Rss/IXmlFormatter.cs b/src/cloudscribe.Syndication/Models/Rss/IXmlFormatter.cs index 969973e..d6a4f56 100644 --- a/src/cloudscribe.Syndication/Models/Rss/IXmlFormatter.cs +++ b/src/cloudscribe.Syndication/Models/Rss/IXmlFormatter.cs @@ -1,10 +1,10 @@ -using System.Xml.Linq; - - -namespace cloudscribe.Syndication.Models.Rss -{ - public interface IXmlFormatter - { - XDocument BuildXml(RssChannel channel); - } +using System.Xml.Linq; + + +namespace cloudscribe.Syndication.Models.Rss +{ + public interface IXmlFormatter + { + XDocument BuildXml(RssChannel channel); + } } \ No newline at end of file diff --git a/src/cloudscribe.Syndication/Models/Rss/NullChannelProvider.cs b/src/cloudscribe.Syndication/Models/Rss/NullChannelProvider.cs index 37ed9e0..a9757c8 100644 --- a/src/cloudscribe.Syndication/Models/Rss/NullChannelProvider.cs +++ b/src/cloudscribe.Syndication/Models/Rss/NullChannelProvider.cs @@ -1,20 +1,20 @@ -using System; -using System.Threading; -using System.Threading.Tasks; - -namespace cloudscribe.Syndication.Models.Rss -{ - public class NullChannelProvider : IChannelProvider - { - public string Name { get { return "NullChannelProvider"; } } - - public Task GetChannel(CancellationToken cancellationToken = default(CancellationToken)) - { - cancellationToken.ThrowIfCancellationRequested(); - RssChannel channel = null; - return Task.FromResult(channel); - } - - - } -} +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace cloudscribe.Syndication.Models.Rss +{ + public class NullChannelProvider : IChannelProvider + { + public string Name { get { return "NullChannelProvider"; } } + + public Task GetChannel(CancellationToken cancellationToken = default(CancellationToken)) + { + cancellationToken.ThrowIfCancellationRequested(); + RssChannel channel = null; + return Task.FromResult(channel); + } + + + } +} diff --git a/src/cloudscribe.Syndication/Models/Rss/Rss20Constants.cs b/src/cloudscribe.Syndication/Models/Rss/Rss20Constants.cs index 95af7b8..31aa748 100644 --- a/src/cloudscribe.Syndication/Models/Rss/Rss20Constants.cs +++ b/src/cloudscribe.Syndication/Models/Rss/Rss20Constants.cs @@ -1,42 +1,42 @@ -namespace cloudscribe.Syndication.Models.Rss -{ - public static class Rss20Constants - { - public const string AtomNamespace = "http://www.w3.org/2005/Atom"; - public const string AuthorTag = "author"; - public const string CategoryTag = "category"; - public const string ChannelTag = "channel"; - public const string CopyrightTag = "copyright"; - public const string DescriptionTag = "description"; - public const string DocsTag = "docs"; - public const string DomainTag = "domain"; - public const string EnclosureTag = "enclosure"; - public const string ExtensionWrapperTag = "extensionWrapper"; - public const string GeneratorTag = "generator"; - public const string GuidTag = "guid"; - public const string HeightTag = "height"; - public const string ImageTag = "image"; - public const string IsPermaLinkTag = "isPermaLink"; - public const string ItemTag = "item"; - public const string LanguageTag = "language"; - public const string LastBuildDateTag = "lastBuildDate"; - public const string LengthTag = "length"; - public const string LinkTag = "link"; - public const string ManagingEditorTag = "managingEditor"; - public const string PubDateTag = "pubDate"; - public const string Rss20Namespace = ""; - public const string RssTag = "rss"; - public const string SourceTag = "source"; - public const string SpecificationLink = "http://blogs.law.harvard.edu/tech/rss"; - public const string TitleTag = "title"; - public const string TypeTag = "type"; - public const string TtlTag = "ttl"; - public const string UrlTag = "url"; - public const string Version = "2.0"; - public const string VersionTag = "version"; - public const string WidthTag = "width"; - public const string WebMasterTag = "webMaster"; - - - } -} +namespace cloudscribe.Syndication.Models.Rss +{ + public static class Rss20Constants + { + public const string AtomNamespace = "http://www.w3.org/2005/Atom"; + public const string AuthorTag = "author"; + public const string CategoryTag = "category"; + public const string ChannelTag = "channel"; + public const string CopyrightTag = "copyright"; + public const string DescriptionTag = "description"; + public const string DocsTag = "docs"; + public const string DomainTag = "domain"; + public const string EnclosureTag = "enclosure"; + public const string ExtensionWrapperTag = "extensionWrapper"; + public const string GeneratorTag = "generator"; + public const string GuidTag = "guid"; + public const string HeightTag = "height"; + public const string ImageTag = "image"; + public const string IsPermaLinkTag = "isPermaLink"; + public const string ItemTag = "item"; + public const string LanguageTag = "language"; + public const string LastBuildDateTag = "lastBuildDate"; + public const string LengthTag = "length"; + public const string LinkTag = "link"; + public const string ManagingEditorTag = "managingEditor"; + public const string PubDateTag = "pubDate"; + public const string Rss20Namespace = ""; + public const string RssTag = "rss"; + public const string SourceTag = "source"; + public const string SpecificationLink = "http://blogs.law.harvard.edu/tech/rss"; + public const string TitleTag = "title"; + public const string TypeTag = "type"; + public const string TtlTag = "ttl"; + public const string UrlTag = "url"; + public const string Version = "2.0"; + public const string VersionTag = "version"; + public const string WidthTag = "width"; + public const string WebMasterTag = "webMaster"; + + + } +} diff --git a/src/cloudscribe.Syndication/Models/Rss/RssCategory.cs b/src/cloudscribe.Syndication/Models/Rss/RssCategory.cs index c0f296e..a42df16 100644 --- a/src/cloudscribe.Syndication/Models/Rss/RssCategory.cs +++ b/src/cloudscribe.Syndication/Models/Rss/RssCategory.cs @@ -1,103 +1,103 @@ -using System.Collections.ObjectModel; - -namespace cloudscribe.Syndication.Models.Rss -{ - /// - /// Represents a category or tag to which a or belongs. - /// - public class RssCategory - { - - public RssCategory() - { - - } - - public RssCategory(string value) - { - this.Value = value; - } - - public RssCategory(string value, string domain) : this(value) - { - this.Domain = domain; - } - - public RssCategory(Collection value) - { - Guard.ArgumentNotNull(value, "value"); - - //------------------------------------------------------------ - // Build slash-delimited string for supplied taxonomy hierarchy - //------------------------------------------------------------ - if (value.Count > 0) - { - string[] hierarchy = new string[value.Count]; - value.CopyTo(hierarchy, 0); - - this.Value = string.Join("/", hierarchy); - } - } - - public RssCategory(Collection value, string domain) : this(value) - { - this.Domain = domain; - } - - private string categoryDomain = string.Empty; - /// - /// Gets or sets a string that identifies the taxonomy in which the category is placed. - /// - /// A string that identifies the taxonomy in which the category is placed. The default value is an empty string. - public string Domain - { - get - { - return categoryDomain; - } - - set - { - if (string.IsNullOrEmpty(value)) - { - categoryDomain = string.Empty; - } - else - { - categoryDomain = value.Trim(); - } - } - } - - private string categoryValue = string.Empty; - - /// - /// Gets or sets a slash-delimited string that identifies a hierarchical position in the taxonomy. - /// - /// A slash-delimited string that identifies a hierarchical position in the taxonomy. The default value is an empty string. - /// - /// If the category represents a tag or is the root hierarchical position in the taxonomy, no slash-delimiter is necessary. - /// - public string Value - { - get - { - return categoryValue; - } - - set - { - if (string.IsNullOrEmpty(value)) - { - categoryValue = string.Empty; - } - else - { - categoryValue = value.Trim(); - } - } - } - - - } -} +using System.Collections.ObjectModel; + +namespace cloudscribe.Syndication.Models.Rss +{ + /// + /// Represents a category or tag to which a or belongs. + /// + public class RssCategory + { + + public RssCategory() + { + + } + + public RssCategory(string value) + { + this.Value = value; + } + + public RssCategory(string value, string domain) : this(value) + { + this.Domain = domain; + } + + public RssCategory(Collection value) + { + Guard.ArgumentNotNull(value, "value"); + + //------------------------------------------------------------ + // Build slash-delimited string for supplied taxonomy hierarchy + //------------------------------------------------------------ + if (value.Count > 0) + { + string[] hierarchy = new string[value.Count]; + value.CopyTo(hierarchy, 0); + + this.Value = string.Join("/", hierarchy); + } + } + + public RssCategory(Collection value, string domain) : this(value) + { + this.Domain = domain; + } + + private string categoryDomain = string.Empty; + /// + /// Gets or sets a string that identifies the taxonomy in which the category is placed. + /// + /// A string that identifies the taxonomy in which the category is placed. The default value is an empty string. + public string Domain + { + get + { + return categoryDomain; + } + + set + { + if (string.IsNullOrEmpty(value)) + { + categoryDomain = string.Empty; + } + else + { + categoryDomain = value.Trim(); + } + } + } + + private string categoryValue = string.Empty; + + /// + /// Gets or sets a slash-delimited string that identifies a hierarchical position in the taxonomy. + /// + /// A slash-delimited string that identifies a hierarchical position in the taxonomy. The default value is an empty string. + /// + /// If the category represents a tag or is the root hierarchical position in the taxonomy, no slash-delimiter is necessary. + /// + public string Value + { + get + { + return categoryValue; + } + + set + { + if (string.IsNullOrEmpty(value)) + { + categoryValue = string.Empty; + } + else + { + categoryValue = value.Trim(); + } + } + } + + + } +} diff --git a/src/cloudscribe.Syndication/Models/Rss/RssChannel.cs b/src/cloudscribe.Syndication/Models/Rss/RssChannel.cs index 4801ef3..7141cbe 100644 --- a/src/cloudscribe.Syndication/Models/Rss/RssChannel.cs +++ b/src/cloudscribe.Syndication/Models/Rss/RssChannel.cs @@ -1,497 +1,497 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Globalization; - - -namespace cloudscribe.Syndication.Models.Rss -{ - /// - /// Represents information about the meta-data and contents associated to an . - /// - public class RssChannel - { - - public RssChannel() - { - - } - - public RssChannel(Uri link, string title, string description) - { - this.Link = link; - this.Title = title; - this.Description = description; - } - - /// - /// ie feedburner url - /// - public string RemoteFeedUrl { get; set; } = string.Empty; - - /// - /// ie Feedburner User Agent fragment "FeedBurner" - /// - public string RemoteFeedProcessorUseAgentFragment { get; set; } = string.Empty; - - private Collection channelCategories = null; - /// - /// Gets the categories or tags to which this channel belongs. - /// - /// - /// A collection of objects that represent the categories to which this channel belongs. The default value is an empty collection. - /// - public Collection Categories - { - get - { - if (channelCategories == null) - { - channelCategories = new Collection(); - } - return channelCategories; - } - } - - private string channelCopyrightNotice = string.Empty; - /// - /// Gets or sets the human-readable copyright statement that applies to this feed. - /// - /// The human-readable copyright statement that applies to this feed. - /// - /// When a feed lacks a copyright element, aggregators should not assume that is in the public domain and can be republished and redistributed without restriction. - /// - public string Copyright - { - get - { - return channelCopyrightNotice; - } - - set - { - if (string.IsNullOrEmpty(value)) - { - channelCopyrightNotice = string.Empty; - } - else - { - channelCopyrightNotice = value.Trim(); - } - } - } - - private string channelDescription = string.Empty; - /// - /// Gets or sets character data that provides a human-readable characterization or summary of this feed. - /// - /// Character data that provides a human-readable characterization or summary of this feed. - /// - /// The description character data must be suitable for presentation as HTML. - /// - /// The is a null reference (Nothing in Visual Basic). - /// The is an empty string. - public string Description - { - get - { - return channelDescription; - } - - set - { - Guard.ArgumentNotNullOrEmptyString(value, "value"); - channelDescription = value.Trim(); - } - } - - private string channelGenerator = "cloudscribe.Syndication"; - /// - /// Gets or sets a value that credits the software that created this feed. - /// - /// A value that credits the software that created this feed. The default value is an agent that describes this syndication framework. - public string Generator - { - get - { - return channelGenerator; - } - - set - { - if (string.IsNullOrEmpty(value)) - { - channelGenerator = string.Empty; - } - else - { - channelGenerator = value.Trim(); - } - } - } - - private RssImage channelImage; - /// - /// Gets or sets the graphical logo for this feed. - /// - /// - /// A object that represents the graphical logo for this feed. The default value is a null reference. - /// - public RssImage Image - { - get - { - return channelImage; - } - - set - { - channelImage = value; - } - } - - private IEnumerable channelItems; - /// - /// Gets or sets the distinct content published in this feed. - /// - /// A collection of objects that represent distinct content published in this feed. - /// - /// This collection of objects is internally represented as a collection. - /// - /// The is a null reference (Nothing in Visual Basic). - public IEnumerable Items - { - get - { - if (channelItems == null) - { - channelItems = new Collection(); - } - return channelItems; - } - - set - { - Guard.ArgumentNotNull(value, "value"); - channelItems = value; - } - } - - private CultureInfo channelLanguage; - /// - /// Gets or sets the natural language employed in this feed. - /// - /// A object that represents the natural language employed in this feed. The default value is a null reference. - /// - /// The language must be identified using one of the RSS language codes - /// or a W3C language code. - /// - public CultureInfo Language - { - get - { - if (channelLanguage == null) return new CultureInfo("en-US"); - return channelLanguage; - } - - set - { - channelLanguage = value; - } - } - - private DateTime channelLastBuildDate = DateTime.MinValue; - /// - /// Gets or sets the last date and time the content of this feed was updated. - /// - /// - /// A object that represents the last date and time the content of this feed was updated. - /// The default value is , which indicates that no last build date was specified. - /// - public DateTime LastBuildDate - { - get - { - return channelLastBuildDate; - } - - set - { - channelLastBuildDate = value; - } - } - - private Uri channelLink; - /// - /// Gets or sets the URL of the web site associated with this feed. - /// - /// A that represents the URL of the web site associated with this feed. - /// The is a null reference (Nothing in Visual Basic). - public Uri Link - { - get - { - return channelLink; - } - - set - { - Guard.ArgumentNotNull(value, "value"); - channelLink = value; - } - } - - private string channelManagingEditor = string.Empty; - /// - /// Gets or sets the e-mail address of the person to contact regarding the editorial content of this feed. - /// - /// The e-mail address of the person to contact regarding the editorial content of this feed. - /// - /// - /// There is no requirement to follow a specific format for email addresses. Publishers can format addresses according to the RFC 2822 Address Specification, - /// the RFC 2368 guidelines for mailto links, or some other scheme. The recommended format for e-mail addresses is username@hostname.tld (Real Name). - /// - /// - public string ManagingEditor - { - get - { - return channelManagingEditor; - } - - set - { - if (string.IsNullOrEmpty(value)) - { - channelManagingEditor = string.Empty; - } - else - { - channelManagingEditor = value.Trim(); - } - } - } - - private DateTime channelPublicationDate = DateTime.MinValue; - /// - /// Gets or sets the publication date and time of this feed's content. - /// - /// - /// A object that represents the publication date and time of this feed's content. - /// The default value is , which indicates that no publication date was specified. - /// - /// - /// Publishers of daily, weekly or monthly periodicals can use this element to associate feed items with the date they most recently went to press. - /// - public DateTime PublicationDate - { - get - { - return channelPublicationDate; - } - - set - { - channelPublicationDate = value; - } - } - - private string channelRating = string.Empty; - /// - /// Gets or sets an advisory label for the content in this feed. - /// - /// A string value, formatted according to the specification for the Platform for Internet Content Selection (PICS), that supplies an advisory label for the content in this feed. - /// - /// - /// For further information on the Platform for Internet Content Selection (PICS) advisory label formatting specification, - /// see http://www.w3.org/TR/REC-PICS-labels#General. - /// - /// - public string Rating - { - get - { - return channelRating; - } - - set - { - if (string.IsNullOrEmpty(value)) - { - channelRating = string.Empty; - } - else - { - channelRating = value.Trim(); - } - } - } - - private Uri channelSelfLink; - /// - /// Gets or sets a URL that describes the feed itself. - /// - /// A that represents a URL that points to where this feed can be retrieved from. - /// - /// - /// Identifying a feed's URL within the feed makes it more portable, self-contained, and easier to cache. - /// For these reasons, a feed should provide a value for that is used for this purpose. - /// - /// - /// Identifying a self referential link is achieved by including a atom:link element within the channel. - /// See RSS Profile for more information. - /// - /// - public Uri SelfLink - { - get - { - return channelSelfLink; - } - - set - { - channelSelfLink = value; - } - } - - private Collection channelSkipDays; - /// - /// Gets or sets the days of the week during which this feed is not updated. - /// - /// A collection of enumeration values that indicate the days of the week during which this feed is not updated. - /// - /// enumeration values within this collection must not be duplicated. - /// - public Collection SkipDays - { - get - { - if (channelSkipDays == null) - { - channelSkipDays = new Collection(); - } - return channelSkipDays; - } - } - - private Collection channelSkipHours; - /// - /// Gets or sets the hours of the day during which this feed is not updated. - /// - /// A collection of objects that indicate the hours of the day during which this feed is not updated. - /// - /// Values from 0 to 23 are permitted, with 0 representing midnight. Integer values within this collection must not be duplicated. - /// - public Collection SkipHours - { - get - { - if (channelSkipHours == null) - { - channelSkipHours = new Collection(); - } - return channelSkipHours; - } - } - - private RssTextInput channelTextInput; - /// - /// Gets or sets a form to submit a text query to this feed's publisher over the Common Gateway Interface (CGI). - /// - /// - /// A object that represents a form to submit a text query to this feed's publisher over the Common Gateway Interface (CGI). - /// The default value is a null reference. - /// - public RssTextInput TextInput - { - get - { - return channelTextInput; - } - - set - { - channelTextInput = value; - } - } - - private int channelTimeToLive = int.MinValue; - /// - /// Gets or sets the maximum number of minutes to cache the data before a client should request it again. - /// - /// - /// The maximum number of minutes to cache the data before an aggregator should request it again. - /// The default value is , which indicates no time-to-live was specified. - /// - /// - /// Aggregators that support this property should treat it as a publisher's suggestion of a feed's update frequency, not a hard rule. - /// - public int TimeToLive - { - get - { - return channelTimeToLive; - } - - set - { - channelTimeToLive = value; - } - } - - private string channelTitle = string.Empty; - /// - /// Gets or sets character data that provides the name of this feed. - /// - /// Character data that provides the name of this feed. - /// The is a null reference (Nothing in Visual Basic). - /// The is an empty string. - public string Title - { - get - { - return channelTitle; - } - - set - { - Guard.ArgumentNotNullOrEmptyString(value, "value"); - channelTitle = value.Trim(); - } - } - - private string channelWebmaster = string.Empty; - /// - /// Gets or sets the e-mail address of the person to contact about technical issues regarding this feed. - /// - /// The e-mail address of the person to contact about technical issues regarding this feed. - /// - /// - /// There is no requirement to follow a specific format for email addresses. Publishers can format addresses according to the RFC 2822 Address Specification, - /// the RFC 2368 guidelines for mailto links, or some other scheme. The recommended format for e-mail addresses is username@hostname.tld (Real Name). - /// - /// - public string Webmaster - { - get - { - return channelWebmaster; - } - - set - { - if (string.IsNullOrEmpty(value)) - { - channelWebmaster = string.Empty; - } - else - { - channelWebmaster = value.Trim(); - } - } - } - - - } -} +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Globalization; + + +namespace cloudscribe.Syndication.Models.Rss +{ + /// + /// Represents information about the meta-data and contents associated to an . + /// + public class RssChannel + { + + public RssChannel() + { + + } + + public RssChannel(Uri link, string title, string description) + { + this.Link = link; + this.Title = title; + this.Description = description; + } + + /// + /// ie feedburner url + /// + public string RemoteFeedUrl { get; set; } = string.Empty; + + /// + /// ie Feedburner User Agent fragment "FeedBurner" + /// + public string RemoteFeedProcessorUseAgentFragment { get; set; } = string.Empty; + + private Collection channelCategories = null; + /// + /// Gets the categories or tags to which this channel belongs. + /// + /// + /// A collection of objects that represent the categories to which this channel belongs. The default value is an empty collection. + /// + public Collection Categories + { + get + { + if (channelCategories == null) + { + channelCategories = new Collection(); + } + return channelCategories; + } + } + + private string channelCopyrightNotice = string.Empty; + /// + /// Gets or sets the human-readable copyright statement that applies to this feed. + /// + /// The human-readable copyright statement that applies to this feed. + /// + /// When a feed lacks a copyright element, aggregators should not assume that is in the public domain and can be republished and redistributed without restriction. + /// + public string Copyright + { + get + { + return channelCopyrightNotice; + } + + set + { + if (string.IsNullOrEmpty(value)) + { + channelCopyrightNotice = string.Empty; + } + else + { + channelCopyrightNotice = value.Trim(); + } + } + } + + private string channelDescription = string.Empty; + /// + /// Gets or sets character data that provides a human-readable characterization or summary of this feed. + /// + /// Character data that provides a human-readable characterization or summary of this feed. + /// + /// The description character data must be suitable for presentation as HTML. + /// + /// The is a null reference (Nothing in Visual Basic). + /// The is an empty string. + public string Description + { + get + { + return channelDescription; + } + + set + { + Guard.ArgumentNotNullOrEmptyString(value, "value"); + channelDescription = value.Trim(); + } + } + + private string channelGenerator = "cloudscribe.Syndication"; + /// + /// Gets or sets a value that credits the software that created this feed. + /// + /// A value that credits the software that created this feed. The default value is an agent that describes this syndication framework. + public string Generator + { + get + { + return channelGenerator; + } + + set + { + if (string.IsNullOrEmpty(value)) + { + channelGenerator = string.Empty; + } + else + { + channelGenerator = value.Trim(); + } + } + } + + private RssImage channelImage; + /// + /// Gets or sets the graphical logo for this feed. + /// + /// + /// A object that represents the graphical logo for this feed. The default value is a null reference. + /// + public RssImage Image + { + get + { + return channelImage; + } + + set + { + channelImage = value; + } + } + + private IEnumerable channelItems; + /// + /// Gets or sets the distinct content published in this feed. + /// + /// A collection of objects that represent distinct content published in this feed. + /// + /// This collection of objects is internally represented as a collection. + /// + /// The is a null reference (Nothing in Visual Basic). + public IEnumerable Items + { + get + { + if (channelItems == null) + { + channelItems = new Collection(); + } + return channelItems; + } + + set + { + Guard.ArgumentNotNull(value, "value"); + channelItems = value; + } + } + + private CultureInfo channelLanguage; + /// + /// Gets or sets the natural language employed in this feed. + /// + /// A object that represents the natural language employed in this feed. The default value is a null reference. + /// + /// The language must be identified using one of the RSS language codes + /// or a W3C language code. + /// + public CultureInfo Language + { + get + { + if (channelLanguage == null) return new CultureInfo("en-US"); + return channelLanguage; + } + + set + { + channelLanguage = value; + } + } + + private DateTime channelLastBuildDate = DateTime.MinValue; + /// + /// Gets or sets the last date and time the content of this feed was updated. + /// + /// + /// A object that represents the last date and time the content of this feed was updated. + /// The default value is , which indicates that no last build date was specified. + /// + public DateTime LastBuildDate + { + get + { + return channelLastBuildDate; + } + + set + { + channelLastBuildDate = value; + } + } + + private Uri channelLink; + /// + /// Gets or sets the URL of the web site associated with this feed. + /// + /// A that represents the URL of the web site associated with this feed. + /// The is a null reference (Nothing in Visual Basic). + public Uri Link + { + get + { + return channelLink; + } + + set + { + Guard.ArgumentNotNull(value, "value"); + channelLink = value; + } + } + + private string channelManagingEditor = string.Empty; + /// + /// Gets or sets the e-mail address of the person to contact regarding the editorial content of this feed. + /// + /// The e-mail address of the person to contact regarding the editorial content of this feed. + /// + /// + /// There is no requirement to follow a specific format for email addresses. Publishers can format addresses according to the RFC 2822 Address Specification, + /// the RFC 2368 guidelines for mailto links, or some other scheme. The recommended format for e-mail addresses is username@hostname.tld (Real Name). + /// + /// + public string ManagingEditor + { + get + { + return channelManagingEditor; + } + + set + { + if (string.IsNullOrEmpty(value)) + { + channelManagingEditor = string.Empty; + } + else + { + channelManagingEditor = value.Trim(); + } + } + } + + private DateTime channelPublicationDate = DateTime.MinValue; + /// + /// Gets or sets the publication date and time of this feed's content. + /// + /// + /// A object that represents the publication date and time of this feed's content. + /// The default value is , which indicates that no publication date was specified. + /// + /// + /// Publishers of daily, weekly or monthly periodicals can use this element to associate feed items with the date they most recently went to press. + /// + public DateTime PublicationDate + { + get + { + return channelPublicationDate; + } + + set + { + channelPublicationDate = value; + } + } + + private string channelRating = string.Empty; + /// + /// Gets or sets an advisory label for the content in this feed. + /// + /// A string value, formatted according to the specification for the Platform for Internet Content Selection (PICS), that supplies an advisory label for the content in this feed. + /// + /// + /// For further information on the Platform for Internet Content Selection (PICS) advisory label formatting specification, + /// see http://www.w3.org/TR/REC-PICS-labels#General. + /// + /// + public string Rating + { + get + { + return channelRating; + } + + set + { + if (string.IsNullOrEmpty(value)) + { + channelRating = string.Empty; + } + else + { + channelRating = value.Trim(); + } + } + } + + private Uri channelSelfLink; + /// + /// Gets or sets a URL that describes the feed itself. + /// + /// A that represents a URL that points to where this feed can be retrieved from. + /// + /// + /// Identifying a feed's URL within the feed makes it more portable, self-contained, and easier to cache. + /// For these reasons, a feed should provide a value for that is used for this purpose. + /// + /// + /// Identifying a self referential link is achieved by including a atom:link element within the channel. + /// See RSS Profile for more information. + /// + /// + public Uri SelfLink + { + get + { + return channelSelfLink; + } + + set + { + channelSelfLink = value; + } + } + + private Collection channelSkipDays; + /// + /// Gets or sets the days of the week during which this feed is not updated. + /// + /// A collection of enumeration values that indicate the days of the week during which this feed is not updated. + /// + /// enumeration values within this collection must not be duplicated. + /// + public Collection SkipDays + { + get + { + if (channelSkipDays == null) + { + channelSkipDays = new Collection(); + } + return channelSkipDays; + } + } + + private Collection channelSkipHours; + /// + /// Gets or sets the hours of the day during which this feed is not updated. + /// + /// A collection of objects that indicate the hours of the day during which this feed is not updated. + /// + /// Values from 0 to 23 are permitted, with 0 representing midnight. Integer values within this collection must not be duplicated. + /// + public Collection SkipHours + { + get + { + if (channelSkipHours == null) + { + channelSkipHours = new Collection(); + } + return channelSkipHours; + } + } + + private RssTextInput channelTextInput; + /// + /// Gets or sets a form to submit a text query to this feed's publisher over the Common Gateway Interface (CGI). + /// + /// + /// A object that represents a form to submit a text query to this feed's publisher over the Common Gateway Interface (CGI). + /// The default value is a null reference. + /// + public RssTextInput TextInput + { + get + { + return channelTextInput; + } + + set + { + channelTextInput = value; + } + } + + private int channelTimeToLive = int.MinValue; + /// + /// Gets or sets the maximum number of minutes to cache the data before a client should request it again. + /// + /// + /// The maximum number of minutes to cache the data before an aggregator should request it again. + /// The default value is , which indicates no time-to-live was specified. + /// + /// + /// Aggregators that support this property should treat it as a publisher's suggestion of a feed's update frequency, not a hard rule. + /// + public int TimeToLive + { + get + { + return channelTimeToLive; + } + + set + { + channelTimeToLive = value; + } + } + + private string channelTitle = string.Empty; + /// + /// Gets or sets character data that provides the name of this feed. + /// + /// Character data that provides the name of this feed. + /// The is a null reference (Nothing in Visual Basic). + /// The is an empty string. + public string Title + { + get + { + return channelTitle; + } + + set + { + Guard.ArgumentNotNullOrEmptyString(value, "value"); + channelTitle = value.Trim(); + } + } + + private string channelWebmaster = string.Empty; + /// + /// Gets or sets the e-mail address of the person to contact about technical issues regarding this feed. + /// + /// The e-mail address of the person to contact about technical issues regarding this feed. + /// + /// + /// There is no requirement to follow a specific format for email addresses. Publishers can format addresses according to the RFC 2822 Address Specification, + /// the RFC 2368 guidelines for mailto links, or some other scheme. The recommended format for e-mail addresses is username@hostname.tld (Real Name). + /// + /// + public string Webmaster + { + get + { + return channelWebmaster; + } + + set + { + if (string.IsNullOrEmpty(value)) + { + channelWebmaster = string.Empty; + } + else + { + channelWebmaster = value.Trim(); + } + } + } + + + } +} diff --git a/src/cloudscribe.Syndication/Models/Rss/RssEnclosure.cs b/src/cloudscribe.Syndication/Models/Rss/RssEnclosure.cs index ab4b742..8f7b3a4 100644 --- a/src/cloudscribe.Syndication/Models/Rss/RssEnclosure.cs +++ b/src/cloudscribe.Syndication/Models/Rss/RssEnclosure.cs @@ -1,99 +1,99 @@ -using System; - -namespace cloudscribe.Syndication.Models.Rss -{ - /// - /// Represents a media object such as an audio, video, or executable file that can be associated with - /// an . - /// - public class RssEnclosure - { - public RssEnclosure() - { - - } - - public RssEnclosure(long length, string type, Uri url) - { - this.ContentType = type; - this.Length = length; - this.Url = url; - } - - private string enclosureType = string.Empty; - /// - /// Gets or sets the media object's MIME content type. - /// - /// The media object's MIME content type. - /// - /// See http://www.iana.org/assignments/media-types/ for a listing of the registered IANA MIME media types. - /// - /// The is a null reference (Nothing in Visual Basic). - /// The is an empty string. - public string ContentType - { - get - { - return enclosureType; - } - - set - { - Guard.ArgumentNotNullOrEmptyString(value, "value"); - enclosureType = value.Trim(); - } - } - - private long enclosureLength = long.MinValue; - /// - /// Gets or sets the size of the media object. - /// - /// The size, in bytes, of the media object. The default value is , which indicates that no size was specified. - /// - /// - /// Though an enclosure must specify its size with the length attribute, the size of some media objects cannot be determined by an RSS publisher. - /// When an enclosure's size cannot be determined, a publisher should use a length of 0. - /// - /// - /// The peer-to-peer file-sharing protocol BitTorrent deploys files using a small key file called a torrent that tells a client how to find and download the file. - /// When an enclosure is delivered in a multi-step process like the one used by BitTorrent, the length should be the size - /// of the first file that must be downloaded to begin the process. - /// - /// - /// The is less than zero. - public long Length - { - get - { - return enclosureLength; - } - - set - { - Guard.ArgumentNotLessThan(value, "value", 0); - enclosureLength = value; - } - } - - private Uri enclosureUrl; - /// - /// Gets or sets the URL of the media object. - /// - /// A that represents the URL of the media object. - /// The is a null reference (Nothing in Visual Basic). - public Uri Url - { - get - { - return enclosureUrl; - } - - set - { - Guard.ArgumentNotNull(value, "value"); - enclosureUrl = value; - } - } - - } -} +using System; + +namespace cloudscribe.Syndication.Models.Rss +{ + /// + /// Represents a media object such as an audio, video, or executable file that can be associated with + /// an . + /// + public class RssEnclosure + { + public RssEnclosure() + { + + } + + public RssEnclosure(long length, string type, Uri url) + { + this.ContentType = type; + this.Length = length; + this.Url = url; + } + + private string enclosureType = string.Empty; + /// + /// Gets or sets the media object's MIME content type. + /// + /// The media object's MIME content type. + /// + /// See http://www.iana.org/assignments/media-types/ for a listing of the registered IANA MIME media types. + /// + /// The is a null reference (Nothing in Visual Basic). + /// The is an empty string. + public string ContentType + { + get + { + return enclosureType; + } + + set + { + Guard.ArgumentNotNullOrEmptyString(value, "value"); + enclosureType = value.Trim(); + } + } + + private long enclosureLength = long.MinValue; + /// + /// Gets or sets the size of the media object. + /// + /// The size, in bytes, of the media object. The default value is , which indicates that no size was specified. + /// + /// + /// Though an enclosure must specify its size with the length attribute, the size of some media objects cannot be determined by an RSS publisher. + /// When an enclosure's size cannot be determined, a publisher should use a length of 0. + /// + /// + /// The peer-to-peer file-sharing protocol BitTorrent deploys files using a small key file called a torrent that tells a client how to find and download the file. + /// When an enclosure is delivered in a multi-step process like the one used by BitTorrent, the length should be the size + /// of the first file that must be downloaded to begin the process. + /// + /// + /// The is less than zero. + public long Length + { + get + { + return enclosureLength; + } + + set + { + Guard.ArgumentNotLessThan(value, "value", 0); + enclosureLength = value; + } + } + + private Uri enclosureUrl; + /// + /// Gets or sets the URL of the media object. + /// + /// A that represents the URL of the media object. + /// The is a null reference (Nothing in Visual Basic). + public Uri Url + { + get + { + return enclosureUrl; + } + + set + { + Guard.ArgumentNotNull(value, "value"); + enclosureUrl = value; + } + } + + } +} diff --git a/src/cloudscribe.Syndication/Models/Rss/RssFeed.cs b/src/cloudscribe.Syndication/Models/Rss/RssFeed.cs index bebd6bd..0124606 100644 --- a/src/cloudscribe.Syndication/Models/Rss/RssFeed.cs +++ b/src/cloudscribe.Syndication/Models/Rss/RssFeed.cs @@ -1,73 +1,73 @@ -using System; - -namespace cloudscribe.Syndication.Models.Rss -{ - /// - /// Represents a Really Simple Syndication (RSS) syndication feed. - /// - public class RssFeed - { - public RssFeed() - { - - } - - public RssFeed(Uri link, string title) - { - this.Channel.Link = link; - this.Channel.Title = title; - } - - public RssFeed(string description) - { - this.Channel.Description = description; - } - - private RssChannel feedChannel = new RssChannel(); - /// - /// Gets or sets information about the meta-data and contents of the feed. - /// - /// A object that represents information about the meta-data and contents of the feed. - /// The is a null reference (Nothing in Visual Basic). - public RssChannel Channel - { - get - { - return feedChannel; - } - - set - { - Guard.ArgumentNotNull(value, "value"); - feedChannel = value; - } - } - - private static SyndicationContentFormat feedFormat = SyndicationContentFormat.Rss; - /// - /// Gets the that this syndication resource implements. - /// - /// The enumeration value that indicates the type of syndication format that this syndication resource implements. - public SyndicationContentFormat Format - { - get - { - return feedFormat; - } - } - - private static Version feedVersion = new Version(2, 0); - /// - /// Gets the of the that this syndication resource conforms to. - /// - /// The of the that this syndication resource conforms to. The default value is 2.0. - public Version Version - { - get - { - return feedVersion; - } - } - - } -} +using System; + +namespace cloudscribe.Syndication.Models.Rss +{ + /// + /// Represents a Really Simple Syndication (RSS) syndication feed. + /// + public class RssFeed + { + public RssFeed() + { + + } + + public RssFeed(Uri link, string title) + { + this.Channel.Link = link; + this.Channel.Title = title; + } + + public RssFeed(string description) + { + this.Channel.Description = description; + } + + private RssChannel feedChannel = new RssChannel(); + /// + /// Gets or sets information about the meta-data and contents of the feed. + /// + /// A object that represents information about the meta-data and contents of the feed. + /// The is a null reference (Nothing in Visual Basic). + public RssChannel Channel + { + get + { + return feedChannel; + } + + set + { + Guard.ArgumentNotNull(value, "value"); + feedChannel = value; + } + } + + private static SyndicationContentFormat feedFormat = SyndicationContentFormat.Rss; + /// + /// Gets the that this syndication resource implements. + /// + /// The enumeration value that indicates the type of syndication format that this syndication resource implements. + public SyndicationContentFormat Format + { + get + { + return feedFormat; + } + } + + private static Version feedVersion = new Version(2, 0); + /// + /// Gets the of the that this syndication resource conforms to. + /// + /// The of the that this syndication resource conforms to. The default value is 2.0. + public Version Version + { + get + { + return feedVersion; + } + } + + } +} diff --git a/src/cloudscribe.Syndication/Models/Rss/RssGuid.cs b/src/cloudscribe.Syndication/Models/Rss/RssGuid.cs index 033f632..87cb593 100644 --- a/src/cloudscribe.Syndication/Models/Rss/RssGuid.cs +++ b/src/cloudscribe.Syndication/Models/Rss/RssGuid.cs @@ -1,80 +1,80 @@ -using System; - -namespace cloudscribe.Syndication.Models.Rss -{ - /// - /// Represents a means of uniquely identifying a . - /// - public class RssGuid - { - public RssGuid() - { - - } - - public RssGuid(string value) - { - this.Value = value; - } - - public RssGuid(string value, bool isPermanentUrl) : this(value) - { - this.IsPermanentLink = isPermanentUrl; - } - - private bool guidIsPermalink = true; - /// - /// Gets or sets a value indicating if the guid represents a permanent URL of a web page associated with this item. - /// - /// true if the guid value represents a permanent URL of a web page; otherwise false. - /// - /// If set to false, the guid may employ any syntax the feed's publisher has devised for ensuring the uniqueness of the string, - /// such as the Tag URI scheme described in RFC 4151. - /// - public bool IsPermanentLink - { - get - { - return guidIsPermalink; - } - - set - { - guidIsPermalink = value; - } - } - - private string guidIdentifier = String.Empty; - /// - /// Gets or sets a string value that uniquely identifies this item. - /// - /// A string value that uniquely identifies this item. - /// - /// - /// If the guid's property has a value of true, the property must be - /// the permanent URL of the web page associated with this item. Otherwise the property may employ any syntax the feed's publisher - /// has devised for ensuring the uniqueness of the string. - /// - /// - /// When choosing to employ a syntax for ensuring the uniqueness of the string, the Tag URI scheme - /// described in RFC 4151 is recommended. - /// - /// - /// The is a null reference (Nothing in Visual Basic). - /// The is an empty string. - public string Value - { - get - { - return guidIdentifier; - } - - set - { - Guard.ArgumentNotNullOrEmptyString(value, "value"); - guidIdentifier = value.Trim(); - } - } - - } -} +using System; + +namespace cloudscribe.Syndication.Models.Rss +{ + /// + /// Represents a means of uniquely identifying a . + /// + public class RssGuid + { + public RssGuid() + { + + } + + public RssGuid(string value) + { + this.Value = value; + } + + public RssGuid(string value, bool isPermanentUrl) : this(value) + { + this.IsPermanentLink = isPermanentUrl; + } + + private bool guidIsPermalink = true; + /// + /// Gets or sets a value indicating if the guid represents a permanent URL of a web page associated with this item. + /// + /// true if the guid value represents a permanent URL of a web page; otherwise false. + /// + /// If set to false, the guid may employ any syntax the feed's publisher has devised for ensuring the uniqueness of the string, + /// such as the Tag URI scheme described in RFC 4151. + /// + public bool IsPermanentLink + { + get + { + return guidIsPermalink; + } + + set + { + guidIsPermalink = value; + } + } + + private string guidIdentifier = String.Empty; + /// + /// Gets or sets a string value that uniquely identifies this item. + /// + /// A string value that uniquely identifies this item. + /// + /// + /// If the guid's property has a value of true, the property must be + /// the permanent URL of the web page associated with this item. Otherwise the property may employ any syntax the feed's publisher + /// has devised for ensuring the uniqueness of the string. + /// + /// + /// When choosing to employ a syntax for ensuring the uniqueness of the string, the Tag URI scheme + /// described in RFC 4151 is recommended. + /// + /// + /// The is a null reference (Nothing in Visual Basic). + /// The is an empty string. + public string Value + { + get + { + return guidIdentifier; + } + + set + { + Guard.ArgumentNotNullOrEmptyString(value, "value"); + guidIdentifier = value.Trim(); + } + } + + } +} diff --git a/src/cloudscribe.Syndication/Models/Rss/RssImage.cs b/src/cloudscribe.Syndication/Models/Rss/RssImage.cs index 848dd72..6cd5645 100644 --- a/src/cloudscribe.Syndication/Models/Rss/RssImage.cs +++ b/src/cloudscribe.Syndication/Models/Rss/RssImage.cs @@ -1,173 +1,173 @@ -using System; - -namespace cloudscribe.Syndication.Models.Rss -{ - /// - /// Represents a graphical logo for an . - /// - public class RssImage - { - public RssImage() - { - - } - - public RssImage(Uri link, string title, Uri url) - { - this.Link = link; - this.Title = title; - this.Url = url; - } - - private string imageDescription = string.Empty; - /// - /// Gets or sets character data that provides a human-readable characterization of the site linked to this image. - /// - /// Character data that provides a human-readable characterization of the site linked to this image. - /// - /// The value of this property should be suitable for use as the title attribute of the a tag in an HTML rendering. - /// - public string Description - { - get - { - return imageDescription; - } - - set - { - if (string.IsNullOrEmpty(value)) - { - imageDescription = String.Empty; - } - else - { - imageDescription = value.Trim(); - } - } - } - - private const int MAX_HEIGHT = 400; - private const int MAX_WIDTH = 144; - - private int imageHeight = int.MinValue; - /// - /// Gets or sets the height of this image. - /// - /// The height, in pixels, of this image. The default value is , which indicates no height was specified. - /// - /// If no height is specified for the image, the image is assumed to be 31 pixels tall. - /// - /// The is greater than 400. - public int Height - { - get - { - return imageHeight; - } - - set - { - Guard.ArgumentNotGreaterThan(value, "value", MAX_HEIGHT); - imageHeight = value; - } - } - - private Uri imageLink; - /// - /// Gets or sets the URL of the web site represented by this image. - /// - /// A that represents the URL of the web site represented by this image. - /// - /// The value of this property should be the same URL as the channel's link property. - /// - /// The is a null reference (Nothing in Visual Basic). - public Uri Link - { - get - { - return imageLink; - } - - set - { - Guard.ArgumentNotNull(value, "value"); - imageLink = value; - } - } - - private string imageTitle = string.Empty; - /// - /// Gets or sets character data that provides a human-readable description of this image. - /// - /// Character data that provides a human-readable description of this image. - /// - /// The value of this property should be the same as the channel's title property - /// and be suitable for use as the alt attribute of the img tag in an HTML rendering. - /// - /// The is a null reference (Nothing in Visual Basic). - /// The is an empty string. - public string Title - { - get - { - return imageTitle; - } - - set - { - Guard.ArgumentNotNullOrEmptyString(value, "value"); - imageTitle = value.Trim(); - } - } - - private Uri imageUrl; - /// - /// Gets or sets the URL of this image. - /// - /// A that represents the URL of this image. - /// - /// The image must be in the GIF, JPEG or PNG formats. - /// - /// The is a null reference (Nothing in Visual Basic). - public Uri Url - { - get - { - return imageUrl; - } - - set - { - Guard.ArgumentNotNull(value, "value"); - imageUrl = value; - } - } - - private int imageWidth = int.MinValue; - - /// - /// Gets or sets the width of this image. - /// - /// The width, in pixels, of this image. The default value is , which indicates no width was specified. - /// - /// If no width is specified for the image, the image is assumed to be 88 pixels wide. - /// - /// The is greater than 144. - public int Width - { - get - { - return imageWidth; - } - - set - { - Guard.ArgumentNotGreaterThan(value, "value", MAX_WIDTH); - imageWidth = value; - } - } - - - } -} +using System; + +namespace cloudscribe.Syndication.Models.Rss +{ + /// + /// Represents a graphical logo for an . + /// + public class RssImage + { + public RssImage() + { + + } + + public RssImage(Uri link, string title, Uri url) + { + this.Link = link; + this.Title = title; + this.Url = url; + } + + private string imageDescription = string.Empty; + /// + /// Gets or sets character data that provides a human-readable characterization of the site linked to this image. + /// + /// Character data that provides a human-readable characterization of the site linked to this image. + /// + /// The value of this property should be suitable for use as the title attribute of the a tag in an HTML rendering. + /// + public string Description + { + get + { + return imageDescription; + } + + set + { + if (string.IsNullOrEmpty(value)) + { + imageDescription = String.Empty; + } + else + { + imageDescription = value.Trim(); + } + } + } + + private const int MAX_HEIGHT = 400; + private const int MAX_WIDTH = 144; + + private int imageHeight = int.MinValue; + /// + /// Gets or sets the height of this image. + /// + /// The height, in pixels, of this image. The default value is , which indicates no height was specified. + /// + /// If no height is specified for the image, the image is assumed to be 31 pixels tall. + /// + /// The is greater than 400. + public int Height + { + get + { + return imageHeight; + } + + set + { + Guard.ArgumentNotGreaterThan(value, "value", MAX_HEIGHT); + imageHeight = value; + } + } + + private Uri imageLink; + /// + /// Gets or sets the URL of the web site represented by this image. + /// + /// A that represents the URL of the web site represented by this image. + /// + /// The value of this property should be the same URL as the channel's link property. + /// + /// The is a null reference (Nothing in Visual Basic). + public Uri Link + { + get + { + return imageLink; + } + + set + { + Guard.ArgumentNotNull(value, "value"); + imageLink = value; + } + } + + private string imageTitle = string.Empty; + /// + /// Gets or sets character data that provides a human-readable description of this image. + /// + /// Character data that provides a human-readable description of this image. + /// + /// The value of this property should be the same as the channel's title property + /// and be suitable for use as the alt attribute of the img tag in an HTML rendering. + /// + /// The is a null reference (Nothing in Visual Basic). + /// The is an empty string. + public string Title + { + get + { + return imageTitle; + } + + set + { + Guard.ArgumentNotNullOrEmptyString(value, "value"); + imageTitle = value.Trim(); + } + } + + private Uri imageUrl; + /// + /// Gets or sets the URL of this image. + /// + /// A that represents the URL of this image. + /// + /// The image must be in the GIF, JPEG or PNG formats. + /// + /// The is a null reference (Nothing in Visual Basic). + public Uri Url + { + get + { + return imageUrl; + } + + set + { + Guard.ArgumentNotNull(value, "value"); + imageUrl = value; + } + } + + private int imageWidth = int.MinValue; + + /// + /// Gets or sets the width of this image. + /// + /// The width, in pixels, of this image. The default value is , which indicates no width was specified. + /// + /// If no width is specified for the image, the image is assumed to be 88 pixels wide. + /// + /// The is greater than 144. + public int Width + { + get + { + return imageWidth; + } + + set + { + Guard.ArgumentNotGreaterThan(value, "value", MAX_WIDTH); + imageWidth = value; + } + } + + + } +} diff --git a/src/cloudscribe.Syndication/Models/Rss/RssItem.cs b/src/cloudscribe.Syndication/Models/Rss/RssItem.cs index 5a4c3b7..54b376b 100644 --- a/src/cloudscribe.Syndication/Models/Rss/RssItem.cs +++ b/src/cloudscribe.Syndication/Models/Rss/RssItem.cs @@ -1,262 +1,262 @@ -using System; -using System.Collections.ObjectModel; - -namespace cloudscribe.Syndication.Models.Rss -{ - /// - /// Represents distinct content published in an such as a news article, - /// weblog entry or some other form of discrete update. - /// - public class RssItem - { - public RssItem() - { - - } - - private string itemAuthor = string.Empty; - /// - /// Gets or sets the e-mail address of the person who wrote this item. - /// - /// The e-mail address of the person who wrote this item. - /// - /// - /// There is no requirement to follow a specific format for email addresses. Publishers can format addresses according to the RFC 2822 Address Specification, - /// the RFC 2368 guidelines for mailto links, or some other scheme. The recommended format for e-mail addresses is username@hostname.tld (Real Name). - /// - /// - /// A feed published by an individual should omit the item author - /// and use the or channel properties to provide contact information. - /// - /// - public string Author - { - get - { - return itemAuthor; - } - - set - { - if (string.IsNullOrEmpty(value)) - { - itemAuthor = string.Empty; - } - else - { - itemAuthor = value.Trim(); - } - } - } - - private Collection itemCategories; - /// - /// Gets the categories or tags to which this item belongs. - /// - /// - /// A of objects that represent the categories to which this item belongs. The default value is an empty collection. - /// - public Collection Categories - { - get - { - if (itemCategories == null) - { - itemCategories = new Collection(); - } - return itemCategories; - } - } - - private Uri itemComments; - /// - /// Gets or sets the URL of a web page that contains comments received in response to this item. - /// - /// A that represents the URL of a web page that contains comments received in response to this item. - public Uri Comments - { - get - { - return itemComments; - } - - set - { - itemComments = value; - } - } - - private string itemDescription = string.Empty; - /// - /// Gets or sets character data that contains this item's full content or a summary of its contents. - /// - /// Character data that contains this item's full content or a summary of its contents. - /// - /// The description may be empty if the item specifies a . - /// - /// The description must be suitable for presentation as HTML. - /// HTML markup must be encoded as character data either by employing the HTML entities (< and >) or a CDATA section. - /// - /// - /// The description should not contain relative URLs, because the RSS format does not provide a means to identify the base URL of a document. - /// When a relative URL is present, an aggregator may attempt to resolve it to a full URL using the channel's link as the base. - /// - /// - public string Description - { - get - { - return itemDescription; - } - - set - { - if (string.IsNullOrEmpty(value)) - { - itemDescription = string.Empty; - } - else - { - itemDescription = value.Trim(); - } - } - } - - private Collection itemEnclosures; - /// - /// Gets the media objects associated with this item. - /// - /// - /// A of objects that represent the media objects such as an audio, video, or executable file that are associated with this item. - /// The default value is an empty collection. - /// - /// - /// - /// Support for the enclosure element in RSS software varies significantly because of disagreement over whether the specification permits more than one enclosure per item. - /// Although the original author intended to permit no more than one enclosure in each item, this limit is not explicit in the specification. - /// For best support in the widest number of aggregators, an item should not contain more than one enclosure. - /// - /// - public Collection Enclosures - { - get - { - if (itemEnclosures == null) - { - itemEnclosures = new Collection(); - } - return itemEnclosures; - } - } - - private RssGuid itemGuid; - /// - /// Gets or sets the unique identifier for this item. - /// - /// - /// A object that represents the unique identifier for this item. The default value is a null reference. - /// - /// - /// A publisher should provide a guid for each item. - /// - public RssGuid Guid - { - get - { - return itemGuid; - } - - set - { - itemGuid = value; - } - } - - private Uri itemLink; - /// - /// Gets or sets the URL of a web page associated with this item. - /// - /// A that represents the URL of a web page associated with this item. - public Uri Link - { - get - { - return itemLink; - } - - set - { - itemLink = value; - } - } - - private DateTime itemPublicationDate = DateTime.MinValue; - /// - /// Gets or sets the publication date and time of this item. - /// - /// - /// A object that represents the publication date and time of this item. - /// The default value is , which indicates that no publication date was specified. - /// - /// - /// The specification recommends that aggregators should ignore items with a publication date that occurs in the future, - /// providing a means for publishers to embargo an item until that date. However, it is recommended that publishers should not - /// include items in a feed until they are ready for publication. - /// - public DateTime PublicationDate - { - get - { - return itemPublicationDate; - } - - set - { - itemPublicationDate = value; - } - } - - private RssSource itemSource; - /// - /// Gets or sets the source feed that this item was republished from. - /// - /// - /// A object that represents the source feed that this item was republished from. The default value is a null reference. - /// - public RssSource Source - { - get - { - return itemSource; - } - - set - { - itemSource = value; - } - } - - private string itemTitle = string.Empty; - /// - /// Gets or sets character data that provides this item's headline. - /// - /// Character data that provides this item's headline. - /// - /// This property is optional if the item contains a . - /// - public string Title - { - get - { - return itemTitle; - } - - set - { - itemTitle = value.Trim(); - } - } - - - } -} +using System; +using System.Collections.ObjectModel; + +namespace cloudscribe.Syndication.Models.Rss +{ + /// + /// Represents distinct content published in an such as a news article, + /// weblog entry or some other form of discrete update. + /// + public class RssItem + { + public RssItem() + { + + } + + private string itemAuthor = string.Empty; + /// + /// Gets or sets the e-mail address of the person who wrote this item. + /// + /// The e-mail address of the person who wrote this item. + /// + /// + /// There is no requirement to follow a specific format for email addresses. Publishers can format addresses according to the RFC 2822 Address Specification, + /// the RFC 2368 guidelines for mailto links, or some other scheme. The recommended format for e-mail addresses is username@hostname.tld (Real Name). + /// + /// + /// A feed published by an individual should omit the item author + /// and use the or channel properties to provide contact information. + /// + /// + public string Author + { + get + { + return itemAuthor; + } + + set + { + if (string.IsNullOrEmpty(value)) + { + itemAuthor = string.Empty; + } + else + { + itemAuthor = value.Trim(); + } + } + } + + private Collection itemCategories; + /// + /// Gets the categories or tags to which this item belongs. + /// + /// + /// A of objects that represent the categories to which this item belongs. The default value is an empty collection. + /// + public Collection Categories + { + get + { + if (itemCategories == null) + { + itemCategories = new Collection(); + } + return itemCategories; + } + } + + private Uri itemComments; + /// + /// Gets or sets the URL of a web page that contains comments received in response to this item. + /// + /// A that represents the URL of a web page that contains comments received in response to this item. + public Uri Comments + { + get + { + return itemComments; + } + + set + { + itemComments = value; + } + } + + private string itemDescription = string.Empty; + /// + /// Gets or sets character data that contains this item's full content or a summary of its contents. + /// + /// Character data that contains this item's full content or a summary of its contents. + /// + /// The description may be empty if the item specifies a . + /// + /// The description must be suitable for presentation as HTML. + /// HTML markup must be encoded as character data either by employing the HTML entities (< and >) or a CDATA section. + /// + /// + /// The description should not contain relative URLs, because the RSS format does not provide a means to identify the base URL of a document. + /// When a relative URL is present, an aggregator may attempt to resolve it to a full URL using the channel's link as the base. + /// + /// + public string Description + { + get + { + return itemDescription; + } + + set + { + if (string.IsNullOrEmpty(value)) + { + itemDescription = string.Empty; + } + else + { + itemDescription = value.Trim(); + } + } + } + + private Collection itemEnclosures; + /// + /// Gets the media objects associated with this item. + /// + /// + /// A of objects that represent the media objects such as an audio, video, or executable file that are associated with this item. + /// The default value is an empty collection. + /// + /// + /// + /// Support for the enclosure element in RSS software varies significantly because of disagreement over whether the specification permits more than one enclosure per item. + /// Although the original author intended to permit no more than one enclosure in each item, this limit is not explicit in the specification. + /// For best support in the widest number of aggregators, an item should not contain more than one enclosure. + /// + /// + public Collection Enclosures + { + get + { + if (itemEnclosures == null) + { + itemEnclosures = new Collection(); + } + return itemEnclosures; + } + } + + private RssGuid itemGuid; + /// + /// Gets or sets the unique identifier for this item. + /// + /// + /// A object that represents the unique identifier for this item. The default value is a null reference. + /// + /// + /// A publisher should provide a guid for each item. + /// + public RssGuid Guid + { + get + { + return itemGuid; + } + + set + { + itemGuid = value; + } + } + + private Uri itemLink; + /// + /// Gets or sets the URL of a web page associated with this item. + /// + /// A that represents the URL of a web page associated with this item. + public Uri Link + { + get + { + return itemLink; + } + + set + { + itemLink = value; + } + } + + private DateTime itemPublicationDate = DateTime.MinValue; + /// + /// Gets or sets the publication date and time of this item. + /// + /// + /// A object that represents the publication date and time of this item. + /// The default value is , which indicates that no publication date was specified. + /// + /// + /// The specification recommends that aggregators should ignore items with a publication date that occurs in the future, + /// providing a means for publishers to embargo an item until that date. However, it is recommended that publishers should not + /// include items in a feed until they are ready for publication. + /// + public DateTime PublicationDate + { + get + { + return itemPublicationDate; + } + + set + { + itemPublicationDate = value; + } + } + + private RssSource itemSource; + /// + /// Gets or sets the source feed that this item was republished from. + /// + /// + /// A object that represents the source feed that this item was republished from. The default value is a null reference. + /// + public RssSource Source + { + get + { + return itemSource; + } + + set + { + itemSource = value; + } + } + + private string itemTitle = string.Empty; + /// + /// Gets or sets character data that provides this item's headline. + /// + /// Character data that provides this item's headline. + /// + /// This property is optional if the item contains a . + /// + public string Title + { + get + { + return itemTitle; + } + + set + { + itemTitle = value.Trim(); + } + } + + + } +} diff --git a/src/cloudscribe.Syndication/Models/Rss/RssSource.cs b/src/cloudscribe.Syndication/Models/Rss/RssSource.cs index 0951b0b..d443ab1 100644 --- a/src/cloudscribe.Syndication/Models/Rss/RssSource.cs +++ b/src/cloudscribe.Syndication/Models/Rss/RssSource.cs @@ -1,65 +1,65 @@ -using System; - -namespace cloudscribe.Syndication.Models.Rss -{ - /// - /// Represents the source feed that an was republished from. - /// - public class RssSource - { - - public RssSource() - { - - } - - public RssSource(Uri url) - { - this.Url = url; - } - - public RssSource(Uri url, string title) : this(url) - { - this.Title = title; - } - - private string sourceTitle = string.Empty; - /// - /// Gets or sets the title of the source feed. - /// - /// The title of the source feed. - public string Title - { - get - { - return sourceTitle; - } - - set - { - sourceTitle = value.Trim(); - } - } - - private Uri sourceUrl; - /// - /// Gets or sets the URL of the source feed. - /// - /// A that represents the URL of the source feed. - /// The is a null reference (Nothing in Visual Basic). - public Uri Url - { - get - { - return sourceUrl; - } - - set - { - Guard.ArgumentNotNull(value, "value"); - sourceUrl = value; - } - } - - } -} +using System; + +namespace cloudscribe.Syndication.Models.Rss +{ + /// + /// Represents the source feed that an was republished from. + /// + public class RssSource + { + + public RssSource() + { + + } + + public RssSource(Uri url) + { + this.Url = url; + } + + public RssSource(Uri url, string title) : this(url) + { + this.Title = title; + } + + private string sourceTitle = string.Empty; + /// + /// Gets or sets the title of the source feed. + /// + /// The title of the source feed. + public string Title + { + get + { + return sourceTitle; + } + + set + { + sourceTitle = value.Trim(); + } + } + + private Uri sourceUrl; + /// + /// Gets or sets the URL of the source feed. + /// + /// A that represents the URL of the source feed. + /// The is a null reference (Nothing in Visual Basic). + public Uri Url + { + get + { + return sourceUrl; + } + + set + { + Guard.ArgumentNotNull(value, "value"); + sourceUrl = value; + } + } + + } +} diff --git a/src/cloudscribe.Syndication/Models/Rss/RssTextInput.cs b/src/cloudscribe.Syndication/Models/Rss/RssTextInput.cs index 14b31a2..b594137 100644 --- a/src/cloudscribe.Syndication/Models/Rss/RssTextInput.cs +++ b/src/cloudscribe.Syndication/Models/Rss/RssTextInput.cs @@ -1,104 +1,104 @@ -using System; - -namespace cloudscribe.Syndication.Models.Rss -{ - /// - /// Represents a form to submit a text query to a feed's publisher over the Common Gateway Interface (CGI). - /// - public class RssTextInput - { - public RssTextInput() - { - - } - - private string textInputDescription = string.Empty; - /// - /// Gets or sets character data that provides a human-readable label explaining this form's purpose. - /// - /// Character data that provides a human-readable label explaining this form's purpose. - /// The is a null reference (Nothing in Visual Basic). - /// The is an empty string. - public string Description - { - get - { - return textInputDescription; - } - - set - { - Guard.ArgumentNotNullOrEmptyString(value, "value"); - textInputDescription = value.Trim(); - } - } - - private Uri textInputLink; - /// - /// Gets or sets the URL of the CGI script that handles the query. - /// - /// A that represents the URL of the CGI script that handles the query. - /// The is a null reference (Nothing in Visual Basic). - public Uri Link - { - get - { - return textInputLink; - } - - set - { - Guard.ArgumentNotNull(value, "value"); - textInputLink = value; - } - } - - private string textInputName = string.Empty; - /// - /// Gets or sets the name of the form component that contains the query. - /// - /// The name of the form component that contains the query. - /// - /// The value of this property must begin with a letter and contain only these characters: - /// the letters A to Z in either case, numeric digits, colons (":"), hyphens ("-"), periods (".") and underscores ("_"). - /// - /// The is a null reference (Nothing in Visual Basic). - /// The is an empty string. - public string Name - { - get - { - return textInputName; - } - - set - { - Guard.ArgumentNotNullOrEmptyString(value, "value"); - textInputName = value.Trim(); - } - } - - private string textInputTitle = string.Empty; - /// - /// Gets or sets a value that labels the button used to submit the query. - /// - /// A string value that labels the button used to submit the query. - /// The is a null reference (Nothing in Visual Basic). - /// The is an empty string. - public string Title - { - get - { - return textInputTitle; - } - - set - { - Guard.ArgumentNotNullOrEmptyString(value, "value"); - textInputTitle = value.Trim(); - } - } - - - } -} +using System; + +namespace cloudscribe.Syndication.Models.Rss +{ + /// + /// Represents a form to submit a text query to a feed's publisher over the Common Gateway Interface (CGI). + /// + public class RssTextInput + { + public RssTextInput() + { + + } + + private string textInputDescription = string.Empty; + /// + /// Gets or sets character data that provides a human-readable label explaining this form's purpose. + /// + /// Character data that provides a human-readable label explaining this form's purpose. + /// The is a null reference (Nothing in Visual Basic). + /// The is an empty string. + public string Description + { + get + { + return textInputDescription; + } + + set + { + Guard.ArgumentNotNullOrEmptyString(value, "value"); + textInputDescription = value.Trim(); + } + } + + private Uri textInputLink; + /// + /// Gets or sets the URL of the CGI script that handles the query. + /// + /// A that represents the URL of the CGI script that handles the query. + /// The is a null reference (Nothing in Visual Basic). + public Uri Link + { + get + { + return textInputLink; + } + + set + { + Guard.ArgumentNotNull(value, "value"); + textInputLink = value; + } + } + + private string textInputName = string.Empty; + /// + /// Gets or sets the name of the form component that contains the query. + /// + /// The name of the form component that contains the query. + /// + /// The value of this property must begin with a letter and contain only these characters: + /// the letters A to Z in either case, numeric digits, colons (":"), hyphens ("-"), periods (".") and underscores ("_"). + /// + /// The is a null reference (Nothing in Visual Basic). + /// The is an empty string. + public string Name + { + get + { + return textInputName; + } + + set + { + Guard.ArgumentNotNullOrEmptyString(value, "value"); + textInputName = value.Trim(); + } + } + + private string textInputTitle = string.Empty; + /// + /// Gets or sets a value that labels the button used to submit the query. + /// + /// A string value that labels the button used to submit the query. + /// The is a null reference (Nothing in Visual Basic). + /// The is an empty string. + public string Title + { + get + { + return textInputTitle; + } + + set + { + Guard.ArgumentNotNullOrEmptyString(value, "value"); + textInputTitle = value.Trim(); + } + } + + + } +} diff --git a/src/cloudscribe.Syndication/README.md b/src/cloudscribe.Syndication/README.md index 45d0501..56b9396 100644 --- a/src/cloudscribe.Syndication/README.md +++ b/src/cloudscribe.Syndication/README.md @@ -1,17 +1,17 @@ -# cloudscribe.Syndication - -A .NET library for RSS and Atom feed generation and consumption. - -## Usage - -1. Install the NuGet package: - ```shell - dotnet add package cloudscribe.Syndication - ``` -2. Reference the library in your project and use the provided APIs to work with RSS/Atom feeds. - -For more details, see the [GitHub repo](https://github.com/cloudscribe/cloudscribe.Syndication). - -## License - -Licensed under the Apache-2.0 License. +# cloudscribe.Syndication + +A .NET library for RSS and Atom feed generation and consumption. + +## Usage + +1. Install the NuGet package: + ```shell + dotnet add package cloudscribe.Syndication + ``` +2. Reference the library in your project and use the provided APIs to work with RSS/Atom feeds. + +For more details, see the [GitHub repo](https://github.com/cloudscribe/cloudscribe.Syndication). + +## License + +Licensed under the Apache-2.0 License. diff --git a/src/cloudscribe.Syndication/SyndicationContentFormat.cs b/src/cloudscribe.Syndication/SyndicationContentFormat.cs index 9c22af0..f8d2fe8 100644 --- a/src/cloudscribe.Syndication/SyndicationContentFormat.cs +++ b/src/cloudscribe.Syndication/SyndicationContentFormat.cs @@ -1,111 +1,111 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace cloudscribe.Syndication.Models -{ - /// - /// Specifies the web content syndication format that the syndicated content conforms to. - /// - /// - /// - //[Serializable()] - public enum SyndicationContentFormat - { - /// - /// No web content syndication format specified. - /// - None = 0, - - /// - /// Indicates that the syndication resource conforms to the Attention Profiling Markup Language (APML) 1.0 syndication format. - /// - //[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Apml")] - //[EnumerationMetadata(DisplayName = "APML 1.0", AlternateValue = "APML")] - //[MimeMediaType(Name = "text", SubName = "x-apml", Documentation = "http://www.apml.org")] - Apml = 1, - - /// - /// Indicates that the syndication resource conforms to the Atom 1.0 syndication format. - /// - //[EnumerationMetadata(DisplayName = "Atom 1.0", AlternateValue = "feed")] - //[MimeMediaType(Name = "application", SubName = "atom+xml", Documentation = "http://www.atomenabled.org/developers/syndication/atom-format-spec.php")] - Atom = 2, - - /// - /// Indicates that the syndication resource conforms to the Web Log Markup Language (BlogML) 2.0 syndication format. - /// - //[EnumerationMetadata(DisplayName = "BlogML 2.0", AlternateValue = "blog")] - //[MimeMediaType(Name = "application", SubName = "blog+xml", Documentation = "http://blogml.org")] - BlogML = 3, - - /// - /// Indicates that the syndication resource conforms to the Microsummary Generator 0.1 syndication format. - /// - //[EnumerationMetadata(DisplayName = "Microsummary Generator 0.1", AlternateValue = "generator")] - //[MimeMediaType(Name = "application", SubName = "x.microsummary+xml", Documentation = "http://developer.mozilla.org/en/docs/Microsummary_XML_grammar_reference")] - MicroSummaryGenerator = 4, - - /// - /// Indicates that the syndication resource conforms to the News Markup Language (NewsML) G2 1.0 syndication format. - /// - //[EnumerationMetadata(DisplayName = "NewsML-G2 1.0", AlternateValue = "NewsML")] - //[MimeMediaType(Name = "text", SubName = "vnd.IPTC.NewsML", Documentation = "http://www.newsml.org")] - NewsML = 5, - - /// - /// Indicates that the syndication resource conforms to the OpenSearch Description 1.1 syndication format. - /// - //[EnumerationMetadata(DisplayName = "OpenSearch Description 1.1", AlternateValue = "OpenSearchDescription")] - //[MimeMediaType(Name = "application", SubName = "opensearchdescription+xml", Documentation = "http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document")] - OpenSearchDescription = 6, - - /// - /// Indicates that the syndication resource conforms to the Outline Processor Markup Language (OPML) 2.0 syndication format. - /// - //[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Opml")] - //[EnumerationMetadata(DisplayName = "OPML 2.0", AlternateValue = "opml")] - //[MimeMediaType(Name = "text", SubName = "x-opml", Documentation = "http://www.opml.org/spec2")] - Opml = 7, - - /// - /// Indicates that the syndication resource conforms to the Really Simple Discovery (RSD) 1.0 syndication format. - /// - //[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Rsd")] - //[EnumerationMetadata(DisplayName = "RSD 1.0", AlternateValue = "rsd")] - //[MimeMediaType(Name = "application", SubName = "rsd+xml", Documentation = "http://cyber.law.harvard.edu/blogs/gems/tech/rsd.html")] - Rsd = 8, - - /// - /// Indicates that the syndication resource conforms to the Really Simple Syndication (RSS) 2.0 syndication format. - /// - //[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Rss")] - //[EnumerationMetadata(DisplayName = "RSS 2.0", AlternateValue = "rss")] - //[MimeMediaType(Name = "application", SubName = "rss+xml", Documentation = "http://www.rssboard.org/rss-specification")] - Rss = 9, - - /// - /// Indicates that the syndication resource conforms to the Resource Description Framework (RDF) 1.0 syndication format. - /// - //[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Rdf")] - //[EnumerationMetadata(DisplayName = "RDF 1.0", AlternateValue = "RDF")] - //[MimeMediaType(Name = "application", SubName = "rdf+xml", Documentation = "http://w3.org/TR/2003/WD-rdf-concepts-20030123/#ref-rdf-mime-type")] - Rdf = 10, - - /// - /// Indicates that the syndication resource conforms to the Atom Publishing Protocol 1.0 Category Document syndication format. - /// - //[EnumerationMetadata(DisplayName = "Atom Publishing Category 1.0", AlternateValue = "categories")] - //[MimeMediaType(Name = "application", SubName = "atomcat+xml", Documentation = "http://bitworking.org/projects/atom/rfc5023.html#iana-atomcat")] - AtomCategoryDocument = 11, - - /// - /// Indicates that the syndication resource conforms to the Atom Publishing Protocol 1.0 Service Document syndication format. - /// - //[EnumerationMetadata(DisplayName = "Atom Publishing Service 1.0", AlternateValue = "service")] - //[MimeMediaType(Name = "application", SubName = "atomsvc+xml", Documentation = "http://bitworking.org/projects/atom/rfc5023.html#iana-atomsvc")] - AtomServiceDocument = 12 - } - -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace cloudscribe.Syndication.Models +{ + /// + /// Specifies the web content syndication format that the syndicated content conforms to. + /// + /// + /// + //[Serializable()] + public enum SyndicationContentFormat + { + /// + /// No web content syndication format specified. + /// + None = 0, + + /// + /// Indicates that the syndication resource conforms to the Attention Profiling Markup Language (APML) 1.0 syndication format. + /// + //[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Apml")] + //[EnumerationMetadata(DisplayName = "APML 1.0", AlternateValue = "APML")] + //[MimeMediaType(Name = "text", SubName = "x-apml", Documentation = "http://www.apml.org")] + Apml = 1, + + /// + /// Indicates that the syndication resource conforms to the Atom 1.0 syndication format. + /// + //[EnumerationMetadata(DisplayName = "Atom 1.0", AlternateValue = "feed")] + //[MimeMediaType(Name = "application", SubName = "atom+xml", Documentation = "http://www.atomenabled.org/developers/syndication/atom-format-spec.php")] + Atom = 2, + + /// + /// Indicates that the syndication resource conforms to the Web Log Markup Language (BlogML) 2.0 syndication format. + /// + //[EnumerationMetadata(DisplayName = "BlogML 2.0", AlternateValue = "blog")] + //[MimeMediaType(Name = "application", SubName = "blog+xml", Documentation = "http://blogml.org")] + BlogML = 3, + + /// + /// Indicates that the syndication resource conforms to the Microsummary Generator 0.1 syndication format. + /// + //[EnumerationMetadata(DisplayName = "Microsummary Generator 0.1", AlternateValue = "generator")] + //[MimeMediaType(Name = "application", SubName = "x.microsummary+xml", Documentation = "http://developer.mozilla.org/en/docs/Microsummary_XML_grammar_reference")] + MicroSummaryGenerator = 4, + + /// + /// Indicates that the syndication resource conforms to the News Markup Language (NewsML) G2 1.0 syndication format. + /// + //[EnumerationMetadata(DisplayName = "NewsML-G2 1.0", AlternateValue = "NewsML")] + //[MimeMediaType(Name = "text", SubName = "vnd.IPTC.NewsML", Documentation = "http://www.newsml.org")] + NewsML = 5, + + /// + /// Indicates that the syndication resource conforms to the OpenSearch Description 1.1 syndication format. + /// + //[EnumerationMetadata(DisplayName = "OpenSearch Description 1.1", AlternateValue = "OpenSearchDescription")] + //[MimeMediaType(Name = "application", SubName = "opensearchdescription+xml", Documentation = "http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document")] + OpenSearchDescription = 6, + + /// + /// Indicates that the syndication resource conforms to the Outline Processor Markup Language (OPML) 2.0 syndication format. + /// + //[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Opml")] + //[EnumerationMetadata(DisplayName = "OPML 2.0", AlternateValue = "opml")] + //[MimeMediaType(Name = "text", SubName = "x-opml", Documentation = "http://www.opml.org/spec2")] + Opml = 7, + + /// + /// Indicates that the syndication resource conforms to the Really Simple Discovery (RSD) 1.0 syndication format. + /// + //[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Rsd")] + //[EnumerationMetadata(DisplayName = "RSD 1.0", AlternateValue = "rsd")] + //[MimeMediaType(Name = "application", SubName = "rsd+xml", Documentation = "http://cyber.law.harvard.edu/blogs/gems/tech/rsd.html")] + Rsd = 8, + + /// + /// Indicates that the syndication resource conforms to the Really Simple Syndication (RSS) 2.0 syndication format. + /// + //[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Rss")] + //[EnumerationMetadata(DisplayName = "RSS 2.0", AlternateValue = "rss")] + //[MimeMediaType(Name = "application", SubName = "rss+xml", Documentation = "http://www.rssboard.org/rss-specification")] + Rss = 9, + + /// + /// Indicates that the syndication resource conforms to the Resource Description Framework (RDF) 1.0 syndication format. + /// + //[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Rdf")] + //[EnumerationMetadata(DisplayName = "RDF 1.0", AlternateValue = "RDF")] + //[MimeMediaType(Name = "application", SubName = "rdf+xml", Documentation = "http://w3.org/TR/2003/WD-rdf-concepts-20030123/#ref-rdf-mime-type")] + Rdf = 10, + + /// + /// Indicates that the syndication resource conforms to the Atom Publishing Protocol 1.0 Category Document syndication format. + /// + //[EnumerationMetadata(DisplayName = "Atom Publishing Category 1.0", AlternateValue = "categories")] + //[MimeMediaType(Name = "application", SubName = "atomcat+xml", Documentation = "http://bitworking.org/projects/atom/rfc5023.html#iana-atomcat")] + AtomCategoryDocument = 11, + + /// + /// Indicates that the syndication resource conforms to the Atom Publishing Protocol 1.0 Service Document syndication format. + /// + //[EnumerationMetadata(DisplayName = "Atom Publishing Service 1.0", AlternateValue = "service")] + //[MimeMediaType(Name = "application", SubName = "atomsvc+xml", Documentation = "http://bitworking.org/projects/atom/rfc5023.html#iana-atomsvc")] + AtomServiceDocument = 12 + } + +} diff --git a/src/cloudscribe.Syndication/cloudscribe.Syndication.csproj b/src/cloudscribe.Syndication/cloudscribe.Syndication.csproj index e7d1708..52d370d 100644 --- a/src/cloudscribe.Syndication/cloudscribe.Syndication.csproj +++ b/src/cloudscribe.Syndication/cloudscribe.Syndication.csproj @@ -1,29 +1,29 @@ - - - - cloudscribe.Syndication Class Library - 8.5.0 - net8.0 - Joe Audette - cloudscribe;syndication;rss;atom;feed;xml - icon.png - https://github.com/cloudscribe/cloudscribe.Syndication - Apache-2.0 - https://github.com/cloudscribe/cloudscribe.Syndication.git - git - - README.md - - - - - - - - - - - - - - + + + + cloudscribe.Syndication Class Library + 8.6.0 + net8.0 + Joe Audette + cloudscribe;syndication;rss;atom;feed;xml + icon.png + https://github.com/cloudscribe/cloudscribe.Syndication + Apache-2.0 + https://github.com/cloudscribe/cloudscribe.Syndication.git + git + + README.md + + + + + + + + + + + + + + diff --git a/tools/packages.config b/tools/packages.config index ee1a562..77e4909 100644 --- a/tools/packages.config +++ b/tools/packages.config @@ -1,4 +1,4 @@ - - - - + + + + diff --git a/update_version.ps1 b/update_version.ps1 index e38bfec..15f706a 100644 --- a/update_version.ps1 +++ b/update_version.ps1 @@ -1,52 +1,52 @@ -################### -## PS script to implement a semantic versioning change from (say) 8.0.x to 8.1 -## across all interdependent cs packages - -## Wherever we have 8.0.n replace it to 8.1.0 where n >= 0 - -## Wherever we have replace it to - -## Wherever we have replace it to where n >= 0 - -## Exclude cloudscribe.HtmlAgilityPack and DbHelpers because those ones are ancient and frozen -################### - - -# Define the directory containing the .csproj files -$directory = "src" - -# Define the old & new versions -$oldVersion = '8\.4' # slash needed ! -$newVersion = "8.5.0" -$newWildcardVersion = "8.5.*" - - -# Get all .csproj files in the directory and subdirectories -$csprojFiles = Get-ChildItem -Path $directory -Recurse -Filter *.csproj - -foreach ($file in $csprojFiles) { - # Read the content of the .csproj file - $content = Get-Content -Path $file.FullName - - # Update the version of cloudscribe package references, except for cloudscribe.HtmlAgilityPack and cloudscribe.DbHelpers - - $wildCardPattern = '(?<=$newVersion" - $updatedContent = $updatedContent -replace $versionPattern, $replacement - - - # Write the updated content back to the .csproj file - Set-Content -Path $file.FullName -Value $updatedContent - - Write-Host "Updated $file.FullName" -} - -Write-Host "All cloudscribe package references (except cloudscribe.HtmlAgilityPack and cloudscribe.DbHelpers) and elements have been updated to version $newVersion or $newWildcardVersion as appropriate." - +################### +## PS script to implement a semantic versioning change from (say) 8.0.x to 8.1 +## across all interdependent cs packages + +## Wherever we have 8.0.n replace it to 8.1.0 where n >= 0 + +## Wherever we have replace it to + +## Wherever we have replace it to where n >= 0 + +## Exclude cloudscribe.HtmlAgilityPack and DbHelpers because those ones are ancient and frozen +################### + + +# Define the directory containing the .csproj files +$directory = "src" + +# Define the old & new versions +$oldVersion = '8\.5' # slash needed ! +$newVersion = "8.6.0" +$newWildcardVersion = "8.6.*" + + +# Get all .csproj files in the directory and subdirectories +$csprojFiles = Get-ChildItem -Path $directory -Recurse -Filter *.csproj + +foreach ($file in $csprojFiles) { + # Read the content of the .csproj file + $content = Get-Content -Path $file.FullName + + # Update the version of cloudscribe package references, except for cloudscribe.HtmlAgilityPack and cloudscribe.DbHelpers + + $wildCardPattern = '(?<=$newVersion" + $updatedContent = $updatedContent -replace $versionPattern, $replacement + + + # Write the updated content back to the .csproj file + Set-Content -Path $file.FullName -Value $updatedContent + + Write-Host "Updated $file.FullName" +} + +Write-Host "All cloudscribe package references (except cloudscribe.HtmlAgilityPack and cloudscribe.DbHelpers) and elements have been updated to version $newVersion or $newWildcardVersion as appropriate." + diff --git a/xglobal.json b/xglobal.json index 48efa3e..7858861 100644 --- a/xglobal.json +++ b/xglobal.json @@ -1,5 +1,5 @@ -{ - "sdk": { - "version": "2.1.101" - } +{ + "sdk": { + "version": "2.1.101" + } } \ No newline at end of file