Java 类ims.admin.vo.domain.BusinessRuleVoAssembler 实例源码

项目:AvoinApotti    文件:RulesPriorityEditorImpl.java   
/**
 * 
 */
public BusinessRuleVoCollection list(RulesEngineEntity entity)
{
    if (entity == null)
        return null;

    DomainFactory factory = getDomainFactory();
    IMSCriteria criteria = new IMSCriteria(BusinessRule.class, factory);
    criteria.equal("this.rootEntity", entity.getId());
    criteria.equal("this.active", true);

    List rules = criteria.find();
    Collections.sort(rules, new BusinessRuleComparator(SortOrder.DESCENDING));

    return BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(rules);
}
项目:AvoinApotti    文件:RulesListImpl.java   
public BusinessRuleVoCollection listRules(Boolean activeOnly, String name, String entityID) throws DomainInterfaceException
{
    DomainFactory factory = getDomainFactory();

    IMSCriteria criteria = new IMSCriteria(BusinessRule.class, factory);

    if (activeOnly)
    {
        criteria.equal("this.active", true);
    }

    if (name != null && name.length() > 0)
    {
        criteria.like("this.name", "%" + name + "%");
    }

    if (entityID != null)
    {
        criteria.equal("this.rootEntity", entityID);
    }

    List list = criteria.find();
    Collections.sort(list, new BusinessRuleComparator(SortOrder.DESCENDING));

    return BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(list);
}
项目:openMAXIMS    文件:RulesPriorityEditorImpl.java   
/**
 * 
 */
public BusinessRuleVoCollection list(RulesEngineEntity entity)
{
    if (entity == null)
        return null;

    DomainFactory factory = getDomainFactory();
    IMSCriteria criteria = new IMSCriteria(BusinessRule.class, factory);
    criteria.equal("this.rootEntity", entity.getId());
    criteria.equal("this.active", true);

    List rules = criteria.find();
    Collections.sort(rules, new BusinessRuleComparator(SortOrder.DESCENDING));

    return BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(rules);
}
项目:openMAXIMS    文件:RulesListImpl.java   
public BusinessRuleVoCollection listRules(Boolean activeOnly, String name, String entityID) throws DomainInterfaceException
{
    DomainFactory factory = getDomainFactory();

    IMSCriteria criteria = new IMSCriteria(BusinessRule.class, factory);

    if (activeOnly)
    {
        criteria.equal("this.active", true);
    }

    if (name != null && name.length() > 0)
    {
        criteria.like("this.name", "%" + name + "%");
    }

    if (entityID != null)
    {
        criteria.equal("this.rootEntity", entityID);
    }

    List list = criteria.find();
    Collections.sort(list, new BusinessRuleComparator(SortOrder.DESCENDING));

    return BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(list);
}
项目:openMAXIMS    文件:RulesPriorityEditorImpl.java   
/**
 * 
 */
public BusinessRuleVoCollection list(RulesEngineEntity entity)
{
    if (entity == null)
        return null;

    DomainFactory factory = getDomainFactory();
    IMSCriteria criteria = new IMSCriteria(BusinessRule.class, factory);
    criteria.equal("this.rootEntity", entity.getId());
    criteria.equal("this.active", true);

    List rules = criteria.find();
    Collections.sort(rules, new BusinessRuleComparator(SortOrder.DESCENDING));

    return BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(rules);
}
项目:openMAXIMS    文件:RulesListImpl.java   
public BusinessRuleVoCollection listRules(Boolean activeOnly, String name, String entityID) throws DomainInterfaceException
{
    DomainFactory factory = getDomainFactory();

    IMSCriteria criteria = new IMSCriteria(BusinessRule.class, factory);

    if (activeOnly)
    {
        criteria.equal("this.active", true);
    }

    if (name != null && name.length() > 0)
    {
        criteria.like("this.name", "%" + name + "%");
    }

    if (entityID != null)
    {
        criteria.equal("this.rootEntity", entityID);
    }

    List list = criteria.find();
    Collections.sort(list, new BusinessRuleComparator(SortOrder.DESCENDING));

    return BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(list);
}
项目:openmaxims-linux    文件:RulesPriorityEditorImpl.java   
/**
 * 
 */
