Examples of EntityFactory


Examples of com.dtrules.session.EntityFactory

            }catch(NullPointerException e){
                throw new RulesException("undefined", "PerformCatchError",
                        "The table '"+table.stringValue()+"' is undefined");
            }catch(RulesException e){
                IRSession     session       = state.getSession();
                EntityFactory ef            = session.getEntityFactory();  
                IREntity      errorEntity   = ef.findRefEntity(error).clone(session).rEntityValue();
                state.entitypush(errorEntity);
               
                // If any of the following puts fail (because the given entity doesn't define them), then
                // simply carry on your merry way.  The user can define these fields if they need them,
                // and they don't need to define them if they don't need them.
View Full Code Here

Examples of com.dtrules.session.EntityFactory

  public RDecisionTable(IRSession session, String name) throws RulesException{
        this.session = session;
        ruleset      = session.getRuleSet();
    dtname       = RName.getRName(name,true);
   
        EntityFactory ef = ruleset.getEntityFactory(session);
        RDecisionTable dttable =ef.findDecisionTable(RName.getRName(name));
        if(dttable != null){
            new CompilerError(CompilerError.Type.TABLE,"Duplicate Decision Tables Found",0,0);
    }   
  }
View Full Code Here

Examples of com.dtrules.session.EntityFactory

     * @param outputXMLName
     * @throws Exception
     */
    public void convertEDDs(RuleSet rs, String excelName, String outputXMLName) throws Exception {
       
        EntityFactory    ef       = new EntityFactory(rs);
        Iterator<String> includes = rs.getIncludedRuleSets().iterator();
       
        while(excelName != null ){
            File excel = new File(rs.getSystemPath()+"/"+excelName);
            if(excel.isDirectory()){
                File files[] = excel.listFiles();
                for(File file : files){
                    String filename = file.getName().toLowerCase();
                    if( !file.isDirectory() && (filename.endsWith(".xls")||filename.endsWith(".xml"))){
                        convertEDD(ef, rs,file.getAbsolutePath());
                    }
                }
            }else{
                convertEDD(ef,rs,excelName);
            }
            if(includes.hasNext()){
                String includedSet = includes.next();
                excelName = rs.getRulesDirectory().getRuleSet(includedSet).getExcel_edd();
            }else{
                excelName = null;
            }
        }
       
        XMLPrinter   xptr  = new XMLPrinter(new FileOutputStream(outputXMLName));
        xptr.opentag("entity_data_dictionary","version","2","xmlns:xs","http://www.w3.org/2001/XMLSchema");
        ef.writeAttributes(xptr);
        xptr.close();
    }
View Full Code Here

Examples of com.dtrules.session.EntityFactory

           
            dtcompiler.compile(inDTStream, outDTStream);
                       
            RulesDirectory  rd  = new RulesDirectory(path, rulesDirectoryXML);
            RuleSet         rs  = rd.getRuleSet(RName.getRName(ruleset));
            EntityFactory   ef  = rs.newSession().getEntityFactory();
            IREntity        dt  = ef.getDecisiontables();
            Iterator<RName> idt = ef.getDecisionTableRNameIterator();
           
            while(idt.hasNext()){
                RDecisionTable t = (RDecisionTable) dt.get(idt.next());
                t.build(session.getState());
                List<IDecisionTableError> errs = t.compile();
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.EntityFactory

    public void addAssociation(JetspeedPrincipal from, JetspeedPrincipal to, String associationName) throws SecurityException
    {
        if (!SynchronizationStateAccess.isSynchronizing())
        {
            EntityFactory entityFactory = ldapEntityManager.getEntityFactory(from.getType().getName());
            EntityFactory relatedFactory = ldapEntityManager.getEntityFactory(to.getType().getName());
            Entity fromEntity = entityFactory.createEntity(from);
            Entity toEntity = relatedFactory.createEntity(to);
            SecurityEntityRelationType relationType = new SecurityEntityRelationTypeImpl(associationName, fromEntity.getType(), toEntity.getType());
            ldapEntityManager.addRelation(fromEntity, toEntity, relationType);
        }
        databaseStorageManager.addAssociation(from, to, associationName);
    }
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.EntityFactory

    public void removeAssociation(JetspeedPrincipal from, JetspeedPrincipal to, String associationName) throws SecurityException
    {
        if (!SynchronizationStateAccess.isSynchronizing())
        {
            EntityFactory entityFactory = ldapEntityManager.getEntityFactory(from.getType().getName());
            EntityFactory relatedFactory = ldapEntityManager.getEntityFactory(to.getType().getName());
            Entity fromEntity = entityFactory.createEntity(from);
            Entity toEntity = relatedFactory.createEntity(to);
            SecurityEntityRelationType relationType = new SecurityEntityRelationTypeImpl(associationName, fromEntity.getType(), toEntity.getType());
            ldapEntityManager.removeRelation(fromEntity, toEntity, relationType);
            databaseStorageManager.removeAssociation(from, to, associationName);
        }
    }
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.EntityFactory

        this.ldapEntityManager = ldapEntityManager;
    }

    public void addPrincipal(JetspeedPrincipal principal, Set<JetspeedPrincipalAssociationReference> associations) throws SecurityException
    {
        EntityFactory entityFactory = ldapEntityManager.getEntityFactory(principal.getType().getName());
        if (!SynchronizationStateAccess.isSynchronizing())
        {
            ldapEntityManager.addEntity(entityFactory.createEntity(principal));
        }
        delegateJpsm.addPrincipal(principal, associations);
    }
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.EntityFactory

        return false;
    }

    public void removePrincipal(JetspeedPrincipal principal) throws SecurityException
    {
        EntityFactory entityFactory = ldapEntityManager.getEntityFactory(principal.getType().getName());
        if (!SynchronizationStateAccess.isSynchronizing())
        {
            ldapEntityManager.removeEntity(entityFactory.createEntity(principal));
        }
        delegateJpsm.removePrincipal(principal);
    }
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.EntityFactory

        delegateJpsm.removePrincipal(principal);
    }

    public void updatePrincipal(JetspeedPrincipal principal) throws SecurityException
    {
        EntityFactory entityFactory = ldapEntityManager.getEntityFactory(principal.getType().getName());
        if (!SynchronizationStateAccess.isSynchronizing())
        {
            ldapEntityManager.updateEntity(entityFactory.createEntity(principal));
        }
        delegateJpsm.updatePrincipal(principal);
    }
View Full Code Here

Examples of org.apache.jetspeed.security.mapping.EntityFactory

    public void addPrincipal(JetspeedPrincipal principal, Set<JetspeedPrincipalAssociationReference> associations) throws SecurityException
    {
        if (!SynchronizationStateAccess.isSynchronizing() && !ldapEntityManager.isReadOnly())
        {
            EntityFactory entityFactory = ldapEntityManager.getEntityFactory(principal.getType().getName());
            if (entityFactory.isCreateAllowed())
            {
                ldapEntityManager.addEntity(entityFactory.createEntity(principal));
            }
        }
        delegateJpsm.addPrincipal(principal, associations);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.