/*
*
* Copyright 2005 AgileTec s.r.l. (http://www.agiletec.it) All rights reserved.
*
* This file is part of jAPS software.
* jAPS is a free software;
* you can redistribute it and/or modify it
* under the terms of the GNU General Public License (GPL) as published by the Free Software Foundation; version 2.
*
* See the file License for the specific language governing permissions
* and limitations under the License
*
*
*
* Copyright 2005 AgileTec s.r.l. (http://www.agiletec.it) All rights reserved.
*
*/
package com.agiletec.plugins.jacms.aps.system.services.content;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import com.agiletec.aps.system.common.entity.model.EntitySearchFilter;
/**
* @author E.Santoboni
*/
public class WorkContentSearcherDAO extends AbstractContentSearcherDAO implements IWorkContentSearcherDAO {
@Override
public List<String> loadContentsId(EntitySearchFilter[] filters, Collection<String> userGroupCodes) {
return this.loadContentsId(null, filters, userGroupCodes);
}
@Override
public List<String> loadContentsId(String[] categories, EntitySearchFilter[] filters, Collection<String> userGroupCodes) {
List<String> contentsId = new ArrayList<String>();
if (userGroupCodes == null || userGroupCodes.size()==0) {
return contentsId;
}
Connection conn = null;
PreparedStatement stat = null;
ResultSet result = null;
try {
conn = this.getConnection();
stat = this.buildStatement(filters, categories, userGroupCodes, false, conn);
result = stat.executeQuery();
this.flowResult(contentsId, filters, result);
} catch (Throwable t) {
processDaoException(t, "Errore in caricamento lista id contenuti", "loadContentsId");
} finally {
closeDaoResources(result, stat, conn);
}
return contentsId;
}
@Override
protected String getEntitySearchTableName() {
return "workcontentsearch";
}
@Override
protected String getEntitySearchTableIdFieldName() {
return "contentid";
}
@Override
protected String getContentRelationsTableName() {
return "workcontentrelations";
}
}