com.wewebu.ow.server.plug.owdms
Class OwSaveDlgDialog

java.lang.Object
  extended by com.wewebu.ow.server.ui.OwEventTarget
      extended by com.wewebu.ow.server.ui.OwView
          extended by com.wewebu.ow.server.ui.OwLayout
              extended by com.wewebu.ow.server.ui.OwDialog
                  extended by com.wewebu.ow.server.app.OwStandardDialog
                      extended by com.wewebu.ow.server.plug.owdms.OwSaveDlgDialog
All Implemented Interfaces:
com.wewebu.ow.server.dmsdialogs.views.OwObjectClassView.OwObjectClassViewListner, OwSaveDlgDocumentImportView.OwSaveDlgDocumentImportViewListner, OwSaveDlgObjectPropertyView.OwSaveDlgObjectPropertyViewListner, com.wewebu.ow.server.ui.OwBaseView, com.wewebu.ow.server.ui.OwDialog.OwDialogListener, com.wewebu.ow.server.ui.OwUpdateTarget, EventListener
Direct Known Subclasses:
OwCheckInDialog, OwSaveDialog

public abstract class OwSaveDlgDialog
extends com.wewebu.ow.server.app.OwStandardDialog
implements OwSaveDlgObjectPropertyView.OwSaveDlgObjectPropertyViewListner, OwSaveDlgDocumentImportView.OwSaveDlgDocumentImportViewListner, com.wewebu.ow.server.dmsdialogs.views.OwObjectClassView.OwObjectClassViewListner, com.wewebu.ow.server.ui.OwDialog.OwDialogListener

Implementation of the Add Document Dialog.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Nested Class Summary
 
Nested classes/interfaces inherited from class com.wewebu.ow.server.ui.OwDialog
com.wewebu.ow.server.ui.OwDialog.OwDialogListener
 
Nested classes/interfaces inherited from class com.wewebu.ow.server.ui.OwLayout
com.wewebu.ow.server.ui.OwLayout.OwDispatchRegion
 
Field Summary
protected  com.wewebu.ow.server.dmsdialogs.views.OwObjectClassView m_classView
          the select class view
protected  OwSaveDlgDocumentImportView m_docImportView
          the document import view
protected  OwSaveDlgDocument m_document
          the document to hold the data like the imported document
protected  boolean m_fSaveOnly
          true = displays just the source view to select a save target, false = allows edit of class, properties and access rights
protected  int m_indexClassView
           
protected  int m_indexPropertyView
           
protected  int m_iViewMask
          filters the views and behaviors to be displayed
protected  com.wewebu.ow.server.app.OwSubLayout m_Layout
          layout to be used for the dialog
protected  OwSaveDlgObjectPropertyView m_PropertyView
          the property view
protected  com.wewebu.ow.server.app.OwClientRefreshContext m_RefreshCtx
          refresh context for callback
protected  String m_strParentObjectClass
          name of class to start from or null to start browsing from root
protected  com.wewebu.ow.server.app.OwSubNavigationView m_SubNavigation
          navigation view to navigate through the subviews
protected  Map m_ValuesMap
          a set of properties that should be set as default for the new object
static int VIEW_PROPERTY_CLASS_VIEW
          view flag
static int VIEW_PROPERTY_ENABLE_MULTIPLE_FILE_UPLOAD
          mask value to enable multiple file upload
static int VIEW_PROPERTY_ENABLE_PASTE_METADATA
          mask value to enable paste metadata in property view
 
Fields inherited from class com.wewebu.ow.server.app.OwStandardDialog
CLOSE_BTN_REGION, FOOTER_REGION, HELP_BTN_REGION, INFO_ICON_REGION, LEFT_REGION, m_strHelpPath, m_strInfoIconURL, m_strTitle, MAIN_REGION, MENU_REGION, RIGHT_REGION, STANDARD_DIALOG_REGION_MAX, TITLE_REGION
 
