### Eclipse Workspace Patch 1.0 #P HREPTWO-trunk Index: addon/reviewed-action/frontend/src/main/java/org/hippoecm/frontend/plugins/reviewedactions/BasicReviewedActionsWorkflowPlugin.java =================================================================== --- addon/reviewed-action/frontend/src/main/java/org/hippoecm/frontend/plugins/reviewedactions/BasicReviewedActionsWorkflowPlugin.java (revision 24430) +++ addon/reviewed-action/frontend/src/main/java/org/hippoecm/frontend/plugins/reviewedactions/BasicReviewedActionsWorkflowPlugin.java (working copy) @@ -1,12 +1,12 @@ /* * Copyright 2008 Hippo. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -157,7 +157,7 @@ } return null; } - + @Override protected String execute(Workflow wf) throws Exception { BasicReviewedActionsWorkflow workflow = (BasicReviewedActionsWorkflow) wf; @@ -224,7 +224,7 @@ protected Dialog createRequestDialog() { WorkflowDescriptorModel wdm = (WorkflowDescriptorModel) getDefaultModel(); try { - return new SchedulePublishDialog(this, new JcrNodeModel(wdm.getNode()), new PropertyModel(this, "date"), getEditorManager()); + return new SchedulePublishDialog(this, new JcrNodeModel(wdm.getNode()), new PropertyModel(this, "date"), getEditorManager(), date); } catch (RepositoryException ex) { log.warn("could not retrieve node for scheduling publish", ex); } @@ -254,7 +254,7 @@ protected Dialog createRequestDialog() { WorkflowDescriptorModel wdm = (WorkflowDescriptorModel) getDefaultModel(); try { - return new ScheduleDepublishDialog(this, new JcrNodeModel(wdm.getNode()), new PropertyModel(this, "date"), getEditorManager()); + return new ScheduleDepublishDialog(this, new JcrNodeModel(wdm.getNode()), new PropertyModel(this, "date"), getEditorManager(), date); } catch (RepositoryException e) { log.warn("could not retrieve node for scheduling depublish", e); } Index: addon/workflow/src/main/java/org/hippoecm/addon/workflow/CompatibilityWorkflowPlugin.java =================================================================== --- addon/workflow/src/main/java/org/hippoecm/addon/workflow/CompatibilityWorkflowPlugin.java (revision 24430) +++ addon/workflow/src/main/java/org/hippoecm/addon/workflow/CompatibilityWorkflowPlugin.java (working copy) @@ -1,12 +1,12 @@ /* * Copyright 2008 Hippo. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,6 +15,7 @@ */ package org.hippoecm.addon.workflow; +import java.util.Calendar; import java.util.Date; import java.util.Iterator; @@ -88,7 +89,7 @@ public WorkflowDescriptor getModelObject() { return (WorkflowDescriptor) getDefaultModelObject(); } - + @Deprecated public class WorkflowAction extends StdWorkflow { ResourceReference iconModel; @@ -357,7 +358,7 @@ modelServiceId = decorated.getString("model.folder"); tracker = new ServiceTracker(IModelReference.class) { - + IModelReference modelRef; IObserver modelObserver; @@ -369,11 +370,11 @@ modelRef.setModel(destination.getChainedModel()); context.registerService(modelObserver = new IObserver() { private static final long serialVersionUID = 1L; - + public IModelReference getObservable() { return modelRef; } - + public void onEvent(Iterator> events) { IModel model = modelRef.getModel(); if (model != null && model instanceof JcrNodeModel && ((JcrNodeModel) model).getNode() != null) { @@ -437,15 +438,20 @@ @Deprecated public class DateDialog extends WorkflowDialog { - public DateDialog(IModel question, final PropertyModel dateModel) { + public DateDialog(IModel question, final PropertyModel dateModel, Date minimumTime) { super(); add(new Label("question", question)); + + final Calendar minimumMinute = Calendar.getInstance(); + minimumMinute.setTime(minimumTime); + minimumMinute.set(Calendar.SECOND, 0); + minimumMinute.set(Calendar.MILLISECOND, 0); + YuiDateTimeField ydtf = new YuiDateTimeField("value", dateModel); - ydtf.add(DateValidator.minimum(new Date())); + ydtf.add(DateValidator.minimum(minimumMinute.getTime())); add(ydtf); setFocusOnCancel(); - } @Override Index: addon/reviewed-action/frontend/src/main/java/org/hippoecm/frontend/plugins/reviewedactions/dialogs/ScheduleDepublishDialog.java =================================================================== --- addon/reviewed-action/frontend/src/main/java/org/hippoecm/frontend/plugins/reviewedactions/dialogs/ScheduleDepublishDialog.java (revision 24430) +++ addon/reviewed-action/frontend/src/main/java/org/hippoecm/frontend/plugins/reviewedactions/dialogs/ScheduleDepublishDialog.java (working copy) @@ -1,12 +1,12 @@ /* * Copyright 2010 Hippo. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -33,8 +33,8 @@ private static final long serialVersionUID = 1L; - public ScheduleDepublishDialog(WorkflowAction action, JcrNodeModel nodeModel, PropertyModel dateModel, IEditorManager editorMgr) { - action.super(new ResourceModel("schedule-depublish-text"), dateModel); + public ScheduleDepublishDialog(WorkflowAction action, JcrNodeModel nodeModel, PropertyModel dateModel, IEditorManager editorMgr, Date minimum) { + action.super(new ResourceModel("schedule-depublish-text"), dateModel, minimum); ReferringDocumentsProvider provider = new ReferringDocumentsProvider(nodeModel, false); add(new ReferringDocumentsView("refs", provider, editorMgr)); Index: addon/reviewed-action/frontend/src/main/java/org/hippoecm/frontend/plugins/reviewedactions/FullReviewedActionsWorkflowPlugin.java =================================================================== --- addon/reviewed-action/frontend/src/main/java/org/hippoecm/frontend/plugins/reviewedactions/FullReviewedActionsWorkflowPlugin.java (revision 24430) +++ addon/reviewed-action/frontend/src/main/java/org/hippoecm/frontend/plugins/reviewedactions/FullReviewedActionsWorkflowPlugin.java (working copy) @@ -1,12 +1,12 @@ /* * Copyright 2009 Hippo. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -231,7 +231,7 @@ protected Dialog createRequestDialog() { WorkflowDescriptorModel wdm = (WorkflowDescriptorModel) getDefaultModel(); try { - return new SchedulePublishDialog(this, new JcrNodeModel(wdm.getNode()), new PropertyModel(this, "date"), getEditorManager()); + return new SchedulePublishDialog(this, new JcrNodeModel(wdm.getNode()), new PropertyModel(this, "date"), getEditorManager(), date); } catch (RepositoryException ex) { log.warn("could not retrieve node for scheduling publish", ex); } @@ -263,7 +263,7 @@ protected Dialog createRequestDialog() { WorkflowDescriptorModel wdm = (WorkflowDescriptorModel) getDefaultModel(); try { - return new ScheduleDepublishDialog(this, new JcrNodeModel(wdm.getNode()), new PropertyModel(this, "date"), getEditorManager()); + return new ScheduleDepublishDialog(this, new JcrNodeModel(wdm.getNode()), new PropertyModel(this, "date"), getEditorManager(), date); } catch (RepositoryException e) { log.warn("could not retrieve node for scheduling depublish", e); } @@ -578,7 +578,7 @@ /** * Get the name of the node this workflow operates on - * + * * @return The name of the node that the workflow operates on or an empty String if an error occurs * @throws RepositoryException */ @@ -593,7 +593,7 @@ // } /** * Use the IBrowseService to select the node referenced by parameter path - * + * * @param nodeModel Absolute path of node to browse to * @throws RepositoryException */ Index: addon/reviewed-action/frontend/src/main/java/org/hippoecm/frontend/plugins/reviewedactions/dialogs/SchedulePublishDialog.java =================================================================== --- addon/reviewed-action/frontend/src/main/java/org/hippoecm/frontend/plugins/reviewedactions/dialogs/SchedulePublishDialog.java (revision 24430) +++ addon/reviewed-action/frontend/src/main/java/org/hippoecm/frontend/plugins/reviewedactions/dialogs/SchedulePublishDialog.java (working copy) @@ -1,12 +1,12 @@ /* * Copyright 2010 Hippo. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,6 +15,8 @@ */ package org.hippoecm.frontend.plugins.reviewedactions.dialogs; +import java.util.Date; + import org.apache.wicket.model.IModel; import org.apache.wicket.model.PropertyModel; import org.apache.wicket.model.ResourceModel; @@ -34,8 +36,8 @@ private static final long serialVersionUID = 1L; public SchedulePublishDialog(WorkflowAction action, JcrNodeModel nodeModel, PropertyModel dateModel, - IEditorManager editorMgr) { - action.super(new ResourceModel("schedule-publish-text"), dateModel); + IEditorManager editorMgr, Date minimum) { + action.super(new ResourceModel("schedule-publish-text"), dateModel, minimum); UnpublishedReferenceNodeProvider provider = new UnpublishedReferenceNodeProvider( new UnpublishedReferenceProvider(new ReferenceProvider(nodeModel)));