package pt.ist.bennu.manager.presentation.actions; import java.io.Serializable; import java.util.List; import pt.ist.bennu.core.domain.MyOrg; import pt.ist.bennu.core.domain.contents.CustomFunctionalityKey; import pt.ist.bennu.core.domain.contents.Node; import pt.ist.bennu.core.domain.groups.PersistentGroup; import pt.ist.fenixframework.services.Service; import pt.utl.ist.fenix.tools.util.i18n.MultiLanguageString; public class NodeBean implements Serializable { private static final long serialVersionUID = 2784798590778169974L; private Node node; private PersistentGroup accessibilityGroup; private boolean customize; private MultiLanguageString name; private String url; public NodeBean(Node node) { this(node, false); } public NodeBean(Node node, boolean customize) { this.node = node; this.customize = customize; this.name = node.getFunctionality().getFunctionalityName(); this.url = node.getFunctionality().getUrl(); this.accessibilityGroup = node.getAccessibilityGroup(); } public Node getNode() { return node; } public PersistentGroup getAccessibilityGroup() { return accessibilityGroup; } public void setAccessibilityGroup(PersistentGroup accessibilityGroup) { this.accessibilityGroup = accessibilityGroup; } public Boolean getCustomize() { return customize; } public void setCustomize(Boolean customize) { this.customize = customize; } public MultiLanguageString getName() { return name; } public void setName(MultiLanguageString name) { this.name = name; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } @Service public void save() { node.setAccessibilityGroup(accessibilityGroup); if (customize) { node.setFunctionality(new CustomFunctionalityKey(name, url)); } } public List getPossibleGroups() { return MyOrg.getInstance().getPersistentGroups(); } }