コード例 #1
0
ファイル: DataFactoryImpl.java プロジェクト: eclipse/osee
 @Override
 public AttributeData create(ArtifactData parent, IAttributeType attributeType)
     throws OseeCoreException {
   VersionData version = objectFactory.createDefaultVersionData();
   version.setBranchId(parent.getVersion().getBranchId());
   ModificationType modType = RelationalConstants.DEFAULT_MODIFICATION_TYPE;
   Integer attributeid = RelationalConstants.DEFAULT_ITEM_ID;
   return objectFactory.createAttributeData(
       version, attributeid, attributeType, modType, parent.getLocalId());
 }
コード例 #2
0
ファイル: DataFactoryImpl.java プロジェクト: eclipse/osee
 @Override
 public RelationData createRelationData(
     IRelationType relationType,
     IOseeBranch branch,
     HasLocalId<Integer> aArt,
     HasLocalId<Integer> bArt,
     String rationale)
     throws OseeCoreException {
   VersionData version = objectFactory.createDefaultVersionData();
   version.setBranchId(branch.getUuid());
   ModificationType modType = RelationalConstants.DEFAULT_MODIFICATION_TYPE;
   Integer relationId = RelationalConstants.DEFAULT_ITEM_ID;
   return objectFactory.createRelationData(
       version,
       relationId,
       relationType,
       modType,
       aArt.getLocalId(),
       bArt.getLocalId(),
       rationale);
 }
コード例 #3
0
ファイル: DataFactoryImpl.java プロジェクト: eclipse/osee
  @Override
  public ArtifactData create(IOseeBranch branch, IArtifactType token, String guid, long uuid)
      throws OseeCoreException {
    Conditions.checkNotNull(branch, "branch");

    Conditions.checkExpressionFailOnTrue(
        artifactCache.isAbstract(token), "Cannot create an instance of abstract type [%s]", token);

    String guidToSet = idFactory.getUniqueGuid(guid);

    Conditions.checkExpressionFailOnTrue(
        !GUID.isValid(guidToSet),
        "Invalid guid [%s] during artifact creation [type: %s]",
        guidToSet,
        token);

    VersionData version = objectFactory.createDefaultVersionData();
    version.setBranchId(branch.getUuid());

    ModificationType modType = RelationalConstants.DEFAULT_MODIFICATION_TYPE;
    ArtifactData artifactData =
        objectFactory.createArtifactData(version, (int) uuid, token, modType, guidToSet);
    return artifactData;
  }