Skip to content

Commit 7a4294a

Browse files
committedJan 26, 2015
initial commit
0 parents  commit 7a4294a

File tree

5 files changed

+258
-0
lines changed

5 files changed

+258
-0
lines changed
 

‎ActionForm.DnnJournal.csproj

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{066A5270-A33F-4AA4-8608-8920515AA674}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>ActionForm.DnnJournal</RootNamespace>
11+
<AssemblyName>ActionForm.DnnJournal</AssemblyName>
12+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<TargetFrameworkProfile />
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>..\..\..\..\..\bin\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<PropertyGroup>
36+
<StartupObject />
37+
</PropertyGroup>
38+
<ItemGroup>
39+
<Reference Include="DotNetNuke">
40+
<HintPath>..\..\!Dependencies\dnn620\DotNetNuke.dll</HintPath>
41+
<Private>False</Private>
42+
</Reference>
43+
<Reference Include="System" />
44+
<Reference Include="System.Core" />
45+
<Reference Include="System.Xml.Linq" />
46+
<Reference Include="System.Data.DataSetExtensions" />
47+
<Reference Include="System.Data" />
48+
<Reference Include="System.Xml" />
49+
</ItemGroup>
50+
<ItemGroup>
51+
<Compile Include="PostToJournal.cs" />
52+
<Compile Include="Properties\AssemblyInfo.cs" />
53+
</ItemGroup>
54+
<ItemGroup>
55+
<None Include="ActionForm.DnnJournal.dnn" />
56+
<None Include="Config\Actions\dnnjournal.config" />
57+
</ItemGroup>
58+
<ItemGroup>
59+
<ProjectReference Include="..\..\avt.ActionForm.Core\avt.ActionForm.Core.csproj">
60+
<Project>{aa96fb7b-ea1f-4207-9117-8a418c74c3ad}</Project>
61+
<Name>avt.ActionForm.Core</Name>
62+
</ProjectReference>
63+
</ItemGroup>
64+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
65+
<PropertyGroup>
66+
<PostBuildEvent>xcopy "$(ProjectDir)Config\*.*" "$(SolutionDir)Config\*.*" /e /s /y /q</PostBuildEvent>
67+
</PropertyGroup>
68+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
69+
Other similar extension points exist, see Microsoft.Common.targets.
70+
<Target Name="BeforeBuild">
71+
</Target>
72+
<Target Name="AfterBuild">
73+
</Target>
74+
-->
75+
</Project>

‎ActionForm.DnnJournal.dnn

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<dotnetnuke version="5.0" type="Package" xmlns:fo="http://www.w3.org/1999/XSL/Format">
2+
<packages>
3+
<package name="ActionForm.DnnJournal" type="Module" version="01.00.03">
4+
<friendlyName>ActionForm.DnnPageActions</friendlyName>
5+
<description>Integrates with DNN Journal.</description>
6+
<iconFile>images/icon_dashboard.png</iconFile>
7+
8+
<owner>
9+
<name>DNN Sharp</name>
10+
<organization>DNN Sharp</organization>
11+
<url>http://www.dnnsharp.com/dnn/modules/action-form-builder/page-actions</url>
12+
<email>support@dnnsharp.com</email>
13+
</owner>
14+
15+
<dependencies>
16+
<dependency type="CoreVersion">06.02.00</dependency>
17+
<dependency type="Package">Action Form</dependency>
18+
</dependencies>
19+
20+
<components>
21+
22+
<component type="ResourceFile">
23+
<resourceFiles>
24+
<basePath>/</basePath>
25+
<resourceFile>
26+
<name>Resources.zip</name>
27+
</resourceFile>
28+
</resourceFiles>
29+
</component>
30+
31+
</components>
32+
</package>
33+
</packages>
34+
</dotnetnuke>

