+ Start a Discussion
viswadaviswada 

Constructor not defined: [IdeaListController].--urgent

HI all,

 

     I have a issue with  ideastandardsetController and IdeaStandardController .in  my calss  i am  using ideaStandardController and IdaestandardController  ,  while writting test coverage for  these a classes  i am getting error like " Consructed not defined "   i  have activatevated these classes from salesforce, evethough    i am gettin error. how can we resove this issue.

 .

LVSLVS

Put your page and class at pastebin.org and give us a link

bob_buzzardbob_buzzard

This is about the fourth post for exactly the same issue.  Can you please stop making multiple posts on the same topic.

viswadaviswada

Thanks for replaying  

 

Here my apex class is 

public class IdeaListController extends IdeaController {

Integer IdeaCountWhenMerged = 0;
public Idea[] mergeList {
get {
if (mergeList == null){
mergeList = [select Id from Idea where ParentIdeaId!=null];
}
return mergeList;
}
set;
}
public Idea[] ideas;
private static final Integer MAX_NUMBER_OF_IDEAS_PER_PAGE = 20;

public ApexPages.IdeaStandardSetController controller;
public Integer total {get;set;}
public String catName {get;set;}

// Page number variables
public Integer totalNumPages{get;set;}
public Integer numPages { get; set; }

public Boolean View {get;set;}
public Boolean ArcView {get;set;}
public Boolean ProView {get;set;}

public String reqWorkspaceBtnList {get;set;}
public String accessWorkspaceBtnList {get;set;}
public String hasAccesstoWorkspace {get;set;}
public Map<String,Integer> participantsList {get;set;}


public List<Id> accessWorkspaceList {get;set;}

public IdeaListController() {

}

public IdeaListController(ApexPages.IdeaStandardSetController controller) {
this.controller = controller;
accessWorkspaceBtnList = '';
reqWorkspaceBtnList = '';
hasAccesstoWorkspace ='';
accessWorkspaceList = new List<Id>();
participantsList = new Map<String, Integer>();
List<SObject> sobj = [SELECT Id,Status, (SELECT Id FROM Votes WHERE Type = 'Up' LIMIT 51),(SELECT Id,Number_Of_Participants__c from WorkspaceList__r)
FROM Idea WHERE Id IN :controller.getIdeaList() AND Categories != 'DevSummit 2012'];
List<Idea> tempIdeaList = (List<Idea>)sobj;
for(Idea obj: tempIdeaList) {
String mapId = obj.Id;
mapId = mapId.substring(0,15);
if (obj.Votes.size() > 50 && obj.Status == NULL) {
if(obj.WorkspaceList__r.size()==0){
reqWorkspaceBtnList += obj.Id + ',';
}
else{
accessWorkspaceBtnList += obj.Id + ',';
accessWorkspaceList.add(obj.Id);
participantsList.put(mapId,Integer.valueOf(obj.WorkspaceList__r[0].Number_Of_Participants__c));
}
}
else{
if(obj.WorkspaceList__r.size()>0){
accessWorkspaceBtnList += obj.Id + ',';
accessWorkspaceList.add(obj.Id);
participantsList.put(mapId,Integer.valueOf(obj.WorkspaceList__r[0].Number_Of_Participants__c));
}
}
}
List<WorkspaceUser__c> workspaceUserList = [Select WorkspaceList__c, WorkspaceList__r.Idea__c, UserName__c From WorkspaceUser__c where UserName__c = :userinfo.getUserId() and WorkspaceList__r.Idea__c IN :accessWorkspaceList];
for(WorkspaceUser__c wu : workspaceUserList){
hasAccesstoWorkspace += wu.WorkspaceList__r.Idea__c +',';
}

}

public String feedName {
get {
if (feedName == null) {
if (IdeaController.SORT_POPULAR.equals(sortParam)) {
feedName = IdeaFeedController.TYPE_POPULAR;

} else if (IdeaController.SORT_RECENT.equals(sortParam)) {
feedName = IdeaFeedController.TYPE_RECENT;

} else if (IdeaController.SORT_TOP.equals(sortParam)) {
feedName = IdeaFeedController.TYPE_TOP;

} else if (IdeaController.SORT_COMMENTS.equals(sortParam)) {
feedName = IdeaFeedController.TYPE_RECENT_COMMENTS;

} else {
feedName = IdeaFeedController.TYPE_POPULAR;

}
}
return feedName;
}
set;
}

public IdeaWithVote[] ideasWithVotes {
get {
if (ideasWithVotes == null) {
ideasWithVotes = IdeaWithVote.getIdeasWithVotes(getIdeas());


}
return ideasWithVotes;
}
set;
}

public String cat {get;set;}
public Integer catSize {get;set;}

public Idea[] getIdeas() {
if (ideas == null) {
if (controller != null) {
ideas = controller.getIdeaList();

}
}
return ideas;
}


public String getPageName() {
return PAGE_LIST;
}

public Boolean getHasPreviousPage() {
return getPageParamInt() > 1;

}

public Boolean getHasNextPage() {
return (ideas.size() == MAX_NUMBER_OF_IDEAS_PER_PAGE);
}

public Integer getPageNumber(){
return getPageParamInt();
}



//Caluculate total number of pages
public Integer gettotalpages(){
Integer tot;

for(Idea I : mergeList){
IdeaCountWhenMerged++;
}

//counting ideas for each category
if(categoryParam=='ArcGIS Server')
{
tot = getServerIdeas();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='ArcGIS Desktop')
{
tot = getDesktopIdeas();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='ArcGIS Desktop Extensions')
{
tot = getArcGISDesktopExtensions();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='ArcGIS Engine')
{
tot = getEngineIdeas();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='ArcGIS Explorer')
{
tot = getExplorerIdeas();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}

else if(categoryParam=='ArcGIS Online')
{
tot = getOnlineIdeas();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='ArcLogistics')
{
tot = getArcLogistics();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}

else if(categoryParam=='Geodatabase')
{
tot = getGeoDatabase();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Imagery')
{
tot = getImagery();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Maps and Content')
{
tot = getMaps();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Mobile GIS')
{
tot = getMobilegis();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}

else if(categoryParam=='Business Analyst')
{
tot = getBusinessAnalyst();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Esri CityEngine')
{
tot = getCityEngine();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Other Products')
{
tot = getOtherProducts ();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Web Apps and APIs')
{
tot =getWebApps();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Production Mapping (PLTS)')
{
tot = getProdMap();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Service Ideas')
{
tot = getServiceIdeas();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Defense and Intelligence')
{
tot = getDefenseandIntelligence();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Education')
{
tot = getEducation();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Local Government')
{
tot = getLocalGovernment();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Mining')
{
tot = getMining();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Federal Government')
{
tot = getFederalGovernment();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Natural Resources')
{
tot = getNaturalResources();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Petroleum')
{
tot = getPetroleum();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}

else if(categoryParam=='Public Safety')
{
tot = getPublicSafety();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Utilities')
{
tot = getUtilities();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Telecommunications')
{
tot = getTelecommunications();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Transportation')
{
tot = getTransportation();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Other Industries')
{
tot = getOtherIndustries();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Water and Wastewater')
{
tot = getWaterandWastewater();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
/*else if(categoryParam=='EGUG 2010')
{
tot=getEGUG2010();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='DevSummit 2012')
{
tot=getDevSummit();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}*/
else if(categoryParam=='Training Ideas')
{
tot=getTrainingIdeas();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='ArcGIS Runtime')
{
tot=getArcGISRuntime();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else if(categoryParam=='Oceans and Maritime')
{
tot=getOceansMaritime();
totalNumPages = Math.round(Math.ceil(tot / ( 1.0 * this.controller.getPageSize())));
}
else
{
totalNumPages = Math.round(Math.ceil((this.controller.getResultSize()-IdeaCountWhenMerged) / ( 1.0 * this.controller.getPageSize())));
//this.controller.getResultSize()
}
return totalNumPages;
}
public String getSort(){
return sortParam;
}

//Do not display the page numbers for comments

public Boolean getcheckSort(){
if(sortParam=='Comments'||statusParam=='Under Consideration'||statusParam=='Implemented'||statusParam=='Deferred')
return false;
else
return true;
}

/* public integer getTest(){
integer intTotal ;

return intTotal;
} */

/*
public string pNUM {get;set;}
public String fullURL;
public String getURL(){
return ApexPages.CurrentPage().getURL();
}
public PageReference goToPage(){
PageReference pageRef = new PageReference(ApexPages.CurrentPage().getURL());
pageRef.getParameters().clear();
pageRef.getParameters().put('p',pNUM);
// pageRef.setRedirect(true);
return pageRef+;
} */

}

=====================================

Test Coverage 

=================================

 

@isTest
private class IdeaListControllerTest {
static testMethod void testFeedNameP()
{

ApexPages.ideaStandardsetController ideaCon ;
IdeaTestUtil.setupTest();
TestIdeaController controller = new TestIdeaController();
Community cm=[select id from community];

idea Testideas=new idea(Tags__c='aaaaa',Status_Changed_By__c='bbbb',CommunityId=Cm.id,title='hii');
insert Testideas;

List<Idea> ideas= new List<Idea>();
ideas.add(Testideas);
//insert ideas;
ApexPages.ideaStandardController sc= new ApexPages.IdeaStandardController(ideas);///  I  am gettin gerror here 
IdeaListController Ilc=New IdeaListController();, If  I pass 'sc'  error  would also same,
ILC.gettotalpages();
Ilc.getIdeas();
ILC.getPageNumber();
ILC.getPageName();
string s= Ilc.getSort();
Boolean b=ILc.getcheckSort();
//ideaCon=(ApexPages.ideaStandardsetController)sc;


//ideaCon = new ApexPages.ideaStandardsetController(Ilc);

checkFeedName(IdeaController.SORT_POPULAR, IdeaFeedController.TYPE_POPULAR);
checkFeedName(IdeaController.SORT_RECENT, IdeaFeedController.TYPE_RECENT);
checkFeedName(IdeaController.SORT_TOP, IdeaFeedController.TYPE_TOP);
checkFeedName(IdeaController.SORT_COMMENTS, IdeaFeedController.TYPE_RECENT_COMMENTS);
checkFeedName('foo', IdeaFeedController.TYPE_POPULAR);


}

 

 

===========================================

 how can we   create instance for ideastandardsetcontroller  and ideastandardcontroller