public BusinessRuleVoCollection list(RulesEngineEntity entity)
{
    if (entity == null)
        return null;

    DomainFactory factory = getDomainFactory();
    IMSCriteria criteria = new IMSCriteria(BusinessRule.class, factory);
    criteria.equal("this.rootEntity", entity.getId());
    criteria.equal("this.active", true);

    List rules = criteria.find();
    Collections.sort(rules, new BusinessRuleComparator(SortOrder.DESCENDING));

    return BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(rules);
}
项目:openmaxims-linux    文件:RulesListImpl.java   
public BusinessRuleVoCollection listRules(Boolean activeOnly, String name, String entityID) throws DomainInterfaceException
{
    DomainFactory factory = getDomainFactory();

    IMSCriteria criteria = new IMSCriteria(BusinessRule.class, factory);

    if (activeOnly)
    {
        criteria.equal("this.active", true);
    }

    if (name != null && name.length() > 0)
    {
        criteria.like("this.name", "%" + name + "%");
    }

    if (entityID != null)
    {
        criteria.equal("this.rootEntity", entityID);
    }

    List list = criteria.find();
    Collections.sort(list, new BusinessRuleComparator(SortOrder.DESCENDING));

    return BusinessRuleVoAssembler.createBusinessRuleVoCollectionFromBusinessRule(list);
}
项目:AvoinApotti    文件:RulesEditImpl.java   
public BusinessRuleVo save(BusinessRuleVo rule) throws ims.domain.exceptions.StaleObjectException, UnqViolationUncheckedException
{
    if(rule == null)
        throw new CodingRuntimeException("BusinessRuleVo is null");     

    DomainFactory factory = getDomainFactory();     
    BusinessRule dom = BusinessRuleVoAssembler.extractBusinessRule(factory,rule);       
    factory.save(dom);      
    return BusinessRuleVoAssembler.create(dom);                 
}
项目:AvoinApotti    文件:RulesPriorityEditorImpl.java   
/**
 * 
 */
public BusinessRuleVoCollection save(BusinessRuleVoCollection rules) throws DomainInterfaceException, StaleObjectException, ForeignKeyViolationException, UniqueKeyViolationException
{
    if (rules == null)
        throw new CodingRuntimeException("Major Logical Error - Rules collection must not be null");

    DomainFactory factory = getDomainFactory();

    for (int i = 0; i < rules.size(); i++)
    {
        BusinessRuleVo rule = rules.get(i);
        BusinessRule domRule = BusinessRuleVoAssembler.extractBusinessRule(factory, rule);          

        if (rule.getXmlContent() == null)
            throw new CodingRuntimeException("Major Logical Error - XML Content cannot be null");

        String xml;
        try {
            IRule iRule = RuleXmlSerialization.deserializeFromXml(rule.getXmlContent(), Entities.getInstance());
            iRule.setPriority(rule.getPriority());
            xml = RuleXmlSerialization.serialize(iRule);
            domRule.setXmlContent(xml);
            factory.save(domRule);
        }
        catch (Exception e) 
        {
            throw new DomainInterfaceException(e.getMessage());             
        }               
    }

    // Return null
    return null;
}
项目:openMAXIMS    文件:RulesEditImpl.java   
public BusinessRuleVo save(BusinessRuleVo rule) throws ims.domain.exceptions.StaleObjectException, UnqViolationUncheckedException
{
    if(rule == null)
        throw new CodingRuntimeException("BusinessRuleVo is null");     

    DomainFactory factory = getDomainFactory();     
    BusinessRule dom = BusinessRuleVoAssembler.extractBusinessRule(factory,rule);       
    factory.save(dom);      
    return BusinessRuleVoAssembler.create(dom);                 
}
项目:openMAXIMS    文件:RulesPriorityEditorImpl.java   
/**
 * 
 */
