ItEr20S06XestionDaComunidadeItEr19S06: Added "ganttzk-demo-webapp" demo site to repository

This commit is contained in:
Lorenzo Tilve 2009-08-07 13:39:55 +02:00 committed by Javier Moran Rua
parent acede8c059
commit d1677f9c7e
41 changed files with 2163 additions and 0 deletions

View file

@ -0,0 +1,74 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.navalplanner</groupId>
<artifactId>navalplanner</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>ganttzk-demo-webapp</artifactId>
<packaging>war</packaging>
<name>Naval Planner Web Client Module</name>
<build>
<finalName>ganttzk-demo-webapp</finalName>
</build>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
</dependency>
<!-- BeanShell (required by ZK) -->
<dependency>
<groupId>org.beanshell</groupId>
<artifactId>bsh</artifactId>
</dependency>
<!-- Apache Commons Fileupload (required by ZK) -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
</dependency>
<!-- ZK -->
<dependency>
<groupId>org.zkoss.zk</groupId>
<artifactId>zul</artifactId>
</dependency>
<dependency>
<groupId>org.zkoss.zk</groupId>
<artifactId>zkplus</artifactId>
</dependency>
<dependency>
<groupId>org.zkoss.zk</groupId>
<artifactId>zk</artifactId>
</dependency>
<dependency>
<groupId>org.zkoss.zk</groupId>
<artifactId>zkex</artifactId>
</dependency>
<!-- Naval Planner ZK Components -->
<dependency>
<groupId>org.navalplanner</groupId>
<artifactId>navalplanner-gantt-zk</artifactId>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
</dependencies>
</project>

View file

@ -0,0 +1,5 @@
package org.navalplanner.web.common;
public enum Level {
INFO, WARNING, ERROR;
}

View file

@ -0,0 +1,29 @@
package org.navalplanner.web.common;
import java.util.Arrays;
import java.util.List;
import org.zkoss.zk.ui.Component;
/**
* Utility for enforcing that only one of the supplied component is visible. <br />
* @author Óscar González Fernández <ogonzalez@igalia.com>
*/
public class OnlyOneVisible {
private List<Component> components;
public OnlyOneVisible(Component... components) {
this.components = Arrays.asList(components);
showOnly(null);
}
public void showOnly(Component component) {
for (Component c : components) {
if (c != null) {
c.setVisible(component != null && c.equals(component));
}
}
}
}

View file

@ -0,0 +1,312 @@
package org.navalplanner.web.common;
import java.math.BigDecimal;
import java.util.Date;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.event.InputEvent;
import org.zkoss.zkplus.databind.DataBinder;
import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Datebox;
import org.zkoss.zul.Decimalbox;
import org.zkoss.zul.Intbox;
import org.zkoss.zul.Textbox;
/**
* Utilities class. <br />
*
* @author Óscar González Fernández <ogonzalez@igalia.com>
* @author Manuel Rego Casasnovas <mrego@igalia.com>
*/
public class Util {
public static void reloadBindings(Component... toReload) {
for (Component reload : toReload) {
DataBinder binder = Util.getBinder(reload);
if (binder != null) {
binder.loadComponent(reload);
}
}
}
public static void saveBindings(Component... toReload) {
for (Component reload : toReload) {
DataBinder binder = Util.getBinder(reload);
if (binder != null) {
binder.saveComponent(reload);
}
}
}
public static DataBinder getBinder(Component component) {
return (DataBinder) component.getVariable("binder", false);
}
/**
* Generic interface to represent a class with a typical get method.
*
* @author Manuel Rego Casasnovas <mrego@igalia.com>
*
* @param <T>
* The type of the variable to be returned.
*/
public static interface Getter<T> {
/**
* Typical get method that returns a variable.
*
* @return A variable of type <T>.
*/
public T get();
}
/**
* Generic interface to represent a class with a typical set method.
*
* @author Manuel Rego Casasnovas <mrego@igalia.com>
*
* @param <T>
* The type of the variable to be set.
*/
public static interface Setter<T> {
/**
* Typical set method to store a variable.
*
* @param value
* A variable of type <T> to be set.
*/
public void set(T value);
}
/**
* Binds a {@link Textbox} with a {@link Getter}. The {@link Getter} will be
* used to get the value that is going to be showed in the {@link Textbox}.
*
* @param textBox
* The {@link Textbox} to be bound
* @param getter
* The {@link Getter} interface that will implement a get method.
* @return The {@link Textbox} bound
*/
public static Textbox bind(Textbox textBox, Getter<String> getter) {
textBox.setValue(getter.get());
textBox.setDisabled(true);
return textBox;
}
/**
* Binds a {@link Textbox} with a {@link Getter}. The {@link Getter} will be
* used to get the value that is going to be showed in the {@link Textbox}.
* The {@link Setter} will be used to store the value inserted by the user
* in the {@link Textbox}.
*
* @param textBox
* The {@link Textbox} to be bound
* @param getter
* The {@link Getter} interface that will implement a get method.
* @param setter
* The {@link Setter} interface that will implement a set method.
* @return The {@link Textbox} bound
*/
public static Textbox bind(final Textbox textBox,
final Getter<String> getter, final Setter<String> setter) {
textBox.setValue(getter.get());
textBox.addEventListener("onChange", new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
InputEvent newInput = (InputEvent) event;
String value = newInput.getValue();
setter.set(value);
textBox.setValue(getter.get());
}
});
return textBox;
}
/**
* Binds a {@link Intbox} with a {@link Getter}. The {@link Getter} will be
* used to get the value that is going to be showed in the {@link Intbox}.
*
* @param intBox
* The {@link Intbox} to be bound
* @param getter
* The {@link Getter} interface that will implement a get method.
* @return The {@link Intbox} bound
*/
public static Intbox bind(Intbox intBox, Getter<Integer> getter) {
intBox.setValue(getter.get());
intBox.setDisabled(true);
return intBox;
}
/**
* Binds a {@link Intbox} with a {@link Getter}. The {@link Getter} will be
* used to get the value that is going to be showed in the {@link Intbox}.
* The {@link Setter} will be used to store the value inserted by the user
* in the {@link Intbox}.
*
* @param intBox
* The {@link Intbox} to be bound
* @param getter
* The {@link Getter} interface that will implement a get method.
* @param setter
* The {@link Setter} interface that will implement a set method.
* @return The {@link Intbox} bound
*/
public static Intbox bind(final Intbox intBox,
final Getter<Integer> getter, final Setter<Integer> setter) {
intBox.setValue(getter.get());
intBox.addEventListener("onChange", new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
InputEvent newInput = (InputEvent) event;
String value = newInput.getValue();
setter.set(Integer.valueOf(value));
intBox.setValue(getter.get());
}
});
return intBox;
}
/**
* Binds a {@link Datebox} with a {@link Getter}. The {@link Getter} will be
* used to get the value that is going to be showed in the {@link Datebox}.
*
* @param dateBox
* The {@link Datebox} to be bound
* @param getter
* The {@link Getter} interface that will implement a get method.
* @return The {@link Datebox} bound
*/
public static Datebox bind(final Datebox dateBox,
final Getter<Date> getter) {
dateBox.setValue(getter.get());
dateBox.setDisabled(true);
return dateBox;
}
/**
* Binds a {@link Datebox} with a {@link Getter}. The {@link Getter} will be
* used to get the value that is going to be showed in the {@link Datebox}.
* The {@link Setter} will be used to store the value inserted by the user
* in the {@link Datebox}.
*
* @param dateBox
* The {@link Datebox} to be bound
* @param getter
* The {@link Getter} interface that will implement a get method.
* @param setter
* The {@link Setter} interface that will implement a set method.
* @return The {@link Datebox} bound
*/
public static Datebox bind(final Datebox dateBox,
final Getter<Date> getter, final Setter<Date> setter) {
dateBox.setValue(getter.get());
dateBox.addEventListener("onChange", new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
setter.set(dateBox.getValue());
dateBox.setValue(getter.get());
}
});
return dateBox;
}
/**
* Binds a {@link Decimalbox} with a {@link Getter}. The {@link Getter} will
* be used to get the value that is going to be showed in the
* {@link Decimalbox}.
*
* @param decimalBox
* The {@link Decimalbox} to be bound
* @param getter
* The {@link Getter} interface that will implement a get method.
* @return The {@link Decimalbox} bound
*/
public static Decimalbox bind(final Decimalbox decimalBox,
final Getter<BigDecimal> getter) {
decimalBox.setValue(getter.get());
decimalBox.setDisabled(true);
return decimalBox;
}
/**
* Binds a {@link Decimalbox} with a {@link Getter}. The {@link Getter} will
* be used to get the value that is going to be showed in the
* {@link Decimalbox}. The {@link Setter} will be used to store the value
* inserted by the user in the {@link Decimalbox}.
*
* @param decimalBox
* The {@link Decimalbox} to be bound
* @param getter
* The {@link Getter} interface that will implement a get method.
* @param setter
* The {@link Setter} interface that will implement a set method.
* @return The {@link Decimalbox} bound
*/
public static Decimalbox bind(final Decimalbox decimalBox,
final Getter<BigDecimal> getter, final Setter<BigDecimal> setter) {
decimalBox.setValue(getter.get());
decimalBox.addEventListener("onChange", new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
setter.set(decimalBox.getValue());
decimalBox.setValue(getter.get());
}
});
return decimalBox;
}
/**
* Binds a {@link Checkbox} with a {@link Getter}. The {@link Getter} will
* be used to get the value that is going to be showed in the
* {@link Checkbox}.
*
* @param decimalBox
* The {@link Checkbox} to be bound
* @param getter
* The {@link Getter} interface that will implement a get method.
* @return The {@link Checkbox} bound
*/
public static Checkbox bind(final Checkbox checkBox,
final Getter<Boolean> getter) {
checkBox.setChecked(getter.get());
checkBox.setDisabled(true);
return checkBox;
}
/**
* Binds a {@link Checkbox} with a {@link Getter}. The {@link Getter} will
* be used to get the value that is going to be showed in the
* {@link Checkbox}. The {@link Setter} will be used to store the value
* inserted by the user in the {@link Checkbox}.
*
* @param decimalBox
* The {@link Checkbox} to be bound
* @param getter
* The {@link Getter} interface that will implement a get method.
* @param setter
* The {@link Setter} interface that will implement a set method.
* @return The {@link Checkbox} bound
*/
public static Checkbox bind(final Checkbox checkBox,
final Getter<Boolean> getter, final Setter<Boolean> setter) {
checkBox.setChecked(getter.get());
checkBox.addEventListener(Events.ON_CHECK, new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
setter.set(checkBox.isChecked());
checkBox.setChecked(getter.get());
}
});
return checkBox;
}
}

