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

项目:AvoinApotti    文件:Logic.java   
private DrawingGraphicFindingQuestionVo getInactiveRecord(QuestionInformationShortVo voQInfoShort)
{
    DrawingGraphicFindingQuestionVoCollection voColl = form.getLocalContext().getInactiveFindingQuestions();
    for (int i = 0; voColl != null && i < voColl.size(); i++)
    {
        if (voColl.get(i).getQuestionIsNotNull() && voColl.get(i).getQuestion().equals(voQInfoShort))
        {
            DrawingGraphicFindingQuestionVo voDrawingGraphicFindingQuestion = voColl.get(i);
            voColl.remove(voDrawingGraphicFindingQuestion);
            form.getLocalContext().setInactiveFindingQuestions(voColl);
            return voDrawingGraphicFindingQuestion;
        }
    }

    return null;
}
项目:AvoinApotti    文件:FindingQuestionsImpl.java   
public DrawingGraphicFindingQuestionVoCollection saveDrawingGraphicFindings(DrawingGraphicFindingQuestionVoCollection voColl) throws StaleObjectException
{
    if(voColl == null)
        throw new RuntimeException("Cannot save null values for DrawingGraphicFindingQuestionVoCollection");
    if(voColl.isValidated() == false)
        throw new CodingRuntimeException("DrawingGraphicFindingQuestionVoCollection has not been validated");

    DomainFactory factory = getDomainFactory();
    ArrayList doList = new ArrayList();
    for(int i=0; i<voColl.size(); i++)
    {
        DrawingGraphicFindingQuestion doDrawingGraphicFindingQuestion = DrawingGraphicFindingQuestionVoAssembler.extractDrawingGraphicFindingQuestion(factory, voColl.get(i));
        factory.save(doDrawingGraphicFindingQuestion);
        doList.add(doDrawingGraphicFindingQuestion);
    }

    return DrawingGraphicFindingQuestionVoAssembler.createDrawingGraphicFindingQuestionVoCollectionFromDrawingGraphicFindingQuestion(doList);
}
项目:AvoinApotti    文件:FindingQuestionsImpl.java   
/**
 * List active finding questions 
 */
public DrawingGraphicFindingQuestionVoCollection listDrawingGraphicFindings(Integer findingId)
{   
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("select dgfq from DrawingGraphicFindingQuestion as dgfq left join dgfq.question as dgql where (dgfq.drawingGraphicFinding.id = :findID and dgql.status.id != :statusID) order by dgfq.order asc ");  //wdev-10987
    ArrayList names  = new ArrayList();
    ArrayList values = new ArrayList();

    names.add("findID");
    values.add(findingId);

    names.add("statusID");
    values.add(getDomLookup(PreActiveActiveInactiveStatus.INACTIVE).getId());       

    List findingsList = factory.find(hql.toString(), names, values);
    return DrawingGraphicFindingQuestionVoAssembler.createDrawingGraphicFindingQuestionVoCollectionFromDrawingGraphicFindingQuestion(findingsList);
}
项目:openMAXIMS    文件:Logic.java   
private DrawingGraphicFindingQuestionVo getInactiveRecord(QuestionInformationShortVo voQInfoShort)
{
    DrawingGraphicFindingQuestionVoCollection voColl = form.getLocalContext().getInactiveFindingQuestions();
    for (int i = 0; voColl != null && i < voColl.size(); i++)
    {
        if (voColl.get(i).getQuestionIsNotNull() && voColl.get(i).getQuestion().equals(voQInfoShort))
        {
            DrawingGraphicFindingQuestionVo voDrawingGraphicFindingQuestion = voColl.get(i);
            voColl.remove(voDrawingGraphicFindingQuestion);
            form.getLocalContext().setInactiveFindingQuestions(voColl);
            return voDrawingGraphicFindingQuestion;
        }
    }

    return null;
}
项目:openMAXIMS    文件:FindingQuestionsImpl.java   
public DrawingGraphicFindingQuestionVoCollection saveDrawingGraphicFindings(DrawingGraphicFindingQuestionVoCollection voColl) throws StaleObjectException
{
    if(voColl == null)
        throw new RuntimeException("Cannot save null values for DrawingGraphicFindingQuestionVoCollection");
    if(voColl.isValidated() == false)
        throw new CodingRuntimeException("DrawingGraphicFindingQuestionVoCollection has not been validated");

    DomainFactory factory = getDomainFactory();
    ArrayList doList = new ArrayList();
    for(int i=0; i<voColl.size(); i++)
    {
        DrawingGraphicFindingQuestion doDrawingGraphicFindingQuestion = DrawingGraphicFindingQuestionVoAssembler.extractDrawingGraphicFindingQuestion(factory, voColl.get(i));
        factory.save(doDrawingGraphicFindingQuestion);
        doList.add(doDrawingGraphicFindingQuestion);
    }

    return DrawingGraphicFindingQuestionVoAssembler.createDrawingGraphicFindingQuestionVoCollectionFromDrawingGraphicFindingQuestion(doList);
}
项目:openMAXIMS    文件:FindingQuestionsImpl.java   
/**
 * List active finding questions 
 */
