String fmodel = dataSrc.getFeatureModel();
//begin ��ȡ����ģ�������ļ�
try {
InputStream inputStream = new StringBufferInputStream(fmodel);
featureModel = parser.openFmdl(inputStream);
} catch (Exception exception) {
errorInfo = "Exception occurs when read feature-model file.\n" + exception;
return false;
}
//end ��ȡ����ģ�������ļ�
//begin ��ȡԼ��ģ�������ļ�
try {
String cm = dataSrc.getConstraintModel();
InputStream input = new StringBufferInputStream(cm);
parser.openCmdl(input, featureModel);
} catch (Exception exception) {
errorInfo = "Exception occurs when read constraint-model file.\n" + exception;
return false;
}
//end ��ȡԼ��ģ�������ļ�
//Question: *.im �洢ʲô��Ϣ��im means Interaction-Model
try{
String im = dataSrc.getInteractionModel();
InputStream input =new StringBufferInputStream(im);
parser.openImdl(input, featureModel);
} catch (Exception exception) {
errorInfo = "Exception occurs when read interaction-model file.\n" + exception;
return false;
}
AdaptedStandardStorageFormat reader = new AdaptedStandardStorageFormat();
//�������viewNameArray.length��draw�ļ�.
if (viewNameArray.length > 0) {
//begin ��ȡͼԪ��Ϣ�ļ�
try {
drawingArray = new Drawing[viewNameArray.length];
for (int i = 0; i < viewNameArray.length; i++) {
DrawModel draw = dataSrc.getDrawModel(viewNameArray[i]);
InputStream input = new StringBufferInputStream(draw.getContent());
drawingArray[i] = reader.restore(input);
drawingArray[i].setId(draw.getId());
}
} catch (Exception exception) {
errorInfo = "Exception occurs when read project graphic file.\n" + exception;
return false;
}
//end ��ȡͼԪ��Ϣ�ļ�
} else {
drawingArray = new Drawing[0];
}
//begin ��ȡ������Ϣ
informationMap = new GroupTreeMap();
//����൱�����ݱ������������ TODO How to apply in the database environment?
// Enumeration enumeration = zipFile.entries();
//
// while (enumeration.hasMoreElements()) {
// ZipEntry entry = (ZipEntry) enumeration.nextElement();
//
// String entryName = entry.getName();
//
// if (entryName.endsWith(".draw")) {
// int index = entryName.indexOf('\\');
//
// if (index > 0) {
// try {
// String id = entryName.substring(0, index);
// InputStream inputStream = zipFile.getInputStream(entry);
// Drawing drawing = reader.restore(inputStream);
// informationMap.add(id, drawing);
// } catch (Exception exception) {
// errorInfo = "Exception occurs when read information.\n" + exception;
// exception.printStackTrace();
// return false;
// }
// }
// }
// }
//end ��ȡ������Ϣ
//begin ��ȡ������Ϣ
//gh start
CmdlParser cp = new CmdlParserPrototype();
try {
String custom = dataSrc.getCustomizationIndex();
InputStream inputStream = new StringBufferInputStream(custom);
for (Iterator<String> itCVId = cp.openCustomizationVersionIds(
inputStream).iterator(); itCVId.hasNext();) {
String cvId = itCVId.next();
String cusVersionFileContent = dataSrc.getCustomizationVersionFileContent(cvId);
InputStream isCV = new StringBufferInputStream(cusVersionFileContent);
cp.openCustomizationVersion(isCV , featureModel);
}
} catch (Exception exception) {
// errorInfo = "Exception occurs when read customization file.\n"
// + exception;