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 ForumsMapMapHow do I link the map module with the repository moduleHow do I link the map module with the repository module
Previous
 
Next
New Post
3/30/2011 9:52 AM
 
Using the repository as a business directory, I want to link it to the google maps module so I can see the locations of businesses. Effectively I want to use the repository as a data source for the maps module.
Is this possible and if so then how?

TIA
 
New Post
3/31/2011 3:15 PM
 
I assume it's done at the DB level. is this correct?
 
New Post
4/27/2011 1:42 PM
 
ok, I've worked out the following three stored procs (through trial and error) Feedback and criticism welcome!

USE [DotNetNuke]
GO
/****** Object: Trigger [dbo].[CopyToMap] Script Date: 04/14/2011 14:57:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Roland Kamsika
-- Create date:
-- Description:
-- =============================================
ALTER TRIGGER [dbo].[CopyToMap]
ON [dbo].[grmRepositoryObjects] FOR INSERT
AS
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with caller queries SELECT statements.
-- If an update/insert/delete occurs on the main table, the number of records affected
-- should only be based on that table and not what records the triggers may/may not
-- select.
SET NOCOUNT ON;

--
-- Variables Needed for this Trigger
--
DECLARE @GUID nvarchar(200)
DECLARE @SourceID int
DECLARE @Address nvarchar(300)
DECLARE @IconIndex int
DECLARE @Description nvarchar(150)

--
-- Table INSERTED is common to both the INSERT, UPDATE trigger
--
SELECT
@SourceID = 1,
@GUID =[ItemID],
@Address = CONVERT (nvarchar(300),[DESCRIPTION]),
@IconIndex = 0,
@Description =CONVERT (nvarchar(150),[NAME])
FROM [dbo].[grmRepositoryObjects]

BEGIN
INSERT INTO [Map_Points]
([SOURCEID]
,[GUID]
,[ADDRESS]
,[ICONINDEX]
,[DESCRIPTION])
VALUES
(@SourceID
,@GUID
,@Address
,@IconIndex
,@Description
)
END



USE [DotNetNuke]
GO
/****** Object: Trigger [dbo].[DeleteFromMap] Script Date: 04/14/2011 14:58:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Roland Kamsika
-- Create date:
-- Description:
-- =============================================
ALTER TRIGGER [dbo].[DeleteFromMap]
ON [dbo].[grmRepositoryObjects] FOR DELETE
AS
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with caller queries SELECT statements.
-- If an update/insert/delete occurs on the main table, the number of records affected
-- should only be based on that table and not what records the triggers may/may not
-- select.
SET NOCOUNT ON;

--
-- Variables Needed for this Trigger
--
DECLARE @GUID varchar(MAX)
DECLARE @SourceID int
DECLARE @Address varchar(MAX)
DECLARE @IconIndex int
DECLARE @Description varchar(MAX)

--
-- Table INSERTED is common to both the INSERT, UPDATE trigger
--
BEGIN

SELECT @GUID= (SELECT ItemID FROM Deleted)

DELETE FROM Map_Points
WHERE Map_Points.GUID = @GUID

END




USE [DotNetNuke]
GO
/****** Object: Trigger [dbo].[UpdateToMap] Script Date: 04/14/2011 14:58:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Roland Kamsika
-- Create date:
-- Description:
-- =============================================
ALTER TRIGGER [dbo].[UpdateToMap]
ON [dbo].[grmRepositoryObjects] FOR UPDATE
AS
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with caller queries SELECT statements.
-- If an update/insert/delete occurs on the main table, the number of records affected
-- should only be based on that table and not what records the triggers may/may not
-- select.
SET NOCOUNT ON;

--
-- Variables Needed for this Trigger
--
DECLARE @GUID varchar(MAX)
DECLARE @Address varchar(MAX)
DECLARE @Description varchar(MAX)

--
-- Table INSERTED is common to both the INSERT, UPDATE trigger
--
BEGIN

SELECT @GUID= (SELECT ItemID FROM Inserted)

SELECT
@Address =grmRepositoryObjects.DESCRIPTION,
@Description= grmRepositoryObjects.NAME
From grmRepositoryObjects join Map_Points on grmRepositoryObjects.ItemID = @GUID


UPDATE Map_Points
SET ADDRESS=CONVERT (nvarchar(MAX),@Address),
DESCRIPTION=CONVERT (nvarchar(MAX),@Description),
LONGITUDE=0,
LATITUDE=0,
FAILEDGEO=NULL

WHERE Map_Points.GUID = @GUID

END




 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsMapMapHow do I link the map module with the repository moduleHow do I link the map module with 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