//SubObj Name
ObjMetadata metaSubObjName = new ObjMetadata();
String textSubName = msgBuild.getMessage(SUBOBJ_NAME, locale);
metaSubObjName.setName(textSubName);
metaSubObjName.setDataTypeCode("GENERAL_META");
ObjMetacontent metaContentSubObjName = new ObjMetacontent();
SubObject subobj = DAOFactory.getSubObjectDAO().getSubObject(subObjectId);
metaContentSubObjName.setContent(subobj.getName().getBytes());
ObjMetaDataAndContent metaAndContentSubObjName = new ObjMetaDataAndContent();
metaAndContentSubObjName.setMeta(metaSubObjName);
metaAndContentSubObjName.setMetacontent(metaContentSubObjName);
metaDataAndContents.add(metaAndContentSubObjName);
}
BIObject obj = DAOFactory.getBIObjectDAO().loadBIObjectById(objectId);
//Obj Label
ObjMetadata metaObjLabel = new ObjMetadata();
String textLabel = msgBuild.getMessage(LABEL, locale);
metaObjLabel.setName(textLabel);
metaObjLabel.setDataTypeCode("GENERAL_META");
ObjMetacontent metaContentObjLabel = new ObjMetacontent();
metaContentObjLabel.setContent(obj.getLabel().getBytes());
ObjMetaDataAndContent metaAndContentObjLabel = new ObjMetaDataAndContent();
metaAndContentObjLabel.setMeta(metaObjLabel);
metaAndContentObjLabel.setMetacontent(metaContentObjLabel);
metaDataAndContents.add(metaAndContentObjLabel);
//Obj Name
ObjMetadata metaObjName = new ObjMetadata();
String textName = msgBuild.getMessage(NAME, locale);
metaObjName.setName(textName);
metaObjName.setDataTypeCode("GENERAL_META");
ObjMetacontent metaContentObjName = new ObjMetacontent();
metaContentObjName.setContent(obj.getName().getBytes());
ObjMetaDataAndContent metaAndContentObjName = new ObjMetaDataAndContent();
metaAndContentObjName.setMeta(metaObjName);
metaAndContentObjName.setMetacontent(metaContentObjName);
metaDataAndContents.add(metaAndContentObjName);
//Obj Type
ObjMetadata metaObjType = new ObjMetadata();
String textType = msgBuild.getMessage(TYPE, locale);
metaObjType.setName(textType);
metaObjType.setDataTypeCode("GENERAL_META");
ObjMetacontent metaContentObjType = new ObjMetacontent();
metaContentObjType.setContent(obj.getBiObjectTypeCode().getBytes());
ObjMetaDataAndContent metaAndContentObjType = new ObjMetaDataAndContent();
metaAndContentObjType.setMeta(metaObjType);
metaAndContentObjType.setMetacontent(metaContentObjType);
metaDataAndContents.add(metaAndContentObjType);
/*
//Obj Rating
ObjMetadata metaObjRating = new ObjMetadata();
String textRating = msgBuild.getMessage(RATING, locale);
metaObjRating.setName(textRating);
metaObjRating.setDataTypeCode("GENERAL_META");
ObjMetacontent metaContentObjRating = new ObjMetacontent();
Double temp = DAOFactory.getBIObjectRatingDAO().calculateBIObjectRating(obj);
String docRating = ( temp != null ? temp.toString() : "" );
metaContentObjRating.setContent(docRating.getBytes());
ObjMetaDataAndContent metaAndContentObjRating = new ObjMetaDataAndContent();
metaAndContentObjRating.setMeta(metaObjRating);
metaAndContentObjRating.setMetacontent(metaContentObjRating);
metaDataAndContents.add(metaAndContentObjRating);*/
//Obj Engine Name
ObjMetadata metaObjEngineName = new ObjMetadata();
String textEngName = msgBuild.getMessage(ENG_NAME, locale);
metaObjEngineName.setName(textEngName);
metaObjEngineName.setDataTypeCode("GENERAL_META");
ObjMetacontent metaContentObjEngineName = new ObjMetacontent();
metaContentObjEngineName.setContent(obj.getEngine().getName().getBytes());
ObjMetaDataAndContent metaAndContentObjEngineName = new ObjMetaDataAndContent();
metaAndContentObjEngineName.setMeta(metaObjEngineName);
metaAndContentObjEngineName.setMetacontent(metaContentObjEngineName);
metaDataAndContents.add(metaAndContentObjEngineName);
//END GENERAL METADATA
List metadata = DAOFactory.getObjMetadataDAO().loadAllObjMetadata();
if (metadata != null && !metadata.isEmpty()) {
Iterator it = metadata.iterator();
while (it.hasNext()) {
ObjMetadata objMetadata = (ObjMetadata) it.next();
ObjMetacontent objMetacontent = (ObjMetacontent) DAOFactory.getObjMetacontentDAO().loadObjMetacontent(objMetadata.getObjMetaId(), objectId, subObjectId);
ObjMetaDataAndContent metaAndContent = new ObjMetaDataAndContent();
metaAndContent.setMeta(objMetadata);
metaAndContent.setMetacontent(objMetacontent);
metaDataAndContents.add(metaAndContent);
}