diff --git a/BBNews.csproj b/BBNews.csproj index 7d776b2..56ee7e1 100644 --- a/BBNews.csproj +++ b/BBNews.csproj @@ -124,6 +124,7 @@ + ASPXCodeBehind diff --git a/Bitboxx.DNNModules.BBNews.xml b/Bitboxx.DNNModules.BBNews.xml new file mode 100644 index 0000000..aad2c8b --- /dev/null +++ b/Bitboxx.DNNModules.BBNews.xml @@ -0,0 +1,2096 @@ + + + + Bitboxx.DNNModules.BBNews + + + + ----------------------------------------------------------------------------- + + An abstract class for the data access layer + + + + + + ----------------------------------------------------------------------------- + + + + singleton reference to the instantiated object + + + + + constructor + + + + + dynamically create provider + + + + + return the provider + + + + + ----------------------------------------------------------------------------- + + SQL Server implementation of the abstract DataProvider class + + + + + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + The Controller class for BBNews + + + + + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + GetSearchItems implements the ISearchable Interface + + + + The ModuleInfo for the module to be Indexed + + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + ExportModule implements the IPortable ExportModule Interface + + + + The Id of the module to be exported + + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + ImportModule implements the IPortable ImportModule Interface + + + + The Id of the module to be imported + The content to be imported + The version of the module to be imported + The Id of the user performing the import + + + ----------------------------------------------------------------------------- + + + + pnlView control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + ddlTemplate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + imgThumb control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdNew control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdEdit control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + pnlEdit control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + pnlMode control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + pnlNewTemplate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblName control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtName control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + valNameRequired control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + pnlEditTemplate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblMode control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + rblMode control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblLanguage control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + ddlLanguage control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblFileCap control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblFile control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblDummy control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtTemplate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdSave control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdCancelEdit control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + ltrHelp control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblIntro control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblTwitterConsumerKey control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtTwitterConsumerKey control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblTwitterConsumerSecret control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtTwitterConsumerSecret control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblTwitterAccessToken control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtTwitterAccessToken control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblTwitterAccessTokenSecret control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtTwitterAccessTokenSecret control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdUpdate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdUpdate_Click runs when the Update Button is clicked + + + + + [cnurse] 9/28/2004 Updated to reflect design changes for Help, 508 support and localisation + + + + + lblIntro control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + plFriendlyName control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtFriendlyName control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + plEnabled control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + chkEnabled control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + plTimeLapse control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtTimeLapse control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + ddlTimeLapseMeasurement control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + plRetryTimeLapse control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtRetryTimeLapse control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + ddlRetryTimeLapseMeasurement control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + plRetainHistoryNum control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + ddlRetainHistoryNum control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdUpdate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdRun control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdCancel control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + plCategories control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + plFeeds control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + plCategoryFeeds control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + plNews control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + plScheduler control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + plCredentials control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblIntro control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + pnlSearch control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + grdCategories control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + pnlEdit control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblCategoryName control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtCategoryName control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + hidCategoryId control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblCategoryDescription control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtCategoryDescription control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + HiddenField1 control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdNew control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdSave control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdCancel control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblIntro control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblCategories control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + ddlCategories control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblFeeds control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + ctlFeeds control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblIntro control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + pnlSearch control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + grdFeeds control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + pnlEdit control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblFeedName control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtFeedName control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + valFeedname control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + hidFeedId control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblFeedType control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cboFeedType control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + pnlFeedUrl control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtFeedUrl control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + valFeedUrl control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblRetrieveInterval control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtRetrieveInterval control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + valRetrieveIntervalValid control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblTryInterval control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtTryInterval control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + valTryIntervalValid control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblReorgInterval control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtReorgInterval control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + valReorgIntervalValid control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblEnabled control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + chkEnabled control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblLastRetrieve control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtLastRetrieve control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblLastTry control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtLastTry control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + pnlCredentials control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblUserName control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtUserName control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + valUserName control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblPassword control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtPassword control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + valPassword control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdNew control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdSave control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdCancel control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblIntro control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + pnlSearch control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblSearchText control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtSearch control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblSearchCategory control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + ddlSearchCategory control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblSearchDateStart control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + dpDateStart control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblSearchDateEnd control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + dpDateEnd control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblSearch control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdSearch control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + grdNews control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + pnlEdit control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblHide control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + chkHide control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblInternal control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + chkInternal control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblFeed control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + ddlFeed control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblTitle control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtTitle control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + valTitle control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + hidNewsId control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + hidGuid control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblPubDate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + dpPubDate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + tpPubDate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblAuthor control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblAuthorName control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtAuthorName control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblAuthorUrl control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtAuthorUrl control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblAuthorEmail control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtAuthorEmail control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblAuthorNick control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtAuthorNick control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblLink control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtLink control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblImage control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtImage control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblSummary control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblNews control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdNew control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdSave control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cmdCancel control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + ----------------------------------------------------------------------------- + + The Settings class manages Module Settings + + + + + + ----------------------------------------------------------------------------- + + + ----------------------------------------------------------------------------- + + UpdateSettings saves the modified settings to the Database + + + + + + ----------------------------------------------------------------------------- + + + + lblView control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + rblView control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + pnlCategory control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblCategory control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cboCategory control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + pnlMulti control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblTopN control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtTopN control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + RangeValidatorTopN control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblStartDate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + dtpStartDate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblEndDate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + dtpEndDate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblShowRss control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + rblRss control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + pnlShowTitle control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblShowTitle control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + chkShowTitle control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + pnlSelectPage control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblNewsPage control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + urlSelectNewsPage control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + pnlNewsRows control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblNewsInRow control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtNewsInRow control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + RangeValidatorNewsInRow control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblRowsPerPage control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtRowsPerPage control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + RangeValidatorRowsPerPage control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblSelectTemplate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + selTemplate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + pnlMarquee control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblMarqueeDirection control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + cboMarqueeDirection control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblMarqueeScrollAmount control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtMarqueeScrollAmount control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + RangeValidatorMarqueeScrollAmount control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblMarqueeScrollDelay control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + txtMarqueeScrollDelay control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + RangeValidatorMarqueeScrollDelay control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lblMarqueeAlternate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + chkMarqueeAlternate control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + Processes the tokens. + + The FAQ item. + The template. + Answers in which all tokens are processed + + + ----------------------------------------------------------------------------- + + Registers the module actions required for interfacing with the portal framework + + + + + + + ----------------------------------------------------------------------------- + + + + MultiView1 control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + ViewTable control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + lstNews control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + Pager control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + ViewMarquee control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + ltrMarquee control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + ViewDetail control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + plhDetail control. + + + Auto-generated field. + To modify move field declaration from designer file to code-behind file. + + + + + This class is used to set information about the package + + + + + Creates a attribute with the right properties to create a package. Use on View element + + The package name + Ordinal number for sorting packages in the manifest + The package friendly name + The package description + The package iconfile name + Name of Owner + Organization of owner + Url of owner + Email of owner + Flag for Azure Compatibility + + + + Creates a attribute with the right properties to create a package. Use on other elements + + The package name + + + + This class is used to set information about the module + + + + + Creates a attribute with the right properties to create a module. Use on View element + + The module name. + The module friendlyname. + the module default cachetime. + + + + Creates a attribute with the right properties to create a module. Use on other elements + + The module name. + + + + This class is used to indicate which UserControls should be in the install package + + + + + Creates a attribute with the right properties to create a control. + + The key. + The title. + type of the user control. + The help URL. + if set to true [supports partial rendering]. + if set to true [supports pop ups]. + + + + Module permission attribute + + + + + Empty Constructor for Intellisense + + + + + + + + Enum for type of component used. + + + + + Enum for the type of controls DotNetNuke is using. + + + + + The type of dependency for the DotNetNuke Module + + + + diff --git a/Components/BBNewsController.cs b/Components/BBNewsController.cs index 3e228ff..d5518c0 100644 --- a/Components/BBNewsController.cs +++ b/Components/BBNewsController.cs @@ -1,444 +1,451 @@ -#region copyright - -// -// bitboxx - http://www.bitboxx.net -// Copyright (c) 2012 -// by bitboxx solutions Torsten Weggen -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -// to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions -// of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -#endregion - -using System; -using System.Collections.Generic; -using System.Data.SqlTypes; -using System.IO; -using System.Net; -using System.ServiceModel.Syndication; -using System.Text; -using System.Xml; - -using Bitboxx.DNNModules.BBNews.Components; - -using DotNetNuke.Common.Utilities; -using DotNetNuke.Entities.Modules; -using DotNetNuke.Services.Log.EventLog; -using DotNetNuke.Services.Search; - - -namespace Bitboxx.DNNModules.BBNews -{ - - /// ----------------------------------------------------------------------------- - /// - /// The Controller class for BBNews - /// - /// - /// - /// - /// - /// ----------------------------------------------------------------------------- - - // [DNNtc.UpgradeEventMessage("01.01.01,04.00.02,04.01.00")] - [DNNtc.BusinessControllerClass()] - // public class BBNewsController : ISearchable, IPortable - public class BBNewsController : PortalModuleBase //, ISearchable, IPortable - { - - #region "Public Data Methods" - - public List GetNews(int PortalId, int CategoryId, int TopN, DateTime StartDate, DateTime EndDate, int pageNum, int pageSize, bool includeHidden, string search) - { - return CBO.FillCollection(DataProvider.Instance().GetNews(PortalId, CategoryId, TopN, StartDate, EndDate, pageNum, pageSize,includeHidden,search)); - } - public int GetNewsCount(int PortalID, int CategoryID, int TopN, DateTime StartDate, DateTime EndDate, bool includeHidden, String search) - { - return DataProvider.Instance().GetNewsCount(PortalID, CategoryID, TopN, StartDate, EndDate, includeHidden, search); - } - public NewsInfo GetNews(int NewsId) - { - return CBO.FillObject(DataProvider.Instance().GetNews(NewsId)); - } - public List GetNews() - { - return CBO.FillCollection(DataProvider.Instance().GetNews()); - } - public void ReorgNews(int FeedId) - { - DataProvider.Instance().ReorgNews(FeedId); - } - public void SaveNewsByGuid(NewsInfo News) - { - DataProvider.Instance().SaveNewsByGuid(News); - } - public void SaveNewsById(NewsInfo News) - { - DataProvider.Instance().SaveNewsById(News); - } - public void DeleteNews(int NewsId) - { - DataProvider.Instance().DeleteNews(NewsId); - } - public CategoryInfo GetCategory(int categoryId) - { - return CBO.FillObject(DataProvider.Instance().GetCategory(categoryId)); - } - public List GetCategories() - { - return CBO.FillCollection(DataProvider.Instance().GetCategories()); - } - public List GetCategories(int PortalId) - { - return CBO.FillCollection(DataProvider.Instance().GetCategories(PortalId)); - } - public void SaveCategory(CategoryInfo Category) - { - DataProvider.Instance().SaveCategory(Category); - } - public void DeleteCategory(int CategoryId) - { - DataProvider.Instance().DeleteCategory(CategoryId); - } - - public FeedInfo GetFeed(int FeedId) - { - return CBO.FillObject(DataProvider.Instance().GetFeed(FeedId)); - } - public List GetFeeds() - { - return CBO.FillCollection(DataProvider.Instance().GetFeeds()); - } - public List GetFeeds(int portalId) - { - return CBO.FillCollection(DataProvider.Instance().GetFeeds(portalId)); - } - public void SaveFeed(FeedInfo Feed) - { - DataProvider.Instance().SaveFeed(Feed); - } - public void DeleteFeed(int FeedId) - { - DataProvider.Instance().DeleteFeed(FeedId); - } - public List GetCategoryFeeds(int categoryId) - { - return CBO.FillCollection(DataProvider.Instance().GetCategoryFeeds(categoryId)); - } - public void AddCategoryFeed(int categoryId, int feedId) - { - DataProvider.Instance().AddCategoryFeed(categoryId, feedId); - } - public void RemoveCategoryFeed(int categoryId, int feedId) - { - DataProvider.Instance().RemoveCategoryFeed(categoryId, feedId); - } - #endregion - - #region "Public Helper Methods" - - public void ReadFeed(int FeedId) - { - FeedInfo feedInfo = this.GetFeed(FeedId); - string ProxyServer = DotNetNuke.Entities.Host.Host.ProxyServer; - string ProxyPort = DotNetNuke.Entities.Host.Host.ProxyPort.ToString(); - string ProxyUserName = DotNetNuke.Entities.Host.Host.ProxyUsername; - string ProxyPassword = DotNetNuke.Entities.Host.Host.ProxyPassword; - HttpWebRequest wrq; - WebResponse wrp; - Stream rssStream; - XmlReaderSettings settings; - XmlReader rssReader; - SyndicationFeed feed; - - string oAuthToken = DotNetNuke.Entities.Portals.PortalController.GetPortalSetting("BB_TwitterToken", feedInfo.PortalId, ""); - string oAuthTokenSecret = DotNetNuke.Entities.Portals.PortalController.GetPortalSetting("BB_TwitterTokenSecret", feedInfo.PortalId, ""); - string oAuthConsumerKey = DotNetNuke.Entities.Portals.PortalController.GetPortalSetting("BB_TwitterConsumerKey", feedInfo.PortalId, ""); - string oAuthConsumerSecret = DotNetNuke.Entities.Portals.PortalController.GetPortalSetting("BB_TwitterConsumerSecret", feedInfo.PortalId, ""); - - try - { - switch (feedInfo.FeedType) - { - case 0: // None - return; - case 1: // Twitter Search - - TwitterApi11 twitterApiSearch = new TwitterApi11(oAuthToken, oAuthTokenSecret, oAuthConsumerKey, oAuthConsumerSecret); - List newsListSearch = twitterApiSearch.SearchTweets(feedInfo.FeedUrl, 20); - foreach (NewsInfo news in newsListSearch) - { - news.FeedId = FeedId; - this.SaveNewsByGuid(news); - } - feedInfo.LastRetrieve = DateTime.Now; - this.SaveFeed(feedInfo); - break; - - case 3: // Twitter Timeline - - TwitterApi11 twitterApiUser = new TwitterApi11(oAuthToken, oAuthTokenSecret, oAuthConsumerKey, oAuthConsumerSecret); - List newsListUser = twitterApiUser.GetUserTimeLine(feedInfo.FeedUrl, 20); - foreach (NewsInfo news in newsListUser) - { - news.FeedId = FeedId; - this.SaveNewsByGuid(news); - } - feedInfo.LastRetrieve = DateTime.Now; - this.SaveFeed(feedInfo); - break; - - case 2: // RSS - Uri baseUrl = new Uri(feedInfo.FeedUrl); - try - { - wrq = (HttpWebRequest)WebRequest.Create(feedInfo.FeedUrl); - - if (ProxyServer != string.Empty) - wrq.Proxy = new WebProxy(ProxyServer + (ProxyPort != "-1" ? ":" + ProxyPort : "")); - - if (ProxyUserName != string.Empty) - wrq.Proxy.Credentials = new NetworkCredential(ProxyUserName, ProxyPassword); - - - // Set UserAgent to avoid prohibited (403) answer - wrq.UserAgent = "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1"; - - wrp = wrq.GetResponse(); - rssStream = wrp.GetResponseStream(); - - settings = new XmlReaderSettings(); - settings.ProhibitDtd = false; - - rssReader = XmlReader.Create(rssStream, settings); - feed = SyndicationFeed.Load(rssReader); - } - catch (Exception ex) - { - // zweiter Versuch - string xml = string.Empty; - WebClient c = new WebClient(); - Stream s = c.OpenRead(feedInfo.FeedUrl); - try - { - int n, bloc = 65535; - byte[] bytes = new byte[bloc]; - do - { - try - { - n = s.Read(bytes, 0, bloc); - } - catch (IOException) - { - break; - } - - // The end of the file is reached. - if (n == 0) - break; - xml += Encoding.UTF8.GetString(bytes, 0, n); - } while (true); - } - finally - { - s.Close(); - } - - // if xml is not valid lets try to repair - try - { - try - { - rssReader = System.Xml.XmlReader.Create(new StringReader(xml)); - feed = SyndicationFeed.Load(rssReader); - } - catch (Exception) - { - xml = xml.Replace(" ", "&nbsp;") - .Replace("<", "&lt;") - .Replace(">", "&gt;") - .Replace("–", "&ndash;") - .Replace("“", "&ldquo;") - .Replace("”", "&rdquo;") - .Replace("’", "&rsquo;"); - rssReader = System.Xml.XmlReader.Create(new StringReader(xml)); - feed = SyndicationFeed.Load(rssReader); - } - } - catch (Exception) - { - xml = AddCDATA(xml); - rssReader = System.Xml.XmlReader.Create(new StringReader(xml)); - feed = SyndicationFeed.Load(rssReader); - } - } - - - foreach (var feedItem in feed.Items) - { - NewsInfo news = new NewsInfo(); - news.News = ""; - news.Internal = false; - news.Title = (feedItem.Title != null ? feedItem.Title.Text : ""); - news.Summary = (feedItem.Summary != null ? feedItem.Summary.Text : ""); - //if (feedInfo.StripHtml) - // news.Summary = StripHTML(news.Summary); - news.Link = (feedItem.Links.Count > 0 ? feedItem.Links[0].Uri.OriginalString : ""); - if (!news.Link.ToLower().StartsWith("http")) - news.Link = baseUrl.Scheme + "://" + baseUrl.Host + news.Link; - news.Author = ""; - if (feedItem.Authors.Count > 0) - { - string name = feedItem.Authors[0].Name ?? " "; - string uri = feedItem.Authors[0].Uri ?? " "; - string email = feedItem.Authors[0].Email ?? " "; - string nick = ""; - news.Author = name + "|" + uri + "|" + email + "|" + nick; - } - - news.Image = (feedItem.Links.Count > 1 ? feedItem.Links[1].Uri.OriginalString : ""); - - DateTime pubDate = (feedItem.PublishDate.LocalDateTime != DateTime.MinValue ? feedItem.PublishDate.LocalDateTime : (DateTime)SqlDateTime.MinValue); - DateTime lastUpdated = (feedItem.LastUpdatedTime.LocalDateTime != DateTime.MinValue ? feedItem.LastUpdatedTime.LocalDateTime : (DateTime)SqlDateTime.MinValue); - news.Pubdate = (pubDate > lastUpdated ? pubDate : lastUpdated); - news.Pubdate = (news.Pubdate <= (DateTime)SqlDateTime.MinValue ? DateTime.Now : news.Pubdate); - news.Internal = false; - - if (feedItem.Id != null) - news.GUID = feedItem.Id; - else - news.GUID = string.Format("{0:yyyyMMddHHmmss}", news.Pubdate) + - news.Title.ToUpper().Substring(0, Math.Min(news.Title.Length, 20)); - news.FeedId = feedInfo.FeedId; - this.SaveNewsByGuid(news); - } - feedInfo.LastRetrieve = DateTime.Now; - this.SaveFeed(feedInfo); - break; - - - } - } - catch (Exception ex) - { - EventLogController objEventLog = new EventLogController(); - objEventLog.AddLog("Feed Read Error (" + feedInfo.FeedId.ToString() + ":" + feedInfo.FeedUrl + ") ", ex.ToString(), PortalSettings, -1, EventLogController.EventLogType.ADMIN_ALERT); - feedInfo.LastTry = DateTime.Now; - this.SaveFeed(feedInfo); - } - } - - public string AddCDATA(string xml) - { - if (xml.IndexOf("") > -1 && xml.IndexOf("", "", "]]>"); - } - return xml; - } - - #endregion - - #region "Optional Interfaces" - - /// ----------------------------------------------------------------------------- - /// - /// GetSearchItems implements the ISearchable Interface - /// - /// - /// - /// The ModuleInfo for the module to be Indexed - /// - /// - /// ----------------------------------------------------------------------------- - public DotNetNuke.Services.Search.SearchItemInfoCollection GetSearchItems(ModuleInfo ModInfo) - { - - SearchItemInfoCollection SearchItemCollection = new SearchItemInfoCollection(); - - //List colBBNewss = GetBBNewss(ModInfo.ModuleID); - //foreach (BBNewsInfo objBBNews in colBBNewss) - //{ - // SearchItemInfo SearchItem = new SearchItemInfo(ModInfo.ModuleTitle, objBBNews.Content, objBBNews.CreatedByUser, objBBNews.CreatedDate, ModInfo.ModuleID, objBBNews.ItemId.ToString(), objBBNews.Content, "ItemId=" + objBBNews.ItemId.ToString()); - // SearchItemCollection.Add(SearchItem); - //} - - return SearchItemCollection; - - } - - /// ----------------------------------------------------------------------------- - /// - /// ExportModule implements the IPortable ExportModule Interface - /// - /// - /// - /// The Id of the module to be exported - /// - /// - /// ----------------------------------------------------------------------------- - public string ExportModule(int ModuleID) - { - - string strXML = ""; - - //List colBBNewss = GetBBNewss(ModuleID); - //if (colBBNewss.Count != 0) - //{ - // strXML += ""; - // foreach (BBNewsInfo objBBNews in colBBNewss) - // { - // strXML += ""; - // strXML += "" + XmlUtils.XMLEncode(objBBNews.Content) + ""; - // strXML += ""; - // } - // strXML += ""; - //} - - return strXML; - - } - - /// ----------------------------------------------------------------------------- - /// - /// ImportModule implements the IPortable ImportModule Interface - /// - /// - /// - /// The Id of the module to be imported - /// The content to be imported - /// The version of the module to be imported - /// The Id of the user performing the import - /// - /// - /// ----------------------------------------------------------------------------- - public void ImportModule(int ModuleID, string Content, string Version, int UserId) - { - - //XmlNode xmlBBNewss = Globals.GetContent(Content, "BBNewss"); - //foreach (XmlNode xmlBBNews in xmlBBNewss.SelectNodes("BBNews")) - //{ - // BBNewsInfo objBBNews = new BBNewsInfo(); - // objBBNews.ModuleId = ModuleID; - // objBBNews.Content = xmlBBNews.SelectSingleNode("content").InnerText; - // objBBNews.CreatedByUser = UserId; - // AddBBNews(objBBNews); - //} - - } - - #endregion - } +#region copyright + +// +// bitboxx - http://www.bitboxx.net +// Copyright (c) 2012 +// by bitboxx solutions Torsten Weggen +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#endregion + +using System; +using System.Collections.Generic; +using System.Data.SqlTypes; +using System.IO; +using System.Net; +using System.ServiceModel.Syndication; +using System.Text; +using System.Xml; + +using Bitboxx.DNNModules.BBNews.Components; + +using DotNetNuke.Common.Utilities; +using DotNetNuke.Entities.Modules; +using DotNetNuke.Services.Log.EventLog; +using DotNetNuke.Services.Search; + + +namespace Bitboxx.DNNModules.BBNews +{ + + /// ----------------------------------------------------------------------------- + /// + /// The Controller class for BBNews + /// + /// + /// + /// + /// + /// ----------------------------------------------------------------------------- + + // [DNNtc.UpgradeEventMessage("01.01.01,04.00.02,04.01.00")] + [DNNtc.BusinessControllerClass()] + // public class BBNewsController : ISearchable, IPortable + public class BBNewsController : PortalModuleBase //, ISearchable, IPortable + { + + #region "Public Data Methods" + + public List GetNews(int PortalId, int CategoryId, int TopN, DateTime StartDate, DateTime EndDate, int pageNum, int pageSize, bool includeHidden, string search) + { + return CBO.FillCollection(DataProvider.Instance().GetNews(PortalId, CategoryId, TopN, StartDate, EndDate, pageNum, pageSize,includeHidden,search)); + } + public int GetNewsCount(int PortalID, int CategoryID, int TopN, DateTime StartDate, DateTime EndDate, bool includeHidden, String search) + { + return DataProvider.Instance().GetNewsCount(PortalID, CategoryID, TopN, StartDate, EndDate, includeHidden, search); + } + public NewsInfo GetNews(int NewsId) + { + return CBO.FillObject(DataProvider.Instance().GetNews(NewsId)); + } + public List GetNews() + { + return CBO.FillCollection(DataProvider.Instance().GetNews()); + } + public void ReorgNews(int FeedId) + { + DataProvider.Instance().ReorgNews(FeedId); + } + public void SaveNewsByGuid(NewsInfo News) + { + DataProvider.Instance().SaveNewsByGuid(News); + } + public void SaveNewsById(NewsInfo News) + { + DataProvider.Instance().SaveNewsById(News); + } + public void DeleteNews(int NewsId) + { + DataProvider.Instance().DeleteNews(NewsId); + } + public CategoryInfo GetCategory(int categoryId) + { + return CBO.FillObject(DataProvider.Instance().GetCategory(categoryId)); + } + public List GetCategories() + { + return CBO.FillCollection(DataProvider.Instance().GetCategories()); + } + public List GetCategories(int PortalId) + { + return CBO.FillCollection(DataProvider.Instance().GetCategories(PortalId)); + } + public void SaveCategory(CategoryInfo Category) + { + DataProvider.Instance().SaveCategory(Category); + } + public void DeleteCategory(int CategoryId) + { + DataProvider.Instance().DeleteCategory(CategoryId); + } + + public FeedInfo GetFeed(int FeedId) + { + return CBO.FillObject(DataProvider.Instance().GetFeed(FeedId)); + } + public List GetFeeds() + { + return CBO.FillCollection(DataProvider.Instance().GetFeeds()); + } + public List GetFeeds(int portalId) + { + return CBO.FillCollection(DataProvider.Instance().GetFeeds(portalId)); + } + public void SaveFeed(FeedInfo Feed) + { + DataProvider.Instance().SaveFeed(Feed); + } + public void DeleteFeed(int FeedId) + { + DataProvider.Instance().DeleteFeed(FeedId); + } + public List GetCategoryFeeds(int categoryId) + { + return CBO.FillCollection(DataProvider.Instance().GetCategoryFeeds(categoryId)); + } + public void AddCategoryFeed(int categoryId, int feedId) + { + DataProvider.Instance().AddCategoryFeed(categoryId, feedId); + } + public void RemoveCategoryFeed(int categoryId, int feedId) + { + DataProvider.Instance().RemoveCategoryFeed(categoryId, feedId); + } + #endregion + + #region "Public Helper Methods" + + public void ReadFeed(int FeedId) + { + FeedInfo feedInfo = this.GetFeed(FeedId); + string ProxyServer = DotNetNuke.Entities.Host.Host.ProxyServer; + string ProxyPort = DotNetNuke.Entities.Host.Host.ProxyPort.ToString(); + string ProxyUserName = DotNetNuke.Entities.Host.Host.ProxyUsername; + string ProxyPassword = DotNetNuke.Entities.Host.Host.ProxyPassword; + HttpWebRequest wrq; + WebResponse wrp; + Stream rssStream; + XmlReaderSettings settings; + XmlReader rssReader; + SyndicationFeed feed; + + string oAuthToken = DotNetNuke.Entities.Portals.PortalController.GetPortalSetting("BB_TwitterToken", feedInfo.PortalId, ""); + string oAuthTokenSecret = DotNetNuke.Entities.Portals.PortalController.GetPortalSetting("BB_TwitterTokenSecret", feedInfo.PortalId, ""); + string oAuthConsumerKey = DotNetNuke.Entities.Portals.PortalController.GetPortalSetting("BB_TwitterConsumerKey", feedInfo.PortalId, ""); + string oAuthConsumerSecret = DotNetNuke.Entities.Portals.PortalController.GetPortalSetting("BB_TwitterConsumerSecret", feedInfo.PortalId, ""); + + try + { + switch (feedInfo.FeedType) + { + case 0: // None + return; + case 1: // Twitter Search + + TwitterApi11 twitterApiSearch = new TwitterApi11(oAuthToken, oAuthTokenSecret, oAuthConsumerKey, oAuthConsumerSecret); + List newsListSearch = twitterApiSearch.SearchTweets(feedInfo.FeedUrl, 20); + foreach (NewsInfo news in newsListSearch) + { + news.FeedId = FeedId; + this.SaveNewsByGuid(news); + } + feedInfo.LastRetrieve = DateTime.Now; + this.SaveFeed(feedInfo); + break; + + case 3: // Twitter Timeline + + TwitterApi11 twitterApiUser = new TwitterApi11(oAuthToken, oAuthTokenSecret, oAuthConsumerKey, oAuthConsumerSecret); + List newsListUser = twitterApiUser.GetUserTimeLine(feedInfo.FeedUrl, 20); + foreach (NewsInfo news in newsListUser) + { + news.FeedId = FeedId; + this.SaveNewsByGuid(news); + } + feedInfo.LastRetrieve = DateTime.Now; + this.SaveFeed(feedInfo); + break; + + case 2: // RSS + Uri baseUrl = new Uri(feedInfo.FeedUrl); + try + { + wrq = (HttpWebRequest)WebRequest.Create(feedInfo.FeedUrl); + + if (ProxyServer != string.Empty) + wrq.Proxy = new WebProxy(ProxyServer + (ProxyPort != "-1" ? ":" + ProxyPort : "")); + + if (ProxyUserName != string.Empty) + wrq.Proxy.Credentials = new NetworkCredential(ProxyUserName, ProxyPassword); + + + // Set UserAgent to avoid prohibited (403) answer + wrq.UserAgent = "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1"; + + wrp = wrq.GetResponse(); + rssStream = wrp.GetResponseStream(); + + settings = new XmlReaderSettings(); + settings.ProhibitDtd = false; + + rssReader = XmlReader.Create(rssStream, settings); + feed = SyndicationFeed.Load(rssReader); + } + catch (Exception ex) + { + // zweiter Versuch + string xml = string.Empty; + WebClient c = new WebClient(); + Stream s = c.OpenRead(feedInfo.FeedUrl); + try + { + int n, bloc = 65535; + byte[] bytes = new byte[bloc]; + do + { + try + { + n = s.Read(bytes, 0, bloc); + } + catch (IOException) + { + break; + } + + // The end of the file is reached. + if (n == 0) + break; + xml += Encoding.UTF8.GetString(bytes, 0, n); + } while (true); + } + finally + { + s.Close(); + } + + // if xml is not valid lets try to repair + try + { + try + { + rssReader = System.Xml.XmlReader.Create(new StringReader(xml)); + feed = SyndicationFeed.Load(rssReader); + } + catch (Exception) + { + xml = xml.Replace(" ", "&nbsp;") + .Replace("<", "&lt;") + .Replace(">", "&gt;") + .Replace("–", "&ndash;") + .Replace("“", "&ldquo;") + .Replace("”", "&rdquo;") + .Replace("’", "&rsquo;"); + + MemoryStream stream = new MemoryStream(); + StreamWriter writer = new StreamWriter(stream); + writer.Write(xml); + writer.Flush(); + stream.Position = 0; + + rssReader = new RssXmlReader(stream); + feed = SyndicationFeed.Load(rssReader); + } + } + catch (Exception) + { + xml = AddCDATA(xml); + rssReader = System.Xml.XmlReader.Create(new StringReader(xml)); + feed = SyndicationFeed.Load(rssReader); + } + } + + + foreach (var feedItem in feed.Items) + { + NewsInfo news = new NewsInfo(); + news.News = ""; + news.Internal = false; + news.Title = (feedItem.Title != null ? feedItem.Title.Text : ""); + news.Summary = (feedItem.Summary != null ? feedItem.Summary.Text : ""); + //if (feedInfo.StripHtml) + // news.Summary = StripHTML(news.Summary); + news.Link = (feedItem.Links.Count > 0 ? feedItem.Links[0].Uri.OriginalString : ""); + if (!news.Link.ToLower().StartsWith("http")) + news.Link = baseUrl.Scheme + "://" + baseUrl.Host + news.Link; + news.Author = ""; + if (feedItem.Authors.Count > 0) + { + string name = feedItem.Authors[0].Name ?? " "; + string uri = feedItem.Authors[0].Uri ?? " "; + string email = feedItem.Authors[0].Email ?? " "; + string nick = ""; + news.Author = name + "|" + uri + "|" + email + "|" + nick; + } + + news.Image = (feedItem.Links.Count > 1 ? feedItem.Links[1].Uri.OriginalString : ""); + + DateTime pubDate = (feedItem.PublishDate.LocalDateTime != DateTime.MinValue ? feedItem.PublishDate.LocalDateTime : (DateTime)SqlDateTime.MinValue); + DateTime lastUpdated = (feedItem.LastUpdatedTime.LocalDateTime != DateTime.MinValue ? feedItem.LastUpdatedTime.LocalDateTime : (DateTime)SqlDateTime.MinValue); + news.Pubdate = (pubDate > lastUpdated ? pubDate : lastUpdated); + news.Pubdate = (news.Pubdate <= (DateTime)SqlDateTime.MinValue ? DateTime.Now : news.Pubdate); + news.Internal = false; + + if (feedItem.Id != null) + news.GUID = feedItem.Id; + else + news.GUID = string.Format("{0:yyyyMMddHHmmss}", news.Pubdate) + + news.Title.ToUpper().Substring(0, Math.Min(news.Title.Length, 20)); + news.FeedId = feedInfo.FeedId; + this.SaveNewsByGuid(news); + } + feedInfo.LastRetrieve = DateTime.Now; + this.SaveFeed(feedInfo); + break; + + + } + } + catch (Exception ex) + { + EventLogController objEventLog = new EventLogController(); + objEventLog.AddLog("Feed Read Error (" + feedInfo.FeedId.ToString() + ":" + feedInfo.FeedUrl + ") ", ex.ToString(), PortalSettings, -1, EventLogController.EventLogType.ADMIN_ALERT); + feedInfo.LastTry = DateTime.Now; + this.SaveFeed(feedInfo); + } + } + + public string AddCDATA(string xml) + { + if (xml.IndexOf("") > -1 && xml.IndexOf("", "", "]]>"); + } + return xml; + } + + #endregion + + #region "Optional Interfaces" + + /// ----------------------------------------------------------------------------- + /// + /// GetSearchItems implements the ISearchable Interface + /// + /// + /// + /// The ModuleInfo for the module to be Indexed + /// + /// + /// ----------------------------------------------------------------------------- + public DotNetNuke.Services.Search.SearchItemInfoCollection GetSearchItems(ModuleInfo ModInfo) + { + + SearchItemInfoCollection SearchItemCollection = new SearchItemInfoCollection(); + + //List colBBNewss = GetBBNewss(ModInfo.ModuleID); + //foreach (BBNewsInfo objBBNews in colBBNewss) + //{ + // SearchItemInfo SearchItem = new SearchItemInfo(ModInfo.ModuleTitle, objBBNews.Content, objBBNews.CreatedByUser, objBBNews.CreatedDate, ModInfo.ModuleID, objBBNews.ItemId.ToString(), objBBNews.Content, "ItemId=" + objBBNews.ItemId.ToString()); + // SearchItemCollection.Add(SearchItem); + //} + + return SearchItemCollection; + + } + + /// ----------------------------------------------------------------------------- + /// + /// ExportModule implements the IPortable ExportModule Interface + /// + /// + /// + /// The Id of the module to be exported + /// + /// + /// ----------------------------------------------------------------------------- + public string ExportModule(int ModuleID) + { + + string strXML = ""; + + //List colBBNewss = GetBBNewss(ModuleID); + //if (colBBNewss.Count != 0) + //{ + // strXML += ""; + // foreach (BBNewsInfo objBBNews in colBBNewss) + // { + // strXML += ""; + // strXML += "" + XmlUtils.XMLEncode(objBBNews.Content) + ""; + // strXML += ""; + // } + // strXML += ""; + //} + + return strXML; + + } + + /// ----------------------------------------------------------------------------- + /// + /// ImportModule implements the IPortable ImportModule Interface + /// + /// + /// + /// The Id of the module to be imported + /// The content to be imported + /// The version of the module to be imported + /// The Id of the user performing the import + /// + /// + /// ----------------------------------------------------------------------------- + public void ImportModule(int ModuleID, string Content, string Version, int UserId) + { + + //XmlNode xmlBBNewss = Globals.GetContent(Content, "BBNewss"); + //foreach (XmlNode xmlBBNews in xmlBBNewss.SelectNodes("BBNews")) + //{ + // BBNewsInfo objBBNews = new BBNewsInfo(); + // objBBNews.ModuleId = ModuleID; + // objBBNews.Content = xmlBBNews.SelectSingleNode("content").InnerText; + // objBBNews.CreatedByUser = UserId; + // AddBBNews(objBBNews); + //} + + } + + #endregion + } } \ No newline at end of file diff --git a/Components/RssXmlReader.cs b/Components/RssXmlReader.cs new file mode 100644 index 0000000..2e98435 --- /dev/null +++ b/Components/RssXmlReader.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Web; +using System.Xml; + +namespace Bitboxx.DNNModules.BBNews.Components +{ + public class RssXmlReader : XmlTextReader + { + private bool readingDate = false; + const string CustomUtcDateTimeFormat = "ddd MMM dd HH:mm:ss Z yyyy"; // Wed Oct 07 08:00:07 GMT 2009 + + public RssXmlReader(Stream s) : base(s) { } + + public RssXmlReader(string inputUri) : base(inputUri) { } + + public override void ReadStartElement() + { + if (string.Equals(base.NamespaceURI, string.Empty, StringComparison.InvariantCultureIgnoreCase) && + (string.Equals(base.LocalName, "lastBuildDate", StringComparison.InvariantCultureIgnoreCase) || + string.Equals(base.LocalName, "pubDate", StringComparison.InvariantCultureIgnoreCase))) + { + readingDate = true; + } + base.ReadStartElement(); + } + + public override void ReadEndElement() + { + if (readingDate) + { + readingDate = false; + } + base.ReadEndElement(); + } + + public override string ReadString() + { + if (readingDate) + { + string dateString = base.ReadString(); + DateTime dt; + if (!DateTime.TryParse(dateString, out dt)) + dt = DateTime.ParseExact(dateString, CustomUtcDateTimeFormat, CultureInfo.InvariantCulture); + return dt.ToUniversalTime().ToString("R", CultureInfo.InvariantCulture); + } + else + { + return base.ReadString(); + } + } + } +} + diff --git a/README.md b/README.md index 0b2811d..070545d 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,11 @@ * * * ## Whats new ? +_Version 01.02.00 (25.03.2014):_ + +* Compatibility for DNN 8+ +* Fixed some issues when retrieving Feeds +* Added MetaData field to support XML Data in special News Field _Version 01.01.05 (25.03.2014):_ @@ -326,4 +331,24 @@ The DNN scheduler checks in the defined interval your feed table for feeds that Example: Select "10" to keep the ten most recent schedule history rows. - \ No newline at end of file + + +## MetaData + +New in version 01.02.00 for DNN8+ : The news table has a new MetaData field that is NOT filled by the RSS collector. But it can be used by other developers to fill in some xml: +```xml + + + Article + Lorem ipsum dolor.. + + + BackLink + http://www.auktionsbuddy.de + + ... + +``` + +These values can then used as placeholder tokens in the template: +[BBNEWS:Meta|Article] or [BBNEWS:Meta|Backlink] \ No newline at end of file