comments module in dotnetnuke - dotnetnuke

Is there any comments module in Dotnetnuke that can work with the journal module? I mean, if a user comments on a page, the journal module on his profile displays that this user has commented on this page? Or, could there be an item having a link to that page? Just like we have in facebook? I hope you understand my question.

There is no such module. You would have to write your own
This is some sample code from the upcoming Announcements module:
public static void AddAnnouncementToJournal(AnnouncementInfo announcement, int tabId)
{
JournalItem item2 = new JournalItem
{
PortalId = announcement.PortalID,
ProfileId = announcement.LastModifiedByUserID,
UserId = announcement.LastModifiedByUserID,
ContentItemId = announcement.ContentItemID,
Title = announcement.Title
};
ItemData data = new ItemData
{
Url = announcement.Permalink()
};
item2.ItemData = data;
item2.Summary = HtmlUtils.Shorten(HtmlUtils.Clean(System.Web.HttpUtility.HtmlDecode(announcement.Description), false), 250, "...");
item2.Body = null;
item2.JournalTypeId = 33;
item2.SecuritySet = "E,";
JournalItem journalItem = item2;
JournalController.Instance.SaveJournalItem(journalItem, tabId);
}
Important to note: you need to define your own JournalType (in the sample above, this is not fully implemented yet, and using a hard coded value of 33). Basically, what you need is a new record in the JournalTypes table, defining your own journalType

Related

Select urls from Typo3 Database via Typoscript query

First my goal: I want to create a list with links to internal pages. This list has to be ordered by creation date (crdate in the DB)
To achieve this, I wrote the following code:
99 = CONTENT
99.table = pages
99.select {
pidInList = root,-1
selectFields = url
orderBy = crdate
}
Sadly, this returns nothing.
For debugging I played with the different properties.
With
99 = CONTENT
99.table = tt_content
99.select {
pidInList = 1
orderBy = crdate
}
I cloned my rootpage. I got all records from it.
So I know that all page records should be stored in the Pages table with the url.
What am I doing wrong here?
Additional information: Typo3 8.7, no the default backend elements are not working for me, yes I have to do it in typoscript
Thanks in advance for any suggestions.
The field url in the pages record does not hold the url from that page in general.
It is used only for pages of type external URL, so the internal link to this page can be forwarded to that url.
If you want a link list of all your pages you need to create a link to these pages:
99 = CONTENT
99 {
table = pages
select {
// your selection here
}
renderObj = TEXT
renderObj {
typolink {
parameter.field = uid
}
}
}
This will give you a list (if wrapping the renderObj with <li>|</li>) of complete links with page title as link text.
If you want only urls you can add:
typolink {
returnLast = url
}
Without wrapping it will be a long string without separation.
EDIT:
99 = CONTENT
99 {
table = pages
select {
pidInList = 69
orderBy = crdate desc
}
wrap = <ul>|</ul>
renderObj = TEXT
renderObj {
wrap = <li>|</li>
typolink {
parameter.field = uid
}
if.isFalse.cObject = CONTENT
if.isFalse.cObject {
table = pages
select {
// this 'uid' is from context of current pages record we have selected above
pidInList.field = uid
// this 'uid' is the field from the records we are selecting here
selectFields = uid
}
renderObj = TEXT
// this 'uid' is the selected field above
// a field in the pages record of the subquery to decide if there are child pages
renderObj.field = uid
# renderObj.wrap = |,
}
}
}

Cannot link to a webpart on SPO page with certain parameters

