final List<Long> docuses) throws MissedPropertyException,
InvalidPropertyException, MultiplyDefinedException, IOException,
NotApplicableException, InterruptedException, ParseException {
- DocumentType type = getDocumentTypeService().selectType(
- (int) documentTypeId);
User user = getUserService().selectUser(userId);
File updir = getRepositoryService().getDownloadDirectory(user);
File upfile = new File(updir.getPath() + "/" + fname);
- String[] table = fname.split("\\x2E");
// Creation of the document
Document.Properties dprop = new Document.Properties();
if (reference.length() == 0) { // Importation of a foreign document
// TODO: Extract property of supported documents (DOCX, ODT...)
+ DocumentType type = getDocumentTypeService().selectType(
+ (int) documentTypeId);
+ String[] table = fname.split("\\x2E");
addoc = getStepService().createDocument(
step,
dprop.setName(doctitle).setType(type).setFormat(
if (docuses != null) {
for (Long index : docuses) {
Document used = getDocumentService().selectDocument(index);
+ Publication pub = step.getDocument(index);
+ if (pub == null) {
+ for (Publication doc : step.getOwner().
+ getDocums()) {
+ if (doc.value().getIndex() == index) {
+ pub = doc;
+ break;
+ }
+ }
+ }
+ if (pub == null) {
+ for (Publication doc : step.getOwnerStudy().getDocums()) {
+ if (doc.value().getIndex() == index) {
+ pub = doc;
+ break;
+ }
+ }
+ }
addoc.addDependency(used);
+ pub.setValue(used);
}
}
return addoc;