Java 类ims.core.vo.ActivityVoCollection 实例源码

项目:AvoinApotti    文件:Logic.java   
/**
 * @param newNode
 * @param inst
 */
private void fillTypeActivites(TreeNode parentNode, LookupInstVo inst)
{
    ActivityVoCollection collActivityVo = form.getLocalContext().getActivityVoCollection();
    for (int i = 0; i < collActivityVo.size(); i++)
    {
        ActivityVo voActivity = collActivityVo.get(i);

        if (voActivity.getActivityType().equals(inst))
        {
            TreeNode newNode = parentNode.getNodes().add(voActivity, voActivity.getName());
            newNode.setExpandedImage(form.getImages().Core.BlueSquare);
            newNode.setCollapsedImage(form.getImages().Core.BlueSquare);
            newNode.setSelectedImage(form.getImages().Core.BlueSquare);
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
/**
 * @return
 */
private boolean adminInstanceExists()
{
    ActivityVoCollection collActivityVo = form.getLocalContext().getActivityVoCollection();
    if (collActivityVo == null)
        return false;

    for (int i = 0; i < collActivityVo.size(); i++)
    {
        ActivityVo voActivity = collActivityVo.get(i);

        if (voActivity.getActivityType().equals(ActivityType.ADMINFUNCTIONS))
            return true;
    }

    return false;
}
项目:openMAXIMS    文件:ProfilesSlotGenericImpl.java   
public ActivityVoCollection listActivitiesByService(ServiceRefVo serviceRef, Boolean isFlexible)
{
    if( serviceRef == null )
        return null;

    DomainFactory factory = getDomainFactory();
    // For profile Slot, we want to list
    // all activities for appointment activity type
    String hql= null;
    if( Boolean.TRUE.equals(isFlexible))
    {
        hql = "select s1_1.activity from ServiceActivity as s1_1 left join s1_1.activity as a1_1 where (s1_1.isActive = 1 and a1_1.isActive = 1 and s1_1.service.id = :serviceId and s1_1.isFlexible = 1 )";    //wdev-20262
    }
    else
    {
        hql = "select s1_1.activity from ServiceActivity as s1_1 left join s1_1.activity as a1_1 where (s1_1.isActive = 1 and a1_1.isActive = 1 and s1_1.service.id = :serviceId and (s1_1.isFlexible = 0 or s1_1.isFlexible is null))"; //wdev-20262
    }

    List lst = factory.find(hql, new String[]{"serviceId"}, new Object[]{new Integer(serviceRef.getID_Service())});
    return (ActivityVoAssembler.createActivityVoCollectionFromActivity(lst));
}
项目:openMAXIMS    文件:Logic.java   
/**
 * @return
 */
private boolean adminInstanceExists()
{
    ActivityVoCollection collActivityVo = form.getLocalContext().getActivityVoCollection();
    if (collActivityVo == null)
        return false;

    for (int i = 0; i < collActivityVo.size(); i++)
    {
        ActivityVo voActivity = collActivityVo.get(i);

        if (voActivity.getActivityType().equals(ActivityType.ADMINFUNCTIONS))
            return true;
    }

    return false;
}
项目:openMAXIMS    文件:Logic.java   
/**
 * @param newNode
 * @param inst
 */
private void fillTypeActivites(TreeNode parentNode, LookupInstVo inst)
{
    ActivityVoCollection collActivityVo = form.getLocalContext().getActivityVoCollection();
    for (int i = 0; i < collActivityVo.size(); i++)
    {
        ActivityVo voActivity = collActivityVo.get(i);

        if (voActivity.getActivityType().equals(inst))
        {
            TreeNode newNode = parentNode.getNodes().add(voActivity, voActivity.getName());
            newNode.setExpandedImage(form.getImages().Core.BlueSquare);
            newNode.setCollapsedImage(form.getImages().Core.BlueSquare);
            newNode.setSelectedImage(form.getImages().Core.BlueSquare);
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
/**
 * @return
 */
private boolean adminInstanceExists()
{
    ActivityVoCollection collActivityVo = form.getLocalContext().getActivityVoCollection();
    if (collActivityVo == null)
        return false;

    for (int i = 0; i < collActivityVo.size(); i++)
    {
        ActivityVo voActivity = collActivityVo.get(i);

        if (voActivity.getActivityType().equals(ActivityType.ADMINFUNCTIONS))
            return true;
    }

    return false;
}
项目:openmaxims-linux    文件:Logic.java   
/**
 * @param newNode
 * @param inst
 */
private void fillTypeActivites(TreeNode parentNode, LookupInstVo inst)
{
    ActivityVoCollection collActivityVo = form.getLocalContext().getActivityVoCollection();
    for (int i = 0; i < collActivityVo.size(); i++)
    {
        ActivityVo voActivity = collActivityVo.get(i);

        if (voActivity.getActivityType().equals(inst))
        {
            TreeNode newNode = parentNode.getNodes().add(voActivity, voActivity.getName());
            newNode.setExpandedImage(form.getImages().Core.BlueSquare);
            newNode.setCollapsedImage(form.getImages().Core.BlueSquare);
            newNode.setSelectedImage(form.getImages().Core.BlueSquare);
        }
    }
}
项目:openmaxims-linux    文件:Logic.java   
/**
 * @return
 */
private boolean adminInstanceExists()
{
    ActivityVoCollection collActivityVo = form.getLocalContext().getActivityVoCollection();
    if (collActivityVo == null)
        return false;

    for (int i = 0; i < collActivityVo.size(); i++)
    {
        ActivityVo voActivity = collActivityVo.get(i);

        if (voActivity.getActivityType().equals(ActivityType.ADMINFUNCTIONS))
            return true;
    }

    return false;
}
项目:AvoinApotti    文件:ProfilesSlotGenericImpl.java   
/**
* listActivities
*/
public ActivityVoCollection listActivities() 
{   
    DomainFactory factory = getDomainFactory();
    // For profile Slot, we want to list
    // all activities for appointment activity type
    String hql = " from Activity act where act.activityType.id = :activityType and act.isActive = :active";
    List lst = factory.find(hql, new String[]{"activityType", "active"}, new Object[]{new Integer(ActivityType.APPOINTMENTTYPES.getId()), Boolean.TRUE});
    return (ActivityVoAssembler.createActivityVoCollectionFromActivity(lst));
}
项目:AvoinApotti    文件:Logic.java   
protected void onQmbActivityTextSubmited(String value) throws PresentationLogicException
{
    // search for activity based on text submitted and optionally activity
    // type.
    ActivityVoCollection voCollActivity = null;
    try
    {
        voCollActivity = domain.listActivity(form.lyr1().Edit().lyrActivityFunction().tabPageActivity().qmbActivity().getEditedText(), form.lyr1().Edit().lyrActivityFunction().tabPageActivity().cmbActivityType().getValue(), new Boolean(true));
    }
    catch (DomainInterfaceException e)
    {
        engine.showMessage(e.getMessage());
        return;
    }

    form.lyr1().Edit().lyrActivityFunction().tabPageActivity().qmbActivity().clear();

    if (voCollActivity != null && voCollActivity.size() > 0)
    {
        for (int i = 0; i < voCollActivity.size(); i++)
        {
            form.lyr1().Edit().lyrActivityFunction().tabPageActivity().qmbActivity().newRow(voCollActivity.get(i), voCollActivity.get(i).getName());
        }
        if (voCollActivity.size() == 1)
            form.lyr1().Edit().lyrActivityFunction().tabPageActivity().qmbActivity().setValue(voCollActivity.get(0));
        else if (voCollActivity.size() > 1)
            form.lyr1().Edit().lyrActivityFunction().tabPageActivity().qmbActivity().showOpened();
    }

}
项目:AvoinApotti    文件:ActivityImpl.java   
/**
    * Returns a list of all activities, or a list of active activities
    */
    public ims.core.vo.ActivityVoCollection listActivities(Boolean bActive)
    {              
        DomainFactory factory = getDomainFactory();     
        List activities = null;     
        StringBuffer hql = new StringBuffer(" ");
        String query = "from Activity a ";

        if (bActive.equals(Boolean.TRUE))
        {
            ArrayList markers = new ArrayList();
            ArrayList values = new ArrayList();

            hql.append(" a.isActive = :isActive");
            markers.add("isActive");
            values.add(bActive);            

            if (markers.size() > 0) query += " where ";
            query += hql.toString();

            activities = factory.find(query, markers, values, 1000);
        }   
        else
        {
            activities = factory.find(query,1000);          
        }

        return ActivityVoAssembler.createActivityVoCollectionFromActivity(activities).sort();
}
项目:AvoinApotti    文件:ActivityImpl.java   
public ActivityVoCollection listNTPFActivities(Boolean isActive, LookupInstanceCollection activityTypeInstancesToExclude) 
{
    DomainFactory factory = getDomainFactory();     

    String hql = " from Activity act "; 
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    StringBuffer condStr = new StringBuffer();
    String andStr = " ";

    if(isActive != null)
    {
        condStr.append(andStr + " act.isActive = :isActive" );
        markers.add("isActive");
        values.add(isActive);       
        andStr = " and ";
    }
    if(activityTypeInstancesToExclude != null)
    {
        for(int i=0;i<activityTypeInstancesToExclude.size();i++)
        {
            String paramName = "actType" + String.valueOf(i);
            condStr.append(andStr + " act.activityType <> " + ":" + paramName );
            markers.add(paramName);
            values.add(getDomLookup(activityTypeInstancesToExclude.getIndex(i)));       
            andStr = " and ";
        }
    }

    if(andStr.equals( " and "))
        hql += " where ";

    hql += condStr.toString();
    List activities = factory.find(hql,markers,values);
    return ActivityVoAssembler.createActivityVoCollectionFromActivity(activities).sort();       

}
项目:openMAXIMS    文件:Logic.java   
private void loadActivities()
{
    CatsReferralRefVo catsReferralRef = form.getLocalContext().getSelectedApptSessionReferralRef();
    ServiceRefVo  serviceRef = form.getLocalContext().getSelectedSessionIsNotNull() ? form.getLocalContext().getSelectedSession().getService() : null;
    ActivityVoCollection activities = domain.listActivities(catsReferralRef, serviceRef);   
    if (activities == null)
        return;
    for (int i=0; i< activities.size(); i++)
        form.cmbActivity().newRow(activities.get(i),activities.get(i).getName());
    if (activities.size() == 1)
        form.cmbActivity().setValue(activities.get(0));     
}
项目:openMAXIMS    文件:SessionSlotDialogImpl.java   
/**
* listActivities
*/  
//WDEV-22973 
public ActivityVoCollection listActivities(CatsReferralRefVo catsReferralRef, ServiceRefVo serviceRef)
{
    if (catsReferralRef != null && serviceRef != null)
    {   
        DomainFactory factory = getDomainFactory();
        String query = null;

        Long noConsultationActivityRequiredForReferral = factory.countWithHQL("select count(cats.id) from CatsReferral as cats where cats.id = :CatsReferralId and (cats.consultationActivityRequired = 0 or cats.consultationActivityRequired is null) ", new String[] {"CatsReferralId"}, new Object[] {catsReferralRef.getID_CatsReferral()});

        if (noConsultationActivityRequiredForReferral == null || noConsultationActivityRequiredForReferral == 0) //WDEV-22672
        {
            Long appointmentsCount = factory.countWithHQL("select count(appts.id) from CatsReferral as cats right join cats.appointments as appts where appts.theatreBooking is null and cats.id = :CatsReferralId", new String[] {"CatsReferralId"}, new Object[] {catsReferralRef.getID_CatsReferral()});
            query = "select act from ServiceActivity as servActivity left join servActivity.activity as act left join servActivity.service as serv where serv.id = :serviceID and act.activityType.id = :actType and servActivity.isActive = :isActive" + ((appointmentsCount == null || appointmentsCount == 0) ? " and (act.firstAppointment = 1 or act.diagnostic = 1)" : "") + " order by act.name asc";            }
        else
        {
            query = "select act from ServiceActivity as servActivity left join servActivity.activity as act left join servActivity.service as serv where serv.id = :serviceID and act.activityType.id = :actType and servActivity.isActive = :isActive order by act.name asc";
        }

        if(query != null && query.length() > 0)
        {
            List<?> results = factory.find(query, new String[]{"serviceID", "actType", "isActive"}, new Object[]{serviceRef.getID_Service(), ActivityType.APPOINTMENTTYPES.getId(), Boolean.TRUE});
            if (results == null || results.isEmpty())
                return null;
            return ActivityVoAssembler.createActivityVoCollectionFromActivity(results);
        }       

    }
    ProfilesSlotGeneric impl = (ProfilesSlotGeneric) getDomainImpl(ProfilesSlotGenericImpl.class);
    return impl.listActivities();

}
项目:openMAXIMS    文件:ProfilesSlotGenericImpl.java   
/**
* listActivities
*/
public ActivityVoCollection listActivities() 
{   
    DomainFactory factory = getDomainFactory();
    // For profile Slot, we want to list
    // all activities for appointment activity type
    String hql = " from Activity act where act.activityType.id = :activityType and act.isActive = :active";
    List lst = factory.find(hql, new String[]{"activityType", "active"}, new Object[]{new Integer(ActivityType.APPOINTMENTTYPES.getId()), Boolean.TRUE});
    return (ActivityVoAssembler.createActivityVoCollectionFromActivity(lst));
}
项目:openMAXIMS    文件:ActivityImpl.java   
/**
    * Returns a list of all activities, or a list of active activities
    */
    public ims.core.vo.ActivityVoCollection listActivities(Boolean bActive)
    {              
        DomainFactory factory = getDomainFactory();     
        List activities = null;     
        StringBuffer hql = new StringBuffer(" ");
        String query = "from Activity a ";

        if (bActive.equals(Boolean.TRUE))
        {
            ArrayList markers = new ArrayList();
            ArrayList values = new ArrayList();

            hql.append(" a.isActive = :isActive");
            markers.add("isActive");
            values.add(bActive);            

            if (markers.size() > 0) query += " where ";
            query += hql.toString();

            activities = factory.find(query, markers, values, 1000);
        }   
        else
        {
            activities = factory.find(query,1000);          
        }

        return ActivityVoAssembler.createActivityVoCollectionFromActivity(activities).sort();
}
项目:openMAXIMS    文件:ActivityImpl.java   
public ActivityVoCollection listNTPFActivities(Boolean isActive, LookupInstanceCollection activityTypeInstancesToExclude) 
{
    DomainFactory factory = getDomainFactory();     

    String hql = " from Activity act "; 
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    StringBuffer condStr = new StringBuffer();
    String andStr = " ";

    if(isActive != null)
    {
        condStr.append(andStr + " act.isActive = :isActive" );
        markers.add("isActive");
        values.add(isActive);       
        andStr = " and ";
    }
    if(activityTypeInstancesToExclude != null)
    {
        for(int i=0;i<activityTypeInstancesToExclude.size();i++)
        {
            String paramName = "actType" + String.valueOf(i);
            condStr.append(andStr + " act.activityType <> " + ":" + paramName );
            markers.add(paramName);
            values.add(getDomLookup(activityTypeInstancesToExclude.getIndex(i)));       
            andStr = " and ";
        }
    }

    if(andStr.equals( " and "))
        hql += " where ";

    hql += condStr.toString();
    List activities = factory.find(hql,markers,values);
    return ActivityVoAssembler.createActivityVoCollectionFromActivity(activities).sort();       

}
项目:openMAXIMS    文件:ProfilesSlotGenericImpl.java   
/**
* listActivities
*/
public ActivityVoCollection listActivities() 
{   
    DomainFactory factory = getDomainFactory();
    // For profile Slot, we want to list
    // all activities for appointment activity type
    String hql = " from Activity act where act.activityType.id = :activityType and act.isActive = :active";
    List lst = factory.find(hql, new String[]{"activityType", "active"}, new Object[]{new Integer(ActivityType.APPOINTMENTTYPES.getId()), Boolean.TRUE});
    return (ActivityVoAssembler.createActivityVoCollectionFromActivity(lst));
}
项目:openMAXIMS    文件:Logic.java   
protected void onQmbActivityTextSubmited(String value) throws PresentationLogicException
{
    // search for activity based on text submitted and optionally activity
    // type.
    ActivityVoCollection voCollActivity = null;
    try
    {
        voCollActivity = domain.listActivity(form.lyr1().Edit().lyrActivityFunction().tabPageActivity().qmbActivity().getEditedText(), form.lyr1().Edit().lyrActivityFunction().tabPageActivity().cmbActivityType().getValue(), new Boolean(true));
    }
    catch (DomainInterfaceException e)
    {
        engine.showMessage(e.getMessage());
        return;
    }

    form.lyr1().Edit().lyrActivityFunction().tabPageActivity().qmbActivity().clear();

    if (voCollActivity != null && voCollActivity.size() > 0)
    {
        for (int i = 0; i < voCollActivity.size(); i++)
        {
            form.lyr1().Edit().lyrActivityFunction().tabPageActivity().qmbActivity().newRow(voCollActivity.get(i), voCollActivity.get(i).getName());
        }
        if (voCollActivity.size() == 1)
            form.lyr1().Edit().lyrActivityFunction().tabPageActivity().qmbActivity().setValue(voCollActivity.get(0));
        else if (voCollActivity.size() > 1)
            form.lyr1().Edit().lyrActivityFunction().tabPageActivity().qmbActivity().showOpened();
    }

}
项目:openMAXIMS    文件:ActivityImpl.java   
/**
    * Returns a list of all activities, or a list of active activities
    */
    public ims.core.vo.ActivityVoCollection listActivities(Boolean bActive)
    {              
        DomainFactory factory = getDomainFactory();     
        List activities = null;     
        StringBuffer hql = new StringBuffer(" ");
        String query = "from Activity a ";

        if (bActive.equals(Boolean.TRUE))
        {
            ArrayList markers = new ArrayList();
            ArrayList values = new ArrayList();

            hql.append(" a.isActive = :isActive");
            markers.add("isActive");
            values.add(bActive);            

            if (markers.size() > 0) query += " where ";
            query += hql.toString();

            activities = factory.find(query, markers, values, 1000);
        }   
        else
        {
            activities = factory.find(query,1000);          
        }

        return ActivityVoAssembler.createActivityVoCollectionFromActivity(activities).sort();
}
项目:openMAXIMS    文件:ActivityImpl.java   
public ActivityVoCollection listNTPFActivities(Boolean isActive, LookupInstanceCollection activityTypeInstancesToExclude) 
{
    DomainFactory factory = getDomainFactory();     

    String hql = " from Activity act "; 
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    StringBuffer condStr = new StringBuffer();
    String andStr = " ";

    if(isActive != null)
    {
        condStr.append(andStr + " act.isActive = :isActive" );
        markers.add("isActive");
        values.add(isActive);       
        andStr = " and ";
    }
    if(activityTypeInstancesToExclude != null)
    {
        for(int i=0;i<activityTypeInstancesToExclude.size();i++)
        {
            String paramName = "actType" + String.valueOf(i);
            condStr.append(andStr + " act.activityType <> " + ":" + paramName );
            markers.add(paramName);
            values.add(getDomLookup(activityTypeInstancesToExclude.getIndex(i)));       
            andStr = " and ";
        }
    }

    if(andStr.equals( " and "))
        hql += " where ";

    hql += condStr.toString();
    List activities = factory.find(hql,markers,values);
    return ActivityVoAssembler.createActivityVoCollectionFromActivity(activities).sort();       

}
项目:openmaxims-linux    文件:ProfilesSlotGenericImpl.java   
/**
* listActivities
*/
public ActivityVoCollection listActivities() 
{   
    DomainFactory factory = getDomainFactory();
    // For profile Slot, we want to list
    // all activities for appointment activity type
    String hql = " from Activity act where act.activityType.id = :activityType and act.isActive = :active";
    List lst = factory.find(hql, new String[]{"activityType", "active"}, new Object[]{new Integer(ActivityType.APPOINTMENTTYPES.getId()), Boolean.TRUE});
    return (ActivityVoAssembler.createActivityVoCollectionFromActivity(lst));
}
项目:openmaxims-linux    文件:Logic.java   
protected void onQmbActivityTextSubmited(String value) throws PresentationLogicException
{
    // search for activity based on text submitted and optionally activity
    // type.
    ActivityVoCollection voCollActivity = null;
    try
    {
        voCollActivity = domain.listActivity(form.lyr1().Edit().lyrActivityFunction().tabPageActivity().qmbActivity().getEditedText(), form.lyr1().Edit().lyrActivityFunction().tabPageActivity().cmbActivityType().getValue(), new Boolean(true));
    }
    catch (DomainInterfaceException e)
    {
        engine.showMessage(e.getMessage());
        return;
    }

    form.lyr1().Edit().lyrActivityFunction().tabPageActivity().qmbActivity().clear();

    if (voCollActivity != null && voCollActivity.size() > 0)
    {
        for (int i = 0; i < voCollActivity.size(); i++)
        {
            form.lyr1().Edit().lyrActivityFunction().tabPageActivity().qmbActivity().newRow(voCollActivity.get(i), voCollActivity.get(i).getName());
        }
        if (voCollActivity.size() == 1)
            form.lyr1().Edit().lyrActivityFunction().tabPageActivity().qmbActivity().setValue(voCollActivity.get(0));
        else if (voCollActivity.size() > 1)
            form.lyr1().Edit().lyrActivityFunction().tabPageActivity().qmbActivity().showOpened();
    }

}
项目:openmaxims-linux    文件:ActivityImpl.java   
/**
    * Returns a list of all activities, or a list of active activities
    */
    public ims.core.vo.ActivityVoCollection listActivities(Boolean bActive)
    {              
        DomainFactory factory = getDomainFactory();     
        List activities = null;     
        StringBuffer hql = new StringBuffer(" ");
        String query = "from Activity a ";

        if (bActive.equals(Boolean.TRUE))
        {
            ArrayList markers = new ArrayList();
            ArrayList values = new ArrayList();

            hql.append(" a.isActive = :isActive");
            markers.add("isActive");
            values.add(bActive);            

            if (markers.size() > 0) query += " where ";
            query += hql.toString();

            activities = factory.find(query, markers, values, 1000);
        }   
        else
        {
            activities = factory.find(query,1000);          
        }

        return ActivityVoAssembler.createActivityVoCollectionFromActivity(activities).sort();
}
项目:openmaxims-linux    文件:ActivityImpl.java   
public ActivityVoCollection listNTPFActivities(Boolean isActive, LookupInstanceCollection activityTypeInstancesToExclude) 
{
    DomainFactory factory = getDomainFactory();     

    String hql = " from Activity act "; 
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    StringBuffer condStr = new StringBuffer();
    String andStr = " ";

    if(isActive != null)
    {
        condStr.append(andStr + " act.isActive = :isActive" );
        markers.add("isActive");
        values.add(isActive);       
        andStr = " and ";
    }
    if(activityTypeInstancesToExclude != null)
    {
        for(int i=0;i<activityTypeInstancesToExclude.size();i++)
        {
            String paramName = "actType" + String.valueOf(i);
            condStr.append(andStr + " act.activityType <> " + ":" + paramName );
            markers.add(paramName);
            values.add(getDomLookup(activityTypeInstancesToExclude.getIndex(i)));       
            andStr = " and ";
        }
    }

    if(andStr.equals( " and "))
        hql += " where ";

    hql += condStr.toString();
    List activities = factory.find(hql,markers,values);
    return ActivityVoAssembler.createActivityVoCollectionFromActivity(activities).sort();       

}
项目:AvoinApotti    文件:Logic.java   
private void loadActivities()
{
    ActivityVoCollection activities = domain.listActivities();  
    for (int i=0; i< activities.size(); i++)
        form.cmbActivity().newRow(activities.get(i),activities.get(i).getName());           
}
项目:AvoinApotti    文件:Logic.java   
private void loadActivities()
{
    ActivityVoCollection activities = domain.listActivities();  
    for (int i=0; i< activities.size(); i++)
        form.cmbActivity().newRow(activities.get(i),activities.get(i).getName());           
}
项目:AvoinApotti    文件:LocationServiceImpl.java   
public ActivityVoCollection listActivity(LocationServiceActivityVo locationServiceActivity) throws DomainInterfaceException
{
    DomainFactory factory = getDomainFactory();

    if (locationServiceActivity == null)
        return ActivityVoAssembler.createActivityVoCollectionFromActivity(factory.listDomainObjects(Activity.class));

    ActivityVoCollection voCollActivity = new ActivityVoCollection();

    String hql = "select locServiceActivity from LocationServiceActivity locServiceActivity, Procedure proc join proc.keywords as kw";
    StringBuffer condStr = new StringBuffer();
    String andStr = " ";

    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    condStr.append(andStr + " where locServiceActivity.serviceActivity is not null and locServiceActivity.serviceActivity.activity = proc.activity");
    andStr = " and ";

    if (locationServiceActivity.getLocationService() != null)
    {
        condStr.append(andStr + " locServiceActivity.locationService.id = :locService");
        markers.add("locService");
        values.add(locationServiceActivity.getLocationService().getID_LocationService());
        andStr = " and ";
    }

    if ((locationServiceActivity.getServiceActivityIsNotNull()) && (locationServiceActivity.getServiceActivity().getActivityIsNotNull()) && (locationServiceActivity.getServiceActivity().getActivity().getIsActiveIsNotNull()))
    {
        condStr.append(andStr + " locServiceActivity.serviceActivity.activity.isActive = :isActive");
        markers.add("isActive");
        values.add(locationServiceActivity.getServiceActivity().getActivity().getIsActive());
        andStr = " and ";
    }

    if ((locationServiceActivity.getLocationServiceIsNotNull()) && (locationServiceActivity.getLocationService().getIsActiveIsNotNull()))
    {
        condStr.append(andStr + " locServiceActivity.isActive = :isLSActive");
        markers.add("isLSActive");
        values.add(locationServiceActivity.getLocationService().getIsActive());
        andStr = " and ";
    }

    hql += condStr.toString();

    LocationServiceActivityVoCollection voCollLocServiceActivity = null;
    voCollLocServiceActivity = LocationServiceActivityVoAssembler.createLocationServiceActivityVoCollectionFromLocationServiceActivity(Keywords.searchByKeywords(factory, locationServiceActivity.getServiceActivity().getActivity().getName(), hql.toString(), markers, values));
    factory.getDomainSession().clearMessages();

    for (int i = 0; i < voCollLocServiceActivity.size(); i++)
    {
        if (voCollLocServiceActivity.get(i).getServiceActivityIsNotNull())
            voCollActivity.add(voCollLocServiceActivity.get(i).getServiceActivity().getActivity());
    }
    return voCollActivity.sort();
}
项目:AvoinApotti    文件:LocationServiceImpl.java   
public ims.core.vo.ActivityVoCollection listActivity(ims.core.vo.ActivityVo filterActivity)
{
    return listActivity(filterActivity, null);
}
项目:AvoinApotti    文件:LocationServiceImpl.java   
public ActivityVoCollection listActivity(ActivityVo filterActivity, Boolean checkDuplicate)
{
    DomainFactory factory = getDomainFactory();

    if (filterActivity == null)
        return ActivityVoAssembler.createActivityVoCollectionFromActivity(factory.listDomainObjects(Activity.class));

    String hql = " from Activity activity ";
    StringBuffer condStr = new StringBuffer();
    String andStr = " ";

    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    if (filterActivity.getNameIsNotNull())
    {
        // Checks the exact match
        if (checkDuplicate != null && checkDuplicate.booleanValue())
            condStr.append(andStr + " upper(activity.name) = :activityName");
        else
            condStr.append(andStr + " upper(activity.name) like :activityName");

        markers.add("activityName");
        values.add("%" + filterActivity.getName().toUpperCase() + "%");
        andStr = " and ";
    }
    if (filterActivity.getIsActiveIsNotNull())
    {
        condStr.append(andStr + " activity.isActive = :active");
        markers.add("active");
        values.add(filterActivity.getIsActive());
        andStr = " and ";
    }
    if (filterActivity.getActivityTypeIsNotNull())
    {
        condStr.append(andStr + " activity.activityType = :activityType");
        markers.add("activityType");
        values.add(getDomLookup(filterActivity.getActivityType()));
        andStr = " and ";
    }

    if (filterActivity.getIsWorkQueueIsNotNull())
    {
        condStr.append(andStr + " activity.isWorkQueue = :workQ ");
        markers.add("workQ");
        values.add(filterActivity.getIsWorkQueue());
        andStr = " and ";
    }

    if (andStr.equals(" and "))
        hql += " where ";

    hql += condStr.toString();
    return ActivityVoAssembler.createActivityVoCollectionFromActivity(factory.find(hql, markers, values)).sort();
}
项目:AvoinApotti    文件:ServiceImpl.java   
public ActivityVoCollection listActivity(String nameFilter, ActivityType activityType, Boolean bActive) throws DomainInterfaceException
{
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    StringBuffer condStr = new StringBuffer();
    String andStr = " ";
    String hql = null;
    DomainFactory factory = getDomainFactory();

    if (ConfigFlag.DOM.LINK_ACTIVITY_TO_PROCEDURE.getValue() && activityType.equals(ActivityType.PROCEDURE))
    {
        hql = "select act from Activity act, Procedure proc join proc.keywords as kw";
        condStr.append(andStr + " where act = proc.activity");
        andStr = " and ";

    }
    else
    {
        hql = "select act from Activity act";
        condStr.append(" where");
        andStr = " ";
    }

    if (bActive != null)
    {
        condStr.append(andStr + " act.isActive = :isActive");
        markers.add("isActive");
        values.add(bActive);
        andStr = " and ";
    }
    if (activityType != null)
    {
        condStr.append(andStr + " act.activityType =:actType");
        markers.add("actType");
        values.add(getDomLookup(activityType));
        andStr = " and ";
    }
    if (!ConfigFlag.DOM.LINK_ACTIVITY_TO_PROCEDURE.getValue() && nameFilter != "")
    {
        condStr.append(andStr + " act.name like :filterStr ");
        markers.add("filterStr");
        values.add(nameFilter + "%");
    }

    hql += condStr.toString();
    List activities = null;
    if (ConfigFlag.DOM.LINK_ACTIVITY_TO_PROCEDURE.getValue() && activityType.equals(ActivityType.PROCEDURE))
        activities = Keywords.searchByKeywords(factory, nameFilter, hql.toString(), markers, values);
    else
        activities = factory.find(hql, markers, values, 1000);

    return ActivityVoAssembler.createActivityVoCollectionFromActivity(activities).sort();
}
项目:openMAXIMS    文件:Logic.java   
private void loadActivities()
{
    ActivityVoCollection activities = domain.listActivitiesByService(form.getGlobalContext().Scheduling.getProfileService(),form.getLocalContext().getIsFlexible());    // wdev-20074domain.listActivities();   
    for (int i=0; i< activities.size(); i++)
        form.cmbActivity().newRow(activities.get(i),activities.get(i).getName());           
}
项目:openMAXIMS    文件:LocationServiceImpl.java   
public ActivityVoCollection listActivity(LocationServiceActivityVo locationServiceActivity) throws DomainInterfaceException
{
    DomainFactory factory = getDomainFactory();

    if (locationServiceActivity == null)
        return ActivityVoAssembler.createActivityVoCollectionFromActivity(factory.listDomainObjects(Activity.class));

    ActivityVoCollection voCollActivity = new ActivityVoCollection();

    String hql = "select locServiceActivity from LocationServiceActivity locServiceActivity, Procedure proc join proc.keywords as kw";
    StringBuffer condStr = new StringBuffer();
    String andStr = " ";

    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    condStr.append(andStr + " where locServiceActivity.serviceActivity is not null and locServiceActivity.serviceActivity.activity = proc.activity");
    andStr = " and ";

    if (locationServiceActivity.getLocationService() != null)
    {
        condStr.append(andStr + " locServiceActivity.locationService.id = :locService");
        markers.add("locService");
        values.add(locationServiceActivity.getLocationService().getID_LocationService());
        andStr = " and ";
    }

    if ((locationServiceActivity.getServiceActivityIsNotNull()) && (locationServiceActivity.getServiceActivity().getActivityIsNotNull()) && (locationServiceActivity.getServiceActivity().getActivity().getIsActiveIsNotNull()))
    {
        condStr.append(andStr + " locServiceActivity.serviceActivity.activity.isActive = :isActive");
        markers.add("isActive");
        values.add(locationServiceActivity.getServiceActivity().getActivity().getIsActive());
        andStr = " and ";
    }

    if ((locationServiceActivity.getLocationServiceIsNotNull()) && (locationServiceActivity.getLocationService().getIsActiveIsNotNull()))
    {
        condStr.append(andStr + " locServiceActivity.isActive = :isLSActive");
        markers.add("isLSActive");
        values.add(locationServiceActivity.getLocationService().getIsActive());
        andStr = " and ";
    }

    hql += condStr.toString();

    LocationServiceActivityVoCollection voCollLocServiceActivity = null;
    voCollLocServiceActivity = LocationServiceActivityVoAssembler.createLocationServiceActivityVoCollectionFromLocationServiceActivity(Keywords.searchByKeywords(factory, locationServiceActivity.getServiceActivity().getActivity().getName(), hql.toString(), markers, values));
    factory.getDomainSession().clearMessages();

    for (int i = 0; i < voCollLocServiceActivity.size(); i++)
    {
        if (voCollLocServiceActivity.get(i).getServiceActivityIsNotNull())
            voCollActivity.add(voCollLocServiceActivity.get(i).getServiceActivity().getActivity());
    }
    return voCollActivity.sort();
}
项目:openMAXIMS    文件:LocationServiceImpl.java   
public ims.core.vo.ActivityVoCollection listActivity(ims.core.vo.ActivityVo filterActivity)
{
    return listActivity(filterActivity, null);
}
项目:openMAXIMS    文件:LocationServiceImpl.java   
public ActivityVoCollection listActivity(ActivityVo filterActivity, Boolean checkDuplicate)
{
    DomainFactory factory = getDomainFactory();

    if (filterActivity == null)
        return ActivityVoAssembler.createActivityVoCollectionFromActivity(factory.listDomainObjects(Activity.class));

    String hql = " from Activity activity ";
    StringBuffer condStr = new StringBuffer();
    String andStr = " ";

    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    if (filterActivity.getNameIsNotNull())
    {
        // Checks the exact match
        if (checkDuplicate != null && checkDuplicate.booleanValue())
            condStr.append(andStr + " upper(activity.name) = :activityName");
        else
            condStr.append(andStr + " upper(activity.name) like :activityName");

        markers.add("activityName");
        values.add("%" + filterActivity.getName().toUpperCase() + "%");
        andStr = " and ";
    }
    if (filterActivity.getIsActiveIsNotNull())
    {
        condStr.append(andStr + " activity.isActive = :active");
        markers.add("active");
        values.add(filterActivity.getIsActive());
        andStr = " and ";
    }
    if (filterActivity.getActivityTypeIsNotNull())
    {
        condStr.append(andStr + " activity.activityType = :activityType");
        markers.add("activityType");
        values.add(getDomLookup(filterActivity.getActivityType()));
        andStr = " and ";
    }

    if (filterActivity.getIsWorkQueueIsNotNull())
    {
        condStr.append(andStr + " activity.isWorkQueue = :workQ ");
        markers.add("workQ");
        values.add(filterActivity.getIsWorkQueue());
        andStr = " and ";
    }

    if (andStr.equals(" and "))
        hql += " where ";

    hql += condStr.toString();
    return ActivityVoAssembler.createActivityVoCollectionFromActivity(factory.find(hql, markers, values)).sort();
}
项目:openMAXIMS    文件:ServiceImpl.java   
public ActivityVoCollection listActivity(String nameFilter, ActivityType activityType, Boolean bActive) throws DomainInterfaceException
{
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    StringBuffer condStr = new StringBuffer();
    String andStr = " ";
    String hql = null;
    DomainFactory factory = getDomainFactory();

    if (ConfigFlag.DOM.LINK_ACTIVITY_TO_PROCEDURE.getValue() && activityType.equals(ActivityType.PROCEDURE))
    {
        hql = "select act from Activity act, Procedure proc join proc.keywords as kw";
        condStr.append(andStr + " where act = proc.activity");
        andStr = " and ";

    }
    else
    {
        hql = "select act from Activity act";
        condStr.append(" where");
        andStr = " ";
    }

    if (bActive != null)
    {
        condStr.append(andStr + " act.isActive = :isActive");
        markers.add("isActive");
        values.add(bActive);
        andStr = " and ";
    }
    if (activityType != null)
    {
        condStr.append(andStr + " act.activityType =:actType");
        markers.add("actType");
        values.add(getDomLookup(activityType));
        andStr = " and ";
    }
    if (!ConfigFlag.DOM.LINK_ACTIVITY_TO_PROCEDURE.getValue() && nameFilter != "")
    {
        condStr.append(andStr + " act.name like :filterStr ");
        markers.add("filterStr");
        values.add(nameFilter + "%");
    }

    hql += condStr.toString();
    List activities = null;
    if (ConfigFlag.DOM.LINK_ACTIVITY_TO_PROCEDURE.getValue() && activityType.equals(ActivityType.PROCEDURE))
        activities = Keywords.searchByKeywords(factory, nameFilter, hql.toString(), markers, values);
    else
        activities = factory.find(hql, markers, values, 1000);

    return ActivityVoAssembler.createActivityVoCollectionFromActivity(activities).sort();
}
项目:openMAXIMS    文件:Logic.java   
private void loadActivities()
{
    ActivityVoCollection activities = domain.listActivities();  
    for (int i=0; i< activities.size(); i++)
        form.cmbActivity().newRow(activities.get(i),activities.get(i).getName());           
}
项目:openMAXIMS    文件:Logic.java   
private void loadActivities()
{
    ActivityVoCollection activities = domain.listActivities();  
    for (int i=0; i< activities.size(); i++)
        form.cmbActivity().newRow(activities.get(i),activities.get(i).getName());           
}
项目:openMAXIMS    文件:LocationServiceImpl.java   
public ActivityVoCollection listActivity(LocationServiceActivityVo locationServiceActivity) throws DomainInterfaceException
{
    DomainFactory factory = getDomainFactory();

    if (locationServiceActivity == null)
        return ActivityVoAssembler.createActivityVoCollectionFromActivity(factory.listDomainObjects(Activity.class));

    ActivityVoCollection voCollActivity = new ActivityVoCollection();

    String hql = "select locServiceActivity from LocationServiceActivity locServiceActivity, Procedure proc join proc.keywords as kw";
    StringBuffer condStr = new StringBuffer();
    String andStr = " ";

    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    condStr.append(andStr + " where locServiceActivity.serviceActivity is not null and locServiceActivity.serviceActivity.activity = proc.activity");
    andStr = " and ";

    if (locationServiceActivity.getLocationService() != null)
    {
        condStr.append(andStr + " locServiceActivity.locationService.id = :locService");
        markers.add("locService");
        values.add(locationServiceActivity.getLocationService().getID_LocationService());
        andStr = " and ";
    }

    if ((locationServiceActivity.getServiceActivityIsNotNull()) && (locationServiceActivity.getServiceActivity().getActivityIsNotNull()) && (locationServiceActivity.getServiceActivity().getActivity().getIsActiveIsNotNull()))
    {
        condStr.append(andStr + " locServiceActivity.serviceActivity.activity.isActive = :isActive");
        markers.add("isActive");
        values.add(locationServiceActivity.getServiceActivity().getActivity().getIsActive());
        andStr = " and ";
    }

    if ((locationServiceActivity.getLocationServiceIsNotNull()) && (locationServiceActivity.getLocationService().getIsActiveIsNotNull()))
    {
        condStr.append(andStr + " locServiceActivity.isActive = :isLSActive");
        markers.add("isLSActive");
        values.add(locationServiceActivity.getLocationService().getIsActive());
        andStr = " and ";
    }

    hql += condStr.toString();

    LocationServiceActivityVoCollection voCollLocServiceActivity = null;
    voCollLocServiceActivity = LocationServiceActivityVoAssembler.createLocationServiceActivityVoCollectionFromLocationServiceActivity(Keywords.searchByKeywords(factory, locationServiceActivity.getServiceActivity().getActivity().getName(), hql.toString(), markers, values));
    factory.getDomainSession().clearMessages();

    for (int i = 0; i < voCollLocServiceActivity.size(); i++)
    {
        if (voCollLocServiceActivity.get(i).getServiceActivityIsNotNull())
            voCollActivity.add(voCollLocServiceActivity.get(i).getServiceActivity().getActivity());
    }
    return voCollActivity.sort();
}
项目:openMAXIMS    文件:LocationServiceImpl.java   
public ims.core.vo.ActivityVoCollection listActivity(ims.core.vo.ActivityVo filterActivity)
{
    return listActivity(filterActivity, null);
}