View file

@ -0,0 +1,268 @@
package org.navalplanner.web.common.components;
import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.navalplanner.web.common.Util;
import org.zkoss.lang.Objects;
import org.zkoss.zk.ui.HtmlMacroComponent;
import org.zkoss.zul.Listbox;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
/**
* ZK macro component that shows two {@link Listbox} allowing to move objects
* between each other.
*
* In the {@link Listbox} on the left you will have the assigned objects and in
* the right the possible other objects to be assigned.
*
* Finally it provides methods to get the current assigned and unassigned
* objects.
*
* @author Manuel Rego Casasnovas <mrego@igalia.com>
*/
public class TwoWaySelector extends HtmlMacroComponent {
/**
* A {@link Set} of objects that are assigned (so they're shown on the left
* {@link Listbox})
*/
private Set assignedObjects = new HashSet();
/**
* Title for the left {@link Listbox} (where assigned objects are shown)
*/
private String assignedTitle = "Assigned";
/**
* A {@link Set} of objects that are not assigned (so they're shown on the
* right {@link Listbox})
*/
private Set unassignedObjects = new HashSet();
/**
* Title for the right {@link Listbox} (where unassigned objects are shown)
*/
private String unassignedTitle = "Unassigned";
/**
* A {@link List} of properties to be shown on the {@link Listbox} for each
* object.
*/
private List<String> columns = null;
/**
* {@link ListitemRenderer} that knows how to paint an object according to
* the {@link List} stored in the columns attribute. If columns is null then
* the object will be rendered as a string.
*
* @author Manuel Rego Casasnovas <mrego@igalia.com>
*/
private ListitemRenderer renderer = new ListitemRenderer() {
@Override
public void render(Listitem item, Object data) throws Exception {
Class<? extends Object> klass = data.getClass();
Map<String, PropertyDescriptor> propertiesByName = getProperties(klass);
// If a list of attributes is defined
if (columns != null) {
// For each attribute
for (String column : columns) {
// Call the method to get the information
PropertyDescriptor propertyDescriptor = propertiesByName
.get(column);
if (propertyDescriptor == null) {
throw new RuntimeException(
"Unknown attribute '"
+ column + "' in class " + klass.getName());
}
String label = Objects.toString(propertyDescriptor
.getReadMethod().invoke(data));
// Add a new Listcell
item.appendChild(new Listcell(label));
}
} else { // If the list of attributes is not defined
// Render the object as string
item.setLabel(Objects.toString(data));
}
item.setValue(data);
}
/**
* A {@link Map} that stores the information about the attributes for a
* class.
*
* The information about attributes is stored with another Map where
* keys are the properties name and the values the
* {@link PropertyDescriptor}.
*/
private Map<Class<?>, Map<String, PropertyDescriptor>> propertiesMapsCached = new HashMap<Class<?>, Map<String, PropertyDescriptor>>();
/**
* Creates a {@link Map} that relates the properties and their
* {@link PropertyDescriptor} from the {@link BeanInfo}.
*
* @param info
* Information about the bean
* @return A {@link Map} that relates properties name and
* {@link PropertyDescriptor}
*/
private Map<String, PropertyDescriptor> buildPropertyDescriptorsMap(
BeanInfo info) {
PropertyDescriptor[] propertyDescriptors = info
.getPropertyDescriptors();
Map<String, PropertyDescriptor> propertiesByName = new HashMap<String, PropertyDescriptor>();
for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
propertiesByName.put(propertyDescriptor.getName(),
propertyDescriptor);
}
return propertiesByName;
}
/**
* Gets the attributes of a {@link Class} together with the
* {@link PropertyDescriptor} of each property.
*
* @param klass
* The {@link Class} to get the properties
* @return A {@link Map} that relates properties name and
* {@link PropertyDescriptor}
* @throws IntrospectionException
*/
private Map<String, PropertyDescriptor> getProperties(
Class<? extends Object> klass) throws IntrospectionException {
// If it's already cached
if (propertiesMapsCached.containsKey(klass)) {
return propertiesMapsCached.get(klass);
}
BeanInfo beanInfo = Introspector.getBeanInfo(klass);
Map<String, PropertyDescriptor> result = buildPropertyDescriptorsMap(beanInfo);
// Store in cache
propertiesMapsCached.put(klass, result);
return result;
}
};
public void setAssignedTitle(String assignedTitle) {
if (assignedTitle != null) {
this.assignedTitle = assignedTitle;
}
}
public String getAssignedTitle() {
return assignedTitle;
}
public void setUnassignedTitle(String unassignedTitle) {
if (unassignedTitle != null) {
this.unassignedTitle = unassignedTitle;
}
}
public String getUnassignedTitle() {
return unassignedTitle;
}
public void setAssignedObjects(Set assignedObjects) {
if (assignedObjects != null) {
this.assignedObjects = assignedObjects;
}
}
public Set getAssignedObjects() {
return assignedObjects;
}
public void setUnassignedObjects(Set unassignedObjects) {
if (assignedObjects != null) {
this.unassignedObjects = unassignedObjects;
}
}
public Set getUnassignedObjects() {
return unassignedObjects;
}
/**
* Sets the list of attributes to be shown when an object is renderer.
*
* @param columns
* A comma-separated string
*/
public void setColumns(String columns) {
if (columns != null) {
// Remove white spaces
columns = columns.replaceAll("\\s", "");
if (!columns.isEmpty()) {
// Split the string
this.columns = Arrays.asList(columns.split(","));
}
}
}
public List<String> getColumns() {
return columns;
}
public ListitemRenderer getRenderer() {
return renderer;
}
/**
* Assign (move to the left {@link Listbox}) the selected items from the
* right {@link Listbox}. And reload both {@link Listbox} in order to
* relfect the changes.
*
* @param unassignedObjectsListbox
* The right {@link Listbox}
*/
public void assign(Listbox unassignedObjectsListbox) {
Set<Listitem> selectedItems = unassignedObjectsListbox
.getSelectedItems();
for (Listitem listitem : selectedItems) {
Object value = listitem.getValue();
unassignedObjects.remove(value);
assignedObjects.add(value);
}
Util.reloadBindings(unassignedObjectsListbox.getParent());
Util.saveBindings(this);
}
/**
* Unassign (move to the rigth {@link Listbox}) the selected items from the
* left {@link Listbox}. And reload both {@link Listbox} in order to relfect
* the changes.
*
* @param assignedObjectsListbox
* The left {@link Listbox}
*/
public void unassign(Listbox assignedObjectsListbox) {
Set<Listitem> selectedItems = assignedObjectsListbox.getSelectedItems();
for (Listitem listitem : selectedItems) {
Object value = listitem.getValue();
assignedObjects.remove(value);
unassignedObjects.add(value);
}
Util.reloadBindings(assignedObjectsListbox.getParent());
Util.saveBindings(this);
}
}

