Select the search type
  • Site
  • Web
Search
You are here:  Support/Forums
Support

Bring2mind Forums

What's New add-on
Last Post 09/28/2010 9:25 PM by Peter Donker. 6 Replies.
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
maoz
New Member
New Member
Posts:14


--
06/17/2010 4:49 PM

The What's new add-on displays the latest files per selected categories.

Can a folder be selected to filter only the files under this folder and sub-folders?

We do not want to list files from the whole repository, just under one of the folders.

Thanks.

Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
06/18/2010 11:15 AM
Hi Maoz,

The WhatsNew does not include that feature but you could use RSS for this as well. Note every DMX can be told to emit RSS. This is subject to the same parameters as the DMX it is from, so folder and category. This can then be used throughout the site and elsewhere.

Alternatively you can take the source code from the WhatsNew and tweak it yourself.

Peter
Chrickel
New Member
New Member
Posts:44


--
07/19/2010 1:37 PM
There's quite an easy way to handle this demand (in fact, we had the same demand for this feature and it's working perfectly):


Open an SQL console.

Find out the path of your desired folder stored in the database like:

select e.path from DMX_Entries e
inner join DMX_ShortTexts s
on e.EntryId = s.ObjectId

where s.Text='thenameofyourfolder'

Copy the path (it should look like "0;193;264;17013;") to the clipboard or just memorize it ;-)


Now, enter the settings of the What's New module and append this to the row filter:

AND Path like '0;193;264;17013;%'


Now you only see entries of this folder and its subfolders.

Good luck!

-Chris
maoz
New Member
New Member
Posts:14


--
09/21/2010 2:29 PM

 Thank you Chris.

We have implemented your suggestion in the What's New add-on and it works.

We now have a strange problem.
when we set "number of items" to 100 it works.
When we set it to 10 it fails - An error has occurred. Error loading What's New.
If we are logged-in as Admin it works ok with top 10.
Further investigation of the SQL statement (take from log \Portals\_default\DMX\Log)
reveals that it if we execute the sql with "TOP 10" it runs for more than 20 seconds.
If we execute with "TOP 100" it returns very quickly.
The module probably fails on time-out.
I cann't see why TOP 10 takes so much longer than TOP 100.

We use row filter:

Deleted=0 AND IsApproved=1 AND (Not EntryType LIKE '%Collection%') AND ISNULL((SELECT [Text] FROM {databaseOwner}{objectQualifier}DMX_ShortTexts WHERE TypeKey='ENT' AND SubTypeKey='TITLE' AND ObjectId=e.EntryId AND Locale='en-US'), (SELECT [Text] FROM {databaseOwner}{objectQualifier}DMX_ShortTexts WHERE TypeKey='ENT' AND SubTypeKey='TITLE' AND ObjectId=e.EntryId AND Locale='')) NOT LIKE '' AND ([Path] like '0;1;5;10230;%' )

We have total of 16,000 records in the DMX Entries table.
The what's new query (without TOP 10)  returns 1200 records

We use DNN 5.4.4  DMX 5.2.11 and What's New 2.1.3

 

Here is the sql statement that is executed (found in the log file):

