Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 333 → Rev 334

/impl/src/java/pt/estgp/estgweb/services/data/RepositoryService.java
170,12 → 170,24
dom.setRootElement(rootElement);
rootElement.addAttribute("id",""+repositoryFile.getId());
 
Element saveDate = DocumentFactory.getInstance().createElement("saveDate",DatesUtils.getStringFromDateForFilename(repositoryFile.getSaveDate()));
Element name = DocumentFactory.getInstance().createElement("name",""+repositoryFile.getName());
Element contentType = DocumentFactory.getInstance().createElement("contentType",repositoryFile.getContentType());
Element extension = DocumentFactory.getInstance().createElement("extension",""+repositoryFile.getExtension());
Element size = DocumentFactory.getInstance().createElement("sizeKb",""+repositoryFile.getSizeKb());
Element description = DocumentFactory.getInstance().createElement("description",repositoryFile.getDescription());
Element saveDate = DocumentFactory.getInstance().createElement("saveDate");
saveDate.setText(DatesUtils.getStringFromDateForFilename(repositoryFile.getSaveDate()));
 
Element name = DocumentFactory.getInstance().createElement("name");
name.setText(""+repositoryFile.getName());
 
Element contentType = DocumentFactory.getInstance().createElement("contentType");
contentType.setText(repositoryFile.getContentType());
 
Element extension = DocumentFactory.getInstance().createElement("extension");
extension.setText(""+repositoryFile.getExtension());
 
Element size = DocumentFactory.getInstance().createElement("sizeKb");
size.setText(""+repositoryFile.getSizeKb());
 
Element description = DocumentFactory.getInstance().createElement("description");
description.setText(repositoryFile.getDescription());
 
rootElement.add(saveDate);
rootElement.add(name);
rootElement.add(contentType);
188,10 → 200,19
rootElement.add(repositoryFileElem);
 
repositoryFileElem.addAttribute("id","" + repositoryFile.getRepositoryFile().getId());
Element rSaveDate = DocumentFactory.getInstance().createElement("saveDate",DatesUtils.getStringFromDateForFilename(repositoryFile.getRepositoryFile().getSaveDate()));
Element rUpdateDate = DocumentFactory.getInstance().createElement("updateDate",DatesUtils.getStringFromDateForFilename(repositoryFile.getRepositoryFile().getUpdateDate()));
Element accessControl = DocumentFactory.getInstance().createElement("accessControl",repositoryFile.getRepositoryFile().getAccessControl());
Element deleted = DocumentFactory.getInstance().createElement("deleted","" + repositoryFile.getRepositoryFile().isDeleted());
Element rSaveDate = DocumentFactory.getInstance().createElement("saveDate");
rSaveDate.setText(DatesUtils.getStringFromDateForFilename(repositoryFile.getRepositoryFile().getSaveDate()));
 
Element rUpdateDate = DocumentFactory.getInstance().createElement("updateDate");
rUpdateDate.setText(DatesUtils.getStringFromDateForFilename(repositoryFile.getRepositoryFile().getUpdateDate()));
 
 
Element accessControl = DocumentFactory.getInstance().createElement("accessControl");
accessControl.setText(repositoryFile.getRepositoryFile().getAccessControl());
 
Element deleted = DocumentFactory.getInstance().createElement("deleted");
deleted.setText("" + repositoryFile.getRepositoryFile().isDeleted());
 
repositoryFileElem.add(rSaveDate);
repositoryFileElem.add(rUpdateDate);
repositoryFileElem.add(accessControl);
200,30 → 221,46
Element owner = DocumentFactory.getInstance().createElement("owner");
repositoryFileElem.add(owner);
owner.addAttribute("id","" + repositoryFile.getRepositoryFile().getOwner().getId());
Element oName = DocumentFactory.getInstance().createElement("name",repositoryFile.getRepositoryFile().getOwner().getName());
Element oRoles = DocumentFactory.getInstance().createElement("roles",repositoryFile.getRepositoryFile().getOwner().getRoles());
Element oClass = DocumentFactory.getInstance().createElement("class",repositoryFile.getRepositoryFile().getOwner().getClass().getSimpleName());
Element oName = DocumentFactory.getInstance().createElement("name");
oName.setText(repositoryFile.getRepositoryFile().getOwner().getName());
 
Element oRoles = DocumentFactory.getInstance().createElement("roles");
oRoles.setText(repositoryFile.getRepositoryFile().getOwner().getRoles());
 
Element oClass = DocumentFactory.getInstance().createElement("class");
oClass.setText(repositoryFile.getRepositoryFile().getOwner().getClass().getSimpleName());
 
owner.add(oName);
owner.add(oRoles);
owner.add(oClass);
if(repositoryFile.getRepositoryFile().getOwner() instanceof User)
{
Element oUsername = DocumentFactory.getInstance().createElement("username",((User)repositoryFile.getRepositoryFile().getOwner()).getUsername());
Element oEmail = DocumentFactory.getInstance().createElement("email",((User)repositoryFile.getRepositoryFile().getOwner()).getEmail());
Element outEmail = DocumentFactory.getInstance().createElement("outEmail",((User)repositoryFile.getRepositoryFile().getOwner()).getOutEmail());
Element biEmail = DocumentFactory.getInstance().createElement("bi",((User)repositoryFile.getRepositoryFile().getOwner()).getBi());
Element oUsername = DocumentFactory.getInstance().createElement("username");
oUsername.setText(((User)repositoryFile.getRepositoryFile().getOwner()).getUsername());
 
Element oEmail = DocumentFactory.getInstance().createElement("email");
oEmail.setText(((User)repositoryFile.getRepositoryFile().getOwner()).getEmail());
 
Element outEmail = DocumentFactory.getInstance().createElement("outEmail");
outEmail.setText(((User)repositoryFile.getRepositoryFile().getOwner()).getOutEmail());
 
Element biEmail = DocumentFactory.getInstance().createElement("bi");
biEmail.setText(((User)repositoryFile.getRepositoryFile().getOwner()).getBi());
 
owner.add(oUsername);
owner.add(oEmail);
owner.add(outEmail);
owner.add(biEmail);
if(repositoryFile.getRepositoryFile().getOwner() instanceof Teacher)
{
Element code = DocumentFactory.getInstance().createElement("teacherCode",""+((Teacher)repositoryFile.getRepositoryFile().getOwner()).getSigesCode());
Element code = DocumentFactory.getInstance().createElement("teacherCode");
code.setText(""+((Teacher)repositoryFile.getRepositoryFile().getOwner()).getSigesCode());
owner.add(code);
}
if(repositoryFile.getRepositoryFile().getOwner() instanceof Student)
{
Element code = DocumentFactory.getInstance().createElement("studentCode",""+((Student)repositoryFile.getRepositoryFile().getOwner()).getSigesCode());
Element code = DocumentFactory.getInstance().createElement("studentCode");
code.setText(""+((Student)repositoryFile.getRepositoryFile().getOwner()).getSigesCode());
owner.add(code);
}
}