View file

@ -0,0 +1,26 @@
package org.navalplanner.web.common.typeconverters;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.zkoss.zk.ui.Component;
import org.zkoss.zkplus.databind.TypeConverter;
/**
* Converter for the type java.util.Date
*
* @author Diego Pino Garcia <dpino@igalia.com>
*
*/
public class DateConverter implements TypeConverter {
@Override
public Object coerceToBean(Object arg0, Component arg1) {
return null;
}
@Override
public Object coerceToUi(Object object, Component component) {
return (new SimpleDateFormat("dd/MM/yyyy")).format((Date) object);
}
}

View file

@ -0,0 +1,48 @@
package org.navalplanner.web.error;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.util.GenericForwardComposer;
public class PageForErrorOnEvent extends GenericForwardComposer {
private static final Log LOG = LogFactory.getLog(PageForErrorOnEvent.class);
private Component modalWindow;
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
logError();
modalWindow = comp;
}
private void logError() {
Throwable exception = (Throwable) Executions.getCurrent().getAttribute(
"javax.servlet.error.exception");
String errorMessage = (String) Executions.getCurrent().getAttribute(
"javax.servlet.error.message");
LOG.error(errorMessage, exception);
}
public void onClick$continueWorking() {
modalWindow.detach();
}
public void onClick$reload() {
Executions.sendRedirect(null);
}
public void onClick$quitSession() {
HttpServletRequest nativeRequest = (HttpServletRequest) Executions
.getCurrent().getNativeRequest();
nativeRequest.getSession().invalidate();
Executions.sendRedirect("/");
}
}

View file

