@@ -36,7 +37,10 @@
-
\ No newline at end of file
diff --git a/Edit.ascx.cs b/Edit.ascx.cs
index 96f0409..cb0bf34 100644
--- a/Edit.ascx.cs
+++ b/Edit.ascx.cs
@@ -30,7 +30,9 @@
namespace Bitboxx.DNNModules.BBNews
{
- [DNNtc.ModuleControlProperties("Edit", "Bitboxx.BBNews Admin", DNNtc.ControlType.Edit, "", true, true)]
+ [DNNtc.PackageProperties("Bitboxx.BBNews")]
+ [DNNtc.ModuleProperties("Bitboxx.BBNews")]
+ [DNNtc.ModuleControlProperties("Edit", "Bitboxx.BBNews Admin", DNNtc.ControlType.Edit, "", true, true)]
public partial class Edit : PortalModuleBase
{
public Hashtable SubModules;
@@ -80,6 +82,13 @@ protected void Page_Load(object sender, EventArgs e)
ctrlScheduler.MainControl = this;
plScheduler.Controls.Add(ctrlScheduler);
SubModules.Add("EditScheduler", ctrlScheduler);
+
+ EditCredentials ctrlCredentials = LoadControl("EditCredentials.ascx") as EditCredentials;
+ ctrlCredentials.ModuleConfiguration = this.ModuleConfiguration;
+ ctrlCredentials.LocalResourceFile = Localization.GetResourceFile(ctrlNews, ctrlCredentials.GetType().BaseType.Name + ".ascx");
+ ctrlCredentials.MainControl = this;
+ plCredentials.Controls.Add(ctrlCredentials);
+ SubModules.Add("EditCredentials", ctrlCredentials);
}
catch (Exception ex)
{
diff --git a/Edit.ascx.designer.cs b/Edit.ascx.designer.cs
index 1f02c95..7b4f19f 100644
--- a/Edit.ascx.designer.cs
+++ b/Edit.ascx.designer.cs
@@ -56,5 +56,14 @@ public partial class Edit {
/// To modify move field declaration from designer file to code-behind file.
///
protected global::System.Web.UI.WebControls.PlaceHolder plScheduler;
+
+ ///
+ /// plCredentials control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.PlaceHolder plCredentials;
}
}
diff --git a/EditCredentials.ascx b/EditCredentials.ascx
new file mode 100644
index 0000000..c42a3bf
--- /dev/null
+++ b/EditCredentials.ascx
@@ -0,0 +1,30 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EditCredentials.ascx.cs" Inherits="Bitboxx.DNNModules.BBNews.EditCredentials" %>
+<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
+
+
diff --git a/EditCredentials.ascx.cs b/EditCredentials.ascx.cs
new file mode 100644
index 0000000..d476814
--- /dev/null
+++ b/EditCredentials.ascx.cs
@@ -0,0 +1,79 @@
+#region copyright
+
+// bitboxx - http://www.bitboxx.net
+// Copyright (c) 2014
+// 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
+
+
+// Some blog info about Scheduler
+// http://kemmis.info/blog/archive/2008/05/20/programmatically-add-delete-and-update-scheduled-tasks.aspx
+
+
+using System;
+using System.Collections;
+using System.Web.UI;
+using DotNetNuke.Common.Utilities;
+using DotNetNuke.Entities.Modules;
+using DotNetNuke.Entities.Portals;
+using DotNetNuke.Services.Localization;
+using DotNetNuke.Services.Scheduling;
+using DotNetNuke.UI.Skins;
+using DotNetNuke.UI.Skins.Controls;
+
+namespace Bitboxx.DNNModules.BBNews
+{
+ public partial class EditCredentials : PortalModuleBase
+ {
+ #region Private Members
+
+ private BBNewsController _controller;
+
+ #endregion
+
+ #region Properties
+
+ public BBNewsController Controller
+ {
+ get
+ {
+ if (_controller == null)
+ _controller = new BBNewsController();
+ return _controller;
+ }
+ }
+ public Control MainControl { get; set; }
+ #endregion
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ txtTwitterAccessToken.Text = PortalController.GetPortalSetting("BB_TwitterToken", PortalId, "");
+ txtTwitterAccessTokenSecret.Text = PortalController.GetPortalSetting("BB_TwitterTokenSecret", PortalId, "");
+ txtTwitterConsumerKey.Text = PortalController.GetPortalSetting("BB_TwitterConsumerKey", PortalId, "");
+ txtTwitterConsumerSecret.Text = PortalController.GetPortalSetting("BB_TwitterConsumerSecret", PortalId, "");
+ }
+
+ protected void cmdUpdate_OnClick(object sender, EventArgs e)
+ {
+ PortalController.UpdatePortalSetting(PortalId, "BB_TwitterToken",txtTwitterAccessToken.Text.Trim());
+ PortalController.UpdatePortalSetting(PortalId, "BB_TwitterTokenSecret", txtTwitterAccessTokenSecret.Text.Trim());
+ PortalController.UpdatePortalSetting(PortalId, "BB_TwitterConsumerKey", txtTwitterConsumerKey.Text.Trim());
+ PortalController.UpdatePortalSetting(PortalId, "BB_TwitterConsumerSecret", txtTwitterConsumerSecret.Text.Trim());
+ }
+ }
+}
\ No newline at end of file
diff --git a/EditCredentials.ascx.designer.cs b/EditCredentials.ascx.designer.cs
new file mode 100644
index 0000000..49c7436
--- /dev/null
+++ b/EditCredentials.ascx.designer.cs
@@ -0,0 +1,105 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Bitboxx.DNNModules.BBNews {
+
+
+ public partial class EditCredentials {
+
+ ///
+ /// lblIntro control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblIntro;
+
+ ///
+ /// lblTwitterConsumerKey control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.UserControl lblTwitterConsumerKey;
+
+ ///
+ /// txtTwitterConsumerKey control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtTwitterConsumerKey;
+
+ ///
+ /// lblTwitterConsumerSecret control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.UserControl lblTwitterConsumerSecret;
+
+ ///
+ /// txtTwitterConsumerSecret control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtTwitterConsumerSecret;
+
+ ///
+ /// lblTwitterAccessToken control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.UserControl lblTwitterAccessToken;
+
+ ///
+ /// txtTwitterAccessToken control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtTwitterAccessToken;
+
+ ///
+ /// lblTwitterAccessTokenSecret control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.UserControl lblTwitterAccessTokenSecret;
+
+ ///
+ /// txtTwitterAccessTokenSecret control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtTwitterAccessTokenSecret;
+
+ ///
+ /// cmdUpdate control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.LinkButton cmdUpdate;
+ }
+}
diff --git a/EditFeeds.ascx.cs b/EditFeeds.ascx.cs
index 9c42588..4116ce4 100644
--- a/EditFeeds.ascx.cs
+++ b/EditFeeds.ascx.cs
@@ -173,31 +173,26 @@ protected void cmdCancel_Click(object sender, EventArgs e)
protected void cboFeedType_SelectedIndexChanged(object sender, EventArgs e)
{
- //
switch (cboFeedType.SelectedValue)
{
case "0": // None
pnlFeedUrl.Visible = false;
pnlCredentials.Visible = false;
- //valFeedUrlValid.Enabled = false;
break;
case "1": // Twitter Search
pnlFeedUrl.Visible = true;
pnlCredentials.Visible = false;
lblFeedUrl.Text = Localization.GetString("lblFeedUrlTwitterSearch.Text", this.LocalResourceFile);
- //valFeedUrlValid.Enabled = false;
break;
case "2": // RSS
pnlFeedUrl.Visible = true;
pnlCredentials.Visible = false;
lblFeedUrl.Text = Localization.GetString("lblFeedUrlRss.Text", this.LocalResourceFile);
- //valFeedUrlValid.Enabled = true;
break;
case "3": // Twitter Usertimeline
pnlFeedUrl.Visible = true;
- pnlCredentials.Visible = true;
+ pnlCredentials.Visible = false;
lblFeedUrl.Text = Localization.GetString("lblFeedUrlTwitterTimeline.Text", this.LocalResourceFile);
- //valFeedUrlValid.Enabled = false;
break;
}
}
diff --git a/Installation/01.00.00.SqlDataProvider b/Installation/01.00.00.SqlDataProvider
index 104d151..34aa723 100644
--- a/Installation/01.00.00.SqlDataProvider
+++ b/Installation/01.00.00.SqlDataProvider
@@ -21,7 +21,7 @@ IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'{databaseOwne
)
ALTER TABLE {databaseOwner}[{objectQualifier}BBNews_Category]
- ADD CONSTRAINT {objectQualifier}PK_BBNews_Category PRIMARY KEY CLUSTERED (CategoryID ASC)
+ ADD CONSTRAINT PK_{objectQualifier}BBNews_Category PRIMARY KEY CLUSTERED (CategoryID ASC)
END
GO
@@ -38,7 +38,7 @@ IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'{databaseOwne
)
ALTER TABLE {databaseOwner}[{objectQualifier}BBNews_Feed]
- ADD CONSTRAINT {objectQualifier}PK_BBNews_Feed PRIMARY KEY CLUSTERED (FeedID ASC)
+ ADD CONSTRAINT PK_{objectQualifier}BBNews_Feed PRIMARY KEY CLUSTERED (FeedID ASC)
END
GO
@@ -57,20 +57,20 @@ IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'{databaseOwne
)
ALTER TABLE {databaseOwner}[{objectQualifier}BBNews_News]
- ADD CONSTRAINT {objectQualifier}PK_BBNews_News PRIMARY KEY CLUSTERED (NewsID ASC)
+ ADD CONSTRAINT PK_{objectQualifier}BBNews_News PRIMARY KEY CLUSTERED (NewsID ASC)
END
GO
IF NOT EXISTS (SELECT 1 FROM sys.foreign_keys where object_id = object_id(N'{objectQualifier}FK_Category_Feed') and parent_object_id = object_id(N'{databaseOwner}[{objectQualifier}BBNews_Feed]'))
ALTER TABLE {databaseOwner}[{objectQualifier}BBNews_Feed] WITH NOCHECK
- ADD CONSTRAINT {objectQualifier}FK_Category_Feed FOREIGN KEY ( CategoryID )
+ ADD CONSTRAINT FK_{objectQualifier}Category_Feed FOREIGN KEY ( CategoryID )
REFERENCES {databaseOwner}[{objectQualifier}BBNews_Category] ( CategoryID ) ON DELETE SET DEFAULT
GO
/*IF NOT EXISTS (SELECT 1 FROM sys.objects where name='{objectQualifier}FK_Category_News' and type='F')*/
IF NOT EXISTS (SELECT 1 FROM sys.foreign_keys where object_id = object_id(N'{objectQualifier}FK_Category_News') and parent_object_id = object_id(N'{databaseOwner}[{objectQualifier}BBNews_News]'))
ALTER TABLE {databaseOwner}[{objectQualifier}BBNews_News] WITH NOCHECK
- ADD CONSTRAINT {objectQualifier}FK_Category_News FOREIGN KEY ( CategoryID )
+ ADD CONSTRAINT FK_{objectQualifier}Category_News FOREIGN KEY ( CategoryID )
REFERENCES {databaseOwner}[{objectQualifier}BBNews_Category] ( CategoryID ) ON DELETE CASCADE
GO
diff --git a/Installation/01.01.00.SqlDataProvider b/Installation/01.01.00.SqlDataProvider
index 5fd0395..49203ee 100644
--- a/Installation/01.01.00.SqlDataProvider
+++ b/Installation/01.01.00.SqlDataProvider
@@ -15,11 +15,20 @@ ALTER TABLE {databaseOwner}[{objectQualifier}BBNews_Feed]
DROP CONSTRAINT [{objectQualifier}FK_Category_Feed]
go
+IF EXISTS (SELECT 1 FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[FK_{objectQualifier}Category_Feed]') AND parent_object_id = OBJECT_ID(N'{databaseOwner}[{objectQualifier}BBNews_Feed]'))
+ALTER TABLE {databaseOwner}[{objectQualifier}BBNews_Feed]
+DROP CONSTRAINT [FK_{objectQualifier}Category_Feed]
+go
+
IF EXISTS (SELECT 1 FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[{objectQualifier}FK_Category_News]') AND parent_object_id = OBJECT_ID(N'{databaseOwner}[{objectQualifier}BBNews_News]'))
ALTER TABLE {databaseOwner}[{objectQualifier}BBNews_News]
DROP CONSTRAINT [{objectQualifier}FK_Category_News]
go
+IF EXISTS (SELECT 1 FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[FK_{objectQualifier}Category_News]') AND parent_object_id = OBJECT_ID(N'{databaseOwner}[{objectQualifier}BBNews_News]'))
+ALTER TABLE {databaseOwner}[{objectQualifier}BBNews_News]
+DROP CONSTRAINT [FK_{objectQualifier}Category_News]
+go
IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'{databaseOwner}[{objectQualifier}TEMP_BBNews_Category]') AND type = 'U')
DROP TABLE {databaseOwner}[{objectQualifier}TEMP_BBNews_Category]
@@ -41,7 +50,7 @@ IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'{databaseOwne
CategoryID INT NOT NULL DEFAULT (0),
FeedID INT NOT NULL DEFAULT (0)
)
- CREATE CLUSTERED INDEX {objectQualifier}IDX_BBNews_CategoryFeeds_CategoryID ON {databaseOwner}[{objectQualifier}BBNews_CategoryFeeds] (CategoryID ASC, FeedID ASC)
+ CREATE CLUSTERED INDEX IDX_{objectQualifier}BBNews_CategoryFeeds_CategoryID ON {databaseOwner}[{objectQualifier}BBNews_CategoryFeeds] (CategoryID ASC, FeedID ASC)
END
GO
@@ -54,7 +63,7 @@ CREATE TABLE {databaseOwner}[{objectQualifier}TEMP_BBNews_Category]
CategoryDescription NVARCHAR(255) NOT NULL DEFAULT ''
)
ALTER TABLE {databaseOwner}[{objectQualifier}TEMP_BBNews_Category]
- ADD CONSTRAINT {objectQualifier}PK_TEMP_BBNews_Category PRIMARY KEY CLUSTERED (CategoryID ASC)
+ ADD CONSTRAINT PK_{objectQualifier}TEMP_BBNews_Category PRIMARY KEY CLUSTERED (CategoryID ASC)
go
SET IDENTITY_INSERT {databaseOwner}[{objectQualifier}TEMP_BBNews_Category] ON
@@ -72,7 +81,7 @@ BEGIN
SET IDENTITY_INSERT {databaseOwner}[{objectQualifier}TEMP_BBNews_Category] OFF
EXECUTE sp_rename '{databaseOwner}[{objectQualifier}TEMP_BBNews_Category]', '{objectQualifier}BBNews_Category', 'OBJECT'
- EXECUTE sp_rename '{objectQualifier}PK_TEMP_BBNews_Category', '{objectQualifier}PK_BBNews_Category', 'OBJECT'
+ EXECUTE sp_rename 'PK_{objectQualifier}TEMP_BBNews_Category', 'PK_{objectQualifier}BBNews_Category', 'OBJECT'
--ALTER TABLE {databaseOwner}[{objectQualifier}BBNews_Category]
--ADD CONSTRAINT {objectQualifier}PK_BBNews_Category PRIMARY KEY NONCLUSTERED (CategoryID ASC)
@@ -105,7 +114,7 @@ CREATE TABLE {databaseOwner}[{objectQualifier}TEMP_BBNews_Feed]
Password NVARCHAR(40) NOT NULL DEFAULT ''
)
ALTER TABLE {databaseOwner}[{objectQualifier}TEMP_BBNews_Feed]
- ADD CONSTRAINT {objectQualifier}PK_TEMP_BBNews_Feed PRIMARY KEY CLUSTERED (FeedID ASC)
+ ADD CONSTRAINT PK_{objectQualifier}TEMP_BBNews_Feed PRIMARY KEY CLUSTERED (FeedID ASC)
go
@@ -133,7 +142,7 @@ BEGIN
SET IDENTITY_INSERT {databaseOwner}[{objectQualifier}TEMP_BBNews_Feed] OFF
EXECUTE sp_rename '{databaseOwner}[{objectQualifier}TEMP_BBNews_Feed]', '{objectQualifier}BBNews_Feed', 'OBJECT'
- EXECUTE sp_rename '{objectQualifier}PK_TEMP_BBNews_Feed', '{objectQualifier}PK_BBNews_Feed', 'OBJECT'
+ EXECUTE sp_rename 'PK_{objectQualifier}TEMP_BBNews_Feed', 'PK_{objectQualifier}BBNews_Feed', 'OBJECT'
--ALTER TABLE {databaseOwner}[{objectQualifier}BBNews_Feed]
--ADD CONSTRAINT {objectQualifier}PK_BBNews_Feed PRIMARY KEY NONCLUSTERED (FeedID ASC)
@@ -163,7 +172,7 @@ CREATE TABLE {databaseOwner}[{objectQualifier}TEMP_BBNews_News]
Internal BIT NOT NULL
)
ALTER TABLE {databaseOwner}[{objectQualifier}TEMP_BBNews_News]
- ADD CONSTRAINT {objectQualifier}PK_TEMP_BBNews_News PRIMARY KEY CLUSTERED (NewsID ASC)
+ ADD CONSTRAINT PK_{objectQualifier}TEMP_BBNews_News PRIMARY KEY CLUSTERED (NewsID ASC)
go
@@ -184,7 +193,7 @@ BEGIN
SET IDENTITY_INSERT {databaseOwner}[{objectQualifier}TEMP_BBNews_News] OFF
EXECUTE sp_rename '{databaseOwner}[{objectQualifier}TEMP_BBNews_News]', '{objectQualifier}BBNews_News', 'OBJECT'
- EXECUTE sp_rename '{objectQualifier}PK_TEMP_BBNews_News', '{objectQualifier}PK_BBNews_News', 'OBJECT'
+ EXECUTE sp_rename 'PK_{objectQualifier}TEMP_BBNews_News', 'PK_{objectQualifier}BBNews_News', 'OBJECT'
--ALTER TABLE {databaseOwner}[{objectQualifier}BBNews_News]
--ADD CONSTRAINT {objectQualifier}PK_BBNews_News PRIMARY KEY NONCLUSTERED (NewsID ASC)
@@ -198,27 +207,27 @@ BEGIN
END
go
-IF NOT EXISTS (SELECT 1 FROM sys.objects where name='{objectQualifier}FK_CategoryFeedsOfCategory' and type='F')
+IF NOT EXISTS (SELECT 1 FROM sys.objects where name='FK_{objectQualifier}CategoryFeedsOfCategory' and type='F')
ALTER TABLE {databaseOwner}[{objectQualifier}BBNews_CategoryFeeds] WITH NOCHECK
- ADD CONSTRAINT {objectQualifier}FK_CategoryFeedsOfCategory FOREIGN KEY
+ ADD CONSTRAINT FK_{objectQualifier}CategoryFeedsOfCategory FOREIGN KEY
( CategoryID )
REFERENCES {databaseOwner}[{objectQualifier}BBNews_Category]
( CategoryID )
ON DELETE CASCADE
go
-IF NOT EXISTS (SELECT 1 FROM sys.objects where name='{objectQualifier}FK_NewsOfFeed' and type='F')
+IF NOT EXISTS (SELECT 1 FROM sys.objects where name='FK_{objectQualifier}NewsOfFeed' and type='F')
ALTER TABLE {databaseOwner}[{objectQualifier}BBNews_News] WITH NOCHECK
- ADD CONSTRAINT {objectQualifier}FK_NewsOfFeed FOREIGN KEY
+ ADD CONSTRAINT FK_{objectQualifier}NewsOfFeed FOREIGN KEY
( FeedID )
REFERENCES {databaseOwner}[{objectQualifier}BBNews_Feed]
( FeedID )
ON DELETE CASCADE
go
-IF NOT EXISTS (SELECT 1 FROM sys.objects where name='{objectQualifier}FK_FeedsOfCategoryFeeds' and type='F')
+IF NOT EXISTS (SELECT 1 FROM sys.objects where name='FK_{objectQualifier}FeedsOfCategoryFeeds' and type='F')
ALTER TABLE {databaseOwner}[{objectQualifier}BBNews_CategoryFeeds] WITH NOCHECK
- ADD CONSTRAINT {objectQualifier}FK_FeedsOfCategoryFeeds FOREIGN KEY
+ ADD CONSTRAINT FK_{objectQualifier}FeedsOfCategoryFeeds FOREIGN KEY
( FeedID )
REFERENCES {databaseOwner}[{objectQualifier}BBNews_Feed]
( FeedID )
diff --git a/Installation/Attributes.cs b/Installation/Attributes.cs
index 8813d7e..813de2e 100644
--- a/Installation/Attributes.cs
+++ b/Installation/Attributes.cs
@@ -4,6 +4,66 @@ namespace DNNtc
{
#region Attributes
+
+ ///
+ /// This class is used to set information about the package
+ ///
+ [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
+ public class PackageProperties : Attribute
+ {
+ ///
+ /// 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
+ public PackageProperties(string name, int viewOrder, string friendlyName, string description, string iconFile, string ownerName, string ownerOrganization, string ownerUrl, string ownerEmail, bool azureCompatible)
+ {
+ //Intentially left empty
+ }
+ ///
+ /// Creates a attribute with the right properties to create a package. Use on other elements
+ ///
+ ///
The package name
+ public PackageProperties(string name)
+ {
+ //Intentially left empty
+ }
+ }
+
+ ///
+ /// This class is used to set information about the module
+ ///
+ [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
+ public class ModuleProperties : Attribute
+ {
+ ///
+ /// 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.
+ public ModuleProperties(string name, string friendlyname, int defaultCacheTime)
+ {
+ //Intentially left empty
+ }
+ ///
+ /// Creates a attribute with the right properties to create a module. Use on other elements
+ ///
+ ///
The module name.
+ public ModuleProperties(string name)
+ {
+ //Intentially left empty
+ }
+ }
+
///
/// This class is used to indicate which UserControls should be in the install package
///
@@ -18,7 +78,7 @@ public class ModuleControlProperties : Attribute
///
The help URL.
///
if set to
true [supports partial rendering].
///
if set to
true [supports pop ups].
- public ModuleControlProperties(string key, string title, ControlType userControlType, string helpUrl, bool supportsPartialRendering=false, bool supportsPopUps=false)
+ public ModuleControlProperties(string key, string title, ControlType userControlType, string helpUrl, bool supportsPartialRendering = false, bool supportsPopUps = false)
{
//Intentially left empty
}
diff --git a/Installation/Project.targets b/Installation/Project.targets
index 62cb58c..f18604d 100644
--- a/Installation/Project.targets
+++ b/Installation/Project.targets
@@ -1,4 +1,4 @@
-
+
@@ -8,18 +8,16 @@
@@ -33,29 +31,26 @@
-
-
- bitboxx solutions
- http://www.bitboxx.net
- info@bitboxx.net
-
+
$(MSBuildProjectDirectory)\bin
- Bitboxx.BBNews
- BBNews
- Bitboxx BBNews
-
+ Bitboxx.BBNews
+ BBNews
bbnews.png
- A flexible RSS/News reader, provider and aggregator
true
- -1
-
+
+
+
+
+
@@ -63,7 +58,7 @@
$(MSBuildProjectDirectory)\Installation
- $(InstallDir)\$(ModuleName).dnn6
+ $(InstallDir)\$(ZipFileNamePrefix).dnn
@@ -93,32 +88,42 @@
-
+ File="%(AssemblyInfoFiles.FullPath)" >
+
-
-
-
+
+
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -133,108 +138,30 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -262,7 +189,7 @@
-
+
@@ -347,7 +274,8 @@
$(MSBuildProjectDirectory)\*ReSharper*\**;
$(MSBuildProjectDirectory)\Installation\*.png;
$(MSBuildProjectDirectory)\tmpCompressScript\**;
- $(MSBuildProjectDirectory)\tmpCompressCSS\**"
+ $(MSBuildProjectDirectory)\tmpCompressCSS\**;
+ @(ProjectsToExclude)"
Include="$(MSBuildProjectDirectory)\**\*.ascx;
$(MSBuildProjectDirectory)\**\*.aspx;
$(MSBuildProjectDirectory)\**\*.css;
@@ -358,7 +286,12 @@
$(MSBuildProjectDirectory)\**\*.gif;
$(MSBuildProjectDirectory)\**\*.jpg;
$(MSBuildProjectDirectory)\**\*.png;
- $(MSBuildProjectDirectory)\**\*.js;">
+ $(MSBuildProjectDirectory)\**\*.js;
+ $(MSBuildProjectDirectory)\**\*.template;
+ $(MSBuildProjectDirectory)\**\*.htm;
+ $(MSBuildProjectDirectory)\**\*.htp;
+
+ ">
@@ -404,7 +337,7 @@
+ ZipFileName="$(InstallDir)\$(ZipFileNamePrefix)_$(FileMajor).$(FileMinor).$(FileBuild)_Install.zip" />
@@ -445,8 +378,6 @@
-
-
-
@@ -493,7 +424,7 @@
+ ZipFileName="$(InstallDir)\Resources.zip" />
@@ -510,16 +441,14 @@
+ ZipFileName="$(InstallDir)\$(ZipFileNamePrefix)_$(FileMajor).$(FileMinor).$(FileBuild)_Source.zip" />
-
-
+
diff --git a/Installation/ReleaseNotes/Release.01.01.04.txt b/Installation/ReleaseNotes/Release.01.01.04.txt
index 33c771a..2497c05 100644
--- a/Installation/ReleaseNotes/Release.01.01.04.txt
+++ b/Installation/ReleaseNotes/Release.01.01.04.txt
@@ -4,10 +4,15 @@
- Fixed some errors in the UI (DNN Form Pattern)
- Fixed a bug not showing the correct favicon
- - Fixed an error which occured while retrieving some RSS feeds (e.g. blogs-feed on dotnetnuke.com).
-
-
- Fixed an error with ambiguous NewsId when opening "Manage BBNews".
-
+
- Fixed an error which occured while retrieving some RSS feeds (e.g. blogs-feed on dotnetnuke.com).
+ - Fixed an error with ambiguous NewsId when opening "Manage BBNews".
+ - RSS icon has wrong path if DNN is installed in subdirectory
+ - Added some error tolerance to parsing of RSS feeds
+ - Added default values for settings "NewsInRow" and "RowsPerPage" to avoid error message if these are not set
ENHANCEMENTS
- - Added a class ("bbNewsCell") to the news area for better styling
+ - Upgraded twitter integration to API 1.1 with oAuth (needs creation of app on https://dev.twitter.com/apps).
+ - Added a class ("bbNewsCell") to the news area for better styling
+ - Upgraded package mechanism to dnntcmsbuild V 2.0
\ No newline at end of file
diff --git a/Installation/bbnews.png b/Installation/bbnews.png
new file mode 100644
index 0000000..70dc566
Binary files /dev/null and b/Installation/bbnews.png differ
diff --git a/Settings.ascx.cs b/Settings.ascx.cs
index 96a2b5c..5829581 100644
--- a/Settings.ascx.cs
+++ b/Settings.ascx.cs
@@ -40,7 +40,9 @@ namespace Bitboxx.DNNModules.BBNews
///
///
/// -----------------------------------------------------------------------------
- [DNNtc.ModuleControlProperties("Settings", "Configure settings", DNNtc.ControlType.Edit, "", true, true)]
+ [DNNtc.PackageProperties("Bitboxx.BBNews")]
+ [DNNtc.ModuleProperties("Bitboxx.BBNews")]
+ [DNNtc.ModuleControlProperties("Settings", "Configure settings", DNNtc.ControlType.Edit, "", true, true)]
partial class Settings : ModuleSettingsBase
{
private BBNewsController _controller;
diff --git a/Templates/News/Twitter.htm b/Templates/News/Twitter.htm
index 39af816..80b68be 100644
--- a/Templates/News/Twitter.htm
+++ b/Templates/News/Twitter.htm
@@ -1,5 +1,5 @@
\ No newline at end of file
diff --git a/Templates/News/Twitter.jpg b/Templates/News/Twitter.jpg
index 766d08b..d4ac500 100644
Binary files a/Templates/News/Twitter.jpg and b/Templates/News/Twitter.jpg differ
diff --git a/View.ascx.cs b/View.ascx.cs
index 166b8e0..826a771 100644
--- a/View.ascx.cs
+++ b/View.ascx.cs
@@ -24,6 +24,7 @@
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.IO;
+using System.Linq;
using System.ServiceModel.Syndication;
using System.Text;
using System.Web.UI;
@@ -43,7 +44,9 @@
namespace Bitboxx.DNNModules.BBNews
{
- [DNNtc.ModuleDependencies(DNNtc.ModuleDependency.CoreVersion, "06.01.00")]
+ [DNNtc.PackageProperties("Bitboxx.BBNews", 1, "Bitboxx BBNews", "A flexible RSS/News reader, provider and aggregator", "bbnews.png", "Torsten Weggen", "bitboxx solutions", "http://www.bitboxx.net", "info@bitboxx.net", true)]
+ [DNNtc.ModuleProperties("Bitboxx.BBNews", "Bitboxx BBNews", -1)]
+ [DNNtc.ModuleDependencies(DNNtc.ModuleDependency.CoreVersion, "06.01.00")]
[DNNtc.ModuleControlProperties("", "Bitboxx.BBNews", DNNtc.ControlType.View,"", true, false)]
partial class View : PortalModuleBase,IActionable
{
@@ -84,7 +87,7 @@ public int TopN
{
get
{
- int _topN = 1;
+ int _topN = 0;
if (Settings["TopN"] != null)
Int32.TryParse((string)Settings["TopN"], out _topN);
return _topN;
@@ -191,25 +194,26 @@ protected void Page_Init(object sender, System.EventArgs e)
if (user.IsInRole("Administrator") && IsEditable)
MultiView1.Visible = true;
- if (Settings["NewsInRow"] != null)
- {
- if (ViewIndex == 0)
- {
- newsInRow = Int32.Parse((string)Settings["NewsInRow"]);
- rowsPerPage = Int32.Parse((string)Settings["RowsPerPage"]);
- lstNews.GroupItemCount = newsInRow;
- Pager.PageSize = newsInRow * rowsPerPage;
- }
- MultiView1.ActiveViewIndex = ViewIndex;
- IsConfigured = true;
- }
-
- if (Settings["NewsInRow"] == null)
- {
- string message = Localization.GetString("Configure.Message", this.LocalResourceFile);
- DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, message, ModuleMessage.ModuleMessageType.YellowWarning);
- }
- if (Settings["TemplateName"] == null && Settings["Template"] != null )
+ if (Settings["NewsInRow"] != null)
+ {
+ newsInRow = 1;
+ rowsPerPage = 5;
+ if (ViewIndex == 0)
+ {
+ Int32.TryParse((string) Settings["NewsInRow"], out newsInRow);
+ Int32.TryParse((string) Settings["RowsPerPage"], out rowsPerPage);
+ lstNews.GroupItemCount = newsInRow;
+ Pager.PageSize = newsInRow*rowsPerPage;
+ }
+ MultiView1.ActiveViewIndex = ViewIndex;
+ IsConfigured = true;
+ }
+ else
+ {
+ string message = Localization.GetString("Configure.Message", this.LocalResourceFile);
+ DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, message, ModuleMessage.ModuleMessageType.YellowWarning);
+ }
+ if (Settings["TemplateName"] == null && Settings["Template"] != null )
{
var ctrl = LoadControl("controls\\TemplateControl.ascx") as Controls.TemplateControl;
ctrl.Key = "News";
@@ -367,7 +371,7 @@ protected void Page_Prerender(object sender, EventArgs e)
{
int position = Convert.ToInt32(Settings["ShowRss"]);
Control rssIconCtrl = ParseControl("");
+ "\">");
switch (position)
{
case 1:
@@ -455,7 +459,7 @@ private SyndicationFeed CreateFeed()
//feed.Description = new TextSyndicationContent(category.CategoryDescription);
List items = new List();
- foreach (NewsInfo news in AllNews)
+ foreach (NewsInfo news in AllNews.Take(10).OrderByDescending(n => n.Pubdate))
{
if (news.Internal && Settings["NewsPage"] != null)
{