public QueryResponse QueryMapPaged(string callingUrl, Guid domainId, Guid nodeId, int maxDepth, EdgeConditions edgeConditions, FilterConditions filterConditions, int objectIndex)
        {
            using (GlymaNSApp.NodeServiceClient nodeServiceClient = new GlymaNSApp.NodeServiceClient(callingUrl))
            {
                /// This method requires security trimming so there is no need to check authentication here.
                using (WebAppSPGlymaSession glymaSession = new WebAppSPGlymaSession(callingUrl))
                {
                    GlymaSessionConfiguration configuration = glymaSession.ExportGlymaSession();

                    /// This method doesn't traverse rootmap boundaries.
                    GlymaSecurityTrimmer securityTrimmer = new GlymaSecurityTrimmer(glymaSession.Web, glymaSession);

                    securityTrimmer.CheckRootMapAuthorisationBaseOnNode(domainId, nodeId, SPGlymaRightFactory.Instance.MapReadRight);

                    QueryResponse response = nodeServiceClient.QueryMapPaged(configuration, domainId, nodeId, maxDepth, edgeConditions, filterConditions, objectIndex);
                    response.CompressResponse();

                    return response;
                }
            }
        }
        public QueryResponse QueryMapByDomain(string callingUrl, Guid domainId, int maxDepth, EdgeConditions edgeConditions, FilterConditions filterConditions)
        {
            using (GlymaNSApp.NodeServiceClient nodeServiceClient = new GlymaNSApp.NodeServiceClient(callingUrl))
            {
                /// This method requires security trimming so there is no need to check authentication here.
                using (WebAppSPGlymaSession glymaSession = new WebAppSPGlymaSession(callingUrl))
                {
                    GlymaSessionConfiguration configuration = glymaSession.ExportGlymaSession();

                    QueryResponse allRootMaps = nodeServiceClient.QueryMapByDomain(configuration, domainId, maxDepth, edgeConditions, filterConditions);

                    /// This method DOES traverse rootmap boundaries.
                    GlymaSecurityTrimmer securityTrimmer = new GlymaSecurityTrimmer(glymaSession.Web, glymaSession);

                    QueryResponse trimmedRootMaps = securityTrimmer.TrimResponse(allRootMaps, SPGlymaRightFactory.Instance.RootMapReadRight);
                    trimmedRootMaps.CompressResponse();

                    return trimmedRootMaps;
                }
            }
        }
        public Dictionary<Guid, QueryResponse> QueryDomains(string callingUrl)
        {
            using (GlymaNSApp.NodeServiceClient nodeServiceClient = new GlymaNSApp.NodeServiceClient(callingUrl))
            {
                /// This method requires security trimming so there is no need to check authentication here.
                using (WebAppSPGlymaSession glymaSession = new WebAppSPGlymaSession(callingUrl))
                {
                    GlymaSessionConfiguration configuration = glymaSession.ExportGlymaSession();

                    Dictionary<Guid, QueryResponse> allDomains = nodeServiceClient.QueryDomains(configuration);

                    GlymaSecurityTrimmer securityTrimmer = new GlymaSecurityTrimmer(glymaSession.Web, glymaSession);

                    Dictionary<Guid, QueryResponse> authorisedDomains = securityTrimmer.TrimResponse(allDomains, SPGlymaRightFactory.Instance.ProjectReadRight);

                    return authorisedDomains;
                }
            }
        }