public DrawingGraphicFindingQuestionVoCollection listDrawingGraphicFindings(Integer findingId)
{   
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("select dgfq from DrawingGraphicFindingQuestion as dgfq left join dgfq.question as dgql where (dgfq.drawingGraphicFinding.id = :findID and dgql.status.id != :statusID) order by dgfq.order asc ");  //wdev-10987
    ArrayList names  = new ArrayList();
    ArrayList values = new ArrayList();

    names.add("findID");
    values.add(findingId);

    names.add("statusID");
    values.add(getDomLookup(PreActiveActiveInactiveStatus.INACTIVE).getId());       

    List findingsList = factory.find(hql.toString(), names, values);
    return DrawingGraphicFindingQuestionVoAssembler.createDrawingGraphicFindingQuestionVoCollectionFromDrawingGraphicFindingQuestion(findingsList);
}
项目:openMAXIMS    文件:Logic.java   
private DrawingGraphicFindingQuestionVo getInactiveRecord(QuestionInformationShortVo voQInfoShort)
{
    DrawingGraphicFindingQuestionVoCollection voColl = form.getLocalContext().getInactiveFindingQuestions();
    for (int i = 0; voColl != null && i < voColl.size(); i++)
    {
        if (voColl.get(i).getQuestionIsNotNull() && voColl.get(i).getQuestion().equals(voQInfoShort))
        {
            DrawingGraphicFindingQuestionVo voDrawingGraphicFindingQuestion = voColl.get(i);
            voColl.remove(voDrawingGraphicFindingQuestion);
            form.getLocalContext().setInactiveFindingQuestions(voColl);
            return voDrawingGraphicFindingQuestion;
        }
    }

    return null;
}
项目:openMAXIMS    文件:FindingQuestionsImpl.java   
public DrawingGraphicFindingQuestionVoCollection saveDrawingGraphicFindings(DrawingGraphicFindingQuestionVoCollection voColl) throws StaleObjectException
{
    if(voColl == null)
        throw new RuntimeException("Cannot save null values for DrawingGraphicFindingQuestionVoCollection");
    if(voColl.isValidated() == false)
        throw new CodingRuntimeException("DrawingGraphicFindingQuestionVoCollection has not been validated");

    DomainFactory factory = getDomainFactory();
    ArrayList doList = new ArrayList();
    for(int i=0; i<voColl.size(); i++)
    {
        DrawingGraphicFindingQuestion doDrawingGraphicFindingQuestion = DrawingGraphicFindingQuestionVoAssembler.extractDrawingGraphicFindingQuestion(factory, voColl.get(i));
        factory.save(doDrawingGraphicFindingQuestion);
        doList.add(doDrawingGraphicFindingQuestion);
    }

    return DrawingGraphicFindingQuestionVoAssembler.createDrawingGraphicFindingQuestionVoCollectionFromDrawingGraphicFindingQuestion(doList);
}
项目:openMAXIMS    文件:FindingQuestionsImpl.java   
/**
 * List active finding questions 
 */