Fields inherited from class com.wewebu.ow.server.ui.OwDialog
m_iDEBUG_DocumentViewSize, m_iDEBUG_InitDocument, m_iDEBUG_TargetCount, m_Listener
 
Fields inherited from class com.wewebu.ow.server.ui.OwLayout
m_Regions
 
Fields inherited from class com.wewebu.ow.server.ui.OwView
CURRENT_MODULE_KEY, FORMULAR_PLACEHOLDER_END_DELIMITER, FORMULAR_PLACEHOLDER_START_DELIMITER, m_externalFormEventTarget
 
Fields inherited from interface com.wewebu.ow.server.ui.OwBaseView
EMPTY_STRING
 
Constructor Summary
OwSaveDlgDialog(com.wewebu.ow.server.ecm.OwResource resource_p, boolean fSaveOnly_p, List documentImporters_p)
          Create new OwSaveDlgDialog with the given parameters
 
Method Summary
protected  void cleanup()
           
protected  OwSaveDlgDocumentImportView createDocumentImportView(List documentImporters_p, int documentImporterContext_p)
          (overridable) Factory method to create own ImportViews
 void detach()
          Remove view and all subviews from context
protected  OwSaveDlgDocument getCurrentDocument()
          Helper returning the current used OwSaveDlgDocument.
 int getDocumentImporterContext()
          (overridable) Context for the DocumentImporter which are initialized by the OwSaveDlgDocumentImportView
protected  List getDocumentImporters()
          Returns the list of document importers to use.
protected  com.wewebu.ow.server.app.OwStandardDialog getPostProcessingDialog()
          (overridable) Get a dialog to be used for post processing of the current document item.
protected  boolean hasViewMask(int iViewMask_p)
          Check if view should be displayed or is masked out
protected  void init()
          Init the target after the context is set.
 boolean isPostProcessDialogOpen()
          Flag which notifies if the post process dialog was opened.
 boolean isRegion(int iRegion_p)
          Determine if region contains a view
 void onClose(javax.servlet.http.HttpServletRequest request_p)
          clear resources when dialog has been canceled
 void onDialogClose(com.wewebu.ow.server.ui.OwDialog dialog_p)
          This is the listener Implementation of for the post process dialog, and cannot be overwritten in sub classes.
 void onDocumentImported()
          Event fired when document has been imported
 void onObjectClassViewSelectClass(com.wewebu.ow.server.ecm.OwObjectClass classDescription_p, String strPath_p)
          event called when user selects a class
protected abstract  void onPostProcessDialogClose(com.wewebu.ow.server.ui.OwDialog dialog_p)
          Will be called if a postprocess dialog was opened, after closing it again.
 void onSaveDocument()
          Event fired when user clicks save and all properties are correct
 void onUpdate(com.wewebu.ow.server.ui.OwEventTarget caller_p, int iCode_p, Object param_p)
           
protected  void openPostProcessingView(com.wewebu.ow.server.app.OwDocumentImporter importer_p, com.wewebu.ow.server.ecm.OwObject processedObject_p)
          Open an post processing dialog if available for current getDocumentImporterContext().
