Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepositoryIs it possible for a direct link from blog module to item uploaded into the repository module?Is it possible for a direct link from blog module to item uploaded into the repository module?
Previous
 
Next
New Post
6/12/2007 2:01 PM
 

Repository Search Token. It actually seems to be almost working, but it does return results that do not contain the search criteria anywhere.

For example, if I search for "21" I generate no results, if I search for 29 I get 21, 22 and 29.

Maybe I'm just not using the search properly. However, if I include the article ID (not as a token) in the Summary section everything seems to work fine.


Icthus Technologies

Building Faith on the Internet
 
New Post
6/12/2007 2:53 PM
 

The Repository search looks at a number of fields for a hit ..
- Description
- Summary
- AuthorName
- AuthorEMail
- Title
- Filename

So if you're searching for something as simple as '29', you might get an inadvertent hit if '29' exists anywhere in any of the above fields. If you're searching for 29 and get a hit on something that does not have '29' in at least one of those fields, let me know, it's a bug.

Now, back to your issue. Since the Repository search is done in a stored procedure, the good news is you can add that functionality by modifying the stored procedure via the Host->SQL page .. no code changes required!

Copy and paste the following script into the Host->SQL textbox, check 'Execute as script' and execute it.  This adds a new search feature, after updating the stored proc, you can enter 'Article=2' in the search field and it will only find the record with ItemID equal to 2. It won't search any of the other fields. Entering anything  in the search box that does not start with 'Article=' will perform the normal search logic.  The text is case-insensitive, so entering 'ARTICLE=7' will find the item with ItemID equal to 7.

NOTE: I tested this and it seems to work, but I would suggest testing it on a dev or test environment before doing this on your production box. ( I know, I didn't need to tell you that .. but it makes me feel better to at least throw out a warning  :)  )

let me know if that works for you...

if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}grmGetRepositoryObjects]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure {databaseOwner}[{objectQualifier}grmGetRepositoryObjects]
GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

CREATE procedure {databaseOwner}{objectQualifier}grmGetRepositoryObjects
(
@ModuleID  int,
@sFilter nvarchar(256),
@sSort  nvarchar(100),
@Approved int,
@CategoryId int,
@Attributes nvarchar(150),
@RowCount int
)
AS

BEGIN
IF @RowCount > 0
    SET ROWCOUNT @RowCount
END

DECLARE @sql NVARCHAR(4000)
DECLARE @SearchToken nvarchar(128)
DECLARE @SearchClause nvarchar(50)

BEGIN
SELECT  @sql = 'SELECT a.*, (SELECT COUNT({databaseOwner}{objectQualifier}grmRepositoryComments.ItemID) FROM {databaseOwner}{objectQualifier}grmRepositoryComments ' +
   'WHERE {databaseOwner}{objectQualifier}grmRepositoryComments.ObjectID=a.ItemID) AS CommentCount '

IF @CategoryId = -1
BEGIN
 SET @sql = @sql + 'FROM {databaseOwner}{objectQualifier}grmRepositoryObjects a '
END
ELSE
BEGIN
 SET @sql = @sql + 'FROM {databaseOwner}{objectQualifier}grmRepositoryObjects a, {databaseOwner}{objectQualifier}grmRepositoryObjectCategories b '
END