I have created a hyperlink which opens up a modal that shows a specific item from a SharePoint Online list.
Here's what I've got so far (with help from AmosWu!):
private _filterListOnEmail = () => { //this runs on componentdidmount
var urlParams = new URLSearchParams(window.location.search);
var urlParamstoString = urlParams.toString();
var justUrl = window.location.href;
var trimHref = justUrl.split('&')[0];
var trimHref2 = trimHref.substring(trimHref.indexOf("=") + 1);
var txtUrlParams = urlParams.toString();
var trimtxtUrlParams = txtUrlParams.substring(3);
this.setState({
urlParams: trimHref2
}, () => {
if(urlParamstoString){
this.setState({
showWelcomeModal: true,
ByEmail: 'Yes',
});
}
The URL I have constructed:
<a href={`https://mytenant.sharepoint.com/sites/MySite?ID=${this.props.id}`}>Here</a>
This works if the URL is https://mytenant.sharepoint.com/sites/MySite?ID=1 and it shows my modal and it gets the correct ID and shows the correct list item. But if it's ID=2 or any other number, the page shows No item exists at
https://mytenant.sharepoint.com/sites/MySite/SitePages/Home.aspx?ID=2
I don't understand why it's putting the extra SitePages/Home.aspx on the end....I guess this is causing the No item exists error.
The webpart is on the home page of the SP site.
It works with any ID number in workbench but not when deployed.
Really need help with this.
My test result:
I show the editform in the modal, it works well.
The code is the code I shared with you in Q&A. If you need the complete project code, please let me know and I will share it on Github.

find out duplicate entry while editing the person name information in angular

I can create people information with their b'date using add button. It get displayed top of the page. If i want to edit information, I again click on that information and edit it easily. I need one validation there that i should not choose bday.name(person name) duplicate. e.q. if i already have "peter" person so i can't edit and change any other person name to "peter". so need to avoid duplicate entry in list.
plunker: http://plnkr.co/edit/2UFfaG?p=preview
$scope.newBirthday = function(){
$scope.bdays.push({name:$scope.bdayname, date:$scope.bdaydate});
$scope.bdayname = '';
$scope.bdaydate = '';
};
here is a simple solution using only angular js :
$scope.newBirthday = function(){
var exist=false;
angular.forEach($scope.bdays, function(bday) {
if(bday.name===$scope.bdayname){
exist=true;
bday.date=angular.copy($scope.bdaydate);
}
});
if(!exist){
$scope.bdays.push({name:$scope.bdayname, date:$scope.bdaydate});
}
$scope.bdayname = '';
$scope.bdaydate = '';
};

Augmenting controller with events

I am currently writing a single page web application for a parties producing company.
My goal is to create an "Office like" application that will allow the users to open a new "party document " and edit it.
Each document will have a lot of "content pages" (like food , utilities, attractions ,suppliers etc...) and in each page there will be many fields.
Each field will have it own restrictions that should occure when it is being added , removed or edited.
I wanted to make a base JavaScript object that all other fields object will inherit from . It looks like this :
`
function RootComponent(name,value){
this.name = name;
this.value = null;
// Logic restrictions methods
this.onChange = null;
this.afterChange = null;
this.onCheck = null;
this.onDelete = null;
this.afterDelete = null;
this.onAdd = null;
// Ensure we got value
if (value !== undefined){
this.value = value;
}
}
`
My question is how should I augment the events of "OnChange" and such with Angular's $watch system.

Problem with WPF perfomance

I have form which has many tabs. Every tab has many controls textboxes, comboboxes, datagrids and e .t.c. I bind form to one data source in such way
this.DataContext=MyClassInstance
But with this way my form opening very slow. about one minute.
When I comment above code, form opens very quickly. All My controls I bound to the class properties in XAML. Please tell me the way to bind every tab when it's activated, or bind controls in background thread or any other idea which can help me to speed up my form.
Thanks in advance.
I think the problem lies in your class instance you are binding to.
When the xaml is bound to the class, all the getters of the bound properties are fired. If each getter accesses the database to get some data, this can take a while.
I think you should really review your design here, and think about asynchronously fetching your data.
I agree with Gerrie.
I'm suggesting the following:
When you start your application, you automatically open one tab i guess. Load only that tab, don't care about the others. This should start your project much faster.
The thing you do for the other tabs is load them when clicked for the first time. When the user for example is interested in tab 5, the only ones loading will be the initial tab at startup, and tab 5 when clicked by the user. all other tabs will not be loaded, which will decrease startup time.
Hope the idea is clear to you and will help your application.
I found why my form open so slow. I use about 20 XMLDataProvider object in form. and this providers were iteract with xml file. When I comment code below everything working fast. Thank everyone for help
//relatives_xdp = new XmlDataProvider() { Source = uri, XPath = "Config/ColumnsVisibility/Person_RelativeList" };
//education_xdp = new XmlDataProvider() { Source = uri, XPath = "Config/ColumnsVisibility/Person_EducationList" };
//requalification_xdp = new XmlDataProvider() { Source = uri, XPath = "Config/ColumnsVisibility/Person_RequalificationList" };
//jobHistory_xdp = new XmlDataProvider() { Source = uri, XPath = "Config/ColumnsVisibility/Person_JobHistoryList" };
//rank_xdp = new XmlDataProvider() { Source = uri, XPath = "Config/ColumnsVisibility/Person_RankList" };
//tradeUnion_xdp = new XmlDataProvider() { Source = uri, XPath = "Config/ColumnsVisibility/Person_TradeUnionList" };
//election_xdp = new XmlDataProvider() { Source = uri, XPath = "Config/ColumnsVisibility/Person_ElectionList" };
//judgeHistory_xdp = new XmlDataProvider() { Source = uri, XPath = "Config/ColumnsVisibility/Person_JudgeHistoryList" };
//tempWork_xdp = new XmlDataProvider() { Source = uri, XPath = "Config/ColumnsVisibility/Person_TempWorkList" };
//inquire_xdp = new XmlDataProvider() { Source = uri, XPath = "Config/ColumnsVisibility/Person_InquireList" };
//bulleten_xdp = new XmlDataProvider() { Source = uri, XPath = "Config/ColumnsVisibility/Person_BulletenList" };
//reprimand_xdp = new XmlDataProvider() { Source = uri, XPath = "Config/ColumnsVisibility/Person_ReprimandList" };
//certificate_xdp = new XmlDataProvider() { Source = uri, XPath = "Config/ColumnsVisibility/Person_CertificateList" };
//course_xdp = new XmlDataProvider() { Source = uri, XPath = "Config/ColumnsVisibility/Person_CourceList" };
//incentive_xdp = new XmlDataProvider() { Source = uri, XPath = "Config/ColumnsVisibility/Person_IncentiveList" };
//btrip_xdp = new XmlDataProvider() { Source = uri, XPath = "Config/ColumnsVisibility/Person_BtripList" };
//vacation_xdp = new XmlDataProvider() { Source = uri, XPath = "Config/ColumnsVisibility/Person_VacationList" };
//pass_xdp = new XmlDataProvider() { Source = uri, XPath = "Config/ColumnsVisibility/Person_PassList" };
//language_xdp = new XmlDataProvider() { Source = uri, XPath = "Config/ColumnsVisibility/Person_LanguageList" };

Resources