pl.edu.icm.yadda.service2.YaddaObjectID.getId()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(89)

本文整理了Java中pl.edu.icm.yadda.service2.YaddaObjectID.getId()方法的一些代码示例,展示了YaddaObjectID.getId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YaddaObjectID.getId()方法的具体详情如下:
包路径:pl.edu.icm.yadda.service2.YaddaObjectID
类名称:YaddaObjectID
方法名:getId

YaddaObjectID.getId介绍

暂无

代码示例

代码示例来源:origin: pl.edu.icm.yadda/yadda-content

private String notNull(final YaddaObjectID id) {
  if (id != null && id.getId() != null) {
    return id.getId();
  } else {
    return "";
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-services2

/**
 * Returns an URI of the object
 * 
 * @return
 */
public String encode() {
  // TODO support versioning
  String uri = URI_SCHEME + "://" + rootId.getId();
  for (int i = 0; i < path.length; i++) {
    uri = uri + "/" + path[i];
  }
  return uri;
}

代码示例来源:origin: pl.edu.icm.yadda/bwmeta-process

protected void readNext() {			
  while (it.hasNext() && next == null) {
    CatalogObjectMeta com = it.next();
    next = com.getId().getId();				
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

@Override
  public String getId(CatalogObject<String> element) {
    return element.getId().getId();
  }
};

代码示例来源:origin: pl.edu.icm.yadda/yadda-services2

public List<String> getUnversionedChildrenIds() {
  List<YaddaObjectID> ids = getChildrenIds();
  List<String> unversionedIds = new ArrayList<String>();
  for (YaddaObjectID id : ids) {
    unversionedIds.add(id.getId());
  }
  return unversionedIds;
}

代码示例来源:origin: pl.edu.icm.yadda/bwmeta-process

protected void readNext() {
  
  while (it.hasNext() && next == null) {
    CatalogObjectMeta com = it.next();
    try {
      next = readObject(com.getId().getId(), false);
    } catch (CatalogException e) {
      log2.error("Error occured while getting record from catalog", e);
    } catch (YaddaException e) {
      log2.error("Error occured while parsing BWMETA1 object",e);
    }
    if (next==null) 
      log2.warn("CatalogObject is null for id=["+com.getId()+"]");
  }
  
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-services2

/**
 * Copy constructor
 *
 * @param id the id to copy
 */
public YaddaObjectID(YaddaObjectID id) {
  this.id = id.getId();
  this.branch = id.getBranch();
  this.version = id.getVersion();
  this.displayName = id.getDisplayName();
}

代码示例来源:origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected Chunk doProcessChunk(Chunk data,
    Map<String, Serializable> context, 
    IProcessListener processListener, ProcessingStats stats)
    throws Exception {
  
  for (WriteStatusRequest ce : data.getWriteStatusRequests()) {
                
    String serializedElementStatus = xStream.toXML(ce.getNewStatus());            
    
    YaddaObjectID id = new YaddaObjectID(ce.getExtId().getId());
    
    if (!data.getObjectsToWrite().containsKey(ce.getExtId().getId())) {				
      data.getObjectsToWrite().put(ce.getExtId().getId(), new CatalogObject<String>(id));				
    }
            
    CatalogObjectPart<String> elementStatusPart = new CatalogObjectPart<String>(
        CatalogParamConstants.TYPE_ELEMENT_PROCESSING_STATUS, serializedElementStatus);                
    
    data.getObjectsToWrite().get(ce.getExtId().getId()).addPart(elementStatusPart);
    
  }
      
  return data;
                    
}

代码示例来源:origin: pl.edu.icm.yadda/recorddb-editor

@Override
public List<CatalogObject<String>> produce(int limit) {
  List<CatalogObject<String>> cos = new ArrayList<CatalogObject<String>>();
  while (current < ids.length && limit > 0) {
    YaddaObjectID oid = ids[current];
    try {
      CatalogObject<String> object = 
        oid.getVersion() == null ?
            curdao.findObject(oid.getId(), request.getType()) :
              curdao.findObject(oid, request.getType());
            if (object != null) cos.add(object);
    } catch (RuntimeException e) {
      log.error("Exception caught", e);
      throw e;
    }
    limit -= 1;
    current += 1;
  }
  return cos;
}
@Override

代码示例来源:origin: pl.edu.icm.yadda/recorddb-editor

@Override
protected DbObjectMeta findMetaNoPTs(YaddaObjectID oid) throws DataAccessException {
  DbObjectMeta meta = jdbc.queryForObject(
    "SELECT * FROM "+tablePrefix+METAS_TABLE_NAME+
    " WHERE "+META_ID+"=? AND "+META_BRANCH+"=? AND "+META_VERSION+"=?"+
    (history?"":" AND "+META_HISTORY+"="+sqlSelectBoolFalse),
    metaRowMapper,
    oid.getId(), oid.getBranch(), oid.getVersion()
  );
  meta.setTags(findTags(meta));
  return meta;
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-content

public void importMetadata() throws MetadataIndexException {
  try {
    final CountingIterator<CatalogObjectMeta> ci = catalogFacade.iterateObjects(null, null, null, null, false);
    while (ci.hasNext()) {
      final CatalogObjectMeta meta = ci.next();
      final String extId = meta.getId().getId();
      importMetadata(meta, extId);
    }
  } catch (final CatalogException e) {
    throw new MetadataIndexException(e);
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-content

public void matchMetadata() throws MetadataIndexException {
  try {
    final CountingIterator<CatalogObjectMeta> ci = catalogFacade.iterateObjects(null, null, null, new String[] { MetadataIndexConstants.C_IMPORTED }, false);
    while (ci.hasNext()) {
      final CatalogObjectMeta meta = ci.next();
      final String extId = meta.getId().getId();
      matchMetadata(meta, extId);
    }
  } catch (final CatalogException e) {
    throw new MetadataIndexException(e);
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-content

public void cleanMetadata() throws MetadataIndexException {
  try {
    final CountingIterator<CatalogObjectMeta> ci = catalogFacade.iterateObjects(null, null, null, null, false);
    while (ci.hasNext()) {
      final CatalogObjectMeta meta = ci.next();
      final String extId = meta.getId().getId();
      cleanMetadata(meta, extId);
    }
  } catch (final CatalogException e) {
    throw new MetadataIndexException(e);
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-aal

/**
 * Initializes memory copy of users directory
 */
protected void fetchUsers() throws CatalogException {
          List<CatalogObjectMeta> userObjects = 
    catalogFacade.listObjects(new String[]{PART_TYPE_USER}, null, null, null, false);
  
  for (CatalogObjectMeta item : userObjects) {
    if (!item.getStatus().isDeleted()) {
      
      CatalogObjectPart<String> part = 
        catalogFacade.getPart(item.getId(), PART_TYPE_USER, null);
      
      User user = (User)serializer.toObject(item.getId().getId(), part.getData());
      
      usersByLogin.put(user.getLogin(), user);
      usersById.put(user.getExtId(), user);
      
    }
  }                
  
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-user

public void init() {
  try {
    //fetch all
    CountingIterator<CatalogObjectMeta> i =
        catalog.iterateObjects(new String[]{partType}, null, null,
        null, false);
    while (i.hasNext()) {
      String id = i.next().getId().getId();
      NamedObject no =
          loadObject(idMapper.getName(id), idMapper.getType(id));
      addRelations(no);
    }
  } catch (CatalogException ex) {
    log.error(
        "Failed to read/process some objects during initialization.",
        ex);
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-aal

/**
 * Initializes memory copy of roles directory
 * @throws CatalogException
 */
protected void fetchRoles() throws CatalogException {
  
  List<CatalogObjectMeta> roleObjects = 
    catalogFacade.listObjects(new String[]{PART_TYPE_ROLE}, null, null, null, false);
  
  for (CatalogObjectMeta item : roleObjects) {
    if (!item.getStatus().isDeleted()) {
      
      CatalogObjectPart<String> part = 
        catalogFacade.getPart(item.getId(), PART_TYPE_ROLE, null);
      
      Role role = (Role)serializer.toObject(item.getId().getId(), part.getData());                
      roles.put(role.getExtId(), role);
              
    }
  }
  
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-content

@Override
public void matchInternal(final Date from, final Date until, String[] tags) throws MetadataIndexException {
  try {
    if (tags == null) {
      tags = new String[] {};
    }
    final CountingIterator<CatalogObjectMeta> ci = catalogFacade.iterateObjects(
        new String[] { MetadataIndexConstants.T_REFMETA }, from, until, tags, false);
    while (ci.hasNext()) {
      final CatalogObjectMeta meta = ci.next();
      final String extId = meta.getId().getId();
      matchMetadata(meta, extId);
    }
  } catch (final CatalogException e) {
    throw new MetadataIndexException(e);
  }
}

代码示例来源:origin: pl.edu.icm.yadda/recorddb-editor

@Override
public GetPartResponse<String> getPart(GetPartRequest request) {
  GetPartResponse<String> resp = new GetPartResponse<String>();
  try {
    CatalogObjectPart<String> part;
    YaddaObjectID oid = request.getObject();
    String type = request.getType();
    if (oid.getVersion() == null)
      part = curdao.findPart(oid.getId(), type);
    else
      part = curdao.findPart(oid, type);
    resp.setPart(part);
  } catch (Exception e) {
    log.error("Exception caught", e);
    resp.setError(new YaddaError(ERROR_CODE, "exception caught", e));
  }
  return resp;
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-content

@Override
public int delete(String tag) throws MetadataIndexException {
  try {
    tag = MetadataIndexConstants.C_DATA_PREFIX + sanitizeTag(tag);
    final CountingIterator<CatalogObjectMeta> iterator = catalogFacade.iterateObjects(
        new String[] { MetadataIndexConstants.T_REFMETA }, null, null, new String[] { tag }, false);
    final ISessionFacade<IndexDocument> session = indexFacade.connect(indexName);
    int count = 0;
    while (iterator.hasNext()) {
      final YaddaObjectID yid = iterator.next().getId();
      final DocId id = new DocId(MetadataIndexConstants.D_EXTID, yid.getId());
      final Set<DocId> toRemove = checkExisting(Arrays.asList(new DocId[] { id }));
      for (final DocId docId : toRemove) {
        count += delete(session, docId, true);
      }
    }
    session.commit();
    return count;
  } catch (final ServiceException e) {
    throw new MetadataIndexException(e);
  }
}

代码示例来源:origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected void processElement(Element<CatalogObjectMeta> element)
    throws Exception {
  
  if (!element.getData().isHistorical()) {
    
    CatalogObjectMeta meta = targetCatalog.getObjectMetadata(new YaddaObjectID(element.getData().getId().getId()));
    
    ObjectHistory.Ancestor relation = resolveRelation(element.getData(), meta);
    
    if (relation == ObjectHistory.Ancestor.SAME || relation == ObjectHistory.Ancestor.MY_FIRST) {
      //Do nothing
    } else {
      ObjectHistory resolvedObject = new ObjectHistory(element.getData(), meta, relation);
      target.process(resolvedObject);
    }
    
  }
  
}

相关文章