SELECT TOP 10 e.*,
    CASE WHEN (SELECT COUNT(*) FROM DMX_ShortTexts WHERE TypeKey='ENT' AND SubTypeKey='TITLE' AND ObjectId=e.CollectionId AND Locale='en-US') >0 THEN (SELECT [Text] FROM DMX_ShortTexts WHERE TypeKey='ENT' AND SubTypeKey='TITLE' AND ObjectId=e.CollectionId AND Locale='en-US') ELSE (SELECT [Text] FROM DMX_ShortTexts WHERE TypeKey='ENT' AND SubTypeKey='TITLE' AND ObjectId=e.CollectionId AND Locale='') END FolderTitle, CAST (CASE WHEN UserSubs.EntryId > -1 THEN 1 ELSE 0 END AS BIT) AS Subscribed, CAST (CASE WHEN UserSubs.LastAccess < e.LastModified THEN 1 ELSE 0 END AS BIT) AS Changed, CAST (CASE WHEN e.LockedUntil > GETDATE() THEN 1 ELSE 0 END AS BIT) AS IsLocked, ext.ControlToLoad, ext.Custom, ext.DownloadUrl, ext.EntryTypes, ext.Icon16, ext.Icon32, ext.IsPrivate, ext.MimeType, ext.ResourceFile, ext.SettingsControl, ext.ViewByDefault, CAST(CASE WHEN (PATINDEX('Collection%',e.EntryType)>0) THEN 1 ELSE 0 END AS BIT) AS IsCollection, ISNULL((SELECT [Text] FROM DMX_LongTexts WHERE TypeKey='ENT' AND SubTypeKey='REMARKS' AND ObjectId=e.EntryId AND Locale='en-US'),  (SELECT [Text] FROM DMX_LongTexts WHERE TypeKey='ENT' AND SubTypeKey='REMARKS' AND ObjectId=e.EntryId AND Locale='')) Remarks, ISNULL((SELECT [Text] FROM DMX_ShortTexts WHERE TypeKey='ENT' AND SubTypeKey='TITLE' AND ObjectId=e.EntryId AND Locale='en-US'),  (SELECT [Text] FROM DMX_ShortTexts WHERE TypeKey='ENT' AND SubTypeKey='TITLE' AND ObjectId=e.EntryId AND Locale='')) Title, ea1.Value [Att_SyncFolder] FROM DMX_Entries e INNER JOIN DMX_Extensions ext ON e.EntryType=ext.ExtensionKey LEFT OUTER JOIN DMX_EntryAttributes ea1 ON ea1.EntryId=e.EntryId AND ea1.AttributeId=1 LEFT JOIN DMX_Subscriptions UserSubs ON UserSubs.UserId=69 AND UserSubs.EntryId=e.EntryId INNER JOIN (SELECT DISTINCT ep.EntryId FROM DMX_EntryPermissions ep INNER JOIN DMX_Permissions pt ON pt.PermissionId=ep.PermissionId AND pt.PermissionKey='VIEW' LEFT JOIN vw_DMX_ActiveUserRoles r ON r.RoleId=ep.RoleId AND r.UserId=69 WHERE (ep.UserId=69 OR NOT r.UserId IS NULL OR ep.RoleId=-1)) perm ON perm.EntryId=e.EntryId WHERE (e.Version=(SELECT MAX(Version) FROM DMX_Entries e2 WHERE e2.LastVersionId=e.LastVersionId AND (e2.IsApproved=1 OR e2.Owner=69))) AND e.PortalId=0 AND ext.PortalId=0 AND (Deleted=0 AND IsApproved=1 AND (Not EntryType LIKE '%Collection%') AND ISNULL((SELECT [Text] FROM DMX_ShortTexts WHERE TypeKey='ENT' AND SubTypeKey='TITLE' AND ObjectId=e.EntryId AND Locale='en-US'), (SELECT [Text] FROM DMX_ShortTexts WHERE TypeKey='ENT' AND SubTypeKey='TITLE' AND ObjectId=e.EntryId AND Locale='')) NOT LIKE '' AND ([Path] like '0;1;5;10230;%' )) ORDER BY LastModified DESC

 

 

 

 

maoz
New Member
New Member
Posts:14


--
09/21/2010 2:52 PM

 More information:

If we change the path in the filter to AND ([Path] like '0;1;%' )
instead of 
AND ([Path] like '0;1;5;10230;%' )
The query completes quickly and the module works.

We cann't see why the specific path  '0;1;5;10230;'  takes so much time with TOP 10

 

 

maoz
New Member
New Member
Posts:14


--
09/21/2010 6:21 PM

 We have found the offending collection that may have caused the problem.

Some file entries in the collection have a path which define the parent as another file
instead of a collection ("directory")

Peter,

Do you have a script that detects problems in paths, orphane entries and parents which are FILE ??
 

Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
09/28/2010 9:25 PM
Hi Maoz,

I have spent some time on "repair scripts" for the upcoming 5.3 release. But this kid of data inconsistency is hard to resolve automatically.

BTW I'm not even sure this is an error. The gallery extension, for instance, creates a thumbnail from a file and stores this as a DMX file that is the child of the original file. This kind of hierarchy is permitted in DMX. But that's not to say that in this case it was legitimate.

Peter
You are not authorized to post a reply.