<commit_before>/**********************************************************************************
 * $URL$
 * $Id$
 ***********************************************************************************
 *
 * Copyright (c) 2004, 2005, 2006 The Sakai Foundation.
 *
 * Licensed under the Educational Community License, Version 1.0 (the"License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.opensource.org/licenses/ecl1.php
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 **********************************************************************************/


package org.sakaiproject.tool.assessment.ui.listener.questionpool;

import java.util.ArrayList;

import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.sakaiproject.tool.assessment.services.QuestionPoolService;
import org.sakaiproject.tool.assessment.ui.bean.questionpool.QuestionPoolBean;
import org.sakaiproject.tool.assessment.ui.listener.util.ContextUtil;

/**
 * <p>Title: Samigo</p>2
 * <p>Description: Sakai Assessment Manager</p>
 * <p>Copyright: Copyright (c) 2004 Sakai Project</p>
 * <p>Organization: Sakai Project</p>
 * @version $Id$
 */

public class SortQuestionListListener
    implements ActionListener
{
  private static Log log = LogFactory.getLog(SortQuestionListListener.class);
  private static ContextUtil cu;


  public void processAction(ActionEvent ae) throws AbortProcessingException
  {
    FacesContext context = FacesContext.getCurrentInstance();
   
    // get service and managed bean
    QuestionPoolBean questionpoolbean = (QuestionPoolBean) cu.lookupBean("questionpool");
    
    String orderBy = cu.lookupParam("orderBy");
    String ascending =cu.lookupParam("ascending");
    if (orderBy != null &&!orderBy.trim().equals("")){
    	questionpoolbean.setSortQuestionProperty(orderBy);
    	log.debug("orderBy = " + cu.lookupParam("orderBy"));
    }
    
    if (ascending != null && ascending.trim().equals("")){
    	questionpoolbean.setSortAscending(Boolean.valueOf(ascending).booleanValue());
    	log.debug("ascending = " + ascending);
    }
    
    questionpoolbean.setSortQuestionAscending(Boolean.valueOf(cu.lookupParam("ascending")).booleanValue());
    
    String qpid=cu.lookupParam("qpid");
    QuestionPoolService delegate = new QuestionPoolService();
    ArrayList list= new ArrayList();
    if (qpid==null ||("").equals(qpid)){
     list = delegate.getAllItemsSorted(questionpoolbean.getCurrentPool().getId(), orderBy, ascending);
    }
    else{
	list = delegate.getAllItemsSorted(Long.getLong(qpid),orderBy, ascending);
    }
    
    System.out.println("FAIL AFTER CALLING DELEGATE");
    questionpoolbean.setAllItems(list);

  }
}
<commit_msg>Replace System\.out with log.debug<commit_after>/**********************************************************************************
 * $URL$
 * $Id$
 ***********************************************************************************
 *
 * Copyright (c) 2004, 2005, 2006 The Sakai Foundation.
 *
 * Licensed under the Educational Community License, Version 1.0 (the"License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.opensource.org/licenses/ecl1.php
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 **********************************************************************************/


package org.sakaiproject.tool.assessment.ui.listener.questionpool;

import java.util.ArrayList;

import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.sakaiproject.tool.assessment.services.QuestionPoolService;
import org.sakaiproject.tool.assessment.ui.bean.questionpool.QuestionPoolBean;
import org.sakaiproject.tool.assessment.ui.listener.util.ContextUtil;

/**
 * <p>Title: Samigo</p>2
 * <p>Description: Sakai Assessment Manager</p>
 * <p>Copyright: Copyright (c) 2004 Sakai Project</p>
 * <p>Organization: Sakai Project</p>
 * @version $Id$
 */

public class SortQuestionListListener
    implements ActionListener
{
  private static Log log = LogFactory.getLog(SortQuestionListListener.class);
  private static ContextUtil cu;


  public void processAction(ActionEvent ae) throws AbortProcessingException
  {
    FacesContext context = FacesContext.getCurrentInstance();
   
    // get service and managed bean
    QuestionPoolBean questionpoolbean = (QuestionPoolBean) cu.lookupBean("questionpool");
    
    String orderBy = cu.lookupParam("orderBy");
    String ascending =cu.lookupParam("ascending");
    if (orderBy != null &&!orderBy.trim().equals("")){
    	questionpoolbean.setSortQuestionProperty(orderBy);
    	log.debug("orderBy = " + cu.lookupParam("orderBy"));
    }
    
    if (ascending != null && ascending.trim().equals("")){
    	questionpoolbean.setSortAscending(Boolean.valueOf(ascending).booleanValue());
    	log.debug("ascending = " + ascending);
    }
    
    questionpoolbean.setSortQuestionAscending(Boolean.valueOf(cu.lookupParam("ascending")).booleanValue());
    
    String qpid=cu.lookupParam("qpid");
    QuestionPoolService delegate = new QuestionPoolService();
    ArrayList list= new ArrayList();
    if (qpid==null ||("").equals(qpid)){
     list = delegate.getAllItemsSorted(questionpoolbean.getCurrentPool().getId(), orderBy, ascending);
    }
    else{
	list = delegate.getAllItemsSorted(Long.getLong(qpid),orderBy, ascending);
    }
    
    log.debug("AFTER CALLING DELEGATE");
    questionpoolbean.setAllItems(list);

  }
}

{'fraction_non_alphanumeric': 0.18237926245949698, 'fraction_numerical': 0.006171887054466903, 'mean_word_length': 4.941338221814849, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3442853', 'n_tokens_mistral': 1818, 'n_tokens_neox': 1735, 'n_words': 416}