public DrawingGraphicFindingQuestionVoCollection listDrawingGraphicFindings(Integer findingId)
{   
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("select dgfq from DrawingGraphicFindingQuestion as dgfq left join dgfq.question as dgql where (dgfq.drawingGraphicFinding.id = :findID and dgql.status.id != :statusID) order by dgfq.order asc ");  //wdev-10987
    ArrayList names  = new ArrayList();
    ArrayList values = new ArrayList();

    names.add("findID");
    values.add(findingId);

    names.add("statusID");
    values.add(getDomLookup(PreActiveActiveInactiveStatus.INACTIVE).getId());       

    List findingsList = factory.find(hql.toString(), names, values);
    return DrawingGraphicFindingQuestionVoAssembler.createDrawingGraphicFindingQuestionVoCollectionFromDrawingGraphicFindingQuestion(findingsList);
}
项目:openmaxims-linux    文件:Logic.java   
private DrawingGraphicFindingQuestionVo getInactiveRecord(QuestionInformationShortVo voQInfoShort)
{
    DrawingGraphicFindingQuestionVoCollection voColl = form.getLocalContext().getInactiveFindingQuestions();
    for (int i = 0; voColl != null && i < voColl.size(); i++)
    {
        if (voColl.get(i).getQuestionIsNotNull() && voColl.get(i).getQuestion().equals(voQInfoShort))
        {
            DrawingGraphicFindingQuestionVo voDrawingGraphicFindingQuestion = voColl.get(i);
            voColl.remove(voDrawingGraphicFindingQuestion);
            form.getLocalContext().setInactiveFindingQuestions(voColl);
            return voDrawingGraphicFindingQuestion;
        }
    }

    return null;
}
项目:openmaxims-linux    文件:FindingQuestionsImpl.java   
public DrawingGraphicFindingQuestionVoCollection saveDrawingGraphicFindings(DrawingGraphicFindingQuestionVoCollection voColl) throws StaleObjectException
{
    if(voColl == null)
        throw new RuntimeException("Cannot save null values for DrawingGraphicFindingQuestionVoCollection");
    if(voColl.isValidated() == false)
        throw new CodingRuntimeException("DrawingGraphicFindingQuestionVoCollection has not been validated");

    DomainFactory factory = getDomainFactory();
    ArrayList doList = new ArrayList();
    for(int i=0; i<voColl.size(); i++)
    {
        DrawingGraphicFindingQuestion doDrawingGraphicFindingQuestion = DrawingGraphicFindingQuestionVoAssembler.extractDrawingGraphicFindingQuestion(factory, voColl.get(i));
        factory.save(doDrawingGraphicFindingQuestion);
        doList.add(doDrawingGraphicFindingQuestion);
    }

    return DrawingGraphicFindingQuestionVoAssembler.createDrawingGraphicFindingQuestionVoCollectionFromDrawingGraphicFindingQuestion(doList);
}
项目:openmaxims-linux    文件:FindingQuestionsImpl.java   
/**
 * List active finding questions 
 */
