forked from SFDO-Community/GrantGuides
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add feature #44 Grant selector to editor, refactor selector methods t…
…o separate classes
- Loading branch information
Showing
15 changed files
with
354 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
force-app/main/default/classes/GGW_ContentBlockSelector.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (c) 2022, salesforce.com, inc. | ||
* All rights reserved. | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause | ||
* | ||
* GGW_ContentBlockSelector Salesforce Content Block text data selector class support GGW. | ||
* | ||
*/ | ||
public with sharing class GGW_ContentBlockSelector { | ||
public static GGW_Content_Block__c queryContentBlockById(String blockid){ | ||
GGW_Content_Block__c cBlock = [SELECT Id, Name, Description__c | ||
FROM GGW_Content_Block__c | ||
WHERE Id =: blockid WITH SECURITY_ENFORCED LIMIT 1]; | ||
return cBlock; | ||
} | ||
public static List<GGW_Content_Block__c> queryContentBlocksBySection(String sectionId){ | ||
List<GGW_Content_Block__c> cbList = [SELECT Id, Name, Description__c, Short_Description__c, | ||
Section__c, Section__r.Name, CreatedDate, | ||
Language__c | ||
FROM GGW_Content_Block__c | ||
WHERE Section__c =: sectionId WITH SECURITY_ENFORCED]; | ||
return cbList; | ||
} | ||
public static List<GGW_Content_Block__c> queryContentBlocks(){ | ||
List<GGW_Content_Block__c> cbList = [SELECT Id, Name, Description__c, Short_Description__c, | ||
Section__c, Section__r.Name, CreatedDate, | ||
Language__c | ||
FROM GGW_Content_Block__c WITH SECURITY_ENFORCED ORDER BY Section__c]; | ||
return cbList; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
force-app/main/default/classes/GGW_ContentBlockSelector.cls-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>58.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
Oops, something went wrong.