@ -0,0 +1,206 @@
package org.navalplanner.web.planner;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import org.zkoss.ganttz.TaskEditFormComposer;
import org.zkoss.ganttz.adapters.AutoAdapter;
import org.zkoss.ganttz.adapters.DomainDependency;
import org.zkoss.ganttz.adapters.IStructureNavigator;
import org.zkoss.ganttz.adapters.PlannerConfiguration;
import org.zkoss.ganttz.data.DefaultFundamentalProperties;
import org.zkoss.ganttz.data.DependencyType;
import org.zkoss.ganttz.data.GanttDiagramGraph;
import org.zkoss.ganttz.data.ITaskFundamentalProperties;
import org.zkoss.ganttz.data.Task;
import org.zkoss.ganttz.data.TaskContainer;
import org.zkoss.ganttz.data.TaskLeaf;
import org.zkoss.ganttz.extensions.ICommand;
import org.zkoss.ganttz.extensions.ICommandOnTask;
import org.zkoss.ganttz.extensions.IContext;
import org.zkoss.ganttz.extensions.IContextWithPlannerTask;
/**
* Some test data for planner <br />
* @author Óscar González Fernández <ogonzalez@igalia.com>
*/
public class DataForPlanner {
private TaskEditFormComposer taskEditForm = new TaskEditFormComposer();
public DataForPlanner() {
}
public GanttDiagramGraph getEmpty() {
return new GanttDiagramGraph();
}
private PlannerConfiguration<ITaskFundamentalProperties> addCommands(
PlannerConfiguration<ITaskFundamentalProperties> configuration) {
configuration
.addGlobalCommand(new ICommand<ITaskFundamentalProperties>() {
@Override
public String getName() {
return "Add Task";
}
@Override
public void doAction(
IContext<ITaskFundamentalProperties> context) {
addNewTask(context);
}
});
configuration
.setGoingDownInLastArrowCommand(new ICommand<ITaskFundamentalProperties>() {
@Override
public void doAction(
IContext<ITaskFundamentalProperties> context) {
addNewTask(context);
}
@Override
public String getName() {
return "";
}
});
configuration
.addCommandOnTask(new ICommandOnTask<ITaskFundamentalProperties>() {
@Override
public void doAction(
IContextWithPlannerTask<ITaskFundamentalProperties> context,
ITaskFundamentalProperties task) {
context.remove(task);
}
@Override
public String getName() {
return "Remove";
}
});
configuration.setEditTaskCommand(new ICommandOnTask<ITaskFundamentalProperties>() {
@Override
public void doAction(
IContextWithPlannerTask<ITaskFundamentalProperties> context,
ITaskFundamentalProperties task) {
taskEditForm.showEditFormFor(context.getRelativeTo(),
context.getTask());
}
@Override
public String getName() {
return "";
}
});
return configuration;
}
public PlannerConfiguration<ITaskFundamentalProperties> getLightLoad() {
return addCommands(getModelWith(20));
}
public PlannerConfiguration<ITaskFundamentalProperties> getMediumLoad() {
return addCommands(getModelWith(300));
}
public PlannerConfiguration<ITaskFundamentalProperties> getHighLoad() {
return addCommands(getModelWith(500));
}
private PlannerConfiguration<ITaskFundamentalProperties> getModelWith(
int tasksToCreate) {
List<ITaskFundamentalProperties> list = new ArrayList<ITaskFundamentalProperties>();
Date now = new Date();
Date end = twoMonthsLater(now);
final ITaskFundamentalProperties container = createTask("container",
now, end);
final List<ITaskFundamentalProperties> containerChildren = new ArrayList<ITaskFundamentalProperties>();
final ITaskFundamentalProperties child1 = createTask("child 1", now,
end);
containerChildren.add(child1);
final DefaultFundamentalProperties child2 = createTask("another", now,
end);
containerChildren.add(child2);
list.add(container);
final ITaskFundamentalProperties first = createTask("tarefa1", now, end);
final ITaskFundamentalProperties second = createTask("tarefa2", now,
end);
list.add(first);
list.add(second);
for (int i = 2; i < tasksToCreate - 3; i++) {
String name = "tarefa " + (i + 1);
ITaskFundamentalProperties task = createTask(name, now, end);
list.add(task);
}
IStructureNavigator<ITaskFundamentalProperties> navigator = new IStructureNavigator<ITaskFundamentalProperties>() {
@Override
public List<ITaskFundamentalProperties> getChildren(
ITaskFundamentalProperties object) {
if (object == container)
return containerChildren;
return new ArrayList<ITaskFundamentalProperties>();
}
@Override
public boolean isLeaf(ITaskFundamentalProperties object) {
return object != container;
}
};
return new PlannerConfiguration<ITaskFundamentalProperties>(
new AutoAdapter() {
@Override
public List<DomainDependency<ITaskFundamentalProperties>> getOutcomingDependencies(
ITaskFundamentalProperties object) {
List<DomainDependency<ITaskFundamentalProperties>> result = new ArrayList<DomainDependency<ITaskFundamentalProperties>>();
if (child1 == object) {
result.add(DomainDependency.createDependency(
child1, child2, DependencyType.END_START));
} else if (first == object) {
result.add(DomainDependency.createDependency(first,
second, DependencyType.END_START));
}
return result;
}
}, navigator, list);
}
private TaskContainer createContainer(String name, Date start, Date end) {
TaskContainer container = new TaskContainer();
container.setBeginDate(start);
container.setEndDate(end);
container.setName(name);
return container;
}
private DefaultFundamentalProperties createTask(String name, Date now,
Date end) {
return new DefaultFundamentalProperties(name, end, end.getTime()
- now.getTime(), "bla");
}
private void addNewTask(IContext<ITaskFundamentalProperties> context) {
Task newTask = new TaskLeaf();
newTask.setName("Nova Tarefa");
newTask.setBeginDate(new Date());
newTask.setEndDate(twoMonthsLater(newTask.getBeginDate()));
context.add(newTask);
}
private static Date twoMonthsLater(Date now) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(now);
calendar.add(Calendar.MONTH, 2);
return calendar.getTime();
}
public TaskEditFormComposer getTaskEditForm() {
return taskEditForm;
}
}

View file

@ -0,0 +1,68 @@
package org.navalplanner.web.planner;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.Validate;
public class ShareBean {
public static int[] toHours(ShareBean... shares) {
Validate.noNullElements(shares);
int[] result = new int[shares.length];
for (int i = 0; i < result.length; i++) {
result[i] = shares[i].getHours();
}
return result;
}
public static int sum(Collection<? extends ShareBean> shareBeans) {
Validate.noNullElements(shareBeans);
int result = 0;
for (ShareBean shareBean : shareBeans) {
result += shareBean.getHours();
}
return result;
}
public static List<ShareBean> toShareBeans(String name, int[] hours) {
ArrayList<ShareBean> result = new ArrayList<ShareBean>();
for (int i = 0; i < hours.length; i++) {
ShareBean s = new ShareBean();
s.setName(name + "." + (i + 1));
s.setHours(hours[i]);
result.add(s);
}
return result;
}
private String name;
private Integer hours;
public ShareBean() {
}
public String getName() {
return name;
}
public void setName(String name) {
if (StringUtils.isEmpty(name))
return;
this.name = name;
}
public Integer getHours() {
return hours;
}
public void setHours(Integer share) {
if (share == null || share <= 0)
return;
this.hours = share;
}
}

View file