public DrawingGraphicFindingQuestionVoCollection listDrawingGraphicFindings(Integer findingId)
{   
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("select dgfq from DrawingGraphicFindingQuestion as dgfq left join dgfq.question as dgql where (dgfq.drawingGraphicFinding.id = :findID and dgql.status.id != :statusID) order by dgfq.order asc ");  //wdev-10987
    ArrayList names  = new ArrayList();
    ArrayList values = new ArrayList();

    names.add("findID");
    values.add(findingId);

    names.add("statusID");
    values.add(getDomLookup(PreActiveActiveInactiveStatus.INACTIVE).getId());       

    List findingsList = factory.find(hql.toString(), names, values);
    return DrawingGraphicFindingQuestionVoAssembler.createDrawingGraphicFindingQuestionVoCollectionFromDrawingGraphicFindingQuestion(findingsList);
}
项目:AvoinApotti    文件:Logic.java   
private boolean save()
{
    DrawingGraphicFindingVo voDGFsaved = saveDrawingGraphicFinding();
    if (voDGFsaved == null)
        return false;

    //DrawingGraphicFindingQuestionVo voDrawingGraphicFinding = form.getLocalContext().getVoDrawingGraphicFindingQuestion();
    //Save the finding to the rest of Drawing Grapgic Finding Question
    //--------------------------------------------------------------------------------------------
    form.getLocalContext().setInactiveFindingQuestions( refreshInactiveFindingQuestions(voDGFsaved));
    //----------------------------------------------------------------------------------------------
    DrawingGraphicFindingQuestionVoCollection voColl = getDrawingGraphicFindingFromGrid(voDGFsaved);

    String[] activeErrors = validateActiveErrors(voColl);
    String[] errors = voColl.validate(activeErrors);
    if (errors != null)
    {
        engine.showErrors(errors);
        return false;
    }

    try
    {
        domain.saveDrawingGraphicFindings(voColl);
    }
    catch (StaleObjectException e)
    {
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        return false;
    }

    return true;
}
项目:AvoinApotti    文件:Logic.java   
private DrawingGraphicFindingQuestionVoCollection refreshInactiveFindingQuestions(DrawingGraphicFindingVo voDrawGraphicFinding)
{

    DrawingGraphicFindingQuestionVoCollection voColl = form.getLocalContext().getInactiveFindingQuestions();
    if (voColl == null)
        return null;
    for(DrawingGraphicFindingQuestionVo temp: voColl)
    {
        temp.setDrawingGraphicFinding(voDrawGraphicFinding);
    }
    return voColl;
}
项目:AvoinApotti    文件:Logic.java   
private String[] validateActiveErrors(DrawingGraphicFindingQuestionVoCollection voColl)
{
    if(voColl == null)
        return null;
    ArrayList errors = new ArrayList();
    for(int i = 0; i < voColl.size(); i++)
    {
        DrawingGraphicFindingQuestionVo voDGFQ   = voColl.get(i);
        DrawingGraphicFindingVo voDGFinding      = voDGFQ.getDrawingGraphicFinding();
        QuestionInformationShortVo voQInforShort = voDGFQ.getQuestion();

        //WDEV-1213 - Don't allow the inactive to be checked
        if(voDGFQ.getActiveIsNotNull() && voDGFQ.getActive().booleanValue() && voDGFinding != null)
        {
            if(voDGFinding.getActiveStatusIsNotNull() && voDGFinding.getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
            {
                //Question
                if(voQInforShort != null && voQInforShort.getStatusIsNotNull() && !voQInforShort.getStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
                {
                    errors.add("'" + voQInforShort.getText() + "' question has to be active");
                }
            }
        }
    }

    if (errors.size() == 0)
        return null;

    String[] findingErrors = new String[errors.size()];
    errors.toArray(findingErrors);

    return findingErrors;
}
项目:openMAXIMS    文件:Logic.java   
private boolean save()
{
    DrawingGraphicFindingVo voDGFsaved = saveDrawingGraphicFinding();
    if (voDGFsaved == null)
        return false;

    //DrawingGraphicFindingQuestionVo voDrawingGraphicFinding = form.getLocalContext().getVoDrawingGraphicFindingQuestion();
    //Save the finding to the rest of Drawing Grapgic Finding Question
    //--------------------------------------------------------------------------------------------
    form.getLocalContext().setInactiveFindingQuestions( refreshInactiveFindingQuestions(voDGFsaved));
    //----------------------------------------------------------------------------------------------
    DrawingGraphicFindingQuestionVoCollection voColl = getDrawingGraphicFindingFromGrid(voDGFsaved);

    String[] activeErrors = validateActiveErrors(voColl);
    String[] errors = voColl.validate(activeErrors);
    if (errors != null)
    {
        engine.showErrors(errors);
        return false;
    }

    try
    {
        domain.saveDrawingGraphicFindings(voColl);
    }
    catch (StaleObjectException e)
    {
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        return false;
    }

    return true;
}
项目:openMAXIMS    文件:Logic.java   
private DrawingGraphicFindingQuestionVoCollection refreshInactiveFindingQuestions(DrawingGraphicFindingVo voDrawGraphicFinding)
{

    DrawingGraphicFindingQuestionVoCollection voColl = form.getLocalContext().getInactiveFindingQuestions();
    if (voColl == null)
        return null;
    for(DrawingGraphicFindingQuestionVo temp: voColl)
    {
        temp.setDrawingGraphicFinding(voDrawGraphicFinding);
    }
    return voColl;
}
项目:openMAXIMS    文件:Logic.java   
private String[] validateActiveErrors(DrawingGraphicFindingQuestionVoCollection voColl)
{
    if(voColl == null)
        return null;
    ArrayList errors = new ArrayList();
    for(int i = 0; i < voColl.size(); i++)
    {
        DrawingGraphicFindingQuestionVo voDGFQ   = voColl.get(i);
        DrawingGraphicFindingVo voDGFinding      = voDGFQ.getDrawingGraphicFinding();
        QuestionInformationShortVo voQInforShort = voDGFQ.getQuestion();

        //WDEV-1213 - Don't allow the inactive to be checked
        if(voDGFQ.getActiveIsNotNull() && voDGFQ.getActive().booleanValue() && voDGFinding != null)
        {
            if(voDGFinding.getActiveStatusIsNotNull() && voDGFinding.getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
            {
                //Question
                if(voQInforShort != null && voQInforShort.getStatusIsNotNull() && !voQInforShort.getStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
                {
                    errors.add("'" + voQInforShort.getText() + "' question has to be active");
                }
            }
        }
    }

    if (errors.size() == 0)
        return null;

    String[] findingErrors = new String[errors.size()];
    errors.toArray(findingErrors);

    return findingErrors;
}
项目:openMAXIMS    文件:Logic.java   
private boolean save()
{
    DrawingGraphicFindingVo voDGFsaved = saveDrawingGraphicFinding();
    if (voDGFsaved == null)
        return false;

    //DrawingGraphicFindingQuestionVo voDrawingGraphicFinding = form.getLocalContext().getVoDrawingGraphicFindingQuestion();
    //Save the finding to the rest of Drawing Grapgic Finding Question
    //--------------------------------------------------------------------------------------------
    form.getLocalContext().setInactiveFindingQuestions( refreshInactiveFindingQuestions(voDGFsaved));
    //----------------------------------------------------------------------------------------------
    DrawingGraphicFindingQuestionVoCollection voColl = getDrawingGraphicFindingFromGrid(voDGFsaved);

    String[] activeErrors = validateActiveErrors(voColl);
    String[] errors = voColl.validate(activeErrors);
    if (errors != null)
    {
        engine.showErrors(errors);
        return false;
    }

    try
    {
        domain.saveDrawingGraphicFindings(voColl);
    }
    catch (StaleObjectException e)
    {
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        return false;
    }

    return true;
}
项目:openMAXIMS    文件:Logic.java   
private DrawingGraphicFindingQuestionVoCollection refreshInactiveFindingQuestions(DrawingGraphicFindingVo voDrawGraphicFinding)
{

    DrawingGraphicFindingQuestionVoCollection voColl = form.getLocalContext().getInactiveFindingQuestions();
    if (voColl == null)
        return null;
    for(DrawingGraphicFindingQuestionVo temp: voColl)
    {
        temp.setDrawingGraphicFinding(voDrawGraphicFinding);
    }
    return voColl;
}
项目:openMAXIMS    文件:Logic.java   
private String[] validateActiveErrors(DrawingGraphicFindingQuestionVoCollection voColl)
{
    if(voColl == null)
        return null;
    ArrayList errors = new ArrayList();
    for(int i = 0; i < voColl.size(); i++)
    {
        DrawingGraphicFindingQuestionVo voDGFQ   = voColl.get(i);
        DrawingGraphicFindingVo voDGFinding      = voDGFQ.getDrawingGraphicFinding();
        QuestionInformationShortVo voQInforShort = voDGFQ.getQuestion();

        //WDEV-1213 - Don't allow the inactive to be checked
        if(voDGFQ.getActiveIsNotNull() && voDGFQ.getActive().booleanValue() && voDGFinding != null)
        {
            if(voDGFinding.getActiveStatusIsNotNull() && voDGFinding.getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
            {
                //Question
                if(voQInforShort != null && voQInforShort.getStatusIsNotNull() && !voQInforShort.getStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
                {
                    errors.add("'" + voQInforShort.getText() + "' question has to be active");
                }
            }
        }
    }

    if (errors.size() == 0)
        return null;

    String[] findingErrors = new String[errors.size()];
    errors.toArray(findingErrors);

    return findingErrors;
}
项目:openmaxims-linux    文件:Logic.java   
private boolean save()
{
    DrawingGraphicFindingVo voDGFsaved = saveDrawingGraphicFinding();
    if (voDGFsaved == null)
        return false;

    //DrawingGraphicFindingQuestionVo voDrawingGraphicFinding = form.getLocalContext().getVoDrawingGraphicFindingQuestion();
    //Save the finding to the rest of Drawing Grapgic Finding Question
    //--------------------------------------------------------------------------------------------
    form.getLocalContext().setInactiveFindingQuestions( refreshInactiveFindingQuestions(voDGFsaved));
    //----------------------------------------------------------------------------------------------
    DrawingGraphicFindingQuestionVoCollection voColl = getDrawingGraphicFindingFromGrid(voDGFsaved);

    String[] activeErrors = validateActiveErrors(voColl);
    String[] errors = voColl.validate(activeErrors);
    if (errors != null)
    {
        engine.showErrors(errors);
        return false;
    }

    try
    {
        domain.saveDrawingGraphicFindings(voColl);
    }
    catch (StaleObjectException e)
    {
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        return false;
    }

    return true;
}
项目:openmaxims-linux    文件:Logic.java   
private DrawingGraphicFindingQuestionVoCollection refreshInactiveFindingQuestions(DrawingGraphicFindingVo voDrawGraphicFinding)
{

    DrawingGraphicFindingQuestionVoCollection voColl = form.getLocalContext().getInactiveFindingQuestions();
    if (voColl == null)
        return null;
    for(DrawingGraphicFindingQuestionVo temp: voColl)
    {
        temp.setDrawingGraphicFinding(voDrawGraphicFinding);
    }
    return voColl;
}
项目:openmaxims-linux    文件:Logic.java   
private String[] validateActiveErrors(DrawingGraphicFindingQuestionVoCollection voColl)
{
    if(voColl == null)
        return null;
    ArrayList errors = new ArrayList();
    for(int i = 0; i < voColl.size(); i++)
    {
        DrawingGraphicFindingQuestionVo voDGFQ   = voColl.get(i);
        DrawingGraphicFindingVo voDGFinding      = voDGFQ.getDrawingGraphicFinding();
        QuestionInformationShortVo voQInforShort = voDGFQ.getQuestion();

        //WDEV-1213 - Don't allow the inactive to be checked
        if(voDGFQ.getActiveIsNotNull() && voDGFQ.getActive().booleanValue() && voDGFinding != null)
        {
            if(voDGFinding.getActiveStatusIsNotNull() && voDGFinding.getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
            {
                //Question
                if(voQInforShort != null && voQInforShort.getStatusIsNotNull() && !voQInforShort.getStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
                {
                    errors.add("'" + voQInforShort.getText() + "' question has to be active");
                }
            }
        }
    }

    if (errors.size() == 0)
        return null;

    String[] findingErrors = new String[errors.size()];
    errors.toArray(findingErrors);

    return findingErrors;
}