public BusinessRuleVoCollection save(BusinessRuleVoCollection rules) throws DomainInterfaceException, StaleObjectException, ForeignKeyViolationException, UniqueKeyViolationException
{
    if (rules == null)
        throw new CodingRuntimeException("Major Logical Error - Rules collection must not be null");

    DomainFactory factory = getDomainFactory();

    for (int i = 0; i < rules.size(); i++)
    {
        BusinessRuleVo rule = rules.get(i);
        BusinessRule domRule = BusinessRuleVoAssembler.extractBusinessRule(factory, rule);          

        if (rule.getXmlContent() == null)
            throw new CodingRuntimeException("Major Logical Error - XML Content cannot be null");

        String xml;
        try {
            IRule iRule = RuleXmlSerialization.deserializeFromXml(rule.getXmlContent(), Entities.getInstance());
            iRule.setPriority(rule.getPriority());
            xml = RuleXmlSerialization.serialize(iRule);
            domRule.setXmlContent(xml);
            factory.save(domRule);
        }
        catch (Exception e) 
        {
            throw new DomainInterfaceException(e.getMessage());             
        }               
    }

    // Return null
    return null;
}
项目:openMAXIMS    文件:RulesEditImpl.java   
public BusinessRuleVo save(BusinessRuleVo rule) throws ims.domain.exceptions.StaleObjectException, UnqViolationUncheckedException
{
    if(rule == null)
        throw new CodingRuntimeException("BusinessRuleVo is null");     

    DomainFactory factory = getDomainFactory();     
    BusinessRule dom = BusinessRuleVoAssembler.extractBusinessRule(factory,rule);       
    factory.save(dom);      
    return BusinessRuleVoAssembler.create(dom);                 
}
项目:openMAXIMS    文件:RulesPriorityEditorImpl.java   
/**
 * 
 */
public BusinessRuleVoCollection save(BusinessRuleVoCollection rules) throws DomainInterfaceException, StaleObjectException, ForeignKeyViolationException, UniqueKeyViolationException
{
    if (rules == null)
        throw new CodingRuntimeException("Major Logical Error - Rules collection must not be null");

    DomainFactory factory = getDomainFactory();

    for (int i = 0; i < rules.size(); i++)
    {
        BusinessRuleVo rule = rules.get(i);
        BusinessRule domRule = BusinessRuleVoAssembler.extractBusinessRule(factory, rule);          

        if (rule.getXmlContent() == null)
            throw new CodingRuntimeException("Major Logical Error - XML Content cannot be null");

        String xml;
        try {
            IRule iRule = RuleXmlSerialization.deserializeFromXml(rule.getXmlContent(), Entities.getInstance());
            iRule.setPriority(rule.getPriority());
            xml = RuleXmlSerialization.serialize(iRule);
            domRule.setXmlContent(xml);
            factory.save(domRule);
        }
        catch (Exception e) 
        {
            throw new DomainInterfaceException(e.getMessage());             
        }               
    }

    // Return null
    return null;
}
项目:openmaxims-linux    文件:RulesEditImpl.java   
public BusinessRuleVo save(BusinessRuleVo rule) throws ims.domain.exceptions.StaleObjectException, UnqViolationUncheckedException
{
    if(rule == null)
        throw new CodingRuntimeException("BusinessRuleVo is null");     

    DomainFactory factory = getDomainFactory();     
    BusinessRule dom = BusinessRuleVoAssembler.extractBusinessRule(factory,rule);       
    factory.save(dom);      
    return BusinessRuleVoAssembler.create(dom);                 
}
项目:openmaxims-linux    文件:RulesPriorityEditorImpl.java   
/**
 * 
 */
public BusinessRuleVoCollection save(BusinessRuleVoCollection rules) throws DomainInterfaceException, StaleObjectException, ForeignKeyViolationException, UniqueKeyViolationException
{
    if (rules == null)
        throw new CodingRuntimeException("Major Logical Error - Rules collection must not be null");

    DomainFactory factory = getDomainFactory();

    for (int i = 0; i < rules.size(); i++)
    {
        BusinessRuleVo rule = rules.get(i);
        BusinessRule domRule = BusinessRuleVoAssembler.extractBusinessRule(factory, rule);          

        if (rule.getXmlContent() == null)
            throw new CodingRuntimeException("Major Logical Error - XML Content cannot be null");

        String xml;
        try {
            IRule iRule = RuleXmlSerialization.deserializeFromXml(rule.getXmlContent(), Entities.getInstance());
            iRule.setPriority(rule.getPriority());
            xml = RuleXmlSerialization.serialize(iRule);
            domRule.setXmlContent(xml);
            factory.save(domRule);
        }
        catch (Exception e) 
        {
            throw new DomainInterfaceException(e.getMessage());             
        }               
    }

    // Return null
    return null;
}