@ -0,0 +1,81 @@
package org.navalplanner.web.planner;
import java.util.List;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.zkoss.zk.ui.WrongValueException;
import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zk.ui.util.GenericForwardComposer;
import org.zkoss.zul.Label;
import org.zkoss.zul.SimpleListModel;
import org.zkoss.zul.Window;
import org.zkoss.zul.api.Grid;
@Component
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class SplittingController extends GenericForwardComposer {
private IActionOnOk curentAction;
private Window window;
private Grid sharesListing;
private Label totalHoursLabel;
private List<ShareBean> sharesList;
private Integer totalHours;
public interface IActionOnOk {
public void doOkAction(ShareBean[] shares);
}
public void show(List<ShareBean> initialSharesList, Integer totalHours,
IActionOnOk ok) {
this.sharesList = initialSharesList;
this.totalHours = totalHours;
this.curentAction = ok;
this.totalHoursLabel.setValue(totalHours + "");
this.sharesListing.setModel(new SimpleListModel(initialSharesList));
showWindow();
}
public void onClick$splitOk() {
checkSumIsEqualToTotal();
Clients.closeErrorBox(totalHoursLabel);
hideWindow();
curentAction.doOkAction(this.sharesList.toArray(new ShareBean[0]));
}
private void checkSumIsEqualToTotal() {
int sum = ShareBean.sum(sharesList);
if (sum != totalHours) {
throw new WrongValueException(totalHoursLabel,
"the sum is not equal: " + sum);
}
}
public void onClick$splitCancel() {
hideWindow();
}
private void showWindow() {
try {
window.setMode("modal");
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
private void hideWindow() {
window.setVisible(false);
}
@Override
public void doAfterCompose(org.zkoss.zk.ui.Component comp) throws Exception {
super.doAfterCompose(comp);
window = (Window) comp;
}
}

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<language-addon>
<addon-name>navalplanner-webapp</addon-name>
<language-name>xul/html</language-name>
<component>
<component-name>twowayselector</component-name>
<component-class>org.navalplanner.web.common.components.TwoWaySelector</component-class>
<macro-uri>/common/components/twowayselector.zul</macro-uri>
</component>
</language-addon>

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<!--
For enabling annotation-based configuration (in particular,
required for "@Autowired")
-->
<context:annotation-config />
<!--bean class="org.navalplanner.web.common.entrypoints.RedirectorSynthetiser"></bean-->
<!--bean class="org.navalplanner.web.planner.OrderPlanningModel" scope="prototype">
<lookup-method name="getTaskElementAdapter" bean="taskElementAdapter"/>
<lookup-method name="getSaveCommand" bean="saveCommand"/>
<lookup-method name="getResourceAllocationCommand" bean="resourceAllocationCommand"/>
<lookup-method name="getSplitCommand" bean="splitTaskCommand"/>
<lookup-method name="getMergeTaskCommand" bean="mergeTaskCommand"/>
<lookup-method name="getEditTaskCommand" bean="editTaskCommand"/>
</bean-->
<context:component-scan base-package="org.navalplanner.web"/>
</beans>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="">
<ResourceLink name="${dataSource.jndiName}"
global="${dataSource.jndiName}"
type="javax.sql.DataSource">
</ResourceLink>
</Context>

View file

@ -0,0 +1,46 @@
task.name=Nome
task.start=Comezo
task.end=Final
task.notes=Notas
task.ok=Aceptar
listdetails.add_task=Engadir
task.new_task_name=Nova Tarefa
DETAIL_ONE=Detalle 1
DETAIL_TWO=Detalle 2
DETAIL_THREE=Detalle 3
DETAIL_FOUR=Detalle 4
mainmenu.new=Novo
mainmenu.open=Abrir
mainmenu.save=Gardar
mainmenu.project=Proxecto
mainmenu.exit=Saír
mainmenu.resources=Recursos
mainmenu.list_workers=Lista traballadores
mainmenu.add_resources=Engadir recurso
mainmenu.manage_resources=Administrar recursos
mainmenu.check_plannification=Revisar conflitos de planificación
mainmenu.plannification=Planificación
mainmenu.add_task=Engadir tarefa
mainmenu.manage_tasks=Administrar tarefas
mainmenu.set_complection_data=Establecer nivel de complección
mainmenu.add_dependency=Engadir dependencia
mainmenu.manage_dependencies=Administrar dependencias
mainmenu.help=Axuda
mainmenu.about=Acerca de
mainmenu.aclunaga=Aclunaga
mainmenu.manage_criterions=Administrar criterios
mainmenu.orders=Pedidos
mainmenu.list_orders=Lista de pedidos
mainmenu.company_overview=Vista de empresa
mainmenu.plannifications_list=Listado de planificacións
mainmenu.manage_machines=Xestionar máquinas
mainmenu.activity_work_types=Tipos de actividad de traballo
mainmenu.models=Modelos
mainmenu.work_reports=Partes de traballo
mainmenu.work_report_list=Listado de partes de traballo
mainmenu.work_report_types=Tipos de partes de traballo
mainmenu.work_report_import=Importación de partes de traballo
mainmenu.administration=Administración
mainmenu.manage_users=Xestionar usuarios e permisos
mainmenu.quality_management=Xestión da calidade
mainmenu.manageAdvancesTypes=Xestionar tipos de avance

View file

@ -0,0 +1,46 @@
task.name=Name
task.start=Start
task.end=End
task.notes=Notes
task.ok=Ok
listdetails.add_task=Add
task.new_task_name=New Task
DETAIL_ONE=Detail 1
DETAIL_TWO=Detail 2
DETAIL_THREE=Detail 3
DETAIL_FOUR=Detail 4
mainmenu.new=New
mainmenu.open=Open
mainmenu.save=Save
mainmenu.project=Project
mainmenu.exit=Exit
mainmenu.resources=Resources
mainmenu.list_workers=Workers list
mainmenu.add_resources=Add resource
mainmenu.manage_resources=Manage resources
mainmenu.check_plannification=Check for plannification conflicts
mainmenu.plannification=Plannification
mainmenu.add_task=Add task
mainmenu.manage_tasks=Manage tasks
mainmenu.set_complection_data=Set complection data
mainmenu.add_dependency=Add dependency
mainmenu.manage_dependencies=Manage dependences
mainmenu.help=Help
mainmenu.about=About
mainmenu.aclunaga=Aclunaga
mainmenu.manage_criterions=Manage criterions
mainmenu.orders=Orders
mainmenu.list_orders=Orders list
mainmenu.company_overview=Company overview
mainmenu.plannifications_list=Plannifications list
mainmenu.manage_machines=Manage machines
mainmenu.activity_work_types=Activity work types
mainmenu.models=Models
mainmenu.work_reports=Work reports
mainmenu.work_report_list=Work report list
mainmenu.work_report_types=Work report types
mainmenu.work_report_import=Work report importation
mainmenu.administration=Administration
mainmenu.manage_users=Manage users and permissions
mainmenu.quality_management=Quality management
mainmenu.manageAdvancesTypes=Manage Advance types

View file

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>ganttzk-demo-webapp</display-name>
<!--
It searches all navalplanner-business-spring-config.xml files, it can
found several. There must be at least one. It searches
navalplanner-webapp-spring-config.xml. There must be just one. It
searches navalplanner-override-spring-config.xml to override some
previous definitions. There could be several or none.
-->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:/navalplanner-override-spring-config.xml</param-value>
</context-param>
<!-- /// -->
<!-- DSP -->
<servlet>
<description><![CDATA[The servlet loads the DSP pages.]]></description>
<servlet-name>dspLoader</servlet-name>
<servlet-class>org.zkoss.web.servlet.dsp.InterpreterServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>dspLoader</servlet-name>
<url-pattern>*.dsp</url-pattern>
</servlet-mapping>
<!-- /// -->
<!-- //// -->
<!-- ZK -->
<listener>
<description>Used to cleanup when a session is destroyed</description>
<display-name>ZK Session Cleaner</display-name>
<listener-class>org.zkoss.zk.ui.http.HttpSessionListener</listener-class>
</listener>
<!-- Spring listeners -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<!-- end Spring listeners -->
<!-- Loads all IDataBootstrap and executes them -->
<!-- listener>
<listener-class>org.navalplanner.web.bootstrap.BootstrapListener</listener-class>
</listener -->
<servlet>
<description>ZK loader for ZUML pages</description>
<servlet-name>zkLoader</servlet-name>
<servlet-class>org.zkoss.zk.ui.http.DHtmlLayoutServlet</servlet-class>
<!--
Must. Specifies URI of the update engine (DHtmlUpdateServlet). It
must be the same as <url-pattern> for the update engine.
-->
<init-param>
<param-name>update-uri</param-name>
<param-value>/zkau</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>zkLoader</servlet-name>
<url-pattern>*.zul</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>zkLoader</servlet-name>
<url-pattern>*.zhtml</url-pattern>
</servlet-mapping>
<servlet>
<description>The asynchronous update engine for ZK</description>
<servlet-name>auEngine</servlet-name>
<servlet-class>org.zkoss.zk.au.http.DHtmlUpdateServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>auEngine</servlet-name>
<url-pattern>/zkau/*</url-pattern>
</servlet-mapping>
<!-- //// -->
<welcome-file-list>
<welcome-file>/planner/main.zul</welcome-file>
</welcome-file-list>
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/common/error.zul</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/common/page_not_found.zul</location>
</error-page>
</web-app>

View file

@ -0,0 +1,11 @@
<zk>
<log>
<log-base></log-base>
</log>
<error-page>
<exception-type>java.lang.Throwable
</exception-type>
<location>/common/event_error.zul</location>
</error-page>
</zk>

View file

@ -0,0 +1,42 @@
<zk>
<zscript>
<![CDATA[
top = self;
]]>
</zscript>
<vbox>
<hbox>
<listbox id="assignedObjects"
model="@{top.assignedObjects}"
itemRenderer="@{top.renderer}"
multiple="true" checkmark="true">
<listhead>
<listheader label="@{top.assignedTitle}" />
</listhead>
</listbox>
<vbox>
<button id="assignButton" label="&lt;&lt;"
onClick="top.assign(unassignedObjects);" />
<button id="unassignButton" label="&gt;&gt;"
onClick="top.unassign(assignedObjects);" />
</vbox>
<listbox id="unassignedObjects"
model="@{top.unassignedObjects}"
itemRenderer="@{top.renderer}"
multiple="true" checkmark="true">
<listhead>
<listheader label="@{top.unassignedTitle}" />
</listhead>
</listbox>
</hbox>
</vbox>
</zk>

View file

@ -0,0 +1,46 @@
@charset "utf-8";
body {
}
.identificacion {
font-family: Arial, Helvetica, sans-serif;
font-size: 18px;
color: #0081C3;
text-decoration: none;
padding-top: 20px;
text-align: center;
padding-bottom: 5px;
}
.entrar {
color:#333333;
font-size:12px;
font-family: Tahoma, Arial, Helvetica, sans-serif;
border: 1px solid #0081C3;
background-color: #C2E1F3;
width: 150px;
background-image: url(../img/flechitas.gif);
height: 25px;
}
.usuario_clave {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #333333;
text-decoration: none;
padding-top: 5px;
text-align: center;
}
.campotexto {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #666666;
text-decoration: none;
border: 1px solid #CCCCCC;
padding-left: 4px;
}
.fondo_identificacion {
background-image: url(../img/degradado_azul.gif);
background-repeat: repeat-x;
}

View file

@ -0,0 +1,89 @@
body {
margin-top: 0px;
margin-bottom: 0px;
margin-right: 0px;
margin-left: 0px;
}
.menuup {
font-family: Tahoma, Arial, Helvetica, sans-serif;
text-decoration: none;
background-image: url(../img/pestana1.gif);
font-size: 11px;
color: #0081C2;
display: block;
padding-top: 10px;
padding-left: 6px;
width: 125px;
font-weight: bold;
background-repeat: no-repeat;
background-position: -4px 0px;
padding-bottom: 5px;
}
a.menuup:hover {
background-image: url(../img/pestana_sobre.gif);
}
.sub_menu {
font-family: Tahoma, Arial, Helvetica, sans-serif, Tahoma;
font-size: 11px;
color: #EDF2F7;
text-decoration: none;
display: block;
line-height: 22px;
padding-right: 3px;
padding-left: 3px;
}
a.sub_menu:hover {
color: #FFFFFF;
text-decoration: underline;
}
.menuup_activa {
font-family: Tahoma, Arial, Helvetica, sans-serif;
text-decoration: none;
font-size: 11px;
color: #FFFFFF;
display: block;
background-image: url(../img/pestana_activa.gif);
width: 125px;
padding-top: 10px;
padding-bottom: 5px;
padding-left: 6px;
font-weight: bold;
background-repeat: no-repeat;
background-position: -4px 0px;
}
.usuario {
font-family: Tahoma, Arial, Helvetica, sans-serif;
font-size: 11px;
text-decoration: none;
text-align: right;
padding-right: 15px;
}
.cerrar_sesion {
font-family: Tahoma, Arial, Helvetica, sans-serif;
font-size: 11px;
text-decoration: underline;
text-align: right;
padding-right: 15px;
color: #009900;
display: block;
}
.ruta {
font-family: Tahoma, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #3B89B7;
text-decoration: none;
}
.fondo_cabecera {
background-image: url(../img/cabecera.jpg);
background-position: right top;
background-repeat: no-repeat;
}
.migas_linea {
border-top-width: 1px;
border-bottom-width: 1px;
border-top-style: solid;
border-bottom-style: solid;
border-top-color: #DCEEF9;
border-bottom-color: #DCEEF9;
}

View file

@ -0,0 +1,117 @@
.logo {
background-image: url("../img/v3/blue_ga.jpg");
height: 50px;
width: 300px;
height: 100px;
float: left;
clear: both;
position: absolute;
}
.headings { /* height:90px; */
height: 90px;
}
table {
margin: 0px;
padding: 0px;
border: 0px;
}
.errorbox {
margin: 40px;
padding: 40px;
border: solid 1px red;
}
/* Forms */
.z-button-tl,.z-button-tm,z-button-tr,.z-button-cl,.z-button-cr,.z-button-bl,.z-button-bm,z-button-br
{
display: none;
}
.zk .z-button-cm,.z-button-cm {
color: #007bbe;
background-color: #FFFFFF;
background-image: none;
border: 2px solid #007bbe;
}
.zk .z-button,.zk .z-button-br,.zk .z-button-tr {
background-image: none;
}
.z-button-tr {
background-image: none !important;
}
.z-button-br {
background-image: none !important;
}
.footer {
clear: both;
margin: 20px;
font-size: 12px;
}
/* ------------- order element tree ------------- */
.orderTree input {
height: 18px;
border-bottom: 0px;
font-size: 12px;
}
/* Allows tasknumber span to have fixed width */
.orderTree .tasknumber {
display: inline-block;
}
/* These constants may be reviewed when testing with 3 digit tasknumbers */
.orderTree .depth_1 input {
width: 470px !important;
}
.orderTree .depth_2 input {
width: 440px !important; /* prev - 30 px */
}
.orderTree .depth_3 input {
width: 410px !important; /* prev - 30 px */
}
.orderTree .depth_4 input {
width: 380px !important; /* prev - 30 px */
}
.orderTree .depth_5 input {
width: 350px !important; /* prev - 30 px */
}
.orderTree .depth_6 input {
width: 320px !important; /* prev - 30 px */
}
.orderTree .depth_1 .tasknumber {
width: 25px;
}
.orderTree .depth_2 .tasknumber {
width: 37px; /* prev + 12 px */
}
.orderTree .depth_3 .tasknumber {
width: 49px; /* prev + 12 px */
}
.orderTree .depth_4 .tasknumber {
width: 61px; /* prev + 12 px */
}
.orderTree .depth_5 .tasknumber {
width: 73px; /* prev + 12 px */
}
.orderTree .depth_6 .tasknumber {
width: 85px; /* prev + 12 px */
}

View file

@ -0,0 +1,12 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
</body>
</html>

View file

@ -0,0 +1,21 @@
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/common/layout/template_ganttzk_demo.zul"?>
<?link rel="stylesheet" type="text/css" href="/common/css/navalpro_v01.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/navalpro_zk.css"?>
<zk>
<window self="@{define(content)}" >
<!--caption>
Erro ${requestScope['javax.servlet.error.status_code']}
</caption-->
<vbox apply="org.navalplanner.web.error.PageForErrorOnEvent"
sclass="errorbox">
Prodúxose un erro na execución:
"${requestScope['javax.servlet.error.message']}". O erro
gardouse e procurarase arreglalo no menor tempo posible.
<hbox style="margin-left:auto; margin-right:auto">
<button id="reload" label="Reload" />
<button id="quitSession" label="Exit Session"></button>
</hbox>
</vbox>
</window>
</zk>

View file

@ -0,0 +1,14 @@
<window title="Erro ${requestScope['javax.servlet.error.status_code']}"
width="400px" border="normal" mode="modal"
apply="org.navalplanner.web.error.PageForErrorOnEvent">
<vbox>
Prodúxose un erro na execución:
"${requestScope['javax.servlet.error.message']}". O erro
gardouse e procurarase arreglalo no menor tempo posible.
<hbox style="margin-left:auto; margin-right:auto">
<button id="continueWorking" label="Continue" />
<button id="reload" label="Reload" />
<button id="quitSession" label="Exit Session"></button>
</hbox>
</vbox>
</window>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 B

View file

@ -0,0 +1,46 @@
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<?link rel="stylesheet" type="text/css" href="/common/css/navalpro_v01.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/navalpro_zk.css"?>
<?component name="customMenu" inline="true" macroURI="_customMenu.zul"?>
<zk self="@{define(content)}">
<n:div xmlns:n="http://www.zkoss.org/2005/zk/native">
<n:table width="100%" border="0" cellpadding="0" cellspacing="0">
<n:tr>
<n:td width="200" valign="bottom">
<n:a href="/ganttzk-demo-webapp/">
<n:img src="/ganttzk-demo-webapp/common/img/ganttzk-demo.png" width="300" height="60" /></n:a></n:td>
<n:td valign="top"><n:table width="100%" border="0" cellspacing="0" cellpadding="0">
<n:tr>
<n:td><n:table width="98%" border="0" cellspacing="0" cellpadding="0">
<n:tr>
<n:td height="20" align="right"><n:table border="0" cellspacing="0" cellpadding="0">
<n:tr>
<n:td class="usuario">about</n:td>
<n:td><n:a href="www.igalia.com" class="cerrar_sesion">ganttZK</n:a></n:td>
<n:td><n:a href="#"><n:img src="/ganttzk-demo-webapp/common/img/axuda.gif" alt="Axuda" width="23" height="24" border="0" /></n:a></n:td>
</n:tr>
</n:table></n:td>
</n:tr>
</n:table>
</n:td>
</n:tr>
</n:table></n:td>
</n:tr>
</n:table>
<n:table width="100%" border="0" cellpadding="0" cellspacing="0">
<n:tr>
<n:td class="migas_linea"></n:td>
</n:tr>
</n:table>
<n:table width="100%" border="0" cellspacing="0" cellpadding="0">
<n:tr>
<n:td height="400" valign="top"><div self="@{insert(content)}"/></n:td>
</n:tr>
<n:tr class="footer">
<n:td height="75" align="right" valign="bottom" background="/ganttzk-demo-webapp/common/img/linea_down.gif"><n:img src="/ganttzk-demo-webapp/common/img/logos_aplicacion.gif" width="332" height="73" /></n:td>
</n:tr>
</n:table>
</n:div>
</zk>

View file

@ -0,0 +1,19 @@
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/common/layout/template_ganttzk_demo.zul"?>
<?link rel="stylesheet" type="text/css" href="/common/css/navalpro_v01.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/navalpro_zk.css"?>
<zk>
<window self="@{define(content)}" >
<vbox apply="org.navalplanner.web.error.PageForErrorOnEvent"
sclass="errorbox">
<vbox>A páxina que está solicitando non existe.</vbox>
<vbox>Se introduciu a dirección directamente na barra de navegación
do navegador revísea ou pulse na seguinte ligazón para ir á páxina
inicial: Ir a inicio</vbox>
<vbox>Se chegou a esta páxina dende outra páxina do portal
rogámoslle nolo notifique para que sexa subsanado no menor
intervalo de tempo posible.</vbox>
<vbox>Desculpe as molestias.</vbox>
</vbox>
</window>
</zk>

View file

@ -0,0 +1,335 @@
/*
* ganttz.css Ganttz specific styles
* /
The next constants are used within the planner styling:
Ganntz.ListdetailsWidth = 280
zkTasklist.HEIGHT_PER_ROW = 15
zkTasklist.HEIGHT_TIME_TRACKER = 120
zkTasklist.SCROLLBAR_WIDTH = 15
zkTasklist.SCROLL_CONTAINER_INITIAL_HEIGHT = 500
zkTasklist.SCROLL_CONTAINER_INITIAL_WIDTH = 600
zkTasklist.GANTT_PANEL_LEFT = 300
*/
/* -------------- Listdetails -------------- */
/* External listdetails box */
.listdetails {
width:280px; /* Ganntz.ListdetailsWidth */
float:left;
margin-top: 0px;
/* border-bottom: 1px solid #86A4BE; */
font-size:10px !important;
margin-top:0px;
}
#listdetails_container {
float:left;
height:500px; /* zkTasklist.SCROLL_CONTAINER_INITIAL_HEIGHT */
position:relative;
top:27px;
overflow-y: hidden;
border-bottom: 1px solid #86A4BE;
border-right: 1px solid #86A4BE;
}
.listdetails img {
display:none;
}
#listdetails_container td {
border-bottom:1px solid #86A4BE;
border-left:1px solid #86A4BE;
border:0px;
}
#listdetails_container td {
padding:0px;
}
.listdetails input {
width: 65px;
font-size:10px !important;
border-bottom:0px;
border-right:0px;
height:17px;
}
#listdetails_container .z-datebox-inp,
#listdetails_container div.z-tree-col-cnt {
font-family:"Verdana,Tahoma,Arial,Helvetica,sans-serif";
font-size:10px !important;
border-bottom:0px;
border-right:0px;
}
.depth_1 .task_title {
width: 121px !important;
}
.depth_2 .task_title {
width: 104px !important;
}
.depth_3 .task_title {
width: 85px;
}
.depth_4 .task_title {
width: 64px;
}
.taskdetail_grid table {
height:30px;
width:285px; /* Ganntz.ListdetailsWidth */
}
#listtasks {
position:relative;
width:600px;
top:0px;
}
/* Task box properties */
.box {
border: 1px solid;
text-align:center;
vertical-align: middle;
z-index:10;
cursor: pointer;
cursor: hand;
}
/* Task lane properties */
.row {
height: 9px; /* 19 */
border-bottom: dotted 1px #CCCCCC;
margin-bottom: 10px;
margin-top: 10px;
width: 10000px; /* Defined to be larger than the maximum scroll_inner_x */
}
/* -------------- Dependencies -------------- */
#listdependencies {
position:relative;
width:400px;
float:left;
top:0px;
}
.dependence {
z-index:1;
position: absolute;
}
.end, .start, .mid, .arrow {
position:absolute;
padding:4px;
cursor: crosshair;
}
.end, .start {
height:1px;
}
.mid {
width:1px;
}
.completion {
display: none;
width: 30%;
margin-top:0px;
height: 10px;
background-color: #FFCC99;
z-index:5;
border:0px;
}
.row span {
display:none;
position:relative;
z-index:5;
color:#BBBBBB;
white-space:nowrap;
}
/* -------------- TaskGroup -------------- */
.taskgroup_start {
background-image: url("/ganttzk-demo-webapp/zkau/web/ganttz/img/group_left.png");
height: 10px;
width: 10px;
float:left;
}
.taskgroup_end {
background-image: url("/ganttzk-demo-webapp/zkau/web/ganttz/img/group_right.png");
height: 10px;
width: 10px;
float:right;
}
.taskgroup, .row .expanded {
border-top: solid black 2px;
border-bottom: 0px;
border-left: 0px;
border-right: 0px;
background-color: transparent !important;
}
.row .closed {
border-top: solid black 2px;
}
.zk #ganttpanel .z-button-cm {
border: 0px;
}
#ganttpanel {
height:400px; /* 800 */
width: 900px;
}
#ganttpanel table {
float:left;
padding:0;
margin:0;
overflow:hidden;
}
#ganttpanel table td {
padding:0;
}
/* -------------- Timetracker -------------- */
.timetracker_fake_row {
height: 80px;
}
/* Forces every zoom level the same table width */
#timetracker table {
border-collapse: collapse;
}
#timetracker .second_level_ tr {
height:14px;
}
/* Watermark alternate row color */
#watermark .timetracker_column_even {
background-color: #EEEEEE;
}
/* Background image for current day vertical line */
#watermark .timetracker_column_today {
background-image: url("/ganttzk-demo-webapp/zkau/web/ganttz/img/watermark_today.png");
background-repeat: repeat-y;
}
#watermark .bankHoliday {
background-color: #FFEEEE; !important;
}
/* Reduce spacing and font-size for watermark legend */
.z-columns, .z-column {
font-size: 8px !important;
text-align: center;
padding:0 0 0 0 !important;
}
table {
margin:0px;
padding:0px;
border:0px;
}
#scroll_container {
margin-top:70px;
height:300px; /* Recalculated based on window */
width:500px; /* Recalculated based on window */
overflow:hidden;
float:left;
position:absolute;
left:285px; /* Ganntz.ListdetailsWidth + borders = 280 + 5 */
/* border:solid green 1px; */
}
#timetracker {
/* border: solid 1px red; */
position:absolute;
left:285px; /* Ganntz.ListdetailsWidth + borders = 280 + 5 */
height:500px; /* zkTasklist.SCROLL_CONTAINER_INITIAL_HEIGHT (dynamic) */
width:600px; /* zkTasklist.SCROLL_CONTAINER_INITIAL_WIDTH (dynamic) */
position:absolute;
overflow-x:hidden;
float:left;
}
#zoom_buttons {
position:relative;
}
tr.z-vbox-sep {
height: 0px;
padding: 0px;
margin: 0px;
}
#ganttpanel_scroller_x, #ganttpanel_scroller_y {
position:absolute;
float:left;
overflow:auto;
}
#ganttpanel_scroller_x {
top: 600px; /* (dynamic) */
left: 285px; /* Ganntz.ListdetailsWidth + borders = 280 + 5 */
width:635px;
height:15px;
}
#ganttpanel_inner_scroller_x {
/* must be resized on ganttpanel javascript adjust size */
width:9000px; /* Real canvas dimensions */
height:15px; /* Scroll constant */
}
#ganttpanel_scroller_y {
top: 160px; /* Fixed top position */
left: 920px;
width:15px;
height:330px;
}
#ganttpanel_inner_scroller_y {
width:15px; /* Scroll constant */
height:1350px; /* Modified when added or removed tasks, or zoom adjustments */
}
.footer {
/* Pending to calculate general position */
display:none;
}
/* Hide at the beginning */
#ganttpanel_scroller_x {
display:none;
}
#ganttpanel_scroller_y {
display:none;
}