‎Config/Actions/dnnjournal.config

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Actions>
3+
4+
<Action>
5+
<Id>PostToJournal</Id>
6+
<Title>
7+
<Item key="default">Post to DNN Journal</Item>
8+
</Title>
9+
<HelpText>
10+
<Item key="default">
11+
This action will post a messge to DNN journal.
12+
</Item>
13+
</HelpText>
14+
<Settings>
15+
<Group>Dnn</Group>
16+
</Settings>
17+
<TypeStr>ActionForm.DnnJournal.PostToJournal, ActionForm.DnnJournal</TypeStr>
18+
19+
<Parameter>
20+
<Id>UserId</Id>
21+
<Title>
22+
<Item key="default">User ID</Item>
23+
</Title>
24+
<HelpText>
25+
<Item key="default">
26+
Post on this user wall. Leave blank to default to current user. Supports form tokens and <a href="http://www.dnnsharp.com/dnn/modules/my-custom-tokens" target="_blank" tabindex="-1">My Tokens</a>.
27+
</Item>
28+
</HelpText>
29+
<Type>Text</Type>
30+
</Parameter>
31+
32+
<Parameter>
33+
<Id>Message</Id>
34+
<Title>
35+
<Item key="default">Message</Item>
36+
</Title>
37+
<HelpText>
38+
<Item key="default">
39+
The message to post.
40+
Supports form tokens and <a href="http://www.dnnsharp.com/dnn/modules/my-custom-tokens" target="_blank" tabindex="-1">My Tokens</a>.
41+
</Item>
42+
</HelpText>
43+
<Type>RichText</Type>
44+
</Parameter>
45+
46+
</Action>
47+
48+
</Actions>

‎PostToJournal.cs

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
using avt.ActionForm;
2+
using avt.ActionForm.Core.Actions;
3+
using avt.ActionForm.Core.DnnSf;
4+
using avt.ActionForm.Core.Form;
5+
using avt.ActionForm.Core.Form.Result;
6+
using DotNetNuke.Entities.Users;
7+
using DotNetNuke.Services.Journal;
8+
using System.Linq;
9+
10+
namespace ActionForm.DnnJournal
11+
{
12+
public class PostToJournal : IAction
13+
{
14+
public string Message { get; set; }
15+
public string UserId { get; set; }
16+
17+
18+
public void Init(ActionInfo actionInfo, SettingsDictionary settings)
19+
{
20+
Message = settings.GetValue("Message", "");
21+
UserId = settings.GetValue("UserId", "");
22+
}
23+
24+
public IFormEventResult Execute(ActionFormSettings settings, FormData data, eActionContext context)
25+
{
26+
var message = data.ApplyAllTokens(Message);
27+
if (string.IsNullOrEmpty(message))
28+
return null;
29+
30+
var strUserId = data.ApplyAllTokens(UserId);
31+
var userId = UserController.GetCurrentUserInfo().UserID;
32+
if (!string.IsNullOrEmpty(strUserId))
33+
int.TryParse(strUserId, out userId);
34+
35+
string objectKey = null;// Constants.ContentTypeName + "_" + Constants.JournalVoteTypeName + "_" + string.Format("{0}:{1}", objPost.ModuleID, voteId);
36+
var ji = JournalController.Instance.GetJournalItemByKey(settings.PortalId, objectKey);
37+
if ((ji != null))
38+
JournalController.Instance.DeleteJournalItemByKey(settings.PortalId, objectKey);
39+
40+
41+
var colJournalTypes = (from t in JournalController.Instance.GetJournalTypes(settings.PortalId)
42+
where t.JournalType == "status"
43+
select t.JournalTypeId).SingleOrDefault();
44+
45+
ji = new JournalItem {
46+
PortalId = settings.PortalId,
47+
ProfileId = userId,
48+
UserId = userId,
49+
ContentItemId = -1,
50+
Title = "",
51+
ItemData = null, //new ItemData { Url = url },
52+
Summary = message,
53+
Body = null,
54+
JournalTypeId = colJournalTypes,
55+
ObjectKey = objectKey,
56+
SecuritySet = "E,"
57+
};
58+
59+
JournalController.Instance.SaveJournalItem(ji, settings.TabId);
60+
61+
return null;
62+
}
63+
64+
}
65+
}

‎Properties/AssemblyInfo.cs

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("ActionForm.DnnJournal")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("ActionForm.DnnJournal")]
13+
[assembly: AssemblyCopyright("Copyright © 2014")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("34e00889-c67b-4b79-b8f3-c9c91b79a67f")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)
Please sign in to comment.