Versão atual:

Apagar registros no IBM Content Manager

Bom dia,

Como faço para apagar registros no IBM Content Manager?

Estou tentando como abaixo, mas ocorre o seguinte erro:

27/11/15 09:12:50:285 GMT-03:00] 00000019 SystemErr R com.ibm.mm.sdk.common.DKUsageError: DGL3626A: ID do Item não localizado; ICM7402: O ID de item especificado não existe. (STATE) : [LS RC = 7402, LS reasonCode = 0, SQL RC = 100] [27/11/15 09:12:50:285 GMT-03:00] 00000019 SystemErr R at com.ibm.mm.sdk.server.PDeleteDocICM.parseReturnParameters(PDeleteDocICM.java:391) [27/11/15 09:12:50:285 GMT-03:00] 00000019 SystemErr R at com.ibm.mm.sdk.server.PDeleteDocICM.delete(PDeleteDocICM.java:200) [27/11/15 09:12:50:286 GMT-03:00] 00000019 SystemErr R at com.ibm.mm.sdk.server.PDeleteDocICM.delete(PDeleteDocICM.java:120) [27/11/15 09:12:50:286 GMT-03:00] 00000019 SystemErr R at com.ibm.mm.sdk.server.PDocItemICM.deleteDoc(PDocItemICM.java:183) [27/11/15 09:12:50:286 GMT-03:00] 00000019 SystemErr R at com.ibm.mm.sdk.server.DKDatastoreICM.deleteObject(DKDatastoreICM.java:7722) [27/11/15 09:12:50:287 GMT-03:00] 00000019 SystemErr R at com.ibm.mm.sdk.server.DKDatastoreICM.deleteObject(DKDatastoreICM.java:7621) [27/11/15 09:12:50:287 GMT-03:00] 00000019 SystemErr R at com.ibm.mm.sdk.common.DKDDO.del(DKDDO.java:893)

Ou seja, fala que não localizou o ID, mas passei o ID corretamente.


private DKDDO doc;

public final T add(T vo) throws DAOException {
    logger.info("add()");
    try {
        doc = createDoc(getItemTypeName());
        setAtts(doc, vo);
        addImageToDoc(vo.getImagens());
        doc.add();
    } catch (com.ibm.mm.sdk.common.DKDataObjectAlreadyExists dkExist) {
        throw new DuplicatedKeyDAOException(dkExist);
    } catch (DKException e) {
        throw new DAOException(e);
    } catch (DAOException e) {
        throw e;
    } catch (Exception e) {
        throw new DAOException(e);
    }

    return vo;
}


public DKDDO createDoc(String itemType) throws DAOException {
    logger.info("createDoc()");
    try {
        doc = getConnection().createDDO(itemType, DKConstant.DK_CM_DOCUMENT);
    } catch (DKException e) {
        throw new DAOException(e);
    } catch (DAOException e) {
        throw e;
    } catch (Exception e) {
        throw new DAOException(e);
    }
    return doc;
}


@Override
protected void setAtts(DKDDO doc, Usuario vo) throws DKException, DAOException {
    logger.info("setAtts()");
    doc.setData(doc.dataId(DKConstant.DK_CM_NAMESPACE_ATTR, AttributeTypeEnum.ATTR_ID.getAttributeName()), vo.getId());
    doc.setData(doc.dataId(DKConstant.DK_CM_NAMESPACE_ATTR, AttributeTypeEnum.ATTR_NOME.getAttributeName()), vo.getNome());
    doc.setData(doc.dataId(DKConstant.DK_CM_NAMESPACE_ATTR, AttributeTypeEnum.ATTR_DOC.getAttributeName()), vo.getDoc());
    //Outros atributos
}

Versões(2):

Ver a versão formatada

Apagar registros no IBM Content Manager

Comentário

new question