View file

@ -0,0 +1,46 @@
<?page title="Navalpro: Scheduling"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?>
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/common/layout/template_ganttzk_demo.zul"?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<?link rel="stylesheet" type="text/css" href="/planner/css/ganttzk.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/navalpro_v01.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/navalpro_zk.css"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<zk>
<zscript><![CDATA[
plannerData = new org.navalplanner.web.planner.DataForPlanner();
]]>
</zscript>
<!-- choose lightLoad, mediumLoad or highLoad.
-->
<planner id="planner" self="@{define(content)}"
configuration="${plannerData.lightLoad}">
<div id="idContextMenuTaskAssigment"></div>
</planner>
<popup width="300px" apply="${plannerData.taskEditForm}">
<grid>
<rows>
<row>
${c:l('task.name')}
<textbox id="name" />
</row>
<row>
${c:l('task.start')}
<datebox id="startDateBox" compact="true" />
</row>
<row>
${c:l('task.end')}
<datebox id="endDateBox" compact="true" />
</row>
<row>
${c:l('task.notes')}
<textbox id="notes" />
</row>
</rows>
</grid>
<button id="ok" label=" ${c:l('task.ok')}" />
</popup>
</zk>

View file

@ -16,6 +16,7 @@
<module>navalplanner-business</module>
<module>navalplanner-gantt-zk</module>
<module>navalplanner-webapp</module>
<module>ganttzk-demo-webapp</module>
</modules>
<!--