• Rambo Suson
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
APEX CLASS

public with sharing class GrpsBtnController {
    
    private static final String PvtGrp = 'Private';
    public static final String GstSrTyp = 'Guest';

    @AuraEnabled
    public static GrpBtnWrapper getGroupMemberInfo(String groupId) {
        
        GrpBtnWrapper response = new GrpBtnWrapper();
        List<CollabGrp> groupList = new List<CollabGrp>();
        List<CollabGrpM> GrpMem = new List<CollabGrpM>();

        if(String.isNotBlank(groupId)) {
            response.baseURL = PCGCUtility.returnSiteBaseURL();

            User usr = [SELECT Id,UserType FROM User WHERE Id =:UserInfo.getUserID() LIMIT 1];
            response.userObj = usr;

            try {
                groupList = [SELECT Id,ColTyp,OwnerId FROM CollabGrp WHERE
                             Id =:groupId LIMIT 1];

                if(!groupList.isEmpty() && groupList[0].OwnerId != UserInfo.getUserId() 
                    && PvtGrp.equalsIgnoreCase(groupList[0].ColTyp)) {

                    GrpMem = [SELECT Id,CollabGrpId,MemberId FROM 
                                       CollabGrpM WHERE MemberId =:UserInfo.getUserId()
                                       AND CollabGrpId =:groupId LIMIT 1];
                    
                    if(!GrpMem.isEmpty()) {
                        response.showGrpMemD = true;
                    }
                    else {
                        response.showGrpMemD = false;

                    }
                }

                else {
                    response.showGrpMemD = true;
                }
            }
            catch(Exception ex) {
                system.debug('---Exception---'+ex.getMessage());
            }
        }
        else {
            response.showGrpMemD = false;

        }
        return response;
    }
}

TEST CLASS

@isTest
public with sharing class GrpsBtnControllerTest {
    
    private static User AnUser;
    private static Account acc;
    public static CollabGrp newGroup;

    @testSetup static void createTestData() {
          
        acc = PCTDUtility.createAccount('Test Account 3');
        insert acc;
        
        System.assertNotEquals(null,acc);
        
        Contact con = PCTDUtility.createPtContact('Contact 3','Test',acc.Id);
        insert con;
        
        System.assertNotEquals(null,con);
        li360User = PCTDUtility.createPtStUser('Test731','ShippingAndMailing871',
                           'TUABC36','testPtUser2@testorg.com','testPtUser79@testorg.com.pb','TestShippingAndMailing1393',
                           con.Id);

    }

    private static testMethod void getPubGrpMInfoTest() {
        
        User li360User = [SELECT Id FROM User WHERE communityNickName = 'TestShippingAndMailing1393' LIMIT 1];
        GrpBtnWrapper grpWrapper = new GrpBtnWrapper();
        
        newGroup = new CollabGrp();
        newGroup.Name='Chatter Group 2';
        newGroup.ColTyp='Public';
        newGroup.OwnerId = UserInfo.getUserId();
        insert newGroup;
        
        Test.startTest();
            grpWrapper = GrpsBtnController.getGrpMemInfo(newGroup.Id);
        Test.stopTest();
        system.assertEquals(true,grpWrapper.showGrpMembD);
    }

    private static testMethod void getPvtGrpMemInfoTest() {
        
        User li360User = [SELECT Id FROM User WHERE communityNickName = 'TestShippingAndMailing1393' LIMIT 1];
        GrpBtnWrapper grpWrapper = new GrpBtnWrapper();
        
        newGroup = new CollabGrp();
        newGroup.Name='Chatter Group 1';
        newGroup.ColTyp='Private';
        newGroup.OwnerId = UserInfo.getUserId();
        insert newGroup;
        
        Test.startTest();
            grpWrapper = GrpsBtnController.getGrpMemInfo(newGroup.Id);
        Test.stopTest();
        system.assertEquals(true,grpWrapper.showGrpMemD);
    }
}

the bold and italic part is not able to cover........ Could anyone help me out....
I'am getting this response from the server
<BinaryBarcodes>        
        <Type>COMMON_2D</Type> <Value>Wyk+HjAxHTAyNzY5MDAzHTM1Nh0wNR03OTQ2MTkwODYzOTAwNDY3HUZERR01MTAwODcyNDAdMjMyHR0xLzIdNS4wMEtHHU4dUXIuTm8tRC8zMDEdUk9VUktFTEEdICAdVmluYXkgU2hhcm1hHjA2HTEwWkVJSTA3HTExWlZlbmthdB0xMloxMjM0NTY2Nx0xNVoxMTkwNjI0MTIdMzFaMTAxODQ1NzMzMzE0MTA4OTEwMzkwMDc5NDYxOTA4NjM5MB0zMlowMh0zOVpSUktBHR4wOR1GRFgdeh04HSMjEBkzOn9AHgQ=</Value>                            
</BinaryBarcodes>
I want to convert this Binary code into string as key value pair and display in VF page as PDF format. How to acheive it?
<apex:page controller="CheckEmailwithContact" >
  
  <apex:form >
  <apex:pageBlock title="Select Options as per your choice" >
<apex:selectRadio value="{!selectedCheckbox}" onclick="!getCons2(this.value)"  immediate="true">
<apex:selectOptions value="{!items}"/>
</apex:selectRadio><p/>
<!--<apex:commandButton value="Click Here" action="{!getCons2}"/>-->
</apex:pageBlock>
</apex:form>
 <apex:pageblock >
          <apex:pageBlockTable value="{!conlists}" var="l" id="Table">
          <apex:column headerValue="First Name" value="{!l.FirstName}"/>
          <apex:column headerValue="Last Name" value="{!l.LastName}"/>     
          <apex:column headerValue="Email" value="{!l.Email}"/>  
          </apex:pageBlockTable>
          
  </apex:pageBlock>
 
</apex:page>