SET @sql = @sql +
  'WHERE a.ModuleID = ' + CONVERT(VARCHAR, @ModuleID) + ' ' +
  'AND ( CONVERT(VARCHAR,a.Approved) = ' + CONVERT(VARCHAR, @Approved) + ') '  +
  'AND ( ''' + @Attributes + ''' = '''' OR {databaseOwner}{objectQualifier}grmCheckAllAttributes(''' + @Attributes + ''','';'', a.ItemID) = 1) '

IF @CategoryId <> -1
BEGIN
 SET @sql = @sql + 'AND (a.ItemID = b.ObjectID AND b.CategoryId = ' + CONVERT(VARCHAR, @CategoryId) + ') '
END

IF @sFilter <> ''
BEGIN
 SET @sql = @sql + 'AND ( '


 IF LOWER(SUBSTRING(@sFilter, 1, 8)) = 'article='
     BEGIN
  SET @sql = @sql + 'a.ItemID = ' + SUBSTRING(@sFilter, 9, LEN(@sFilter) - 8)
     END
 ELSE
     BEGIN

 -- inject a set of search filters for each search word or phrase
 DECLARE TCUR CURSOR FOR
 SELECT [Value] FROM {databaseOwner}{objectQualifier}grmParseDelimitedStrings(@sFilter, '|')
 SET @SearchClause = 'false'
 
 OPEN TCUR
 FETCH NEXT FROM TCUR INTO @SearchToken
     WHILE @@FETCH_STATUS = 0
     BEGIN
     IF @SearchClause <> 'true'
  BEGIN
          SET @SearchClause = 'true'
          SET @sql = @sql +
   '(( a.Description like ''%' + CONVERT(VARCHAR, @SearchToken) + '%'' ) OR ( a.Summary like ''%' + CONVERT(VARCHAR, @SearchToken) + '%'' ) ' +
   ' OR ( a.Name like ''%' + CONVERT(VARCHAR, @SearchToken) + '%'' ) OR ( a.FileName like ''%' + CONVERT(VARCHAR, @SearchToken) + '%'' ) ' +
   ' OR ( a.Author like ''%' + CONVERT(VARCHAR, @SearchToken) + '%'' ) OR ( a.AuthorEmail like ''%' + CONVERT(VARCHAR, @SearchToken) + '%'' ) ' +
   ' ) '
  END
  ELSE
  BEGIN
          SET @sql = @sql +
   ' OR (( a.Description like ''%' + CONVERT(VARCHAR, @SearchToken) + '%'' ) OR ( a.Summary like ''%' + CONVERT(VARCHAR, @SearchToken) + '%'' ) ' +
   ' OR ( a.Name like ''%' + CONVERT(VARCHAR, @SearchToken) + '%'' ) OR ( a.FileName like ''%' + CONVERT(VARCHAR, @SearchToken) + '%'' ) ' +
   ' OR ( a.Author like ''%' + CONVERT(VARCHAR, @SearchToken) + '%'' ) OR ( a.AuthorEmail like ''%' + CONVERT(VARCHAR, @SearchToken) + '%'' ) ' +
   ' ) '
  END
         FETCH NEXT FROM TCUR INTO @SearchToken
     END 
 CLOSE TCUR
 DEALLOCATE TCUR


     END


 SET @sql = @sql + ' ) '

END

IF @sSort = 'Name'
BEGIN
 SET @sql = @sql + 'ORDER BY a.Name ASC '
END

IF @sSort = 'Author'
BEGIN
 SET @sql = @sql + 'ORDER BY a.Author ASC '
END

IF @sSort = 'Downloads'
BEGIN
 SET @sql = @sql + 'ORDER BY a.Downloads DESC '
END

IF @sSort = 'RatingAverage'
BEGIN
 SET @sql = @sql + 'ORDER BY a.RatingAverage DESC '
END

IF @sSort = 'UpdatedDate'
BEGIN
 SET @sql = @sql + 'ORDER BY a.UpdatedDate DESC '
END

EXEC(@sql)
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

 

 
New Post
6/14/2007 12:54 AM
 

I would really prefer if you could add an additional query string such as "ItemID", and so in URL:

/tabid/xx/ItemID/1/Default.aspx would show just the item that has itemID = 1. This should be quite possible to do.

 
New Post
6/14/2007 6:10 AM
 

there is already a query string parameter for that ... id=n  where n is the ItemID of the item you want to display

 
New Post
7/18/2007 6:34 PM
 

Hi - I am running Repository version 3.01.13.. I think thats the latest, but I dont see a reference to a "PERMALINK" - I would like to get this feature working as well, please explain what I need to do?

Thanks,
Ed

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepositoryIs it possible for a direct link from blog module to item uploaded into the repository module?Is it possible for a direct link from blog module to item uploaded into the repository module?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out