Will add the post process view to the dialog into the OwStandardDialog.MAIN_REGION of given getPostProcessingDialog() and register itself as dialog close listener.
protected abstract  void performSave()
          This method is invoked after the dialog sequence has been finished (i.e.
 void renderRegion(Writer w_p, int iRegion_p)
          Render the views of the region
protected  void setIsPostProcessDialogOpen(boolean isOpen_p)
          Set the flag for post process dialog, if it is is open or was closed.
 void setRefreshContext(com.wewebu.ow.server.app.OwClientRefreshContext pluginRefreshCtx_p)
          Set a plugin refresh callback interface
 void setValues(Map properties_p)
          Submit a set of values that should be set as default for the new object
 void setViewMask(int iViewMask_p)
          Determine the views to be displayed by masking them with their flag
 
Methods inherited from class com.wewebu.ow.server.app.OwStandardDialog
getInfoIcon, getTitle, hasHelpButton, onHelp, onRender, renderCloseButton, renderHelpButton, setHelp, setInfoIcon, setTitle
 
Methods inherited from class com.wewebu.ow.server.ui.OwDialog
closeDialog, setListener
 
Methods inherited from class com.wewebu.ow.server.ui.OwLayout
addRegion, addView, addView, addViewReference, getIterator, getViewRegion, isRegionMaximized, isRegionMinimized, isRegionNormal, renderNamedRegion
 
Methods inherited from class com.wewebu.ow.server.ui.OwView
activate, getBreadcrumbPart, getDocument, getExternalFormEventTarget, getFormName, getFormTarget, getIcon, getMaximizeView, getParent, getRenderedNamedRegion, getRenderedRegion, getViewList, isFormTargetExternal, isNamedRegion, isShowMaximized, isShowMinimized, isShowNormal, onActivate, render, renderHTMLFormular, serverSideDesignInclude, serverSideInclude, setDocument, setExternalFormTarget, setMaximizeView, setParent, showMaximized, showMinimized, showNormal, usesFormWithAttributes
 
Methods inherited from class com.wewebu.ow.server.ui.OwEventTarget
attach, disableRequestListener, enableRequestListener, getAjaxEventURL, getContext, getEventURL, getFormEventFunction, getFormEventURL, getID, onExternalRequest, onFormEvent, onRequest, updateExternalFormTarget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VIEW_PROPERTY_ENABLE_PASTE_METADATA

public static final int VIEW_PROPERTY_ENABLE_PASTE_METADATA
mask value to enable paste metadata in property view

See Also:
Constant Field Values

VIEW_PROPERTY_ENABLE_MULTIPLE_FILE_UPLOAD

public static final int VIEW_PROPERTY_ENABLE_MULTIPLE_FILE_UPLOAD
mask value to enable multiple file upload

See Also:
Constant Field Values

VIEW_PROPERTY_CLASS_VIEW

public static final int VIEW_PROPERTY_CLASS_VIEW
view flag

See Also:
Constant Field Values

m_Layout

protected com.wewebu.ow.server.app.OwSubLayout m_Layout
layout to be used for the dialog


m_SubNavigation

protected com.wewebu.ow.server.app.OwSubNavigationView m_SubNavigation
navigation view to navigate through the subviews


m_docImportView

protected OwSaveDlgDocumentImportView m_docImportView
the document import view


m_classView

protected com.wewebu.ow.server.dmsdialogs.views.OwObjectClassView m_classView
the select class view


m_PropertyView

protected OwSaveDlgObjectPropertyView m_PropertyView
the property view


m_indexClassView

protected int m_indexClassView

m_indexPropertyView

protected int m_indexPropertyView

m_document

protected OwSaveDlgDocument m_document
the document to hold the data like the imported document


m_fSaveOnly

protected boolean m_fSaveOnly
true = displays just the source view to select a save target, false = allows edit of class, properties and access rights


m_RefreshCtx

protected com.wewebu.ow.server.app.OwClientRefreshContext m_RefreshCtx
refresh context for callback


m_strParentObjectClass

protected String m_strParentObjectClass
name of class to start from or null to start browsing from root


m_ValuesMap

protected Map m_ValuesMap
a set of properties that should be set as default for the new object


m_iViewMask

protected int m_iViewMask
filters the views and behaviors to be displayed

Constructor Detail

OwSaveDlgDialog

public OwSaveDlgDialog(com.wewebu.ow.server.ecm.OwResource resource_p,
                       boolean fSaveOnly_p,
                       List documentImporters_p)
Create new OwSaveDlgDialog with the given parameters

Parameters:
resource_p - the resource used to search for document classes
fSaveOnly_p - true = displays just the source view to select a save target, false = allows edit of class, properties and access rights
documentImporters_p - list of document importers to use
Method Detail

performSave

protected abstract void performSave()
                             throws Exception
This method is invoked after the dialog sequence has been finished (i.e. in case of a save-only dialog directly after document import and after properties review otherwise).
This method has to save, checkin or whatever it wants to do with the data stored in the OwSaveDlgDocument, cleanup() and close the dialog.

Throws:
Exception

hasViewMask

protected boolean hasViewMask(int iViewMask_p)
Check if view should be displayed or is masked out

Parameters:
iViewMask_p - bitmask according to VIEW_MASK_SYSTEM_... flags

setViewMask

public void setViewMask(int iViewMask_p)
Determine the views to be displayed by masking them with their flag

Parameters:
iViewMask_p - bitmask according to VIEW_MASK_SYSTEM_... flags

setRefreshContext

public void setRefreshContext(com.wewebu.ow.server.app.OwClientRefreshContext pluginRefreshCtx_p)
Set a plugin refresh callback interface

Parameters:
pluginRefreshCtx_p - OwClientRefreshContext

setValues

public void setValues(Map properties_p)
Submit a set of values that should be set as default for the new object

Parameters:
properties_p - Map of values keyed by parameter names to be set initially

init

protected void init()
             throws Exception
Init the target after the context is set.

Overrides:
init in class com.wewebu.ow.server.ui.OwView
Throws:
Exception

onSaveDocument

public void onSaveDocument()
                    throws Exception
Description copied from interface: OwSaveDlgObjectPropertyView.OwSaveDlgObjectPropertyViewListner
Event fired when user clicks save and all properties are correct

Specified by:
onSaveDocument in interface OwSaveDlgObjectPropertyView.OwSaveDlgObjectPropertyViewListner
Throws:
Exception

onDocumentImported

public void onDocumentImported()
                        throws Exception
Description copied from interface: OwSaveDlgDocumentImportView.OwSaveDlgDocumentImportViewListner
Event fired when document has been imported

Specified by:
onDocumentImported in interface OwSaveDlgDocumentImportView.OwSaveDlgDocumentImportViewListner
Throws:
Exception

detach

public void detach()
Remove view and all subviews from context

Overrides:
detach in class com.wewebu.ow.server.ui.OwView

renderRegion

public void renderRegion(Writer w_p,
                         int iRegion_p)
                  throws Exception
Render the views of the region

Specified by:
renderRegion in interface com.wewebu.ow.server.ui.OwBaseView
Overrides:
renderRegion in class com.wewebu.ow.server.app.OwStandardDialog
Parameters:
w_p - Writer object to write HTML to
iRegion_p - ID of the region to render
Throws:
Exception

isRegion

public boolean isRegion(int iRegion_p)
Determine if region contains a view

Specified by:
isRegion in interface com.wewebu.ow.server.ui.OwBaseView
Overrides:
isRegion in class com.wewebu.ow.server.app.OwStandardDialog
Parameters:
iRegion_p - ID of the region to render
Returns:
true if region contains anything and should be rendered

onUpdate

public void onUpdate(com.wewebu.ow.server.ui.OwEventTarget caller_p,
                     int iCode_p,
                     Object param_p)
              throws Exception
Specified by:
onUpdate in interface com.wewebu.ow.server.ui.OwUpdateTarget
Overrides:
onUpdate in class com.wewebu.ow.server.ui.OwView
Throws:
Exception

cleanup

protected void cleanup()
                throws Exception
Throws:
Exception

onClose

public void onClose(javax.servlet.http.HttpServletRequest request_p)
             throws Exception
clear resources when dialog has been canceled

Overrides:
onClose in class com.wewebu.ow.server.app.OwStandardDialog
Throws:
Exception

onObjectClassViewSelectClass

public void onObjectClassViewSelectClass(com.wewebu.ow.server.ecm.OwObjectClass classDescription_p,
                                         String strPath_p)
                                  throws Exception
event called when user selects a class

Specified by:
onObjectClassViewSelectClass in interface com.wewebu.ow.server.dmsdialogs.views.OwObjectClassView.OwObjectClassViewListner
Parameters:
classDescription_p - OwObjectClass
strPath_p - String path to selected tree item
Throws:
Exception

createDocumentImportView

protected OwSaveDlgDocumentImportView createDocumentImportView(List documentImporters_p,
                                                               int documentImporterContext_p)
(overridable) Factory method to create own ImportViews

Parameters:
documentImporters_p - List of OwDocumentImporter
documentImporterContext_p - int representing the
Returns:
OwSaveDlgDocumentImportView to use init document Importer view, should be one of OwDocumentImporter.IMPORT_CONTEXT_...
Since:
2.5.2.0
See Also:
getDocumentImporters(), getDocumentImporterContext()

getDocumentImporterContext

public int getDocumentImporterContext()
(overridable) Context for the DocumentImporter which are initialized by the OwSaveDlgDocumentImportView

Returns:
int OwDocumentImporter.IMPORT_CONTEXT_...
Since:
2.5.2.0

getDocumentImporters

protected List getDocumentImporters()
Returns the list of document importers to use.

Returns:
List of OwDocumentImporter's
Since:
2.5.2.0

getPostProcessingDialog

protected com.wewebu.ow.server.app.OwStandardDialog getPostProcessingDialog()
(overridable) Get a dialog to be used for post processing of the current document item. Should return a dialog where to add the post processing view.

Returns:
OwStandardDialog to be used, (non-null)
Since:
2.5.2.0

openPostProcessingView

protected void openPostProcessingView(com.wewebu.ow.server.app.OwDocumentImporter importer_p,
                                      com.wewebu.ow.server.ecm.OwObject processedObject_p)
                               throws Exception
Open an post processing dialog if available for current getDocumentImporterContext().
Will add the post process view to the dialog into the OwStandardDialog.MAIN_REGION of given getPostProcessingDialog() and register itself as dialog close listener.

Parameters:
importer_p - OwDocumentImporter which should be requested for post processing view
processedObject_p - OwObject which was recently processed
Throws:
Exception - if problem exist with opening post processing dialog
Since:
2.5.2.0

onDialogClose

public final void onDialogClose(com.wewebu.ow.server.ui.OwDialog dialog_p)
                         throws Exception
This is the listener Implementation of for the post process dialog, and cannot be overwritten in sub classes.

For processing the close event of post processing dialog subclasses must implement onPostProcessDialogClose(OwDialog)

Specified by:
onDialogClose in interface com.wewebu.ow.server.ui.OwDialog.OwDialogListener
Parameters:
dialog_p - OwDialog the post process dialog
Throws:
Exception
Since:
2.5.2.0
See Also:
onPostProcessDialogClose(OwDialog)

onPostProcessDialogClose

protected abstract void onPostProcessDialogClose(com.wewebu.ow.server.ui.OwDialog dialog_p)
                                          throws Exception
Will be called if a postprocess dialog was opened, after closing it again.

Parameters:
dialog_p - OwDialog which was used for post processing
Throws:
Exception
Since:
2.5.2.0

isPostProcessDialogOpen

public boolean isPostProcessDialogOpen()
Flag which notifies if the post process dialog was opened.

Returns:
boolean

setIsPostProcessDialogOpen

protected void setIsPostProcessDialogOpen(boolean isOpen_p)
Set the flag for post process dialog, if it is is open or was closed.

Parameters:
isOpen_p -

getCurrentDocument

protected OwSaveDlgDocument getCurrentDocument()
Helper returning the current used OwSaveDlgDocument.

Returns:
OwSaveDlgDocument
Since:
2.5.2.0


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.