-- Table structure for table `snapshot_sources`
--

CREATE TABLE `snapshot_sources` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `snapshot_id` int(11) NOT NULL,
  `data` longtext COLLATE utf8_bin,
  PRIMARY KEY (`id`),
  KEY `snap_sources_snapshot_id` (`snapshot_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4612 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

--
-- Dumping data for table `snapshot_sources`
--

INSERT INTO `snapshot_sources` VALUES (129,197,'package gov.nist.hit.ds.xdstools3.client.RESTUtils;\r\n\r\nimport javax.xml.bind.annotation.XmlElement;\r\nimport javax.xml.bind.annotation.XmlType;\r\n\r\n/**\r\n * Utility class for representing a {@linkRestDataSource} request as an object.\r\n *\r\n * @see //http://www.smartclient.com/docs/7.0rc2/a/b/c/go.html#class..RestDataSource\r\n */\r\n@XmlType\r\npublic abstract class DSRequest {\r\n\r\n	private String dataSource;\r\n	private OperationType operationType;\r\n	private int startRow;\r\n	private int endRow;\r\n	private String componentId;\r\n\r\n    @XmlElement(name = \"operationType\")\r\n	public OperationType getOperationType() {\r\n		return operationType;\r\n	}\r\n\r\n	public void setOperationType(OperationType operationType) {\r\n		this.operationType = operationType;\r\n	}\r\n\r\n    @XmlElement(name = \"startRow\")\r\n	public int getStartRow() {\r\n		return startRow;\r\n	}\r\n\r\n	public void setStartRow(int startRow) {\r\n		this.startRow = startRow;\r\n	}\r\n\r\n    @XmlElement(name = \"endRow\")\r\n	public int getEndRow() {\r\n		return endRow;\r\n	}\r\n\r\n	public void setEndRow(int endRow) {\r\n		this.endRow = endRow;\r\n	}\r\n\r\n	public void setComponentId(String componentId) {\r\n		this.componentId = componentId;\r\n	}\r\n\r\n    @XmlElement(name = \"componentId\")\r\n    public String getComponentId() {\r\n		return componentId;\r\n	}\r\n\r\n	public void setDataSource(String dataSource) {\r\n		this.dataSource = dataSource;\r\n	}\r\n\r\n    @XmlElement(name = \"dataSource\")\r\n	public String getDataSource() {\r\n		return dataSource;\r\n	}\r\n}\r\n'),(130,198,'package gov.nist.hit.ds.xdstools3.client.RESTUtils;\r\n\r\nimport javax.xml.bind.annotation.XmlElement;\r\nimport javax.xml.bind.annotation.XmlType;\r\n\r\n@XmlType\r\npublic abstract class DSResponse {\r\n    public static int STATUS_FAILURE = -1;\r\n    public static int STATUS_LOGIN_INCORRECT = -5;\r\n    public static int STATUS_LOGIN_REQUIRED = -7;\r\n    public static int STATUS_LOGIN_SUCCESS = -8;\r\n    public static int STATUS_MAX_LOGIN_ATTEMPTS_EXCEEDED = -6;\r\n    public static int STATUS_SERVER_TIMEOUT = -100;\r\n    public static int STATUS_SUCCESS = 0;\r\n    public static int STATUS_TRANSPORT_ERROR = -90;\r\n    public static int STATUS_VALIDATION_ERROR = -4;\r\n\r\n	private int status;\r\n	private int startRow;\r\n	private int endRow;\r\n	private int totalRows;\r\n\r\n    @XmlElement(name = \"startRow\")\r\n	public int getStartRow() {\r\n		return startRow;\r\n	}\r\n\r\n	public void setStartRow(int startRow) {\r\n		this.startRow = startRow;\r\n	}\r\n\r\n    @XmlElement(name = \"endRow\")\r\n	public int getEndRow() {\r\n		return endRow;\r\n	}\r\n\r\n	public void setEndRow(int endRow) {\r\n		this.endRow = endRow;\r\n	}\r\n	\r\n	public void setStatus(int status) {\r\n		this.status = status;\r\n	}\r\n\r\n    @XmlElement(name = \"status\")\r\n	public int getStatus() {\r\n		return status;\r\n	}\r\n\r\n	public void setTotalRows(int totalRows) {\r\n		this.totalRows = totalRows;\r\n	}\r\n\r\n    @XmlElement(name = \"totalRows\")\r\n	public int getTotalRows() {\r\n		return totalRows;\r\n	}\r\n}\r\n'),(131,199,'package gov.nist.hit.ds.xdstools3.client.RESTUtils;\r\n\r\nimport javax.xml.bind.annotation.XmlEnum;\r\nimport javax.xml.bind.annotation.XmlEnumValue;\r\nimport javax.xml.bind.annotation.XmlType;\r\n\r\n/**\r\n * Simple enumeration representing the different {@link //RestDataSource} scripts.\r\n */\r\n@XmlType\r\n@XmlEnum(String.class)\r\npublic enum OperationType {\r\n	@XmlEnumValue(\"add\") ADD, \r\n	@XmlEnumValue(\"fetch\") FETCH, \r\n	@XmlEnumValue(\"update\") UPDATE, \r\n	@XmlEnumValue(\"remove\") REMOVE\r\n}\r\n'),(132,201,'package gov.nist.hit.ds.xdstools3.client.RPCUtils;\r\n\r\nimport com.google.gwt.user.client.rpc.AsyncCallback;\r\nimport com.smartgwt.client.util.SC;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.Manager;\r\nimport gov.nist.hit.ds.xdstools3.client.util.eventBus.OpenTabEvent;\r\n\r\n/**\r\n * Created by dazais on 5/16/2014.\r\n */\r\npublic class OpenEndpointTabCallback implements AsyncCallback {\r\n    public void onFailure(Throwable caught) {\r\n        SC.say(\"Failed to communicate with the server. Please contact the support team.\");\r\n    }\r\n\r\n    @Override\r\n    /**\r\n     * Displays the Endpoint Tab if successful\r\n     */\r\n    public void onSuccess(Object result) {\r\n        // Display the Admin Settings Tab if login was successful\r\n        Manager.EVENT_BUS.fireEvent(new OpenTabEvent(\"ENDPOINTS\"));\r\n    }\r\n\r\n\r\n}\r\n'),(133,202,'package gov.nist.hit.ds.xdstools3.client.RPCUtils;\r\n\r\nimport com.google.gwt.user.client.rpc.AsyncCallback;\r\nimport com.smartgwt.client.util.SC;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.Manager;\r\nimport gov.nist.hit.ds.xdstools3.client.util.eventBus.OpenTabEvent;\r\n\r\n/**\r\n * Created by dazais on 5/16/2014.\r\n */\r\npublic class OpenSettingsTabCallback implements AsyncCallback {\r\n    public void onFailure(Throwable caught) {\r\n        SC.say(\"Failed to communicate with the server. Please contact the support team.\");\r\n    }\r\n\r\n    @Override\r\n    /**\r\n     * Displays the Admin Settings Tab if successful\r\n     */\r\n    public void onSuccess(Object result) {\r\n        // Display the Admin Settings Tab if login was successful\r\n        Manager.EVENT_BUS.fireEvent(new OpenTabEvent(\"ADMIN\"));\r\n    }\r\n\r\n\r\n}\r\n'),(134,203,'package gov.nist.hit.ds.xdstools3.client.RPCUtils;\r\n\r\nimport com.google.gwt.core.client.GWT;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.toolbar.ToolbarService;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.toolbar.ToolbarServiceAsync;\r\n\r\n/**\r\n * Utility class that retrieves an instance of the RPC Async Service interface\r\n */\r\npublic class RPCUtil {\r\n    private static ToolbarServiceAsync RPCService = null;\r\n\r\n    private RPCUtil(){\r\n        RPCService = GWT.create(ToolbarService.class);\r\n    }\r\n\r\n\r\n        public static ToolbarServiceAsync getInstance(){\r\n          if (RPCService == null) {\r\n              new RPCUtil();\r\n          }\r\n            return RPCService;\r\n     }\r\n\r\n}\r\n'),(135,205,'package gov.nist.hit.ds.xdstools3.client;\n\n\nimport com.google.gwt.activity.shared.AbstractActivity;\nimport com.google.gwt.core.client.GWT;\nimport com.google.gwt.user.client.Window;\nimport com.google.gwt.user.client.rpc.AsyncCallback;\nimport com.google.gwt.user.client.ui.AcceptsOneWidget;\nimport com.google.gwt.user.client.ui.IsWidget;\nimport com.smartgwt.client.types.Alignment;\nimport com.smartgwt.client.util.BooleanCallback;\nimport com.smartgwt.client.util.SC;\nimport com.smartgwt.client.widgets.HTMLFlow;\nimport com.smartgwt.client.widgets.layout.HLayout;\nimport com.smartgwt.client.widgets.layout.LayoutSpacer;\nimport com.smartgwt.client.widgets.layout.VLayout;\nimport com.smartgwt.client.widgets.tab.Tab;\nimport com.smartgwt.client.widgets.tab.events.TabSelectedEvent;\nimport com.smartgwt.client.widgets.tab.events.TabSelectedHandler;\nimport gov.nist.hit.ds.repository.shared.data.AssetNode;\nimport gov.nist.hit.ds.repository.ui.client.event.asset.OutOfContextAssetClickedEvent;\nimport gov.nist.hit.ds.repository.ui.client.event.asset.OutOfContextAssetClickedEventHandler;\nimport gov.nist.hit.ds.xdstools3.client.activitiesAndPlaces.TabPlace;\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.dialogs.PopupMessageV3;\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.toolbar.Toolbar;\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.toolbar.ToolbarService;\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.toolbar.ToolbarServiceAsync;\nimport gov.nist.hit.ds.xdstools3.client.manager.Manager;\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\nimport gov.nist.hit.ds.xdstools3.client.tabs.*;\nimport gov.nist.hit.ds.xdstools3.client.tabs.QRSCombinedTab.QueryRetrieveSubmitCombinedTab;\nimport gov.nist.hit.ds.xdstools3.client.tabs.adminSettingsTab.AdminSettingsTab;\nimport gov.nist.hit.ds.xdstools3.client.tabs.connectathonTabs.*;\nimport gov.nist.hit.ds.xdstools3.client.tabs.contactTab.ContactTab;\nimport gov.nist.hit.ds.xdstools3.client.tabs.docEntryEditorTab.DocEntryEditorTab;\nimport gov.nist.hit.ds.xdstools3.client.tabs.findDocumentsTab.FindDocumentTab;\nimport gov.nist.hit.ds.xdstools3.client.tabs.homeTab.HomeTab;\nimport gov.nist.hit.ds.xdstools3.client.tabs.logBrowserTab.LogBrowserTab;\nimport gov.nist.hit.ds.xdstools3.client.tabs.mhdTabs.MHDValidatorTab;\nimport gov.nist.hit.ds.xdstools3.client.tabs.mhdTabs.MhdToXdsConverterTab;\nimport gov.nist.hit.ds.xdstools3.client.tabs.preConnectathonTestsTab.PreConnectathonTestsTab;\nimport gov.nist.hit.ds.xdstools3.client.tabs.queryRetrieveTabs.*;\nimport gov.nist.hit.ds.xdstools3.client.tabs.submitTestDataTab.SubmitTestDataTab;\nimport gov.nist.hit.ds.xdstools3.client.util.eventBus.*;\nimport gov.nist.hit.ds.xdstools3.client.tabs.MPQTab.MPQTab;\nimport gov.nist.hit.ds.xdstools3.client.util.injection.Xdstools3GinInjector;\n\nimport java.util.logging.Logger;\n\n\n/**\n * Main class of the application which is the Activity for Activity-Places design, the view and a bit of a controller.\n */\n// AcceptsOneWidget was added to avoid creating an entire MVP architecture (fuse Activity and View in one single class)\npublic class Xdstools3ActivityView extends AbstractActivity implements AcceptsOneWidget {\n    private ToolbarServiceAsync propertiesService = GWT.create(ToolbarService.class);\n    private Logger logger= Logger.getLogger(this.getClass().getName());\n\n    private GenericTabSet topTabSet;\n\n    private HLayout container;\n    private String tabId;\n    private HTMLFlow header= new HTMLFlow();\n    private String toolkitEvent=null;\n    private String toolkitVersion=null;\n\n    /**\n     * Method that starts the UI\n     */\n    public void run() {\n        // Toolbar\n        Toolbar configBar = new Toolbar();\n        configBar.setStyleName(\"app-padding\");\n\n\n        // Tabs\n        topTabSet = new GenericTabSet();\n        HLayout tabsetStack = new HLayout();\n        tabsetStack.setLayoutBottomMargin(27);\n        tabsetStack.addMembers(new LayoutSpacer(), topTabSet,new LayoutSpacer());\n        topTabSet.setWidth(1200);\n        Tab homeTab = new HomeTab(\"Home\");\n        topTabSet.addTab(homeTab);\n        tabsetStack.setZIndex(-1);\n\n\n        // Main layout\n        VLayout mainLayout = new VLayout();\n        setHeader();\n        HTMLFlow footer = new HTMLFlow();\n        footer.setContents(getFooterHtmlContent());\n\n        mainLayout.addMembers(header, configBar, tabsetStack, footer);\n        mainLayout.setStyleName(\"mainLayout\");\n\n        // Attach the contents to the RootLayoutPanel\n        container = new HLayout();\n        container.setAlign(Alignment.CENTER);\n        container.setWidth100();\n        container.setHeight100();\n        container.addMembers(mainLayout);\n        container.draw();\n\n        // Smartgwt Console - useful for development, mainly tracking RPC calls\n        //SC.showConsole();\n\n        bindUI();\n    }\n\n    private void setHeader() {\n        header.setContents(getHeaderHtmlContent());\n        header.redraw();\n    }\n\n    /**\n     * binds the UI Actions\n     */\n    private void bindUI() {\n        propertiesService.getToolkitEvent(new AsyncCallback<String>() {\n            @Override\n            public void onFailure(Throwable throwable) {\n                new PopupMessageV3(\"Error loading Connectathon event name from properties. See log for more information.\");\n                logger.warning(\"Error loading Connectathon event name from properties. \" + throwable.getMessage());\n            }\n\n            @Override\n            public void onSuccess(String s) {\n                toolkitEvent = s;\n                setHeader();\n            }\n        });\n        propertiesService.getToolkitVersion(new AsyncCallback<String>() {\n            @Override\n            public void onFailure(Throwable throwable) {\n                new PopupMessageV3(\"Error loading app version property. See log for more information.\");\n                logger.warning(\"Error loading app version property. \"+throwable.getMessage());\n            }\n\n            @Override\n            public void onSuccess(String s) {\n                toolkitVersion=s;\n                setHeader();\n            }\n        });\n        // Add listener for Open Tab eventBus. The tabs called must be defined in function \"openTab\".\n        Manager.EVENT_BUS.addHandler(OpenTabEvent.TYPE, new OpenTabEventHandler(){\n            public void onEvent(OpenTabEvent event) {\n                openTab(event.getTabName());\n            }\n        });\n\n        topTabSet.addTabSelectedHandler(new TabSelectedHandler() {\n            @Override\n            public void onTabSelected(TabSelectedEvent tabSelectedEvent) {\n                String tabName;\n                tabName=((GenericTab) tabSelectedEvent.getTab()).getTabName();\n                Xdstools3GinInjector.injector.getPlaceController().goTo(new TabPlace(tabName));\n            }\n        });\n        //---------- Close Tabs from context menu ---------\n        //------ TODO Could be move to GenericTabSet ------\n        Manager.EVENT_BUS.addHandler(CloseTabEvent.TYPE,new CloseTabEvent.CloseTabEventHandler() {\n            @Override\n            public void onCloseTabEvent(CloseTabEvent event) {\n                final Tab t=event.getTab();\n                SC.confirm(\"Are you sure you want to close the tab: \'\" + t.getTitle() + \"\'?\", new BooleanCallback() {\n                    @Override\n                    public void execute(Boolean response) {\n                        if(response != null && response){\n                            topTabSet.removeTab(t);\n                        }\n                    }\n                });\n            }\n        });\n        Manager.EVENT_BUS.addHandler(CloseOtherTabsEvent.TYPE,new CloseOtherTabsEvent.CloseOtherTabsEventHandler() {\n            @Override\n            public void onCloseOtherTabsEvent(CloseOtherTabsEvent event) {\n                final Tab tab=event.getTab();\n                SC.confirm(\"Are you sure you want to close all tab except from: \'\" + tab.getTitle() + \"\'?\", new BooleanCallback() {\n                    @Override\n                    public void execute(Boolean response) {\n                        if(response != null && response){\n                            for (Tab t:topTabSet.getTabs()){\n                                if (!(t.getTitle().equals(\"Home\") || t.getTitle().equals(tab.getTitle()))){\n                                    topTabSet.removeTab(t);\n                                }\n                            }\n                        }\n                    }\n                });\n            }\n        });\n        Manager.EVENT_BUS.addHandler(CloseAllTabsEvent.TYPE,new CloseAllTabsEvent.CloseAllTabsEventHandler() {\n            @Override\n            public void onCloseAllTabsEvent(CloseAllTabsEvent event) {\n                SC.confirm(\"Are you sure you want to close your tabs?\", new BooleanCallback() {\n                    @Override\n                    public void execute(Boolean response) {\n                        if(response != null && response){\n                            for (Tab t:topTabSet.getTabs()){\n                                if (!(t.getTitle().equals(\"Home\"))){\n                                    topTabSet.removeTab(t);\n                                }\n                            }\n                        }\n                    }\n                });\n            }\n        });\n        //--------------------------------------------------\n        // Add handler for log browser events\n        try {\n            // This handler is specific to the widget launch from the MHD Validator tab\n            Manager.EVENT_BUS.addHandler(OutOfContextAssetClickedEvent.TYPE, new OutOfContextAssetClickedEventHandler() {\n                public void onAssetClick(OutOfContextAssetClickedEvent event) {\n                    try {\n                        final AssetNode target = event.getValue();\n\n                        if (\"text/csv\".equals(target.getMimeType())) {\n                            String rowNumberToHighlightStr = \"\" + event.getRowNumber();\n\n                            target.getExtendedProps().put(\"rowNumberToHighlight\", rowNumberToHighlightStr);\n\n                            Tab lbContextTab = new LogBrowserTab(target);\n                            topTabSet.addTab(lbContextTab);\n                            topTabSet.selectTab(lbContextTab);\n\n                        }\n\n                    } catch (Throwable t) {\n                        t.printStackTrace();\n                        Window.alert(t.toString());\n                    }\n\n                }\n            });\n\n        } catch (Throwable t) {\n            t.printStackTrace();\n            Window.alert(\"Event setup failed. \" + t.toString());\n        }\n        //--------------------------------------------------\n    }\n\n\n    /**\n     * Opens a given tab defined by its name. Updates the display to add this new tab and to bring it into focus.\n     * This function must be updated when new tabs are added to the application, as well as its related classes.\n     *\n     * @param tabName the name of the tab to open.\n     * @see gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager , OpenTabEvent\n     */\n    public void openTab(String tabName) {\n        Tab tab = null;\n\n        // ---------- v3 tabs --------\n        if (tabName.equals(TabNamesManager.getInstance().getHomeTabCode())){\n            tab = new HomeTab(\"Home\");\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getAdminTabCode())) {\n            tab = new AdminSettingsTab();\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getEndpointsTabCode())) {\n            tab = new EndpointConfigTab();\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getFindDocumentsTabCode())) {\n            tab = new FindDocumentTab();\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getMpqFindDocumentsTabCode())) {\n            tab = new MPQTab();\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getMessageValidatorTabCode())) {\n            tab = new MessageValidatorTab();\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getPreConnectathonTestsTabCode())) {\n            tab = new PreConnectathonTestsTab();\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getDocumentMetadataEditorTabCode())) {\n            tab = new DocEntryEditorTab();\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getGetDocumentsTabCode())) {\n            tab = new GetDocumentsTab();\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getFindFoldersCode())) {\n            tab = new FindFoldersTab();\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getGetFoldersTabCode())) {\n            tab = new GetFoldersTab();\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getRetrieveDocumentTabCode())) {\n            tab = new RetrieveDocumentsTab();\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getGetFoldersAndContentsCode())) {\n            tab = new GetFolderAndContentsTab();\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getGetSubmissionSetAndContentsTabCode())) {\n            tab = new GetSubmissionSetAndContentsTab();\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getGetRelatedDocumentsCode())) {\n            tab = new GetRelatedDocumentsTab();\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getSourceStoresDocumentValidationCode())) {\n            tab = new SourcesStoresDocumentValidationTab();\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getRegisterAndQueryTabCode())) {\n            tab = new RegisterAndQueryTab();\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getLifecycleValidationTabCode())) {\n            tab = new LifecycleValidationTab();\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getFolderValidationTabCode())) {\n            tab = new FolderValidationTab();\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getSubmitRetrieveTabCode())) {\n            tab = new SubmitRetrieveTab();\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getMHDValidatorTabCode())) {\n            tab = new MHDValidatorTab();\n        }\n        else if(tabName.equals(TabNamesManager.getInstance().getTestDataSubmissionTabCode())){\n            tab = new SubmitTestDataTab();\n        }\n        else if (tabName.equals(TabNamesManager.getInstance().getLogBrowserTabCode())) {\n            tab = new LogBrowserTab();\n        }\n        else if(tabName.equals(TabNamesManager.getInstance().getMhdtoXdsConverterTabCode())){\n            tab = new MhdToXdsConverterTab();\n        }\n        else if(tabName.equals(TabNamesManager.getInstance().getHelpTabCode())){\n            tab = new HelpTab();\n        }\n        else if(tabName.equals(TabNamesManager.getInstance().getContactTabCode())){\n            tab = new ContactTab();\n        }\n        else if(tabName.equals(TabNamesManager.getInstance().getQRSCombinedTabCode())){\n            tab = new QueryRetrieveSubmitCombinedTab();\n        }\n        else{\n            // unknown tab\n            topTabSet.selectTab(0); // todo we can create a 404\n        }\n\n        // update set of tabs\n        if (tab != null) {\n            // tests if the tab is already open\n            Tab t=topTabSet.findTab(tab);\n            if(t!=null){\n                // select and display the tab when already open\n                topTabSet.selectTab(t);\n            }else{\n                // open a new tab in tabset, select and display it.\n                topTabSet.addTab(tab);\n                topTabSet.selectTab(tab);\n            }\n        }\n    }\n\n    /**\n     * Implementation of abstract activity method that starts an activity.\n     * This method is called each time an activity must be loaded, which means\n     * each time Place change.\n     *\n     * @param acceptsOneWidget\n     * @param eventBus\n     */\n    @Override\n    public void start(AcceptsOneWidget acceptsOneWidget, com.google.gwt.event.shared.EventBus eventBus) {\n        if(tabId!=null ) {\n            // Open required tab\n            Manager.EVENT_BUS.fireEvent(new OpenTabEvent(tabId));\n        }\n    }\n\n    /**\n     * Method to set open Tab\'s ID (or to open)\n     * @param tabId\n     */\n    public void setTabId(String tabId) {\n        this.tabId = tabId;\n    }\n\n    /**\n     * Implementation of AcceptsOneWidget method to set a widget in the Activity (AcceptsOneWidget) main container.\n     * (Kind of an ActivityDisplayer)\n     *\n     * @param w widget to load in the activity\n     */\n    @Override\n    public void setWidget(IsWidget w) {\n        container.addMember(w.asWidget());\n    }\n    /**\n     * Method that create application header html content\n     * @return app header html\n     */\n    private String getHeaderHtmlContent() {\n        return \"<header id=\'appheader\'>\" +\n                \"<div id=\'apptitle-wrapper\'>\" +\n                \"<div id=\'apptitle\'>Document Sharing Toolkit</div>\" +\n                \"<div id=\'appevent\'>\"+ toolkitEvent +\"</div>\" +\n                \"<div id=\'appsubtitle\'>Testing platform for healthcare interoperability</div>\" +\n                \"<div id=\'appversion\'>\"+ toolkitVersion +\"</div>\" +\n                \"</div>\" +   /* end apptitle-wrapper */\n                \"</header>\" +\n                \"<nav class=\'navbar\'>\" +\n                \"<div class=\'app-padding navbar-inner\'>\" +\n                \"<ul>\" +\n                \"<li><a href=\'#\'>HOME</a></li>\" +\n               /* \"<li><a href=\'#\'>Queries & Retrieves</a>\" +\n                \"<ul>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getFindDocumentsTabCode()+\"\'>Find Document</a></li>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getMpqFindDocumentsTabCode()+\"\'>MPQ Find Documents</a></li>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getGetDocumentsTabCode()+\"\'>Get Documents</a></li>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getGetRelatedDocumentsCode()+\"\'>Get Related Documents</a></li>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getRetrieveDocumentTabCode()+\"\'>Retrieve Document</a></li>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getFindFoldersCode()+\"\'>Find Folders</a></li>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getGetFoldersTabCode()+\"\'>Get Folders</a></li>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getGetFoldersAndContentsCode()+\"\'>Get Folders and Contents</a></li>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getGetSubmissionSetAndContentsTabCode()+\"\'>Get Submission Set and Contents</a></li>\" +\n                \"</ul>\" +\n                \"</li>\" + */\n                \"<li><a href=\'#\'>MHD TOOLS</a>\" +\n                \"<ul>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getMHDValidatorTabCode()+\"\'>MHD Validator</a></li>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getMhdtoXdsConverterTabCode()+\"\'>MHD to XDS Converter</a></li>\" +\n                \"</ul>\" +\n                \"</li>\" +\n                \"<li><a href=\'#\'>TOOLS</a>\" +\n                \"<ul>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getMessageValidatorTabCode()+\"\'>Message Validator</a></li>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getDocumentMetadataEditorTabCode()+\"\'>Document Metadata Editor</a></li>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getPreConnectathonTestsTabCode()+\"\'>Pre-Connectathon Tests</a></li>\" +\n                \"</ul>\" +\n                \"</li>\" +\n               /* \"<li><a href=\'#\'>Send Test Data</a>\" +\n                \"<ul>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getv2TabCode()+\"\'>v2 Tab Example</a></li>\" +\n                \"</ul>\" +\n                \"</li>\" +\n                \"<li><a href=\'#\'>Simulators</a>\" +\n                \"<ul>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getv2TabCode()+\"\'>v2 Tab Example</a></li>\" +\n                \"</ul>\" +\n                \"</li>\" +\n                \"<li><a href=\'#\'>Connectathon Tools</a>\" +\n                \"<ul>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getSourceStoresDocumentValidationCode()+\"\'>XDS.b Doc Source Stores Document</a></li>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getRegisterAndQueryTabCode()+\"\'>XDS.b Register and Query</a></li>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getLifecycleValidationTabCode()+\"\'>XDS.b Lifecycle Validation</a></li>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getFolderValidationTabCode()+\"\'>XDS.b Registry Folder Validation</a></li>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getSubmitRetrieveTabCode()+\"\'>XDS.b Submit/Retrieve</a></li>\" +\n                \"</ul>\" +\n                \"</li>\" + */\n                // In order to obtain blue icons for that section, use this online tool: http://fa2png.io/ and color #0000aa (shade of blue).\n                \"<div style=\'float:right;\'>\" +\n               // \"<li><a class=\'right-side-button\' href=\'#\'><img class=\'icon-link\' src=\'images/icons/glyphicons/16px-blue/glyphicons-download-16px.png\'/> Download</a></li>\" +\n               // \"<li><a class=\'right-side-button\' href=\'#TabPlace:\"+ TabNamesManager.getInstance().getHelpTabCode()+\"\'><img class=\'icon-link\' src=\'images/icons/glyphicons/16px-blue/glyphicons-help-16px.png\'/> Help</a></li>\" +\n                \"<li><a href=\'#TabPlace:\"+ TabNamesManager.getInstance().getContactTabCode()+\"\'><i class=\'fa fa-envelope\'></i>&nbsp; CONTACT US</a></li>\" +\n                \"</div>\" +\n                \"<ul>\" +\n                \"</div>\" +\n                \"</nav>\";\n    }\n\n    /**\n     * Method that create application footer html content\n     * @return app footer html\n     */\n    private String getFooterHtmlContent() {\n        return \"<footer>\" +\n                \"    <ul>\" +\n                \"         <li>\" +\n                \"            <a href=\\\"http://www.nist.gov\\\">NIST homepage</a>\" +\n                \"         </li>\" +\n                \"         <li>\" +\n                \"            <a href=\\\"http://www.nist.gov/public_affairs/disclaimer.cfm\\\">NIST disclaimer</a>\" +\n                \"         </li>\" +\n                \"    </ul>\" +\n                \"</footer>\";\n    }\n\n}\n'),(136,206,'package gov.nist.hit.ds.xdstools3.client;\r\n\r\nimport com.google.gwt.activity.shared.ActivityManager;\r\nimport com.google.gwt.activity.shared.ActivityMapper;\r\nimport com.google.gwt.core.client.EntryPoint;\r\nimport com.google.gwt.core.client.GWT;\r\nimport com.google.gwt.place.shared.PlaceController;\r\nimport com.google.gwt.place.shared.PlaceHistoryHandler;\r\nimport com.google.web.bindery.event.shared.EventBus;\r\nimport gov.nist.hit.ds.xdstools3.client.activitiesAndPlaces.TabPlace;\r\nimport gov.nist.hit.ds.xdstools3.client.activitiesAndPlaces.Xdstools3ActivityMapper;\r\nimport gov.nist.hit.ds.xdstools3.client.activitiesAndPlaces.Xdstools3PlaceHistoryMapper;\r\nimport gov.nist.hit.ds.xdstools3.client.util.injection.Xdstools3GinInjector;\r\n\r\n/**\r\n * Application entry point. It start the UI and initiate the Activity Place design.\r\n *\r\n * Created by onh2 on 9/22/2014.\r\n */\r\npublic class Xdstools3EP implements EntryPoint {\r\n    private static final Xdstools3GinInjector injector=Xdstools3GinInjector.injector;\r\n\r\n    private static final EventBus eventBus= injector.getEventBus();\r\n    private static final ActivityMapper activityMapper=injector.getActivityMapper();\r\n    private Xdstools3ActivityView xdstools3ActivityView=injector.getXdstools3();\r\n\r\n    @Override\r\n    public void onModuleLoad() {\r\n        // start the application\r\n        xdstools3ActivityView.run();\r\n\r\n        PlaceController placeController = injector.getPlaceController();\r\n        ActivityMapper actMapper = new Xdstools3ActivityMapper();\r\n        ActivityManager activityManager = new ActivityManager(actMapper, eventBus);\r\n        // set the main widget container of the application (AcceptsOneWidget)\r\n        activityManager.setDisplay(xdstools3ActivityView);\r\n\r\n        Xdstools3PlaceHistoryMapper historyMapper = GWT.create(Xdstools3PlaceHistoryMapper.class);\r\n        final PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);\r\n\r\n        historyHandler.register(placeController, eventBus, new TabPlace(\"HOME\"));\r\n\r\n        // Goes to place represented on URL or default place\r\n        historyHandler.handleCurrentHistory();\r\n    }\r\n}\r\n'),(137,208,'package gov.nist.hit.ds.xdstools3.client.activitiesAndPlaces;\r\n\r\nimport com.google.gwt.place.shared.Place;\r\nimport com.google.gwt.place.shared.PlaceTokenizer;\r\n\r\n/**\r\n * TabPlace and its tokenizer are used for browser history and URL creation.\r\n *\r\n * The URL will be created as http://app-main-url#TabPlace:tabId\r\n * The different tabId are defined in {@link gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager}.\r\n *\r\n * Created by onh2 on 9/22/2014.\r\n */\r\npublic class TabPlace extends Place{\r\n    public static class Tokenizer implements PlaceTokenizer<TabPlace> {\r\n\r\n        @Override\r\n        public TabPlace getPlace(String s) {\r\n            return new TabPlace(s);\r\n        }\r\n\r\n        @Override\r\n        public String getToken(TabPlace tabPlace) {\r\n            return tabPlace.getTabId().toString();\r\n        }\r\n    }\r\n\r\n    private String tabId;\r\n\r\n    public TabPlace(String tabId){\r\n        this.tabId=tabId;\r\n    }\r\n\r\n    public String getTabId(){\r\n        return tabId;\r\n    }\r\n\r\n    @Override\r\n    public boolean equals(Object obj) {\r\n        if (obj instanceof TabPlace) {\r\n            return tabId.equals(((TabPlace) obj).tabId);\r\n        }\r\n        return false;\r\n    }\r\n\r\n    @Override\r\n    public int hashCode() {\r\n        return tabId.hashCode();\r\n    }\r\n\r\n    @Override\r\n    public String toString() {\r\n        return \"Place: \"+this.getClass().getName() +\r\n                \":\'\" + tabId +\" loaded.\";\r\n    }\r\n}\r\n'),(138,209,'package gov.nist.hit.ds.xdstools3.client.activitiesAndPlaces;\r\n\r\nimport com.google.gwt.activity.shared.Activity;\r\nimport com.google.gwt.activity.shared.ActivityMapper;\r\nimport com.google.gwt.place.shared.Place;\r\nimport gov.nist.hit.ds.xdstools3.client.Xdstools3ActivityView;\r\nimport gov.nist.hit.ds.xdstools3.client.util.injection.Xdstools3GinInjector;\r\n\r\nimport javax.inject.Inject;\r\n\r\n/**\r\n * Finds the activity to run for a given Place, used to configure an ActivityManager.\r\n * It binds the Places with the right Activities.\r\n *\r\n * @see TabPlace\r\n * @see com.google.gwt.activity.shared.ActivityManager\r\n *\r\n * Created by onh2 on 9/22/2014.\r\n */\r\npublic class Xdstools3ActivityMapper implements ActivityMapper {\r\n\r\n    @Inject\r\n    public Xdstools3ActivityMapper() {\r\n        super();\r\n    }\r\n\r\n    /**\r\n     * This method is supposed to return the right Activity for a given Place to load.\r\n     * It sets the id of the tab to load in Xdstools3ActivityView and return this Activity.\r\n     * The Activity will use this id to know which tab to open when it starts.\r\n     *\r\n     * @see gov.nist.hit.ds.xdstools3.client.Xdstools3ActivityView#start(com.google.gwt.user.client.ui.AcceptsOneWidget, com.google.gwt.event.shared.EventBus)\r\n     * @param place Place to load\r\n     * @return the right Activity for a given place to load.\r\n     */\r\n    @Override\r\n    public Activity getActivity(Place place) {\r\n        Xdstools3ActivityView xdstools3ActivityView = Xdstools3GinInjector.injector.getXdstools3();\r\n        //TODO check if place name exists otherwise redirect to home\r\n        xdstools3ActivityView.setTabId(((TabPlace) place).getTabId());\r\n        return xdstools3ActivityView;\r\n    }\r\n}\r\n'),(139,210,'package gov.nist.hit.ds.xdstools3.client.activitiesAndPlaces;\r\n\r\nimport com.google.gwt.place.shared.PlaceHistoryMapper;\r\nimport com.google.gwt.place.shared.WithTokenizers;\r\n\r\n/**\r\n * Monitors PlaceChangeEvents and History events and keep them in sync.\r\n * It must know all the different Places used in the application.\r\n *\r\n * Created by onh2 on 9/22/2014.\r\n */\r\n@WithTokenizers({TabPlace.Tokenizer.class})\r\npublic interface Xdstools3PlaceHistoryMapper extends PlaceHistoryMapper {\r\n}\r\n'),(140,212,'package gov.nist.hit.ds.xdstools3.client.customWidgets;\r\n\r\nimport com.smartgwt.client.types.ListGridComponent;\r\nimport com.smartgwt.client.types.ListGridEditEvent;\r\nimport com.smartgwt.client.widgets.form.DynamicForm;\r\nimport com.smartgwt.client.widgets.form.fields.SelectItem;\r\nimport com.smartgwt.client.widgets.grid.ListGrid;\r\nimport com.smartgwt.client.widgets.grid.ListGridField;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\nimport com.smartgwt.client.widgets.toolbar.ToolStrip;\r\nimport com.smartgwt.client.widgets.toolbar.ToolStripButton;\r\n\r\n/**\r\n * Created by onh2 on 1/8/2015.\r\n */\r\npublic class CodedTermEditableGridWidget extends VStack{\r\n    ListGrid codedTermGrid = new ListGrid();\r\n    ToolStripButton addButton;\r\n\r\n    public CodedTermEditableGridWidget(){\r\n        buildUI();\r\n    }\r\n\r\n    private void buildUI() {\r\n        ToolStrip gridEditControls = new ToolStrip();\r\n        gridEditControls.setWidth100();\r\n        gridEditControls.setHeight(24);\r\n\r\n        addButton = new ToolStripButton();\r\n        addButton.setIcon(\"icons/glyphicons/add.gif\");\r\n        addButton.setPrompt(\"Add a custom value\");\r\n\r\n        gridEditControls.setMembers(addButton);\r\n\r\n        codedTermGrid.setShowAllRecords(true);\r\n        codedTermGrid.setShowAllColumns(true);\r\n        codedTermGrid.setHeight(200);\r\n        codedTermGrid.setWidth100();\r\n        codedTermGrid.setCellHeight(25);\r\n        codedTermGrid.setTitle(\"Coded term grid\");\r\n\r\n        ListGridField displayNameField = new ListGridField(\"displayName\",\"Display name\");\r\n        ListGridField codeField = new ListGridField(\"code\",\"Code\");\r\n        ListGridField codingScheme = new ListGridField(\"codingScheme\",\"Coding scheme\");\r\n\r\n        codedTermGrid.setFields(displayNameField,codeField,codingScheme);\r\n        codedTermGrid.setCanEdit(true);\r\n        codedTermGrid.setEditEvent(ListGridEditEvent.DOUBLECLICK);\r\n\r\n        SelectItem existingCodedTerms = new SelectItem();\r\n        existingCodedTerms.setEmptyDisplayValue(\"Select a coded term to add...\");\r\n        existingCodedTerms.setType(\"comboBox\");\r\n        existingCodedTerms.setWidth(400);\r\n        existingCodedTerms.setTitle(\"Existing codes\");\r\n        DynamicForm form=new DynamicForm();\r\n        form.setWidth100();\r\n        form.setFields(existingCodedTerms);\r\n\r\n        codedTermGrid.setGridComponents(new Object[] {\r\n                gridEditControls,\r\n                ListGridComponent.HEADER,\r\n                ListGridComponent.FILTER_EDITOR,\r\n                ListGridComponent.BODY,\r\n                form\r\n        });\r\n\r\n        this.addMembers(codedTermGrid);\r\n    }\r\n\r\n}\r\n'),(141,213,'package gov.nist.hit.ds.xdstools3.client.customWidgets;\r\n\r\nimport com.smartgwt.client.widgets.form.fields.CheckboxItem;\r\nimport com.smartgwt.client.widgets.form.fields.FormItemIcon;\r\n\r\npublic class GenericCheckboxWithTooltipWidget extends CheckboxItem {\r\n	private String tooltip;\r\n	private FormItemIcon icon = new FormItemIcon(); \r\n	\r\n	public GenericCheckboxWithTooltipWidget(){\r\n	     icon.setSrc(\"help.png\");\r\n	     icon.setPrompt(\"\");\r\n	     setIcons(icon);\r\n	}\r\n	\r\n	public void setTooltip(String tip){\r\n		tooltip = tip;\r\n		icon.setPrompt(tooltip);\r\n	}\r\n	\r\n}\r\n'),(142,214,'package gov.nist.hit.ds.xdstools3.client.customWidgets;\r\n\r\nimport com.smartgwt.client.widgets.form.fields.FormItemIcon;\r\nimport com.smartgwt.client.widgets.form.fields.TextItem;\r\n\r\n/**\r\n * Creates a TextItem with a questionmark icon that displays a tooltip when hovered.\r\n * @see PatientIDWidget as an example of use.\r\n * @author dazais\r\n *\r\n */\r\npublic class GenericTextItemWithTooltipWidget extends TextItem {\r\n	\r\n	private String tooltip;\r\n	private FormItemIcon icon = new FormItemIcon(); \r\n	\r\n	public GenericTextItemWithTooltipWidget(){\r\n	     icon.setSrc(\"icons/glyphicons/glyphicons_194_circle_question_mark.png\");\r\n         icon.setBaseStyle(\"glyphicon\");\r\n	     icon.setPrompt(\"\");\r\n	     setIcons(icon);  \r\n	}\r\n	\r\n	public void setTooltip(String tip){\r\n		tooltip = tip;\r\n		icon.setPrompt(tooltip);\r\n	}\r\n\r\n}\r\n'),(143,215,'package gov.nist.hit.ds.xdstools3.client.customWidgets;\r\n\r\n\r\nimport com.smartgwt.client.widgets.form.DynamicForm;\r\nimport com.smartgwt.client.widgets.form.events.ItemChangedEvent;\r\nimport com.smartgwt.client.widgets.form.events.ItemChangedHandler;\r\n\r\n\r\n/**\r\n * Creates a TextItem to hold a Patient ID, to be used in a form. The PID input is required.\r\n * @author dazais\r\n *\r\n */\r\npublic class PatientIDWidget extends DynamicForm {\r\n\r\n    private String tooltip = \"Ex.: 2729f2aca58d47f^^^&1.3.6.1.4.1.21367.2005.3.7&ISO\";\r\n    private boolean pidValueEntered = false; //monitors the state of the PID field (value is required).\r\n    private GenericTextItemWithTooltipWidget pid;\r\n\r\n\r\n    public PatientIDWidget(){\r\n\r\n        pid = new GenericTextItemWithTooltipWidget();\r\n        pid.setWidth(400);\r\n        pid.setTitle(\"Patient ID *\");\r\n        pid.setName(\"patientID\");\r\n        pid.setRequired(true);\r\n        pid.setTooltip(tooltip);\r\n\r\n        setFields(pid);\r\n\r\n        this.addItemChangedHandler(new ItemChangedHandler() {\r\n            @Override\r\n            public void onItemChanged(ItemChangedEvent itemChangedEvent) {\r\n                if (itemChangedEvent.getNewValue() != null) {\r\n                    pidValueEntered = true;\r\n                } else { pidValueEntered = false; }\r\n            }\r\n        });\r\n\r\n    }\r\n\r\n    /** Indicates whether the PID field is empty or not\r\n     * */\r\n    public boolean isPidValueEntered() {\r\n        return pidValueEntered;\r\n    }\r\n\r\n    /** Returns the value of the text field PID\r\n     * **/\r\n    public String getValue(){\r\n        return pid.getValueAsString();\r\n    }\r\n}\r\n'),(144,216,'package gov.nist.hit.ds.xdstools3.client.customWidgets;\r\n\r\nimport com.smartgwt.client.widgets.Button;\r\nimport com.smartgwt.client.widgets.form.fields.ComboBoxItem;\r\nimport com.smartgwt.client.widgets.layout.HStack;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\n/**\r\n * Custom ComboBox for CodedTerms with pre-loaded possible values depending on the type of CodedTerm.\r\n *\r\n */\r\npublic class PredefinedCodedTermComboBox extends HStack {\r\n\r\n    private ComboBoxItem predefinedCodesComboBox;\r\n    private Button editCustomedValueBtn = new Button(\"Edit\");\r\n    private List<Integer> customedValuesIndexes = new ArrayList<Integer>();\r\n    private int selectedIndex = -1;\r\n\r\n//    public PredefinedCodedTermComboBox(PredefinedCodes predefinedCodes) {\r\n//        predefinedCodesComboBox=new ComboBoxItem();\r\n//        predefinedCodesComboBox.setTitle(\"Existing codes\");\r\n//\r\n//        getStore().clear();\r\n//        predefinedCodesComboBox.setEmptyDisplayValue(\"Select a code...\");\r\n//        predefinedCodesComboBox.setValueMap();\r\n//\r\n//        List<CodedTerm> l = PredefinedCodesParser.INSTANCE.getCodes(predefinedCodes);\r\n//\r\n//        getStore().add(new CodedTerm(\"\", \"Custom Value\", \"\"));\r\n//        getStore().addAll(l);\r\n//\r\n//        setTriggerAction(ComboBoxCell.TriggerAction.ALL);\r\n//        setForceSelection(true);\r\n//        setTypeAhead(true);\r\n//\r\n//        editCustomedValueBtn.disable();\r\n//\r\n//        setText(\"\");\r\n//        clear();\r\n//\r\n//        bind();\r\n//    }\r\n//\r\n//    public Widget getDisplay() {\r\n//        HorizontalLayoutContainer hcon = new HorizontalLayoutContainer();\r\n//        hcon.add(super.asWidget(), new HorizontalLayoutContainer.HorizontalLayoutData(1, 0.1, new Margins(0, 2, 0, 0)));\r\n//        hcon.add(editCustomedValueBtn, new HorizontalLayoutContainer.HorizontalLayoutData(-1, -1, new Margins(0, 1, 0, 2)));\r\n//        return hcon;\r\n//    }\r\n//\r\n//    public void hideTitle(){\r\n//        predefinedCodesComboBox.setShowTitle(false);\r\n//    }\r\n//\r\n//    public void showTitle(){\r\n//        predefinedCodesComboBox.setShowTitle(false);\r\n//    }\r\n//\r\n//    public void setTitle(String title){\r\n//        predefinedCodesComboBox.setTitle(title);\r\n//    }\r\n//\r\n//    public void setEmptyDisplayValue(String emptyDisplayValue){\r\n//        predefinedCodesComboBox.setEmptyDisplayValue(emptyDisplayValue);\r\n//    }\r\n//\r\n//    private void bind() {\r\n//        this.addBeforeSelectionHandler(new BeforeSelectionHandler<CodedTerm>() {\r\n//            @Override\r\n//            public void onBeforeSelection(BeforeSelectionEvent<CodedTerm> event) {\r\n//                if (event.getItem().getDisplayName().toString().equals(\"Custom Value\")) {\r\n//                    final CodedTermPopUpEditor codedTermPopUpEditor = new CodedTermPopUpEditor();\r\n//\r\n//                    codedTermPopUpEditor.getOkButton().addSelectHandler(new SelectEvent.SelectHandler() {\r\n//                        @Override\r\n//                        public void onSelect(SelectEvent event) {\r\n//                            CodedTerm added = codedTermPopUpEditor.getEditor().save();\r\n//                            if (added.getCode().toString() != null && added.getCodingScheme().toString() != null\r\n//                                    && added.getDisplayName().toString() != null) {\r\n//                                getStore().add(added);\r\n//                                select(added);\r\n//                                setValue(added);\r\n//                                customedValuesIndexes.add(getStore().indexOf(added));\r\n//                                redraw(true);\r\n//                                editCustomedValueBtn.enable();\r\n//                                codedTermPopUpEditor.hide();\r\n//                            }\r\n//                        }\r\n//                    });\r\n//                    codedTermPopUpEditor.getCancelButton().addSelectHandler(new SelectEvent.SelectHandler() {\r\n//                        @Override\r\n//                        public void onSelect(SelectEvent event) {\r\n//                            resetSelection();\r\n//                        }\r\n//                    });\r\n//                }\r\n//                selectedIndex = getStore().indexOf(event.getItem());\r\n//                if (customedValuesIndexes.contains(selectedIndex)) {\r\n//                    Logger.getLogger(this.getClass().getName()).info(\"Index: \" + customedValuesIndexes.indexOf(selectedIndex));\r\n//                    editCustomedValueBtn.enable();\r\n//                } else {\r\n//                    editCustomedValueBtn.disable();\r\n//                }\r\n//            }\r\n//        });\r\n//        editCustomedValueBtn.addSelectHandler(new SelectEvent.SelectHandler() {\r\n//            @Override\r\n//            public void onSelect(SelectEvent event) {\r\n//                final CodedTermPopUpEditor codedTermPopUpEditor = new CodedTermPopUpEditor();\r\n//                codedTermPopUpEditor.getOkButton().setText(\"Save changes\");\r\n//                final CodedTerm currentValue = getCurrentValue();\r\n//                codedTermPopUpEditor.getEditor().edit(currentValue);\r\n//                codedTermPopUpEditor.getOkButton().addSelectHandler(new SelectEvent.SelectHandler() {\r\n//                    @Override\r\n//                    public void onSelect(SelectEvent event) {\r\n//                        CodedTerm updated = codedTermPopUpEditor.getEditor().save();\r\n//                        if (updated.getCode().toString() != null && updated.getCodingScheme().toString() != null\r\n//                                && updated.getDisplayName().toString() != null) {\r\n//                            customedValuesIndexes.remove(customedValuesIndexes.indexOf(getStore().indexOf(currentValue)));\r\n//                            getStore().remove(currentValue);\r\n//                            getStore().add(updated);\r\n//                            select(updated);\r\n//                            setValue(updated);\r\n//                            customedValuesIndexes.add(getStore().indexOf(updated));\r\n//                            redraw(true);\r\n//                            editCustomedValueBtn.enable();\r\n//                            codedTermPopUpEditor.hide();\r\n//                        }\r\n//                    }\r\n//                });\r\n//            }\r\n//        });\r\n//    }\r\n//\r\n//    private void resetSelection() {\r\n//        setValue(null);\r\n//        redraw(true);\r\n//    }\r\n//\r\n//    /**\r\n//     * Popup editor for CodedTerm custom values\r\n//     */\r\n//    private class CodedTermPopUpEditor extends Dialog {\r\n//\r\n//        private final TextButton cancelButton;\r\n//        private final TextButton okButton;\r\n//        private final CodedTermEditorWidget editor;\r\n//\r\n//        public CodedTermPopUpEditor() {\r\n//            super();\r\n//            setBodyBorder(false);\r\n//            setHeadingText(\"Custom Coded Term\");\r\n//            setHideOnButtonClick(true);\r\n//            setWidth(600);\r\n//            setHeight(180);\r\n//\r\n//            FramedPanel fpanel = new FramedPanel();\r\n//            fpanel.setHeaderVisible(false);\r\n//            VerticalLayoutContainer vcon = new VerticalLayoutContainer();\r\n//            fpanel.add(vcon);\r\n//\r\n//            editor = new CodedTermEditorWidget();\r\n//            editor.initEditorDriver();\r\n//            editor.editNew();\r\n//            editor.setAllowBlanks(false, false, false);\r\n//\r\n//            okButton = new TextButton(\"Add \");\r\n//            okButton.setHeight(25);\r\n//            okButton.setWidth(80);\r\n//            cancelButton = new TextButton(\"Cancel\");\r\n//            cancelButton.setHeight(25);\r\n//            cancelButton.setWidth(80);\r\n//            fpanel.addButton(okButton);\r\n//            fpanel.addButton(cancelButton);\r\n//            fpanel.setButtonAlign(BoxLayoutContainer.BoxLayoutPack.CENTER);\r\n//\r\n//            vcon.add(editor, new VerticalLayoutContainer.VerticalLayoutData(1, 1, new Margins(10)));\r\n//\r\n//            add(fpanel);\r\n//\r\n//            // delete the default button\r\n//            getButtonBar().remove(0);\r\n//            setModal(true);\r\n//            show();\r\n//\r\n//            getEditor().setFocus();\r\n//\r\n//            bind();\r\n//        }\r\n//\r\n//        private void bind() {\r\n//            cancelButton.addSelectHandler(new SelectEvent.SelectHandler() {\r\n//                @Override\r\n//                public void onSelect(SelectEvent event) {\r\n//                    editor.setEditionMode(EditionMode.NODATA);\r\n//                    hide();\r\n//                }\r\n//            });\r\n//        }\r\n//\r\n//        public TextButton getCancelButton() {\r\n//            return cancelButton;\r\n//        }\r\n//\r\n//        public CodedTermEditorWidget getEditor() {\r\n//            return editor;\r\n//        }\r\n//\r\n//        public TextButton getOkButton() {\r\n//            return okButton;\r\n//        }\r\n//    }\r\n\r\n}\r\n'),(145,217,'package gov.nist.hit.ds.xdstools3.client.customWidgets;\r\n\r\n/**\r\n * Enumerated class for all possible type of CodedTerm.\r\n */\r\npublic enum PredefinedCodes {\r\n    CLASS_CODES, CONFIDENTIALITY_CODES, FORMAT_CODES, HEALTHCARE_FACILITY_TYPE_CODES, PRACTICE_SETTING_CODES, EVENT_CODES, TYPE_CODES;\r\n}\r\n'),(146,218,'package gov.nist.hit.ds.xdstools3.client.customWidgets;\r\n\r\nimport com.smartgwt.client.widgets.form.fields.SelectItem;\r\nimport com.smartgwt.client.widgets.form.fields.events.ChangedEvent;\r\nimport com.smartgwt.client.widgets.form.fields.events.ChangedHandler;\r\n\r\nimport java.util.LinkedHashMap;\r\n\r\n/**\r\n * Widget to select the reporting level of the log browser.\r\n */\r\npublic class ReportingLevelSelectWidget extends SelectItem {\r\n\r\n    private String selectedReportingLevel;\r\n\r\n    public ReportingLevelSelectWidget(){\r\n        setTitle(\"Select log level\");\r\n        setType(\"comboBox\");\r\n        setName(\"reportingLevelItem\");\r\n        setValueMap(loadLogLevels());\r\n        setDefaultValue(\"errors\");\r\n        selectedReportingLevel=\"errors\";\r\n    }\r\n\r\n    private LinkedHashMap<String,String> loadLogLevels() {\r\n        LinkedHashMap<String,String> logLevels = new LinkedHashMap<String,String>();\r\n        logLevels.put(\"all\",\"All\");\r\n        logLevels.put(\"errors\",\"Errors only\");\r\n        return logLevels;\r\n    }\r\n\r\n    private void bindUI(){\r\n        addChangedHandler(new ChangedHandler() {\r\n            @Override\r\n            public void onChanged(ChangedEvent changedEvent) {\r\n                selectedReportingLevel=(String) changedEvent.getValue();\r\n            }\r\n        });\r\n    }\r\n\r\n    public String getSelectedReportingLevel() {\r\n        return selectedReportingLevel;\r\n    }\r\n}\r\n'),(147,220,'package gov.nist.hit.ds.xdstools3.client.customWidgets.TLSAndSAML;\r\n\r\nimport com.google.gwt.user.client.ui.ListBox;\r\nimport com.smartgwt.client.widgets.form.fields.ComboBoxItem;\r\n\r\n/**\r\n * A simple SAML drop-down widget. It is set to be alone on a form line, by default.\r\n */\r\npublic class SAMLComboBox extends ComboBoxItem {\r\n\r\n    public SAMLComboBox() {\r\n        setValueMap(\"SAML off\", \"SAML on\", \"Do we have SAML in IHE?\", \"How many versions?\");\r\n        setValue(\"SAML off\");\r\n        setShowTitle(false);\r\n        setEndRow(true);\r\n\r\n    }\r\n}\r\n'),(148,221,'package gov.nist.hit.ds.xdstools3.client.customWidgets.TLSAndSAML;\r\n\r\nimport com.smartgwt.client.widgets.form.DynamicForm;\r\nimport com.smartgwt.client.widgets.form.fields.FormItem;\r\nimport com.smartgwt.client.widgets.form.fields.SpacerItem;\r\n\r\n/**\r\n * Created by dazais on 6/20/2014.\r\n */\r\npublic class TLSAndSAMLForm extends DynamicForm {\r\n\r\n    private TLSCheckbox tls;\r\n    private SAMLComboBox saml;\r\n\r\n    public TLSAndSAMLForm(){\r\n        tls = new TLSCheckbox();\r\n        tls.setEndRow(true);\r\n        saml = new SAMLComboBox();\r\n        saml.setEndRow(true);\r\n        SpacerItem space = new SpacerItem();\r\n        setFields(new FormItem[]{tls, space, saml});\r\n        setCellPadding(10);\r\n    }\r\n\r\n    public boolean isTLSChecked(){\r\n        return tls.getValueAsBoolean();\r\n    }\r\n\r\n    public String getSAMLValue(){\r\n        return saml.getDisplayValue();\r\n    }\r\n}\r\n'),(149,222,'package gov.nist.hit.ds.xdstools3.client.customWidgets.TLSAndSAML;\r\n\r\nimport com.smartgwt.client.widgets.form.fields.CheckboxItem;\r\n\r\n/**\r\n * A simple TLS checkbox widget.\r\n * TLS is checked by default since it is more commonly used than no TLS. It is also set to be alone on a form line, by default.\r\n */\r\npublic class TLSCheckbox extends CheckboxItem {\r\n\r\n    public TLSCheckbox() {\r\n        setTitle(\"TLS\");\r\n        setValue(true);\r\n       setEndRow(true);\r\n        setStartRow(true);\r\n    }\r\n}\r\n'),(150,223,'package gov.nist.hit.ds.xdstools3.client.customWidgets;\r\n\r\nimport com.smartgwt.client.widgets.form.fields.FormItemIcon;\r\nimport com.smartgwt.client.widgets.form.fields.UploadItem;\r\n\r\npublic class UploadItemWithTooltipWidget extends UploadItem {\r\n	\r\n	private String tooltip;\r\n	private FormItemIcon icon = new FormItemIcon(); \r\n	\r\n	public UploadItemWithTooltipWidget(){\r\n	     icon.setSrc(\"help.png\");\r\n	     icon.setPrompt(\"\");\r\n	     setIcons(icon);  \r\n	}\r\n	\r\n	public void setTooltip(String tip){\r\n		tooltip = tip;\r\n		icon.setPrompt(tooltip);\r\n	}\r\n	\r\n\r\n}\r\n'),(151,224,'package gov.nist.hit.ds.xdstools3.client.customWidgets;\r\n\r\nimport com.smartgwt.client.widgets.HTMLPane;\r\n\r\n/**\r\n * Widget that displays a wait message with a spinning wheel.\r\n * Needs to be added to a container.\r\n *\r\n * Use #show method to display the widget before the system starts processing.\r\n * Use #hide method to hide the widget once the system finishes processing.\r\n * Use #setWaitMessage method to change the message displayed by the widget.\r\n *\r\n * Created by onh2 on 12/23/2014.\r\n */\r\npublic class WaitPanel extends HTMLPane {\r\n    /**\r\n     * Default widget constructor.\r\n     * The widget will display the spinning wheel with the\r\n     * following message:\r\n     *      <pre>\"Waiting for validation result…\"</pre>\r\n     */\r\n    public WaitPanel(){\r\n        this(\"Waiting for validation result…\");\r\n    }\r\n\r\n    /**\r\n     * Custom widget constructor that will create a widget that\r\n     * displays a specific message next to the spinning wheel.\r\n     *\r\n     * @param message custom wait message\r\n     */\r\n    public WaitPanel(String message){\r\n        setWaitMessage(message);\r\n        setHeight(62);\r\n        setMargin(10);\r\n    }\r\n\r\n    /**\r\n     * Method that changes the wait message of the widget.\r\n     *\r\n     * @param message custom wait message\r\n     */\r\n    public void setWaitMessage(String message){\r\n        setContents(\"<div class=\'wait-message\'><img src=\'images/icons/loading.gif\'/> \"+message+\"</div>\");\r\n    }\r\n}\r\n'),(152,226,'package gov.nist.hit.ds.xdstools3.client.customWidgets.buttons;\r\n\r\nimport com.smartgwt.client.widgets.IButton;\r\n\r\n/**\r\n * Creates a TextItem to hold a Patient ID, to be used in a form. The PID input is required.\r\n * The button is disabled until a ChangeEvent occurs in the required form item(s). \r\n * @author dazais\r\n *\r\n */\r\npublic class GenericCancelButton extends IButton {\r\n\r\n	public GenericCancelButton(){\r\n		setTitle(\"Cancel\");\r\n		setWidth(80);\r\n	}\r\n\r\n\r\n\r\n}\r\n'),(153,227,'package gov.nist.hit.ds.xdstools3.client.customWidgets.buttons;\r\n\r\nimport com.smartgwt.client.widgets.form.fields.ButtonItem;\r\n\r\n/**\r\n * Creates a TextItem to hold a Patient ID, to be used in a form. The PID input is required.\r\n * The button is disabled until a ChangeEvent occurs in the required form item(s). \r\n * @author dazais\r\n *\r\n */\r\npublic class GenericRunButton extends ButtonItem {\r\n	\r\n	public GenericRunButton(){\r\n		setTitle(\"Run\");\r\n		setDisabled(true);  \r\n	}\r\n	\r\n	\r\n\r\n}\r\n'),(154,228,'package gov.nist.hit.ds.xdstools3.client.customWidgets.buttons;\r\n\r\nimport com.smartgwt.client.widgets.Button;\r\n\r\n/**\r\n * Creates a generic button, disabled by default, to become re-enabled when all required fields of a tab are filled out.\r\n * @author dazais\r\n *\r\n */\r\npublic class GenericRunButtonNoForm extends Button {\r\n	\r\n	public GenericRunButtonNoForm(){\r\n		setTitle(\"Run\");\r\n		setMargin(10);\r\n		setHeight(42);\r\n        setDisabled(true);\r\n		}\r\n}\r\n'),(155,229,'package gov.nist.hit.ds.xdstools3.client.customWidgets.buttons;\r\n\r\nimport com.smartgwt.client.types.Alignment;\r\nimport com.smartgwt.client.widgets.Canvas;\r\nimport com.smartgwt.client.widgets.IButton;\r\nimport com.smartgwt.client.widgets.events.ClickEvent;\r\nimport com.smartgwt.client.widgets.events.ClickHandler;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.dialogs.HelpWindow;\r\n\r\n/**\r\n * Creates a help button to be displayed on each tab. When clicked, the button displays a help window.\r\n * Usage: create the help button where needed. Set the desired contents of the Help Window. The rest is automatic.\r\n * Created by dazais on 12/20/2014.\r\n */\r\npublic class HelpButton extends IButton {\r\n    private HelpWindow helpWindow;\r\n    private String helpWindowContents;\r\n\r\n    /**\r\n     * Creates a Help button with a question mark icon.\r\n     * @param helpContainer\r\n     * @param helpContents\r\n     */\r\n    public HelpButton(final Canvas helpContainer, String helpContents) {\r\n        final Canvas helpWindowContainer = helpContainer;\r\n        helpWindowContents = helpContents;\r\n        setTitle(\"Help\");\r\n        setIcon(\"icons/glyphicons/16px-blue/glyphicons-help-16px.png\");\r\n\r\n        // When clicked, display a new Help Window. Contents of the Help Window must be set in the\r\n        // tab from which the call is made.\r\n        addClickHandler(new ClickHandler() {\r\n            public void onClick(ClickEvent event) {\r\n                helpWindow = new HelpWindow(helpWindowContents);\r\n                helpWindow.setLayoutAlign(Alignment.RIGHT);\r\n                helpWindowContainer.addChild(helpWindow);\r\n            }\r\n        });\r\n    }\r\n\r\n    public HelpWindow getHelpWindow() {\r\n        return helpWindow;\r\n    }\r\n\r\n    /**\r\n     * Registers the Help Window contents locally. This content will be set if / when the HelpWindow\r\n     * is created.\r\n     * @param contents\r\n     */\r\n    public void setHelpWindowContents(String contents){\r\n        helpWindowContents = contents;\r\n    }\r\n}\r\n'),(156,230,'package gov.nist.hit.ds.xdstools3.client.customWidgets.buttons;\r\n\r\nimport com.smartgwt.client.widgets.IButton;\r\n\r\n/**\r\n * Creates a TextItem to hold a Patient ID, to be used in a form. The PID input is required.\r\n * The button is disabled until a ChangeEvent occurs in the required form item(s). \r\n * @author dazais\r\n *\r\n */\r\npublic class LoginButton extends IButton {\r\n	\r\n	public LoginButton(){\r\n		setTitle(\"Login\");\r\n		setWidth(80);\r\n	}\r\n	\r\n	\r\n\r\n}\r\n'),(157,232,'package gov.nist.hit.ds.xdstools3.client.customWidgets.design;\r\n\r\n/**\r\n * Formatting utilities.\r\n */\r\npublic class Formatter {\r\n\r\n    public static IconLabel createTabHeader(String s){\r\n        IconLabel l = new IconLabel();\r\n        l.setContents(s);\r\n        l.setStyleName(\"h3\");\r\n        return l;\r\n    }\r\n\r\n    public static IconLabel createTabHeaderWithoutLeftPadding(String s){\r\n        IconLabel l = new IconLabel();\r\n        l.setContents(s);\r\n        l.setStyleName(\"h3-nopadding\");\r\n        return l;\r\n    }\r\n\r\n    public static IconLabel createHomeSubtitle(String s){\r\n        IconLabel l = new IconLabel();\r\n        l.setContents(s);\r\n        l.setStyleName(\"home-subtitle\");\r\n        return l;\r\n    }\r\n\r\n    public static IconLabel createSubtitle1(String s){\r\n        IconLabel l = new IconLabel();\r\n        l.setContents(s);\r\n        l.setStyleName(\"subtitle1\");\r\n        return l;\r\n    }\r\n\r\n    public static IconLabel createSubtitle2(String s){\r\n        IconLabel l = new IconLabel();\r\n        l.setContents(s);\r\n        l.setStyleName(\"subtitle2\");\r\n        return l;\r\n    }\r\n}\r\n'),(158,233,'package gov.nist.hit.ds.xdstools3.client.customWidgets.design;\r\n\r\nimport com.smartgwt.client.widgets.Label;\r\n\r\n/**\r\n * Standard Smartgwt label with custom icon formatting.\r\n */\r\npublic class IconLabel extends Label {\r\n\r\n    public IconLabel(){\r\n        super();\r\n        setIconSpacing(10);\r\n        setIconSize(15);\r\n        setWidth(400);\r\n        setHeight(18);\r\n    }\r\n\r\n}\r\n'),(159,235,'package gov.nist.hit.ds.xdstools3.client.customWidgets.dialogs;\r\n\r\nimport com.smartgwt.client.types.VerticalAlignment;\r\nimport com.smartgwt.client.widgets.Label;\r\nimport com.smartgwt.client.widgets.Window;\r\n\r\n/**\r\n * Creates a \"Help\" window, displayed at the top right of each tab.\r\n * Uses the SmartGWT Window component. All parameters, such as height, width, canDragResize, can be changed\r\n * after the object has been created.\r\n */\r\npublic class HelpWindow extends Window {\r\n\r\n    public HelpWindow (String contents){\r\n        setTitle(\"Help\");\r\n        setWidth(690);\r\n        setHeight(190);\r\n        setCanDragScroll(true);\r\n        setContents(contents);\r\n    }\r\n\r\n    /**\r\n     * Sets the contents of the help window.\r\n     * @param contents\r\n     */\r\n    public void setContents(String contents){\r\n        Label l = new Label(contents);\r\n        l.setWidth100();\r\n        l.setHeight100();\r\n        l.setPadding(10);\r\n        l.setLeft(20);\r\n        l.setValign(VerticalAlignment.TOP);\r\n        addItem(l);\r\n    }\r\n}\r\n'),(160,236,'package gov.nist.hit.ds.xdstools3.client.customWidgets.dialogs;\n\nimport com.smartgwt.client.types.Alignment;\nimport com.smartgwt.client.util.EventHandler;\nimport com.smartgwt.client.widgets.Button;\nimport com.smartgwt.client.widgets.Dialog;\nimport com.smartgwt.client.widgets.events.ClickEvent;\nimport com.smartgwt.client.widgets.events.ClickHandler;\nimport com.smartgwt.client.widgets.events.KeyDownEvent;\nimport com.smartgwt.client.widgets.events.KeyDownHandler;\n\n/**\n * Displays an error message in a SmartGWT popup.\n */\npublic class PopupMessageV3 extends Dialog {\n\n	public PopupMessageV3(String message) {\n        super();\n\n        // popup attributes\n        setTitle(\"Error\");\n        setAutoSize(true);\n        setMinWidth(350);\n        setIcon(\"[SKIN]error.png\");\n        setMessage(\"<span style=\'color: red\'>\" + message + \"</span>\");\n\n        // OK button\n		final Button ok = new Button(\"OK\");\n        ok.setLayoutAlign(Alignment.CENTER);\n\n        // Close the dialog with a click on the OK button\n		ok.addClickHandler(new ClickHandler() {\n			public void onClick(ClickEvent event) {\n                   clear();\n			}\n		});\n        // Close the dialog when pressing Enter or Escape\n        ok.addKeyDownHandler(new KeyDownHandler() {\n            @Override\n            public void onKeyDown(KeyDownEvent event) {\n                if (EventHandler.getKey().equals(\"Escape\") || EventHandler.getKey().equals(\"Enter\")){\n                    clear();\n                }\n            }\n        });\n        setButtons(ok);\n        // Set the focus on the button (has to be set only after drawing the widget)\n        ok.focus();\n\n        draw();\n	}\n\n\n// TODO this is legacy code, not updated yet\n//	public PopupMessageV3(AssertionResults result) {\n//        super();\n//\n//        VStack panel = new VStack();\n//		addItem(panel);\n//		for (AssertionResult ar : result.assertions) {\n//			if (ar.status) {\n//                panel.addMember(new HTMLFlow(ar.assertion));\n//			} else {\n//				panel.addMember(new HTMLFlow(\"<font color=\\\"#FF0000\\\">\" + ar.assertion + \"</font>\"));\n//			}\n//		}\n//\n//		Button ok = new Button(\"OK\");\n//		ok.addClickHandler(new ClickHandler() {\n//			public void onClick(ClickEvent event) {\n//				removeFromParent();\n//			}\n//		});\n//		panel.addMember(ok);\n//        setAlign(Alignment.CENTER);\n//		draw();\n//	}\n\n}\n\n'),(161,238,'package gov.nist.hit.ds.xdstools3.client.customWidgets.dialogs.loginDialog;\r\n\r\nimport com.google.gwt.core.client.GWT;\r\nimport com.google.gwt.user.client.rpc.AsyncCallback;\r\nimport com.smartgwt.client.data.DataSource;\r\nimport com.smartgwt.client.data.fields.DataSourcePasswordField;\r\nimport com.smartgwt.client.types.Alignment;\r\nimport com.smartgwt.client.types.VerticalAlignment;\r\nimport com.smartgwt.client.util.EventHandler;\r\nimport com.smartgwt.client.widgets.Label;\r\nimport com.smartgwt.client.widgets.Window;\r\nimport com.smartgwt.client.widgets.events.ClickEvent;\r\nimport com.smartgwt.client.widgets.events.ClickHandler;\r\nimport com.smartgwt.client.widgets.events.KeyDownEvent;\r\nimport com.smartgwt.client.widgets.events.KeyDownHandler;\r\nimport com.smartgwt.client.widgets.form.DynamicForm;\r\nimport com.smartgwt.client.widgets.layout.HLayout;\r\nimport com.smartgwt.client.widgets.layout.VLayout;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.buttons.GenericCancelButton;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.buttons.LoginButton;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.Manager;\r\nimport gov.nist.hit.ds.xdstools3.client.util.eventBus.OpenTabEvent;\r\n\r\npublic class LoginDialogWidget extends Window {\r\n    private static int POPUP_WIDTH = 295;\r\n    private static int POPUP_HEIGHT = 125;\r\n    protected DynamicForm form;\r\n    protected LoginButton login;\r\n    protected GenericCancelButton cancel;\r\n    protected DataSource dataSource;\r\n    private String protectedTab = \"\";\r\n    private VLayout vlayout;\r\n    LoginServiceAsync service = GWT.create(LoginService.class);\r\n\r\n\r\n\r\n    public LoginDialogWidget(String _protectedTab) {\r\n        protectedTab = _protectedTab;\r\n\r\n        // Create transactions\r\n        setTitle(\"Login\");\r\n        setWidth(POPUP_WIDTH); setHeight(POPUP_HEIGHT);\r\n        setShowResizeBar(false);\r\n        setAutoCenter(true);\r\n        setMembersMargin(10);\r\n        setLayoutMargin(10);\r\n\r\n\r\n        // Set DataSource (link to backend)\r\n        dataSource = new DataSource();\r\n        dataSource.setID(\"login\");\r\n        DataSourcePasswordField passwordField = new DataSourcePasswordField(\"password\", \"Password\", 50, true);\r\n        dataSource.setFields(passwordField);\r\n\r\n\r\n        vlayout = new VLayout();\r\n        vlayout.setHeight100();\r\n        vlayout.addMembers(createLoginForm(), createButtons());\r\n        vlayout.setAlign(Alignment.CENTER);\r\n        vlayout.setAlign(VerticalAlignment.CENTER);\r\n        addItem(vlayout);\r\n        login.focus();\r\n\r\n        // Close the dialog when pressing Escape, validate login when pressing Enter\r\n        this.addKeyDownHandler(new KeyDownHandler() {\r\n            @Override\r\n            public void onKeyDown(KeyDownEvent event) {\r\n                if (EventHandler.getKey().equals(\"Escape\")) {\r\n                    clear();\r\n                }\r\n                if (EventHandler.getKey().equals(\"Enter\")) {\r\n                    if (form.validate()) {\r\n                        logMeIn((String) form.getField(\"password\").getValue());\r\n                    }\r\n                }\r\n\r\n            }\r\n        });\r\n    }\r\n\r\n    /**\r\n     * Creates the form that asks for username and password\r\n     */\r\n    private DynamicForm createLoginForm() {\r\n        form = new DynamicForm();\r\n        form.setDataSource(dataSource);\r\n        form.setUseAllDataSourceFields(true);\r\n        form.setAutoFocus(true); form.setAutoFocusOnError(true);\r\n        //form.setHeight(40);\r\n        form.setCellPadding(5);\r\n        form.setAlign(Alignment.CENTER);\r\n        return form;\r\n    }\r\n\r\n    /**\r\n     * Creates \"Cancel\" and \"Login\" buttons\r\n     * @return The HLayout containing the buttons\r\n     */\r\n    private HLayout createButtons(){\r\n        login = new LoginButton();\r\n        login.setSelected(true);\r\n        login.addClickHandler(new ClickHandler() {\r\n            public void onClick(ClickEvent event) {\r\n                if (form.validate()) {\r\n                    logMeIn((String) form.getField(\"password\").getValue());\r\n                }\r\n            }\r\n        });\r\n\r\n        cancel = new GenericCancelButton();\r\n        cancel.addClickHandler(new ClickHandler() {\r\n            public void onClick(ClickEvent event) {\r\n                close();\r\n            }\r\n        });\r\n\r\n        HLayout buttonLayout = new HLayout();\r\n        buttonLayout.addMembers(cancel, login);\r\n        buttonLayout.setAlign(Alignment.CENTER);\r\n        buttonLayout.setMembersMargin(10);\r\n        buttonLayout.setLayoutMargin(10);\r\n        return buttonLayout;\r\n    }\r\n\r\n    /**\r\n     * Calls the server to check the user-entered password against the registered password.\r\n     * If the call to server fails, an error message is added to the existing login dialog.\r\n     * If the call succeeds, the login itself can have succeeded or failed. The status of the login attempt\r\n     * is relayed from the server using a Boolean.\r\n     */\r\n    protected void logMeIn(String password){\r\n\r\n        AsyncCallback<Boolean> callback = new AsyncCallback<Boolean>() {\r\n            public void onFailure(Throwable caught) {\r\n                // If the call to the server fails\r\n                // logger.debug(getClassName() + \": \" + \"logMeIn\");\r\n                Label errLabel = createErrorLabel(\"Could not contact the server for authentification. Please contact the system administrator.\");\r\n                vlayout.addMember(errLabel, 1);\r\n                vlayout.redraw();\r\n                setAutoSize(true);\r\n            }\r\n            @Override\r\n            public void onSuccess(Boolean loggedIn) {\r\n                if (loggedIn){\r\n                    Manager.EVENT_BUS.fireEvent(new OpenTabEvent(TabNamesManager.getInstance().getAdminTabCode()));\r\n                    // TODO display a \"you are logged in as admin\" text somewhere in a menu bar\r\n                    close(); // close the popup\r\n\r\n                } else {\r\n                    // call to server went through but login failed\r\n                    Label errLabel = createErrorLabel(\"Incorrect password. Nice try though!\");\r\n                    vlayout.hideMember(errLabel);\r\n                        vlayout.addMember(errLabel); // do nothing if this is the second failure or +,\r\n                                                        // the error label is already shown.\r\n\r\n                    vlayout.redraw();\r\n                    setAutoSize(true);\r\n                }\r\n            }\r\n        };\r\n        service.logMeIn(password, callback);\r\n    }\r\n\r\n    private Label createErrorLabel(String msg){\r\n        Label errorMsg = new Label();\r\n        errorMsg.setWidth(POPUP_WIDTH - 40);\r\n        errorMsg.setHeight(45);\r\n        errorMsg.setLayoutAlign(Alignment.CENTER);\r\n        errorMsg.setPadding(10);\r\n        errorMsg.setContents(\"<span style=\'color: \"+ \"red\" + \"\'>\" + msg + \"</span>\");\r\n        return errorMsg;\r\n    }\r\n\r\n}\r\n'),(162,239,'package gov.nist.hit.ds.xdstools3.client.customWidgets.dialogs.loginDialog;\r\n\r\nimport com.google.gwt.user.client.rpc.RemoteService;\r\nimport com.google.gwt.user.client.rpc.RemoteServiceRelativePath;\r\n\r\n/**\r\n * Client side of the GWT RPC mechanism. This is the service class.\r\n * \r\n * @author dazais\r\n * @see LoginServiceAsync\r\n *\r\n */\r\n@RemoteServiceRelativePath(\"login\")\r\npublic interface LoginService extends RemoteService {\r\n\r\n	public boolean logMeIn(String password);\r\n\r\n}\r\n'),(163,240,'package gov.nist.hit.ds.xdstools3.client.customWidgets.dialogs.loginDialog;\r\n\r\nimport com.google.gwt.user.client.rpc.AsyncCallback;\r\n\r\n/**\r\n * Client side of the GWT RPC mechanism. This is the asynchronous interface.\r\n * \r\n * @author dazais\r\n * @see LoginService\r\n *\r\n */\r\n\r\npublic interface LoginServiceAsync {\r\n\r\n	public void logMeIn(String password, AsyncCallback<Boolean> callback);\r\n}\r\n'),(164,242,'package gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.regular;\r\n\r\n/**\r\n * Created by dazais on 12/8/2014.\r\n */\r\npublic class EndpointConfigWidget {\r\n\r\n\r\n}\r\n'),(165,244,'package gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt;\r\n\r\nimport com.smartgwt.client.data.RestDataSource;\r\nimport com.smartgwt.client.data.fields.DataSourceTextField;\r\n\r\n/**\r\n * SmartGWT datasource for accessing entities over http in a RESTful manner.\r\n * Defines a RESTDataSource fields, scripts and REST service URLs.\r\n */\r\npublic class EndpointConfigDS_old extends RestDataSource {\r\n\r\n    private static EndpointConfigDS_old instance = null;\r\n\r\n    public static EndpointConfigDS_old getInstance() {\r\n        if (instance == null) {\r\n            instance = new EndpointConfigDS_old();\r\n        }\r\n        return instance;\r\n    }\r\n\r\n	private EndpointConfigDS_old() {\r\n        setID(\"supplyCategoryDS\");\r\n        setDataURL(\"resources/datasources/categories.data.xml\");\r\n        setRecordXPath(\"/List/supplyCategory\");\r\n\r\n        // Set fields\r\n		DataSourceTextField endpointId = new DataSourceTextField(\"id\");\r\n		endpointId.setPrimaryKey(true);\r\n		endpointId.setCanEdit(false);\r\n\r\n        DataSourceTextField categoryName = new DataSourceTextField(\"categoryName\", \"Category\", 128, true);\r\n        //categoryName.setPrimaryKey(true);\r\n\r\n        DataSourceTextField parentField = new DataSourceTextField(\"parentID\", null);\r\n        parentField.setHidden(true);\r\n        parentField.setRequired(true);\r\n        parentField.setRootValue(\"root\");\r\n        parentField.setForeignKey(\"supplyCategoryDS.categoryName\");\r\n        parentField.setPrimaryKey(true);\r\n\r\n        setFields(categoryName, parentField);\r\n\r\n\r\n\r\n        // Define REST URLs - not used for now\r\n        setDataURL(\"rest/endpointconfig\");\r\n	}\r\n}\r\n'),(166,246,'package gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.configure;\r\n\r\nimport com.smartgwt.client.widgets.form.fields.TextItem;\r\n\r\n/**\r\n * Created by dazais on 3/4/2015.\r\n */\r\npublic class BasicTextItem extends TextItem {\r\n\r\n    public BasicTextItem(String id){\r\n        super(id);\r\n        setWidth(\"*\");\r\n    }\r\n}\r\n'),(167,247,'package gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.configure;\r\n\r\nimport java.util.ArrayList;\r\n\r\n/**\r\n * Created by dazais on 3/9/2015.\r\n */\r\npublic class DSFactory {\r\n    private static ArrayList<SiteDS> dsArray = new ArrayList<SiteDS>();\r\n\r\n\r\n    public static SiteDS getDataSource(String siteName){\r\n        SiteDS ds = new SiteDS();\r\n        ds.setDataURL(\"resources/datasources/endpoints/\" + siteName + \".data.xml\");\r\n        ds.setID(siteName + \"DS\");\r\n\r\n        registerDS(ds);\r\n\r\n        return ds;\r\n    }\r\n\r\n    /**\r\n     * Keep track of instances of the SiteDS Datasource\r\n     * @param ds\r\n     */\r\n    private static void registerDS(SiteDS ds){\r\n        dsArray.add(ds);\r\n    }\r\n\r\n    /**\r\n     * Checks if a given instance of a datasource was already created, based on its ID\r\n     * @param datasourceID\r\n     * @return\r\n     */\r\n    public static boolean dsInstanceExists(String datasourceID){\r\n        for (SiteDS ds : dsArray) {\r\n            if (ds.getID() == datasourceID) {\r\n                return true;\r\n            }\r\n            return false;\r\n        }\r\n        return false;\r\n    }\r\n\r\n\r\n}\r\n'),(168,248,'package gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.configure;\r\n\r\nimport com.smartgwt.client.data.DataSource;\r\nimport com.smartgwt.client.data.fields.DataSourceTextField;\r\n\r\n/**\r\n * SmartGWT datasource for accessing entities over http in a RESTful manner.\r\n * Defines a RESTDataSource fields, scripts and REST service URLs.\r\n */\r\npublic class EndpointConfigDS extends DataSource {\r\n\r\n\r\n    private static EndpointConfigDS instance = null;\r\n\r\n    public static EndpointConfigDS getInstance() {\r\n        if (instance == null) {\r\n            instance = new EndpointConfigDS();\r\n        }\r\n        return instance;\r\n    }\r\n\r\n	private EndpointConfigDS() {\r\n        setID(\"endpointConfigDS\");\r\n        setDataURL(\"resources/datasources/endpoints/_actors.data.xml\");\r\n        setRecordXPath(\"/sites/site\"); // this is the path to the record we want to display, inside the XML file holding the data\r\n        setClientOnly(true);\r\n\r\n        DataSourceTextField siteName = new DataSourceTextField(\"siteName\", \"Site Name\");\r\n        siteName.setRequired(true);\r\n        siteName.setPrimaryKey(true);\r\n\r\n        setFields(siteName);\r\n\r\n    }\r\n}\r\n'),(169,249,'package gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.configure;\r\n\r\nimport com.smartgwt.client.types.Alignment;\r\nimport com.smartgwt.client.types.Overflow;\r\nimport com.smartgwt.client.widgets.Canvas;\r\nimport com.smartgwt.client.widgets.IButton;\r\nimport com.smartgwt.client.widgets.events.ClickEvent;\r\nimport com.smartgwt.client.widgets.events.ClickHandler;\r\nimport com.smartgwt.client.widgets.grid.ListGrid;\r\nimport com.smartgwt.client.widgets.grid.ListGridRecord;\r\nimport com.smartgwt.client.widgets.layout.HLayout;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\n\r\n/**\r\n * Creates grids to display and edit the Sites.\r\n * @see com.smartgwt.client.widgets.grid.ListGrid\r\n * @see SmartGWT nested ListGrid mechanism\r\n * @see EndpointConfigWidget\r\n *\r\n *\r\n * Created by dazais on 5/21/2014.\r\n */\r\n@SuppressWarnings(\"JavadocReference\")\r\npublic class EndpointConfigWidget extends VStack {\r\n    private ListGrid endpointGrid;\r\n    private HLayout buttonBar;\r\n\r\n    public EndpointConfigWidget() {\r\n        endpointGrid = createEndpointGrid();\r\n        buttonBar = createButtonBar();\r\n        addMembers(endpointGrid, buttonBar);\r\n    }\r\n\r\n    //TODO: Save to file, Delete\r\n    private ListGrid createEndpointGrid() {\r\n\r\n        // Create the ListGrid linked to the DataSource\r\n        final ListGrid grid = new ListGrid(){\r\n\r\n            @Override\r\n            protected Canvas getExpansionComponent(final ListGridRecord record) {\r\n                // Retrieve current site name from current grid record to generate a nested Widget with\r\n                // DataSource matching the site name\r\n                String siteName = record.getAttributeAsString(\"siteName\");\r\n\r\n                // create the nested widget\r\n                SiteWidget siteWidget = new SiteWidget(siteName);\r\n                //old: nestedGrid.fetchRelatedData(record, EndpointConfigDS.getInstance());\r\n                //siteWidget.fetchRelatedData(siteName);\r\n\r\n                return siteWidget;\r\n            }\r\n        };\r\n\r\n        // More formatting\r\n        grid.setMinWidth(800);\r\n        grid.setWidth100();\r\n        grid.setShowAllRecords(true);\r\n        grid.setBodyOverflow(Overflow.VISIBLE);\r\n        grid.setOverflow(Overflow.VISIBLE);\r\n        grid.setLeaveScrollbarGap(false);\r\n        grid.setDataSource(EndpointConfigDS.getInstance());\r\n        grid.setAutoFetchData(true);\r\n        grid.setCanExpandRecords(true);\r\n        grid.setCanExpandMultipleRecords(true);\r\n\r\n        return grid;\r\n    }\r\n\r\n    /**\r\n     * Creates the button bar for Save, Add, etc.\r\n     * @return\r\n     */\r\n    private HLayout createButtonBar(){\r\n        HLayout buttonsLayout = new HLayout(10);\r\n        buttonsLayout.setAlign(Alignment.CENTER);\r\n        buttonsLayout.setLayoutMargin(10);\r\n\r\n        IButton saveButton = new IButton(\"Save all\");\r\n        saveButton.setTop(250);\r\n        saveButton.addClickHandler(new ClickHandler() {\r\n            public void onClick(ClickEvent event) {\r\n                // FIXME this dooesnt work\r\n                //nestedGrid.saveAllEdits();\r\n                //nestedGrid.exportAsXML();\r\n            }\r\n        });\r\n        buttonsLayout.addMember(saveButton);\r\n\r\n        IButton newButton = new IButton(\"Add site\");\r\n        newButton.addClickHandler(new ClickHandler() {\r\n            public void onClick(ClickEvent event) {\r\n                //TODO add a site\r\n            }\r\n        });\r\n        buttonsLayout.addMember(newButton);\r\n\r\n        IButton discardButton = new IButton(\"Discard changes\");\r\n        discardButton.addClickHandler(new ClickHandler() {\r\n            public void onClick(ClickEvent event) {\r\n                //nestedGrid.discardAllEdits();\r\n            }\r\n        });\r\n        buttonsLayout.addMember(discardButton);\r\n\r\n\r\n        return buttonsLayout;\r\n    }\r\n\r\n}\r\n'),(170,250,'package gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.configure;\r\n\r\nimport com.google.gwt.user.client.rpc.RemoteService;\r\nimport com.google.gwt.user.client.rpc.RemoteServiceRelativePath;\r\nimport gov.nist.hit.ds.xdstools3.shared.Site;\r\n\r\n/**\r\n * Client side of the GWT RPC mechanism. This is the service class.\r\n *\r\n * @author dazais\r\n * @see EndpointServiceAsync\r\n *\r\n */\r\n@RemoteServiceRelativePath(\"sites\")\r\npublic interface EndpointService extends RemoteService {\r\n\r\n   // public Sites retrieveSites();\r\n    public Site retrieveSiteAttributes();\r\n\r\n}\r\n'),(171,251,'package gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.configure;\r\n\r\nimport com.google.gwt.user.client.rpc.AsyncCallback;\r\nimport gov.nist.hit.ds.xdstools3.shared.Site;\r\n\r\n/**\r\n * Client side of the GWT RPC mechanism. This is the asynchronous interface.\r\n *\r\n * @author dazais\r\n * @see EndpointService\r\n *\r\n */\r\n\r\npublic interface EndpointServiceAsync {\r\n\r\n   // void retrieveSites(AsyncCallback<Sites> async);\r\n    void retrieveSiteAttributes(AsyncCallback<Site> async);\r\n}\r\n'),(172,252,'package gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.configure;\r\n\r\nimport com.smartgwt.client.data.DataSource;\r\nimport com.smartgwt.client.data.fields.DataSourceTextField;\r\n\r\n/**\r\n * SmartGWT datasource.\r\n *\r\n *  Factory that creates a SiteDS, a customized type of SmartGWT DataSource, based on the current site name\r\n * Field names must match the XML source and must be unique to this datasource.\r\n */\r\npublic class SiteDS extends DataSource {\r\n\r\n    private static SiteDS instance = null;\r\n\r\n    //TODO as far as I know the singleton is not used anymore\r\n    public static SiteDS getInstance() {\r\n        if (instance == null){\r\n            instance = new SiteDS();\r\n        }\r\n        return instance;\r\n    }\r\n\r\n    public SiteDS() { // was private (singleton)\r\n        //setID(\"siteDS\");\r\n        //setDataURL(\"resources/datasources/endpoints/pub.data.xml\");\r\n        setRecordXPath(\"/site\"); //the XML path of the element we want to display, in the datasource file (.data.xml)\r\n        setClientOnly(true);\r\n\r\n\r\n        DataSourceTextField siteName = new DataSourceTextField(\"name\");\r\n        siteName.setValueXPath(\"@name\");\r\n        siteName.setHidden(true);\r\n        siteName.setForeignKey(\"endpointConfigDS.siteName\");\r\n\r\n        DataSourceTextField pidFeedHost = new DataSourceTextField(\"pidfeedhost\");\r\n        pidFeedHost.setValueXPath(\"actor/pid-feed/host\");\r\n        pidFeedHost.setDisplayField(\"pidfeedhost\");\r\n        pidFeedHost.setPrimaryKey(true);\r\n\r\n        DataSourceTextField pidFeedPort = new DataSourceTextField(\"pidfeedport\");\r\n        pidFeedPort.setValueXPath(\"actor/pid-feed/port\");\r\n        pidFeedPort.setDisplayField(\"pidfeedport\");\r\n\r\n/*        DataSourceTextField registerTls = new DataSourceTextField(\"rtls\");\r\n        pidFeedPort.setValueXPath(\"actor/pid-feed/port\");\r\n        pidFeedPort.setDisplayField(\"pidfeedport\");*/\r\n\r\n\r\n//        DataSourceTextField actorCode = new DataSourceTextField(\"actorCode\", \"Endpoint Code\");\r\n//        actorCode.setValueXPath(\"parent::actor/@actorCode\");\r\n//        actorCode.setDisplayField(\"actorType\");\r\n//        actorCode.setCanEdit(false);\r\n//        actorCode.setHidden(true); // is already displayed in group mode title\r\n//\r\n//        DataSourceTextField actorType = new DataSourceTextField(\"actorType\", \"Actor Type\");\r\n//        actorType.setValueXPath(\"parent::actor/@actorType\");\r\n//        actorType.setValueMap(\"Document Registry\", \"Document Repository\");\r\n\r\n\r\n        //---- transactions -----\r\n//\r\n//        DataSourceTextField transactionCode = new DataSourceTextField(\"transactionCode\");\r\n//        transactionCode.setDisplayField(\"transactionName\");\r\n\r\n//        DataSourceTextField transactionName = new DataSourceTextField(\"transactionName\", \"Transaction Type\");\r\n//        transactionName.setCanEdit(false);\r\n//        transactionName.setHidden(true); // used only for formatting\r\n\r\n\r\n        setFields(siteName, pidFeedHost, pidFeedPort);\r\n    }\r\n}\r\n'),(173,253,'package gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.configure;\r\n\r\nimport com.smartgwt.client.data.Criteria;\r\nimport com.smartgwt.client.types.Alignment;\r\nimport com.smartgwt.client.widgets.form.ValuesManager;\r\nimport com.smartgwt.client.widgets.form.fields.TextItem;\r\nimport com.smartgwt.client.widgets.layout.VLayout;\r\nimport gov.nist.hit.ds.xdstools3.shared.Site;\r\n\r\nimport java.util.ArrayList;\r\n\r\n/**\r\n * Contains the front-end code for one Site. This widget is composed of multiple forms, one per transaction type.\r\n * Created by dazais on 3/3/2015.\r\n */\r\npublic class SiteWidget extends VLayout {\r\n    protected TransactionBasicForm docRegistryForm, docRepoForm, docSourceForm, srcRepoForm, docRecptForm, respGatewayForm,\r\n            initGatewayForm;\r\n    protected ValuesManager manager;\r\n\r\n\r\n    public SiteWidget(String datasourceID) {\r\n        buildUI(datasourceID);\r\n        setFormManager();\r\n        setData();\r\n    }\r\n\r\n\r\n    /**\r\n     * Uses class SiteWidgetData to retrieve the form data\r\n     */\r\n    private void setData(){\r\n        // todo this needs to be made into a factory to return one class per nested endpoint\r\n        // TODO the field and map codes are the same, they may be better managed through a utility class...\r\n        try {\r\n            Site site = SiteWidgetData.getInstance().getData(); // TODO Site needs to be changed from dummy class to actual one located in sitemanagement/shared\r\n            manager.getItem(\"rtls\").setValue(\"test\"); // todo retrieve from the map by object key\r\n            //dataMap.get(\"rtls\")\r\n        } catch(Exception e){\r\n            e.printStackTrace();\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Adds all forms to the Values Manager.\r\n     * The Values Manager centralizes the value management of several forms that needed to be split for display purposes,\r\n     * but are part of the same logical form.\r\n     */\r\n    private void setFormManager(){\r\n        manager = new ValuesManager();\r\n        manager.addMember(docRegistryForm);\r\n        manager.addMember(docRepoForm);\r\n        manager.addMember(docSourceForm);\r\n        manager.addMember(srcRepoForm);\r\n        manager.addMember(docRecptForm);\r\n        manager.addMember(respGatewayForm);\r\n        manager.addMember(initGatewayForm);\r\n    }\r\n\r\n    private void buildUI(String datasourceID) {\r\n        setAlign(Alignment.CENTER);\r\n        setMembersMargin(10);\r\n        setLayoutTopMargin(10);\r\n        setLayoutBottomMargin(10);\r\n        setLayoutRightMargin(10);\r\n\r\n        // create the DataSource and the forms\r\n        // todo the datasource should go away\r\n        SiteDS siteDS = DSFactory.getDataSource(datasourceID); // this should be created only once\r\n        docRegistryForm = new TransactionBasicForm(siteDS);\r\n        docRepoForm = new TransactionBasicForm(siteDS);\r\n        docSourceForm = new TransactionBasicForm(siteDS);\r\n        srcRepoForm = new TransactionBasicForm(siteDS);\r\n        docRecptForm = new TransactionBasicForm(siteDS);\r\n        respGatewayForm = new TransactionBasicForm(siteDS);\r\n        initGatewayForm = new TransactionBasicForm(siteDS);\r\n\r\n\r\n        // ------ Document Registry fields ------\r\n        docRegistryForm.setGroupTitle(\"Document Registry\");\r\n\r\n        TextItem pidFeedHost = new TextItem(\"pidfeedhost\");\r\n        pidFeedHost.setTitle(\"Patient Identity Feed\");\r\n        pidFeedHost.setHint(\"Host\");\r\n        pidFeedHost.setWidth(400);\r\n        TextItem pidFeedPort = new TextItem(\"pidfeedport\");\r\n        pidFeedPort.setShowTitle(false);\r\n        pidFeedPort.setHint(\"Port\");\r\n        pidFeedPort.setWidth(50);\r\n        BasicTextItem registerTls = new BasicTextItem(\"rtls\");\r\n        registerTls.setTitle(\"Register\");\r\n        BasicTextItem registerNoTls = new BasicTextItem(\"rnotls\");\r\n        registerNoTls.setShowTitle(false);\r\n        BasicTextItem sqTls = new BasicTextItem(\"sqtls\");\r\n        sqTls.setTitle(\"Stored Query\");\r\n        BasicTextItem sqNoTls = new BasicTextItem(\"sqnotls\");\r\n        sqNoTls.setShowTitle(false);\r\n        BasicTextItem updateTls = new BasicTextItem(\"updatetls\");\r\n        updateTls.setTitle(\"Update\");\r\n        BasicTextItem updateNoTls = new BasicTextItem(\"updatenotls\");\r\n        updateNoTls.setShowTitle(false);\r\n        BasicTextItem mpqTls = new BasicTextItem(\"mpqtls\");\r\n        mpqTls.setTitle(\"Multi-Patient Query\");\r\n        BasicTextItem mpqNoTls = new BasicTextItem(\"mpqnotls\");\r\n        mpqNoTls.setShowTitle(false);\r\n\r\n        docRegistryForm.setFields(pidFeedHost, pidFeedPort, registerTls, registerNoTls, sqTls, sqNoTls, updateTls, updateNoTls,\r\n                mpqTls, mpqNoTls);\r\n\r\n\r\n        // ------ Document Repository fields ------\r\n        docRepoForm.setGroupTitle(\"Document Repository\");\r\n\r\n        TextItem repoUuid = new TextItem(\"repouuid\");\r\n        repoUuid.setTitle(\"Repository Unique ID\");\r\n        repoUuid.setWidth(400);\r\n        BasicTextItem retrieveTls = new BasicTextItem(\"retrievetls\");\r\n        retrieveTls.setTitle(\"Retrieve\");\r\n        BasicTextItem retrieveNoTls = new BasicTextItem(\"retrievenotls\");\r\n        retrieveNoTls.setShowTitle(false);\r\n        BasicTextItem pnrTls = new BasicTextItem(\"pnrtls\");\r\n        pnrTls.setTitle(\"Provide and Register\");\r\n        BasicTextItem pnrNoTls = new BasicTextItem(\"pnrnotls\");\r\n        pnrNoTls.setShowTitle(false);\r\n\r\n        docRepoForm.setFields(repoUuid, retrieveTls, retrieveNoTls, pnrTls, pnrNoTls);\r\n\r\n\r\n        // ------ On-Demand Document Source Fields ------\r\n        docSourceForm.setGroupTitle(\"On-Demand Document Source\");\r\n\r\n        BasicTextItem docSrcRetrieveTls = new BasicTextItem(\"docsrcretrievetls\");\r\n        docSrcRetrieveTls.setTitle(\"On-Demand Document Source Retrieve\");\r\n        BasicTextItem docSrcRetrieveNoTls = new BasicTextItem(\"docsrcretrievenotls\");\r\n        docSrcRetrieveNoTls.setShowTitle(false);\r\n\r\n        docSourceForm.setFields(docSrcRetrieveTls, docSrcRetrieveNoTls);\r\n\r\n\r\n        // ------ Integrated Source / Repository Fields ------\r\n        srcRepoForm.setGroupTitle(\"Integrated Source / Repository\");\r\n\r\n        BasicTextItem srcRepoRetrieveTls = new BasicTextItem(\"srcreporetrievetls\");\r\n        srcRepoRetrieveTls.setTitle(\"Integrated Source / Repository Retrieve\");\r\n        BasicTextItem srcRepoRetrieveNoTls = new BasicTextItem(\"srcreporetrievenotls\");\r\n        srcRepoRetrieveNoTls.setShowTitle(false);\r\n\r\n        srcRepoForm.setFields(srcRepoRetrieveTls, srcRepoRetrieveNoTls);\r\n\r\n\r\n        // ------ Document Recipient Fields ------\r\n        docRecptForm.setGroupTitle(\"Document Recipient\");\r\n\r\n        BasicTextItem xdrPnRTls = new BasicTextItem(\"xdrpnrtls\");\r\n        xdrPnRTls.setTitle(\"XDR Provide and Register\");\r\n        BasicTextItem xdrPnRNoTls = new BasicTextItem(\"xdrpnrnotls\");\r\n        xdrPnRNoTls.setShowTitle(false);\r\n\r\n        docRecptForm.setFields(xdrPnRTls, xdrPnRNoTls);\r\n\r\n\r\n        // ------ Responding Gateway Fields ------\r\n        respGatewayForm.setGroupTitle(\"Responding Gateway\");\r\n\r\n        TextItem homeCommunityId = new TextItem(\"hcid\");\r\n        homeCommunityId.setTitle(\"Home Community ID\");\r\n        homeCommunityId.setWidth(400);\r\n        BasicTextItem xcqTls = new BasicTextItem(\"xcqtls\");\r\n        xcqTls.setTitle(\"Cross-Community Query\");\r\n        BasicTextItem xcqNoTls = new BasicTextItem(\"xcqnotls\");\r\n        xcqNoTls.setShowTitle(false);\r\n        BasicTextItem xcrTls = new BasicTextItem(\"xcrtls\");\r\n        xcrTls.setTitle(\"Cross-Community Retrieve\");\r\n        BasicTextItem xcrNoTls = new BasicTextItem(\"xcrnotls\");\r\n        xcrNoTls.setShowTitle(false);\r\n        BasicTextItem xcpdTls = new BasicTextItem(\"xcpdtls\");\r\n        xcpdTls.setTitle(\"Cross-Community Patient Discovery\");\r\n        BasicTextItem xcpdNoTls = new BasicTextItem(\"xcpdnotls\");\r\n        xcpdNoTls.setShowTitle(false);\r\n\r\n        respGatewayForm.setFields(homeCommunityId, xcqTls, xcqNoTls, xcrTls, xcrNoTls, xcpdTls, xcpdNoTls);\r\n\r\n\r\n        // ------ Initiating Gateway Fields ------\r\n        initGatewayForm.setGroupTitle(\"Initiating Gateway\");\r\n\r\n        BasicTextItem igqTls = new BasicTextItem(\"igqtls\");\r\n        igqTls.setTitle(\"Initiating Gateway Query\");\r\n        BasicTextItem igqNoTls = new BasicTextItem(\"igqnotls\");\r\n        igqNoTls.setShowTitle(false);\r\n        BasicTextItem igrTls = new BasicTextItem(\"igrtls\");\r\n        igrTls.setTitle(\"Initiating Gateway Retrieve\");\r\n        BasicTextItem igrNoTls = new BasicTextItem(\"igrnotls\");\r\n        igrNoTls.setShowTitle(false);\r\n\r\n        initGatewayForm.setFields(igqTls, igqNoTls, igrTls, igrNoTls);\r\n\r\n\r\n        // ------- Add all the forms to the Vlayout -------\r\n        addMembers(docRegistryForm, docRepoForm, docSourceForm, srcRepoForm, docRecptForm, respGatewayForm, initGatewayForm);\r\n    }\r\n\r\n    public void fetchRelatedData(String currentSite){\r\n        // create the search criteria for the SiteDS (nested) DataSource\r\n        Criteria criteria = new Criteria(\"name\", currentSite);\r\n        ArrayList<TransactionBasicForm> array = new ArrayList<TransactionBasicForm>();\r\n        array.add(docRegistryForm);\r\n        array.add(docRepoForm);\r\n        array.add(docSourceForm);\r\n        array.add(srcRepoForm);\r\n        array.add(docRecptForm);\r\n        array.add(respGatewayForm);\r\n        array.add(initGatewayForm);\r\n\r\n        for (TransactionBasicForm currentForm : array) {\r\n            currentForm.fetchRelatedData(criteria);\r\n        }\r\n    }\r\n\r\n\r\n\r\n}\r\n'),(174,254,'package gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.configure;\r\n\r\nimport com.google.gwt.core.client.GWT;\r\nimport com.google.gwt.user.client.rpc.AsyncCallback;\r\nimport gov.nist.hit.ds.xdstools3.shared.Site;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.dialogs.PopupMessageV3;\r\n\r\n/**Singleton that contains the data to populate each nested form of the Site Config Widget.\r\n * Created by dazais on 3/19/2015.\r\n */\r\npublic class SiteWidgetData {\r\n\r\n    private static SiteWidgetData instance = null;\r\n    private EndpointServiceAsync rpc = GWT.create(EndpointService.class);\r\n   // static Logger logger = Logger.getLogger(SiteWidgetData.class);\r\n    protected Site siteAttributesMap; // data for the current site\r\n\r\n\r\n    public static SiteWidgetData getInstance(){\r\n        if (instance == null){return new SiteWidgetData();}\r\n        else return instance;\r\n    }\r\n\r\n    private SiteWidgetData(){\r\n    }\r\n\r\n\r\n    /** Retrieves over RPC and returns the nested data for one form of the Site widget.\r\n     * @return\r\n     */\r\n    public Site getData(){\r\n        AsyncCallback<Site> sitesCallback = new AsyncCallback<Site>() {\r\n\r\n            @Override\r\n            public void onFailure(Throwable caught) {\r\n                //logger.error(caught.getMessage());\r\n                new PopupMessageV3(caught.getMessage());\r\n            }\r\n\r\n            @Override\r\n            public void onSuccess(Site result) {\r\n                siteAttributesMap = result;\r\n            }\r\n        };\r\n\r\n        rpc.retrieveSiteAttributes(sitesCallback);\r\n        return siteAttributesMap;\r\n    }\r\n\r\n\r\n\r\n}\r\n'),(175,255,'package gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.configure;\r\n\r\nimport com.smartgwt.client.data.*;\r\nimport com.smartgwt.client.types.Overflow;\r\nimport com.smartgwt.client.widgets.form.DynamicForm;\r\n\r\n/**\r\n * Contains the parameters common to all forms used to build the Endpoint Configuration Widget.\r\n *\r\n * Created by dazais on 3/4/2015.\r\n */\r\npublic class TransactionBasicForm extends DynamicForm {\r\n\r\n    public TransactionBasicForm(DataSource ds){\r\n\r\n        // Form display parameters\r\n        setNumCols(3);\r\n        setColWidths(210, \"*\", \"*\");\r\n        setPadding(5);\r\n        setIsGroup(true);\r\n        setOverflow(Overflow.VISIBLE);\r\n\r\n        // DataSource configuration\r\n        //setDataSource(ds);\r\n    }\r\n\r\n\r\n    // fetch related data\r\n    public void fetchRelatedData(Criteria criteria) {\r\n        fetchData(criteria, new DSCallback() {\r\n            @Override\r\n            public void execute(DSResponse dsResponse, Object data, DSRequest dsRequest) {\r\n                Record record = new Record();\r\n\r\n                if (dsResponse.getData()[0] != null) {\r\n                    record = dsResponse.getData()[0];\r\n                }\r\n                // if record is empty, warn the user to contact the admin?\r\n                    setValues(record.toMap());\r\n            }\r\n        });\r\n    }\r\n\r\n}\r\n'),(176,257,'package gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select;\n\n\n        import javax.xml.bind.annotation.XmlAttribute;\n        import javax.xml.bind.annotation.XmlElement;\n        import javax.xml.bind.annotation.XmlRootElement;\n\n\n@XmlRootElement(name = \"endpoint\")\npublic class Endpoint {\n\n    /**\n     * The constructor must have no arguments (requirement of RESTful service).\n     */\n\n    String name;\n    String type;\n\n    @XmlElement\n    public String getName(){ return name; }\n\n    public void setName(String _name){\n        name = _name;\n    }\n\n    @XmlAttribute\n    public String getType() {\n        return type;\n    }\n\n    public void setType(String _type) { type = _type; }\n}\n'),(177,258,'package gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select;\r\n\r\nimport com.smartgwt.client.data.OperationBinding;\r\nimport com.smartgwt.client.data.RestDataSource;\r\nimport com.smartgwt.client.data.fields.DataSourceTextField;\r\nimport com.smartgwt.client.types.DSOperationType;\r\nimport com.smartgwt.client.types.DSProtocol;\r\n\r\n/**\r\n * SmartGWT datasource for accessing entities over http in a RESTful manner.\r\n * Defines a RESTDataSource fields, scripts and REST service URLs.\r\n */\r\npublic class EndpointDS extends RestDataSource {\r\n	\r\n	public EndpointDS() {\r\n\r\n        // Set fields\r\n		DataSourceTextField endpointId = new DataSourceTextField(\"id\");\r\n		endpointId.setPrimaryKey(true);\r\n		endpointId.setCanEdit(false);\r\n		DataSourceTextField endpointName = new DataSourceTextField(\"name\");\r\n        DataSourceTextField endpointType = new DataSourceTextField(\"type\");\r\n        setFields(endpointId, endpointName, endpointType);\r\n\r\n        // Define scripts\r\n		OperationBinding fetch = new OperationBinding();\r\n		fetch.setOperationType(DSOperationType.FETCH);\r\n		fetch.setDataProtocol(DSProtocol.POSTMESSAGE);\r\n		OperationBinding add = new OperationBinding();\r\n		add.setOperationType(DSOperationType.ADD);\r\n		add.setDataProtocol(DSProtocol.POSTMESSAGE);\r\n		OperationBinding update = new OperationBinding();\r\n		update.setOperationType(DSOperationType.UPDATE);\r\n		update.setDataProtocol(DSProtocol.POSTMESSAGE);\r\n		OperationBinding remove = new OperationBinding();\r\n		remove.setOperationType(DSOperationType.REMOVE);\r\n		remove.setDataProtocol(DSProtocol.POSTMESSAGE);\r\n		setOperationBindings(fetch, add, update, remove);\r\n\r\n        // Define REST URLs\r\n		setFetchDataURL(\"rest/message/read\");\r\n		setAddDataURL(\"rest/message/add\");\r\n		setUpdateDataURL(\"rest/message/update\");\r\n		setRemoveDataURL(\"rest/message/remove\");\r\n	}\r\n}\r\n'),(178,259,'package gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select;\r\n\r\nimport gov.nist.hit.ds.xdstools3.client.RESTUtils.DSRequest;\r\n\r\nimport javax.xml.bind.annotation.XmlElement;\r\nimport javax.xml.bind.annotation.XmlElementWrapper;\r\nimport javax.xml.bind.annotation.XmlRootElement;\r\nimport java.util.ArrayList;\r\nimport java.util.Collection;\r\nimport java.util.List;\r\n\r\n\r\n/**\r\n * Utility class for representing a {@link //RestDataSource} request as an object.\r\n * \r\n * @see //http://www.smartclient.com/docs/7.0rc2/a/b/c/go.html#class..RestDataSource\r\n */\r\n@XmlRootElement(name=\"request\")\r\npublic class EndpointDSRequest extends DSRequest {\r\n\r\n	// Holds all incoming data\r\n	@XmlElementWrapper(name=\"data\")\r\n	@XmlElement(name=\"EndpointDS\") // Must be the class name of the datasource\r\n	List<Endpoint> data;\r\n	\r\n	public Collection<Endpoint> getMessages() {\r\n		return data;\r\n	}\r\n	\r\n	public void addMessage(Endpoint endpoint) {\r\n		if (data == null) {\r\n			data = new ArrayList<Endpoint>();\r\n		}\r\n		data.add(endpoint);\r\n	}\r\n}\r\n'),(179,260,'package gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select;\r\n\r\nimport gov.nist.hit.ds.xdstools3.client.RESTUtils.DSResponse;\r\n\r\nimport javax.xml.bind.annotation.XmlElement;\r\nimport javax.xml.bind.annotation.XmlElementWrapper;\r\nimport javax.xml.bind.annotation.XmlRootElement;\r\nimport java.util.ArrayList;\r\nimport java.util.Collection;\r\nimport java.util.List;\r\n\r\n\r\n/**\r\n * Utility class for representing a {@link //RestDataSource} request as an object.\r\n * \r\n * @see //http://www.smartclient.com/docs/7.0rc2/a/b/c/go.html#class..RestDataSource\r\n */\r\n@XmlRootElement(name=\"response\")\r\npublic class EndpointDSResponse extends DSResponse {\r\n	// Holds all incoming data\r\n	@XmlElementWrapper(name=\"data\")\r\n	@XmlElement(name=\"record\")\r\n	List<Endpoint> data;\r\n	\r\n	public Collection<Endpoint> getMessages() {\r\n		return data;\r\n	}\r\n	\r\n	public void addMessage(Endpoint endpoint) {\r\n        if (data == null) {\r\n            data = new ArrayList<Endpoint>();\r\n        }\r\n        this.data.add(endpoint);\r\n    }\r\n\r\n}\r\n'),(180,261,'package gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select;\n\n\nimport gov.nist.hit.ds.xdstools3.client.RESTUtils.DSResponse;\nimport gov.nist.hit.ds.xdstools3.client.RESTUtils.OperationType;\n\nimport javax.ws.rs.Consumes;\nimport javax.ws.rs.POST;\nimport javax.ws.rs.Path;\nimport javax.ws.rs.Produces;\nimport javax.ws.rs.core.MediaType;\n\n/**\n* Jersey resource for a SmartGWT {@link //MessageDS}.\n* <p>\n*\n* @see //http://docs.sun.com/app/docs/doc/820-4867/ggnxo?l=en&a=view\n* @see //http://blogs.sun.com/enterprisetechtips/entry/jersey_and_spring\n*/\n\n@Path(\"/message\")\npublic class EndpointServer {\n	@Produces( { MediaType.APPLICATION_XML })\n	@Consumes( { MediaType.TEXT_XML })\n	@POST\n	@Path(\"/add\")\n	public EndpointDSResponse create(EndpointDSRequest request) {\n		EndpointDSResponse response = new EndpointDSResponse();\n\n		if (request.getOperationType() != OperationType.ADD || request.getMessages().size() != 1) {\n			response.setStatus(DSResponse.STATUS_FAILURE);\n		} else {\n		//	Message message = request.getMessages().iterator().next();\n\n			try {\n				// create the message\n                System.out.println(\"success on server\");\n                // save message here in Array\n              //  response.addMessage(message);\n\n				response.setStatus(DSResponse.STATUS_SUCCESS);\n			} catch (Exception e) {\n				response.setStatus(DSResponse.STATUS_FAILURE);\n				e.printStackTrace();\n			}\n		}\n\n		return response;\n	}\n\n	@Produces( { MediaType.APPLICATION_XML })\n	@Consumes( { MediaType.TEXT_XML })\n	@POST\n	@Path(\"/update\")\n	public EndpointDSResponse update(EndpointDSRequest request) {\n		EndpointDSResponse response = new EndpointDSResponse();\n\n		if (request.getOperationType() != OperationType.UPDATE || request.getMessages().size() != 1) {\n			response.setStatus(DSResponse.STATUS_FAILURE);\n		} else {\n			try {\n				//Message data = (Message) request.getMessages().iterator().next();\n                System.out.println(\"success on server\");\n				response.setStatus(DSResponse.STATUS_SUCCESS);\n			} catch (Exception e) {\n				response.setStatus(DSResponse.STATUS_FAILURE);\n				e.printStackTrace();\n			}\n		}\n\n		return response;\n	}\n\n	@Produces( { MediaType.APPLICATION_XML })\n	@Consumes( { MediaType.TEXT_XML })\n	@POST\n	@Path(\"/remove\")\n	public EndpointDSResponse delete(EndpointDSRequest request) {\n		EndpointDSResponse response = new EndpointDSResponse();\n\n		if (request.getOperationType() != OperationType.REMOVE || request.getMessages().size() != 1) {\n			response.setStatus(DSResponse.STATUS_FAILURE);\n		} else {\n			try {\n				//Message data = request.getMessages().iterator().next();\n				//message.remove();\n				//response.addMessage(data);\n                System.out.println(\"success on server\");\n				response.setStatus(DSResponse.STATUS_SUCCESS);\n			} catch (Exception e) {\n				response.setStatus(DSResponse.STATUS_FAILURE);\n				e.printStackTrace();\n			}\n		}\n\n		return response;\n	}\n\n	@POST\n	@Produces( { MediaType.APPLICATION_XML})\n	@Consumes( { MediaType.TEXT_XML })\n	@Path(\"/read\")\n	public EndpointDSResponse read(EndpointDSRequest request) {\n        EndpointDSResponse response = new EndpointDSResponse();\n        response.setStatus(DSResponse.STATUS_SUCCESS);\n//\n//		response.setStartRow(request.getStartRow());\n//\n//        if (request.getOperationType() != OperationType.FETCH) {\n//            response.setStatus(DSResponse.STATUS_FAILURE);\n//        } else {\n//            try {\n\n        // enter fake data\n        Endpoint endpoint1 = new Endpoint();\n        endpoint1.setType(EndpointType.ENDPOINT_TYPE_REGISTRY);\n        endpoint1.setName(\"endpoint1\");\n\n        Endpoint endpoint2 = new Endpoint();\n        endpoint2.setType(EndpointType.ENDPOINT_TYPE_REGISTRY);\n        endpoint2.setName(\"test\");\n\n        Endpoint endpoint3 = new Endpoint();\n        endpoint3.setType(EndpointType.ENDPOINT_TYPE_INIT_GATEWAY);\n        endpoint3.setName(\"test2\");\n\n        response.addMessage(endpoint1);\n        response.addMessage(endpoint2);\n        response.addMessage(endpoint3);\n        response.setEndRow(3);\n        response.setTotalRows(3);\n\n\n\n       // Collection<Endpoint> messages = MessageDSR(request.getStartRow(), 1 + (request.getEndRow() - request.getStartRow()));\n////				long count = Message.countMessages();\n////				response.setEndRow(response.getStartRow()+messages.size()-1);\n////				response.setTotalRows((int)count);\n////				for (Message message : messages) {\n////					response.addMessage(message);\n////				}\n//               //response.addMessage(new Message(sb.toString()));\n\n\n\n//\n//                StringBuffer sb = new StringBuffer();\n//                sb.append(\"<response>\");\n//                sb.append(\"<status>0</status>\");\n//                sb.append(\"<startRow>\" + \"0\" + \"</startRow>\");\n//                sb.append(\"<endRow>\" + \"1\" + \"</endRow>\");\n//                sb.append(\"<totalRows>10000</totalRows>\");\n//                sb.append(\"<data>\");\n//\n//                sb.append(\"<record><id>idtest</id><value>Value</value></record>\");\n//                sb.append(\"</data>\");\n//                sb.append(\"</response>\");\n                System.out.println(\"success on server\");\n\n\n\n                return response;\n//\n\n//            } catch (Exception e) {\n//                SC.say(\"Cannot reach server.\");\n//                response.setStatus(DSResponse.STATUS_FAILURE);\n//            }\n        }\n       // return \"\";\n   // }\n\n//    @POST\n//    @Produces( { MediaType.APPLICATION_XML})\n//    @Consumes( { MediaType.TEXT_XML })\n//    @Path(\"/read\")\n//    public MessageDSResponse read(MessageDSRequest request) {\n//        MessageDSResponse response = new MessageDSResponse();\n//\n//        response.setStartRow(request.getStartRow());\n//\n//        if (request.getOperationType() != OperationType.FETCH) {\n//            response.setStatus(DSResponse.STATUS_FAILURE);\n//        } else {\n//            try {\n////				Collection<Message> messages = findMessageEntries(request.getStartRow(), 1 + (request.getEndRow() - request.getStartRow()));\n////				long count = Message.countMessages();\n////				response.setEndRow(response.getStartRow()+messages.size()-1);\n////				response.setTotalRows((int)count);\n////				for (Message message : messages) {\n////					response.addMessage(message);\n////				}\n//                //response.addMessage(new Message(sb.toString()));\n//\n//                System.out.println(\"success on server\");\n//            } catch (Exception e) {\n//                response.setStatus(DSResponse.STATUS_FAILURE);\n//            }\n//\n//            response.setStatus(DSResponse.STATUS_SUCCESS);\n//        }\n//\n//        return response;\n//    }\n\n\n    }\n'),(181,262,'package gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select;\r\n\r\n/**\r\n * Created by dazais on 6/16/2014.\r\n */\r\npublic class EndpointType {\r\n    public final static String ENDPOINT_TYPE_REGISTRY = \"Document Registry\";\r\n    public final static String ENDPOINT_TYPE_INIT_GATEWAY = \"Initiating Gateway\";\r\n    public final static String ENDPOINT_TYPE_RESP_GATEWAY = \"Responding Gateway\";\r\n\r\n}\r\n'),(182,263,'package gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select;\r\n\r\nimport com.smartgwt.client.data.RestDataSource;\r\nimport com.smartgwt.client.types.GroupStartOpen;\r\nimport com.smartgwt.client.types.RowEndEditAction;\r\nimport com.smartgwt.client.types.SortDirection;\r\nimport com.smartgwt.client.widgets.grid.ListGrid;\r\nimport com.smartgwt.client.widgets.grid.ListGridField;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionEvent;\r\nimport com.smartgwt.client.widgets.layout.HLayout;\r\n\r\n/**\r\n *\r\n * Created by dazais on 5/21/2014.\r\n */\r\npublic class EndpointWidget extends HLayout {\r\n    private ListGrid endpointGrid;\r\n    private boolean endpointValueSelected = false;\r\n\r\n    public EndpointWidget() {\r\n\r\n        endpointGrid = createEndpointGrid();\r\n        addMember(endpointGrid);\r\n    }\r\n\r\n    public ListGrid createEndpointGrid() {\r\n        // Create the DataSource\r\n        RestDataSource dataSource = new EndpointDS();\r\n\r\n        // Create the ListGrid linked to the DataSource\r\n        final ListGrid grid = new ListGrid();\r\n        grid.setHeight(200);\r\n        grid.setWidth(500);\r\n        grid.setTitle(\"Endpoints\");\r\n        grid.setDataSource(dataSource);\r\n        grid.setAutoFetchData(true);\r\n        grid.setListEndEditAction(RowEndEditAction.NEXT);\r\n\r\n        // Configure sorting\r\n        grid.setSortField(1);\r\n        grid.setSortDirection(SortDirection.DESCENDING);\r\n        grid.setGroupStartOpen(GroupStartOpen.ALL);\r\n        grid.setGroupByField(\"type\");\r\n\r\n        // Set ListGrid fields\r\n        ListGridField typeField = new ListGridField(\"type\", \"Type\");\r\n        ListGridField nameField = new ListGridField(\"name\", \"Name\");\r\n        grid.setFields(typeField, nameField);\r\n\r\n        // Listeners\r\n        // listen to changes in field value\r\n        grid.addSelectionChangedHandler(new SelectionChangedHandler() {\r\n\r\n                                                    public void onSelectionChanged(SelectionEvent event) {\r\n                                                        if (event.getRecord() != null) endpointValueSelected = true;\r\n\r\n                                                        // if yes, pass value to validation\r\n//                                                    String newValue = (event.mkNewValue() == null ? null : event.mkNewValue().toString());\r\n//                                                    disabledForm.getItem(FORM_FIELD_NAME).setValue(newValue);\r\n                                                    }\r\n                                                }\r\n\r\n        );\r\n\r\n        return grid;\r\n    }\r\n\r\n//    public IButton createAddButton() {\r\n//        // Create \"Add\" button\r\n//        IButton updateButton = new IButton(\"Add message\");\r\n//        updateButton.addClickHandler(new com.smartgwt.client.widgets.eventBus.ClickHandler() {\r\n//            public void onClick(com.smartgwt.client.widgets.eventBus.ClickEvent event) {\r\n//                Record message = new ListGridRecord();\r\n//                message.setAttribute(\"value\", \"...\");\r\n//                grid.addData(message);\r\n//            }\r\n//        });\r\n//        return updateButton;\r\n//    }\r\n\r\n    public boolean isEndpointValueSelected(){\r\n        return endpointValueSelected;\r\n    }\r\n\r\n    public void addSelectionChangedHandler(SelectionChangedHandler handler){\r\n        endpointGrid.addSelectionChangedHandler(handler);\r\n    }\r\n\r\n}\r\n'),(183,265,'package gov.nist.hit.ds.xdstools3.client.customWidgets.forms;\r\n\r\nimport com.smartgwt.client.widgets.form.DynamicForm;\r\n\r\n/**\r\n * Smartgwt DynamicForm with a few formatting options, for use throughout the toolkit.\r\n */\r\npublic class GenericForm extends DynamicForm {\r\n\r\n    public GenericForm(){\r\n        setCellPadding(10);\r\n    }\r\n\r\n}\r\n'),(184,267,'package gov.nist.hit.ds.xdstools3.client.customWidgets.healthcareCodes;\r\n\r\nimport javax.xml.bind.annotation.XmlAttribute;\r\nimport javax.xml.bind.annotation.XmlElement;\r\nimport javax.xml.bind.annotation.XmlRootElement;\r\n\r\n/**\r\n * Describes a Healthcare Code element, linked to a Datasource and a Widget through a RESTful interface.\r\n */\r\n@XmlRootElement(name = \"healthcodes\")\r\npublic class HealthcareCode {\r\n        String description;\r\n        String code;\r\n\r\n    /**\r\n     * The constructor must have no arguments (requirement of RESTful service).\r\n     */\r\n\r\n        @XmlElement\r\n        public String getDescription(){ return description; }\r\n\r\n        public void setDescription(String _description){\r\n            description = _description;\r\n        }\r\n\r\n        @XmlAttribute\r\n        public String getCode() {\r\n            return code;\r\n        }\r\n\r\n        public void setCode(String _code) { code = _code; }\r\n\r\n}\r\n'),(185,268,'package gov.nist.hit.ds.xdstools3.client.customWidgets.healthcareCodes;\r\n\r\nimport com.smartgwt.client.data.OperationBinding;\r\nimport com.smartgwt.client.data.RestDataSource;\r\nimport com.smartgwt.client.data.fields.DataSourceTextField;\r\nimport com.smartgwt.client.types.DSOperationType;\r\nimport com.smartgwt.client.types.DSProtocol;\r\n\r\n/**\r\n * SmartGWT datasource for Healthcare Codes, to use with RESTful services.\r\n * Defines a RESTDataSource fields, scripts and REST service URLs.\r\n */\r\npublic class HealthcareCodeDS extends RestDataSource {\r\n\r\n        public HealthcareCodeDS() {\r\n\r\n            // Set fields\r\n            DataSourceTextField code = new DataSourceTextField(\"code\");\r\n            code.setPrimaryKey(true);\r\n            code.setCanEdit(false);\r\n            DataSourceTextField descr = new DataSourceTextField(\"description\");\r\n            setFields(code, descr);\r\n\r\n            // Define scripts\r\n            OperationBinding fetch = new OperationBinding();\r\n            fetch.setOperationType(DSOperationType.FETCH);\r\n            fetch.setDataProtocol(DSProtocol.POSTMESSAGE);\r\n            OperationBinding add = new OperationBinding();\r\n            add.setOperationType(DSOperationType.ADD);\r\n            add.setDataProtocol(DSProtocol.POSTMESSAGE);\r\n            OperationBinding update = new OperationBinding();\r\n            update.setOperationType(DSOperationType.UPDATE);\r\n            update.setDataProtocol(DSProtocol.POSTMESSAGE);\r\n            OperationBinding remove = new OperationBinding();\r\n            remove.setOperationType(DSOperationType.REMOVE);\r\n            remove.setDataProtocol(DSProtocol.POSTMESSAGE);\r\n            setOperationBindings(fetch, add, update, remove);\r\n\r\n            // Define REST URLs\r\n            setFetchDataURL(\"rest/healthcodes/read\");\r\n            setAddDataURL(\"rest/healthcodes/add\");\r\n            setUpdateDataURL(\"rest/healthcodes/update\");\r\n            setRemoveDataURL(\"rest/healthcodes/remove\");\r\n        }\r\n\r\n}\r\n'),(186,269,'package gov.nist.hit.ds.xdstools3.client.customWidgets.healthcareCodes;\r\n\r\nimport gov.nist.hit.ds.xdstools3.client.RESTUtils.DSRequest;\r\n\r\nimport javax.xml.bind.annotation.XmlElement;\r\nimport javax.xml.bind.annotation.XmlElementWrapper;\r\nimport javax.xml.bind.annotation.XmlRootElement;\r\nimport java.util.ArrayList;\r\nimport java.util.Collection;\r\nimport java.util.List;\r\n\r\n\r\n/**\r\n * Utility class for representing a {@link //RestDataSource} request as an object.\r\n * \r\n * @see //http://www.smartclient.com/docs/7.0rc2/a/b/c/go.html#class..RestDataSource\r\n */\r\n@XmlRootElement(name=\"request\")\r\npublic class HealthcareCodeDSRequest extends DSRequest {\r\n\r\n	// Holds all incoming data\r\n	@XmlElementWrapper(name=\"data\")\r\n	@XmlElement(name=\"HealthcareCodeDS\") // Must be the class name of the datasource\r\n	List<HealthcareCode> data;\r\n	\r\n	public Collection<HealthcareCode> getMessages() {\r\n		return data;\r\n	}\r\n	\r\n	public void addMessage(HealthcareCode endpoint) {\r\n		if (data == null) {\r\n			data = new ArrayList<HealthcareCode>();\r\n		}\r\n		data.add(endpoint);\r\n	}\r\n}\r\n'),(187,270,'package gov.nist.hit.ds.xdstools3.client.customWidgets.healthcareCodes;\r\n\r\nimport gov.nist.hit.ds.xdstools3.client.RESTUtils.DSResponse;\r\n\r\nimport javax.xml.bind.annotation.XmlElement;\r\nimport javax.xml.bind.annotation.XmlElementWrapper;\r\nimport javax.xml.bind.annotation.XmlRootElement;\r\nimport java.util.ArrayList;\r\nimport java.util.Collection;\r\nimport java.util.List;\r\n\r\n\r\n/**\r\n * Utility class for representing a {@link //RestDataSource} request as an object.\r\n * \r\n * @see //http://www.smartclient.com/docs/7.0rc2/a/b/c/go.html#class..RestDataSource\r\n */\r\n@XmlRootElement(name=\"response\")\r\npublic class HealthcareCodeDSResponse extends DSResponse {\r\n\r\n	// Holds all incoming data\r\n	@XmlElementWrapper(name=\"data\")\r\n	@XmlElement(name=\"record\")\r\n	List<HealthcareCode> data;\r\n	\r\n	public Collection<HealthcareCode> getMessages() {\r\n		return data;\r\n	}\r\n	\r\n	public void addMessage(HealthcareCode healthcode) {\r\n        if (data == null) {\r\n            data = new ArrayList<>();\r\n        }\r\n        this.data.add(healthcode);\r\n    }\r\n\r\n}\r\n'),(188,271,'package gov.nist.hit.ds.xdstools3.client.customWidgets.healthcareCodes;\n\n\nimport gov.nist.hit.ds.xdstools3.client.RESTUtils.OperationType;\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select.EndpointDSRequest;\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select.EndpointDSResponse;\nimport gov.nist.hit.ds.xdstools3.client.RESTUtils.DSResponse;\n\nimport javax.ws.rs.Consumes;\nimport javax.ws.rs.POST;\nimport javax.ws.rs.Path;\nimport javax.ws.rs.Produces;\nimport javax.ws.rs.core.MediaType;\n\n/**\n * Jersey resource for a SmartGWT {@link //MessageDS}.\n * <p>\n *\n * @see //http://docs.sun.com/app/docs/doc/820-4867/ggnxo?l=en&a=view\n * @see //http://blogs.sun.com/enterprisetechtips/entry/jersey_and_spring\n */\n\n@Path(\"/healthcodes\")\npublic class HealthcareCodeServer {\n    @Produces( { MediaType.APPLICATION_XML })\n    @Consumes( { MediaType.TEXT_XML })\n    @POST\n    @Path(\"/add\")\n    public EndpointDSResponse create(EndpointDSRequest request) {\n        EndpointDSResponse response = new EndpointDSResponse();\n\n        if (request.getOperationType() != OperationType.ADD || request.getMessages().size() != 1) {\n            response.setStatus(DSResponse.STATUS_FAILURE);\n        } else {\n            //	Message message = request.getMessages().iterator().next();\n\n            try {\n                // create the message\n                System.out.println(\"success on server\");\n                // save message here in Array\n                //  response.addMessage(message);\n\n                response.setStatus(DSResponse.STATUS_SUCCESS);\n            } catch (Exception e) {\n                response.setStatus(DSResponse.STATUS_FAILURE);\n                e.printStackTrace();\n            }\n        }\n\n        return response;\n    }\n\n    @Produces( { MediaType.APPLICATION_XML })\n    @Consumes( { MediaType.TEXT_XML })\n    @POST\n    @Path(\"/update\")\n    public EndpointDSResponse update(EndpointDSRequest request) {\n        EndpointDSResponse response = new EndpointDSResponse();\n\n        if (request.getOperationType() != OperationType.UPDATE || request.getMessages().size() != 1) {\n            response.setStatus(DSResponse.STATUS_FAILURE);\n        } else {\n            try {\n                //Message data = (Message) request.getMessages().iterator().next();\n                System.out.println(\"success on server\");\n                response.setStatus(DSResponse.STATUS_SUCCESS);\n            } catch (Exception e) {\n                response.setStatus(DSResponse.STATUS_FAILURE);\n                e.printStackTrace();\n            }\n        }\n\n        return response;\n    }\n\n    @Produces( { MediaType.APPLICATION_XML })\n    @Consumes( { MediaType.TEXT_XML })\n    @POST\n    @Path(\"/remove\")\n    public EndpointDSResponse delete(EndpointDSRequest request) {\n        EndpointDSResponse response = new EndpointDSResponse();\n\n        if (request.getOperationType() != OperationType.REMOVE || request.getMessages().size() != 1) {\n            response.setStatus(DSResponse.STATUS_FAILURE);\n        } else {\n            try {\n                //Message data = request.getMessages().iterator().next();\n                //message.remove();\n                //response.addMessage(data);\n                System.out.println(\"success on server\");\n                response.setStatus(DSResponse.STATUS_SUCCESS);\n            } catch (Exception e) {\n                response.setStatus(DSResponse.STATUS_FAILURE);\n                e.printStackTrace();\n            }\n        }\n\n        return response;\n    }\n\n    @POST\n    @Produces( { MediaType.APPLICATION_XML})\n    @Consumes( { MediaType.TEXT_XML })\n    @Path(\"/read\")\n    public HealthcareCodeDSResponse read(HealthcareCodeDSRequest request) {\n        HealthcareCodeDSResponse response = new HealthcareCodeDSResponse();\n        response.setStatus(DSResponse.STATUS_SUCCESS);\n//\n//		response.setStartRow(request.getStartRow());\n//\n//        if (request.getOperationType() != OperationType.FETCH) {\n//            response.setStatus(DSResponse.STATUS_FAILURE);\n//        } else {\n//            try {\n\n        // enter fake data\n        HealthcareCode hc1 = new HealthcareCode();\n        hc1.setCode(\"code example\");\n        hc1.setDescription(\"This is the health code description.\");\n        response.addMessage(hc1);\n        response.setEndRow(1);\n        response.setTotalRows(1);\n\n\n\n        // Collection<Endpoint> messages = MessageDSR(request.getStartRow(), 1 + (request.getEndRow() - request.getStartRow()));\n////				long count = Message.countMessages();\n////				response.setEndRow(response.getStartRow()+messages.size()-1);\n////				response.setTotalRows((int)count);\n////				for (Message message : messages) {\n////					response.addMessage(message);\n////				}\n//               //response.addMessage(new Message(sb.toString()));\n\n\n\n//\n//                StringBuffer sb = new StringBuffer();\n//                sb.append(\"<response>\");\n//                sb.append(\"<status>0</status>\");\n//                sb.append(\"<startRow>\" + \"0\" + \"</startRow>\");\n//                sb.append(\"<endRow>\" + \"1\" + \"</endRow>\");\n//                sb.append(\"<totalRows>10000</totalRows>\");\n//                sb.append(\"<data>\");\n//\n//                sb.append(\"<record><id>idtest</id><value>Value</value></record>\");\n//                sb.append(\"</data>\");\n//                sb.append(\"</response>\");\n        System.out.println(\"success on server\");\n\n\n\n        return response;\n//\n\n//            } catch (Exception e) {\n//                SC.say(\"Cannot reach server.\");\n//                response.setStatus(DSResponse.STATUS_FAILURE);\n//            }\n    }\n    // return \"\";\n    // }\n\n//    @POST\n//    @Produces( { MediaType.APPLICATION_XML})\n//    @Consumes( { MediaType.TEXT_XML })\n//    @Path(\"/read\")\n//    public MessageDSResponse read(MessageDSRequest request) {\n//        MessageDSResponse response = new MessageDSResponse();\n//\n//        response.setStartRow(request.getStartRow());\n//\n//        if (request.getOperationType() != OperationType.FETCH) {\n//            response.setStatus(DSResponse.STATUS_FAILURE);\n//        } else {\n//            try {\n////				Collection<Message> messages = findMessageEntries(request.getStartRow(), 1 + (request.getEndRow() - request.getStartRow()));\n////				long count = Message.countMessages();\n////				response.setEndRow(response.getStartRow()+messages.size()-1);\n////				response.setTotalRows((int)count);\n////				for (Message message : messages) {\n////					response.addMessage(message);\n////				}\n//                //response.addMessage(new Message(sb.toString()));\n//\n//                System.out.println(\"success on server\");\n//            } catch (Exception e) {\n//                response.setStatus(DSResponse.STATUS_FAILURE);\n//            }\n//\n//            response.setStatus(DSResponse.STATUS_SUCCESS);\n//        }\n//\n//        return response;\n//    }\n\n\n}\n'),(189,272,'package gov.nist.hit.ds.xdstools3.client.customWidgets.healthcareCodes;\r\n\r\nimport com.smartgwt.client.data.RestDataSource;\r\nimport com.smartgwt.client.types.Alignment;\r\nimport com.smartgwt.client.types.SelectionStyle;\r\nimport com.smartgwt.client.types.SortDirection;\r\nimport com.smartgwt.client.widgets.grid.ListGrid;\r\nimport com.smartgwt.client.widgets.grid.ListGridField;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\n\r\n/**\r\n * Created by dazais on 5/15/2014.\r\n */\r\npublic class HealthcareCodeWidget extends VStack {\r\n    private ListGrid codesGrid;\r\n    private ListGrid selectedCodesGrid;\r\n\r\n\r\n    public HealthcareCodeWidget() {\r\n\r\n        // Main list of codes and the summary of codes selected by the user\r\n        createCodesGrids();\r\n\r\n       // LayoutSpacer spacer = new LayoutSpacer();\r\n       // spacer.setWidth(\"*\");\r\n\r\n        // Add both grids to the HLayout and set formatting\r\n        addMembers(selectedCodesGrid, codesGrid);\r\n        selectedCodesGrid.setAlign(Alignment.CENTER);\r\n        setAlign(Alignment.CENTER);\r\n\r\n    }\r\n\r\n    /**\r\n     * Builds the main list of codes and the summary of the codes currently selected by the user\r\n     * @see ListGrid in SmartGWT documentation\r\n     */\r\n    public void createCodesGrids() {\r\n        // Create the DataSource\r\n        RestDataSource ds = new HealthcareCodeDS();\r\n\r\n\r\n        // Create the ListGrid linked to the DataSource + additional list of codes selected by the user\r\n        codesGrid = new ListGrid();\r\n        selectedCodesGrid = new ListGrid();\r\n\r\n        // formatting for all codes\r\n        codesGrid.setWidth(500);\r\n        codesGrid.setHeight(224);\r\n        codesGrid.setShowAllRecords(true);\r\n        codesGrid.setSelectionType(SelectionStyle.MULTIPLE);\r\n        codesGrid.setDataSource(ds);\r\n        codesGrid.setAutoFetchData(true);\r\n\r\n        // Formatting for selected codes\r\n        selectedCodesGrid.setWidth(250);\r\n        selectedCodesGrid.setHeight(100);\r\n        selectedCodesGrid.setShowAllRecords(true);\r\n\r\n        // Set Code fields\r\n        ListGridField codeField = new ListGridField(\"code\", \"Code\");\r\n        ListGridField descrField = new ListGridField(\"description\", \"Description\");\r\n        codeField.setWidth(100);\r\n        codesGrid.setFields(codeField, descrField);\r\n\r\n        // Set Selected Codes fields\r\n        ListGridField selectedCodesField = new ListGridField(\"code\", \"Selected Codes\"); // TODO to change\r\n        selectedCodesGrid.setFields(selectedCodesField);\r\n\r\n        // Configure sorting\r\n        codesGrid.setSortField(1);\r\n        codesGrid.setSortDirection(SortDirection.DESCENDING);\r\n\r\n        // listeners\r\n\r\n\r\n\r\n}\r\n\r\n}\r\n'),(190,274,'package gov.nist.hit.ds.xdstools3.client.customWidgets.links;\r\n\r\nimport com.google.gwt.user.client.Window;\r\nimport com.smartgwt.client.types.VerticalAlignment;\r\nimport com.smartgwt.client.widgets.form.fields.LinkItem;\r\nimport com.smartgwt.client.widgets.form.fields.events.ClickEvent;\r\nimport com.smartgwt.client.widgets.form.fields.events.ClickHandler;\r\n\r\n/**\r\n * Created by dazais on 6/16/2014.\r\n */\r\npublic class LinkPIDGenerator {\r\n\r\n    public LinkPIDGenerator() {\r\n        // External link to Patient ID Generator\r\n        LinkItem linkItem = new LinkItem(\"pidGenerator\");\r\n        linkItem.setLinkTitle(\"Patient ID generator\");\r\n        linkItem.setStartRow(false);\r\n        linkItem.setShowTitle(false);\r\n        linkItem.setHeight(15);\r\n        linkItem.setVAlign(VerticalAlignment.CENTER);\r\n        linkItem.addClickHandler(new ClickHandler() {\r\n            public void onClick(ClickEvent event) {\r\n                Window.open(\"http://ihexds.nist.gov:12080/xdstools/pidallocate\", \"\", \"\");\r\n            }\r\n        });\r\n    }\r\n}\r\n'),(191,276,'package gov.nist.hit.ds.xdstools3.client.customWidgets.toolbar;\r\n\r\nimport com.smartgwt.client.widgets.form.fields.SelectOtherItem;\r\n\r\n/**\r\n * Created by dazais on 12/16/2014.\r\n */\r\npublic class CustomSelectOtherItem extends SelectOtherItem {\r\n\r\n\r\n}\r\n'),(192,277,'package gov.nist.hit.ds.xdstools3.client.customWidgets.toolbar;\r\n\r\n\r\nimport com.smartgwt.client.widgets.toolbar.RibbonGroup;\r\n\r\n/**\r\n * Class based on SmartGWT RibbonGroup for toolbars. This class holds basic toolbar formatting.\r\n *\r\n * @see com.smartgwt.client.widgets.toolbar.RibbonBar\r\n * Created by dazais on 11/10/2014.\r\n */\r\n\r\npublic class GenericRibbonGroup extends RibbonGroup {\r\n\r\n    public GenericRibbonGroup(){\r\n        setStyleName(\"toolbarGroup\");\r\n        setTitleStyle(\"toolbarGroupTitle\");\r\n        setBorder(\"1px solid #CCD1FF\"); /* Setting the border inside the CSS does not work on this component, for some reason */\r\n    }\r\n\r\n}\r\n'),(193,278,'package gov.nist.hit.ds.xdstools3.client.customWidgets.toolbar;\r\n\r\nimport com.google.gwt.core.client.GWT;\r\nimport com.google.gwt.user.client.rpc.AsyncCallback;\r\nimport com.smartgwt.client.types.Alignment;\r\nimport com.smartgwt.client.widgets.IconButton;\r\nimport com.smartgwt.client.widgets.events.ClickEvent;\r\nimport com.smartgwt.client.widgets.events.ClickHandler;\r\nimport com.smartgwt.client.widgets.form.DynamicForm;\r\nimport com.smartgwt.client.widgets.form.fields.SelectItem;\r\nimport com.smartgwt.client.widgets.form.fields.SelectOtherItem;\r\nimport com.smartgwt.client.widgets.form.fields.events.ChangedEvent;\r\nimport com.smartgwt.client.widgets.form.fields.events.ChangedHandler;\r\nimport com.smartgwt.client.widgets.toolbar.RibbonBar;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.dialogs.loginDialog.LoginDialogWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.Manager;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.dialogs.PopupMessageV3;\r\nimport gov.nist.hit.ds.xdstools3.client.util.eventBus.OpenTabEvent;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.LinkedHashMap;\r\nimport java.util.List;\r\n\r\n/**\r\n * Some icons are provided by Dave Gandy, based on Fontawesome, through Wikimedia Commons. License CC BY 3.0.\r\n */\r\npublic class Toolbar extends RibbonBar {\r\n    //static Logger logger = Logger.getLogger(Toolbar.class);\r\n    private SelectOtherItem sessionsComboBox;\r\n    private SelectItem envListBox;\r\n    private ToolbarServiceAsync rpcService = GWT.create(ToolbarService.class);\r\n    private LinkedHashMap<String, String> valueMap;\r\n    private String[] currentUserSessions;\r\n\r\n\r\n    public Toolbar() {\r\n\r\n        setMembersMargin(3);\r\n        setAlign(Alignment.CENTER);\r\n\r\n        envListBox = new SelectItem();\r\n        envListBox.setShowTitle(false);\r\n        envListBox.setShowOptionsFromDataSource(false);\r\n        envListBox.setWidth(\"250\");\r\n        envListBox.setDefaultToFirstOption(true);\r\n\r\n        // Retrieve Environment data from server\r\n        loadEnvironmentNamesFromServer();\r\n\r\n        // sets path for flag icons\r\n        envListBox.setImageURLPrefix(\"icons/flags/16/\");\r\n        envListBox.setImageURLSuffix(\".png\");\r\n\r\n        // create sessions drop-down\r\n        sessionsComboBox = new SelectOtherItem();\r\n        sessionsComboBox.setShowTitle(false);\r\n        sessionsComboBox.setWidth(679);\r\n        sessionsComboBox.setOtherTitle(\"Enter a new session name...\");\r\n        sessionsComboBox.setSelectOtherPrompt(\"Register a new session name:\");\r\n        sessionsComboBox.setTitle(\"Session\");\r\n\r\n        // load session data from server\r\n        loadSessionNamesFromServer();\r\n\r\n        // create forms\r\n        DynamicForm sessionForm = new DynamicForm();\r\n        sessionForm.setFields(sessionsComboBox);\r\n        DynamicForm envForm = new DynamicForm();\r\n        envForm.setFields(envListBox);\r\n        sessionForm.setCellPadding(10);\r\n        envForm.setCellPadding(10);\r\n\r\n        // Session and Environments toolbar groups\r\n        GenericRibbonGroup envGroup = createRibbonGroup(\"Environment\");\r\n        GenericRibbonGroup sessionGroup = createRibbonGroup(\"Session\");\r\n        envGroup.addControls(envForm);\r\n        sessionGroup.addControls(sessionForm);\r\n\r\n        // Menu group: Site / Actors\r\n        IconButton endpointButton = getIconButton(\"View / Configure Endpoints\", \"icons/fontawesome-standalone/user.png\", true);\r\n\r\n        // Menu group: Admin\r\n        // Behavior: Clicking on any of the buttons in the admin group opens a dialog to allow the user to log in as admin,\r\n        // IF not logged in yet. Then follows to the link initially requested.\r\n        IconButton adminButton = getIconButton(\"Admin Settings\", \"icons/fontawesome-standalone/cogwheel.png\", true);\r\n\r\n\r\n\r\n        // ---------------------- Listeners ----------------------\r\n\r\n        /**\r\n         * Handles user selection on Environments drop-down\r\n         */\r\n        envListBox.addChangedHandler(new ChangedHandler() {\r\n            @Override\r\n            public void onChanged(ChangedEvent changedEvent) {\r\n\r\n                AsyncCallback<Void> envIsSelectedCallback = new AsyncCallback<Void>() {\r\n                    @Override\r\n                    public void onFailure(Throwable caught) {\r\n                        //logger.debug(getClassName() + \": \" + \" envListBox.addChangedHandler\");\r\n                        new PopupMessageV3(caught.getMessage());\r\n                    }\r\n\r\n                    @Override\r\n                    public void onSuccess(Void result) {\r\n                        // do nothing\r\n                    }\r\n                };\r\n                // the value retrieved is actually the ID of the environment name selected by the user\r\n                String envIdInMap = (String)changedEvent.getValue();\r\n                // getting the actual value\r\n                String selectedEnv = valueMap.get(envIdInMap);\r\n                rpcService.setEnvironment(selectedEnv, envIsSelectedCallback);\r\n            }\r\n        });\r\n\r\n\r\n\r\n        /**\r\n         * Handles user selection on Session drop-down and adding new sessions\r\n         */\r\n        sessionsComboBox.addChangedHandler(new ChangedHandler() {\r\n            @Override\r\n            public void onChanged(ChangedEvent changedEvent) {\r\n                // if the session name added by the user already exists, warn the user\r\n                if (convertArrayToList(currentUserSessions).contains((String) changedEvent.getValue())) {\r\n                    // TODO this should be refactored better later with creating a homemade popup\r\n                    // TODO that will warn the user\r\n\r\n                    // otherwise, proceed with adding the new session name\r\n                } else {\r\n                    AsyncCallback<String[]> addSessionNameCallback = new AsyncCallback<String[]>() {\r\n                        @Override\r\n                        public void onFailure(Throwable caught) {\r\n                            //logger.debug(getClassName() + \": \" + \" sessionsComboBox.addChangedHandler\");\r\n                            new PopupMessageV3(caught.getMessage());\r\n                        }\r\n\r\n                        @Override\r\n                        public void onSuccess(String[] result) {\r\n                            currentUserSessions = result;\r\n                            sessionsComboBox.setValueMap(result);\r\n                        }\r\n                    };\r\n                    rpcService.addTestSession((String) changedEvent.getValue(), addSessionNameCallback);\r\n                }\r\n            }\r\n        });\r\n\r\n\r\n        /**\r\n         * Open Endpoint Tab\r\n         */\r\n        endpointButton.addClickHandler(new ClickHandler() {\r\n            @Override\r\n            public void onClick(ClickEvent event) {\r\n                // Display the Endpoint Settings tab\r\n                Manager.EVENT_BUS.fireEvent(new OpenTabEvent(TabNamesManager.getInstance().getEndpointsTabCode()));\r\n            }});\r\n\r\n        /**\r\n         * Open Configuration / Admin Tab\r\n         */\r\n        adminButton.addClickHandler(new ClickHandler() {\r\n            @Override\r\n            public void onClick(ClickEvent event) {\r\n                    // ask user to log in\r\n                    LoginDialogWidget dialog = new LoginDialogWidget(TabNamesManager.getInstance().getAdminTabCode());\r\n                    dialog.show();\r\n            }\r\n        });\r\n\r\n\r\n\r\n\r\n\r\n        // Add menu groups to menu bar\r\n        this.addMembers(envGroup, sessionGroup, endpointButton, adminButton);\r\n        this.setStyleName(\"toolbar\");\r\n        draw();\r\n    }\r\n\r\n\r\n    /**\r\n     * Calls to the backend for session parameters\r\n     */\r\n    protected void loadSessionNamesFromServer(){\r\n\r\n        AsyncCallback<String[]> sessionCallback = new AsyncCallback<String[]>() {\r\n            public void onFailure(Throwable caught) {\r\n               // logger.debug(getClassName() + \": \" +\"loadSessionNamesFromServer\");\r\n                new PopupMessageV3(caught.getMessage());\r\n            }\r\n            @Override\r\n            public void onSuccess(String[] result) {\r\n                // If some user sessions exist, set the widget. Else do nothing, since the list can be empty.\r\n                if (result != null){\r\n                    currentUserSessions = result;\r\n                    sessionsComboBox.setValueMap(result);\r\n                }\r\n            }\r\n        };\r\n        rpcService.retrieveTestSessions(sessionCallback);\r\n    }\r\n\r\n\r\n\r\n    /**\r\n     * Calls to the backend to get environments\r\n     */\r\n    protected void loadEnvironmentNamesFromServer() {\r\n\r\n        AsyncCallback<String[]> envCallback = new AsyncCallback<String[]>() {\r\n            public void onFailure(Throwable caught) {\r\n                //logger.debug(getClassName() + \": \" +\"loadEnvironmentNamesFromServer\");\r\n                new PopupMessageV3(\"Failed to retrieve the list of available environments from the server. \" +\r\n                        \"The location of the configuration files for this application may be misconfigured.\");\r\n            }\r\n            @Override\r\n            public void onSuccess(String[] result) {\r\n                // Processes the list of environments for display\r\n                ArrayList<LinkedHashMap<String, String>> envsProcessedForDisplay = createEnvironmentMap(result);\r\n                envListBox.setValueMap(envsProcessedForDisplay.get(0));\r\n                envListBox.setValueIcons(envsProcessedForDisplay.get(1));\r\n            }\r\n        };\r\n        rpcService.retrieveEnvironments(envCallback);\r\n    }\r\n\r\n\r\n\r\n    /**\r\n     * Creates an icon button.\r\n     * @param title\r\n     * @param iconName\r\n     * @return\r\n     */\r\n    private IconButton getIconButton(String title, String iconName, boolean vertical) {\r\n        IconButton button = new IconButton(title);\r\n        button.setIcon(iconName);\r\n        button.setPadding(7);\r\n        if (vertical) button.setOrientation(\"vertical\");\r\n        return button;\r\n    }\r\n\r\n    private GenericRibbonGroup createRibbonGroup(String title){\r\n        GenericRibbonGroup group = new GenericRibbonGroup();\r\n        group.setTitle(title);\r\n        group.setNumRows(1);\r\n        return group;\r\n    }\r\n\r\n\r\n    /**\r\n     * Creates a map of environments and matching regions to display the correct flag in the drop-down.\r\n     * Supports only US and EU environments!\r\n     * The key is the region code (\"US\" or \"EU\") to which are added incremental numbers because the key must be unique.\r\n     *\r\n     * This is a workaround to build a Map that will be accepted by the SmartGWT dropdown and retain all of its\r\n     * built-in functionality.\r\n     *s\r\n     * @param envs the list of environments\r\n     * @return two LinkedHashMap<String, String> of environments and regions, stored into an ArrayList. Ex.: < EU1, EURO2012 > and < EU1, EU >.\r\n     */\r\n    private ArrayList<LinkedHashMap<String, String>> createEnvironmentMap(String[] envs){\r\n        String key = \"\";\r\n        int counterEU = 0;\r\n        int counterUS = 0;\r\n        valueMap = new LinkedHashMap<String, String>(); /* Not specifying types here does not work at GWT compile */\r\n        LinkedHashMap<String, String> iconsMap = new LinkedHashMap<String, String>();\r\n\r\n        for (String envName : envs) {\r\n            if (envName.contains(\"EURO\")) {\r\n                counterEU++;\r\n                key = \"EU\" + Integer.toString(counterEU);\r\n                valueMap.put(key, envName);\r\n                iconsMap.put(key, \"EU\");\r\n            } else {\r\n                counterUS++;\r\n                key = \"US\" + Integer.toString(counterUS);\r\n                valueMap.put(key, envName);\r\n                iconsMap.put(key, \"US\");\r\n            }\r\n        }\r\n\r\n        // build an arraylist that is only used to return the results\r\n        ArrayList<LinkedHashMap<String, String>> envResults = new ArrayList<LinkedHashMap<String, String>>();\r\n        envResults.add(valueMap);\r\n        envResults.add(iconsMap);\r\n        return envResults;\r\n    }\r\n\r\n    /**\r\n     * Utility function\r\n     * @param array\r\n     * @return\r\n     */\r\n    private List convertArrayToList(String[] array){\r\n        List l = new ArrayList();\r\n        for (int i=0; i<array.length; i++){\r\n            l.add(array[i]);\r\n        }\r\n        return l;\r\n    }\r\n}\r\n'),(194,279,'package gov.nist.hit.ds.xdstools3.client.customWidgets.toolbar;\r\n\r\nimport com.google.gwt.user.client.rpc.RemoteService;\r\nimport com.google.gwt.user.client.rpc.RemoteServiceRelativePath;\r\n\r\n/**\r\n * Client side of the GWT RPC mechanism. This is the service class.\r\n *\r\n * @author dazais\r\n * @see ToolbarServiceAsync\r\n *\r\n */\r\n@RemoteServiceRelativePath(\"toolbar\")\r\npublic interface ToolbarService extends RemoteService {\r\n\r\n    public String[] retrieveEnvironments();\r\n    public void setEnvironment(String environmentName);\r\n    public String[] retrieveTestSessions();\r\n    public String[] addTestSession(String sessionName);\r\n    public String[] deleteTestSession(String sessionName);\r\n\r\n    // header app properties services\r\n    public String getToolkitEvent();\r\n    public String getToolkitVersion();\r\n\r\n}\r\n'),(195,280,'package gov.nist.hit.ds.xdstools3.client.customWidgets.toolbar;\r\n\r\nimport com.google.gwt.user.client.rpc.AsyncCallback;\r\n\r\n/**\r\n * Client side of the GWT RPC mechanism. This is the asynchronous interface.\r\n *\r\n * @author dazais\r\n * @see ToolbarService\r\n *\r\n */\r\n\r\npublic interface ToolbarServiceAsync {\r\n\r\n    void retrieveEnvironments(AsyncCallback<String[]> async);\r\n    void setEnvironment(String environmentName, AsyncCallback<Void> async);\r\n    void retrieveTestSessions(AsyncCallback<String[]> async);\r\n    void addTestSession(String sessionName, AsyncCallback<String[]> async);\r\n    void deleteTestSession(String sessionName, AsyncCallback<String[]> async);\r\n\r\n    // header app properties services\r\n    void getToolkitEvent(AsyncCallback<String> async);\r\n    void getToolkitVersion(AsyncCallback<String> async);\r\n}\r\n'),(196,282,'package gov.nist.hit.ds.xdstools3.client.customWidgets.validationOutput;\r\n\r\nimport com.smartgwt.client.types.Overflow;\r\nimport com.smartgwt.client.widgets.Canvas;\r\n\r\npublic class ValidationSummaryCanvas extends Canvas {\r\n	\r\n        private String contents = \"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt \"\r\n        				+ \"ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut \"\r\n        				+ \"aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu \"\r\n        				+ \"fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit \"\r\n        				+ \"anim id est laborum.\"; \r\n  \r\n        public ValidationSummaryCanvas(String id) {  \r\n            setID(id);  \r\n            setPadding(10);  \r\n            setOverflow(Overflow.AUTO);  \r\n            setContents(contents);  \r\n        }  \r\n\r\n}\r\n'),(197,283,'package gov.nist.hit.ds.xdstools3.client.customWidgets.validationOutput;\r\n\r\nimport com.smartgwt.client.types.Overflow;\r\nimport com.smartgwt.client.types.VisibilityMode;\r\nimport com.smartgwt.client.widgets.layout.SectionStack;\r\nimport com.smartgwt.client.widgets.layout.SectionStackSection;\r\n\r\n/**\r\n * Holds the full validation output (validation result summary AND complete validation output).\r\n * @author dazais\r\n * @see ValidationSummaryCanvas\r\n *\r\n */\r\npublic class ValidationSummaryWidget extends SectionStack {\r\n\r\n	public ValidationSummaryWidget() {\r\n		setVisibilityMode(VisibilityMode.MULTIPLE);  \r\n		setAnimateSections(true);  \r\n		setOverflow(Overflow.HIDDEN);\r\n\r\n		final ValidationSummaryCanvas loremipsum1 = new ValidationSummaryCanvas(\"loremipsum1\"); \r\n		final ValidationSummaryCanvas loremipsum2 = new ValidationSummaryCanvas(\"loremipsum2\"); \r\n\r\n		SectionStackSection middleSection = new SectionStackSection();  \r\n		middleSection.setTitle(\"Validation result\");  \r\n		middleSection.setExpanded(true);  \r\n		middleSection.setItems(loremipsum1);\r\n\r\n		SectionStackSection lowerSection = new SectionStackSection();  \r\n		lowerSection.setTitle(\"Validation output\");  \r\n		lowerSection.setExpanded(true);  \r\n		lowerSection.setItems(loremipsum2);\r\n\r\n		setSections( middleSection, lowerSection);  \r\n	}\r\n\r\n}\r\n'),(198,285,'package gov.nist.hit.ds.xdstools3.client.exceptions;\n\nimport com.google.gwt.user.client.rpc.IsSerializable;\n\npublic class NoServletSessionException extends Exception  implements IsSerializable{\n\n	/**\n	 *\n	 */\n	private static final long serialVersionUID = 1L;\n\n	public NoServletSessionException(String msg) {\n		super(msg);\n	}\n\n	public NoServletSessionException() {}\n\n}\n'),(199,286,'package gov.nist.hit.ds.xdstools3.client.exceptions;\r\n\r\nimport com.google.gwt.user.client.rpc.IsSerializable;\r\n\r\n/**\r\n * Created by dazais on 12/17/2014.\r\n */\r\npublic class ToolkitServerError extends Exception  implements IsSerializable {\r\n\r\n        private static final long serialVersionUID = 1L;\r\n\r\n        public ToolkitServerError(String msg) {\r\n            super(msg);\r\n        }\r\n\r\n        public ToolkitServerError() {}\r\n\r\n    }\r\n'),(200,288,'package gov.nist.hit.ds.xdstools3.client.manager;\r\n\r\n\r\nimport com.google.gwt.core.client.GWT;\r\nimport com.google.web.bindery.event.shared.EventBus;\r\nimport gov.nist.hit.ds.xdstools3.client.util.injection.Xdstools3GinInjector;\r\n\r\n/** Stores static variables & variables common to the application. This is a singleton.\r\n *\r\n */\r\npublic class Manager {\r\n    private static Manager instance = null;\r\n\r\n    // ----- Common GIN injector and event bus -----\r\n    private static final Xdstools3GinInjector injector=GWT.create(Xdstools3GinInjector.class);\r\n    public static final /*Simple*/EventBus EVENT_BUS = injector.getEventBus();/*new SimpleEventBus();*/\r\n\r\n\r\n    // Singleton constructor\r\n    private Manager(){\r\n    }\r\n\r\n    public static Manager getInstance(){\r\n        if (instance == null) {\r\n            instance = new Manager();\r\n        }\r\n        return instance;\r\n    }\r\n\r\n}\r\n'),(201,289,'package gov.nist.hit.ds.xdstools3.client.manager;\r\n\r\n/**\r\n * Stores   variables & variables common to the application. This is a singleton.\r\n * The values set here are the Tabs codes used in TabSet to identify the different tabs\r\n * and to set the different TabPlaces tokens for the URLs.\r\n *\r\n * URLs will be http://app-main-url#TabPlace:XXXXXX\r\n *\r\n * where XXXXXX is a value defined underneath such as HOME, ADMIN, GET_DOCUMENTS\r\n * or GET_FOLDERS...\r\n *\r\n */\r\npublic class TabNamesManager {\r\n    private static TabNamesManager instance = null;\r\n\r\n    public static TabNamesManager getInstance(){\r\n        if (instance == null) {\r\n            instance = new TabNamesManager();\r\n        }\r\n        return instance;\r\n    }\r\n\r\n    private final String findDocumentsTabCode = \"FIND_DOCUMENTS\";\r\n    private final String mpqFindDocumentsTabCode = \"MPQ_FIND_DOCUMENTS\";\r\n    private final String messageValidatorTabCode = \"MESSAGE_VALIDATOR\";\r\n    private final String adminTabCode = \"ADMIN\";\r\n    private final String endpointsTabCode = \"ENDPOINTS\";\r\n    private final String preConnectathonTestsTabCode = \"PRE_CONNECTATHON\";\r\n    private final String documentMetadataEditorTabCode = \"METADATA_EDITOR\";\r\n    private final String getDocumentsCode = \"GET_DOCUMENTS\";\r\n    private final String v2TabCode = \"v2_TAB\";\r\n    private final String findFoldersCode = \"FIND_FOLDERS\";\r\n    private final String getFoldersCode = \"GET_FOLDERS\";\r\n    private final String getFolderAndContentsCode=\"GET_FOLDER_AND_CONTENTS\";\r\n    private final String retrieveDocumentCode = \"RETRIEVE_DOCUMENT\";\r\n    private final String getSubmissionSetAndContentsCode = \"GET_SUB_SET_AND_CONTENTS\";\r\n    private final String getRelatedDocuments = \"GET_RELATED_DOCUMENTS\";\r\n    private final String sourceStoresDocumentValidationCode = \"SOURCE_STORES_DOC_VALIDATION\";\r\n    private final String registerAndQueryTabCode= \"REGISTER_AND_QUERY\";\r\n    private final String lifecycleValidationTabCode = \"LIFECYCLE_VALIDATION\";\r\n    private final String folderValidationTabCode = \"FOLDER_VALIDATION\";\r\n    private final String submitRetrieveTabCode=\"SUBMIT_RETRIEVE\";\r\n    private final String homeTabCode=\"HOME\";\r\n    private final String helpTabCode=\"HELP\";\r\n    private final String mhdValidatorTabCode=\"MHD_VALIDATOR\";\r\n    private final String testDataSubmissionTabCode = \"SUBMIT_TEST_DATA\";\r\n    private final String mhdToXdsConverterTabCode=\"MHD_CONVERTER\";\r\n    private final String logBrowserTabCode = \"LOG_BROWSER\";\r\n    private final String contactTabCode = \"CONTACT\";\r\n    private final String QRSCombinedTabCode = \"QRS_COMBINED\";\r\n\r\n\r\n\r\n    public String getFindDocumentsTabCode() {\r\n        return findDocumentsTabCode;\r\n    }\r\n    public String getAdminTabCode() {\r\n        return adminTabCode;\r\n    }\r\n    public String getEndpointsTabCode() {\r\n        return endpointsTabCode;\r\n    }\r\n    public String getMpqFindDocumentsTabCode() {\r\n        return mpqFindDocumentsTabCode;\r\n    }\r\n    public String getMessageValidatorTabCode() { return messageValidatorTabCode; }\r\n    public String getDocumentMetadataEditorTabCode() { return documentMetadataEditorTabCode; }\r\n    public String getPreConnectathonTestsTabCode() { return preConnectathonTestsTabCode; }\r\n    public String getGetDocumentsTabCode() { return getDocumentsCode; }\r\n    public String getFindFoldersCode() { return findFoldersCode; }\r\n    public String getGetFoldersTabCode() { return getFoldersCode; }\r\n    public String getGetFoldersAndContentsCode() {return getFolderAndContentsCode;}\r\n    public String getRetrieveDocumentTabCode() { return retrieveDocumentCode; }\r\n    public String getGetSubmissionSetAndContentsTabCode(){return getSubmissionSetAndContentsCode;}\r\n    public String getGetRelatedDocumentsCode(){return getRelatedDocuments;}\r\n    public String getSourceStoresDocumentValidationCode(){return sourceStoresDocumentValidationCode;}\r\n    public String getRegisterAndQueryTabCode() { return registerAndQueryTabCode;}\r\n    public String getLifecycleValidationTabCode() {return lifecycleValidationTabCode;}\r\n    public String getFolderValidationTabCode() {return folderValidationTabCode;}\r\n    public String getSubmitRetrieveTabCode() { return submitRetrieveTabCode; }\r\n    public String getv2TabCode() { return v2TabCode; }\r\n    public String getMHDValidatorTabCode() {return mhdValidatorTabCode;}\r\n    public String getHomeTabCode() {\r\n        return homeTabCode;\r\n    }\r\n    public String getTestDataSubmissionTabCode() {return testDataSubmissionTabCode;}\r\n    public String getMhdtoXdsConverterTabCode() {return mhdToXdsConverterTabCode;}\r\n    public String getLogBrowserTabCode() {return logBrowserTabCode;}\r\n    public String getHelpTabCode() {return helpTabCode;}\r\n    public String getContactTabCode() {return contactTabCode;}\r\n    public String getQRSCombinedTabCode() {return QRSCombinedTabCode;}\r\n\r\n}\r\n'),(202,291,'package gov.nist.hit.ds.xdstools3.client.resources;\r\n\r\nimport com.google.gwt.core.client.GWT;\r\nimport com.google.gwt.resources.client.ClientBundle;\r\nimport com.google.gwt.resources.client.TextResource;\r\n\r\n/**\r\n * Created by dazais on 12/29/2014.\r\n */\r\npublic interface Resources extends ClientBundle {\r\n    public static final Resources INSTANCE = GWT.create(Resources.class);\r\n\r\n    // ----- Load text files -----//\r\n    @Source(\"help-contents/mhd-validator.htm\")\r\n    TextResource getMHDValidatorHelpContents();\r\n\r\n\r\n    @Source(\"contact/contact.htm\")\r\n    TextResource getContactPageContents();\r\n\r\n\r\n}\r\n'),(203,293,'package gov.nist.hit.ds.xdstools3.client.tabs;\r\n\r\n\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.configure.EndpointConfigWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\n\r\npublic class EndpointConfigTab extends GenericCloseableTab {\r\n	static String header = \"View / Configure Endpoints\";\r\n\r\n	public EndpointConfigTab() {\r\n		super(header);\r\n		setPane(new EndpointConfigWidget());\r\n	}\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getEndpointsTabCode();\r\n    }\r\n\r\n\r\n}\r\n'),(204,294,'package gov.nist.hit.ds.xdstools3.client.tabs;\r\n\r\nimport com.smartgwt.client.widgets.menu.Menu;\r\nimport com.smartgwt.client.widgets.menu.MenuItem;\r\nimport com.smartgwt.client.widgets.menu.events.ClickHandler;\r\nimport com.smartgwt.client.widgets.menu.events.MenuItemClickEvent;\r\nimport com.smartgwt.client.widgets.tab.Tab;\r\nimport gov.nist.hit.ds.xdstools3.client.util.eventBus.CloseTabEvent;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.Manager;\r\nimport gov.nist.hit.ds.xdstools3.client.util.eventBus.CloseAllTabsEvent;\r\nimport gov.nist.hit.ds.xdstools3.client.util.eventBus.CloseOtherTabsEvent;\r\n\r\n/**\r\n * Structure for closeable tabs\r\n */\r\npublic abstract class GenericCloseableTab extends GenericTab {\r\n    Menu tabMenu = new Menu();\r\n    MenuItem closeTabBtn=new MenuItem(\"Close tab\");\r\n    MenuItem closeOtherTabsBtn=new MenuItem(\"Close other tabs\");\r\n    MenuItem closeAllTabBtn=new MenuItem(\"Close all tabs\");\r\n\r\n    public GenericCloseableTab(String header){\r\n        super(header);\r\n        setCanClose(true);\r\n        this.setContextMenu(tabMenu);\r\n        tabMenu.setItems(closeTabBtn, closeOtherTabsBtn, closeAllTabBtn);\r\n        bindUI();\r\n    }\r\n\r\n\r\n    private void bindUI(){\r\n        final Tab tab=this;\r\n        closeTabBtn.addClickHandler(new ClickHandler() {\r\n            @Override\r\n            public void onClick(MenuItemClickEvent menuItemClickEvent) {\r\n                Manager.EVENT_BUS.fireEvent(new CloseTabEvent(tab));\r\n            }\r\n        });\r\n        closeAllTabBtn.addClickHandler(new ClickHandler() {\r\n            @Override\r\n            public void onClick(MenuItemClickEvent menuItemClickEvent) {\r\n                Manager.EVENT_BUS.fireEvent(new CloseAllTabsEvent());\r\n            }\r\n        });\r\n        closeOtherTabsBtn.addClickHandler(new ClickHandler() {\r\n            @Override\r\n            public void onClick(MenuItemClickEvent menuItemClickEvent) {\r\n                Manager.EVENT_BUS.fireEvent(new CloseOtherTabsEvent(tab));\r\n            }\r\n        });\r\n    }\r\n\r\n}\r\n'),(205,295,'package gov.nist.hit.ds.xdstools3.client.tabs;\r\n\r\nimport com.google.gwt.user.client.Window;\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport com.smartgwt.client.types.Alignment;\r\nimport com.smartgwt.client.widgets.Canvas;\r\nimport com.smartgwt.client.widgets.Label;\r\nimport com.smartgwt.client.widgets.layout.HLayout;\r\nimport com.smartgwt.client.widgets.layout.LayoutSpacer;\r\nimport com.smartgwt.client.widgets.layout.VLayout;\r\nimport gov.nist.hit.ds.repository.shared.data.AssetNode;\r\nimport gov.nist.hit.ds.repository.ui.client.widgets.EventAggregatorWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.design.IconLabel;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.WaitPanel;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.buttons.HelpButton;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.design.Formatter;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.Manager;\r\n\r\npublic abstract class GenericCloseableToolTab extends GenericCloseableTab implements ToolTabInterface {\r\n\r\n    private VLayout mainPanel = new VLayout();\r\n    private VLayout helpPanel = new VLayout(); // this is the right panel\r\n    private HLayout topPanel = new HLayout();  // contains contentsPanel and resultsPanel\r\n    private VLayout contentsPanel = new VLayout(10); // form contents\r\n    private VLayout resultsPanel; // bottom label\r\n    private Label headerLabel = new Label();\r\n    private HLayout titleAndHelpButton = new HLayout();\r\n    private HelpButton helpButton;\r\n    private EventAggregatorWidget eventMessageAggregatorWidget;\r\n    protected WaitPanel waitPanel = new WaitPanel();\r\n\r\n\r\n    // Initial event summary widget parameters\r\n    String id = null;\r\n    String type = \"validators\";\r\n    String[] displayColumns = new String[]{\"ID\",\"STATUS\",\"MSG\"};\r\n\r\n\r\n\r\n    public GenericCloseableToolTab(String header) {\r\n        super(header);\r\n        setHeader(header);\r\n\r\n        // set the left canvas contents\r\n        setFieldsCanvas(createContents());\r\n\r\n        // create and populate the validation results panel with initialized EventAggregatorWidget\r\n        resultsPanel = new VLayout();\r\n        resultsPanel.addMember(setupEventMessagesWidget(EventAggregatorWidget.ASSET_CLICK_EVENT.OUT_OF_CONTEXT, \"Sim\", id, type, displayColumns));\r\n        mainPanel.addMember(resultsPanel);\r\n        setPane(mainPanel);\r\n\r\n        // display attributes\r\n        mainPanel.setLayoutMargin(20);\r\n        resultsPanel.setLayoutMargin(10);\r\n        }\r\n\r\n    @Override\r\n    public VLayout getContentsPanel() {\r\n        return contentsPanel;\r\n    }\r\n\r\n\r\n    /**\r\n     * This is the title of the tab, displayed in large characters at the top of the tab\r\n     * @param s the title or header of the tab\r\n     */\r\n    @Override\r\n    public void setHeader(String s){\r\n        // create the header of the tab\r\n        headerLabel = Formatter.createTabHeader(s);\r\n\r\n        // add a spacer to separate the title from the help button\r\n        LayoutSpacer spacer = new LayoutSpacer();\r\n        spacer.setHeight(30);\r\n\r\n        // add components to main contentsPanel\r\n        titleAndHelpButton.addMembers(headerLabel, spacer);\r\n        titleAndHelpButton.setHeight(30);\r\n        mainPanel.addMember(titleAndHelpButton);\r\n        setPane(mainPanel);\r\n    }\r\n\r\n\r\n    /**\r\n     * Creates a subtitle. Other, smaller subtitle functions can be later created in the same manner.\r\n     * @param s\r\n     @Override\r\n     */\r\n    public IconLabel createSubtitle1(String s){\r\n        return Formatter.createSubtitle1(s);\r\n    }\r\n\r\n    /**\r\n     * Sets the contents of a tab, inside its left panel. This\r\n     * is usually the fields intended to be filled out by the user.\r\n     * @param pane The tab contents\r\n     */\r\n    public void setFieldsCanvas(Widget pane){\r\n        // add the form to be filled out by the user, to the left contents panel\r\n        contentsPanel.addMember(pane);\r\n        // populate the top panel (contents panel | help panel)\r\n        topPanel.addMembers(contentsPanel, helpPanel);\r\n        // add the top panel to the overall tab canvas\r\n        mainPanel.addMember(topPanel);\r\n        setPane(mainPanel);\r\n        // display features\r\n        getPane().setAlign(Alignment.CENTER);\r\n        topPanel.setLayoutBottomMargin(20);\r\n    }\r\n\r\n\r\n    /**\r\n     * Changes the contents of the result panel\r\n     * @param canvas\r\n     */\r\n    @Override\r\n    public void setResultsPanel(Canvas canvas){\r\n        resultsPanel.clear();\r\n        resultsPanel.addMember(canvas);\r\n    }\r\n\r\n    @Override\r\n    public VLayout getResultsPanel(){\r\n        return resultsPanel;\r\n    }\r\n\r\n    /**\r\n     * Removes the main header of a tab\r\n     */\r\n    @Override\r\n    public void removeHeaderTitle(){\r\n        mainPanel.removeMember(titleAndHelpButton);\r\n    }\r\n\r\n    /**\r\n     * Add a help button to the top right corner of the tab\r\n     */\r\n    @Override\r\n    public void setHelpButton(Canvas container, String contents){\r\n        helpButton = new HelpButton(container, contents);\r\n        titleAndHelpButton.addMember(helpButton);\r\n        titleAndHelpButton.setHeight(30);\r\n        titleAndHelpButton.redraw();\r\n    }\r\n\r\n    /**\r\n     * Hides the help button\r\n     */\r\n    @Override\r\n    public void hideHelpButton(){\r\n        contentsPanel.hideMember(helpButton);\r\n    }\r\n\r\n    /**\r\n     * Changes the contents of the Help Window, displayed when clicking on the Help Button\r\n     * @param contents\r\n     */\r\n    @Override\r\n    public void setHelpWindowContents(String contents){\r\n        helpButton.setHelpWindowContents(contents);\r\n    }\r\n\r\n    @Override\r\n    public VLayout getHelpPanel() {\r\n        return helpPanel;\r\n    }\r\n\r\n    public EventAggregatorWidget getEventMessageAggregatorWidget(){ return eventMessageAggregatorWidget; }\r\n\r\n    /**\r\n     * Abstract method that builds the tab\'s widget content.\r\n     * @return tab\'s content widget\r\n     */\r\n    protected abstract Widget createContents();\r\n\r\n    /**\r\n     * Method that sets the tab\'s name.\r\n     * @return tab\'s name\r\n     */\r\n    protected abstract String setTabName();\r\n\r\n\r\n    /**\r\n     * Method that return a panel displaying a message asking to wait\r\n     * while the system is processing.\r\n     *\r\n     * <strong>How to:</strong>\r\n     * To display the panel, use {@link gov.nist.hit.ds.xdstools3.client.customWidgets.WaitPanel#show()}\r\n     * method before system start processing.\r\n     * To hide the panel, use {@link gov.nist.hit.ds.xdstools3.client.customWidgets.WaitPanel#hide()}\r\n     * method when system finishes processing.\r\n     *\r\n     * @see gov.nist.hit.ds.xdstools3.client.customWidgets.WaitPanel\r\n     *\r\n     * @return WaitPanel\r\n     */\r\n    protected WaitPanel getWaitPanel(){\r\n        return waitPanel;\r\n    }\r\n\r\n\r\n    /**\r\n     * Initializes the Event Message Widget to be populated with the validation result\r\n     */\r\n    protected Widget setupEventMessagesWidget(EventAggregatorWidget.ASSET_CLICK_EVENT assetClickEvent, String externalRepositoryId, String eventAssetId, String type, String[] displayColumns) {\r\n\r\n        try {\r\n            // Initialize the widget\r\n            eventMessageAggregatorWidget = new EventAggregatorWidget(Manager.EVENT_BUS, assetClickEvent, externalRepositoryId,eventAssetId,type,displayColumns);\r\n            eventMessageAggregatorWidget.setSize(\"1110px\", \"600px\");\r\n            return eventMessageAggregatorWidget;\r\n\r\n        } catch (Throwable t) {\r\n            Window.alert(\"EventAggregatorWidget instance could not be created: \" + t.toString());\r\n        }\r\n        return null;\r\n    }\r\n\r\n    /**\r\n     * Display validation results and hides the wait panel\r\n     *\r\n     * @param assetNode Validation result from RPC validation\r\n     */\r\n    public void displayValidationResults(AssetNode assetNode) {\r\n        if (!getResultsPanel().isVisible()){\r\n            getResultsPanel().setVisible(true);\r\n        }\r\n        getEventMessageAggregatorWidget().setEventAssetNode(assetNode);\r\n        getResultsPanel().redraw();\r\n        getContentsPanel().hideMember(waitPanel);\r\n    }\r\n}\r\n'),(206,296,'package gov.nist.hit.ds.xdstools3.client.tabs;\r\n\r\nimport com.smartgwt.client.widgets.tab.Tab;\r\n\r\n/**\r\n * Holds the functions common to all tabs (Tool Tabs and Home Tabs).\r\n */\r\n\r\npublic abstract class GenericTab extends Tab {\r\n    private String tabName;\r\n\r\n    public GenericTab(String header) {\r\n        tabName = setTabName();\r\n        setTitle(header);\r\n    }\r\n\r\n    /**\r\n     * Returns the tab name, used for navigation.\r\n     * These are defined in TabNamesUtil.\r\n     * @return tab name (String)\r\n     * @See TabNamesUtil\r\n     */\r\n    public String getTabName(){\r\n        return tabName;\r\n    }\r\n\r\n    /**\r\n     * Sets the tab name.\r\n     * @return tab name\r\n     */\r\n    protected abstract String setTabName();\r\n\r\n\r\n}\r\n'),(207,297,'package gov.nist.hit.ds.xdstools3.client.tabs;\r\n\r\nimport com.smartgwt.client.types.Side;\r\nimport com.smartgwt.client.widgets.tab.Tab;\r\nimport com.smartgwt.client.widgets.tab.TabSet;\r\n\r\n/**\r\n * Builds the main set of tabs for the application\r\n */\r\npublic class GenericTabSet extends TabSet {\r\n\r\n	public GenericTabSet(){\r\n	    this.setTabBarPosition(Side.TOP);\r\n	    this.setTabBarAlign(Side.LEFT);\r\n	}\r\n\r\n    public Tab findTab(Tab tab){\r\n        for (Tab t:getTabs())\r\n            if (t.getTitle().equals(tab.getTitle())) {\r\n                return t;\r\n            }\r\n        return null;\r\n    }\r\n\r\n\r\n}\r\n'),(208,298,'package gov.nist.hit.ds.xdstools3.client.tabs;\r\n\r\n\r\nimport com.smartgwt.client.widgets.HTMLPane;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\n\r\npublic class HelpTab extends GenericCloseableTab {\r\n	static String header = \"Help\";\r\n\r\n	public HelpTab() {\r\n		super(header);\r\n	}\r\n\r\n	protected VStack createContents(){\r\n        VStack vstack = new VStack();\r\n        HTMLPane panel = new HTMLPane();\r\n        vstack.addMember(panel);\r\n        return vstack ;\r\n	}\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getHelpTabCode();\r\n    }\r\n\r\n\r\n}\r\n'),(209,300,'package gov.nist.hit.ds.xdstools3.client.tabs.MPQTab;\r\n\r\nimport com.smartgwt.client.widgets.Label;\r\nimport com.smartgwt.client.widgets.layout.HStack;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.PatientIDWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.TLSAndSAML.TLSAndSAMLForm;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.buttons.GenericRunButtonNoForm;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select.EndpointWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.healthcareCodes.HealthcareCodeWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.GenericCloseableToolTab;\r\n\r\n/**\r\n * Created by dazais on 5/14/2014.\r\n */\r\npublic class MPQTab extends GenericCloseableToolTab {\r\n    static String header = \"Multi-Patient Find Documents (MPQ)\";\r\n\r\n    public MPQTab() {\r\n        super(header);\r\n    }\r\n\r\n    @Override\r\n    protected VStack createContents(){\r\n        // layout\r\n        final VStack mpqPanel = new VStack();\r\n\r\n        // PID\r\n        Label label1 = createSubtitle1(\"Step 1: Enter PID, OR select one or more Code Values\");\r\n        PatientIDWidget pid = new PatientIDWidget();\r\n        // Create the Code grids\r\n        HealthcareCodeWidget codeGridsWidget = new HealthcareCodeWidget();\r\n        HStack pidAndCodes = new HStack();\r\n        pidAndCodes.addMembers(pid, codeGridsWidget);\r\n\r\n        // Actors\r\n        // TODO needs an actors widget with only Registries\r\n        Label label2 = createSubtitle1(\"Step 2: Select Actors\");\r\n        EndpointWidget endpoints = new EndpointWidget();\r\n\r\n        // TLS / SAML\r\n        Label label3 = createSubtitle1(\"Step 3: Select TLS and SAML options\");\r\n        TLSAndSAMLForm tlsSaml = new TLSAndSAMLForm();\r\n\r\n        // Run button\r\n        final GenericRunButtonNoForm runButton = new GenericRunButtonNoForm();\r\n\r\n        // Add to layout\r\n        mpqPanel.addMembers(label1, pid, codeGridsWidget, label2, endpoints, label3, tlsSaml, runButton);\r\n\r\n        // Add listeners\r\n\r\n        return mpqPanel;\r\n    }\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getMpqFindDocumentsTabCode();\r\n    }\r\n\r\n}\r\n'),(210,301,'package gov.nist.hit.ds.xdstools3.client.tabs;\r\n\r\nimport com.smartgwt.client.data.RestDataSource;\r\nimport com.smartgwt.client.types.GroupStartOpen;\r\nimport com.smartgwt.client.types.RowEndEditAction;\r\nimport com.smartgwt.client.types.SortDirection;\r\nimport com.smartgwt.client.widgets.grid.ListGrid;\r\nimport com.smartgwt.client.widgets.grid.ListGridField;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select.EndpointDS;\r\n\r\npublic class MessageValidatorTab extends GenericCloseableToolTab {\r\n    private static String title = \"Message Validator\";\r\n\r\n\r\n    public MessageValidatorTab() {\r\n        super(title);\r\n    }\r\n\r\n    @Override\r\n    protected ListGrid createContents() {\r\n        // Create the DataSource\r\n        RestDataSource dataSource = new EndpointDS();\r\n\r\n        // Create the ListGrid linked to the DataSource\r\n        final ListGrid grid = new ListGrid();\r\n        grid.setHeight(200);\r\n        grid.setWidth(500);\r\n        grid.setTitle(\"Endpoints\");\r\n        grid.setDataSource(dataSource);\r\n        grid.setAutoFetchData(true);\r\n        grid.setListEndEditAction(RowEndEditAction.NEXT);\r\n\r\n        // Configure sorting\r\n        grid.setSortField(1);\r\n        grid.setSortDirection(SortDirection.DESCENDING);\r\n        grid.setGroupStartOpen(GroupStartOpen.ALL);\r\n        grid.setGroupByField(\"type\");\r\n\r\n        // Set ListGrid fields\r\n        ListGridField typeField = new ListGridField(\"type\", \"Type\");\r\n        ListGridField nameField = new ListGridField(\"name\", \"Name\");\r\n        grid.setFields(typeField, nameField);\r\n        return grid;\r\n    }\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getMessageValidatorTabCode();\r\n    }\r\n\r\n}\r\n'),(211,303,'package gov.nist.hit.ds.xdstools3.client.tabs.QRSCombinedTab;\r\n\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport com.smartgwt.client.types.VisibilityMode;\r\nimport com.smartgwt.client.widgets.grid.ListGrid;\r\nimport com.smartgwt.client.widgets.grid.ListGridField;\r\nimport com.smartgwt.client.widgets.layout.*;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.GenericCloseableToolTab;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.QRSCombinedTab.data.QRSDataFactory;\r\n\r\n/**\r\n * Created by dazais on 3/9/2015.\r\n */\r\npublic class QueryRetrieveSubmitCombinedTab extends GenericCloseableToolTab {\r\n    private static final String header = \"Query - Retrieve - Submit\";\r\n\r\n\r\n    public QueryRetrieveSubmitCombinedTab(){\r\n        super(header);\r\n    }\r\n\r\n\r\n    @Override\r\n    protected Widget createContents() {\r\n\r\n        // Transaction parameters selection grids and layout\r\n        final ListGrid profileGrid = createSelectionListGrid(\"Profile\", \"profile\");\r\n        final ListGrid fromGrid = createSelectionListGrid(\"From\", \"from\");\r\n        final ListGrid toGrid = createSelectionListGrid(\"To\", \"to\");\r\n        final ListGrid transactionGrid = createSelectionListGrid(\"Transaction\", \"transaction\");\r\n\r\n        HLayout gridLayout = new HLayout();\r\n        gridLayout.addMembers(profileGrid, fromGrid, toGrid, transactionGrid);\r\n\r\n\r\n\r\n        // Sections\r\n\r\n        final SectionStack sectionStack = new SectionStack();\r\n        sectionStack.setVisibilityMode(VisibilityMode.MULTIPLE);\r\n        sectionStack.setWidth(1000);\r\n        sectionStack.setHeight(300);\r\n\r\n        SectionStackSection section1 = new SectionStackSection(\"Select query parameters\");\r\n        section1.setExpanded(true);\r\n        section1.setCanCollapse(true);\r\n        section1.addItem(gridLayout);\r\n        sectionStack.addSection(section1);\r\n\r\n        SectionStackSection section2 = new SectionStackSection(\"HTML Flow\");\r\n        section2.setExpanded(true);\r\n        section2.setCanCollapse(true);\r\n        //section2.addItem(htmlFlow);\r\n        sectionStack.addSection(section2);\r\n\r\n\r\n\r\n        // SectionStack container\r\n        HStack sections = new HStack();\r\n        sections.addMember(sectionStack);\r\n\r\n        //DynamicForm form = new DynamicForm();\r\n        //form.setFields(selectItemMultipleGrid);\r\n\r\n        VStack vStack = new VStack();\r\n        vStack.addMember(sections);\r\n        return vStack;\r\n    }\r\n\r\n    /** Creates a custom ListGrid with only one column that will be used as a\r\n     * permanently expanded selection box.\r\n     * @param title\r\n     * @param fieldName Must match the record\'s name in the matching Data class.\r\n     * @return\r\n     */\r\n    private ListGrid createSelectionListGrid(String title, String fieldName){\r\n        ListGrid grid = new ListGrid();\r\n        grid.setWidth(\"25%\");\r\n        grid.setShowAllRecords(true);\r\n        grid.setLeaveScrollbarGap(false);\r\n        grid.setRecords(QRSDataFactory.getRecord(fieldName));\r\n        ListGridField field = new ListGridField(fieldName, title);\r\n        grid.setFields(field);\r\n        return grid;\r\n    }\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getQRSCombinedTabCode();\r\n    }\r\n}'),(212,305,'package gov.nist.hit.ds.xdstools3.client.tabs.QRSCombinedTab.data;\r\n\r\nimport com.smartgwt.client.widgets.grid.ListGridRecord;\r\n\r\n/**\r\n * Data for the Profile selection grid\r\n * Created by dazais on 3/10/2015.\r\n */\r\npublic class FromData extends QRSDataModel {\r\n    private static ListGridRecord[] records;\r\n\r\n\r\n    private FromData(){super();}\r\n\r\n    public static ListGridRecord[] getRecords() {\r\n        if (records == null) {\r\n            records = getNewRecords();\r\n        }\r\n        return records;\r\n    }\r\n\r\n    public static ListGridRecord[] getNewRecords() {\r\n        return new ListGridRecord[]{\r\n                createRecord(\"xxx\", \"from\"),\r\n                createRecord(\"uuu\", \"from\"),\r\n        };\r\n    }\r\n\r\n}\r\n'),(213,306,'package gov.nist.hit.ds.xdstools3.client.tabs.QRSCombinedTab.data;\r\n\r\nimport com.smartgwt.client.widgets.grid.ListGridRecord;\r\n\r\n/**\r\n * Data for the Profile selection grid\r\n * Created by dazais on 3/10/2015.\r\n */\r\npublic class ProfileData extends QRSDataModel {\r\n    private static ListGridRecord[] records;\r\n\r\n\r\n    private ProfileData(){super();}\r\n\r\n    public static ListGridRecord[] getRecords() {\r\n        if (records == null) {\r\n            records = getNewRecords();\r\n        }\r\n        return records;\r\n    }\r\n\r\n    public static ListGridRecord[] getNewRecords() {\r\n        return new ListGridRecord[]{\r\n                createRecord(\"XDS\", \"profile\"),\r\n                createRecord(\"XDR\", \"profile\"),\r\n                createRecord(\"XCA\", \"profile\")\r\n        };\r\n    }\r\n\r\n}\r\n'),(214,307,'package gov.nist.hit.ds.xdstools3.client.tabs.QRSCombinedTab.data;\r\n\r\n\r\nimport com.smartgwt.client.widgets.grid.ListGridRecord;\r\n\r\n/**\r\n * Created by dazais on 3/12/2015.\r\n */\r\npublic class QRSDataFactory {\r\n\r\n    public static ListGridRecord[] getRecord(String type){\r\n        String formattedStr = type.toLowerCase();\r\n\r\n        if (formattedStr == \"profile\"){\r\n            return ProfileData.getRecords();\r\n        }\r\n        else if (formattedStr == \"from\"){\r\n            return FromData.getRecords();\r\n        }\r\n        else if (formattedStr == \"to\"){\r\n            return ToData.getRecords();\r\n        }\r\n        else if (formattedStr == \"transaction\"){\r\n            return TransactionData.getRecords();\r\n        }\r\n        else {\r\n            return new ListGridRecord[]{};\r\n        }\r\n    }\r\n\r\n}\r\n'),(215,308,'package gov.nist.hit.ds.xdstools3.client.tabs.QRSCombinedTab.data;\r\n\r\nimport com.smartgwt.client.widgets.grid.ListGridRecord;\r\n\r\n/**\r\n * Data model for the selection grids. See *Data classes for extensions of this class dedicated to each grid.\r\n * The purpose of this class is to store the data functions common to all *Data singletons.\r\n *\r\n * Created by dazais on 3/10/2015.\r\n */\r\npublic class QRSDataModel {\r\n\r\n    public QRSDataModel(){}\r\n\r\n\r\n    public static ListGridRecord createRecord(String property, String value) {\r\n        ListGridRecord record = new ListGridRecord();\r\n        record.setAttribute(value, property);\r\n        return record;\r\n    }\r\n\r\n\r\n}\r\n'),(216,309,'package gov.nist.hit.ds.xdstools3.client.tabs.QRSCombinedTab.data;\r\n\r\nimport com.smartgwt.client.widgets.grid.ListGridRecord;\r\n\r\n/**\r\n * Data for the Profile selection grid\r\n * Created by dazais on 3/10/2015.\r\n */\r\npublic class ToData extends QRSDataModel {\r\n    private static ListGridRecord[] records;\r\n\r\n\r\n    private ToData(){super();}\r\n\r\n    public static ListGridRecord[] getRecords() {\r\n        if (records == null) {\r\n            records = getNewRecords();\r\n        }\r\n        return records;\r\n    }\r\n\r\n    public static ListGridRecord[] getNewRecords() {\r\n        return new ListGridRecord[]{\r\n                createRecord(\"iii\", \"to\"),\r\n                createRecord(\"sss\", \"to\"),\r\n                createRecord(\"sss2\", \"to\"),\r\n        };\r\n    }\r\n\r\n}\r\n'),(217,310,'package gov.nist.hit.ds.xdstools3.client.tabs.QRSCombinedTab.data;\r\n\r\nimport com.smartgwt.client.widgets.grid.ListGridRecord;\r\n\r\n/**\r\n * Data for the Profile selection grid\r\n * Created by dazais on 3/10/2015.\r\n */\r\npublic class TransactionData extends QRSDataModel {\r\n    private static ListGridRecord[] records;\r\n\r\n\r\n    private TransactionData(){super();}\r\n\r\n    public static ListGridRecord[] getRecords() {\r\n        if (records == null) {\r\n            records = getNewRecords();\r\n        }\r\n        return records;\r\n    }\r\n\r\n    public static ListGridRecord[] getNewRecords() {\r\n        return new ListGridRecord[]{\r\n                createRecord(\"Retrieve\", \"transaction\"),\r\n                createRecord(\"test\", \"transaction\"),\r\n        };\r\n    }\r\n\r\n}\r\n'),(218,311,'package gov.nist.hit.ds.xdstools3.client.tabs;\r\n\r\nimport com.smartgwt.client.widgets.Canvas;\r\nimport com.smartgwt.client.widgets.layout.VLayout;\r\nimport com.smartgwt.client.widgets.Label;\r\n\r\n/**\r\n * Defines the profile for creating a tab.\r\n * @author dazais\r\n * @see GenericCloseableTab\r\n *\r\n */\r\npublic interface ToolTabInterface {\r\n\r\n	public VLayout getContentsPanel();\r\n	public void setHeader(String s);\r\n	public void removeHeaderTitle();\r\n	public Label createSubtitle1(String s);\r\n\r\n	public void setResultsPanel(Canvas canvas);\r\n	public VLayout getResultsPanel();\r\n\r\n	public void setHelpButton(Canvas container, String contents);\r\n	public void hideHelpButton();\r\n	public void setHelpWindowContents(String contents);\r\n	public VLayout getHelpPanel();\r\n\r\n	public String getTabName();\r\n}\r\n'),(219,313,'package gov.nist.hit.ds.xdstools3.client.tabs.adminSettingsTab;\r\n\r\nimport com.smartgwt.client.types.Alignment;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.forms.GenericForm;\r\n\r\n/**\r\n * Holds the formatting for a form used in the AdminSettings tab.\r\n *\r\n * Created by dazais on 10/30/2014.\r\n */\r\npublic class AdminSettingsForm extends GenericForm {\r\n\r\n    public AdminSettingsForm(){\r\n        setWidth(600);\r\n        setLayoutAlign(Alignment.CENTER);\r\n        setNumCols(2);\r\n        setColWidths(150);\r\n    }\r\n\r\n}\r\n'),(220,314,'package gov.nist.hit.ds.xdstools3.client.tabs.adminSettingsTab;\r\n\r\nimport com.google.gwt.user.client.rpc.RemoteService;\r\nimport com.google.gwt.user.client.rpc.RemoteServiceRelativePath;\r\n\r\n/**\r\n * Created by dazais on 10/29/2014.\r\n */\r\n    @RemoteServiceRelativePath(\"adminSettings\")\r\n    public interface AdminSettingsService extends RemoteService {\r\n\r\n        public void saveAdminSettings(String[] settings);\r\n        public void saveAdminPassword(String oldPassword, String newPassword);\r\n        public String[] retrieveAdminSettings();\r\n    }\r\n\r\n'),(221,315,'package gov.nist.hit.ds.xdstools3.client.tabs.adminSettingsTab;\r\n\r\nimport com.google.gwt.user.client.rpc.AsyncCallback;\r\n\r\n/**\r\n * Created by dazais on 10/29/2014.\r\n */\r\npublic interface AdminSettingsServiceAsync {\r\n\r\n     void saveAdminSettings(String[] settings, AsyncCallback<Void> async);\r\n     void saveAdminPassword(String oldPassword, String newPassword, AsyncCallback<Void> async);\r\n     void retrieveAdminSettings(AsyncCallback<String[]> async);\r\n}\r\n'),(222,316,'package gov.nist.hit.ds.xdstools3.client.tabs.adminSettingsTab;\r\n\r\nimport com.google.gwt.core.client.GWT;\r\nimport com.google.gwt.user.client.rpc.AsyncCallback;\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport com.smartgwt.client.types.Alignment;\r\nimport com.smartgwt.client.widgets.Canvas;\r\nimport com.smartgwt.client.widgets.IButton;\r\nimport com.smartgwt.client.widgets.events.ClickEvent;\r\nimport com.smartgwt.client.widgets.events.ClickHandler;\r\nimport com.smartgwt.client.widgets.form.fields.PasswordItem;\r\nimport com.smartgwt.client.widgets.form.fields.SectionItem;\r\nimport com.smartgwt.client.widgets.form.fields.TextItem;\r\nimport com.smartgwt.client.widgets.form.validator.MatchesFieldValidator;\r\nimport com.smartgwt.client.widgets.layout.VLayout;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.dialogs.PopupMessageV3;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.GenericCloseableTab;\r\n\r\n/**\r\n * This tabs allows to edit the Administrator Settings / Toolkit Settings available through the back-end from a\r\n * properties file. This tab is being opened when the user logs in as administrator, through the Login Dialog.\r\n */\r\npublic class AdminSettingsTab extends GenericCloseableTab {\r\n	private static String title = \"Administrator Settings\";\r\n    private TextItem host, port, tls_port, cache, environment, gazelle;\r\n    protected AdminSettingsServiceAsync rpcService = GWT.create(AdminSettingsService.class);\r\n\r\n\r\n	public AdminSettingsTab() {\r\n        super(title);\r\n        setPane((Canvas) createContents());\r\n        populateFields();\r\n    }\r\n\r\n\r\n    protected Widget createContents() {\r\n\r\n        // ------  First form to hold most settings -----\r\n        final AdminSettingsForm form = new AdminSettingsForm();\r\n\r\n        host = createField(\"host\", \"Toolkit host\", \"transport-testing.nist.gov\", 400);\r\n        port = createField(\"port\", \"Toolkit port\", \"12080\", 400);\r\n        tls_port = createField(\"tls_port\", \"Toolkit TLS Port\", \"12081\", 400);\r\n        cache = createField(\"cache\", \"External cache\", \"Ex.: C:\\\\Workspace\\\\external_cache\", 400);\r\n        environment = createField(\"environment\", \"Default environment	\", \"Ex.: MU2014, NA2014...\", 400);\r\n        gazelle = createField(\"gazelle\", \"Gazelle config URL\", \"\", 400);\r\n\r\n        // Build form sections\r\n        SectionItem section1 = new SectionItem();\r\n        section1.setDefaultValue(\"General\");\r\n        section1.setSectionExpanded(true);\r\n        section1.setItemIds(\"host\", \"port\", \"tls_port\", \"cache\", \"environment\");\r\n\r\n        final SectionItem section2 = new SectionItem();\r\n        section2.setDefaultValue(\"Connectathon\");\r\n        section2.setSectionExpanded(true);\r\n        section2.setItemIds(\"gazelle\");\r\n\r\n        form.setFields(section1, host, port, tls_port, cache, environment, section2, gazelle);\r\n\r\n\r\n\r\n        // ------  Second form for password -----\r\n        // Allows to implement client-side validation checks on the data entered in the password fields\r\n        // without affecting the rest of the page (e.g. all fields must be filled out in that form,\r\n        // but not necessarily in the other form).\r\n        final AdminSettingsForm formPassword = new AdminSettingsForm();\r\n\r\n        // Form items\r\n        final PasswordItem oldPassword = createPasswordField(\"oldpassword\", \"Current password\", 30);\r\n        oldPassword.setRequired(true);\r\n        final PasswordItem newPassword = createPasswordField(\"newpassword\", \"New password\", 30);\r\n        newPassword.setRequired(true);\r\n        final PasswordItem newPasswordCheck = createPasswordField(\"newpasswordcheck\", \"Confirm new password\", 30);\r\n        newPasswordCheck.setRequired(true);\r\n\r\n        // validator that checks that the \"new password\" fields match each other\r\n        MatchesFieldValidator matchesValidator = new MatchesFieldValidator();\r\n        matchesValidator.setOtherField(\"newpassword\");\r\n        matchesValidator.setErrorMessage(\"Passwords do not match\");\r\n        newPasswordCheck.setValidators(matchesValidator);\r\n\r\n        // Form sections\r\n        SectionItem section3 = new SectionItem();\r\n        section3.setDefaultValue(\"Change administrator password\");\r\n        section3.setSectionExpanded(false);\r\n        section3.setItemIds(\"oldpassword\", \"newpassword\", \"newpasswordcheck\");\r\n\r\n        formPassword.setFields(section3, oldPassword, newPassword, newPasswordCheck);\r\n\r\n        // -------- Enclosing layout -------\r\n        final VLayout layout = new VLayout(10);\r\n\r\n        //------- Save Button --------\r\n        final IButton saveButton = new IButton(\"Save\");\r\n        saveButton.addClickHandler(new ClickHandler() {\r\n            @Override\r\n            public void onClick(ClickEvent clickEvent) {\r\n                String[] settings = {(String) host.getValue(), (String) port.getValue(), (String) tls_port.getValue(),\r\n                        (String) cache.getValue(), (String) environment.getValue(), (String) gazelle.getValue()};\r\n\r\n                // if password fields are null, save only the other form\r\n                if (oldPassword.getValue() == null\r\n                        && newPassword.getValue() == null\r\n                        && newPasswordCheck.getValue() == null) {\r\n                    saveAdminSettings(settings);\r\n                } else {\r\n                    if (formPassword.validate()) {\r\n                            saveAdminSettings(settings);\r\n                            saveAdminPassword((String) oldPassword.getValue(), (String) newPassword.getValue());\r\n                        }\r\n                    }\r\n                }\r\n        });\r\n\r\n\r\n        // -------- Enclosing layout -------\r\n        layout.addMembers(form, formPassword, saveButton);\r\n        saveButton.setLayoutAlign(Alignment.CENTER);\r\n        return layout;\r\n    }\r\n\r\n\r\n\r\n    /**\r\n     * Populates the form fields by retrieving the Toolkit settings from the back-end.\r\n     */\r\n    protected void populateFields() {\r\n        // FIXME why does this function trigger two updates of the admin settings? cf console log\r\n\r\n       // -------- Populate forms with data from Toolkit configuration -------\r\n        // Returns the following parameters in that order: host, port, tls_port, cache, environment, gazelleURL.\r\n        AsyncCallback<String[]> callback = new AsyncCallback<String[]>() {\r\n            public void onFailure(Throwable caught) {\r\n                // logger.debug(getClassName() + \": \" +\"populateForms\");\r\n                new PopupMessageV3(\"Retrieving administrator settings from the server failed.\");\r\n            }\r\n\r\n            @Override\r\n            public void onSuccess(String[] result) {\r\n                if (result.length != 6) new PopupMessageV3(\"Retrieving administrator settings from the server failed.\");\r\n                else {\r\n                    host.setDefaultValue(result[0]);\r\n                    port.setDefaultValue(result[1]);\r\n                    tls_port.setDefaultValue(result[2]);\r\n                    cache.setDefaultValue(result[3]);\r\n                    environment.setDefaultValue(result[4]);\r\n                    gazelle.setDefaultValue(result[5]);\r\n                }\r\n            }\r\n        };\r\n        rpcService.retrieveAdminSettings(callback);\r\n    }\r\n\r\n    /** Propagates changes in the admin settings to the back-end where they are ultimately saved to file\r\n     *\r\n     * @param settings the array of settings\r\n     */\r\n    protected void saveAdminSettings(String[] settings){\r\n\r\n        AsyncCallback<Void> callback = new AsyncCallback<Void>() {\r\n            public void onFailure(Throwable caught) {\r\n                // logger.debug(getClassName() + \": \" +\"saveAdminSettings\");\r\n                new PopupMessageV3(\"Saving administrator settings to server failed.\");\r\n            }\r\n\r\n            @Override\r\n            public void onSuccess(Void result) {\r\n                // TODO close the tab. Maybe have both a \"save\" button and a \"save and close\" one?\r\n                // TODO This is not urgent as the user can do it manually for now.\r\n            }\r\n        };\r\n        rpcService.saveAdminSettings(settings, callback);\r\n    }\r\n\r\n    protected void saveAdminPassword(String oldPassword, String newPassword){\r\n\r\n        AsyncCallback<Void> callback = new AsyncCallback<Void>() {\r\n            public void onFailure(Throwable caught) {\r\n                // logger.debug(getClassName() + \": \" +\"saveAdminSettings\");\r\n                new PopupMessageV3(\"Saving administrator settings to the server failed.\");\r\n            }\r\n\r\n            @Override\r\n            public void onSuccess(Void result) {\r\n                // TODO close the tab. Maybe have both a \"save\" button and a \"save and close\" one?\r\n                // TODO This is not urgent as the user can do it manually for now.\r\n            }\r\n        };\r\n        rpcService.saveAdminPassword(oldPassword, newPassword, callback);\r\n    }\r\n\r\n\r\n    /**\r\n     * Creates a form standard field based on the SmartGWT TextItem class.\r\n     * @param name Reference of the field, in the code.\r\n     * @param title Field title, displayed on the interface.\r\n     * @param hint hint to help fill out the field, configured to be displayed inside the field itself\r\n     * @param width desired width of the field, in pixels\r\n     * @return\r\n     */\r\n    private TextItem createField(String name, String title, String hint, int width) {\r\n        TextItem item = new TextItem();\r\n        item.setName(name);\r\n        item.setTitle(title);\r\n        item.setHint(hint);\r\n        item.setShowHintInField(true);\r\n        item.setWidth(width);\r\n        return item;\r\n    }\r\n\r\n    /**\r\n     * Creates a form password field based on the SmartGWT PasswordItem class. The field\'s contents is hidden.\r\n     * @param name the reference of the field, in the code\r\n     * @param title the title of the field, displayed on the interface\r\n     * @param length the length, in characters, of the expected password\r\n     * @return a PasswordItem object, pre-configured\r\n     */\r\n    private PasswordItem createPasswordField(String name, String title, int length){\r\n        PasswordItem item = new PasswordItem(name, title);\r\n        item.setLength(length);\r\n        return item;\r\n    }\r\n\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getAdminTabCode();\r\n    }\r\n}\r\n'),(223,318,'package gov.nist.hit.ds.xdstools3.client.tabs.connectathonTabs;\r\n\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport com.smartgwt.client.widgets.Button;\r\nimport com.smartgwt.client.widgets.Label;\r\nimport com.smartgwt.client.widgets.events.ClickEvent;\r\nimport com.smartgwt.client.widgets.events.ClickHandler;\r\nimport com.smartgwt.client.widgets.form.fields.events.BlurEvent;\r\nimport com.smartgwt.client.widgets.form.fields.events.BlurHandler;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionEvent;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.PatientIDWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.TLSAndSAML.TLSAndSAMLForm;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select.EndpointWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.GenericCloseableToolTab;\r\n\r\npublic abstract class AbstractRegistryAndRepositoryTab extends GenericCloseableToolTab {\r\n    private PatientIDWidget patientIDWidget;\r\n    private EndpointWidget sites;\r\n    private Button runBtn;\r\n\r\n    protected abstract String setHeaderTitle();\r\n    protected abstract void configureEndpoint();\r\n\r\n    protected AbstractRegistryAndRepositoryTab() {\r\n        super(\"\");\r\n        setTitle(setHeaderTitle());\r\n        setHeader(setHeaderTitle());\r\n    }\r\n\r\n\r\n    @Override\r\n    protected Widget createContents() {\r\n        VStack vStack=new VStack();\r\n\r\n        Label l1=createSubtitle1(\"1. Enter Patient ID\");\r\n        patientIDWidget = new PatientIDWidget();\r\n        patientIDWidget.setWidth(400);\r\n\r\n        Label l2=createSubtitle1(\"2. Select Registry\");\r\n        sites = new EndpointWidget();\r\n\r\n        Label l3=createSubtitle1(\"3. Select SAML and TLS options\");\r\n        TLSAndSAMLForm tlsAndSAMLForm=new TLSAndSAMLForm();\r\n\r\n        runBtn=new Button(\"Run\");\r\n        runBtn.disable();\r\n\r\n        vStack.addMembers(l1,patientIDWidget,l2, sites,l3,tlsAndSAMLForm,runBtn);\r\n\r\n        bindUI();\r\n\r\n        return vStack;\r\n    }\r\n\r\n    private void bindUI() {\r\n        patientIDWidget.getField(\"patientID\").addBlurHandler(new BlurHandler() {\r\n            @Override\r\n            public void onBlur(BlurEvent blurEvent) {\r\n                if (patientIDWidget.isPidValueEntered() && sites.isEndpointValueSelected()) {\r\n                    runBtn.enable();\r\n                } else {\r\n                    runBtn.disable();\r\n                }\r\n            }\r\n        });\r\n        sites.addSelectionChangedHandler(new SelectionChangedHandler() {\r\n            @Override\r\n            public void onSelectionChanged(SelectionEvent selectionEvent) {\r\n                if (patientIDWidget.isPidValueEntered() && sites.isEndpointValueSelected()) {\r\n                    runBtn.enable();\r\n                } else {\r\n                    runBtn.disable();\r\n                }\r\n            }\r\n        });\r\n        runBtn.addClickHandler(new ClickHandler() {\r\n            @Override\r\n            public void onClick(ClickEvent clickEvent) {\r\n                // TODO\r\n            }\r\n        });\r\n    }\r\n    protected Button getRunButton(){\r\n        return runBtn;\r\n    }\r\n\r\n    protected PatientIDWidget getPatientIDWidget(){\r\n        return patientIDWidget;\r\n    }\r\n\r\n    protected EndpointWidget getRegistryWidget(){\r\n        return sites;\r\n    }\r\n}\r\n'),(224,319,'package gov.nist.hit.ds.xdstools3.client.tabs.connectathonTabs;\r\n\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\n\r\npublic class FolderValidationTab extends AbstractRegistryAndRepositoryTab {\r\n\r\n    @Override\r\n    protected String setHeaderTitle() {\r\n        return \"Folder Validation\";\r\n    }\r\n\r\n    @Override\r\n    protected void configureEndpoint() {\r\n        // TODO To change when we\'ll know how to configure an EndpointWidget\r\n    }\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getFolderValidationTabCode();\r\n    }\r\n}\r\n'),(225,320,'package gov.nist.hit.ds.xdstools3.client.tabs.connectathonTabs;\r\n\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\n\r\npublic class LifecycleValidationTab extends AbstractRegistryAndRepositoryTab {\r\n    @Override\r\n    protected String setHeaderTitle() {\r\n        return \"Lifecycle Validation\";\r\n    }\r\n\r\n    @Override\r\n    protected void configureEndpoint() {\r\n        // TODO To change when we\'ll know how to configure an EndpointWidget\r\n    }\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getLifecycleValidationTabCode();\r\n    }\r\n}\r\n'),(226,321,'package gov.nist.hit.ds.xdstools3.client.tabs.connectathonTabs;\r\n\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\n\r\npublic class RegisterAndQueryTab extends AbstractRegistryAndRepositoryTab {\r\n\r\n    @Override\r\n    protected String setHeaderTitle() {\r\n        return \"Register And Query\";\r\n    }\r\n\r\n    @Override\r\n    protected void configureEndpoint() {\r\n        // TODO To change when we\'ll know how to configure an EndpointWidget\r\n    }\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getRegisterAndQueryTabCode();\r\n    }\r\n}\r\n'),(227,322,'package gov.nist.hit.ds.xdstools3.client.tabs.connectathonTabs;\r\n\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport com.smartgwt.client.widgets.Button;\r\nimport com.smartgwt.client.widgets.Label;\r\nimport com.smartgwt.client.widgets.events.ClickEvent;\r\nimport com.smartgwt.client.widgets.events.ClickHandler;\r\nimport com.smartgwt.client.widgets.form.DynamicForm;\r\nimport com.smartgwt.client.widgets.form.fields.events.BlurEvent;\r\nimport com.smartgwt.client.widgets.form.fields.events.BlurHandler;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionEvent;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.GenericTextItemWithTooltipWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.GenericCloseableToolTab;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.TLSAndSAML.TLSAndSAMLForm;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select.EndpointWidget;\r\n\r\npublic class SourcesStoresDocumentValidationTab extends GenericCloseableToolTab {\r\n    private final static String header = \"Sources Stores Document Validation\";\r\n    private GenericTextItemWithTooltipWidget subSetUUID;\r\n    private EndpointWidget sites;\r\n    private Button runBtn;\r\n\r\n    public SourcesStoresDocumentValidationTab() {\r\n        super(header);\r\n    }\r\n\r\n    @Override\r\n    protected Widget createContents() {\r\n        VStack vStack=new VStack();\r\n\r\n        Label l1=createSubtitle1(\"1. Enter Submission Set Unique ID or UUID\");\r\n        DynamicForm docEntryUUIDForm = new DynamicForm();\r\n        subSetUUID = new GenericTextItemWithTooltipWidget();\r\n        subSetUUID.setTitle(\"Submission Set UUID or UID\");\r\n        subSetUUID.setWidth(400);\r\n        docEntryUUIDForm.setFields(subSetUUID);\r\n\r\n        Label l2=createSubtitle1(\"2. Select Registry\");\r\n        sites = new EndpointWidget();\r\n\r\n        Label l3=createSubtitle1(\"3. Select SAML and TLS options\");\r\n        TLSAndSAMLForm tlsAndSAMLForm=new TLSAndSAMLForm();\r\n\r\n        runBtn=new Button(\"Run\");\r\n        runBtn.disable();\r\n\r\n        vStack.addMembers(l1,docEntryUUIDForm,l2, sites,l3,tlsAndSAMLForm,runBtn);\r\n\r\n        bindUI();\r\n\r\n        return vStack;\r\n    }\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getSourceStoresDocumentValidationCode();\r\n    }\r\n\r\n    private void bindUI() {\r\n        subSetUUID.addBlurHandler(new BlurHandler() {\r\n            @Override\r\n            public void onBlur(BlurEvent blurEvent) {\r\n                if (!subSetUUID.getValueAsString().isEmpty() && sites.isEndpointValueSelected()){\r\n                    runBtn.enable();\r\n                }else{\r\n                    runBtn.disable();\r\n                }\r\n            }\r\n        });\r\n        sites.addSelectionChangedHandler(new SelectionChangedHandler() {\r\n            @Override\r\n            public void onSelectionChanged(SelectionEvent selectionEvent) {\r\n                if (subSetUUID.getValue() != null && sites.isEndpointValueSelected()) {\r\n                    runBtn.enable();\r\n                } else {\r\n                    runBtn.disable();\r\n                }\r\n            }\r\n        });\r\n        runBtn.addClickHandler(new ClickHandler() {\r\n            @Override\r\n            public void onClick(ClickEvent clickEvent) {\r\n                // TODO\r\n            }\r\n        });\r\n    }\r\n}\r\n'),(228,323,'package gov.nist.hit.ds.xdstools3.client.tabs.connectathonTabs;\r\n\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\n\r\npublic class SubmitRetrieveTab extends AbstractRegistryAndRepositoryTab {\r\n\r\n    @Override\r\n    protected String setHeaderTitle() {\r\n        return \"Submit/Retrieve\";\r\n    }\r\n\r\n    @Override\r\n    protected void configureEndpoint() {\r\n        // TODO To change when we\'ll know how to configure an EndpointWidget\r\n    }\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getSubmitRetrieveTabCode();\r\n    }\r\n}\r\n'),(229,325,'package gov.nist.hit.ds.xdstools3.client.tabs.contactTab;\r\n\r\n\r\nimport com.smartgwt.client.widgets.HTMLFlow;\r\nimport com.smartgwt.client.widgets.Label;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.resources.Resources;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.GenericCloseableTab;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.design.Formatter;\r\n\r\npublic class ContactTab extends GenericCloseableTab {\r\n	static String header = \"Contact us\";\r\n\r\n	public ContactTab() {\r\n		super(header);\r\n\r\n        VStack mainStack = new VStack();\r\n        Label tabHeader = Formatter.createTabHeaderWithoutLeftPadding(header);\r\n        mainStack.addMembers(tabHeader, createHTMLPanel());\r\n        mainStack.setLayoutLeftMargin(50); mainStack.setLayoutRightMargin(50);\r\n        mainStack.setLayoutTopMargin(20); mainStack.setLayoutBottomMargin(20);\r\n        setPane(mainStack);\r\n	}\r\n\r\n    /**\r\n     * Load contents and create HTML panel\r\n     * @return the panel that contains the instructions to the user on the points of contact\r\n     * */\r\n	protected HTMLFlow createHTMLPanel(){\r\n        HTMLFlow htmlFlow = new HTMLFlow();\r\n        htmlFlow.setContents(Resources.INSTANCE.getContactPageContents().getText());\r\n        return htmlFlow;\r\n	}\r\n\r\n\r\n    /**\r\n     * Creates a panel that contains the points of contact displayed as a table\r\n     * @return\r\n     */\r\n   //TODO this was a test and should ultimately be reintegrated or removed. It does not work as is.\r\n    //TODO I am keeping it until I figure out what the best solution is. -Diane\r\n    /*\r\n    protected HStack createContactPanel(){\r\n        HStack hstack = new HStack();\r\n        ListGrid grid = new ListGrid();\r\n        ListGridField questionTypeField = new ListGridField(\"questionType\", \"For questions related to...\");\r\n        ListGridField contactField = new ListGridField(\"contact\", \"Contact\");\r\n        grid.setCanSelectCells(false);\r\n\r\n        // create data\r\n        HashMap<String, String> questionTypeMap = new HashMap<String, String>();\r\n        questionTypeMap.put(\"1\",\"The testing process \\nThe XDS specification\");\r\n        questionTypeField.setValueMap(questionTypeMap);\r\n        HashMap<String, String> contactMap = new HashMap<String, String>();\r\n        contactMap.put(\"1\",\"The testing process \\nThe XDS specification\");\r\n        contactField.setValueMap(contactMap);\r\n        grid.setFields(questionTypeField, contactField);\r\n        grid.setWidth(500);\r\n\r\n        // add to hstack\r\n        hstack.addMember(grid);\r\n        return hstack;\r\n    }*/\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getContactTabCode();\r\n    }\r\n\r\n\r\n}\r\n'),(230,327,'package gov.nist.hit.ds.xdstools3.client.tabs.docEntryEditorTab;\r\n\r\nimport com.smartgwt.client.types.ContentsType;\r\nimport com.smartgwt.client.widgets.HTMLPane;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.GenericCloseableTab;\r\n\r\npublic class DocEntryEditorTab extends GenericCloseableTab {\r\n    static String header = \"Document Metadata Editor\";\r\n\r\n    public DocEntryEditorTab() {\r\n        super(header);\r\n        HTMLPane pane = new HTMLPane();\r\n        pane.setShowEdges(false);\r\n        pane.setContentsURL(\"http://ihexds.nist.gov:12093/docentryeditor-integ/\");\r\n        //http://hit-dev.nist.gov:12090/docentryeditor-integ/ - this URL has a cert issue\r\n        pane.setContentsType(ContentsType.PAGE);\r\n        this.setPane(pane);\r\n    }\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getDocumentMetadataEditorTabCode();\r\n    }\r\n}\r\n'),(231,329,'package gov.nist.hit.ds.xdstools3.client.tabs.findDocumentsTab;\r\n\r\nimport com.google.gwt.core.client.GWT;\r\nimport com.google.gwt.user.client.rpc.AsyncCallback;\r\nimport com.smartgwt.client.widgets.Label;\r\nimport com.smartgwt.client.widgets.events.ClickEvent;\r\nimport com.smartgwt.client.widgets.events.ClickHandler;\r\nimport com.smartgwt.client.widgets.form.DynamicForm;\r\nimport com.smartgwt.client.widgets.form.events.ItemChangedEvent;\r\nimport com.smartgwt.client.widgets.form.events.ItemChangedHandler;\r\nimport com.smartgwt.client.widgets.form.fields.CheckboxItem;\r\nimport com.smartgwt.client.widgets.form.fields.SpacerItem;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionEvent;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\nimport gov.nist.hit.ds.repository.shared.data.AssetNode;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.PatientIDWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.TLSAndSAML.SAMLComboBox;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.TLSAndSAML.TLSCheckbox;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.buttons.GenericRunButtonNoForm;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select.EndpointWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.exceptions.ToolkitServerError;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.GenericCloseableToolTab;\r\n\r\nimport java.util.logging.Logger;\r\n\r\n\r\npublic class FindDocumentTab extends GenericCloseableToolTab {\r\n    private Logger logger = Logger.getLogger(FindDocumentTab.class.getName());\r\n\r\n    static String header = \"Find Documents\";\r\n\r\n    // Global class fields\r\n    PatientIDWidget pid;\r\n    EndpointWidget endpoints;\r\n    GenericRunButtonNoForm runButton;\r\n    TLSCheckbox tls;\r\n    SAMLComboBox saml;\r\n    CheckboxItem includeOnDemand;\r\n\r\n    // RPC services declaration\r\n    private final static FindDocumentTabServicesAsync findDocumentService = GWT\r\n            .create(FindDocumentTabServices.class);\r\n\r\n\r\n\r\n    public FindDocumentTab() {\r\n        super(header);\r\n    }\r\n\r\n    /**\r\n     * Creates and sets the contents of the FindDocuments Tab\r\n     */\r\n    @Override\r\n    protected VStack createContents(){\r\n\r\n        // layout\r\n        final VStack findDocsPanel = new VStack();\r\n\r\n        // create components\r\n        Label l1 = createSubtitle1(\"Step 1: Enter Patient ID\");\r\n        pid = new PatientIDWidget();\r\n\r\n        Label l2 = createSubtitle1(\"Step 2: Select TLS / SAML / On-Demand options\");\r\n        tls = new TLSCheckbox(); tls.setEndRow(true);\r\n        saml = new SAMLComboBox(); saml.setEndRow(true);\r\n        includeOnDemand = new CheckboxItem(\"includeOnDemand\");\r\n        includeOnDemand.setTitle(\"Include On-Demand document entries\");\r\n        SpacerItem space = new SpacerItem();\r\n        DynamicForm options = new DynamicForm();\r\n        options.setFields(tls, space, saml, includeOnDemand);\r\n        options.setCellPadding(10);\r\n\r\n        Label l3 = createSubtitle1(\"Step 3: Select Endpoint\");\r\n        endpoints = new EndpointWidget();\r\n\r\n        runButton = new GenericRunButtonNoForm();\r\n\r\n        // Add to layout\r\n        findDocsPanel.addMembers(l1, pid, l2, options, l3, endpoints, runButton);\r\n\r\n\r\n\r\n        // -------------- Add listeners --------------\r\n\r\n        // Enable Run button if all fields were filled out\r\n        pid.addItemChangedHandler(new ItemChangedHandler() {\r\n            @Override\r\n            public void onItemChanged(ItemChangedEvent itemChangedEvent) {\r\n                checkFieldsAndEnableRunButton();\r\n            }\r\n        });\r\n\r\n        // Enable Run button if all fields were filled out\r\n        endpoints.addSelectionChangedHandler(new SelectionChangedHandler() {\r\n            @Override\r\n            public void onSelectionChanged(SelectionEvent selectionEvent) {\r\n                checkFieldsAndEnableRunButton();\r\n            }\r\n        });\r\n\r\n        // Runs the query if all fields are filled out\r\n        runButton.addClickHandler(new ClickHandler() {\r\n            public void onClick(ClickEvent event) {\r\n                    runQuery();\r\n            }\r\n        });\r\n        return findDocsPanel;\r\n    }\r\n\r\n    /**\r\n     * Utility function that checks if all fields are filled out before enabling the Run button\r\n     */\r\n    private void checkFieldsAndEnableRunButton() {\r\n        if (pid.isPidValueEntered() && endpoints.isEndpointValueSelected()) {\r\n            runButton.enable();\r\n        }\r\n        if (!pid.isPidValueEntered() || !endpoints.isEndpointValueSelected()) {\r\n            runButton.disable();\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Runs a Find Document query through RPC\r\n     */\r\n    private void runQuery(){\r\n        try {\r\n            // TODO SAML is not implemented\r\n            // TODO not sure what the endpoints ID is returning\r\n                                                // pid.getValue(), tls, saml, onDemand, endpointID,\r\n            findDocumentService.findDocuments(pid.getValue(), tls.getValueAsBoolean(), false, includeOnDemand.getValueAsBoolean(),\r\n                    endpoints.getID(), new AsyncCallback<AssetNode>() {\r\n                @Override\r\n                public void onFailure(Throwable caught) {\r\n                    logger.warning(caught.getMessage());\r\n                }\r\n\r\n                @Override\r\n                public void onSuccess(AssetNode assetNode) {\r\n\r\n                    displayValidationResults(assetNode);\r\n                }\r\n            });\r\n        } catch (ToolkitServerError toolkitServerError) {\r\n            toolkitServerError.printStackTrace();\r\n            // TODO display error message to user\r\n        }\r\n    }\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getFindDocumentsTabCode();\r\n    }\r\n\r\n}\r\n'),(232,330,'package gov.nist.hit.ds.xdstools3.client.tabs.findDocumentsTab;\n\n\nimport com.google.gwt.user.client.rpc.RemoteService;\nimport com.google.gwt.user.client.rpc.RemoteServiceRelativePath;\nimport gov.nist.hit.ds.repository.shared.data.AssetNode;\nimport gov.nist.hit.ds.xdstools3.client.exceptions.ToolkitServerError;\n\n/**\n * RPC services for Find Document validation\n */\n@RemoteServiceRelativePath(\"finddocument-tab\")\npublic interface FindDocumentTabServices extends RemoteService  {\n\n    public AssetNode findDocuments(String pid, boolean tls, boolean saml, boolean onDemand, String endpointID) throws ToolkitServerError;\n\n}\n'),(233,331,'package gov.nist.hit.ds.xdstools3.client.tabs.findDocumentsTab;\n\nimport com.google.gwt.user.client.rpc.AsyncCallback;\nimport gov.nist.hit.ds.repository.shared.data.AssetNode;\nimport gov.nist.hit.ds.xdstools3.client.exceptions.ToolkitServerError;\n\n/**\n * Asynchronous interface to call the RPC Services for mhd validation.\n */\npublic interface FindDocumentTabServicesAsync {\n\n    void findDocuments(String pid, boolean tls, boolean saml, boolean onDemand, String endpointID, AsyncCallback<AssetNode> async) throws ToolkitServerError;\n\n}\n'),(234,333,'package gov.nist.hit.ds.xdstools3.client.tabs.homeTab;\r\n\r\nimport com.smartgwt.client.types.VerticalAlignment;\r\nimport com.smartgwt.client.widgets.Label;\r\nimport com.smartgwt.client.widgets.layout.HStack;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.design.IconLabel;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.design.Formatter;\r\n\r\n/**\r\n * Formatted box that displays a title with optional icon, and a list of links as buttons.\r\n */\r\npublic class HomeBox extends VStack {\r\n    IconLabel title;\r\n\r\n    public HomeBox(String _title){\r\n        super();\r\n        this.setStyleName(\"home-box\");\r\n        title = Formatter.createHomeSubtitle(_title);\r\n        addMember(title);\r\n    }\r\n\r\n    /**\r\n     * Sets an icon before a label title. This function encapsulates an existing Smartgwt function adding an icon to a Label.\r\n     * @param path The path of the icon. Must be relative to webapp/images.\r\n     */\r\n    public void setIcon(String path){\r\n        title.setIcon(path);\r\n    }\r\n\r\n    /**\r\n     * Creates a new HomeLinkButton item and adds it to the container. If the tab is labeled as being under construction,\r\n     * the item added will include an \"Under construction\" label, displayed inline, positioned to the right of the item.\r\n     * @param item_title The title of the button.\r\n     * @param isUnderConstruction Boolean indicating whether the tab being linked to is under construction.\r\n     * @see HomeLinkButton\r\n     */\r\n    public void addItem(String item_title, boolean isUnderConstruction){\r\n        HomeLinkButton button = new HomeLinkButton(item_title);\r\n        button.setBaseStyle(\"home-button\");\r\n\r\n        if (isUnderConstruction){\r\n            Label underConstructionLabel = new Label(\"Under construction\");\r\n            underConstructionLabel.setWidth(150);\r\n            underConstructionLabel.setLayoutAlign(VerticalAlignment.CENTER);\r\n            underConstructionLabel.setStyleName(\"under-construction-label\");\r\n            button.setWidth(280);\r\n            HStack stack = new HStack();\r\n            stack.setAutoHeight();\r\n            stack.addMembers(button, underConstructionLabel);\r\n            addMember(stack);\r\n        } else {\r\n            addMember(button);\r\n            button.setWidth(420);\r\n        }\r\n    }\r\n\r\n}\r\n'),(235,334,'package gov.nist.hit.ds.xdstools3.client.tabs.homeTab;\r\n\r\nimport com.google.gwt.place.shared.PlaceController;\r\nimport com.smartgwt.client.types.Alignment;\r\nimport com.smartgwt.client.util.SC;\r\nimport com.smartgwt.client.widgets.IButton;\r\nimport com.smartgwt.client.widgets.events.ClickEvent;\r\nimport com.smartgwt.client.widgets.events.ClickHandler;\r\nimport gov.nist.hit.ds.xdstools3.client.activitiesAndPlaces.TabPlace;\r\nimport gov.nist.hit.ds.xdstools3.client.util.injection.Xdstools3GinInjector;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\n\r\n/**\r\n * Creates a button with the title passed in argument. Also creates a listener which fires an event through Eventbus,\r\n * opening the tab that matches the title parameter.\r\n */\r\npublic class HomeLinkButton extends IButton {\r\n\r\n    PlaceController placeController = Xdstools3GinInjector.injector.getPlaceController();\r\n    private final String title;\r\n\r\n    public HomeLinkButton(String _title){\r\n        title = _title;\r\n        setTitle(title);\r\n        setAlign(Alignment.LEFT);\r\n\r\n        // for some reason, setting these properties in the CSS does not override SmartGWT defaults\r\n        setBorder(\"0\");\r\n        setHeight(20);\r\n\r\n        bindUI();\r\n    }\r\n\r\n    private void bindUI() {\r\n        // go to a new TabPlace on home\'s button click\r\n        addClickHandler(new ClickHandler() {\r\n            public void onClick(ClickEvent event) {\r\n                // FIXME unsafe code if refactored\r\n                if (title == \"Find Documents\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getFindDocumentsTabCode()));\r\n//                    Util.EVENT_BUS.fireEvent(new OpenTabEvent(TabNamesUtil.getInstance().getFindDocumentsTabCode()));\r\n                else if (title == \"MPQ Find Documents\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getMpqFindDocumentsTabCode()));\r\n                else if (title == \"Message Validator\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getMessageValidatorTabCode()));\r\n                else if (title == \"Document Metadata Editor\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getDocumentMetadataEditorTabCode()));\r\n                else if (title == \"Pre-Connectathon Tests\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getPreConnectathonTestsTabCode()));\r\n                else if (title == \"Get Documents\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getGetDocumentsTabCode()));\r\n                else if (title == \"Find Folders\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getFindFoldersCode()));\r\n                else if (title == \"Get Folders\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getGetFoldersTabCode()));\r\n                else if (title == \"Get Folder and Contents\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getGetFoldersAndContentsCode()));\r\n                else if (title == \"Retrieve Document\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getRetrieveDocumentTabCode()));\r\n                else if (title == \"Get Submission Set and Contents\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getGetSubmissionSetAndContentsTabCode()));\r\n                else if (title == \"Get Related Documents\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getGetRelatedDocumentsCode()));\r\n                else if (title == \"XDS.b Doc Source Stores Document\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getSourceStoresDocumentValidationCode()));\r\n                else if (title == \"XDS.b Registry Do This First\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getRegisterAndQueryTabCode()));\r\n                else if (title == \"XDS.b Lifecycle\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getLifecycleValidationTabCode()));\r\n                else if (title == \"XDS.b Registry Folder Handling\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getFolderValidationTabCode()));\r\n                else if (title == \"v2 Tab Example\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getv2TabCode()));\r\n                else if (title == \"XDS.b Repository Do This First\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getSubmitRetrieveTabCode()));\r\n                else if (title == \"MHD Validator\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getMHDValidatorTabCode()));\r\n                else if (title == \"Submit Test Data\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getTestDataSubmissionTabCode()));\r\n                else if (title == \"MHD to XDS Converter\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getMhdtoXdsConverterTabCode()));\r\n                else if (title == \"Query - Retrieve - Submit\")\r\n                    placeController.goTo(new TabPlace(TabNamesManager.getInstance().getQRSCombinedTabCode()));\r\n                else SC.say(\"A link is missing. Please contact the support team.\");\r\n            }\r\n        });\r\n    }\r\n}\r\n'),(236,335,'package gov.nist.hit.ds.xdstools3.client.tabs.homeTab;\r\n\r\n\r\nimport com.smartgwt.client.types.Alignment;\r\nimport com.smartgwt.client.widgets.layout.HStack;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.GenericTab;\r\n\r\npublic class HomeTab extends GenericTab {\r\n\r\n    public HomeTab(String s) {\r\n        super(s);\r\n        setPane(createContents());\r\n    }\r\n\r\n    protected HStack createContents(){\r\n\r\n        HomeBox queriesAndRetrieves = new HomeBox(\"Queries and Retrieves\");\r\n       /* queriesAndRetrieves.setIcon(\"icons/glyphicons/glyphicons_027_search.png\");\r\n        queriesAndRetrieves.addItem(\"Find Documents\", true);\r\n        queriesAndRetrieves.addItem(\"MPQ Find Documents\", true);\r\n        queriesAndRetrieves.addItem(\"Get Documents\", true);\r\n        queriesAndRetrieves.addItem(\"Get Related Documents\", true);\r\n        queriesAndRetrieves.addItem(\"Retrieve Document\", true);\r\n        queriesAndRetrieves.addItem(\"Find Folders\", true);\r\n        queriesAndRetrieves.addItem(\"Get Folders\", true);\r\n        queriesAndRetrieves.addItem(\"Get Folder and Contents\", true);\r\n        queriesAndRetrieves.addItem(\"Get Submission Set and Contents\", true); */\r\n        queriesAndRetrieves.addItem(\"Query - Retrieve - Submit\", true);\r\n\r\n\r\n        HomeBox tools = new HomeBox(\"Tools\");\r\n        tools.setIcon(\"icons/glyphicons/glyphicons_280_settings.png\");\r\n        tools.addItem(\"Message Validator\", true);\r\n        tools.addItem(\"Document Metadata Editor\", false);\r\n        tools.addItem(\"Pre-Connectathon Tests\", true);\r\n\r\n        HomeBox sendTestData = new HomeBox(\"Send Test Data\");\r\n        sendTestData.setIcon(\"icons/glyphicons/glyphicons_123_message_out.png\");\r\n        sendTestData.addItem(\"Submit Test Data\", true);\r\n\r\n        HomeBox simulators = new HomeBox(\"Simulators\");\r\n        simulators.setIcon(\"icons/glyphicons/glyphicons_086_display.png\");\r\n\r\n        HomeBox mhdTools = new HomeBox(\"MHD Tools\");\r\n        mhdTools.setIcon(\"icons/glyphicons/glyphicons_280_settings.png\");\r\n        mhdTools.addItem(\"MHD Validator\", false);\r\n        //mhdTools.addItem(\"MHD to XDS Converter\", true);\r\n\r\n        HomeBox connectathonTools = new HomeBox(\"Connectathon Tools\");\r\n        connectathonTools.setIcon(\"icons/glyphicons/glyphicons_280_settings.png\");\r\n        // Connectathon Validations\r\n        connectathonTools.addItem(\"XDS.b Doc Source Stores Document\", true);\r\n        // Registry Validations\r\n        connectathonTools.addItem(\"XDS.b Registry Do This First\", true);\r\n        connectathonTools.addItem(\"XDS.b Lifecycle\", true);\r\n        connectathonTools.addItem(\"XDS.b Registry Folder Handling\", true);\r\n        // Repository Validations\r\n        connectathonTools.addItem(\"XDS.b Repository Do This First\", true);\r\n\r\n        VStack vstack1 = new VStack();\r\n        VStack vstack2 = new VStack();\r\n        vstack1.addMembers(mhdTools, queriesAndRetrieves, connectathonTools);\r\n        vstack2.addMembers(tools, sendTestData, simulators);\r\n\r\n        HStack hstack = new HStack();\r\n        hstack.addMembers(vstack1, vstack2);\r\n        hstack.setAlign(Alignment.CENTER);\r\n        hstack.setLayoutTopMargin(20);\r\n        return hstack;\r\n    }\r\n\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getHomeTabCode();\r\n    }\r\n\r\n\r\n}\r\n'),(237,337,'package gov.nist.hit.ds.xdstools3.client.tabs.logBrowserTab;\r\n\r\nimport com.google.gwt.dom.client.Style;\r\nimport com.google.gwt.user.client.Window;\r\nimport com.google.gwt.user.client.ui.HTML;\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport com.smartgwt.client.widgets.Canvas;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\nimport gov.nist.hit.ds.repository.rpc.search.client.exception.RepositoryConfigException;\r\nimport gov.nist.hit.ds.repository.shared.data.AssetNode;\r\nimport gov.nist.hit.ds.repository.ui.client.widgets.LogBrowserWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.Manager;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.GenericCloseableTab;\r\n\r\nimport java.util.logging.Logger;\r\n\r\n/**\r\n * This class is for the UI tab that hosts a log browser widget.\r\n */\r\npublic class LogBrowserTab extends GenericCloseableTab {\r\n    private Logger logger=Logger.getLogger(LogBrowserTab.class.getName());\r\n    // RPC services declaration\r\n    // --\r\n\r\n    // tab\'s title and header\r\n    private static String header=\"Log Browser\";\r\n\r\n    // UI components\r\n    // --\r\n\r\n    // Variables\r\n    // --\r\n\r\n\r\n\r\n    private AssetNode target;\r\n\r\n    /**\r\n     * Default constructor\r\n     */\r\n    public LogBrowserTab() {\r\n        super(header);\r\n        try {\r\n            getPane().addChild(createContent(null));\r\n        } catch (Throwable t) {\r\n            t.printStackTrace();\r\n        }\r\n\r\n    }\r\n\r\n    /**\r\n     * This constructor is target assetNode context specific\r\n     * @param target The target asset to focus on\r\n     */\r\n    public LogBrowserTab(AssetNode target) {\r\n        super(header);\r\n\r\n        try {\r\n            setPane((Canvas) createContent(target));\r\n\r\n        } catch (Throwable t) {\r\n            t.printStackTrace();\r\n        }\r\n\r\n    }\r\n\r\n\r\n    /**\r\n     * Abstract method implementation that build the UI.\r\n     *\r\n     * @return tab UI as a Widget\r\n     */\r\n    protected Widget createContents() {\r\n        Widget w = new HTML(\"\");\r\n        w.setSize(\"1px\",\"1px\");\r\n        w.getElement().getStyle().setDisplay(Style.Display.NONE);\r\n        w.getElement().getStyle().setVisibility(Style.Visibility.HIDDEN);\r\n\r\n       return w; // This is a placeholder\r\n    }\r\n\r\n\r\n\r\n    /**\r\n     * Creates tab content\r\n     * @return\r\n     */\r\n    private Widget createContent(AssetNode target) {\r\n        VStack vStack=new VStack();\r\n\r\n\r\n        try {\r\n            LogBrowserWidget logBrowserWidget = null;\r\n            if (target!=null) {\r\n                // This is target assetNode specific\r\n                logBrowserWidget = new LogBrowserWidget(Manager.EVENT_BUS,target);\r\n\r\n            } else {\r\n                // Normal browse mode\r\n                try {\r\n                    logBrowserWidget = new LogBrowserWidget(Manager.EVENT_BUS,\r\n                            new LogBrowserWidget.Feature[] {\r\n                                    LogBrowserWidget.Feature.BROWSE\r\n                            });\r\n\r\n                } catch (RepositoryConfigException e) {\r\n                    Window.alert(\"Could not initialize log browser widget: \" + e.toString());\r\n                }\r\n            }\r\n\r\n            logBrowserWidget.setSize(\"1170px\", \"600px\");\r\n\r\n            vStack.addMember(logBrowserWidget);\r\n        } catch (Throwable t) {\r\n            t.printStackTrace();\r\n        }\r\n\r\n        bindUI();\r\n\r\n        return vStack;\r\n    }\r\n\r\n    /**\r\n     * Abstract method implementation to set the tab name\r\n     * @return\r\n     */\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getMHDValidatorTabCode();\r\n    }\r\n\r\n    /**\r\n     * Method that binds the tab widgets together and their functionality\r\n     */\r\n    private void bindUI(){\r\n       // Add event handlers\r\n    }\r\n\r\n\r\n    public AssetNode getTarget() {\r\n        return target;\r\n    }\r\n\r\n    public void setTarget(AssetNode target) {\r\n        this.target = target;\r\n    }\r\n\r\n\r\n\r\n\r\n}\r\n'),(238,339,'package gov.nist.hit.ds.xdstools3.client.tabs.mhdTabs;\n\n\nimport com.google.gwt.user.client.rpc.RemoteService;\nimport com.google.gwt.user.client.rpc.RemoteServiceRelativePath;\nimport gov.nist.hit.ds.repository.shared.data.AssetNode;\nimport gov.nist.hit.ds.xdstools3.client.exceptions.ToolkitServerError;\n\n/**\n * RPC services for mhd validation\n */\n@RemoteServiceRelativePath(\"mhd-tabs\")\npublic interface MHDTabsServices extends RemoteService  {\n\n    public AssetNode validateMHDMessage(String messageType) throws ToolkitServerError;\n\n    public AssetNode convertMHDToXDS();\n}\n'),(239,340,'package gov.nist.hit.ds.xdstools3.client.tabs.mhdTabs;\n\nimport com.google.gwt.user.client.rpc.AsyncCallback;\nimport gov.nist.hit.ds.repository.api.Asset;\nimport gov.nist.hit.ds.repository.shared.data.AssetNode;\nimport gov.nist.hit.ds.xdstools3.client.exceptions.ToolkitServerError;\n\n/**\n * Asynchronous interface to call the RPC Services for mhd validation.\n */\npublic interface MHDTabsServicesAsync {\n    void validateMHDMessage(String messageType, AsyncCallback<AssetNode> async) throws ToolkitServerError;\n\n    void convertMHDToXDS(AsyncCallback<AssetNode> convertedDocument);\n}\n'),(240,341,'package gov.nist.hit.ds.xdstools3.client.tabs.mhdTabs;\r\n\r\nimport com.google.gwt.core.client.GWT;\r\nimport com.google.gwt.user.client.rpc.AsyncCallback;\r\nimport com.google.gwt.user.client.ui.FileUpload;\r\nimport com.google.gwt.user.client.ui.FormPanel;\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport com.smartgwt.client.util.SC;\r\nimport com.smartgwt.client.widgets.Button;\r\nimport com.smartgwt.client.widgets.events.ClickEvent;\r\nimport com.smartgwt.client.widgets.events.ClickHandler;\r\nimport com.smartgwt.client.widgets.form.fields.HeaderItem;\r\nimport com.smartgwt.client.widgets.form.fields.SelectItem;\r\nimport com.smartgwt.client.widgets.form.fields.events.ChangeEvent;\r\nimport com.smartgwt.client.widgets.form.fields.events.ChangeHandler;\r\nimport com.smartgwt.client.widgets.layout.VLayout;\r\nimport gov.nist.hit.ds.repository.shared.data.AssetNode;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.buttons.GenericRunButtonNoForm;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.forms.GenericForm;\r\nimport gov.nist.hit.ds.xdstools3.client.exceptions.ToolkitServerError;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.resources.Resources;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.GenericCloseableToolTab;\r\n\r\nimport java.util.LinkedHashMap;\r\nimport java.util.logging.Logger;\r\n\r\n/**\r\n * This class is the UI implementation for the MHD Validator tab.\r\n * @author oherrmann\r\n */\r\npublic class MHDValidatorTab extends GenericCloseableToolTab {\r\n    private Logger logger = Logger.getLogger(MHDValidatorTab.class.getName());\r\n\r\n    // RPC services declaration\r\n    private final static MHDTabsServicesAsync mhdToolkitService = GWT\r\n            .create(MHDTabsServices.class);\r\n\r\n    private static String header=\"MHD Validator\";\r\n\r\n    // UI components\r\n    private FormPanel uploadForm;\r\n    private SelectItem messageTypeSelect;\r\n    private FileUpload fileUploadItem;\r\n    private Button runBtn;\r\n    private VLayout container;\r\n    // Variables\r\n    private String selectedMessageType;\r\n\r\n    /**\r\n     * Default constuctor\r\n     */\r\n    public MHDValidatorTab() {\r\n        super(header);\r\n        getContentsPanel().setWidth(440);\r\n    }\r\n\r\n    /**\r\n     * Abstract method implementation that build the UI.\r\n     *\r\n     * @return tab UI as a Widget\r\n     */\r\n    @Override\r\n    protected Widget createContents() {\r\n        container = new VLayout();\r\n\r\n        // Message type transactions\r\n        HeaderItem messageTypeLabel = new HeaderItem();\r\n        messageTypeLabel.setDefaultValue(\"1. Select the type of MHD message to validate\");\r\n        messageTypeSelect = new SelectItem();\r\n        messageTypeSelect.setShowTitle(false);\r\n        messageTypeSelect.setType(\"comboBox\");\r\n        messageTypeSelect.setName(\"messageTypeItem\");\r\n        messageTypeSelect.setEmptyDisplayValue(\"Select message type...\");\r\n        messageTypeSelect.setWidth(400);\r\n        loadMessageTypesMap();\r\n\r\n        // Uploader\r\n        HeaderItem uploadLabel=new HeaderItem();\r\n        uploadLabel.setDefaultValue(\"2. Upload file\");\r\n        uploadForm = new FormPanel();\r\n        uploadForm.setHeight(\"40px\");\r\n        uploadForm.setMethod(FormPanel.METHOD_POST);\r\n        uploadForm.setEncoding(FormPanel.ENCODING_MULTIPART);\r\n        uploadForm.setAction(\"fileUploadServlet\");\r\n        uploadForm.setStyleName(\"gwt-form-margin\");\r\n        fileUploadItem = new FileUpload();\r\n        fileUploadItem.setName(\"upload1FormElement\");\r\n        fileUploadItem.setWidth(\"400px\");\r\n        uploadForm.add(fileUploadItem);\r\n\r\n        // ------- Create the first form ------\r\n        GenericForm form = new GenericForm();\r\n        form.setFields(messageTypeLabel, messageTypeSelect, uploadLabel);\r\n\r\n        // Run button\r\n        runBtn = new GenericRunButtonNoForm();\r\n\r\n        // Create Help Link and populates it with text from resources\r\n        setHelpButton(getHelpPanel(), Resources.INSTANCE.getMHDValidatorHelpContents().getText());\r\n\r\n\r\n        // Layout\r\n        container.addMembers(form);\r\n        container.addMember(uploadForm);\r\n        container.addMember(runBtn);\r\n        container.addMember(waitPanel);\r\n        container.hideMember(waitPanel);\r\n\r\n        bindUI();\r\n\r\n        return container;\r\n    }\r\n\r\n    /**\r\n     * Abstract method implementation to set the tab name\r\n     * @return\r\n     */\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getMHDValidatorTabCode();\r\n    }\r\n\r\n    /**\r\n     * Method that binds the tab widgets together and their functionality\r\n     */\r\n    private void bindUI(){\r\n        messageTypeSelect.addChangeHandler(new ChangeHandler() {\r\n            @Override\r\n            public void onChange(ChangeEvent changeEvent) {\r\n                selectedMessageType = (String) changeEvent.getValue();\r\n                if (selectedMessageType != null) {\r\n                    if (fileUploadItem.getFilename() != null && !fileUploadItem.getFilename().isEmpty()) {\r\n                        runBtn.enable();\r\n                    }\r\n                }\r\n            }\r\n        });\r\n        fileUploadItem.addChangeHandler(new com.google.gwt.event.dom.client.ChangeHandler() {\r\n            @Override\r\n            public void onChange(com.google.gwt.event.dom.client.ChangeEvent event) {\r\n                if (fileUploadItem.getFilename() != null && !fileUploadItem.getFilename().isEmpty()) {\r\n                    if (selectedMessageType != null && !selectedMessageType.isEmpty()) {\r\n                        if (fileUploadItem.getFilename().endsWith(\".xml\") || fileUploadItem.getFilename().endsWith(\".json\")) {\r\n                            runBtn.enable();\r\n                        } else {\r\n                            runBtn.disable();\r\n                            SC.warn(\"Invalid file format. The uploaded file must be XML or JSON.\");\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        });\r\n        // Click handler on run button\r\n        runBtn.addClickHandler(new ClickHandler() {\r\n            @Override\r\n            public void onClick(ClickEvent clickEvent) {\r\n                // submit the form information to the UploadServlet (for file upload)\r\n                uploadForm.submit();\r\n            }\r\n        });\r\n        uploadForm.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() {\r\n            @Override\r\n            public void onSubmitComplete(FormPanel.SubmitCompleteEvent event) {\r\n//                waitPanel.show();\r\n                container.showMember(waitPanel);\r\n                // call for validation\r\n                validate();\r\n            }\r\n        });\r\n    }\r\n\r\n    /**\r\n     * Calls the MHD validation service\r\n     */\r\n    private void validate() {\r\n        try {\r\n            mhdToolkitService.validateMHDMessage(selectedMessageType, new AsyncCallback<AssetNode>() {\r\n                @Override\r\n                public void onFailure(Throwable caught) {\r\n                    logger.warning(caught.getMessage());\r\n                }\r\n\r\n                @Override\r\n                public void onSuccess(AssetNode assetNode) {\r\n                    displayValidationResults(assetNode);\r\n                }\r\n            });\r\n        } catch (ToolkitServerError toolkitServerError) {\r\n            toolkitServerError.printStackTrace();\r\n            // TODO display error message to user\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Method loading possible values for message type.\r\n     */\r\n    private void loadMessageTypesMap() {\r\n        LinkedHashMap<String,String> map=new LinkedHashMap<String,String>();\r\n        map.put(\"sbmt\", \"Submit\");\r\n        map.put(\"sbmt_resp\",\"Submit Response - not implemented yet\");\r\n        messageTypeSelect.setValueMap(map);\r\n        messageTypeSelect.setDefaultValue(\"sbmt\");\r\n        selectedMessageType=\"sbmt\";\r\n    }\r\n\r\n\r\n}\r\n'),(241,342,'package gov.nist.hit.ds.xdstools3.client.tabs.mhdTabs;\r\n\r\nimport com.google.gwt.core.client.GWT;\r\nimport com.google.gwt.event.dom.client.ChangeEvent;\r\nimport com.google.gwt.event.dom.client.ChangeHandler;\r\nimport com.google.gwt.user.client.Window;\r\nimport com.google.gwt.user.client.rpc.AsyncCallback;\r\nimport com.google.gwt.user.client.ui.FileUpload;\r\nimport com.google.gwt.user.client.ui.FormPanel;\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport com.smartgwt.client.util.SC;\r\nimport com.smartgwt.client.widgets.Button;\r\nimport com.smartgwt.client.widgets.events.ClickEvent;\r\nimport com.smartgwt.client.widgets.events.ClickHandler;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\nimport gov.nist.hit.ds.repository.shared.data.AssetNode;\r\nimport gov.nist.hit.ds.repository.ui.client.widgets.EventAggregatorWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.Manager;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.GenericCloseableToolTab;\r\n\r\nimport java.util.logging.Logger;\r\n\r\n/**\r\n * Tab to handle a file conversion from mhd to xds\r\n */\r\npublic class MhdToXdsConverterTab extends GenericCloseableToolTab {\r\n    private Logger logger=Logger.getLogger(MhdToXdsConverterTab.class.getName());\r\n    private EventAggregatorWidget eventMessageAggregatorWidget;\r\n\r\n    // RPC services declaration\r\n    private final static MHDTabsServicesAsync mhdToolkitService = GWT\r\n            .create(MHDTabsServices.class);\r\n\r\n    // tab title and header\r\n    private static final String header=\"MHD to XDS Converter\";\r\n\r\n    // UI components\r\n    private FormPanel uploadForm;\r\n    private FileUpload fileUploadItem;\r\n    private Button runBtn;\r\n\r\n    public MhdToXdsConverterTab() {\r\n        super(header);\r\n        bindUI();\r\n    }\r\n\r\n    /**\r\n     * Implementation of the abstract method that build the UI.\r\n     *\r\n     * @return The UI as a Widget\r\n     */\r\n    @Override\r\n    protected Widget createContents() {\r\n        VStack vStack=new VStack();\r\n\r\n        uploadForm = new FormPanel();\r\n        uploadForm.setMethod(FormPanel.METHOD_POST);\r\n        uploadForm.setEncoding(FormPanel.ENCODING_MULTIPART);\r\n        uploadForm.setAction(\"fileUploadServlet\");\r\n        uploadForm.setStyleName(\"gwt-form-margin\");\r\n\r\n        fileUploadItem = new FileUpload();\r\n        fileUploadItem.setTitle(\"File to convert\");\r\n        fileUploadItem.setName(\"upload1FormElement\");\r\n        fileUploadItem.setWidth(\"600px\");\r\n\r\n        uploadForm.add(fileUploadItem);\r\n\r\n        runBtn=new Button(\"Convert\");\r\n        runBtn.disable();\r\n\r\n        vStack.addMember(createSubtitle1(\"Select MHD file to convert\"));\r\n        vStack.addMember(uploadForm);\r\n        vStack.addMember(runBtn);\r\n\r\n//        vStack.addMember(waitPanel);\r\n\r\n        // Event summary widget parameters\r\n        String id = \"f721daed-d17c-4109-b2ad-c1e4a8293281\"; // \"052c21b6-18c2-48cf-a3a7-f371d6dd6caf\";\r\n        String type = \"validators\";\r\n        String[] displayColumns = new String[]{\"ID\",\"STATUS\",\"MSG\"};\r\n\r\n        vStack.addMember(setupEventMessagesWidget(EventAggregatorWidget.ASSET_CLICK_EVENT.OUT_OF_CONTEXT, \"Sim\", id, type, displayColumns));\r\n\r\n        return vStack;\r\n    }\r\n\r\n    /**\r\n     * Method that bind the UI widgets together and call for distant services\r\n     */\r\n    private void bindUI(){\r\n        // change handler on the file selector to enable the run button when a file is selected\r\n        fileUploadItem.addChangeHandler(new ChangeHandler() {\r\n            @Override\r\n            public void onChange(ChangeEvent changeEvent) {\r\n                if (fileUploadItem.getFilename() != null && !fileUploadItem.getFilename().isEmpty()) {\r\n                    if(fileUploadItem.getFilename().endsWith(\".xml\") || fileUploadItem.getFilename().endsWith(\".json\")) {\r\n                        runBtn.enable();\r\n                    }else{\r\n                        runBtn.disable();\r\n                        SC.warn(\"Invalid file format - must be xml or json\");\r\n                    }\r\n                }\r\n            }\r\n        });\r\n        // click handler on the run button which calls the server file upload servlet to save the file\r\n        runBtn.addClickHandler(new ClickHandler() {\r\n            @Override\r\n            public void onClick(ClickEvent clickEvent) {\r\n//                waitPanel.show();\r\n                uploadForm.submit();\r\n            }\r\n        });\r\n        // submit complete handler that assures the upload is done\r\n        uploadForm.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() {\r\n            @Override\r\n            public void onSubmitComplete(FormPanel.SubmitCompleteEvent submitCompleteEvent) {\r\n                // call for the distant method that converts the mhd file to an xds file\r\n                mhdToolkitService.convertMHDToXDS(new AsyncCallback<AssetNode>() {\r\n\r\n                    @Override\r\n                    public void onFailure(Throwable e) {\r\n                        logger.warning(\"Error: \" + e.getMessage());\r\n                    }\r\n\r\n                    @Override\r\n                    public void onSuccess(AssetNode response) {\r\n                        // Open the converted file saved on the server in a new Window\r\n//                        Window.open(GWT.getHostPageBaseURL() + \"files/\" + response, response + \"Converted File\", \"enabled\");\r\n                        eventMessageAggregatorWidget.setEventAssetNode(response);\r\n//                        waitPanel.hide();\r\n                    }\r\n                });\r\n            }\r\n        });\r\n    }\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getMhdtoXdsConverterTabCode();\r\n    }\r\n\r\n    /**\r\n     * Initializes the Event Message Widget to be populated with the validation result\r\n     */\r\n    protected Widget setupEventMessagesWidget(EventAggregatorWidget.ASSET_CLICK_EVENT assetClickEvent, String externalRepositoryId, String eventAssetId, String type, String[] displayColumns) {\r\n\r\n        try {\r\n            // Initialize the widget\r\n            eventMessageAggregatorWidget = new EventAggregatorWidget(Manager.EVENT_BUS, assetClickEvent, externalRepositoryId,eventAssetId,type,displayColumns);\r\n            eventMessageAggregatorWidget.setSize(\"990px\", \"375px\");\r\n            return eventMessageAggregatorWidget;\r\n\r\n        } catch (Throwable t) {\r\n            Window.alert(\"EventAggregatorWidget instance could not be created: \" + t.toString());\r\n        }\r\n        return null;\r\n    }\r\n}\r\n'),(242,344,'package gov.nist.hit.ds.xdstools3.client.tabs.preConnectathonTestsTab;\n\n\nimport com.google.gwt.user.client.rpc.RemoteService;\nimport com.google.gwt.user.client.rpc.RemoteServiceRelativePath;\n\nimport java.util.Map;\n\n\n@RemoteServiceRelativePath(\"preconnectathon-tab\")\npublic interface PreConnectathonTabService extends RemoteService  {\n\n	/* Test management */\n	public Map<String, String> getCollectionNames(String collectionSetName) throws Exception;\n	public Map<String, String> getCollection(String collectionSetName,String collectionName) throws Exception;\n	public String getTestReadme(String test) throws Exception;\n//	public String getTestReadme(String test) throws Exception;\n	/* Simulator Management */\n//	public List<String> getActorTypeNames() throws Exception ;\n}\n'),(243,345,'package gov.nist.hit.ds.xdstools3.client.tabs.preConnectathonTestsTab;\n\nimport com.google.gwt.user.client.rpc.AsyncCallback;\n\nimport java.util.Map;\n\npublic interface PreConnectathonTabServiceAsync {\n    void getCollectionNames(String collectionSetName, AsyncCallback<Map<String, String>> callback);\n    void getCollection(String collectionSetName, String collectionName, AsyncCallback<Map<String, String>> callback);\n    void getTestReadme(String test, AsyncCallback<String> callback);\n}\n'),(244,346,'package gov.nist.hit.ds.xdstools3.client.tabs.preConnectathonTestsTab;\r\n\r\nimport com.google.gwt.core.client.GWT;\r\nimport com.google.gwt.user.client.rpc.AsyncCallback;\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport com.smartgwt.client.widgets.HTMLFlow;\r\nimport com.smartgwt.client.widgets.HTMLPane;\r\nimport com.smartgwt.client.widgets.IButton;\r\nimport com.smartgwt.client.widgets.form.DynamicForm;\r\nimport com.smartgwt.client.widgets.form.fields.SelectItem;\r\nimport com.smartgwt.client.widgets.form.fields.events.ChangeEvent;\r\nimport com.smartgwt.client.widgets.form.fields.events.ChangeHandler;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.PatientIDWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.TLSAndSAML.TLSAndSAMLForm;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.GenericCloseableToolTab;\r\n\r\nimport java.util.LinkedHashMap;\r\nimport java.util.Map;\r\nimport java.util.logging.Logger;\r\n\r\npublic class PreConnectathonTestsTab extends GenericCloseableToolTab {\r\n    static final Logger logger = Logger.getLogger(PreConnectathonTestsTab.class.getName());\r\n    private final static PreConnectathonTabServiceAsync toolkitService = GWT\r\n            .create(PreConnectathonTabService.class);\r\n\r\n\r\n    private static String header = \"Pre-Connectathon Tests\";\r\n\r\n    private DynamicForm form;\r\n    private HTMLPane htmlReadme;\r\n    private SelectItem selectActor;\r\n    private SelectItem selectTest;\r\n    private SelectItem selectSection;\r\n\r\n    private VStack sectionPanel;\r\n\r\n\r\n    private String selectedActor;\r\n    private LinkedHashMap<String, String> actorMap;\r\n    private HTMLFlow beforeReadme;\r\n    private HTMLFlow afterReadme;\r\n\r\n    public PreConnectathonTestsTab() {\r\n        super(header);\r\n    }\r\n\r\n    @Override\r\n    protected Widget createContents() {\r\n        VStack vStack = new VStack();\r\n        form = new DynamicForm();\r\n\r\n        selectActor = new SelectItem();\r\n        selectActor.setTitle(\"Select Actor\");\r\n        selectActor.setName(\"actorItem\");\r\n        selectActor.setEmptyDisplayValue(\"Select author...\");\r\n        selectActor.setWidth(400);\r\n        loadActorsMap();\r\n        selectActor.addChangeHandler(new ChangeHandler() {\r\n            @Override\r\n            public void onChange(ChangeEvent changeEvent) {\r\n                selectedActor = (String) changeEvent.getValue();\r\n                selectTest.clearValue();\r\n                if (selectedActor == null)\r\n                    return;\r\n                if (\"\".equals(selectedActor))\r\n                    return;\r\n                loadTestsForActor(selectedActor);\r\n            }\r\n        });\r\n\r\n        selectTest = new SelectItem();\r\n        selectTest.setTitle(\"Select test\");\r\n        selectTest.setName(\"testItem\");\r\n        selectTest.setEmptyDisplayValue(\"Select actor first...\");\r\n        selectTest.addChangeHandler(new ChangeHandler() {\r\n            @Override\r\n            public void onChange(ChangeEvent changeEvent) {\r\n                loadTestReadme((String) changeEvent.getValue());\r\n            }\r\n        });\r\n        selectTest.setWidth(400);\r\n\r\n        beforeReadme = new HTMLFlow(\"<hr/>\");\r\n        htmlReadme = new HTMLPane();\r\n        htmlReadme.setHeight(300);\r\n        htmlReadme.setShowEdges(true);\r\n        htmlReadme.setContents(\"<div style=\'padding-left:20px\'>\" +\r\n                \"<h3>README</h3>\" +\r\n                \"</div>\");\r\n        afterReadme = new HTMLFlow(\"<hr/>\");\r\n        afterReadme = new HTMLFlow(\"<hr/>\");\r\n\r\n        form.setFields(selectActor, selectTest);\r\n        form.setCellPadding(10);\r\n\r\n        selectSection = new SelectItem();\r\n        selectSection.setTitle(\"Select section\");\r\n        selectSection.setName(\"sectionItem\");\r\n        selectSection.setEmptyDisplayValue(\"Select section...\");\r\n        selectSection.setWidth(400);\r\n        selectSection.addChangeHandler(new ChangeHandler() {\r\n            @Override\r\n            public void onChange(ChangeEvent changeEvent) {\r\n\r\n               /* viewTestPlan.addClickHandler(new ClickHandler() {\r\n                    @Override\r\n                    public void onClick(ClickEvent clickEvent) {\r\n                        // TODO\r\n                    }\r\n                });*/\r\n\r\n            }\r\n        });\r\n        DynamicForm f=new DynamicForm();\r\n        IButton viewTestPlan = new IButton(\"View this section\'s testplan\");\r\n        viewTestPlan.setWidth(200);\r\n        f.setFields(selectSection);\r\n        f.setCellPadding(10);\r\n\r\n        sectionPanel = new VStack();\r\n        sectionPanel.addMembers(f,viewTestPlan);\r\n\r\n        PatientIDWidget patientID = new PatientIDWidget();\r\n        TLSAndSAMLForm tLSAndSAMLForm = new TLSAndSAMLForm();\r\n\r\n        vStack.addMembers(form, beforeReadme, htmlReadme, afterReadme,sectionPanel,patientID,tLSAndSAMLForm);\r\n        return vStack;\r\n    }\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getPreConnectathonTestsTabCode();\r\n    }\r\n\r\n    private void loadActorsMap() {\r\n        toolkitService.getCollectionNames(\"actorcollections\",new AsyncCallback<Map<String, String>>() {\r\n            @Override\r\n            public void onFailure(Throwable caught) {\r\n                logger.warning(caught.getMessage());\r\n            }\r\n\r\n            @Override\r\n            public void onSuccess(Map<String, String> result) {\r\n                actorMap = new LinkedHashMap<String,String>();\r\n                actorMap.putAll(result);\r\n                selectActor.setValueMap(actorMap);\r\n            }\r\n        });\r\n    }\r\n\r\n    private void loadTestsForActor(String selectedActor) {\r\n        toolkitService.getCollection(\"actorcollections\",selectedActor,new AsyncCallback<Map<String, String>>() {\r\n\r\n            @Override\r\n            public void onFailure(Throwable caught) {\r\n                logger.warning(caught.getMessage());\r\n            }\r\n\r\n            @Override\r\n            public void onSuccess(Map<String, String> result) {\r\n                final LinkedHashMap<String,String> map=new LinkedHashMap<String,String>();\r\n                map.putAll(result);\r\n                if (map.isEmpty()){\r\n                    selectTest.setEmptyDisplayValue(\" -- NO DATA -- \");\r\n                }else{\r\n                    selectTest.setEmptyDisplayValue(\"Select Test...\");\r\n                }\r\n                selectTest.setValueMap(map);\r\n                form.getField(\"testItem\").setValueMap(map);\r\n            }\r\n        });\r\n\r\n    }\r\n\r\n    void loadSectionNames(String selectedTest) {\r\n        // TODO\r\n    }\r\n\r\n    private void loadTestReadme(String selectedTest){\r\n        toolkitService.getTestReadme(selectedTest, new AsyncCallback<String>() {\r\n            @Override\r\n            public void onFailure(Throwable throwable) {\r\n                logger.warning(throwable.getMessage());\r\n            }\r\n\r\n            @Override\r\n            public void onSuccess(String result) {\r\n                String readme = result;\r\n                // FIXME line break character replacement does not work\r\n                readme=readme.replaceAll(\"\\\\n\", \"<br/>\");\r\n                setReadmeHTMLPanel(readme);\r\n            }\r\n        });\r\n    }\r\n\r\n    private void setReadmeHTMLPanel(String readme){\r\n        String readMe=\"<div style=\'padding-left:20px\'>\"+\r\n                \"<h3>README</h3>\";\r\n        for (String s:readme.split(\"\\\\n\")){\r\n            readMe+=s+\"<br/>\";\r\n        }\r\n        readMe+=\"</div>\";\r\n        htmlReadme.setContents(readMe);\r\n    }\r\n\r\n    private void setReadmeVisible(boolean visible){\r\n        beforeReadme.setVisible(visible);\r\n        htmlReadme.setVisible(visible);\r\n        afterReadme.setVisible(visible);\r\n    }\r\n}\r\n'),(245,348,'package gov.nist.hit.ds.xdstools3.client.tabs.queryRetrieveTabs;\r\n\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport com.smartgwt.client.widgets.Button;\r\nimport com.smartgwt.client.widgets.Label;\r\nimport com.smartgwt.client.widgets.events.ClickEvent;\r\nimport com.smartgwt.client.widgets.events.ClickHandler;\r\nimport com.smartgwt.client.widgets.form.fields.events.BlurEvent;\r\nimport com.smartgwt.client.widgets.form.fields.events.BlurHandler;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionEvent;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.PatientIDWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.TLSAndSAML.TLSAndSAMLForm;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select.EndpointWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.GenericCloseableToolTab;\r\n\r\npublic class FindFoldersTab extends GenericCloseableToolTab {\r\n    private static final String header=\"Find Folders\";\r\n    private PatientIDWidget patientIDWidget;\r\n    private EndpointWidget sites;\r\n    private Button runBtn;\r\n\r\n    public FindFoldersTab() {\r\n        super(header);\r\n    }\r\n\r\n    @Override\r\n    protected Widget createContents() {\r\n        VStack vStack=new VStack();\r\n\r\n        Label l1=createSubtitle1(\"1. Enter Patient ID\");\r\n        patientIDWidget = new PatientIDWidget();\r\n        patientIDWidget.setWidth(400);\r\n\r\n        Label l2=createSubtitle1(\"2. Select site\");\r\n        sites = new EndpointWidget();\r\n\r\n        Label l3=createSubtitle1(\"3. Select SAML and TLS options\");\r\n        TLSAndSAMLForm tlsAndSAMLForm=new TLSAndSAMLForm();\r\n\r\n        runBtn=new Button(\"Run\");\r\n        runBtn.disable();\r\n\r\n        vStack.addMembers(l1,patientIDWidget,l2, sites,l3,tlsAndSAMLForm,runBtn);\r\n\r\n        bindUI();\r\n\r\n        return vStack;\r\n    }\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getFindFoldersCode();\r\n    }\r\n\r\n    private void bindUI() {\r\n        patientIDWidget.getField(\"patientID\").addBlurHandler(new BlurHandler() {\r\n            @Override\r\n            public void onBlur(BlurEvent blurEvent) {\r\n                if (patientIDWidget.isPidValueEntered() && sites.isEndpointValueSelected()) {\r\n                    runBtn.enable();\r\n                } else {\r\n                    runBtn.disable();\r\n                }\r\n            }\r\n        });\r\n        sites.addSelectionChangedHandler(new SelectionChangedHandler() {\r\n            @Override\r\n            public void onSelectionChanged(SelectionEvent selectionEvent) {\r\n                if (patientIDWidget.isPidValueEntered() && sites.isEndpointValueSelected()) {\r\n                    runBtn.enable();\r\n                } else {\r\n                    runBtn.disable();\r\n                }\r\n            }\r\n        });\r\n        runBtn.addClickHandler(new ClickHandler() {\r\n            @Override\r\n            public void onClick(ClickEvent clickEvent) {\r\n                // TODO\r\n            }\r\n        });\r\n    }\r\n}\r\n'),(246,349,'package gov.nist.hit.ds.xdstools3.client.tabs.queryRetrieveTabs;\r\n\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport com.smartgwt.client.widgets.Button;\r\nimport com.smartgwt.client.widgets.Label;\r\nimport com.smartgwt.client.widgets.events.ClickEvent;\r\nimport com.smartgwt.client.widgets.events.ClickHandler;\r\nimport com.smartgwt.client.widgets.form.DynamicForm;\r\nimport com.smartgwt.client.widgets.form.fields.events.BlurEvent;\r\nimport com.smartgwt.client.widgets.form.fields.events.BlurHandler;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionEvent;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.GenericTextItemWithTooltipWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.GenericCloseableToolTab;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.TLSAndSAML.TLSAndSAMLForm;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select.EndpointWidget;\r\n\r\npublic class GetDocumentsTab extends GenericCloseableToolTab {\r\n\r\n    private static final String header=\"Get Documents\";\r\n    private GenericTextItemWithTooltipWidget docEntryUUID;\r\n    private EndpointWidget sites;\r\n    private Button runBtn;\r\n\r\n    public GetDocumentsTab() {\r\n        super(header);\r\n    }\r\n\r\n    @Override\r\n    protected Widget createContents() {\r\n        VStack vStack=new VStack();\r\n\r\n        Label l1=createSubtitle1(\"1. Enter Document Entry UUID or UID\");\r\n        DynamicForm docEntryUUIDForm = new DynamicForm();\r\n        docEntryUUID = new GenericTextItemWithTooltipWidget();\r\n        docEntryUUID.setTitle(\"Document Entry UUID or UID\");\r\n        docEntryUUID.setWidth(400);\r\n        docEntryUUIDForm.setFields(docEntryUUID);\r\n        docEntryUUIDForm.setCellPadding(15);\r\n\r\n        Label l2=createSubtitle1(\"2. Select site\");\r\n        sites = new EndpointWidget();\r\n\r\n        Label l3=createSubtitle1(\"3. Select SAML and TLS options\");\r\n        TLSAndSAMLForm tlsAndSAMLForm=new TLSAndSAMLForm();\r\n\r\n        runBtn=new Button(\"Run\");\r\n        runBtn.disable();\r\n\r\n        vStack.addMembers(l1,docEntryUUIDForm,l2, sites,l3,tlsAndSAMLForm,runBtn);\r\n\r\n        bindUI();\r\n\r\n        return vStack;\r\n    }\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getGetDocumentsTabCode();\r\n    }\r\n\r\n    private void bindUI() {\r\n        docEntryUUID.addBlurHandler(new BlurHandler() {\r\n            @Override\r\n            public void onBlur(BlurEvent blurEvent) {\r\n                if (!docEntryUUID.getValueAsString().isEmpty() && sites.isEndpointValueSelected()){\r\n                    runBtn.enable();\r\n                }else{\r\n                    runBtn.disable();\r\n                }\r\n            }\r\n        });\r\n        sites.addSelectionChangedHandler(new SelectionChangedHandler() {\r\n            @Override\r\n            public void onSelectionChanged(SelectionEvent selectionEvent) {\r\n                if (docEntryUUID.getValue() != null && sites.isEndpointValueSelected()) {\r\n                    runBtn.enable();\r\n                } else {\r\n                    runBtn.disable();\r\n                }\r\n            }\r\n        });\r\n        runBtn.addClickHandler(new ClickHandler() {\r\n            @Override\r\n            public void onClick(ClickEvent clickEvent) {\r\n                // TODO\r\n            }\r\n        });\r\n    }\r\n}\r\n'),(247,350,'package gov.nist.hit.ds.xdstools3.client.tabs.queryRetrieveTabs;\r\n\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\n\r\npublic class GetFolderAndContentsTab extends GetFoldersTab{\r\n    private static final String header=\"Get Folder and Contents\";\r\n\r\n    public GetFolderAndContentsTab(){\r\n        setHeader(header);\r\n        setTitle(header);\r\n    }\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getGetFoldersAndContentsCode();\r\n    }\r\n}\r\n'),(248,351,'package gov.nist.hit.ds.xdstools3.client.tabs.queryRetrieveTabs;\r\n\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport com.smartgwt.client.widgets.Button;\r\nimport com.smartgwt.client.widgets.Label;\r\nimport com.smartgwt.client.widgets.events.ClickEvent;\r\nimport com.smartgwt.client.widgets.events.ClickHandler;\r\nimport com.smartgwt.client.widgets.form.DynamicForm;\r\nimport com.smartgwt.client.widgets.form.fields.events.BlurEvent;\r\nimport com.smartgwt.client.widgets.form.fields.events.BlurHandler;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionEvent;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.GenericTextItemWithTooltipWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select.EndpointWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.GenericCloseableToolTab;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.TLSAndSAML.TLSAndSAMLForm;\r\n\r\npublic class GetFoldersTab extends GenericCloseableToolTab {\r\n    private static final String header=\"Get Folders\";\r\n    protected EndpointWidget sites;\r\n    protected Button runBtn;\r\n    protected GenericTextItemWithTooltipWidget folderUUID;\r\n\r\n    public GetFoldersTab() {\r\n        super(header);\r\n    }\r\n\r\n    @Override\r\n    protected Widget createContents() {\r\n        VStack vStack=new VStack();\r\n\r\n        Label l1=createSubtitle1(\"1. Enter Folder UUID or UID\");\r\n        DynamicForm folderUUIDForm = new DynamicForm();\r\n        folderUUID = new GenericTextItemWithTooltipWidget();\r\n        folderUUID.setTitle(\"Folder UUID or UID\");\r\n        folderUUID.setWidth(400);\r\n        folderUUIDForm.setFields(folderUUID);\r\n        folderUUIDForm.setCellPadding(10);\r\n\r\n        Label l2=createSubtitle1(\"2. Select site\");\r\n        sites = new EndpointWidget();\r\n//        sites.isEndpointValueSelected()\r\n\r\n        Label l3=createSubtitle1(\"3. Select SAML and TLS options\");\r\n        TLSAndSAMLForm tlsAndSAMLForm=new TLSAndSAMLForm();\r\n\r\n        runBtn=new Button(\"Run\");\r\n        runBtn.disable();\r\n\r\n        vStack.addMembers(l1,folderUUIDForm,l2, sites,l3,tlsAndSAMLForm,runBtn);\r\n\r\n        bindUI();\r\n\r\n        return vStack;\r\n    }\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getGetFoldersTabCode();\r\n    }\r\n\r\n    private void bindUI() {\r\n        folderUUID.addBlurHandler(new BlurHandler() {\r\n            @Override\r\n            public void onBlur(BlurEvent blurEvent) {\r\n                if (!folderUUID.getValueAsString().isEmpty() && sites.isEndpointValueSelected()) {\r\n                    runBtn.enable();\r\n                } else {\r\n                    runBtn.disable();\r\n                }\r\n            }\r\n        });\r\n        sites.addSelectionChangedHandler(new SelectionChangedHandler() {\r\n            @Override\r\n            public void onSelectionChanged(SelectionEvent selectionEvent) {\r\n                if (folderUUID.getValue() != null && sites.isEndpointValueSelected()) {\r\n                    runBtn.enable();\r\n                } else {\r\n                    runBtn.disable();\r\n                }\r\n            }\r\n        });\r\n        runBtn.addClickHandler(new ClickHandler() {\r\n            @Override\r\n            public void onClick(ClickEvent clickEvent) {\r\n                // TODO\r\n            }\r\n        });\r\n    }\r\n}\r\n'),(249,352,'package gov.nist.hit.ds.xdstools3.client.tabs.queryRetrieveTabs;\r\n\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport com.smartgwt.client.widgets.Button;\r\nimport com.smartgwt.client.widgets.Label;\r\nimport com.smartgwt.client.widgets.events.ClickEvent;\r\nimport com.smartgwt.client.widgets.events.ClickHandler;\r\nimport com.smartgwt.client.widgets.form.DynamicForm;\r\nimport com.smartgwt.client.widgets.form.fields.ComboBoxItem;\r\nimport com.smartgwt.client.widgets.form.fields.events.BlurEvent;\r\nimport com.smartgwt.client.widgets.form.fields.events.BlurHandler;\r\nimport com.smartgwt.client.widgets.form.fields.events.ChangedEvent;\r\nimport com.smartgwt.client.widgets.form.fields.events.ChangedHandler;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionEvent;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.GenericTextItemWithTooltipWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.GenericCloseableToolTab;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.TLSAndSAML.TLSAndSAMLForm;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select.EndpointWidget;\r\n\r\nimport java.util.LinkedHashMap;\r\n\r\npublic class GetRelatedDocumentsTab extends GenericCloseableToolTab {\r\n    private static final String header=\"Get Related Documents\";\r\n\r\n    private GenericTextItemWithTooltipWidget docEntryUUID;\r\n    private ComboBoxItem associationTypes;\r\n    private EndpointWidget sites;\r\n    private Button runBtn;\r\n\r\n    public GetRelatedDocumentsTab() {\r\n        super(header);\r\n    }\r\n\r\n    @Override\r\n    protected Widget createContents() {\r\n        VStack vStack=new VStack();\r\n\r\n        Label l1=createSubtitle1(\"1. Enter Document Entry UUID\");\r\n        DynamicForm docEntryUUIDForm = new DynamicForm();\r\n        docEntryUUID = new GenericTextItemWithTooltipWidget();\r\n        docEntryUUID.setTitle(\"Document Entry UUID\");\r\n        docEntryUUID.setWidth(400);\r\n        docEntryUUIDForm.setFields(docEntryUUID);\r\n        docEntryUUIDForm.setCellPadding(10);\r\n\r\n        Label l2=createSubtitle1(\"2. Select Association Type\");\r\n        DynamicForm associationForm = new DynamicForm();\r\n        associationTypes = new ComboBoxItem();\r\n        associationTypes.setTitle(\"Association Type\");\r\n        associationTypes.setName(\"associationItem\");\r\n        associationTypes.setEmptyDisplayValue(\"Select Association Type...\");\r\n        associationTypes.setWidth(400);\r\n        associationForm.setFields(associationTypes);\r\n        associationForm.setCellPadding(10);\r\n        loadAssociationTypesMap();\r\n\r\n\r\n        Label l3=createSubtitle1(\"3. Select Site\");\r\n        sites = new EndpointWidget();\r\n//        sites.isEndpointValueSelected()\r\n\r\n        Label l4=createSubtitle1(\"4. Select SAML and TLS options\");\r\n        TLSAndSAMLForm tlsAndSAMLForm=new TLSAndSAMLForm();\r\n\r\n        runBtn=new Button(\"Run\");\r\n        runBtn.disable();\r\n\r\n        vStack.addMembers(l1,docEntryUUIDForm,l2,associationForm,l3, sites,l4,tlsAndSAMLForm,runBtn);\r\n\r\n        bindUI();\r\n\r\n        return vStack;\r\n    }\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getGetRelatedDocumentsCode();\r\n    }\r\n\r\n    private void loadAssociationTypesMap() {\r\n        LinkedHashMap<String,String> map=new LinkedHashMap<String,String>();\r\n        map.put(\"RPLC\",\"RPLC (full name)\");\r\n        map.put(\"APND\",\"APND (full name)\");\r\n        map.put(\"XFRM\",\"XFRM (full name)\");\r\n        map.put(\"XFRM_RPLC\",\"XFRM_RPLC (full name)\");\r\n        map.put(\"signs\",\"signs\");\r\n        associationTypes.setValueMap(map);\r\n    }\r\n\r\n    private void bindUI() {\r\n        docEntryUUID.addBlurHandler(new BlurHandler() {\r\n            @Override\r\n            public void onBlur(BlurEvent blurEvent) {\r\n                if (!docEntryUUID.getValueAsString().isEmpty() && sites.isEndpointValueSelected() && associationTypes.getValue()!=null) {\r\n                    runBtn.enable();\r\n                } else {\r\n                    runBtn.disable();\r\n                }\r\n            }\r\n        });\r\n        associationTypes.addChangedHandler(new ChangedHandler() {\r\n            @Override\r\n            public void onChanged(ChangedEvent changedEvent) {\r\n                if (!docEntryUUID.getValueAsString().isEmpty() && sites.isEndpointValueSelected() && associationTypes.getValue()!=null) {\r\n                    runBtn.enable();\r\n                } else {\r\n                    runBtn.disable();\r\n                }\r\n            }\r\n        });\r\n        sites.addSelectionChangedHandler(new SelectionChangedHandler() {\r\n            @Override\r\n            public void onSelectionChanged(SelectionEvent selectionEvent) {\r\n                if (docEntryUUID.getValue() != null && sites.isEndpointValueSelected() && associationTypes.getValue()!=null) {\r\n                    runBtn.enable();\r\n                } else {\r\n                    runBtn.disable();\r\n                }\r\n            }\r\n        });\r\n        runBtn.addClickHandler(new ClickHandler() {\r\n            @Override\r\n            public void onClick(ClickEvent clickEvent) {\r\n                // TODO\r\n            }\r\n        });\r\n    }\r\n}\r\n'),(250,353,'package gov.nist.hit.ds.xdstools3.client.tabs.queryRetrieveTabs;\r\n\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport com.smartgwt.client.widgets.Button;\r\nimport com.smartgwt.client.widgets.Label;\r\nimport com.smartgwt.client.widgets.events.ClickEvent;\r\nimport com.smartgwt.client.widgets.events.ClickHandler;\r\nimport com.smartgwt.client.widgets.form.DynamicForm;\r\nimport com.smartgwt.client.widgets.form.fields.events.BlurEvent;\r\nimport com.smartgwt.client.widgets.form.fields.events.BlurHandler;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionEvent;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.GenericTextItemWithTooltipWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.TLSAndSAML.TLSAndSAMLForm;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select.EndpointWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.GenericCloseableToolTab;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\n\r\npublic class GetSubmissionSetAndContentsTab extends GenericCloseableToolTab {\r\n\r\n    private static final String header=\"Get Submission Set And Contents\";\r\n\r\n    private GenericTextItemWithTooltipWidget subSetUUID;\r\n    private EndpointWidget sites;\r\n    private Button runBtn;\r\n\r\n    public GetSubmissionSetAndContentsTab() {\r\n        super(header);\r\n    }\r\n\r\n    @Override\r\n    protected Widget createContents() {\r\n        VStack vStack=new VStack();\r\n\r\n        Label l1=createSubtitle1(\"1. Enter Submission Set UUID or UID\");\r\n        DynamicForm subSetUUIDForm = new DynamicForm();\r\n        subSetUUID = new GenericTextItemWithTooltipWidget();\r\n        subSetUUID.setTitle(\"Submission Set UUID or UID\");\r\n        subSetUUID.setWidth(400);\r\n        subSetUUIDForm.setFields(subSetUUID);\r\n        subSetUUIDForm.setCellPadding(10);\r\n\r\n        Label l2=createSubtitle1(\"2. Select site\");\r\n        sites = new EndpointWidget();\r\n//        sites.isEndpointValueSelected()\r\n\r\n        Label l3=createSubtitle1(\"3. Select SAML and TLS options\");\r\n        TLSAndSAMLForm tlsAndSAMLForm=new TLSAndSAMLForm();\r\n\r\n        runBtn=new Button(\"Run\");\r\n        runBtn.disable();\r\n\r\n        vStack.addMembers(l1,subSetUUIDForm,l2, sites,l3,tlsAndSAMLForm,runBtn);\r\n\r\n        bindUI();\r\n\r\n        return vStack;\r\n    }\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getGetSubmissionSetAndContentsTabCode();\r\n    }\r\n\r\n    private void bindUI() {\r\n        subSetUUID.addBlurHandler(new BlurHandler() {\r\n            @Override\r\n            public void onBlur(BlurEvent blurEvent) {\r\n                if (!subSetUUID.getValueAsString().isEmpty() && sites.isEndpointValueSelected()) {\r\n                    runBtn.enable();\r\n                } else {\r\n                    runBtn.disable();\r\n                }\r\n            }\r\n        });\r\n        sites.addSelectionChangedHandler(new SelectionChangedHandler() {\r\n            @Override\r\n            public void onSelectionChanged(SelectionEvent selectionEvent) {\r\n                if (subSetUUID.getValue() != null && sites.isEndpointValueSelected()) {\r\n                    runBtn.enable();\r\n                } else {\r\n                    runBtn.disable();\r\n                }\r\n            }\r\n        });\r\n        runBtn.addClickHandler(new ClickHandler() {\r\n            @Override\r\n            public void onClick(ClickEvent clickEvent) {\r\n                // TODO\r\n            }\r\n        });\r\n    }\r\n}\r\n'),(251,354,'package gov.nist.hit.ds.xdstools3.client.tabs.queryRetrieveTabs;\r\n\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport com.smartgwt.client.widgets.Button;\r\nimport com.smartgwt.client.widgets.Label;\r\nimport com.smartgwt.client.widgets.events.ClickEvent;\r\nimport com.smartgwt.client.widgets.events.ClickHandler;\r\nimport com.smartgwt.client.widgets.form.DynamicForm;\r\nimport com.smartgwt.client.widgets.form.fields.events.BlurEvent;\r\nimport com.smartgwt.client.widgets.form.fields.events.BlurHandler;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionEvent;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.GenericTextItemWithTooltipWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select.EndpointWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.GenericCloseableToolTab;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.TLSAndSAML.TLSAndSAMLForm;\r\n\r\npublic class RetrieveDocumentsTab extends GenericCloseableToolTab {\r\n\r\n    private static final String header=\"Retrieve Documents\";\r\n    private GenericTextItemWithTooltipWidget docUID;\r\n    private EndpointWidget repositories;\r\n    private Button runBtn;\r\n\r\n    public RetrieveDocumentsTab() {\r\n        super(header);\r\n    }\r\n\r\n    @Override\r\n    protected Widget createContents() {\r\n        VStack vStack=new VStack();\r\n        Label l1=createSubtitle1(\"1. Enter Document UID\");\r\n        DynamicForm docUIDForm = new DynamicForm();\r\n        docUID = new GenericTextItemWithTooltipWidget();\r\n        docUID.setTitle(\"Document UID\");\r\n        docUID.setWidth(400);\r\n        docUIDForm.setFields(docUID);\r\n        docUIDForm.setCellPadding(10);\r\n\r\n        Label l2=createSubtitle1(\"2. Select Repository\");\r\n        repositories = new EndpointWidget();\r\n//        repositories.isEndpointValueSelected()\r\n\r\n        Label l3=createSubtitle1(\"3. Select SAML and TLS options\");\r\n        TLSAndSAMLForm tlsAndSAMLForm=new TLSAndSAMLForm();\r\n\r\n        runBtn=new Button(\"Run\");\r\n        runBtn.disable();\r\n\r\n        vStack.addMembers(l1,docUIDForm,l2, repositories,l3,tlsAndSAMLForm,runBtn);\r\n\r\n        bindUI();\r\n\r\n        return vStack;\r\n    }\r\n\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getRetrieveDocumentTabCode();\r\n    }\r\n\r\n    private void bindUI() {\r\n        docUID.addBlurHandler(new BlurHandler() {\r\n            @Override\r\n            public void onBlur(BlurEvent blurEvent) {\r\n                if (!docUID.getValueAsString().isEmpty() && repositories.isEndpointValueSelected()) {\r\n                    runBtn.enable();\r\n                } else {\r\n                    runBtn.disable();\r\n                }\r\n            }\r\n        });\r\n        repositories.addSelectionChangedHandler(new SelectionChangedHandler() {\r\n            @Override\r\n            public void onSelectionChanged(SelectionEvent selectionEvent) {\r\n                if (docUID.getValue() != null && repositories.isEndpointValueSelected()) {\r\n                    runBtn.enable();\r\n                } else {\r\n                    runBtn.disable();\r\n                }\r\n            }\r\n        });\r\n        runBtn.addClickHandler(new ClickHandler() {\r\n            @Override\r\n            public void onClick(ClickEvent clickEvent) {\r\n                // TODO\r\n            }\r\n        });\r\n    }\r\n}\r\n'),(252,356,'package gov.nist.hit.ds.xdstools3.client.tabs.submitTestDataTab;\r\n\r\nimport com.google.gwt.core.client.GWT;\r\nimport com.google.gwt.user.client.rpc.AsyncCallback;\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport com.smartgwt.client.widgets.Button;\r\nimport com.smartgwt.client.widgets.Label;\r\nimport com.smartgwt.client.widgets.events.ClickEvent;\r\nimport com.smartgwt.client.widgets.events.ClickHandler;\r\nimport com.smartgwt.client.widgets.events.FocusChangedEvent;\r\nimport com.smartgwt.client.widgets.events.FocusChangedHandler;\r\nimport com.smartgwt.client.widgets.form.DynamicForm;\r\nimport com.smartgwt.client.widgets.form.fields.HeaderItem;\r\nimport com.smartgwt.client.widgets.form.fields.SelectItem;\r\nimport com.smartgwt.client.widgets.form.fields.events.ChangedEvent;\r\nimport com.smartgwt.client.widgets.form.fields.events.ChangedHandler;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionChangedHandler;\r\nimport com.smartgwt.client.widgets.grid.events.SelectionEvent;\r\nimport com.smartgwt.client.widgets.layout.VStack;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.PatientIDWidget;\r\nimport gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.GenericCloseableToolTab;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.TLSAndSAML.TLSAndSAMLForm;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.select.EndpointWidget;\r\n\r\nimport java.util.LinkedHashMap;\r\nimport java.util.Map;\r\nimport java.util.logging.Logger;\r\n\r\n/**\r\n * Tab implementation to submit test data, handle Repository Test data,\r\n * Registry Test Data and MHD Test Data.\r\n */\r\npublic class SubmitTestDataTab extends GenericCloseableToolTab {\r\n    private Logger logger=Logger.getLogger(SubmitTestDataTab.class.getName());\r\n    // RPC Services declaration\r\n    private final static TestDataSubmissionServicesAsync testDataSubmissionServices = GWT\r\n            .create(TestDataSubmissionServices.class);\r\n\r\n    // tab title and header\r\n    private final static String header = \"Submit Test Data\";\r\n\r\n    // Tab components\r\n    private SelectItem testDataType;\r\n    private SelectItem testDataSetSelectItem;\r\n    private PatientIDWidget pid;\r\n    private EndpointWidget docRepository;\r\n    private TLSAndSAMLForm tlsAndSAMLForm;\r\n    private Button runBtn;\r\n\r\n    // Variables\r\n    private String selectedDataTestSet;\r\n\r\n    /**\r\n     * Default constructor\r\n     */\r\n    public SubmitTestDataTab() {\r\n        super(header);\r\n        bindUI();\r\n    }\r\n\r\n    /**\r\n     * Abstract method implementation to build the tab UI\r\n     *\r\n     * @return tab UI as a Widget\r\n     */\r\n    @Override\r\n    protected Widget createContents() {\r\n        VStack container=new VStack();\r\n\r\n        DynamicForm form=new DynamicForm();\r\n\r\n        // Test data type transactions\r\n        HeaderItem l1 = new HeaderItem();\r\n        l1.setDefaultValue(\"1. Select Test Data Type\");\r\n        testDataType = new SelectItem();\r\n        testDataType.setType(\"comboBox\");\r\n        testDataType.setWidth(400);\r\n        testDataType.setEmptyDisplayValue(\"Select test data type...\");\r\n        testDataType.setTitle(\"Test Data Type\");\r\n        loadTestDataType();\r\n        // select registry as default value\r\n        testDataType.setDefaultValue(\"reg\");\r\n\r\n        // Test data set transactions\r\n        HeaderItem l2=new HeaderItem();\r\n        l2.setDefaultValue(\"2. Select a Test Data Set\");\r\n        testDataSetSelectItem = new SelectItem();\r\n        // display the SelectItem as a comboBox if not using this the comboBox might not dropdown\r\n        testDataSetSelectItem.setType(\"comboBox\");\r\n        testDataSetSelectItem.setWidth(400);\r\n        testDataSetSelectItem.setTitle(\"Test Data Set\");\r\n        testDataSetSelectItem.setEmptyDisplayValue(\"Select test data set...\");\r\n        loadTestDataSet();\r\n\r\n        // Patient ID transactions\r\n        Label l3=createSubtitle1(\"3. Enter Patient ID\");\r\n        pid = new PatientIDWidget();\r\n\r\n        // Document repository transactions\r\n        Label l4 = createSubtitle1(\"4. Select a Document Repository\");\r\n        docRepository = new EndpointWidget();\r\n\r\n        // TLS and SAML transactions\r\n        Label l5=createSubtitle1(\"5. Select SAML and TLS options\");\r\n        tlsAndSAMLForm = new TLSAndSAMLForm();\r\n\r\n        runBtn = new Button(\"Submit\");\r\n        runBtn.disable();\r\n\r\n        form.setFields(l1, testDataType,l2, testDataSetSelectItem);\r\n        form.setCellPadding(15);\r\n\r\n        container.addMembers(form,l3, pid,l4, docRepository,l5, tlsAndSAMLForm, runBtn);\r\n        return container;\r\n    }\r\n\r\n    /**\r\n     * Method to load Test Data Set using RPC to call upon a distant method\r\n     */\r\n    private void loadTestDataSet() {\r\n        testDataSubmissionServices.retrieveTestDataSet(\"\",new AsyncCallback<Map<String,String>>() {\r\n            @Override\r\n            public void onFailure(Throwable caught) {\r\n                logger.warning(\"Error: \"+caught.getMessage());\r\n            }\r\n\r\n            @Override\r\n            public void onSuccess(Map<String,String> result) {\r\n                LinkedHashMap<String,String> map=new LinkedHashMap<String,String>();\r\n                map.putAll(result);\r\n                testDataSetSelectItem.setValueMap(map);\r\n            }\r\n        });\r\n    }\r\n\r\n    /**\r\n     * Method that binds the tab widgets together\r\n     */\r\n    private void bindUI(){\r\n        // set variable when a test data set is selected and enable run button if all field are filled\r\n        testDataSetSelectItem.addChangedHandler(new ChangedHandler() {\r\n            @Override\r\n            public void onChanged(ChangedEvent changedEvent) {\r\n                selectedDataTestSet= (String) changedEvent.getValue();\r\n                if(selectedDataTestSet!=null && !selectedDataTestSet.isEmpty()){\r\n                    if (pid.isPidValueEntered() && docRepository.isEndpointValueSelected()){\r\n                        runBtn.enable();\r\n                    }\r\n                }\r\n            }\r\n        });\r\n        // enable run button when patient id is filled if all field are filled\r\n        pid.addFocusChangedHandler(new FocusChangedHandler() {\r\n            @Override\r\n            public void onFocusChanged(FocusChangedEvent focusChangedEvent) {\r\n                if(pid.isPidValueEntered() && docRepository.isEndpointValueSelected() && selectedDataTestSet!=null && !selectedDataTestSet.isEmpty()){\r\n                    runBtn.enable();\r\n                }\r\n            }\r\n        });\r\n        // enable run button when a document repository is selected if all other fields are filled\r\n        docRepository.addSelectionChangedHandler(new SelectionChangedHandler() {\r\n            @Override\r\n            public void onSelectionChanged(SelectionEvent selectionEvent) {\r\n                if(pid.isPidValueEntered() && docRepository.isEndpointValueSelected() && selectedDataTestSet!=null && !selectedDataTestSet.isEmpty()){\r\n                    runBtn.enable();\r\n                }\r\n            }\r\n        });\r\n        runBtn.addClickHandler(new ClickHandler() {\r\n            @Override\r\n            public void onClick(ClickEvent clickEvent) {\r\n                String selectedTestDataType = testDataType.getValueAsString();\r\n                String pidValue=pid.getValue();\r\n                testDataSubmissionServices.submitTestData(selectedTestDataType, selectedDataTestSet, pidValue, \"repository\", tlsAndSAMLForm.isTLSChecked(),tlsAndSAMLForm.getSAMLValue(),new AsyncCallback<String>() {\r\n                    @Override\r\n                    public void onFailure(Throwable caught) {\r\n                        // TODO error meessage\r\n                    }\r\n\r\n                    @Override\r\n                    public void onSuccess(String result) {\r\n\r\n                    }\r\n                });\r\n            }\r\n        });\r\n    }\r\n\r\n    /**\r\n     * Method that set possible test data types\r\n     */\r\n    private void loadTestDataType() {\r\n        LinkedHashMap<String,String> testTypeMap=new LinkedHashMap<String,String>();\r\n        testTypeMap.put(\"reg\",\"Registry\");\r\n        testTypeMap.put(\"rep\",\"Repository\");\r\n        testTypeMap.put(\"mhd\",\"MHD\");\r\n        testDataType.setValueMap(testTypeMap);\r\n    }\r\n\r\n    /**\r\n     * Abstract method implementation to set the tab name (defined in {@link gov.nist.hit.ds.xdstools3.client.manager.TabNamesManager}).\r\n     *\r\n     * @return tab name\r\n     */\r\n    @Override\r\n    protected String setTabName() {\r\n        return TabNamesManager.getInstance().getTestDataSubmissionTabCode();\r\n    }\r\n}\r\n'),(253,357,'package gov.nist.hit.ds.xdstools3.client.tabs.submitTestDataTab;\r\n\r\nimport com.google.gwt.user.client.rpc.RemoteService;\r\nimport com.google.gwt.user.client.rpc.RemoteServiceRelativePath;\r\n\r\nimport java.util.Map;\r\n\r\n/**\r\n * RPC Services client interface to call upon test data submission distant methods\r\n */\r\n@RemoteServiceRelativePath(\"test-data-submission\")\r\npublic interface TestDataSubmissionServices extends  RemoteService{\r\n    String submitTestData(String selectedTestDataType, String selectedDataTestSet, String pidValue, String repository,boolean tls,String saml);\r\n    Map<String,String> retrieveTestDataSet(String testDataType);\r\n}\r\n'),(254,358,'package gov.nist.hit.ds.xdstools3.client.tabs.submitTestDataTab;\r\n\r\nimport com.google.gwt.user.client.rpc.AsyncCallback;\r\n\r\nimport java.util.Map;\r\n\r\n/**\r\n * Asynchronous interface for test data submission services to call upon distant method using RPC\r\n */\r\npublic interface TestDataSubmissionServicesAsync {\r\n    void submitTestData(String selectedTestDataType, String selectedDataTestSet, String pidValue, String repository, boolean tls, String saml, AsyncCallback<String> async);\r\n\r\n    void retrieveTestDataSet(String testDataType, AsyncCallback<Map<String,String>> async);\r\n}\r\n'),(255,360,'package gov.nist.hit.ds.xdstools3.client.util.eventBus;\r\n\r\nimport com.google.gwt.event.shared.EventHandler;\r\nimport com.google.gwt.event.shared.GwtEvent;\r\n\r\n/**\r\n * Event to throw to close all the open tabs.\r\n */\r\npublic class CloseAllTabsEvent extends GwtEvent<CloseAllTabsEvent.CloseAllTabsEventHandler> {\r\n    public static Type<CloseAllTabsEventHandler> TYPE = new Type<CloseAllTabsEventHandler>();\r\n\r\n    @Override\r\n    public Type<CloseAllTabsEventHandler> getAssociatedType() {\r\n        return TYPE;\r\n    }\r\n\r\n    @Override\r\n    protected void dispatch(CloseAllTabsEventHandler handler) {\r\n        handler.onCloseAllTabsEvent(this);\r\n    }\r\n\r\n    public interface CloseAllTabsEventHandler extends EventHandler {\r\n        public void onCloseAllTabsEvent(CloseAllTabsEvent event);\r\n    }\r\n}\r\n\r\n'),(256,361,'package gov.nist.hit.ds.xdstools3.client.util.eventBus;\r\n\r\nimport com.google.gwt.event.shared.EventHandler;\r\nimport com.google.gwt.event.shared.GwtEvent;\r\nimport com.smartgwt.client.widgets.tab.Tab;\r\n\r\n/**\r\n * Event thrown to close a specific tab\r\n */\r\npublic class CloseOtherTabsEvent extends GwtEvent<CloseOtherTabsEvent.CloseOtherTabsEventHandler> {\r\n    public static Type<CloseOtherTabsEventHandler> TYPE = new Type<CloseOtherTabsEventHandler>();\r\n    private Tab tab;\r\n\r\n    public CloseOtherTabsEvent(Tab tab){\r\n        this.tab=tab;\r\n    }\r\n\r\n    public Tab getTab(){\r\n        return tab;\r\n    }\r\n\r\n    @Override\r\n    public Type<CloseOtherTabsEventHandler> getAssociatedType() {\r\n        return TYPE;\r\n    }\r\n\r\n    @Override\r\n    protected void dispatch(CloseOtherTabsEventHandler handler) {\r\n        handler.onCloseOtherTabsEvent(this);\r\n    }\r\n\r\n    public interface CloseOtherTabsEventHandler extends EventHandler {\r\n        public void onCloseOtherTabsEvent(CloseOtherTabsEvent event);\r\n    }\r\n}\r\n'),(257,362,'package gov.nist.hit.ds.xdstools3.client.util.eventBus;\r\n\r\nimport com.google.gwt.event.shared.EventHandler;\r\nimport com.google.gwt.event.shared.GwtEvent;\r\nimport com.smartgwt.client.widgets.tab.Tab;\r\n\r\n/**\r\n * Event thrown to close a specific tab\r\n */\r\npublic class CloseTabEvent extends GwtEvent<CloseTabEvent.CloseTabEventHandler> {\r\n    public static Type<CloseTabEventHandler> TYPE = new Type<CloseTabEventHandler>();\r\n    private Tab tab;\r\n\r\n    public CloseTabEvent(Tab tab){\r\n        this.tab=tab;\r\n    }\r\n\r\n    public Tab getTab(){\r\n        return tab;\r\n    }\r\n\r\n    @Override\r\n    public Type<CloseTabEventHandler> getAssociatedType() {\r\n        return TYPE;\r\n    }\r\n\r\n    @Override\r\n    protected void dispatch(CloseTabEventHandler handler) {\r\n        handler.onCloseTabEvent(this);\r\n    }\r\n\r\n    public interface CloseTabEventHandler extends EventHandler {\r\n        public void onCloseTabEvent(CloseTabEvent event);\r\n    }\r\n}\r\n'),(258,363,'package gov.nist.hit.ds.xdstools3.client.util.eventBus;\r\n\r\nimport com.google.gwt.event.shared.GwtEvent;\r\n\r\n/**\r\n * To be used in GWT Eventbus. Opens a new tab. Takes as argument the name of the tab to open.\r\n * Example of use:  Util.EVENT_BUS.fireEvent(new OpenTabEvent(\"ENDPOINTS\"));\r\n */\r\npublic class OpenTabEvent extends GwtEvent<OpenTabEventHandler> {\r\n	public static Type<OpenTabEventHandler> TYPE = new Type<OpenTabEventHandler>();\r\n\r\n	    // Data to be passed to the event object\r\n	    private String tabName;\r\n\r\n	    public OpenTabEvent(String _tabName){\r\n	        tabName = _tabName;\r\n	    }\r\n\r\n	    public String getTabName(){\r\n            return tabName;\r\n	    }\r\n\r\n\r\n	    @Override\r\n	    protected void dispatch(OpenTabEventHandler handler) {\r\n	        handler.onEvent(this);\r\n	    }\r\n\r\n\r\n	    @Override\r\n	    public Type<OpenTabEventHandler> getAssociatedType() {\r\n	        return TYPE;\r\n	    }\r\n\r\n\r\n}\r\n'),(259,364,'package gov.nist.hit.ds.xdstools3.client.util.eventBus;\r\n\r\npublic interface OpenTabEventHandler extends com.google.gwt.event.shared.EventHandler {\r\n\r\n    void onEvent(OpenTabEvent event);\r\n\r\n\r\n}\r\n'),(260,366,'package gov.nist.hit.ds.xdstools3.client.util.eventBus.demo;\r\n\r\nimport com.google.gwt.event.shared.GwtEvent;\r\n\r\n\r\n    public class AuthenticationEvent extends GwtEvent<AuthenticationEventHandler> {\r\n\r\n        public static Type<AuthenticationEventHandler> TYPE = new Type<AuthenticationEventHandler>();\r\n\r\n        @Override\r\n        public Type<AuthenticationEventHandler> getAssociatedType() {\r\n            return TYPE;\r\n        }\r\n\r\n        @Override\r\n        protected void dispatch(AuthenticationEventHandler handler) {\r\n            handler.onAuthenticationChanged(this);\r\n        }\r\n}\r\n'),(261,367,'package gov.nist.hit.ds.xdstools3.client.util.eventBus.demo;\r\n\r\n\r\nimport gov.nist.hit.ds.xdstools3.client.util.eventBus.OpenTabEventHandler;\r\n\r\npublic interface AuthenticationEventHandler extends OpenTabEventHandler {\r\n        void onAuthenticationChanged(AuthenticationEvent authenticationEvent);\r\n    }\r\n'),(262,368,'package gov.nist.hit.ds.xdstools3.client.util.eventBus.demo;\r\n\r\nimport com.google.gwt.event.shared.GwtEvent;\r\n\r\n\r\npublic class AuthenticationRequestEvent extends GwtEvent<AuthenticationRequestEventHandler> {\r\n\r\n    public static Type<AuthenticationRequestEventHandler> TYPE = new Type<AuthenticationRequestEventHandler>();\r\n\r\n    @Override\r\n    public Type<AuthenticationRequestEventHandler> getAssociatedType() {\r\n        return TYPE;\r\n    }\r\n\r\n    @Override\r\n    protected void dispatch(AuthenticationRequestEventHandler handler) {\r\n        handler.onAuthenticationChanged(this);\r\n    }\r\n}\r\n'),(263,369,'package gov.nist.hit.ds.xdstools3.client.util.eventBus.demo;\r\n\r\n\r\nimport gov.nist.hit.ds.xdstools3.client.util.eventBus.OpenTabEventHandler;\r\n\r\npublic interface AuthenticationRequestEventHandler extends OpenTabEventHandler {\r\n        void onAuthenticationChanged(AuthenticationRequestEvent authenticationEvent);\r\n    }\r\n'),(264,370,'package gov.nist.hit.ds.xdstools3.client.util.eventBus.demo;\r\n\r\nimport com.google.gwt.event.shared.GwtEvent;\r\n\r\n\r\n\r\npublic class PingEvent extends GwtEvent<PingEventHandler> {\r\n	public static Type<PingEventHandler> TYPE = new Type<PingEventHandler>();\r\n\r\n	    // This is the only data that we intend to pass right now in the event object\r\n	    private String message;\r\n\r\n	    public PingEvent(String msg){\r\n	        this.message = msg;\r\n	        System.out.println(msg);\r\n	    }\r\n\r\n	    public String getMessage(){\r\n	        return this.message;\r\n	    }\r\n	     \r\n\r\n	    @Override\r\n	    protected void dispatch(PingEventHandler handler) {\r\n	        handler.onEvent(this);\r\n	    }\r\n\r\n\r\n	    @Override\r\n	    public com.google.gwt.event.shared.GwtEvent.Type<PingEventHandler> getAssociatedType() {\r\n	        return TYPE;\r\n	    }\r\n\r\n\r\n}\r\n'),(265,371,'package gov.nist.hit.ds.xdstools3.client.util.eventBus.demo;\r\n\r\nimport com.google.gwt.event.shared.EventHandler;\r\n\r\npublic interface PingEventHandler extends EventHandler {\r\n\r\n    void onEvent(PingEvent event);\r\n\r\n\r\n}\r\n'),(266,373,'package gov.nist.hit.ds.xdstools3.client.util.injection;\r\n\r\nimport com.google.gwt.activity.shared.ActivityMapper;\r\nimport com.google.gwt.core.client.GWT;\r\nimport com.google.gwt.inject.client.GinModules;\r\nimport com.google.gwt.inject.client.Ginjector;\r\nimport com.google.gwt.place.shared.PlaceController;\r\nimport com.google.web.bindery.event.shared.EventBus;\r\nimport gov.nist.hit.ds.xdstools3.client.Xdstools3ActivityView;\r\n\r\n/**\r\n * Application Client\'s Factory. Ginjector type can be used to bootstrap injection.\r\n * It is similar to GWT bundles (image or text). You just create a method for each object\r\n * you want to instantiate and Gin will generate it for you.\r\n *\r\n * See how Gin and Guice works: https://code.google.com/p/google-gin/wiki/GinTutorial\r\n *                              https://github.com/google/guice/wiki/Motivation\r\n *\r\n * Created by onh2 on 9/22/2014.\r\n */\r\n@GinModules(Xdstools3GinModule.class)\r\npublic interface Xdstools3GinInjector extends Ginjector{\r\n\r\n    public final static Xdstools3GinInjector injector = GWT.create(Xdstools3GinInjector.class);\r\n\r\n    Xdstools3ActivityView getXdstools3();\r\n    EventBus getEventBus();\r\n    PlaceController getPlaceController();\r\n\r\n    ActivityMapper getActivityMapper();\r\n}\r\n'),(267,374,'package gov.nist.hit.ds.xdstools3.client.util.injection;\r\n\r\nimport com.google.gwt.activity.shared.ActivityMapper;\r\nimport com.google.gwt.inject.client.AbstractGinModule;\r\nimport com.google.gwt.place.shared.PlaceController;\r\nimport com.google.inject.Provider;\r\nimport com.google.web.bindery.event.shared.EventBus;\r\nimport com.google.web.bindery.event.shared.SimpleEventBus;\r\nimport com.google.inject.Singleton;\r\nimport gov.nist.hit.ds.xdstools3.client.activitiesAndPlaces.Xdstools3ActivityMapper;\r\n\r\nimport javax.inject.Inject;\r\n\r\n\r\n/**\r\n * GIN counterpart of Guice\'s Module for GWT. It binds the various classes and providers\r\n * using a Guice module. The module class looks almost exactly like it would in regular\r\n * Guice. (GinModule and AbstractGinModule are used instead of Module and AbstractModule.)\r\n * If GIN can\'t findSimple a binding for a class, it falls back to calling GWT.create()\r\n * on that class. What this means that image bundles and translated messages\r\n * will just magically work.\r\n *\r\n * Created by onh2 on 9/22/2014.\r\n */\r\npublic class Xdstools3GinModule extends AbstractGinModule {\r\n    @Override\r\n    protected void configure() {\r\n        // binding the abstract class EventBus to its implementation SimpleEventBus.\r\n        bind(com.google.web.bindery.event.shared.EventBus.class).to(SimpleEventBus.class).in(Singleton.class);\r\n        // binding the place controller to its provider who knows how to instantiate the class.\r\n        bind(PlaceController.class).toProvider(PlaceControllerProvider.class).in(Singleton.class);\r\n        // binding the ActivityMapper interface to its implementation in Xdstools3AcitivtyMapper\r\n        bind(ActivityMapper.class).to(Xdstools3ActivityMapper.class).in(Singleton.class);\r\n    }\r\n\r\n    /**\r\n     * Specific provider for PlaceController.\r\n     */\r\n    public static class PlaceControllerProvider implements Provider<PlaceController> {\r\n        @Inject\r\n        EventBus eventBus; // inject the eventbus\r\n        private PlaceController controller;\r\n\r\n        @SuppressWarnings(\"deprecation\")\r\n        @Override\r\n        public PlaceController get() {\r\n            if (controller == null) {\r\n                controller = new PlaceController(eventBus); // instanciate placecontroller with the eventbus\r\n            }\r\n            return controller;\r\n        }\r\n    }\r\n\r\n}\r\n'),(268,376,'package gov.nist.hit.ds.xdstools3.server;\r\n\r\nimport gov.nist.hit.ds.repository.shared.data.AssetNode;\r\nimport gov.nist.hit.ds.simSupport.api.ValidationApi;\r\nimport gov.nist.hit.ds.xdstools3.shared.Site;\r\nimport gov.nist.hit.ds.siteManagement.loader.Sites;\r\nimport gov.nist.hit.ds.toolkit.Toolkit;\r\nimport gov.nist.hit.ds.xdstools3.client.exceptions.ToolkitServerError;\r\nimport gov.nist.hit.ds.xdstools3.server.demo.ActorsCollectionsDataSamples;\r\nimport gov.nist.hit.ds.xdstools3.server.demo.TestDataHelper;\r\nimport org.apache.log4j.Logger;\r\n\r\nimport java.io.Serializable;\r\nimport java.util.Map;\r\n\r\n/**\r\n * Singleton class that acts as a directory of all calls to server-side packages. All calls must go through this class in order to\r\n * develop and build easily on top of this application.\r\n *\r\n * @author dazais\r\n *\r\n */\r\npublic class Caller implements Serializable {\r\n\r\n    private static final long serialVersionUID = -6431109235310163158L;\r\n    private static Caller instance = null;\r\n    private final static Logger logger = Logger.getLogger(Caller.class.getName());\r\n    private final ValidationApi api = new ValidationApi();\r\n\r\n    // Transaction name common to all MHD transactions\r\n    private final String MHD_TRANSACTION_NAME = \"pdb\";\r\n\r\n    protected Caller(){\r\n    }\r\n\r\n    /**\r\n     * Singleton method. Use this method to gain access to the functionality in this class.\r\n     * @return Caller instance\r\n     */\r\n    public static Caller getInstance(){\r\n        if (instance == null){\r\n            instance = new Caller();\r\n        }\r\n        return instance;\r\n    }\r\n\r\n\r\n    // ------------------ Header app properties -------------------------\r\n\r\n    public String getToolkitConnectathonEvent() {\r\n        return Toolkit.getToolkitConnectathonEvent();\r\n    }\r\n\r\n    public String getToolkitVersion() {\r\n        return Toolkit.getToolkitVersion();\r\n    }\r\n\r\n\r\n    // ------------------ Administrator functionality --------------------\r\n    /**\r\n     * Login as admin\r\n     * @param password the admin password\r\n     */\r\n    public boolean logMeIn(String password){\r\n        String pwd = Toolkit.getPassword();\r\n        if (password.equals(pwd)){\r\n            logger.info(\"User logged in as admin.\");\r\n            return true;\r\n        }\r\n        return false;\r\n    }\r\n\r\n    /**\r\n     * Saves the application settings as defined by the administrator(s)\r\n     * @param settings Table of settings: host, port, tls_port, cache, environment, gazelleURL\r\n     */\r\n    public void saveAdminSettings(String[] settings){\r\n        // TODO save admin settings to back-end\r\n        Toolkit.saveProperties(Toolkit.getToolkitPropertiesFile());\r\n        System.out.println(\"Admin settings were saved\");\r\n    }\r\n\r\n    /**\r\n     * Changes the administrator password.\r\n     * @param oldPassword\r\n     * @param newPassword\r\n     */\r\n    public void saveAdminPassword(String oldPassword, String newPassword){\r\n        // TODO save admin password to back-end if oldPassword is correct\r\n        System.out.println(\"Admin password was saved\");\r\n    }\r\n\r\n    /**\r\n     * Retrieves the Toolkit / Admin settings from the back-end\r\n     * @return Table of settings: host, port, tls_port, external cache location, default environment, gazelle URL\r\n     */\r\n    public String[] retrieveAdminSettings(){\r\n        //TODO missing the location of external cache\r\n        String[] currentAdminParams = {Toolkit.getHost(), Toolkit.getPort(), Toolkit.getTlsPort(),\r\n                \"ext_cache_location\", Toolkit.getDefaultEnvironmentName(), Toolkit.getGazelleConfigURL()};\r\n        //String[] test = {\"http://nist1\", \"90800\", \"90801\", \"C://ext_cache\", \"NA2015\", \"http://gazelle.net\"}; // test data\r\n        logger.info(\"Retrieved from back-end (API Toolkit) the following parameters: \"\r\n                + \"host, port, TLS port, external cache location, default environment, gazelle URL.\");\r\n        return currentAdminParams;\r\n    }\r\n\r\n\r\n    // --------------------- Sessions and Environments ---------------------\r\n\r\n    /**\r\n     * Sets the list of environments\r\n     * @return the list of available environments\r\n     */\r\n    public String[] retrieveEnvironments(){\r\n        String[] envs = Toolkit.getEnvironmentNames().toArray(new String[0]);\r\n        logger.info(\"Retrieved the list of environments.\");\r\n        // String[] envs = {\"NA2014\", \"EURO2011\", \"EURO2012\", \"NwHIN\"}; // test data\r\n        return envs;\r\n    }\r\n\r\n    /**\r\n     * Sets the environment selected by the user\r\n     */\r\n    public void setEnvironment(String envName) {\r\n        Toolkit.setCurrentEnvironmentName(envName);\r\n        logger.info(\"Environment \'\" + envName + \"\' was set.\");\r\n    }\r\n\r\n    /**\r\n     * Sets the list of test sessions\r\n     * @return the list of test sessions\r\n     */\r\n    public String[] retrieveTestSessions() {\r\n        // String[] sessions = {\"Test session 1\", \"Test session 2\"};   // test data\r\n        try {\r\n            logger.info(\"Retrieved the list of user session names.\");\r\n            return Toolkit.getUserSessions().toArray(new String[0]);\r\n        }\r\n        catch (NullPointerException e) {\r\n            logger.info(\"No user session names are registered.\");\r\n            return new String[]{};\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Registers a new session name and perpetuates the change to the back-end.\r\n     * Retrieving the new list of sessions is done from inside the service\r\n     * implementation ToolbarServiceImpl.\r\n     * @param sessionName New session name entered by the user\r\n     * @see gov.nist.hit.ds.xdstools3.server.RPCServices.ToolbarServiceImpl\r\n     */\r\n    public void addTestSession(String sessionName){\r\n        Toolkit.addUserSession(sessionName);\r\n    }\r\n\r\n    /**\r\n     * Deletes a user session and perpetuates the change to the back-end.\r\n     * Retrieving the new list of sessions is done from inside the service\r\n     * implementation ToolbarServiceImpl.\r\n     * @param sessionName\r\n     * @see gov.nist.hit.ds.xdstools3.server.RPCServices.ToolbarServiceImpl\r\n     */\r\n    public void deleteTestSession(String sessionName) {\r\n        Toolkit.deleteUserSession(sessionName);\r\n    }\r\n\r\n\r\n\r\n    // --------------------- Actors and Collections ---------------------\r\n\r\n    public Map<String, String> getCollectionNames(String collectionSetName) throws Exception  {\r\n        return ActorsCollectionsDataSamples.instance.getCollectionNames(collectionSetName);\r\n    }\r\n\r\n    public Map<String, String> getCollection(String collectionSetName, String collectionName) {\r\n        return ActorsCollectionsDataSamples.instance.getCollection(collectionSetName,collectionName);\r\n    }\r\n\r\n    public String getTestReadme(String test) {\r\n        return ActorsCollectionsDataSamples.instance.getTestReadme(test);\r\n    }\r\n\r\n\r\n\r\n\r\n    // ----------------------------- MHD -------------------------------\r\n\r\n    /**\r\n     * Calls validation on an MHD message\r\n     * @param messageType the type of MHD message being uploaded\r\n     * @param filecontent MHD message contents\r\n     *\r\n     * @return an Asset (= validation result) as handled by the repository / LogBrowser\r\n     */\r\n    public AssetNode validateMHDMessage(String messageType, String filecontent) throws ToolkitServerError {\r\n        //if (messageType == \"Submit\") {\r\n        AssetNode validationResult = api.validateRequest(MHD_TRANSACTION_NAME, filecontent);\r\n        logger.info(\"Received AssetNode with parameters AssetId: \" + validationResult.getAssetId()\r\n                +\", AssetType: \"+ validationResult.getType()\r\n        +\", RepositoryId: \"+ validationResult.getRepId());\r\n        return validationResult;\r\n        //} // end submit\r\n        // else throw new unsupportedmessagetypeexception\r\n    }\r\n\r\n\r\n    /**\r\n     * Converts a MHD file into an XDS file\r\n     * @param uploadedFileContents the contents as a String of the MHD file uploaded by the user\r\n     * @param location the location of the file. This is the \"rootDirPath\" parameter that originates from the\r\n     *                 upload servlet. I do not know if we need this. -Diane\r\n     * @return\r\n     */\r\n    public AssetNode convertMHDtoXDS(String location, String uploadedFileContents) {\r\n        //TODO\r\n        // This is a test implementation that saves the uploaded file and displays it for the user\r\n        // inside a popup window. This should go away when the actual conversion is linked from the backend.\r\n        AssetNode validationResult = api.validateRequest(MHD_TRANSACTION_NAME, uploadedFileContents);\r\n        logger.info(\"Received AssetNode with parameters AssetId: \" + validationResult.getAssetId()\r\n                +\", AssetType: \"+ validationResult.getType()\r\n                +\", RepositoryId: \"+ validationResult.getRepId());\r\n        return validationResult;\r\n//        return saveTempFileService.saveAsXMLFile(uploadedFileContents);\r\n    }\r\n\r\n\r\n\r\n    // ----------------------------- Submit Test Data -------------------------------\r\n\r\n    /**\r\n     * Retrieves all the available test data sets for a given type of test data.\r\n     * This is for now used in the Submit Test Data tab.\r\n     * @param testDataType type of test data\r\n     * @return all the matching test data sets\r\n     */\r\n    public Map<String,String> retrieveTestDataSet(String testDataType) {\r\n        return TestDataHelper.instance.getTestDataSet();\r\n    }\r\n\r\n\r\n    // ----------------------------- Query & Retrieve -------------------------------\r\n\r\n    public AssetNode findDocuments(String pid, boolean tls, boolean saml, boolean onDemand, String endpointID) throws ToolkitServerError {\r\n        // create class to hold all parameters\r\n        // TODO insert API call for Find Documents\r\n        return null;\r\n    }\r\n\r\n\r\n    // --------------------------------- Sites / Actors / Endpoints ----------------------------------\r\n\r\n    /**\r\n     * Retrieve the full list of sites with their data\r\n     * @return\r\n     */\r\n    public Sites retrieveSites() {\r\n        return null;\r\n    }\r\n\r\n    public Site retrieveSiteAttributes() {\r\n        // TODO\r\n        /*HashMap<String, String> test = new HashMap<>();\r\n        test.put(\"pidfeedhost\", \"https://ihexds.nist.gov\");\r\n        test.put(\"pidfeedport\", \"12081\");\r\n        test.put(\"rtls\", \"https://ihexds.nist.gov:12081/tf6/services/xdsregistryb\");\r\n        test.put(\"rnotls\", \"http://ihexds.nist.gov:12080/tf6/services/xdsregistryb-notls\");\r\n        test.put(\"sqtls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"sqnotls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"updatetls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"updateNotls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"mpqtls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"mpqNotls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"repouuid\", \"https://ihexds.nist.gov\");\r\n        test.put(\"retrievetls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"retrievenotls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"pnrtls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"pnrnotls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"docsrcretrievetls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"docsrcretrievenotls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"srcreporetrievetls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"srcreporetrievenotls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"xdrpnrtls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"xdrpnrnotls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"hcid\", \"https://ihexds.nist.gov\");\r\n        test.put(\"xcqtls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"xcqnotls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"xcrtls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"xcrnotls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"xcpdtls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"xcpdnotls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"igqtls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"igqnotls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"igrtls\", \"https://ihexds.nist.gov\");\r\n        test.put(\"igrnotls\", \"https://ihexds.nist.gov\");\r\n*/\r\n        return new Site();\r\n    }\r\n\r\n}\r\n\r\n\r\n'),(269,378,'package gov.nist.hit.ds.xdstools3.server.RPCServices;\r\n\r\nimport com.google.gwt.user.server.rpc.RemoteServiceServlet;\r\nimport gov.nist.hit.ds.xdstools3.server.Caller;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.adminSettingsTab.AdminSettingsService;\r\n\r\n/**\r\n * Created by dazais on 10/29/2014.\r\n */\r\npublic class AdminSettingsImpl extends RemoteServiceServlet implements AdminSettingsService {\r\n\r\n    private static final long serialVersionUID = 1L;\r\n\r\n    @Override\r\n    public void saveAdminSettings(String[] settings) {\r\n        Caller.getInstance().saveAdminSettings(settings);}\r\n    public void saveAdminPassword(String oldPassword, String newPassword) {Caller.getInstance().saveAdminPassword(oldPassword, newPassword);}\r\n    public String[] retrieveAdminSettings() {return Caller.getInstance().retrieveAdminSettings();}\r\n\r\n}\r\n'),(270,379,'package gov.nist.hit.ds.xdstools3.server.RPCServices;\r\n\r\nimport com.google.gwt.user.server.rpc.RemoteServiceServlet;\r\nimport gov.nist.hit.ds.xdstools3.shared.Site;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.endpoints.smartgwt.configure.EndpointService;\r\nimport gov.nist.hit.ds.xdstools3.server.Caller;\r\n\r\n/**\r\n * Server side of the GWT RPC mechanism.\r\n *\r\n * @author dazais\r\n * @see gov.nist.hit.ds.xdstools3.client.customWidgets.toolbar.ToolbarService\r\n *\r\n */\r\npublic class EndpointImpl extends RemoteServiceServlet implements EndpointService {\r\n	/**\r\n	 *\r\n	 */\r\n	private static final long serialVersionUID = 1L;\r\n\r\n\r\n   /* @Override\r\n    public Sites retrieveSites() {\r\n        return Caller.getInstance().retrieveSites();\r\n    }*/\r\n\r\n    @Override\r\n    public Site retrieveSiteAttributes() {\r\n        return Caller.getInstance().retrieveSiteAttributes();\r\n    }\r\n}\r\n'),(271,380,'package gov.nist.hit.ds.xdstools3.server.RPCServices;\r\n\r\nimport com.google.gwt.user.server.rpc.RemoteServiceServlet;\r\nimport gov.nist.hit.ds.repository.shared.data.AssetNode;\r\nimport gov.nist.hit.ds.xdstools3.client.exceptions.ToolkitServerError;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.findDocumentsTab.FindDocumentTabServices;\r\nimport gov.nist.hit.ds.xdstools3.server.Caller;\r\nimport org.apache.log4j.Logger;\r\n\r\n@SuppressWarnings(\"serial\")\r\npublic class FindDocumentServicesImpl extends RemoteServiceServlet implements FindDocumentTabServices {\r\n    static Logger logger = Logger.getLogger(FindDocumentServicesImpl.class);\r\n\r\n    /**\r\n     * Default constructor\r\n     */\r\n    public FindDocumentServicesImpl() {\r\n    }\r\n\r\n    public AssetNode findDocuments(String pid, boolean tls, boolean saml, boolean onDemand, String endpointID) throws ToolkitServerError {\r\n        return Caller.getInstance().findDocuments(pid, tls, saml, onDemand, endpointID);\r\n    }\r\n\r\n}\r\n'),(272,381,'package gov.nist.hit.ds.xdstools3.server.RPCServices;\r\n\r\nimport com.google.gwt.user.server.rpc.RemoteServiceServlet;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.dialogs.loginDialog.LoginService;\r\nimport gov.nist.hit.ds.xdstools3.server.Caller;\r\n\r\n/**\r\n * Server side of the GWT RPC mechanism. \r\n * \r\n * @author dazais\r\n * @see gov.nist.hit.ds.xdstools3.client.customWidgets.dialogs.loginDialog.LoginService\r\n *\r\n */\r\npublic class LoginServiceImpl extends RemoteServiceServlet implements LoginService {\r\n	/**\r\n	 * \r\n	 */\r\n	private static final long serialVersionUID = 1L;\r\n\r\n    /**\r\n     * Admin login. Passes the password to the backend to be checked.\r\n     * @param password the admin password.\r\n     * @return a boolean that indicates whether the login was successful / unsuccessful.\r\n     */\r\n	public boolean logMeIn(String password){\r\n        return Caller.getInstance().logMeIn(password);}\r\n\r\n}\r\n\r\n'),(273,382,'package gov.nist.hit.ds.xdstools3.server.RPCServices;\r\n\r\nimport com.google.gwt.user.server.rpc.RemoteServiceServlet;\r\nimport gov.nist.hit.ds.repository.shared.data.AssetNode;\r\n//import gov.nist.toolkit.actorfactory.SiteServiceManager;\r\nimport gov.nist.hit.ds.session.server.Session;\r\nimport gov.nist.hit.ds.xdstools3.client.exceptions.ToolkitServerError;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.mhdTabs.MHDTabsServices;\r\nimport gov.nist.hit.ds.xdstools3.server.Caller;\r\nimport org.apache.log4j.Logger;\r\n\r\n/**\r\n * MHD RPC Services Implementation inspired from v2 ToolkitServicesImpl.\r\n * TODO Some elements will need to be reviewed when integrating the rest of v2 transactions\r\n */\r\n@SuppressWarnings(\"serial\")\r\npublic class MHDServicesImpl extends RemoteServiceServlet implements MHDTabsServices {\r\n    static Logger logger = Logger.getLogger(MHDServicesImpl.class);\r\n\r\n    // Used only for non-servlet use (Dashboard is good example)\r\n    //    private String sessionID = null;\r\n    private Session standAloneSession = null;  // needed for standalone use not part of servlet\r\n\r\n    //public SiteServiceManager siteServiceManager;\r\n\r\n    /**\r\n     * Default constructor\r\n     */\r\n    public MHDServicesImpl() {\r\n       // siteServiceManager = SiteServiceManager.getSiteServiceManager();   // One copy shared between sessions\r\n    }\r\n\r\n    /**\r\n     * MHD Message Validation method\r\n     *\r\n     * @param messageType Type of MHD message\r\n     *\r\n     * @return validation result\r\n     */\r\n    public AssetNode validateMHDMessage(String messageType) throws ToolkitServerError {\r\n        return Caller.getInstance().validateMHDMessage(messageType, new String(getSession().getlastUpload()).trim());\r\n    }\r\n\r\n    /**\r\n     * Retrieves uploaded MHD file from the servlet and calls the conversion to XDS file.\r\n     * The uploaded file must be an XML file.\r\n     * @return\r\n     */\r\n    @Override\r\n    public AssetNode convertMHDToXDS() {\r\n        String rootDirPath = getServletContext().getContextPath();\r\n        String uploadedFileContents = new String(getSession().getlastUpload()).trim();\r\n        return Caller.getInstance().convertMHDtoXDS(rootDirPath, uploadedFileContents);\r\n    }\r\n\r\n\r\n    /**\r\n     * Method that returns the session using rpc servlet\r\n     * @return session\r\n     */\r\n    public Session getSession() { return Session.getSession(this.getThreadLocalRequest()); }\r\n\r\n\r\n}\r\n'),(274,383,'package gov.nist.hit.ds.xdstools3.server.RPCServices;\n\n\nimport com.google.gwt.user.server.rpc.RemoteServiceServlet;\n\n\nimport gov.nist.hit.ds.xdstools3.client.tabs.preConnectathonTestsTab.PreConnectathonTabService;\nimport gov.nist.hit.ds.xdstools3.server.Caller;\nimport org.apache.log4j.Logger;\n\n\n\nimport java.util.Map;\n\n\n@SuppressWarnings(\"serial\")\npublic class PreConnectathonTabServiceImpl extends RemoteServiceServlet implements PreConnectathonTabService {\n\n    static Logger logger = Logger.getLogger(PreConnectathonTabServiceImpl.class);\n\n\n    public PreConnectathonTabServiceImpl() {\n    }\n\n    public Map<String, String> getCollectionNames(String collectionSetName) throws Exception {\n        return Caller.getInstance().getCollectionNames(collectionSetName);\n    }\n\n    public Map<String, String> getCollection(String collectionSetName, String collectionName) throws Exception {\n        return Caller.getInstance().getCollection(collectionSetName, collectionName);\n    }\n\n    public String getTestReadme(String test){\n        return Caller.getInstance().getTestReadme(test);\n    }\n\n\n\n}\n'),(275,384,'package gov.nist.hit.ds.xdstools3.server.RPCServices;\r\n\r\nimport java.io.File;\r\nimport java.io.FileOutputStream;\r\nimport java.io.IOException;\r\nimport java.util.UUID;\r\nimport java.util.logging.Logger;\r\n\r\n/**\r\n * Service class to save a temporary file on the server. The file is save into the webapp directory.\r\n */\r\npublic class SaveTempFileService {\r\n    private static final long serialVersionUID = 1L;\r\n    private static File FILE_REPOSITORY;\r\n    private final Logger logger = Logger.getLogger(SaveTempFileService.class.getName());\r\n\r\n    public SaveTempFileService(){\r\n        String rootDirPath = System.getProperty(\"user.dir\");\r\n        logger.info(\"Root Path: \" + rootDirPath);\r\n        File fileFolder=new File(new File(rootDirPath),\"/files/\");\r\n        if(!fileFolder.exists()) {\r\n            logger.info(\"Create storage folder \'files\'\'\");\r\n            fileFolder.mkdir();\r\n            logger.info(\"... storage folder \'files\' created.\");\r\n        }\r\n        FILE_REPOSITORY=fileFolder;\r\n        logger.info(\"New storage folder is: \"+FILE_REPOSITORY.getAbsolutePath());\r\n    }\r\n\r\n    /**\r\n     * Distant method that save a String into a generated xml file in the\r\n     * server. It returns the generated file name.\r\n     *\r\n     * @param fileContent\r\n     * @return String filename\r\n     */\r\n    public String saveAsXMLFile(String fileContent) {\r\n        logger.info(\"Saving xml file...\");\r\n\r\n        // Random name created for save on server\r\n        String filename = UUID.randomUUID().toString() + \".xml\";\r\n\r\n        // Save xml file content into \"files\" repository\r\n        logger.info(\"Metadata xml file creation...\");\r\n\r\n        // return created file\'s name\r\n        return saveAsXMLFile(filename,fileContent);\r\n\r\n//        return filename;\r\n    }\r\n\r\n    /**\r\n     * Distant method that save a String into a generated xml file in the\r\n     * server. It returns the generated file name.\r\n     *\r\n     * @param fileContent\r\n     * @param filename\r\n     * @return String filename\r\n     */\r\n    public String saveAsXMLFile(String filename, String fileContent) {\r\n        logger.info(\"Saving xml file...\");\r\n\r\n        // Random name created for save on server\r\n        String fileName = filename;\r\n        if (fileName == null || fileName.equals(\"\"))\r\n            fileName = UUID.randomUUID().toString();\r\n        if (!(fileName.matches(\".*(\\\\.[0-9A-Za-z]+)$\") || fileName.matches(\".*\\\\.xml$\")))\r\n            fileName += \".xml\";\r\n\r\n        // Save xml file content into \"files\" repository\r\n        logger.info(\"Metadata xml file creation...\");\r\n\r\n        FileOutputStream out;\r\n\r\n        try {\r\n            out = new FileOutputStream(new File(FILE_REPOSITORY, fileName));\r\n            logger.info(\"... writing file (\"+fileName+\") in \"+FILE_REPOSITORY.getAbsolutePath()+\"...\");\r\n            out.write(fileContent.getBytes());\r\n            out.close();\r\n        } catch (IOException e) {\r\n            logger.warning(\"Error when writing metadata file on server.\\n\" + e.getMessage());\r\n            e.printStackTrace();\r\n        }\r\n        logger.fine(\"... temporary file created: \" + FILE_REPOSITORY + \"/\" + fileName);\r\n\r\n        // return created file\'s name\r\n        return fileName;\r\n    }\r\n}\r\n'),(276,385,'package gov.nist.hit.ds.xdstools3.server.RPCServices;\r\n\r\n\r\nimport com.google.gwt.user.server.rpc.RemoteServiceServlet;\r\nimport gov.nist.hit.ds.xdstools3.client.tabs.submitTestDataTab.TestDataSubmissionServices;\r\nimport gov.nist.hit.ds.xdstools3.server.Caller;\r\nimport org.apache.log4j.Logger;\r\n\r\nimport java.util.Map;\r\n\r\n/**\r\n * RPC Service implementation for test data submission\r\n */\r\n@SuppressWarnings(\"serial\")\r\npublic class TestDataSubmissionServicesImpl extends RemoteServiceServlet implements TestDataSubmissionServices {\r\n    static Logger logger = Logger.getLogger(PreConnectathonTabServiceImpl.class);\r\n\r\n    /**\r\n     * Default constructor\r\n     */\r\n    public TestDataSubmissionServicesImpl() {\r\n    }\r\n\r\n    /**\r\n     * Method to submit new test data\r\n     *\r\n     * @param selectedTestDataType\r\n     * @param selectedDataTestSet\r\n     * @param pidValue\r\n     * @param repository\r\n     * @param tls\r\n     * @param saml\r\n     * @return\r\n     */\r\n    @Override\r\n    public String submitTestData(String selectedTestDataType, String selectedDataTestSet, String pidValue, String repository,boolean tls,String saml) {\r\n        return null;\r\n    }\r\n\r\n    /**\r\n     * Method to retrieve test data sets from test data type\r\n     *\r\n     * @param testDataType\r\n     * @return\r\n     */\r\n    @Override\r\n    public Map<String,String> retrieveTestDataSet(String testDataType) {\r\n        return Caller.getInstance().retrieveTestDataSet(testDataType);\r\n    }\r\n\r\n\r\n}\r\n'),(277,386,'package gov.nist.hit.ds.xdstools3.server.RPCServices;\r\n\r\nimport com.google.gwt.user.server.rpc.RemoteServiceServlet;\r\n\r\nimport gov.nist.hit.ds.xdstools3.server.Caller;\r\nimport gov.nist.hit.ds.xdstools3.client.customWidgets.toolbar.ToolbarService;\r\n\r\n/**\r\n * Server side of the GWT RPC mechanism.\r\n *\r\n * @author dazais\r\n * @see gov.nist.hit.ds.xdstools3.client.customWidgets.toolbar.ToolbarService\r\n *\r\n */\r\npublic class ToolbarServiceImpl extends RemoteServiceServlet implements ToolbarService {\r\n	/**\r\n	 *\r\n	 */\r\n	private static final long serialVersionUID = 1L;\r\n\r\n    public String[] retrieveEnvironments(){  return Caller.getInstance().retrieveEnvironments();}\r\n    public void setEnvironment(String envName) { Caller.getInstance().setEnvironment(envName); }\r\n    public String[] retrieveTestSessions(){  return Caller.getInstance().retrieveTestSessions();}\r\n    public String[] addTestSession(String sessionName) {\r\n        Caller.getInstance().addTestSession(sessionName); return Caller.getInstance().retrieveTestSessions();}\r\n    public String[] deleteTestSession(String sessionName) {\r\n        Caller.getInstance().addTestSession(sessionName); return Caller.getInstance().retrieveTestSessions();}\r\n\r\n    // HEADER Services\r\n    public String getToolkitEvent(){\r\n        return Caller.getInstance().getToolkitConnectathonEvent();\r\n    }\r\n\r\n    public String getToolkitVersion(){\r\n        return Caller.getInstance().getToolkitVersion();\r\n    }\r\n}\r\n'),(278,387,'package gov.nist.hit.ds.xdstools3.server;\n\nimport gov.nist.hit.ds.http.parser.*;\nimport gov.nist.hit.ds.session.server.Session;\nimport gov.nist.hit.ds.xdsExceptions.ExceptionUtil;\nimport org.apache.log4j.Logger;\n\nimport javax.servlet.http.*;\nimport java.io.IOException;\nimport java.util.Map;\n\npublic class UploadServlet extends HttpServlet {\n\n	static final Logger logger = Logger.getLogger(UploadServlet.class);\n	/**\n	 *\n	 */\n	private static final long serialVersionUID = 1L;\n\n	public void doPost(HttpServletRequest request, HttpServletResponse response)  throws IOException {\n		byte[] body = null;\n		String filename = null;\n		byte[] body2 = null;\n		String filename2 = null;\n		Map<String, byte[]> contentMap = null;\n\n		HttpParser hp;\n		try {\n			hp = new HttpParser();\n            hp.appendixV = false;\n                        hp.init(request);\n//			filename = extractFileName(hp.getMultipartParser().getMultipartMessage().asMessage());\n//			if(!(filename.endsWith(\".xml\") || filename.endsWith(\".json\"))){\n//				throw new IOException(\"Invalid file format exception - must be xml or json\");\n//			}\n			byte[] bodybytes = hp.getBody();\n		} catch (HttpParseException e1) {\n			logger.error(\"HTTPParser parse error: \" + e1.getMessage());\n			throw new IOException(\"Parse Error: \" + e1.getMessage());\n		}\n		catch (RuntimeException e) {\n			logger.error(ExceptionUtil.exception_details(e));\n			throw new IOException(\"Parse Error: \" + e.getMessage());\n		}\n		if (hp.isMultipart()) {\n			logger.debug(\"Parse servlet input - is a multipart\");\n\n			MultipartParser mp = hp.getMultipartParser();\n			MultipartMessage mm = mp.getMultipartMessage();\n\n			contentMap = mm.getContentMap();\n		} else {\n			HttpMessage hm = hp.getHttpMessage();\n//			logger.debug(hm.toString());\n//			String bdy = hm.getBody();\n//			System.out.println(\"body=\" + bdy);\n			logger.error(\"Cannot parse servlet input - not a multipart\");\n			//throw new IOException(\"Cannot parse servlet input - not a multipart\");\n		}\n\n		try {\n            Session session = Session.getSession(request);\n            logger.debug(\"UploadServlet: sessionId is \" + session.getId());\n\n			if (contentMap != null) {\n                byte[] upload1 = contentMap.get(\"upload1FormElement\");\n                logger.debug(\"upload1 is \" + ((upload1 == null) ? \"null\" : \"not null\"));\n                byte[] upload2 = contentMap.get(\"upload2FormElement\");\n                logger.debug(\"upload2 is \" + ((upload2 == null) ? \"null\" : \"not null\"));\n				session.setLastUpload(\n						\"filename\",\n						upload1,\n						asString(contentMap, \"password1\"),\n						\"filename\",\n						upload2,\n						asString(contentMap, \"password2\"));\n			}\n\n		} catch (Exception e7) {\n			logger.error(ExceptionUtil.exception_details(e7));\n			body = e7.getMessage().getBytes();\n		}\n		response.setStatus(HttpServletResponse.SC_OK);\n	}\n\n	String asString(Map<String, byte[]> map, String entry) {\n		if (!map.containsKey(entry))\n			return \"\";\n		return new String(map.get(entry)).trim();\n	}\n	private String extractFileName(String multipartMessage) {\n		String[] items = multipartMessage.split(\";\");\n		for (String s : items) {\n			if (s.trim().startsWith(\"filename\")) {\n				String tmp = s.substring(s.indexOf(\"=\") + 2, s.length()-1);\n				return tmp.split(\"\\\"\")[0];\n			}\n		}\n		return \"\";\n	}\n}\n'),(279,389,'package gov.nist.hit.ds.xdstools3.server.demo;\r\n\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.HashMap;\r\nimport java.util.List;\r\nimport java.util.Map;\r\n\r\n/**\r\n * Created by onh2 on 8/26/2014.\r\n *\r\n * Provides test data / GUI demo data for Actors and Collections widgets\r\n */\r\npublic enum ActorsCollectionsDataSamples {\r\n    instance;\r\n\r\n    Map<String,List<String>> testsMap;\r\n    Map<String,String> collectionsReadme;\r\n\r\n    private ActorsCollectionsDataSamples(){\r\n        testsMap = new HashMap<>();\r\n        collectionsReadme = new HashMap<>();\r\n\r\n        List<String> sq = new ArrayList<>();\r\n        sq.add(\"12346\");\r\n        testsMap.put(\"Initialize_for_Stored_Query\", sq);\r\n\r\n        List<String> rg=new ArrayList<>();\r\n        rg.add(\"12309\");\r\n        rg.add(\"12310\");\r\n        rg.add(\"12311\");\r\n        rg.add(\"12312\");\r\n        rg.add(\"12313\");\r\n        rg.add(\"12314\");\r\n        rg.add(\"15500\");\r\n        rg.add(\"12300\");\r\n        rg.add(\"12301\");\r\n        rg.add(\"12306\");\r\n        rg.add(\"12307\");\r\n        rg.add(\"12308\");\r\n        testsMap.put(\"rg\", rg);\r\n\r\n        List<String> rep=new ArrayList<>();\r\n        rep.add(\"12318\");\r\n        rep.add(\"12345\");\r\n        rep.add(\"11966\");\r\n        rep.add(\"11979\");\r\n        rep.add(\"11983\");\r\n        rep.add(\"11986\");\r\n        rep.add(\"12021\");\r\n        rep.add(\"12028\");\r\n        rep.add(\"12029\");\r\n        rep.add(\"12369\");\r\n        testsMap.put(\"rep\", rg);\r\n\r\n        List<String> reg=new ArrayList<>();\r\n        reg.add(\"12361\");\r\n        reg.add(\"12374\");\r\n        reg.add(\"11897\");\r\n        reg.add(\"11898\");\r\n        reg.add(\"11899\");\r\n        reg.add(\"11901\");\r\n        reg.add(\"11902\");\r\n        reg.add(\"11903\");\r\n        reg.add(\"11904\");\r\n        reg.add(\"11905\");\r\n        reg.add(\"11906\");\r\n        reg.add(\"11907\");\r\n        reg.add(\"11908\");\r\n        reg.add(\"11909\");\r\n        reg.add(\"11990\");\r\n        reg.add(\"11991\");\r\n        reg.add(\"11992\");\r\n        reg.add(\"11993\");\r\n        reg.add(\"11994\");\r\n        reg.add(\"11995\");\r\n        reg.add(\"11996\");\r\n        reg.add(\"11997\");\r\n        reg.add(\"11998\");\r\n        reg.add(\"11999\");\r\n        reg.add(\"12000\");\r\n        reg.add(\"12001\");\r\n        reg.add(\"12002\");\r\n        reg.add(\"12004\");\r\n        reg.add(\"12084\");\r\n        reg.add(\"12323\");\r\n        reg.add(\"12326\");\r\n        reg.add(\"12327\");\r\n        reg.add(\"12364\");\r\n        reg.add(\"12368\");\r\n        reg.add(\"12370\");\r\n        reg.add(\"12379\");\r\n        reg.add(\"15800\");\r\n        reg.add(\"15802\");\r\n        testsMap.put(\"reg\", reg);\r\n\r\n        List<String> rec = new ArrayList<>();\r\n        rec.add(\"12371\");\r\n        rec.add(\"12372\");\r\n        rec.add(\"12373\");\r\n        rec.add(\"12375\");\r\n        rec.add(\"12376\");\r\n        testsMap.put(\"rec\", rec);\r\n\r\n        collectionsReadme.put(\"11897\", \"SQ.b FindDocuments Stored Query\\n\" +\r\n                \"\\n\" +\r\n                \"Stored Query must be run over SOAP 1.2.  \\n\" +\r\n                \"\\n\" +\r\n                \"This testplan contains many many test steps each validating \\n\" +\r\n                \"a feature of the FindDocuments stored query.  This test relies\\n\" +\r\n                \"on test 12346 to pre-load the Registry with known test data.\\n\" +\r\n                \"\\n\" +\r\n                \"The test steps are:\\n\" +\r\n                \"\\n\" +\r\n                \"and:\\n\" +\r\n                \"   tests AND logic in SQ\\n\" +\r\n                \"   eventCodeList having both T-D4909  AND  T-62002\\n\" +\r\n                \"   must return single document\\n\" +\r\n                \"\\n\" +\r\n                \"classcode_one: \\n\" +\r\n                \"   queries for: \\n\" +\r\n                \"      classCode = \'Consult\'\\n\" +\r\n                \"      status = \'Approved\'\\n\" +\r\n                \"   must return: DocD\\n\" +\r\n                \"\\n\" +\r\n                \"classcode_practicesetting:\\n\" +\r\n                \"  queries for:\\n\" +\r\n                \"    classCode = \'Communication\'\\n\" +\r\n                \"    practiceSettingCode = \'Cardiology\'\\n\" +\r\n                \"    status = \'Approved\'\\n\" +\r\n                \"  must return: DocB\\n\" +\r\n                \"\\n\" +\r\n                \"classcode_scheme_2: \\n\" +\r\n                \"   queries for:\\n\" +\r\n                \"     classCode = (\'Communication\', \'Communication\')\\n\" +\r\n                \"     classCodeScheme = (\'Connect-a-thon classCodes\',\'Connect-a-thon classCodes 2\')\\n\" +\r\n                \"     status = \'Approved\'\\n\" +\r\n                \"   must return: DocB, DocC\\n\" +\r\n                \"\\n\" +\r\n                \"classcode_scheme_mismatch:\\n\" +\r\n                \"  queries for:\\n\" +\r\n                \"      classCode = \'Communication\'\\n\" +\r\n                \"      classCodeScheme = (\'Connect-a-thon classCodes\', \'a\') \\n\" +\r\n                \"      status = \'Approved\'\\n\" +\r\n                \"  must return: none (mismatch on codes and scheme)\\n\" +\r\n                \"\\n\" +\r\n                \"classcode_two: \\n\" +\r\n                \"   queries for: \\n\" +\r\n                \"      classCode = \'Consult\' or \'History and Physical\'\\n\" +\r\n                \"      status = \'Approved\'\\n\" +\r\n                \"   must return: DocD, DocE, DocA\\n\" +\r\n                \"\\n\" +\r\n                \"confcode:\\n\" +\r\n                \"  queries for:\\n\" +\r\n                \"    confidentialityCode = (\'1.3.6.1.4.1.21367.2006.7.101\',\\n\" +\r\n                \"                                    \'1.3.6.1.4.1.21367.2006.7.103\')\\n\" +\r\n                \"    status = \'Approved\'\\n\" +\r\n                \"  must return: DocB, DocC\\n\" +\r\n                \"\\n\" +\r\n                \"creationtime_between:\\n\" +\r\n                \"  queries for:\\n\" +\r\n                \"    creationTimeFrom: 20040101\\n\" +\r\n                \"    creationTimeTo:  20050101\\n\" +\r\n                \"    status = \'Approved\'\\n\" +\r\n                \"  must return: DocB\\n\" +\r\n                \"\\n\" +\r\n                \"creationtime_left_edge:\\n\" +\r\n                \"  queries for:\\n\" +\r\n                \"    creationTimeFrom: 20041224\\n\" +\r\n                \"    creationTimeTo:  20050101\\n\" +\r\n                \"    status = \'Approved\'\\n\" +\r\n                \"  must return: DocB\\n\" +\r\n                \"\\n\" +\r\n                \"creationtime_right_edge:\\n\" +\r\n                \"  queries for:\\n\" +\r\n                \"    creationTimeFrom: 20041124\\n\" +\r\n                \"    creationTimeTo:  20041224\\n\" +\r\n                \"    status = \'Approved\'\\n\" +\r\n                \"  must return: none\\n\" +\r\n                \"\\n\" +\r\n                \"creationtime_practicesetting:\\n\" +\r\n                \"  queries for: \\n\" +\r\n                \"    creation time:  20020101 thru 20060101\\n\" +\r\n                \"    practiceSettingCode: \'Dialysis\'\\n\" +\r\n                \"    status = \'Approved\'\\n\" +\r\n                \"  must return: DocD\\n\" +\r\n                \"\\n\" +\r\n                \"deprecated:\\n\" +\r\n                \"  queries for:\\n\" +\r\n                \"    status = \'Deprecated\'\\n\" +\r\n                \"  must return: DocE\\n\" +\r\n                \"\\n\" +\r\n                \"eventcode:\\n\" +\r\n                \"  queries for:\\n\" +\r\n                \"    eventCodeList = \'Colonoscopy\'\\n\" +\r\n                \"    status = \'Approved\'\\n\" +\r\n                \"  must return: DocB\\n\" +\r\n                \"\\n\" +\r\n                \"eventcode_scheme:\\n\" +\r\n                \"  queries for:\\n\" +\r\n                \"    eventCodeList = \'Colonoscopy\'\\n\" +\r\n                \"    eventCodeList = \'Connect-a-thon eventCodeList\'\\n\" +\r\n                \"    status = \'Approved\'\\n\" +\r\n                \"  must return: DocB\\n\" +\r\n                \"\\n\" +\r\n                \"formatcode:\\n\" +\r\n                \"  queries for:\\n\" +\r\n                \"    formatCode = \'CDAR2/IHE 1.0\'\\n\" +\r\n                \"    status = \'Approved\'\\n\" +\r\n                \"  must return: DocA, DocB, DocF, DocC\\n\" +\r\n                \"\\n\" +\r\n                \"hcftc:\\n\" +\r\n                \"  queries for:\\n\" +\r\n                \"    healthcareFacilty: Outpatient\\n\" +\r\n                \"    status: \'Approved\'\\n\" +\r\n                \"  must return: DocA, DocF, DocD\\n\" +\r\n                \"\\n\" +\r\n                \"hcftc_scheme:\\n\" +\r\n                \"  queries for:\\n\" +\r\n                \"    healthcareFacilty: Outpatient\\n\" +\r\n                \"    healthcareFaciltyScheme: \'Connect-a-thon healthcareFacilityTypeCodes\'\\n\" +\r\n                \"    status: \'Approved\'\\n\" +\r\n                \"  must return: DocF, DocD\\n\" +\r\n                \"\\n\" +\r\n                \"leafclass: \\n\" +\r\n                \"   queries for:\\n\" +\r\n                \"      all approved documents, DocE is deprecated so not returned\\n\" +\r\n                \"   returns LeafClass   \\n\" +\r\n                \"   must return: DocA, DocB, DocC, DocD, DocF\\n\" +\r\n                \"\\n\" +\r\n                \"no_matching_classcode:\\n\" +\r\n                \"   queries for class code not contained in test data\\n\" +\r\n                \"   must return: none\\n\" +\r\n                \"\\n\" +\r\n                \"object_refs: \\n\" +\r\n                \"   queries for:\\n\" +\r\n                \"      all approved documents, DocE is deprecated so not returned\\n\" +\r\n                \"   returns ObjectRefs   \\n\" +\r\n                \"   must return: DocA, DocB, DocC, DocD, DocF\\n\" +\r\n                \"\\n\" +\r\n                \"old_scheme:\\n\" +\r\n                \"   query using old format.  must return error since code not in CE format\\n\" +\r\n                \"\\n\" +\r\n                \"practicesetting:\\n\" +\r\n                \"  queries for:\\n\" +\r\n                \"    practiceSettingCode = \'Dialysis\'\\n\" +\r\n                \"    status = \'Approved\'\\n\" +\r\n                \"  must return: DocA, DocF, DocD\\n\" +\r\n                \"\\n\" +\r\n                \"practicesetting_scheme:\\n\" +\r\n                \"  queries for:\\n\" +\r\n                \"    practiceSettingCode = \'Dialysis\'\\n\" +\r\n                \"    practiceSettingCodeScheme = \'Connect-a-thon practiceSettingCodes\'\\n\" +\r\n                \"    status = \'Approved\'\\n\" +\r\n                \"  must return: DocA, DocD\\n\" +\r\n                \"\\n\" +\r\n                \"  NOTE: there is a parameter $XDSDocumentEntryPracticeSettingCodeScheme\\n\" +\r\n                \"  in this stored query.  This is not a mistake.   Extra parameters\\n\" +\r\n                \"  must be accepted and ignored by the stored query request parser.\\n\" +\r\n                \"  This parameter is no longer valid given the Code Type parameter\\n\" +\r\n                \"  format change but the parameter must still be accepted (and ignored)\\n\" +\r\n                \"  because of this ebRS rule.\\n\" +\r\n                \"\\n\" +\r\n                \"practicesetting_two:\\n\" +\r\n                \"  contains duplicate $XDSDocumentEntryPracticeSettingCode\\n\" +\r\n                \"  must return: error\\n\" +\r\n                \"\\n\" +\r\n                \"servicestarttime:\\n\" +\r\n                \"  queries for:\\n\" +\r\n                \"    serviceStartTimeFrom: 2005\\n\" +\r\n                \"    serviceStartTimeTo: 2006\\n\" +\r\n                \"    status = \'Approved\' \\n\" +\r\n                \"  must return: DocC, DocD\\n\" +\r\n                \"\\n\" +\r\n                \"servicestoptime:\\n\" +\r\n                \"  queries for:\\n\" +\r\n                \"    serviceStopTimeFrom: 2005\\n\" +\r\n                \"    serviceStopTimeTo: 2006\\n\" +\r\n                \"    status = \'Approved\' \\n\" +\r\n                \"  must return: DocC, DocD\\n\");\r\n\r\n        collectionsReadme.put(\"11898\", \"SQ.b FindSubmissionSets Stored Query\\n\" +\r\n                \"\\n\" +\r\n                \"Stored Query must use SOAP version 1.2 \\n\" +\r\n                \"\\n\" +\r\n                \"This test contains many many test steps each validating one \\n\" +\r\n                \"aspect of the FindSubmissionSets stored query.  \\n\" +\r\n                \"Relies on test data loaded by test 12346\\n\" +\r\n                \"\\n\" +\r\n                \"\\n\" +\r\n                \"The test steps are:\\n\" +\r\n                \"\\n\" +\r\n                \"simple\\n\" +\r\n                \"\\tBasic query using patient ID and status\\n\" +\r\n                \"\\n\" +\r\n                \"other_sourceid\\n\" +\r\n                \"\\tAdds selection on non-existant sourceId\\n\" +\r\n                \"\\n\" +\r\n                \"submissiontime_in\\n\" +\r\n                \"\\tIncludes all 5 in submission time range\\n\" +\r\n                \"\\n\" +\r\n                \"submissiontime_out\\n\" +\r\n                \"\\tIncludes none in submission time range\\n\" +\r\n                \"\\n\" +\r\n                \"submissiontime_no_start\\n\" +\r\n                \"\\tNo start time specified - includes all 5\\n\" +\r\n                \"\\n\" +\r\n                \"submissiontime_no_end\\n\" +\r\n                \"\\tNo end time - includes all 5\\n\" +\r\n                \"\\n\" +\r\n                \"author_all\\n\" +\r\n                \"\\tSelect all 5 based on same author\\n\" +\r\n                \"\\n\" +\r\n                \"author_none\\n\" +\r\n                \"\\tSelect none based on different author\\n\" +\r\n                \"\\t\\n\" +\r\n                \"contenttype_all\\n\" +\r\n                \"\\tSelect all 5 based on same content type\\n\" +\r\n                \"\\n\" +\r\n                \"contenttype_none\\n\" +\r\n                \"\\tSelect none based on different content type\\n\");\r\n\r\n        collectionsReadme.put(\"11899\", \"SQ.b FindFolders Stored Query\\n\" +\r\n                \"\\n\" +\r\n                \"This test relies on test 12346 to pre-load test data.\\n\" +\r\n                \"\\n\" +\r\n                \"basic\\n\" +\r\n                \"\\tBasic operation based on Patient ID parameter\\n\" +\r\n                \"\\n\" +\r\n                \"in_updatetime\\n\" +\r\n                \"\\tFilter with update time\\n\" +\r\n                \"\\n\" +\r\n                \"out_updatetime\\n\" +\r\n                \"\\tFilter with update time\\n\");\r\n\r\n        collectionsReadme.put(\"11901\", \"SQ.b GetDocuments Stored Query\\n\" +\r\n                \"\\n\" +\r\n                \"This test relies on test 12346 to pre-load test data.\\n\" +\r\n                \"\\n\" +\r\n                \"Stored Query must use SOAP version 1.2 \\n\" +\r\n                \"\\n\" +\r\n                \"Test Steps\\n\" +\r\n                \"\\n\" +\r\n                \"uniqueid\\n\" +\r\n                \"\\tOperation with UniqueId\\n\" +\r\n                \"\\n\" +\r\n                \"uniqueid2\\n\" +\r\n                \"\\tOperation with multiple UniqueIds\\n\" +\r\n                \"\\n\" +\r\n                \"uuid\\n\" +\r\n                \"\\tOperation with UUID\\n\" +\r\n                \"\\n\" +\r\n                \"uuid2\\n\" +\r\n                \"\\tOperation with multiple UUIDs\\n\" +\r\n                \"\\n\" +\r\n                \"uuid_multiple_slot_values\\n\" +\r\n                \"\\tSQ parameter values spread across multiple Value transactions\\n\" +\r\n                \"of a Slot.  (CP 295)\\n\" +\r\n                \"\\n\" +\r\n                \"homeCommunityId\\n\" +\r\n                \"\\tSection 3.18.4.1.3, part 4, For Document Registry Actors says\\n\" +\r\n                \"\\tthat the Document Registry must accept the homeCommunityId\\n\" +\r\n                \"\\ton a Stored Query. This test repeats step uniqueid above\\n\" +\r\n                \"\\tbut with the homeCommunityId present.\\n\" );\r\n\r\n        collectionsReadme.put(\"11902\", \"SQ.b GetFolders Stored Query\\n\" +\r\n                \"\\n\" +\r\n                \"This test validates the operation of the GetFolders stored query.  It\\n\" +\r\n                \"relies on test 12346 to pre-load test data into the Registry.\\n\" );\r\n\r\n        collectionsReadme.put(\"11903\", \"SQ.b GetAssociations Stored Query\\n\" +\r\n                \"\\n\" +\r\n                \"Relies on test data loaded by test 12346\\n\" +\r\n                \"\\n\" +\r\n                \"Test Steps\\n\" +\r\n                \"\\n\" +\r\n                \"single_from_doc\\n\" +\r\n                \"\\tSingle association referencing document\\n\" +\r\n                \"\\n\" +\r\n                \"multiple_assoc_from_doc\\n\" +\r\n                \"\\tmultiple associations referencing document\\n\" +\r\n                \"\\n\" +\r\n                \"multiple_assoc_from_ss\\n\" +\r\n                \"\\tmultiple associations referencing ss\\n\" +\r\n                \"\\n\" +\r\n                \"multiple_doc\\n\" +\r\n                \"\\tInput references multiple documents\\n\" );\r\n\r\n        collectionsReadme.put(\"11904\", \"SQ.b GetDocumentsAndAssociations Stored Query\\n\" +\r\n                \"\\n\" +\r\n                \"Test 12346 must be run first to load test data into the Registry.\\n\" +\r\n                \"\\n\" +\r\n                \"Test Steps\\n\" +\r\n                \"\\n\" +\r\n                \"uniqueid\\n\" +\r\n                \"\\tQuery with uniqueId.  DocumentEntry targeted was submitted alone in submissionset so\\n\" +\r\n                \"\\tonly the DocumentEntry and a single Association should be returned.\\n\" +\r\n                \"\\n\" +\r\n                \"uniqueids\\n\" +\r\n                \"\\tQuery with two UniqueIds.  One of the targeted DocumentEntries is the same as\\n\" +\r\n                \"\\tabove.  The second is a member of a Folder. Two DocumentEntries are expected\\n\" +\r\n                \"\\tback and 3 Associations: SubmissionSet to DocumentEntry association for each\\n\" +\r\n                \"\\tDocumentEntry AND a single Folder to DocumentEntry association for the second\\n\" +\r\n                \"\\tDocumentEntry.\\n\" +\r\n                \"\\n\" +\r\n                \"uuid\\n\" +\r\n                \"\\tOperation with UUID. This is a repeat of step uniqueid above but starting with the\\n\" +\r\n                \"\\tUUID of the DocumentEntry instead of the uniqueId.\\n\" +\r\n                \"\\n\" +\r\n                \"uuids\\n\" +\r\n                \"\\tOperation with two UUIDs.  This is a repeat of step uniqueids above but starting\\n\" +\r\n                \"\\twith the UUIDs of the DocumentEntries instead of the uniqueIds.\\n\" );\r\n\r\n        collectionsReadme.put(\"11905\", \"SQ.b GetSubmissionSets Stored Query\\n\" +\r\n                \"\\n\" +\r\n                \"Relies on test data loaded by test 12346\\n\" +\r\n                \"\\n\" +\r\n                \"Test Steps\\n\" +\r\n                \"\\n\" +\r\n                \"doc_uuid\\n\" +\r\n                \"\\tDocument UUID as parameter\\n\" +\r\n                \"\\n\" +\r\n                \"two_doc_uuid_two_ss\\n\" +\r\n                \"\\tTwo Document UUIDs as parameters, each in different submission set\\n\" +\r\n                \"\\n\" +\r\n                \"two_doc_uuid_one_ss\\n\" +\r\n                \"\\tTwo Document UUIDs as parameters, both from same submission set\\n\" +\r\n                \"\\n\" +\r\n                \"fol_uuid\\n\" +\r\n                \"\\tFolder UUID as parameter\\n\" +\r\n                \"\\n\" +\r\n                \"doc_and_fol\\n\" +\r\n                \"\\tTwo UUIDS, document and folder from different submission sets\\n\" );\r\n        collectionsReadme.put(\"11906\", \"SQ.b GetSubmissionSetAndContents Stored Query\\n\" +\r\n                \"\\n\" +\r\n                \"Stored Query must use SOAP version 1.2 \\n\" +\r\n                \"\\n\" +\r\n                \"Test 12346 must be run first to load test data needed\\n\" +\r\n                \"for this test.\\n\" +\r\n                \"\\n\" +\r\n                \"uniqueid\\n\" +\r\n                \"\\tQuery based on uniqueId\\n\" +\r\n                \"\\n\" +\r\n                \"folder_and_docs\\n\" +\r\n                \"\\tQuery based on uniqueId. Submission Set includes multiple documents and a folder.\\n\" +\r\n                \"\\n\" +\r\n                \"uuid\\n\" +\r\n                \"\\tQuery based on uuid\\n\" +\r\n                \"\\n\" +\r\n                \"format_code\\n\" +\r\n                \"\\tFilter the documents via Format code\\n\" +\r\n                \"\\n\" +\r\n                \"conf_code\\n\" +\r\n                \"\\tFilter the documents via Confidentialitiy code\\n\" +\r\n                \"\\t\\n\" +\r\n                \"objectrefs\\n\" +\r\n                \"\\tRequest ObjectRefs instead of LeafClass. Should return 3 ObjectRefs.\\n\" +\r\n                \"\\n\" +\r\n                \"In the folder_and_docs, format_code,  and conf_code sections, one \\n\" +\r\n                \"of two DocumentEntries are returned. So, the SQ results include the SS, the folder, one DocumentEntry, and Associations between:\\n\" +\r\n                \"\\tSS and Folder\\n\" +\r\n                \"\\tSS and DocumentEntry\\n\" +\r\n                \"\\tFolder and DocumentEntry\\n\" );\r\n\r\n        collectionsReadme.put(\"11907\", \"SQ.b GetFolderAndContents Stored Query\\n\" +\r\n                \"\\n\" +\r\n                \"Relies on test data loaded by test 12346\\n\" +\r\n                \"\\n\" +\r\n                \"Test Steps\\n\" +\r\n                \"\\n\" +\r\n                \"uniqueid\\n\" +\r\n                \"\\tOperation with UniqueId\\n\" +\r\n                \"\\n\" +\r\n                \"uuid\\n\" +\r\n                \"\\tOperation with UUID\\n\" +\r\n                \"\\n\" +\r\n                \"conf_code\\n\" +\r\n                \"\\tOperation with UUID and confidentialityCode\\n\" +\r\n                \"\\n\" +\r\n                \"both_conf_code\\n\" +\r\n                \"\\tOperation with UUID and confidentialityCode\\n\" +\r\n                \"\\n\" +\r\n                \"format_code\\n\" +\r\n                \"\\tOperation with UUID and formatCode\\n\" );\r\n\r\n        collectionsReadme.put(\"11908\", \"SQ.b GetFoldersForDocument Stored Query\\n\" );\r\n\r\n        collectionsReadme.put(\"11909\", \"SQ.b GetRelatedDocuments Stored Query\\n\" +\r\n                \"\\n\" +\r\n                \"Stored Query must use SOAP version 1.2\\n\" +\r\n                \"\\n\" +\r\n                \"Relies on test data loaded by test 12346\\n\" +\r\n                \"\\n\" +\r\n                \"\\n\" +\r\n                \"Test Steps\\n\" +\r\n                \"\\n\" +\r\n                \"no_initial_doc\\n\" +\r\n                \"\\tOriginal document does not exist. Nothing returned.\\n\" +\r\n                \"\\n\" +\r\n                \"uniqueid_no_related\\n\" +\r\n                \"\\tOperation with single UniqueId as input but no related documents\\n\" +\r\n                \"\\n\" +\r\n                \"uuid_no_related\\n\" +\r\n                \"\\tOperation with single UUID as input but no related documents\\n\" +\r\n                \"\\n\" +\r\n                \"uniqueid\\n\" +\r\n                \"\\tOperation with single UniqueId as input.\\n\" +\r\n                \"\\n\" +\r\n                \"near_folder\\n\" +\r\n                \"\\tOperation near a folder.  Folders and Submission Sets are not returnd.\\n\" +\r\n                \"\\n\" +\r\n                \"uuid\\n\" +\r\n                \"\\tOperation with UUID input\\n\" +\r\n                \"\\n\" );\r\n\r\n        collectionsReadme.put(\"11966\", \"PnR.b Accept document\\n\" +\r\n                \"\\n\" +\r\n                \"submit - Generate a Provide and Register.b transaction to the Repository\\n\" +\r\n                \"under test which is already configured to forward Register.b\\n\" +\r\n                \"transactions to the Public Registry.\\n\" +\r\n                \"\\n\" +\r\n                \"eval - The Public Registry is queried to validate the metadata forwarded.\\n\" +\r\n                \"When using xdstest to run this step, make sure it sends to the Public\\n\" +\r\n                \"Registry.  This can be done using the -s pub command line option to\\n\" +\r\n                \"xdstest.\" );\r\n\r\n        collectionsReadme.put(\"11979\", \"PnR.b Accept two documents\\n\" +\r\n                \"\\n\" +\r\n                \"submit - Generate a Provide and Register.b transaction to the Repository\\n\" +\r\n                \"under test which is already configured to forward Register.b\\n\" +\r\n                \"transactions to the Public Registry.\\n\" +\r\n                \"\\n\" +\r\n                \"eval - The Public Registry is queried to validate the metadata forwarded.\\n\" +\r\n                \"When using xdstest to run this step, make sure it sends to the Public\\n\" +\r\n                \"Registry.  This can be done using the -s pub command line option to\\n\" +\r\n                \"xdstest.\\n\" );\r\n\r\n        collectionsReadme.put(\"11983\", \"PnR.b Reject submissions where metadata and documents do not match\\n\" +\r\n                \"\\n\" +\r\n                \"The submit and eval directories hold test steps with the same names, \\n\" +\r\n                \"shown below.  The submit tests test that the proper error is returned.  \\n\" +\r\n                \"The eval tests test that no contents are present in the Registry.\\n\" +\r\n                \"\\n\" +\r\n                \"*_no_metadata\\n\" +\r\n                \"\\tA document is present as attachment but no XDSDocuementEntry is \\n\" +\r\n                \"present in metadata. The error XDSMissingDocumentMetadata must be returned.\\n\" +\r\n                \"\\n\" +\r\n                \"*_no_doc\\n\" +\r\n                \"\\tA XDSDocumentEntry is present in metadata but no corresponding \\n\" +\r\n                \"document is attached. The error XDSMissingDocument must be returned.\\n\" );\r\n\r\n        collectionsReadme.put(\"11986\", \"PnR.b Return Errors from Registry\\n\" +\r\n                \"\\n\" +\r\n                \"Send a Provide and Register.b transaction to Repository which then \\n\" +\r\n                \"forwards the metadata to the Public Registry.  The metadata contains\\n\" +\r\n                \"a known flaw for which the Public Registry will return a known\\n\" +\r\n                \"error code.  The test validates that the error code is returned\\n\" +\r\n                \"through the Repository back to the Document Source.\" );\r\n\r\n        collectionsReadme.put(\"11990\", \"R.b Accept register one document\\n\" +\r\n                \"\\n\" +\r\n                \"submit - Generate Register.b transaction to your Registry\\n\" +\r\n                \"\\n\" +\r\n                \"eval - use SQ (GetSubmissionSetAndContents) to verify registry contents\" );\r\n        collectionsReadme.put(\"11991\", \"R.b Accept register two documents\\n\" +\r\n                \"\\n\" +\r\n                \"submit - Generate Register.b transaction to your Registry\\n\" +\r\n                \"\\n\" +\r\n                \"eval - use SQ to verify registry contents\" );\r\n        collectionsReadme.put(\"11992\", \"R.b Accept Document Replace\\n\" +\r\n                \"\\n\" +\r\n                \"submit - submit single document\\n\" +\r\n                \"\\n\" +\r\n                \"rplc - issue a document replace\\n\" +\r\n                \"\\n\" +\r\n                \"eval - Verify the new document exists, the old is deprecated and the\\n\" +\r\n                \"RPLC Association is in place.\" );\r\n        collectionsReadme.put(\"11993\", \"R.b Accept Document Addendum\\n\" +\r\n                \"\\n\" +\r\n                \"submit\\n\" +\r\n                \"\\tsubmit  - submit a document\\n\" +\r\n                \"\\tsubmit_copy - submit a second copy of the document\\n\" +\r\n                \"\\n\" +\r\n                \"rplc\\n\" +\r\n                \"\\trplc - replace document from step submit_copy\\n\" +\r\n                \"\\n\" +\r\n                \"apnd\\n\" +\r\n                \"\\tapnd - add ammendment to document from step submit\\n\" +\r\n                \"\\tapnd_rplc - add ammendment to document from step submit_copy - must fail\\n\" +\r\n                \"\\n\" +\r\n                \"eval\\n\" +\r\n                \"\\tvalidate_original - verify document from step submit has status Approved (apnd didn\'t change it)\\n\" +\r\n                \"\\tvalidate_apnd - verify document from step apnd is present and has status Approved\\n\" +\r\n                \"\\tno_validate_rplc_apnd - verify metadata from step apnd_rplc was not stored\\n\"  );\r\n\r\n        collectionsReadme.put(\"11994\", \"R.b Accept Document Transformation\\n\" +\r\n                \"\\n\" +\r\n                \"submit\\n\" +\r\n                \"\\tsubmit  - submit a document\\n\" +\r\n                \"\\tsubmit_copy - submit a second copy of the document\\n\" +\r\n                \"\\n\" +\r\n                \"rplc\\n\" +\r\n                \"\\trplc - replace document from step submit_copy\\n\" +\r\n                \"\\n\" +\r\n                \"xfrm\\n\" +\r\n                \"\\txfrm - add transformation to document from step submit\\n\" +\r\n                \"\\txfrm_rplc - add transformation to document from step submit_copy - must fail\\n\" +\r\n                \"\\n\" +\r\n                \"eval\\n\" +\r\n                \"\\tvalidate_original - verify document from step submit has status Approved (apnd didn\'t change it)\\n\" +\r\n                \"\\tvalidate_xfrm - verify document from step apnd is present and has status Approved\\n\" +\r\n                \"\\tno_validate_rplc_xfrm - verify metadata from step xfrm_rplc was not stored\\n\"  );\r\n        collectionsReadme.put(\"11995\", \"R.b Accept document replace with transformation\\n\" +\r\n                \"\\n\" +\r\n                \"submit - Submit a document\\n\" +\r\n                \"\\n\" +\r\n                \"rplc - Submit a replacement document\\n\" +\r\n                \"\\n\" +\r\n                \"eval - Verify the original document is deprecated, the replacement \\n\" +\r\n                \"document exists, and the RPLC association is in place.\\n\"  );\r\n        collectionsReadme.put(\"11996\", \"R.b Reject Submission of Invalid Patient ID\\n\" +\r\n                \"\\n\" +\r\n                \"Verify a Register.b transaction is rejected by your Registry given\\n\" +\r\n                \"that it carried an unknown Patient ID.  The correct error code\\n\" +\r\n                \"(XDSUnknownPatientId) must be returned.\" );\r\n        collectionsReadme.put(\"11997\", \"R.b Reject Submission Set, Patient ID does not match Document\\n\" +\r\n                \"\\n\" +\r\n                \"submit - Send a Register.b transaction to your Registry where the \\n\" +\r\n                \"Patient ID on the Submission Set and Document do not match.  Verify the\\n\" +\r\n                \"correct error code (XDSPatientIdDoesNotMatch) is returned.\\n\" +\r\n                \"\\n\" +\r\n                \"eval - Verify submission did not update registry.\" );\r\n        collectionsReadme.put(\"11998\", \"R.b Reject Submission, Patient ID on Replacement Document does not match Original\\n\" +\r\n                \"\\n\" +\r\n                \"submit - submit single document\\n\" +\r\n                \"\\n\" +\r\n                \"rplc - allocate new Patient ID and then issue a document replace.  Transaction must fail.\\n\" +\r\n                \"\\n\" +\r\n                \"eval - Verify the new DocumentEntry does not exist, the old still has status Approved\" );\r\n        collectionsReadme.put(\"11999\", \"R.b Accept Create Folder\\n\" +\r\n                \"\\n\" +\r\n                \"submit - Submit an empty folder\\n\" +\r\n                \"\\n\" +\r\n                \"eval - Use SQ (GetSubmissionSetAndContents) to verify registry has new folder\" );\r\n\r\n        collectionsReadme.put(\"12000\", \"R.b Accept Create Folder with Initial Document\\n\" +\r\n                \"\\n\" +\r\n                \"submit - Submit a folder containing a document\\n\" +\r\n                \"\\n\" +\r\n                \"eval - Use SQ to verify registry has new folder, new document, and that\\n\" +\r\n                \"the document is in the folder. Step eval_folder uses \\n\" +\r\n                \"GetSubmissionSetAndContents and step eval_assoc uses GetFolderAndContents \\n\" +\r\n                \"stored queries\");\r\n        collectionsReadme.put(\"12001\", \"R.b Add new document to existing folder\\n\" +\r\n                \"\\n\" +\r\n                \"create_folder - creates a folder to work in\\n\" +\r\n                \"\\n\" +\r\n                \"add_to_folder - adds document to folder\\n\" +\r\n                \"\\n\" +\r\n                \"eval - verify registry contents\\n\" );\r\n        collectionsReadme.put(\"12002\", \"R.b Reject Add Document to Folder - Patient ID does not match\\n\" +\r\n                \"\\n\" +\r\n                \"create_folder - creates a folder to work in\\n\" +\r\n                \"\\n\" +\r\n                \"add_to_folder - attempt add document to folder with different Patient ID\\n\" +\r\n                \"\\n\" +\r\n                \"eval - verify registry contents\\n\" );\r\n        collectionsReadme.put(\"12004\", \"R.b Document Resubmission\\n\" +\r\n                \"\\n\" +\r\n                \"Test Purpose\\n\" +\r\n                \"\\n\" +\r\n                \"The creation of a document and the submission of a document are different \\n\" +\r\n                \"events.  A document created within an EHR could be forwarded as reference \\n\" +\r\n                \"to multiple parties.  A lab report is an example.  Each party could then \\n\" +\r\n                \"submit this document as evidence to support an action taken.  Now, as a \\n\" +\r\n                \"second issue, this report is based on the CDA format and the Content \\n\" +\r\n                \"Profile requires that the XDSDocumentEntry.uniqueId be the value of \\n\" +\r\n                \"attribute x in the CDA.  Now, if both parties are truly submitting the same \\n\" +\r\n                \"document (hash matches) then this should not cause a conflict. They cannot \\n\" +\r\n                \"allocate a new uniqueId for one of the copies because the Content Profile \\n\" +\r\n                \"stipulates taking the value from the document header.  This test validates:\\n\" +\r\n                \"\\n\" +\r\n                \"1) That resubmission does not generate an error\\n\" +\r\n                \"2) That an apparent resubmission (same uniqueId) but different hash (different content) is rejected\\n\" +\r\n                \"3) Both copies are available in query\\n\" +\r\n                \"\\n\" +\r\n                \"submit\\n\" +\r\n                \"\\tSubmit a Submission Set containing a single document\\n\" +\r\n                \"\\n\" +\r\n                \"resubmit_doc\\n\" +\r\n                \"\\tResubmit same with document having same XDSDocumentEntry.uniqueId and\\n\" +\r\n                \"XDSDocumentEntry.hash.  The Register must be successful.\\n\" +\r\n                \"\\n\" +\r\n                \"resubmit_doc_diff_hash\\n\" +\r\n                \"\\tResubmit again with document having a different value in \\n\" +\r\n                \"XDSDocumentEntry.hash but same value in XDSDocumentEntry.uniqueId.  This must \\n\" +\r\n                \"return errorCode XDSDuplicateUniqueIdInRegistry.\\n\");\r\n        collectionsReadme.put(\"12021\", \"Ret.b Accept retrieve document set - two documents\\n\" +\r\n                \"\\n\" +\r\n                \"submit - Send a Provide and Register.b transaction to your Repository which\\n\" +\r\n                \"forwards the metadata to the Public Registry. Your Repository must\\n\" +\r\n                \"be properly configured (see wiki at\\n\" +\r\n                \"http://ihewiki.wustl.edu/wiki/index.php/XDS_Test_Kit_2007-2008_Test_Descriptions#12021).\\n\" +\r\n                \"\\n\" +\r\n                \"query - Use Stored Query to fetch the repositoryUniqueId and document\\n\" +\r\n                \"uniqueId for each document. Make sure to have xdstest configured to \\n\" +\r\n                \"query from the Public Registry.\\n\" +\r\n                \"\\n\" +\r\n                \"retrieve - Use the above parameters to generate a Retrieve Document\\n\" +\r\n                \"Set transaction for both documents.\\n\" );\r\n        collectionsReadme.put(\"12028\", \"Ret.b Accept retrieve document set - single document with TLS\\n\" +\r\n                \"\\n\" +\r\n                \"submit - Issue a Provide and Registry.b transaction to load your\\n\" +\r\n                \"repository with a document.  Your repository must forward the metadata\\n\" +\r\n                \"to the Public Registry.\\n\" +\r\n                \"\\n\" +\r\n                \"query - Query the Public Registry to get the metadata as submitted\\n\" +\r\n                \"by the Repository.\\n\" +\r\n                \"\\n\" +\r\n                \"retrieve - Issue a Retrieve Document Set transaction to your repository\\n\" +\r\n                \"to get the document.  This must be done over TLS.\\n\");\r\n        collectionsReadme.put(\"12029\", \"Ret.b Accept retrieve document set - single document\\n\" +\r\n                \"\\n\" +\r\n                \"Configure Repository to forward Register.b transactions to the Public\\n\" +\r\n                \"Registry\\n\" +\r\n                \"\\n\" +\r\n                \"submit - submit a single document to the Repository\\n\" +\r\n                \"\\n\" +\r\n                \"query - query the Public Registry for metadata\\n\" +\r\n                \"\\n\" +\r\n                \"retrieve - retrieve document\\n\");\r\n        collectionsReadme.put(\"12084\", \"R.b Submission Stored - All or Nothing\\n\" +\r\n                \"\\n\" +\r\n                \"submit - Send a Register.b transaction including two documents.  The\\n\" +\r\n                \"metadata for one document is flawed (no repositoryUniqueId attribute).  \\n\" +\r\n                \"The transaction must fail.\\n\" +\r\n                \"\\n\" +\r\n                \"eval - use SQ to prove that nothing was stored.\");\r\n        collectionsReadme.put(\"12309\", \"XCQ FindDocuments for ObjectRef\\n\" +\r\n                \"\\n\" +\r\n                \"Depends on test 12318 (which targets a Document Repository) to initialize the test data.\\n\" +\r\n                \"\\n\" +\r\n                \"Assertions test the following:\\n\" +\r\n                \"\\n\" +\r\n                \"homeMatch1 - first ObjectRef has correct home attribute (value from xdstest2tool/mgmt/default.xml\\n\" +\r\n                \"\\n\" +\r\n                \"homeMatch2 - second ObjectRef has correct home attribute (value from xdstest2tool/mgmt/default.xml\\n\" +\r\n                \"\\n\" +\r\n                \"ObjectRefCount - Query returns 2 ObjectRefs\\n\" );\r\n        collectionsReadme.put(\"12310\", \"XCQ FindDocuments for LeafClass\\n\" +\r\n                \"\\n\" +\r\n                \"This test depends on test 12318 to initialize test data.\\n\" +\r\n                \"\\n\" +\r\n                \"There is a single test step.\\n\" +\r\n                \"\\n\" +\r\n                \"LeafClass indicates that the entire XML description of the document of interest will be returned.\\n\" +\r\n                \"\\n\" +\r\n                \"Assertions test the following conditions:\\n\" +\r\n                \"\\n\" +\r\n                \"ExtrinsicObjectCount - 2 ExtrinsicObject returned\\n\" +\r\n                \"\\n\" +\r\n                \"ExtrinsicObjectsApproved - both ExtrinsicObject have status of Approved\\n\" +\r\n                \"\\n\" +\r\n                \"homeMatch1 - home attribute on first ExtrinsicObject matches configuration\\n\" +\r\n                \" in xdstest2tool/mgmt/default.xml\\n\" +\r\n                \"\\n\" +\r\n                \"homeMatch2 - home attribute on second ExtrinsicObject matches \\n\" +\r\n                \"configuration in xdstest2tool/mgmt/default.xml\\n\" +\r\n                \"\\n\" +\r\n                \"Implicit Assertions:\\n\" +\r\n                \"\\n\" +\r\n                \"Metadata validates against Schema\\n\" +\r\n                \"\\n\" +\r\n                \"Metadata validates against XDS Metadata Validator\\n\" );\r\n        collectionsReadme.put(\"12311\", \"XCQ GetDocuments Cross Community Query\\n\" +\r\n                \"\\n\" +\r\n                \"This test is dependent on test 12309 which does a FindDocuments query returning ObjectRefs.  \\n\" +\r\n                \"This test takes those ObjectRefs and retrieves (really query) the full metadata from the \\n\" +\r\n                \"Receiving Gateway. This approach to the use of metadata is important in case the original \\n\" +\r\n                \"FindDocuments query returned a large quantity of ObjectRefs then the GetDocuments query \\n\" +\r\n                \"would be used to retreive the full metadata a bunch at a time. \\n\" +\r\n                \"\\n\" +\r\n                \"BTW, test 12309 is dependent on test 12318 to load test data.\\n\" +\r\n                \"\\n\" +\r\n                \"\\n\" +\r\n                \"There are several test steps:\\n\" +\r\n                \"\\n\" +\r\n                \"uuid1 - issues a GetDocuments XGQ for a single document based on its UUID\\n\" +\r\n                \"\\n\" +\r\n                \"uuid2 - same query but asking for 2 documents\\n\" +\r\n                \"\\n\" +\r\n                \"Each test step references the log.xml file of test 12309 \\n\" +\r\n                \"(FindDocuments XGQ for ObjectRefs) to get the starting ObjectRefs.\\n\" +\r\n                \"\\n\" +\r\n                \"Each test uses the following assertions:\\n\" +\r\n                \"\\n\" +\r\n                \"ExtrinsicObjectCount - Correct # of ExtrinsicObjects returned\\n\" +\r\n                \"\\n\" +\r\n                \"ExtrinsicObjectsApproved - both ExtrinsicObject have status of Approved\\n\" +\r\n                \"\\n\" +\r\n                \"homeMatch* - home attribute on ExtrinsicObject matches configuration\\n\" +\r\n                \" in xdstest2tool/mgmt/default.xml\\n\" +\r\n                \"\\n\" +\r\n                \"\\n\" +\r\n                \"Implicit Assertions:\\n\" +\r\n                \"\\n\" +\r\n                \"Metadata validates against Schema\\n\" +\r\n                \"\\n\" +\r\n                \"Metadata validates against XDS Metadata Validator\\n\" );\r\n        collectionsReadme.put(\"12312\", \"XCR Retrieve single document\\n\" +\r\n                \"\\n\" +\r\n                \"This test has two parts:\\n\" +\r\n                \"\\n\" +\r\n                \"==============================================\\n\" +\r\n                \"correct - show correct operation\\n\" +\r\n                \"\\n\" +\r\n                \"Generate request for the retrieval of a single document based \\n\" +\r\n                \"on metadata returned in test 12311.\\n\" +\r\n                \"\\n\" +\r\n                \"Based on the XDSDocument.uniqueId, repositoryUniqueId, and homeCommunityId returned \\n\" +\r\n                \"in test 12311, issue a RetrieveDocumentSet transaction to retrieve a document.  \\n\" +\r\n                \"\\n\" +\r\n                \"When successful, perform the following validations:\\n\" +\r\n                \"\\n\" +\r\n                \"* Single document returned\\n\" +\r\n                \"\\n\" +\r\n                \"* RepositoryUniqueId matches request\\n\" +\r\n                \"\\n\" +\r\n                \"* DocumentUniqueId matches request\\n\" +\r\n                \"\\n\" +\r\n                \"* MimeType matches metadata from test 12311\\n\" +\r\n                \"\\n\" +\r\n                \"* Document hash, as calculated after the retrieve, matches value in metadata from test 12311\\n\" +\r\n                \"\\n\" +\r\n                \"* HomeCommunityId matches configuration\\n\" +\r\n                \"\\n\" +\r\n                \"\\n\" +\r\n                \"==============================================\\n\" +\r\n                \"missing_home - show proper error (XDSMissingHomeCommunityId) returned when \\n\" +\r\n                \"homeCommunityId not in request\\n\" );\r\n        collectionsReadme.put(\"12313\", \"XCR Retrieve multiple document\\n\" +\r\n                \"\\n\" +\r\n                \"Generate request for the retrieval of two documents based on metadata returned in test 12311.\\n\" +\r\n                \"\\n\" +\r\n                \"Based on the XDSDocument.uniqueId, repositoryUniqueId, and homeCommunityId returned in test 12311, \\n\" +\r\n                \"issue a RetrieveDocumentSet transaction to retrieve two documents.  \\n\" );\r\n        collectionsReadme.put(\"12314\", \"XCQ FindDocuments for ObjectRef over TLS\\n\" +\r\n                \"\\n\" +\r\n                \"The following is done over a TLS based channel.\\n\" +\r\n                \"\\n\" +\r\n                \"Depends on test 12318 to initialize the test data.\\n\" +\r\n                \"\\n\" +\r\n                \"Assertions test the following:\\n\" +\r\n                \"\\n\" +\r\n                \"homeMatch1 - first ObjectRef has correct home attribute (value from xdstest2tool/mgmt/default.xml\\n\" +\r\n                \"\\n\" +\r\n                \"homeMatch2 - second ObjectRef has correct home attribute (value from xdstest2tool/mgmt/default.xml\\n\" +\r\n                \"\\n\" +\r\n                \"ObjectRefCount - Query returns 2 ObjectRefs\\n\" );\r\n        collectionsReadme.put(\"12323\", \"R.b Folder lastUpdateTime\\n\" +\r\n                \"\\n\" +\r\n                \"This test verifies that the registry properly sets the XDSFolder.lastUpdateTime\\n\" +\r\n                \"attribute.\\n\" +\r\n                \"\\n\" +\r\n                \"Steps\\n\" +\r\n                \"\\n\" +\r\n                \"no_time - submit folder with no lastUpdateTime attribute\\n\" +\r\n                \"\\n\" +\r\n                \"has_time - submit folder with lastUpdateTime attribute (old date)\\n\" +\r\n                \"\\n\" +\r\n                \"verify_no_submission_time - use GetFolder stored query to retrieve\\n\" +\r\n                \"folder from no_time step.  Verify the XDSFolder.lastUpdateTime\\n\" +\r\n                \"attribute shows today\'s date.\\n\" +\r\n                \"\\n\" +\r\n                \"verify_has_submission_time - use GetFolder stored query to retrieve\\n\" +\r\n                \"folder from has_time step.  Verify the XDSFolder.lastUpdateTime\\n\" +\r\n                \"attribute shows today\'s date.\\n\" +\r\n                \"\\n\" +\r\n                \"add_to_folder - submit a new DocumentEntry adding it to the folder\\n\" +\r\n                \"submitted in step has_time\\n\" +\r\n                \"\\n\" +\r\n                \"verify_time_updated - use GetFolder stored query to verify that \\n\" +\r\n                \"XDSFolder.lastUpdateTime was updated by the add_to_folder step.  Your\\n\" +\r\n                \"ability to pass this step depends on how you test and the precision \\n\" +\r\n                \"of XDSFolder.lastUpdateTime in your implementation.  The XD* profiles do not specify the time precision. If you only support time precision \\n\" +\r\n                \"to the minute and you run step add_to_folder a few seconds after step \\n\" +\r\n                \"has_time then XDSFolder.lastUpdateTime will not show any change.  You will \\n\" +\r\n                \"have to wait a minute or two before running this step to show that your \\n\" +\r\n                \"Registry manages this attribute correctly.  If you support a 1 second \\n\" +\r\n                \"granularity or better then the automatic running of this test will probably \\n\" +\r\n                \"work fine for you.\\n\" +\r\n                \"\\n\" +\r\n                \"rplc - replace document submitted in step add_to_folder.  This must update\\n\" +\r\n                \"the lastUpdateTime on the folder\\n\" +\r\n                \"\\n\" +\r\n                \"verify_time_updated_by_rplc - verify the rplc step did update\\n\" +\r\n                \"lastUpdateTime on the folder\\n\" );\r\n        collectionsReadme.put(\"12326\", \"R.b Add Existing document to existing folder\\n\" +\r\n                \"\\n\" +\r\n                \"This test validates a Registry\'s ability to perform a basic Folder\\n\" +\r\n                \"operation, adding a Document already in Registry to a Folder also \\n\" +\r\n                \"already in Registry.\\n\" +\r\n                \"\\n\" +\r\n                \"create_folder - creates a folder and a document to work with\\n\" +\r\n                \"\\n\" +\r\n                \"add_to_folder - adds document to folder\\n\" +\r\n                \"\\n\" +\r\n                \"eval - verify registry contents\\n\" +\r\n                \"\\n\" +\r\n                \"\\n\" +\r\n                \"FAQ regarding the add_to_folder section:\\n\" +\r\n                \"\\n\" +\r\n                \"Q: I have a little problem with the XDS Registry test 12326. \\n\" +\r\n                \"An existing document shall be added to an existing folder via a new submission set. \\n\" +\r\n                \"In the technical framework it is described that when an existing document is referenced \\n\" +\r\n                \"via a new submission set there must be an HasMember Association with the Association Label \\n\" +\r\n                \"\\\"ByReference\\\" between the submission set and the document entry. But in this test only the \\n\" +\r\n                \"association between folder and document and the association between submission set and \\n\" +\r\n                \"the folder/document association is sent. \\n\" +\r\n                \"\\n\" +\r\n                \"Is this correct or is the test wrong?\\n\" +\r\n                \"\\n\" +\r\n                \"A: In test 12326, the create_folder section submits:\\n\" +\r\n                \"\\n\" +\r\n                \"   A SubmissionSet\\n\" +\r\n                \"   A DocumentEntry linked to the SubmissionSet via a HasMember Association with \\n\" +\r\n                \"   SubmissionSetStatus of Original (new submission)\\n\" +\r\n                \"   A Folder linked to the SubmissionSet via a HasMember Association\\n\" +\r\n                \"\\n\" +\r\n                \"So, at the end of this submission the Registry contains a new DocumentEntry and \\n\" +\r\n                \"a new Folder.  There is no linkage between them (other than that they were submitted \\n\" +\r\n                \"in the same SubmissionSet). The DocumentEntry and the Folder could have been \\n\" +\r\n                \"submitted in separate submissions and this test would be the same.\\n\" +\r\n                \"\\n\" +\r\n                \"In the second submission, section add_to_folder, the DocumentEntry is added \\n\" +\r\n                \"to the Folder. So, the submission contains:\\n\" +\r\n                \"\\n\" +\r\n                \"   The Folder to DocumentEntry HasMember Association (declaring the \\n\" +\r\n                \"         DocumentEntry to be a member of the Folder)\\n\" +\r\n                \"   The HasMember Association linking the SubmissionSet to the above \\n\" +\r\n                \"         Association.  This documents which submission added the \\n\" +\r\n                \"         DocumentEntry to the Folder (who is responsible for this \\n\" +\r\n                \"         DocumentEntry being in the is folder).\\n\" +\r\n                \"\\n\" +\r\n                \"The SubmissionSetStatus attribute is only used when linking a \\n\" +\r\n                \"DocumentEntry to a SubmissionSet.  No DocumentEntries were submitted \\n\" +\r\n                \"or referenced by this submission.\\n\" +\r\n                \"\\n\" +\r\n                \"So, going back to your original question, the ByReference label \\n\" +\r\n                \"is used when adding a DocumentEntry to an existing SubmissionSet. \\n\" +\r\n                \"This is occasionally done because documents of different Patient \\n\" +\r\n                \"IDs need to be linked.  Mother and child during child birth is the \\n\" +\r\n                \"typical example here.  The only way to link documents of different \\n\" +\r\n                \"Patient IDs is through the ByReference label to a SubmissionSet. This \\n\" +\r\n                \"is not the focus of this test.\\n\");\r\n        collectionsReadme.put(\"12327\", \"R.b Accept Document Replace, Document in Folder\\n\" +\r\n                \"\\n\" +\r\n                \"A Document Registry, when accepting a Document Replace, must findSimple all\\n\" +\r\n                \"Folders the original document is a member of and add the replacement\\n\" +\r\n                \"document to those folders.\\n\" +\r\n                \"\\n\" +\r\n                \"Steps are:\\n\" +\r\n                \"\\n\" +\r\n                \"submit_doc_w_fol - submit a document in a folder\\n\" +\r\n                \"\\n\" +\r\n                \"verify_submission -  Use GetSubmissionSetAndContents SQ to verify the\\n\" +\r\n                \"submission\\n\" +\r\n                \"\\n\" +\r\n                \"rplc - replace the document from step submit_doc_w_fol\\n\" +\r\n                \"\\n\" +\r\n                \"verify_folder_contents - verify both the original and the replacement\\n\" +\r\n                \"documents are members of the folder\\n\");\r\n        collectionsReadme.put(\"12364\", \"MPQ - FindDocumentsForMultiplePatients Strored Query\\n\" +\r\n                \"\\n\" +\r\n                \"This test relies on test 12361 to load the necessary test data.\\n\" +\r\n                \"\\n\" +\r\n                \"Each sub-directory holds a testplan which tests a different\\n\" +\r\n                \"aspect of FindDocumentsForMultiplePatients Stored Query.\\n\" +\r\n                \"\\n\" +\r\n                \"With multiple patient ids the following patterns\\n\" +\r\n                \"\\n\" +\r\n                \"nothing - no codes or patient id is specified - must fail\\n\" +\r\n                \"classcode - classcode is specified but no Patient ID\\n\" +\r\n                \"eventcode - eventcode is specified but no Patient ID\\n\" +\r\n                \"hcftc - healthcareFacilityTypeCode is specified but no Patient ID\\n\" +\r\n                \"classcode_eventcode - select on both \\n\" +\r\n                \"one_pid - include single Patient ID\\n\" +\r\n                \"multi_pid - include multiple Patient IDs\\n\" );\r\n        collectionsReadme.put(\"12368\", \"SQ.b XDSResultNotSinglePatient Error\\n\" +\r\n                \"\\n\" +\r\n                \"The Stored Query transaction is restricted from returning full metadata (LeafClass) for more than one Patient ID.  When ObjectRefs are \\n\" +\r\n                \"requested, there is no restriction since PII is not being disclosed.\\n\" +\r\n                \"\\n\" +\r\n                \"Each subtest deals with a combination of an object type \\n\" +\r\n                \"(DocumentEntry, SubmissionSet, Folder) matched up with a return \\n\" +\r\n                \"type (LeafClass, ObjectRef) to ensure the proper response is \\n\" +\r\n                \"generated.\\n\" +\r\n                \"\\n\" +\r\n                \"This test is dependent on both 12346 and 12374 since they load \\n\" +\r\n                \"metadata into different Patient IDs.\\n\");\r\n        collectionsReadme.put(\"12369\", \"12369 PnR.b Wrong size or hash received in metadata\\n\" +\r\n                \"\\n\" +\r\n                \"Sub tests\\n\" +\r\n                \"\\n\" +\r\n                \"size\\n\" +\r\n                \"\\tMetadata contains size attribute that does not match attached document\\n\" +\r\n                \"\\n\" +\r\n                \"hash\\n\" +\r\n                \"\\tMetadata contains hash attribute that does not match attached document\\n\" +\r\n                \"\\n\" +\r\n                \"In both cases, XDSRepositoryMetadataError must be returned.\\n\" +\r\n                \"\\n\" +\r\n                \" \\n\");\r\n        collectionsReadme.put(\"12370\", \"12370 R.b Accept association documenation classification\\n\" +\r\n                \"\\n\" +\r\n                \"Lifecycle management type associations may contain an optional classification labeling the\\n\" +\r\n                \"reason for the update.  This association may be present on RPLC, APND, XFRM etc. assocations.\\n\" +\r\n                \"\\n\" +\r\n                \"Sub Tests\\n\" +\r\n                \"\\n\" +\r\n                \"not_configured - attempt to add this association on a HasMember assocation - fails\\n\" +\r\n                \"\\n\" +\r\n                \"submit - submit a document\\n\" +\r\n                \"\\n\" +\r\n                \"rplc - replace the document and the RPLC association has the documentation classification\\n\" +\r\n                \"\\n\" +\r\n                \"query - validate the documentation classification is returned in a stored query \\n\" );\r\n        collectionsReadme.put(\"12371\", \"XDR Provide and Register.b \\n\" +\r\n                \"\\n\" +\r\n                \"This Provide and Register contains a single DocumentEntry with the\\n\" +\r\n                \"necessary Submission Set and HasMember Association.  The Submission\\n\" +\r\n                \"Set includes the optional intendedRecipient attribute that is \\n\" +\r\n                \"used with XDR.\\n\");\r\n        collectionsReadme.put(\"12372\", \"XDR Provide and Register.b \\n\" +\r\n                \"\\n\" +\r\n                \"This Provide and Register contains a single DocumentEntry with the\\n\" +\r\n                \"necessary Submission Set and HasMember Association.  The Submission\\n\" +\r\n                \"Set includes the optional intendedRecipient attribute that is \\n\" +\r\n                \"used with XDR.\\n\" +\r\n                \"\\n\" +\r\n                \"This test is identical to 12371 but must use TLS.\\n\"  );\r\n        collectionsReadme.put(\"12373\", \"XDR Provide and Register.b with multiple documents\\n\" +\r\n                \"\\n\" +\r\n                \"This Provide and Register contains two DocumentEntry objects with the\\n\" +\r\n                \"necessary Submission Set and HasMember Association.  The Submission\\n\" +\r\n                \"Set includes the optional intendedRecipient attribute that is \\n\" +\r\n                \"used with XDR.\\n\"  );\r\n        collectionsReadme.put(\"12375\", \"XDR Provide and Register.b with Limited Metadata\\n\" +\r\n                \"\\n\" +\r\n                \"This Provide and Register contains a single DocumentEntry with the\\n\" +\r\n                \"necessary Submission Set and HasMember Association. The metadata \\n\" +\r\n                \"provided conforms to the requirements\\n\" +\r\n                \"of the XDR Metadata Limited Document Source.  Only the \\n\" +\r\n                \"absolutely required attributes are included.\\n\" +\r\n                \"\\n\" +\r\n                \"In this metadata, both the SubmissionSet and DocumentEntry\\n\" +\r\n                \"conform to the Limited Metadata specification.  The\\n\" +\r\n                \"profile does not require this of all objects in a submission.\\n\"  );\r\n        collectionsReadme.put(\"12376\", \"XDR Provide and Register.b with Limited Metadata but without Limited Metadata label\\n\" +\r\n                \"\\n\" +\r\n                \"This Provide and Register contains a single DocumentEntry with the\\n\" +\r\n                \"necessary Submission Set and HasMember Association. The metadata \\n\" +\r\n                \"provided conforms to the requirements\\n\" +\r\n                \"of the XDR Metadata Limited Document Source.  Only the \\n\" +\r\n                \"absolutely required attributes are included.  \\n\" +\r\n                \"\\n\" +\r\n                \"But, the SubmissionSet and DocumentEntry are missing the Classification\\n\" +\r\n                \"(label) that indicates Limited Metadata is provided.  As a result\\n\" +\r\n                \"the Document Recipient expects to findSimple full metadata.\\n\" +\r\n                \"\\n\" +\r\n                \"In this metadata, both the SubmissionSet and DocumentEntry\\n\" +\r\n                \"conform to the Limited Metadata specification.  The\\n\" +\r\n                \"profile does not require this of all objects in a submission.\\n\"  );\r\n        collectionsReadme.put(\"12379\", \"Extra Metadata\\n\" +\r\n                \"\\n\" +\r\n                \"Section ITI-TF 4.1.14 defines the composition and handling of \\n\" +\r\n                \"Extra Metadata, ebRIM Slots not defined in XD* metadata.  This \\n\" +\r\n                \"test tests the required handling by the XDS Document Registry actor.\\n\" +\r\n                \"\\n\" +\r\n                \"There are two test sections defined: support and no_support. The\\n\" +\r\n                \"XDS Document Registry actor is required to implement Extra\\n\" +\r\n                \"Metadata by either \\n\" +\r\n                \"\\n\" +\r\n                \"\\tAccepting, not storing and returning the XdsExtraMetadataNotSaved\\n\" +\r\n                \"\\twarning code\\n\" +\r\n                \"\\t\\n\" +\r\n                \"\\tAccepting, storing and returning the extra metadata in query\\n\" +\r\n                \"\\tresponses\\n\" +\r\n                \"\\t\\n\" +\r\n                \"The two sections align with these two approaches the Registy actor\\n\" +\r\n                \"can support.  Only one of the will succeed (they are mutually\\n\" +\r\n                \"exclusive). When logging results in Gazelle, upload the results\\n\" +\r\n                \"for both sections. \" );\r\n        collectionsReadme.put(\"15500\", \"XCPD Find Patient Messages\\n\" +\r\n                \"\\n\" +\r\n                \"Tests the ability of a responding gateway to respond to a findSimple patient request (305). This tests the response message (306).\\n\" +\r\n                \"\\n\" +\r\n                \"The test is composed of three steps stored in three different XML files:\\n\" +\r\n                \"- 1. test1_findpatient_dob_gender_name\\n\" +\r\n                \"\\tAttempts to locate a patient using DOB, gender and name. Expected status: success.\\n\" +\r\n                \"- 2. test2_findpatient_gender_name_failure\\n\" +\r\n                \"\\tAttempts to locate a patient by name only, which means DOB is voluntarily missing. Expected status: failure.\\n\" +\r\n                \"- 3. test3_findpatient_dob_gender_name_failure\\n\" +\r\n                \"\\tAttempts to locate a patient using (wrong) gender and name. Expected status: failure.\\n\" +\r\n                \"\\t\\n\" +\r\n                \"\\n\" +\r\n                \"I will put in more tests later in order to test more parameters: PatientID and address.\\n\" +\r\n                \"\\n\" +\r\n                \"\\n\" +\r\n                \"\\n\" +\r\n                \"--- Data ---\\n\" +\r\n                \"Here is the data we use for this series of tests. You will probably need to enter it manually in your system before we can arrange for something more permanent.\\n\" +\r\n                \"\\n\" +\r\n                \"PatientID\\n\" +\r\n                \"                assigningAuthorityName: domain1\\n\" +\r\n                \"                ext: 100\\n\" +\r\n                \"                root: 1.2.3.4.5.1000\\n\" +\r\n                \"Name\\n\" +\r\n                \"                Given: Chip\\n\" +\r\n                \"                Family: Moore\\n\" +\r\n                \"\\n\" +\r\n                \"Gender: M\\n\" +\r\n                \"DOB: 19849711\\n\" +\r\n                \"Address:\\n\" +\r\n                \"                City: Montreal\\n\" +\r\n                \"\\n\" +\r\n                \"\\n\" +\r\n                \"\\n\" +\r\n                \"--- Addressed issues ---\\n\" +\r\n                \"- The issue dated of ~December 15th, 2011 regarding missing DOBs in some of the tests has been fixed.\\n\" +\r\n                \"\\n\" +\r\n                \"\\n\" +\r\n                \"\\n\" +\r\n                \"--- Contact ---\\n\" +\r\n                \"diane.azais@nist.gov\\n\" );\r\n        collectionsReadme.put(\"15800\", \"MU - Simple DocumentEntry Update\\n\" +\r\n                \"\\n\" +\r\n                \"Tests ability of Document Registry to accept a metadata update which changes a few simple\\n\" +\r\n                \"attributes of a DocumentEntry. This exercises the basic operation\\n\" +\r\n                \"of the Update DocumentEntry Metadata operaton as defined in section\\n\" +\r\n                \"3.57.4.1.3.3.1 of the Metadata Update Supplement\\n\" +\r\n                \"\\n\" +\r\n                \"Sections:\\n\" +\r\n                \"\\n\" +\r\n                \"Section: original - submit an original DocumentEntry, this is a first version.\\n\" +\r\n                \"\\n\" +\r\n                \"Section: update - submit an update to the DocumentEntry, changing the creationTime\\n\" +\r\n                \"\\n\" +\r\n                \"There are two documented \\\"triggers\\\" for this operation\\n\" +\r\n                \"1) The id attribute of the original is installed as the lid\\n\" +\r\n                \"attribute on the updated DocumentEntry.  This must be UUID format.\\n\" +\r\n                \"2) The SubmissionSet to DocumentEntry Association has a PreviousVersion\\n\" +\r\n                \"slot with a single value, 1, the version number of the DocumentEntry\\n\" +\r\n                \"being replaced.\\n\" +\r\n                \"\\n\" +\r\n                \"Normally this would be discovered through query. But for testing\\n\" +\r\n                \"we simplify.\\n\" +\r\n                \"\\n\" +\r\n                \"Formatting the updated DocumentEntry goes as follows:\\n\" +\r\n                \"- new id\\n\" +\r\n                \"- logicalId is id of original\\n\" +\r\n                \"- objectType must match original\\n\" +\r\n                \"- uniqueId must match original\\n\" +\r\n                \"- some attributes different (this is the point of the update)\\n\" +\r\n                \"\\n\" +\r\n                \"Section: query_by_uniqueid - has two steps, uniqueid_query which\\n\" +\r\n                \"executes the GetDocuments query to fetch\\n\" +\r\n                \"both versions of the DocumentEntry.  This is done with $MetadataLevel not\\n\" +\r\n                \"present in the query, a non-Metadata Update Document Consumer.\\n\" +\r\n                \"A non-MetadataUpdate Document Consumer may not understand the relationship\\n\" +\r\n                \"between the two entries returned, but it will get two entries.  \\n\" +\r\n                \"\\n\" +\r\n                \"This must be run after sections original and update\\n\" +\r\n                \"\\n\" +\r\n                \"Section: query_by_uniqueid (step validate) - this runs a series of \\n\" +\r\n                \"validations against the two DocumentEntries returned:\\n\" +\r\n                \"\\n\" +\r\n                \"same_logicalId - both have same logicalId\\n\" +\r\n                \"\\n\" +\r\n                \"different_id - entryUUID attribute on each is different\\n\" +\r\n                \"\\n\" +\r\n                \"orig_is_version_1 - the original version has version = 1\\n\" +\r\n                \"\\n\" +\r\n                \"update_is_version_2 - the updated version has version = 2\\n\" +\r\n                \"\\n\" +\r\n                \"orig_id_and_lid_same - on original DocumentEntry, the id and lid attributes \\n\" +\r\n                \"have the same value\\n\" +\r\n                \"\\n\" +\r\n                \"update_id_and_lid_different - on the update DocumentEntry, the id and lid \\n\" +\r\n                \"attributes have different values\\n\" +\r\n                \"\\n\" +\r\n                \"uniqueid_same - the uniqueId attribute on both DocumentEntries is the same\\n\" +\r\n                \"\\n\" +\r\n                \"original_is_deprecated - the initial version of the DocumentEntry must be\\n\" +\r\n                \"deprecated by the update\\n\" +\r\n                \"\\n\" +\r\n                \"update_is_approved - the update of the DocumentEntry must have availabilityStatus\\n\" +\r\n                \"of Approved\\n\" +\r\n                \"\\n\" +\r\n                \"Section: no_orig_docentry - an update is submitted but no original DocumentEntry\\n\" +\r\n                \"exists. The logicalId is hard coded to a unique value. This must fail.\\n\" +\r\n                \"\\n\" +\r\n                \"\\n\" +\r\n                \"Section: initial_version - submit a first version of a DocumentEntry via\\n\" +\r\n                \"update.  This is illegal, you cannot use metadata update to submit the first\\n\" +\r\n                \"version of a document. (ITI TF-2b:3.57.4.1.3.1 Rule #2)\" );\r\n        collectionsReadme.put(\"15802\", \"MU - Update DocumentEntry Status\\n\" +\r\n                \"\\n\" +\r\n                \"The primary reference for this test is section ITI TF-2b:3.57.4.1.3.3.2\\n\" +\r\n                \"Update DocumentEntry AvailabilityStatus.\\n\" +\r\n                \"\\n\" +\r\n                \"Sections:\\n\" +\r\n                \"\\n\" +\r\n                \"Section: load_docentry_1 - Submit a single DocumentEntry.  Of course it \\n\" +\r\n                \"will be assigned availabilityStatus of Approved.\\n\" +\r\n                \"\\n\" +\r\n                \"Section: deprecate_docentry_1 - Submit an update to deprecate docentry_1. \\n\" +\r\n                \"This will consist of a SubmissionSet and a UpdateAvailabilityStatus\\n\" +\r\n                \"Association referencing docentry_1 \\n\" +\r\n                \"\\n\" +\r\n                \"Section: confirm_docentry_1_deprecated - use GetDocuments Stored Query to \\n\" +\r\n                \"retrieve metadata for docentry_1 and verify it has availabilityStatus\\n\" +\r\n                \"of Deprecated.\\n\" +\r\n                \"\\n\" +\r\n                \"Section: undeprecate_docentry_1 - Submit an update to set the \\n\" +\r\n                \"availabilityStatus on docentry_1 back to Approved.\\n\" +\r\n                \"\\n\" +\r\n                \"Section: confirm_docentry_1_undeprecated - use GetDocuments Stored Query to \\n\" +\r\n                \"retrieve metadata for docentry_1 and verify it has availabilityStatus\\n\" +\r\n                \"of Approved.\\n\" +\r\n                \"\\n\" +\r\n                \"Section: load_docentry_2 - Submit a single DocumentEntry\\n\" +\r\n                \"\\n\" +\r\n                \"Section: update_docentry_2 - Submit an update to docentry_2\\n\" +\r\n                \"\\n\" +\r\n                \"Section: approve_orig_docentry_2 - Attempt to set the availabilityStatus\\n\" +\r\n                \"of the original version of docentry_2 back to Approved.  Since it is \\n\" +\r\n                \"not the most recent version, this must fail.\\n\" +\r\n                \"\\n\" +\r\n                \"Section: verify_orig_docentry_2_deprecated - Verify the previous step\\n\" +\r\n                \"did not change the availabilityStatus of the original version of\\n\" +\r\n                \"docentry_2 back to Approved.\" );\r\n    }\r\n\r\n    public Map<String, String> getCollectionNames(String collectionSetName) {\r\n        Map<String,String> map = new HashMap<String,String>();\r\n        map.put(\"Initialize_for_Stored_Query\",\"Initialize for Stored Query\");\r\n        map.put(\"rec\",\"Document Recipient\");\r\n        map.put(\"reg\",\"Document Registry\");\r\n        map.put(\"rep\",\"Document Repository\");\r\n        map.put(\"rg\", \"Responding Gateway\");\r\n        return map;\r\n    }\r\n\r\n\r\n    public Map<String, String> getCollection(String collectionSetName, String collectionName) {\r\n        List<String> nameList = getRequiredElements(collectionSetName,collectionName);\r\n        Map<String, String> tests = new HashMap<String, String>();\r\n        for (String name : nameList) {\r\n            String description= getTestDescription(name);\r\n            if (description!=null && !description.isEmpty()) {\r\n                tests.put(name, description);\r\n            }\r\n        }\r\n        return tests;\r\n    }\r\n\r\n    private List<String> getRequiredElements(String collectionSetName, String collectionName) {\r\n        return testsMap.get(collectionName);\r\n    }\r\n\r\n    private String getTestDescription(String key){\r\n        String readme = collectionsReadme.get(key);\r\n        if (readme==null)\r\n            return null;\r\n        String[] parts = readme.split(\"\\n\");\r\n        if (parts.length == 0)\r\n            return \"\";\r\n        return parts[0].trim();\r\n    }\r\n\r\n    public String getTestReadme(String test) {\r\n        return  collectionsReadme.get(test);\r\n    }\r\n}\r\n'),(280,390,'package gov.nist.hit.ds.xdstools3.server.demo;\r\n\r\n\r\nimport java.util.HashMap;\r\nimport java.util.Map;\r\n\r\n/**\r\n * Test data helper for testing purpose.\r\n *\r\n * Provides test data / GUI demo data\r\n */\r\npublic enum TestDataHelper {\r\n    instance;\r\n\r\n    private Map<String,String> testsMap;\r\n\r\n    private TestDataHelper(){\r\n        testsMap = new HashMap<>();\r\n        testsMap.put(\"DSUB_IHEGREEN-1016\",\"DSUB_IHEGREEN-1016\");\r\n        testsMap.put(\"MPQ_IHEGREEN-1020\",\"MPQ_IHEGREEN-1020\");\r\n        testsMap.put(\"DSUB_IHERED-1024\",\"DSUB_IHERED-1024\");\r\n        testsMap.put(\"MPQ_IHEGREEN-1018\",\"MPQ_IHEGREEN-1018\");\r\n    }\r\n\r\n    public Map<String,String> getTestDataSet(){\r\n        return testsMap;\r\n    }\r\n}\r\n'),(281,392,'package gov.nist.hit.ds.xdstools3.shared;\r\n\r\nimport java.io.Serializable;\r\n\r\n/**\r\n * Created by dazais on 3/20/2015.\r\n */\r\npublic class Site implements Serializable {\r\n\r\n    public Site(){\r\n\r\n    }\r\n}\r\n'),(4481,5587,'package gov.nist.hit.ds.docentryeditor.client;\r\n\r\nimport com.google.gwt.activity.shared.ActivityManager;\r\nimport com.google.gwt.core.client.GWT;\r\nimport com.google.gwt.place.shared.PlaceController;\r\nimport com.google.gwt.place.shared.PlaceHistoryHandler;\r\nimport com.google.gwt.user.client.ui.IsWidget;\r\nimport com.google.gwt.user.client.ui.SimplePanel;\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport gov.nist.hit.ds.docentryeditor.client.event.MetadataEditorEventBus;\r\nimport gov.nist.hit.ds.docentryeditor.client.home.WelcomePlace;\r\nimport gov.nist.hit.ds.docentryeditor.client.root.MetadataEditorAppView;\r\nimport gov.nist.hit.ds.docentryeditor.client.utils.MetadataEditorActivityMapper;\r\nimport gov.nist.hit.ds.docentryeditor.client.utils.MetadataEditorAppPlaceHistoryMapper;\r\nimport gov.nist.hit.ds.docentryeditor.client.utils.MetadataEditorGinInjector;\r\n\r\nimport java.util.logging.Logger;\r\n\r\n/**\r\n * This is the class to use to create the application.\r\n */\r\npublic class MetadataEditorApp implements IsWidget {\r\n    private final static MetadataEditorGinInjector INJECTOR = MetadataEditorGinInjector.INSTANCE;\r\n    protected final static Logger LOGGER = Logger.getLogger(MetadataEditorApp.class.getName());\r\n    private final MetadataEditorEventBus eventBus = INJECTOR.getEventBus();\r\n\r\n    private SimplePanel activityPanel = new SimplePanel();\r\n    private MetadataEditorAppView appView;\r\n\r\n    public MetadataEditorApp(){\r\n        appView = INJECTOR.getMetadataEditorAppView();\r\n\r\n        PlaceController placeController = INJECTOR.getPlaceController();\r\n\r\n        MetadataEditorActivityMapper activityMapper = new MetadataEditorActivityMapper();\r\n        ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);\r\n        activityManager.setDisplay(activityPanel);\r\n\r\n        MetadataEditorAppPlaceHistoryMapper historyMapper = GWT.create(MetadataEditorAppPlaceHistoryMapper.class);\r\n        PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);\r\n\r\n        historyHandler.register(placeController, eventBus, new WelcomePlace(\"Welcome\"));\r\n\r\n        activityPanel.add(appView.asWidget());\r\n\r\n        historyHandler.handleCurrentHistory();\r\n//        appView.addResizeHandler(new ResizeHandler() {\r\n//            @Override\r\n//            public void onResize(ResizeEvent event) {\r\n//                appView.forceLayout();\r\n//                appView.setResize(true);\r\n//            }\r\n//        });\r\n    }\r\n\r\n    @Override\r\n    public Widget asWidget() {\r\n        return activityPanel;\r\n    }\r\n\r\n    public MetadataEditorAppView getAppView(){\r\n        return appView;\r\n    }\r\n\r\n    public static MetadataEditorGinInjector getInjector() {\r\n        return INJECTOR;\r\n    }\r\n\r\n    public MetadataEditorEventBus getEventBus() {\r\n        return eventBus;\r\n    }\r\n}\r\n'),(4482,5588,'package gov.nist.hit.ds.docentryeditor.client;\r\n\r\nimport com.google.gwt.core.client.EntryPoint;\r\nimport com.google.gwt.user.client.ui.RootLayoutPanel;\r\n\r\nimport java.util.logging.Logger;\r\n\r\n/**\r\n * This is the XDS Metadata Editor Application EntryPoint. That\'s the first\r\n * class loaded, which instantiate the different object global to the\r\n * application.\r\n */\r\npublic class MetadataEditorAppStandaloneEP implements EntryPoint {\r\n    protected final static Logger LOGGER = Logger.getLogger(MetadataEditorAppStandaloneEP.class.getName());\r\n\r\n    @SuppressWarnings(\"deprecation\")\r\n    @Override\r\n    public void onModuleLoad() {\r\n        RootLayoutPanel.get(/*\"editorAppContainer\"*/).add(new MetadataEditorApp().asWidget());\r\n        //  RootPanel.get(\"editorAppContainer\").add(new MetadataEditorApp().asWidget());\r\n        LOGGER.info(\"Application Started!\");\r\n    }\r\n\r\n\r\n}\r\n'),(4483,5590,'package gov.nist.hit.ds.docentryeditor.client.editor;\r\n\r\n/**\r\n * Enumerated class to handle the different possible status for a sub-editor.\r\n * Especially useful to handle editor\'s display.\r\n * It is used to know the state of the editor, to know how to display the different\r\n * fields (enable/disable especially)\r\n */\r\npublic enum EditionMode {\r\n    NODATA, DISPLAY, NEW, EDIT;\r\n}\r\n'),(4484,5592,'package gov.nist.hit.ds.docentryeditor.client.editor.documentEntryEditor;\r\n\r\nimport com.google.gwt.activity.shared.AbstractActivity;\r\nimport com.google.gwt.event.shared.EventBus;\r\nimport com.google.gwt.user.client.Timer;\r\nimport com.google.gwt.user.client.ui.AcceptsOneWidget;\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport com.sencha.gxt.core.client.Style.LayoutRegion;\r\nimport com.sencha.gxt.widget.core.client.ContentPanel;\r\nimport com.sencha.gxt.widget.core.client.container.BorderLayoutContainer;\r\nimport com.sencha.gxt.widget.core.client.container.BorderLayoutContainer.BorderLayoutData;\r\nimport com.sencha.gxt.widget.core.client.container.SimpleContainer;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.validation.ValidationPresenter;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.validation.ValidationView;\r\nimport gov.nist.hit.ds.docentryeditor.client.event.MetadataEditorEventBus;\r\nimport gov.nist.hit.ds.docentryeditor.client.generics.ActivityDisplayer;\r\nimport gov.nist.hit.ds.docentryeditor.client.generics.GenericMVP;\r\nimport gov.nist.hit.ds.docentryeditor.shared.model.XdsDocumentEntry;\r\n\r\nimport javax.inject.Inject;\r\nimport java.util.logging.Logger;\r\n\r\npublic class DocEntryEditorActivity extends AbstractActivity {\r\n\r\n    @Inject\r\n    private ActivityDisplayer displayer;\r\n\r\n    private GenericMVP<XdsDocumentEntry, DocumentEntryEditorView, DocumentEntryEditorPresenter> editorMVP;\r\n    private GenericMVP<XdsDocumentEntry, ValidationView, ValidationPresenter> validationMVP;\r\n\r\n    @Inject\r\n    private DocumentEntryEditorView editorView;\r\n    @Inject\r\n    private DocumentEntryEditorPresenter editorPresenter;\r\n\r\n    @Inject\r\n    private ValidationView validationView;\r\n    @Inject\r\n    private ValidationPresenter validationPresenter;\r\n\r\n    @Inject\r\n    private MetadataEditorEventBus metadataEditorEventBus;\r\n\r\n    private SimpleContainer sc;\r\n    private BorderLayoutContainer blc;\r\n\r\n    // this method is automatically called in the GWT Activity - Places process.\r\n    @Override\r\n    public void start(AcceptsOneWidget panel, EventBus eventBus) {\r\n        editorMVP = buildEditorMVP();\r\n        editorMVP.init();\r\n        validationMVP = buildValidationMVP();\r\n        validationMVP.init();\r\n        displayer.display(getContainer(), panel, eventBus);\r\n        // timer to solve a gwt issue (ugly)\r\n        Timer t = new Timer() {\r\n            @Override\r\n            public void run() {\r\n                Logger.getLogger(this.getClass().getName()).info(\"Fire Doc. Entry Editor UI loaded event...\");\r\n                // signal that the document entry editor view has loaded.\r\n                metadataEditorEventBus.fireXdsEditorLoadedEvent();\r\n            }\r\n        };\r\n\r\n        // Schedule the timer to run once in 1 milliseconds.\r\n        t.schedule(1);\r\n    }\r\n\r\n    /**\r\n     * Build editor layout with borderlayoutcontainer for the Document Entry.\r\n     * Made of a main panel for the editor itself and a collapsible and splittable validation panel underneath.\r\n     *\r\n     * @return widget editor container\r\n     */\r\n    private Widget getContainer() {\r\n        sc = new SimpleContainer();\r\n        blc = new BorderLayoutContainer();\r\n\r\n        ContentPanel validationView = new ContentPanel();\r\n        validationView.setHeadingText(\"Validation\");\r\n\r\n        ContentPanel center = new ContentPanel();\r\n        center.setHeaderVisible(false);\r\n        center.add(editorMVP.getDisplay());\r\n\r\n        blc.setCenterWidget(center);\r\n\r\n        BorderLayoutData southData = new BorderLayoutData(250);\r\n        southData.setCollapsible(true);\r\n        southData.setSplit(true);\r\n        southData.setCollapsed(true);\r\n\r\n        blc.setSouthWidget(validationView, southData);\r\n\r\n        blc.collapse(LayoutRegion.SOUTH);\r\n\r\n        sc.add(blc);\r\n\r\n        return sc.asWidget();\r\n    }\r\n\r\n    /**\r\n     * Method that builds the Document Entry Editor (MVP).\r\n     * @return Document Entry Editor MVP.\r\n     */\r\n    public GenericMVP<XdsDocumentEntry, DocumentEntryEditorView, DocumentEntryEditorPresenter> buildEditorMVP() {\r\n        return new GenericMVP<XdsDocumentEntry, DocumentEntryEditorView, DocumentEntryEditorPresenter>(editorView, editorPresenter);\r\n    }\r\n\r\n    /**\r\n     * Method that builds the Validation view (MVP).\r\n     * @return Validation view MVP.\r\n     */\r\n    public GenericMVP<XdsDocumentEntry, ValidationView, ValidationPresenter> buildValidationMVP() {\r\n        return new GenericMVP<XdsDocumentEntry, ValidationView, ValidationPresenter>(validationView, validationPresenter);\r\n    }\r\n}\r\n'),(4485,5593,'package gov.nist.hit.ds.docentryeditor.client.editor.documentEntryEditor;\r\n\r\nimport com.google.gwt.place.shared.Place;\r\nimport com.google.gwt.place.shared.PlaceTokenizer;\r\n\r\n/**\r\n * Place for the Document Entry editor.\r\n * This enables the navigation within the application thanks to\r\n * the Activity-place design.\r\n */\r\npublic class DocEntryEditorPlace extends Place {\r\n	private String editorPlaceName;\r\n\r\n	public DocEntryEditorPlace(String token) {\r\n		this.editorPlaceName = token;\r\n	}\r\n\r\n	public DocEntryEditorPlace() {\r\n		super();\r\n	}\r\n\r\n	public String getActivityEditorPlaceName() {\r\n		return this.editorPlaceName;\r\n	}\r\n\r\n	public static class Tokenizer implements PlaceTokenizer<DocEntryEditorPlace> {\r\n		@Override\r\n		public String getToken(DocEntryEditorPlace place) {\r\n			return place.getActivityEditorPlaceName();\r\n		}\r\n\r\n		@Override\r\n		public DocEntryEditorPlace getPlace(String token) {\r\n			return new DocEntryEditorPlace(token);\r\n		}\r\n	}\r\n\r\n}\r\n'),(4486,5594,'package gov.nist.hit.ds.docentryeditor.client.editor.documentEntryEditor;\r\n\r\nimport gov.nist.hit.ds.docentryeditor.client.generics.abstracts.AbstractMVP;\r\nimport gov.nist.hit.ds.docentryeditor.shared.model.XdsDocumentEntry;\r\n\r\n/**\r\n * Class that represents and build the Model View Presenter objects for the Document entry editor view.\r\n */\r\npublic class DocumentEntryEditorMVP extends AbstractMVP<XdsDocumentEntry, DocumentEntryEditorView, DocumentEntryEditorPresenter> {\r\n\r\n    @Override\r\n    public DocumentEntryEditorView buildView() {\r\n        return getView();\r\n    }\r\n\r\n    @Override\r\n    public DocumentEntryEditorPresenter buildPresenter() {\r\n        // editorPresenter.initDriver();\r\n        return getPresenter();\r\n    }\r\n\r\n}\r\n'),(4487,5595,'package gov.nist.hit.ds.docentryeditor.client.editor.documentEntryEditor;\r\n\r\nimport com.google.gwt.core.client.GWT;\r\nimport com.google.gwt.editor.client.SimpleBeanEditorDriver;\r\nimport com.google.gwt.place.shared.PlaceChangeEvent;\r\nimport com.sencha.gxt.widget.core.client.Dialog.PredefinedButton;\r\nimport com.sencha.gxt.widget.core.client.box.ConfirmMessageBox;\r\nimport com.sencha.gxt.widget.core.client.event.DialogHideEvent;\r\nimport gov.nist.hit.ds.docentryeditor.client.event.MetadataEditorEventBus;\r\nimport gov.nist.hit.ds.docentryeditor.client.event.StartEditXdsDocumentEvent;\r\nimport gov.nist.hit.ds.docentryeditor.client.generics.abstracts.AbstractPresenter;\r\nimport gov.nist.hit.ds.docentryeditor.shared.model.XdsDocumentEntry;\r\n\r\nimport java.util.logging.Logger;\r\n\r\n/**\r\n * This class is the presenter that handles all the actions and events related to the Document Entry Editor view.\r\n * It works with the DocumentEntryView to handle the XdsDocumentEntry model.\r\n *\r\n * @see gov.nist.hit.ds.docentryeditor.client.editor.documentEntryEditor.DocumentEntryEditorView\r\n * @see gov.nist.hit.ds.docentryeditor.shared.model.XdsDocumentEntry\r\n */\r\npublic class DocumentEntryEditorPresenter extends AbstractPresenter<DocumentEntryEditorView> {\r\n\r\n    protected static Logger logger = Logger.getLogger(DocumentEntryEditorPresenter.class.getName());\r\n    protected XdsDocumentEntry model=new XdsDocumentEntry();\r\n    private DocEntryEditorDriver editorDriver = GWT.create(DocEntryEditorDriver.class);\r\n\r\n    /**\r\n     * Method that initializes the editor and the request factory on document entry editor view start.\r\n     */\r\n    @Override\r\n    public void init() {\r\n        // model = new XdsDocumentEntry();\r\n        bind();\r\n        initDriver(model);\r\n        // requestFactory.initialize(eventBus);\r\n    }\r\n\r\n    /**\r\n     * Method that initializes the editor with a document entry object.\r\n     * @param model\r\n     */\r\n    private void initDriver(XdsDocumentEntry model) {\r\n        this.model = model;\r\n        editorDriver.initialize(view);\r\n        getView().authors.getAuthorWidget().initEditorDriver();\r\n        logger.info(\"Init driver with: \"+model.toString());\r\n        editorDriver.edit(model);\r\n        getView().refreshGridButtonsDisplay();\r\n    }\r\n\r\n    /**\r\n     * Method that ties actions and view together. It mostly handles gwt event form the event bus.\r\n     */\r\n    private void bind() {\r\n        // this event provides the presenter a document entry to edit and triggers its display in doc entry editor view.\r\n        ((MetadataEditorEventBus) getEventBus()).addStartEditXdsDocumentHandler(new StartEditXdsDocumentEvent.StartEditXdsDocumentHandler() {\r\n\r\n            @Override\r\n            public void onStartEditXdsDocument(StartEditXdsDocumentEvent event) {\r\n                logger.info(\"... receive Start Edit Event\");\r\n                model = event.getDocument();\r\n                initDriver(event.getDocument());\r\n                getView().authors.editNewAuthor();\r\n            }\r\n        });\r\n        // this event tells the presenter the application Place is about to change.\r\n        getEventBus().addHandler(PlaceChangeEvent.TYPE, new PlaceChangeEvent.Handler() {\r\n            @Override\r\n            public void onPlaceChange(PlaceChangeEvent placeChangeEvent) {\r\n                // auto save on Place change.\r\n                logger.info(\"Document Entry auto save on Place change.\");\r\n                final XdsDocumentEntry tmp = editorDriver.flush();\r\n                model=tmp;\r\n            }\r\n        });\r\n    }\r\n\r\n    /**\r\n     * Method to handle edited metadata file download with editor\'s validation check.\r\n     */\r\n    public void doSave() {\r\n        if (editorDriver.isDirty()) {\r\n            final XdsDocumentEntry tmp = editorDriver.flush();\r\n            logger.info(\"Saving document entry: \");\r\n            logger.info(model.toString());\r\n\r\n            if (editorDriver.hasErrors()) {\r\n                final ConfirmMessageBox cmb = new ConfirmMessageBox(\"Error\", \"There are errors in your editor. Are you sure you want to download a copy of these data? They may not be usable.\");\r\n                cmb.show();\r\n                cmb.addDialogHideHandler(new DialogHideEvent.DialogHideHandler() {\r\n                    public void onDialogHide(DialogHideEvent event) {\r\n                        if (event.getHideButton() == PredefinedButton.YES) {\r\n                            // perform YES action\r\n                            model=tmp;\r\n                            save();\r\n                            cmb.hide();\r\n                        } else if (event.getHideButton() == PredefinedButton.NO) {\r\n                            // perform NO action\r\n                        }\r\n                    }\r\n                });\r\n            } else {\r\n                model=tmp;\r\n                save();\r\n            }\r\n        } else {\r\n            final ConfirmMessageBox cmb = new ConfirmMessageBox(\"\", \"Data has not changed. Are you sure you want to download a copy of this metadata entry?\");\r\n            cmb.show();\r\n            cmb.addDialogHideHandler(new DialogHideEvent.DialogHideHandler() {\r\n                public void onDialogHide(DialogHideEvent event) {\r\n                    if (event.getHideButton() == PredefinedButton.YES) {\r\n                        // perform YES action\r\n                        save();\r\n                        cmb.hide();\r\n                    } else if (event.getHideButton() == PredefinedButton.NO) {\r\n                        // perform NO action\r\n                    }\r\n                }\r\n            });\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Method which actually handle saving (on server) and download for the edited metadata file.\r\n     */\r\n    private void save() {\r\n        ((MetadataEditorEventBus) eventBus).fireSaveFileEvent();\r\n    }\r\n\r\n    /**\r\n     * Method that cancels the changes made to the document entry object since the last save.\r\n     */\r\n    public void rollbackChanges() {\r\n        logger.info(\"Cancel doc. entry changes.\");\r\n        ((MetadataEditorEventBus) eventBus).fireXdsEditorLoadedEvent();\r\n    }\r\n\r\n    /**\r\n     * Getter that returns the XDS Document Entry object in edition.\r\n     * @return XDS Document Entry object being edited.\r\n     */\r\n    public XdsDocumentEntry getModel() {\r\n        return model;\r\n    }\r\n\r\n    /**\r\n     * Interface of a XDS Document Entry Editor Driver\r\n     */\r\n    interface DocEntryEditorDriver extends SimpleBeanEditorDriver<XdsDocumentEntry, DocumentEntryEditorView> {\r\n\r\n    }\r\n\r\n}\r\n'),(4488,5596,'package gov.nist.hit.ds.docentryeditor.client.editor.documentEntryEditor;\r\n\r\nimport com.google.gwt.editor.client.Editor;\r\nimport com.google.gwt.event.logical.shared.ResizeEvent;\r\nimport com.google.gwt.event.logical.shared.ResizeHandler;\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;\r\nimport com.sencha.gxt.core.client.util.Margins;\r\nimport com.sencha.gxt.data.client.editor.ListStoreEditor;\r\nimport com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer;\r\nimport com.sencha.gxt.widget.core.client.container.SimpleContainer;\r\nimport com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;\r\nimport com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;\r\nimport com.sencha.gxt.widget.core.client.event.SelectEvent;\r\nimport com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;\r\nimport com.sencha.gxt.widget.core.client.form.FieldSet;\r\nimport com.sencha.gxt.widget.core.client.form.validator.RegExValidator;\r\nimport com.sencha.gxt.widget.core.client.tips.ToolTipConfig;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.widgets.AuthorWidgets.AuthorsListEditorWidget;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.widgets.CodedTermWidgets.CodedTermsEditableGridWidget;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.widgets.CodedTermWidgets.PredefinedCodedTermComboBox;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.widgets.*;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.widgets.IdentifierWidgets.IdentifierOIDEditorWidget;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.widgets.IdentifierWidgets.IdentifierString256EditorWidget;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.widgets.InternationalStringWidgets.InternationalStringEditableGrid;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.widgets.NameValueWidgets.NameValueDTMEditorWidget;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.widgets.NameValueWidgets.NameValueIntegerEditorWidget;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.widgets.NameValueWidgets.NameValueString256EditorWidget;\r\nimport gov.nist.hit.ds.docentryeditor.client.generics.abstracts.AbstractView;\r\nimport gov.nist.hit.ds.docentryeditor.client.parser.PredefinedCodes;\r\nimport gov.nist.hit.ds.docentryeditor.client.resources.ToolTipResources;\r\nimport gov.nist.hit.ds.docentryeditor.client.widgets.EditorToolbar;\r\nimport gov.nist.hit.ds.docentryeditor.shared.model.CodedTerm;\r\nimport gov.nist.hit.ds.docentryeditor.shared.model.InternationalString;\r\nimport gov.nist.hit.ds.docentryeditor.shared.model.XdsDocumentEntry;\r\n\r\nimport javax.inject.Inject;\r\nimport java.util.HashMap;\r\nimport java.util.Map;\r\n/**\r\n * This class represents the view of the Document Entry editor.\r\n * It only handles the different widgets used to build the final\r\n * complete view of the editor.\r\n * It work with a presenter to handle the XdsDocumentEntry model.\r\n *\r\n * @see gov.nist.hit.ds.docentryeditor.shared.model.XdsDocumentEntry\r\n * @see gov.nist.hit.ds.docentryeditor.client.editor.documentEntryEditor.DocumentEntryEditorPresenter\r\n */\r\npublic class DocumentEntryEditorView extends AbstractView<DocumentEntryEditorPresenter> implements Editor<XdsDocumentEntry> {\r\n    private final VerticalLayoutContainer form = new VerticalLayoutContainer();\r\n\r\n    private VerticalLayoutContainer requiredFields = new VerticalLayoutContainer();\r\n    private VerticalLayoutContainer optionalFields = new VerticalLayoutContainer();\r\n\r\n    /* simple fields declaration */\r\n    @Inject\r\n    String256EditorWidget id;\r\n    @Inject\r\n    String256EditorWidget hash;\r\n    @Inject\r\n    String256EditorWidget uri;\r\n    @Inject\r\n    LanguageCodeComboBox languageCode;\r\n    @Inject\r\n    MimeTypeComboBox mimeType;\r\n\r\n    // Could be injected using FactoryProvider assisted inject\r\n    OIDEditorWidget repoUId = new OIDEditorWidget(false);\r\n\r\n    /* Identifiers declaration */\r\n    @Inject\r\n    IdentifierOIDEditorWidget uniqueId;\r\n    @Inject\r\n    IdentifierString256EditorWidget patientID;\r\n\r\n    /* coded terms declaration */\r\n    // Could be injected using FactoryProvider assisted inject\r\n    PredefinedCodedTermComboBox classCode = new PredefinedCodedTermComboBox(PredefinedCodes.CLASS_CODES);\r\n    PredefinedCodedTermComboBox formatCode = new PredefinedCodedTermComboBox(PredefinedCodes.FORMAT_CODES);\r\n    PredefinedCodedTermComboBox healthcareFacilityType = new PredefinedCodedTermComboBox(PredefinedCodes.HEALTHCARE_FACILITY_TYPE_CODES);\r\n    PredefinedCodedTermComboBox practiceSettingCode = new PredefinedCodedTermComboBox(PredefinedCodes.PRACTICE_SETTING_CODES);\r\n    PredefinedCodedTermComboBox typeCode = new PredefinedCodedTermComboBox(PredefinedCodes.TYPE_CODES);\r\n\r\n    /* name values declaration */\r\n    // Could be injected using FactoryProvider assisted inject\r\n    NameValueString256EditorWidget legalAuthenticator = new NameValueString256EditorWidget(\"Legal Authenticator\");\r\n    NameValueString256EditorWidget sourcePatientId = new NameValueString256EditorWidget(\"Source Patient ID\");\r\n    NameValueString256EditorWidget sourcePatientInfo = new NameValueString256EditorWidget(\"Source Patient Info\");\r\n    NameValueDTMEditorWidget creationTime = new NameValueDTMEditorWidget(\"Creation Time\");\r\n    NameValueDTMEditorWidget serviceStartTime = new NameValueDTMEditorWidget(\"Service Start Time\");\r\n    NameValueDTMEditorWidget serviceStopTime = new NameValueDTMEditorWidget(\"Service Stop Time\");\r\n    NameValueIntegerEditorWidget size = new NameValueIntegerEditorWidget(\"File Size\");\r\n\r\n    /* Authors widget */\r\n    @Inject\r\n    AuthorsListEditorWidget authors;\r\n\r\n    // ---- Titles WIDGETS\r\n    ListStoreEditor<InternationalString> titles;\r\n    InternationalStringEditableGrid titlesGrid;\r\n\r\n    // ---- Comments WIDGETS\r\n    ListStoreEditor<InternationalString> comments;\r\n    InternationalStringEditableGrid commentsGrid;\r\n\r\n    // ---- ConfidentialityCodes WIDGETS\r\n    ListStoreEditor<CodedTerm> confidentialityCodes;\r\n    CodedTermsEditableGridWidget confidentialityCodesGrid;\r\n\r\n    // ---- EventCodes WIDGETS\r\n    ListStoreEditor<CodedTerm> eventCode;\r\n    CodedTermsEditableGridWidget eventCodesGrid;\r\n\r\n    // -- Button toolbars\r\n    @Inject\r\n    private EditorToolbar editorTopToolbar;\r\n    @Inject\r\n    private EditorToolbar editorBottomToolbar;\r\n\r\n    /**\r\n     * This is the abstract method implementation that builds a collection of objects\r\n     * mapping a String key to a Widget for the Document Entry editor view.\r\n     * @return Map of widgets for the Submission Set editor view.\r\n     */\r\n    @Override\r\n    protected Map<String, Widget> getPathToWidgetsMap() {\r\n        Map<String, Widget> map = new HashMap<String, Widget>();\r\n        map.put(\"id\", id);\r\n        map.put(\"hash\", hash);\r\n        map.put(\"patientID\", patientID);\r\n        map.put(\"uniqueId\", uniqueId);\r\n        map.put(\"uri\", uri);\r\n        map.put(\"repoUId\", repoUId);\r\n        return map;\r\n    }\r\n\r\n    /**\r\n     * This is the implementation of an abstract method supposed to construct\r\n     * the Document Entry editor view as a widget.\r\n     * @return Submission Set editor view as a Widget.\r\n     */\r\n    @Override\r\n    protected Widget buildUI() {\r\n        final VerticalLayoutContainer container = new VerticalLayoutContainer();\r\n        container.getElement().setMargins(10);\r\n        container.setBorders(false);\r\n\r\n        SimpleContainer fp1 = new SimpleContainer();\r\n        SimpleContainer fp2 = new SimpleContainer();\r\n\r\n        fp1.add(requiredFields);\r\n        fp2.add(optionalFields);\r\n\r\n        fp1.setTitle(\"Required fields\");\r\n        fp2.setTitle(\"Optional fields\");\r\n\r\n        // Adding required and optional fields panels to the main container of editor view\r\n        container.add(editorTopToolbar, new VerticalLayoutData(-1,30));\r\n        container.add(new HtmlLayoutContainer(\"<h2>Document Entry Editor</h2>\"));\r\n        container.add(new HtmlLayoutContainer(\"<h3>Required fields</h3>\"));\r\n        container.add(fp1, new VerticalLayoutData(1, -1, new Margins(0, 0, 10, 0)));\r\n        container.add(new HtmlLayoutContainer(\"<h3>Optional fields</h3>\"));\r\n        container.add(fp2, new VerticalLayoutData(1, -1, new Margins(0, 0, 10, 0)));\r\n\r\n        // //////////////////////////////////////\r\n        // Simple fields label and options (init)\r\n        // /////////////////////////////////////\r\n        // ID Field (required)\r\n        EditorFieldLabel idLabel = new EditorFieldLabel(id, \"Entry UUID\");\r\n        // Hash Field (required)\r\n        EditorFieldLabel hashLabel = new EditorFieldLabel(hash, \"Hash\");\r\n        // Language Code Field (required)\r\n        EditorFieldLabel languageCodeLabel = new EditorFieldLabel(languageCode, \"Language Code\");\r\n        // Mime Type Field (required)\r\n        EditorFieldLabel mimeTypeLabel = new EditorFieldLabel(mimeType, \"Mime Type\");\r\n        // Class Code Field (required)\r\n        EditorFieldLabel classCodeLabel = new EditorFieldLabel(classCode.getDisplay(), \"Class Code\");\r\n        // Format Code Field (required)\r\n        EditorFieldLabel formatCodeLabel = new EditorFieldLabel(formatCode.getDisplay(), \"Format Code\");\r\n        // healthcare facility Code Field (required)\r\n        EditorFieldLabel healthcareFacilityTypeLabel = new EditorFieldLabel(healthcareFacilityType.getDisplay(), \"Healthcare Facility\");\r\n        // practiceSettingCode Field (required)\r\n        EditorFieldLabel practiceSettingCodeLabel = new EditorFieldLabel(practiceSettingCode.getDisplay(), \"Practice Setting Code\");\r\n        // type Code Field (required)\r\n        EditorFieldLabel typeCodeLabel = new EditorFieldLabel(typeCode.getDisplay(), \"Type Code\");\r\n        // Repository Unique ID Field (optional)\r\n        EditorFieldLabel repositoryLabel = new EditorFieldLabel(repoUId, \"Repository Unique ID\");\r\n        // URI Field (optional)\r\n        EditorFieldLabel uriLabel = new EditorFieldLabel(uri, \"URI\");\r\n\r\n		/* ********************************* */\r\n        /* identifiers options and fieldset */\r\n        /* ********************************* */\r\n        // Patient ID Fields (required)\r\n        EditorFieldLabel patientIdLabel = new EditorFieldLabel(patientID, \"Patient ID\");\r\n        // Unique ID Fieds (required)\r\n        EditorFieldLabel uniqueIdLabel = new EditorFieldLabel(uniqueId, \"Unique ID\");\r\n\r\n        // ////////////////////////////////////////////////////\r\n        // --- Adding REQUIRED simple fields labels to containers\r\n        // ////////////////////////////////////////////////////\r\n        VerticalLayoutContainer simpleRequiredFieldsContainer = new VerticalLayoutContainer();\r\n        simpleRequiredFieldsContainer.add(idLabel, new VerticalLayoutData(1, -1));\r\n        simpleRequiredFieldsContainer.add(uniqueIdLabel, new VerticalLayoutData(1, -1));\r\n        simpleRequiredFieldsContainer.add(patientIdLabel, new VerticalLayoutData(1, -1));\r\n        simpleRequiredFieldsContainer.add(languageCodeLabel, new VerticalLayoutData(1, -1));\r\n        simpleRequiredFieldsContainer.add(mimeTypeLabel, new VerticalLayoutData(1, -1));\r\n        simpleRequiredFieldsContainer.add(classCodeLabel, new VerticalLayoutData(1, -1/*, new Margins(0, 0, 5, 0)*/));\r\n        simpleRequiredFieldsContainer.add(typeCodeLabel, new VerticalLayoutData(1, -1/*, new Margins(0, 0, 5, 0)*/));\r\n        simpleRequiredFieldsContainer.add(formatCodeLabel, new VerticalLayoutData(1, -1/*, new Margins(0, 0, 5, 0)*/));\r\n        simpleRequiredFieldsContainer.add(healthcareFacilityTypeLabel, new VerticalLayoutData(1, -1/*, new Margins(0, 0, 5, 0)*/));\r\n        simpleRequiredFieldsContainer.add(practiceSettingCodeLabel, new VerticalLayoutData(1, -1/*, new Margins(0, 0, 5, 0)*/));\r\n\r\n		/* REQUIRED container added to a fieldset */\r\n        FieldSet generalRequiredFieldSet = new FieldSet();\r\n        generalRequiredFieldSet.setHeadingText(\"General\");\r\n        generalRequiredFieldSet.setCollapsible(true);\r\n        generalRequiredFieldSet.add(simpleRequiredFieldsContainer);\r\n\r\n        // //////////////////////////////////////////////////////////\r\n        // --- Adding OPTIONAL simple fields labels to containers\r\n        // //////////////////////////////////////////////////////////\r\n        VerticalLayoutContainer filePropertiesFieldsContainer = new VerticalLayoutContainer();\r\n        filePropertiesFieldsContainer.add(hashLabel, new VerticalLayoutData(1, -1));\r\n        filePropertiesFieldsContainer.add(size.getDisplay(), new VerticalLayoutData(1, -1, new Margins(0, 0, 10, 0)));\r\n\r\n        VerticalLayoutContainer repositoryAttributesFieldsContainer = new VerticalLayoutContainer();\r\n        repositoryAttributesFieldsContainer.add(uriLabel, new VerticalLayoutData(1, -1));\r\n        repositoryAttributesFieldsContainer.add(repositoryLabel, new VerticalLayoutData(1, -1));\r\n\r\n		/* OPTIONAL container added to a fieldset */\r\n        FieldSet filePropertiesFieldSet = new FieldSet();\r\n        filePropertiesFieldSet.setHeadingText(\"Files properties\");\r\n        filePropertiesFieldSet.setCollapsible(true);\r\n        filePropertiesFieldSet.add(filePropertiesFieldsContainer);\r\n\r\n        FieldSet repositoryAttributesFieldSet = new FieldSet();\r\n        repositoryAttributesFieldSet.setHeadingText(\"Repository attributes\");\r\n        repositoryAttributesFieldSet.setCollapsible(true);\r\n        repositoryAttributesFieldSet.add(repositoryAttributesFieldsContainer, new VerticalLayoutData(1, -1));\r\n\r\n        // //////////////////////////////////////////////////////\r\n        // Other fields and options (init)\r\n        // //////////////////////////////////////////////////////\r\n\r\n\r\n		/* ********************************** */\r\n        /* coded terms options and fieldset */\r\n        /* ********************************** */\r\n\r\n		/* ****************************** */\r\n        /* name values options and fields */\r\n        /* ****************************** */\r\n        // Legal Authenticator (optional)\r\n        legalAuthenticator.setListMaxSize(1);\r\n\r\n        // Source Patient ID (optional)\r\n        sourcePatientId.setListMaxSize(1);\r\n\r\n        // Source Patient Info\r\n        sourcePatientInfo.setListMaxSize(10);\r\n\r\n        // Service Start Time (optional)\r\n        serviceStartTime.setListMaxSize(1);\r\n\r\n        // Service Stop Time (optional)\r\n        serviceStopTime.setListMaxSize(1);\r\n\r\n        // Size (optional)\r\n        //  size.disableEditing();\r\n        size.disableToolbar();\r\n        size.setListMaxSize(1);\r\n\r\n        // Creation Time (required)\r\n        creationTime.disableToolbar();\r\n        creationTime.setListMaxSize(1);\r\n\r\n        // AUTHORS (Optional)\r\n        FieldSet authorsFieldSet = new FieldSet();\r\n        authorsFieldSet.setHeadingText(\"Authors\");\r\n        authorsFieldSet.setCollapsible(true);\r\n        authorsFieldSet.add(authors.asWidget());\r\n\r\n        // TITLES (Optional)\r\n        titlesGrid = new InternationalStringEditableGrid(\"Titles\");\r\n        titles = new ListStoreEditor<InternationalString>(titlesGrid.getStore());\r\n\r\n\r\n        // COMMENTS (Optional)\r\n        commentsGrid = new InternationalStringEditableGrid(\"Comments\");\r\n        comments = new ListStoreEditor<InternationalString>(commentsGrid.getStore());\r\n\r\n        // CONFIDENTIALITY CODE (Optional)\r\n        confidentialityCodesGrid = new CodedTermsEditableGridWidget(\"Confidentiality Codes\", PredefinedCodes.CONFIDENTIALITY_CODES);\r\n        confidentialityCodes = new ListStoreEditor<CodedTerm>(confidentialityCodesGrid.getStore());\r\n\r\n        // CONFIDENTIALITY CODE (Optional)\r\n        eventCodesGrid = new CodedTermsEditableGridWidget(\"Event Codes\", PredefinedCodes.EVENT_CODES);\r\n        eventCode = new ListStoreEditor<CodedTerm>(eventCodesGrid.getStore());\r\n\r\n        // /////////////////////////////////////////////////////////\r\n        // Adding and ordering fieldsets in REQUIRED panel\r\n        // /////////////////////////////////////////////////////////\r\n        /* simple required fields added to FramedPanel container */\r\n        requiredFields.add(generalRequiredFieldSet, new VerticalLayoutData(1,-1,new Margins(0,0,10,0)));\r\n        requiredFields.add(creationTime.getDisplay(), new VerticalLayoutData(1, -1, new Margins(0, 0, 10, 0)));\r\n\r\n        // /////////////////////////////////////////////////////////\r\n        // Adding and ordering fieldsets in OPTIONAL fields panel\r\n        // /////////////////////////////////////////////////////////\r\n        /* simple optional fields added to FramedPanel container */\r\n        optionalFields.add(filePropertiesFieldSet, new VerticalLayoutData(1, -1, new Margins(0, 0, 10, 0)));\r\n        optionalFields.add(repositoryAttributesFieldSet, new VerticalLayoutData(1, -1, new Margins(0, 0, 10, 0)));\r\n        optionalFields.add(titlesGrid.getDisplay(), new VerticalLayoutData(1, -1, new Margins(0, 0, 10, 0)));\r\n        optionalFields.add(commentsGrid.getDisplay(), new VerticalLayoutData(1, -1, new Margins(0, 0, 10, 0)));\r\n        optionalFields.add(authorsFieldSet, new VerticalLayoutData(1, -1, new Margins(0, 0, 10, 0)));\r\n        optionalFields.add(legalAuthenticator.getDisplay(), new VerticalLayoutData(1, -1, new Margins(0, 0, 10, 0)));\r\n        optionalFields.add(sourcePatientId.getDisplay(), new VerticalLayoutData(1, -1, new Margins(0, 0, 10, 0)));\r\n        optionalFields.add(sourcePatientInfo.getDisplay(), new VerticalLayoutData(1, -1, new Margins(0, 0, 10, 0)));\r\n        optionalFields.add(confidentialityCodesGrid.getDisplay(), new VerticalLayoutData(1, -1, new Margins(0, 0, 10, 0)));\r\n        optionalFields.add(eventCodesGrid.getDisplay(), new VerticalLayoutData(1, -1, new Margins(0, 0, 10, 0)));\r\n        optionalFields.add(serviceStartTime.getDisplay(), new VerticalLayoutData(1, -1, new Margins(0, 0, 10, 0)));\r\n        optionalFields.add(serviceStopTime.getDisplay(), new VerticalLayoutData(1, -1, new Margins(0, 0, 10, 0)));\r\n\r\n        SimpleContainer bottomToolbarContainer = new SimpleContainer();\r\n        bottomToolbarContainer.add(editorBottomToolbar);\r\n        optionalFields.add(bottomToolbarContainer);\r\n\r\n        setWidgetsInfo();\r\n\r\n        form.setScrollMode(ScrollMode.AUTO);\r\n        form.add(container);\r\n\r\n        form.forceLayout();\r\n\r\n        return form;\r\n    }\r\n\r\n    /**\r\n     * Implementation of the abstract method that binds together\r\n     * widgets actions (such as a button click) with presenter actions.\r\n     */\r\n    @Override\r\n    protected void bindUI() {\r\n        form.addResizeHandler(new ResizeHandler() {\r\n            @Override\r\n            public void onResize(ResizeEvent event) {\r\n                form.forceLayout();\r\n            }\r\n        });\r\n        SelectHandler saveHandler = new SelectHandler() {\r\n            @Override\r\n            public void onSelect(SelectEvent selectEvent) {\r\n                presenter.doSave();\r\n            }\r\n        };\r\n        editorTopToolbar.addSaveHandler(saveHandler);\r\n        editorBottomToolbar.addSaveHandler(saveHandler);\r\n        SelectHandler cancelHandler = new SelectHandler() {\r\n            @Override\r\n            public void onSelect(SelectEvent selectEvent) {\r\n                presenter.rollbackChanges();\r\n            }\r\n        };\r\n        editorTopToolbar.addCancelHandler(cancelHandler);\r\n        editorBottomToolbar.addCancelHandler(cancelHandler);\r\n    }\r\n\r\n    public void refreshGridButtonsDisplay() {\r\n        serviceStartTime.refreshNewButton();\r\n        serviceStopTime.refreshNewButton();\r\n        if (commentsGrid!=null) {\r\n            commentsGrid.refreshNewButton();\r\n        }\r\n        if (confidentialityCodes!=null) {\r\n            confidentialityCodesGrid.refreshNewButton();\r\n        }\r\n        if (eventCodesGrid!=null) {\r\n            eventCodesGrid.refreshNewButton();\r\n        }\r\n        if (legalAuthenticator!=null) {\r\n            legalAuthenticator.refreshNewButton();\r\n        }\r\n        if(sourcePatientId!=null) {\r\n            sourcePatientId.refreshNewButton();\r\n        }\r\n        if (sourcePatientInfo!=null) {\r\n            sourcePatientInfo.refreshNewButton();\r\n        }\r\n        if (titlesGrid!=null) {\r\n            titlesGrid.refreshNewButton();\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Sets information about each widgets to guide the user. Tooltips, empty texts and validators\r\n     */\r\n    public void setWidgetsInfo() {\r\n        // class code\r\n        classCode.setEmptyText(\"Select a class...\");\r\n        classCode.clear();\r\n        classCode.setAllowBlank(false);\r\n        // comments\r\n        commentsGrid.setToolbarHelpButtonTooltip(new ToolTipConfig(\"Help on Comments\", \"Comments associated with the Document. Free form text with an XDS \" +\r\n                \"Affinity Domain specified usage. Each comment should have the same meaning in a different language.\"));\r\n        // confidentiality codes\r\n        confidentialityCodesGrid.setToolbarHelpButtonTooltip(new ToolTipConfig(\"Help on Confidentiality codes\", \"The code specifying the level of confidentiality of the XDS Document.\" +\r\n                \"These codes are specific to an XDS Affinity Domain. Enforcement and \" +\r\n                \"issues related to highly sensitive documents are beyond the scope of \" +\r\n                \"XDS (see security section). These issues are expected to be addressed in \" +\r\n                \"later years. confidentialityCode is part of a codification scheme and \" +\r\n                \"value set enforced by the Document Registry. Shall have one or more \" +\r\n                \"values. Code multiple values by creating multiple classification objects\"));\r\n        // event codes\r\n        eventCodesGrid.setToolbarHelpButtonTooltip(new ToolTipConfig(\"Help on Event codes\", \"This list of codes represents the main clinical acts, such as a colonoscopy \" +\r\n                \"or an appendectomy, being documented. In some cases, the event is \" +\r\n                \"inherent in the typeCode, such as a \\\"History and Physical Report\\\" in \" +\r\n                \"which the procedure being documented is necessarily a \\\"History and \" +\r\n                \"Physical\\\" act. \" +\r\n                \"An event can further specialize the act inherent in the typeCode, such as \" +\r\n                \"where it is simply \\\"Procedure Report\\\" and the procedure was a \" +\r\n                \"\\\"colonoscopy\\\". If one or more eventCodes are included, they shall not \" +\r\n                \"conflict with the values inherent in the classCode, practiceSettingCode or \" +\r\n                \"typeCode, as such a conflict would create an ambiguous situation. \" +\r\n                \"This short list of codes is provided to be used as “key words” for certain \" +\r\n                \"types of queries. If present, shall have one or more values. Code multiple \" +\r\n                \"values by creating multiple classification objects.\"));\r\n        // format code\r\n        formatCode.setEmptyText(\"Select a format...\");\r\n        formatCode.clear();\r\n        formatCode.setAllowBlank(false);\r\n        // hash code\r\n        hash.setEmptyText(\"ex: Hex456\");\r\n        hash.setToolTipConfig(new ToolTipConfig(\"Hash is a string\", ToolTipResources.INSTANCE.getString256ToolTip()));\r\n        hash.setAllowBlank(true);\r\n        hash.addValidator(new RegExValidator(\"^[0-9a-fA-F]+$\", \"Value is not correct. It is supposed to be a hexadecimal value.\"));\r\n        // healthcare facility\r\n        healthcareFacilityType.setEmptyText(\"Select an healthcare facility...\");\r\n        healthcareFacilityType.clear();\r\n        healthcareFacilityType.setAllowBlank(false);\r\n        // entry uuid\r\n        id.setEmptyText(\"ex: 123456789\");\r\n        id.setToolTipConfig(new ToolTipConfig(\"ID is a string\", ToolTipResources.INSTANCE.getString256ToolTip()));\r\n        id.setAllowBlank(false);\r\n        // RegExValidator: \"[1-9][0-9]+\", \"Value is not correct. It is supposed to be a number.\"\r\n        id.addValidator(new UuidFormatClientValidator());\r\n        // language code\r\n        languageCode.setAllowBlank(false);\r\n        languageCode.setEmptyText(\"Select a language...\");\r\n        languageCode.setToolTipConfig(new ToolTipConfig(\"LanguageCode from RFC3066\", \"Language code format is \\\"[a-z](2)-[A-Z](2)\\\"\"));\r\n        // legal authenticator\r\n        legalAuthenticator.setEditingFieldToolTip(\"A legal authenticator is a string256 in XCN format. It should be formatted as follow: \\n<b>Identifier^LastName^FirstName[^SecondName[^FurtherGivenNames]][^Suffix][^Prefix]^AssigningAuthority</b>.\");\r\n        // Empty Texts : \"ex: 11375^Welby^Marcus^J^Jr. MD^Dr^^^&1.2.840.113619.6.197&ISO\"\r\n        legalAuthenticator.addFieldValidator(new RegExValidator(\"^[0-9]+\\\\^(([A-Za-z]+\\\\.?\\\\s?)+\\\\^){3,7}\\\\^{2}&[0-9]+(\\\\.[0-9]+)*(&ISO)$\"));\r\n        legalAuthenticator.setToolbarHelpButtonTooltip(new ToolTipConfig(\"Help about legal authenticator\", \"Represents a participant who has legally authenticated or attested the\" +\r\n                \"document within the authorInstitution. Legal authentication implies that \" +\r\n                \"a document has been signed manually or electronically by the \" +\r\n                \"legalAuthenticator. This attribute may be absent if not applicable. If \" +\r\n                \"present, shall have a single value. <br/>It should be formatted as following:<br/>\" +\r\n                \"<ul><li>Identifier</li><li>Last Name</li><li>First name</li><li>Second and further names</li><li>Suffix</li><li>Prefix</li><li>Assigning authority</li></ul><br/>\" +\r\n                \"An example of person name with ID number using this data type is as follows:<br/>\" +\r\n                \"<b>11375^Welby^Marcus^J^Jr. MD^Dr^^^&1.2.840.113619.6.197&ISO</b>\"));\r\n        // mime type\r\n        mimeType.setAllowBlank(false);\r\n        mimeType.setEmptyText(\"Select a mime type...\");\r\n        mimeType.setToolTipConfig(new ToolTipConfig(\"Mime Type is a string\", ToolTipResources.INSTANCE.getString256ToolTip()));\r\n        // patient id\r\n        patientID.setEmptyTexts(\"ex: 76cc^^1.3.6367.2005.3.7&ISO\", \"ex: urn:uuid:6b5aea1a-625s-5631-v4se-96a0a7b38446\");\r\n        patientID.setToolTipConfigs(new ToolTipConfig(\"Patient ID is a String256 in HL7 CX format\", \"The required format is:\" +\r\n                \"IDNumber^^^&OIDofAssigningAuthority&ISO\"), new ToolTipConfig(\r\n                \"idType is a string256 in HL7 CX format\", \"The required format is: \" +\r\n                \"IDNumber^^^&OIDofAssigningAuthority&ISO\"));\r\n        patientID.setAllowBlanks(false, false);\r\n        patientID.addValueFieldValidator(new RegExValidator(\"^(([A-Za-z])|([1-9]))*[0-9A-z]+\\\\^{3}&[1-9][0-9]*(\\\\.[1-9][0-9]*)+(&ISO)$\", \"Value\'s format is not a correct. \\nIt should be like this: 6578946^^^&1.3.6.1.4.1.21367.2005.3.7&ISO.\"));\r\n        // pratice setting code\r\n        practiceSettingCode.setEmptyText(\"Select a practice setting...\");\r\n        practiceSettingCode.clear();\r\n        practiceSettingCode.setAllowBlank(false);\r\n        // repository unique id\r\n        repoUId.setEmptyText(\"ex: 1.2.7.0.3.2.37768.2007.2.2\");\r\n        repoUId.setToolTipConfig(new ToolTipConfig(\"Repository Unique ID is an OID\",\r\n                \"As defined in the HL7 implementation for OID (http://www.hl7.org/implement/standards/product_brief.cfm?product_id=210) \"\r\n                        + \"OID format is \\\"[1-9](\\\\.[0-9]+)*]\\\"\"));\r\n        repoUId.setAllowBlank(true);\r\n        repoUId.addOIDValidator(new RegExValidator(\"^[1-9][0-9]*(\\\\.[1-9][0-9]*)+$\", \"Value is not correct. A repository unique ID is supposed to be a suite of numbers separated by periods.\"));\r\n        // service start time\r\n        serviceStartTime.setToolbarHelpButtonTooltip(new ToolTipConfig(\"Help on Service start time\", \"Represents the start time the service being documented took place \" +\r\n                \"(clinically significant, but not necessarily when the document was \" +\r\n                \"produced or approved). This may be the same as the encounter time in \" +\r\n                \"case the service was delivered during an encounter. Encounter time is not \" +\r\n                \"coded in XDS metadata but may be coded in documents managed by \" +\r\n                \"XDS. This time is expressed as (date/time/UTC). If present, shall have a \" +\r\n                \"single value. \" +\r\n                \"<br/><i>Note: Other times, such as document creation or approval are to be \" +\r\n                \"recorded, if needed, within the document.</i>\"));\r\n        serviceStopTime.setToolbarHelpButtonTooltip(new ToolTipConfig(\"Help on Service stop time\",\r\n                \"Represents the stop time the service being documented took place.\" +\r\n                        \"This may be the same as the encounter time in \" +\r\n                        \"case the service was delivered during an encounter. This time is expressed as (date/time/UTC). \" +\r\n                        \"If present, shall have a single value.\"));\r\n        // source patient id\r\n        sourcePatientId.addFieldValidator(new RegExValidator(\"^(([A-Za-z])|([1-9]))*[0-9A-z]+\\\\^{3}&[1-9][0-9]*(\\\\.[1-9][0-9]*)+(&ISO)$\", \"This value is not a correct source patient id.\"));\r\n        // RegExValidator: \"^[A-Za-z]*[0-9]+\\\\^{3}&[1-9][0-9]*(\\\\.[1-9][0-9]*)+(&ISO)$\", \"This value is not a correct source patient id.\"\r\n        // Empty Text: \"j98789^^^&1.2.3.4.343.1&ISO\"\r\n        sourcePatientId.setToolbarHelpButtonTooltip(new ToolTipConfig(\"Help on Source Patient ID\", \"The sourcePatientId represents the subject of care medical record \" +\r\n                \"Identifier (e.g., Patient Id) in the local patient Identifier Domain of the \" +\r\n                \"Document Source. It shall contain two parts:\" +\r\n                \"<ul><li>Authority Domain Id</li>\" +\r\n                \"<li>An Id in the above domain (e.g., Patient Id).</li></ul>\" +\r\n                \"This sourcePatientId is not intended to be updated once the Document is \" +\r\n                \"registered (just as the Document content and metadata itself will not be \" +\r\n                \"updated without replacing the previous document). As this \" +\r\n                \"sourcePatientId may have been merged by the source actor, it may no \" +\r\n                \"longer be in use within the Document Source (EHR-CR). It is only \" +\r\n                \"intended as an audit/checking mechanism and has occasional use for \" +\r\n                \"Document Consumer Actors. There can be only one Slot named \" +\r\n                \"sourcePatientId.\"));\r\n        // source patient info\r\n        sourcePatientInfo.setToolbarHelpButtonTooltip(new ToolTipConfig(\"Help on Source Patient Info\", \"These elements should contain demographics information of the patient to \" +\r\n                \"whose medical record this document belongs. It is made several values and should be formatted as follow:<br/>\" +\r\n                \"<b>PID-3</b> should include the source patient identifier.<br/>\" +\r\n                \"<b>PID-5</b> should include the patient name.<br/>\" +\r\n                \"<b>PID-7</b> should include the patient date of birth.<br/>\" +\r\n                \"<b>PID-8</b> should code the patient gender as <br/>\" +\r\n                \"<center><i>M Male - F Female - O Other - U Unknown</i></center>\" +\r\n                \"<b>PID-11</b> should include the patient address.<br/>\" +\r\n                \"PID-2, PID-4, PID-12 and PID-19 should not be used.<br/>\"));\r\n        sourcePatientInfo.addFieldValidator(new RegExValidator(\"^PID-(((3|5|11|2|4|12|19)\\\\|)|(8\\\\|(M|F|O|U)$)|(7\\\\|(((19|20)\\\\d\\\\d)(0?[1-9]|1[012])(0?[1-9]|[12][0-9]|3[01])))$)\", \"This value is not a correct source patient info.\"));\r\n        // title\r\n        titlesGrid.setToolbarHelpButtonTooltip(new ToolTipConfig(\"Help on Titles\", \"Represents the title of the document. Clinical documents often do not \" +\r\n                \"have a title, and are collectively referred to by the display name of the \" +\r\n                \"classCode (e.g., a \\\"consultation\\\" or \\\"progress note\\\"). Where these display \" +\r\n                \"names are rendered to the clinician, or where the document has a unique \" +\r\n                \"title, the title component shall be used. Max length, 128 bytes, UTF-8. \" +\r\n                \"Each title must be the same in a different language.\"));\r\n        // type code\r\n        typeCode.setEmptyText(\"Select a type...\");\r\n        typeCode.clear();\r\n        typeCode.setAllowBlank(false);\r\n        // unique id\r\n        uniqueId.setAllowBlanks(false, false);\r\n        uniqueId.addValueFieldValidator(new RegExValidator(\"^[1-9][0-9]*(\\\\.[1-9][0-9]*)+(\\\\^[1-9][0-9]+)?$\", \"Value\'s format is not a correct. It is supposed to be a suite of figures separated by periods.\"));\r\n\r\n        uniqueId.setEmptyTexts(\"ex: 2008.8.1.35447^5846\", \"ex: 2008.8.1.35447\");\r\n        uniqueId.setToolTipConfigs(\r\n                new ToolTipConfig(\"Unique ID is an OID\", \"As defined in the HL7 implementation for OID (http://www.hl7.org/implement/standards/product_brief.cfm?product_id=210)<br/>Unique ID format is \\\"[1-9](\\\\.[0-9]+)*]\\\"\"),\r\n                new ToolTipConfig(\r\n                        \"idType is an OID\",\r\n                        \"As defined in the HL7 implementation for OID (http://www.hl7.org/implement/standards/product_brief.cfm?product_id=210)<br/>Unique ID format is \\\"[1-9](\\\\.[0-9]+)*]\\\"\"));\r\n        // uri\r\n        uri.setAllowBlank(true);\r\n        uri.setEmptyText(\"ex: uriO\");\r\n        uri.setToolTipConfig(new ToolTipConfig(\"URI is a string\", ToolTipResources.INSTANCE.getString256ToolTip()));\r\n    }\r\n}\r\n'),(4489,5598,'package gov.nist.hit.ds.docentryeditor.client.editor.properties;\r\n\r\nimport com.google.gwt.editor.client.Editor.Path;\r\nimport com.sencha.gxt.core.client.ValueProvider;\r\nimport com.sencha.gxt.data.shared.ModelKeyProvider;\r\nimport com.sencha.gxt.data.shared.PropertyAccess;\r\nimport gov.nist.hit.ds.docentryeditor.shared.model.Author;\r\n\r\n/**\r\n * Property Access interface for Author entity. It handles the access to\r\n * author\'s attributes for GXT Stores. It handles the access to a key for the\r\n * author object as well as the author person value.\r\n *\r\n * This Property access only handles the Author\'s attribute authorPerson.\r\n *\r\n * @see Author\r\n *\r\n * @author Olivier\r\n *\r\n */\r\npublic interface AuthorProperties extends PropertyAccess<Author> {\r\n	/**\r\n	 * Returns the KeyProvider for Author. It is consider authorPerson will be\r\n	 * the key of the entity.\r\n	 *\r\n	 * @return a KeyProvider for Author\r\n	 */\r\n	@Path(\"authorPerson\")\r\n	ModelKeyProvider<Author> key();\r\n\r\n	/**\r\n	 * Returns ValueProvider for Author. It handles the access to the\r\n	 * authorPerson Author\'s attribute.\r\n	 *\r\n	 * @return Author ValueProvier for authorPerson\r\n	 */\r\n	@Path(\"authorPerson.string\")\r\n	ValueProvider<Author, String> authorPerson();\r\n\r\n    /**\r\n     * Returns ValueProvider for Author. It handles the access to the\r\n     * authorTelecommunication Author\'s attribute.\r\n     *\r\n     * @return Author ValueProvier for authorTelecommunication\r\n     */\r\n    @Path(\"authorPerson.string\")\r\n    ValueProvider<Author, String> authorTelecommunication();\r\n}\r\n'),(4490,5599,'package gov.nist.hit.ds.docentryeditor.client.editor.properties;\r\n\r\nimport com.google.gwt.editor.client.Editor.Path;\r\nimport com.sencha.gxt.core.client.ValueProvider;\r\nimport com.sencha.gxt.data.shared.ModelKeyProvider;\r\nimport com.sencha.gxt.data.shared.PropertyAccess;\r\nimport gov.nist.hit.ds.docentryeditor.shared.model.CodedTerm;\r\n\r\n/**\r\n * Property Access interface for CodedTerm entities. It handles the access to\r\n * codedTerm\'s attributes for GXT Stores. It handles the access to a key for the\r\n * codedTerm object as well as is displayName, its code and its codingScheme.\r\n *\r\n * @see CodedTerm\r\n *\r\n * @author Olivier\r\n *\r\n */\r\npublic interface CodedTermProperties extends PropertyAccess<CodedTerm> {\r\n	/**\r\n	 * Returns the KeyProvider for CodedTerm. It is consider that CodedTerm\'s\r\n	 * attribute \"code\" will be the key of the entity.\r\n	 *\r\n	 * @return a KeyProvider for CodedTerm\r\n	 */\r\n	@Path(\"code.string\")\r\n	ModelKeyProvider<CodedTerm> key();\r\n\r\n	/**\r\n	 * Returns ValueProvider for CodedTerm displayName attribute.\r\n	 *\r\n	 * @return CodedTerm ValueProvier for displayName\r\n	 */\r\n	@Path(\"displayName.string\")\r\n	ValueProvider<CodedTerm, String> displayName();\r\n\r\n	/**\r\n	 * Returns ValueProvider for CodedTerm code attribute.\r\n	 *\r\n	 * @return CodedTerm ValueProvier for code\r\n	 */\r\n	@Path(\"code.string\")\r\n	ValueProvider<CodedTerm, String> code();\r\n\r\n	/**\r\n	 * Returns ValueProvider for CodedTerm codingScheme attribute.\r\n	 *\r\n	 * @return CodedTerm ValueProvier for codingScheme\r\n	 */\r\n	@Path(\"codingScheme.codingScheme.string\")\r\n	ValueProvider<CodedTerm, String> codingScheme();\r\n}\r\n'),(4491,5600,'package gov.nist.hit.ds.docentryeditor.client.editor.properties;\r\n\r\nimport com.google.gwt.editor.client.Editor.Path;\r\nimport com.sencha.gxt.core.client.ValueProvider;\r\nimport com.sencha.gxt.data.shared.ModelKeyProvider;\r\nimport com.sencha.gxt.data.shared.PropertyAccess;\r\nimport gov.nist.hit.ds.docentryeditor.shared.model.DTM;\r\n\r\nimport java.util.Date;\r\n\r\n/**\r\n * Property Access interface for DTM entity. It handles the access to dtm\'s\r\n * attributes for GXT Stores. It handles the access to a key for the dtm object\r\n * as well as the dtm value.\r\n *\r\n * This Property access only handles the DTM\'s attribute dtm.\r\n *\r\n * @see DTM\r\n *\r\n * @author Olivier\r\n *\r\n */\r\npublic interface DTMProperties extends PropertyAccess<DTM> {\r\n	/**\r\n	 * Returns the KeyProvider for DTM. It is consider that DTM\'s attribute\r\n	 * \"dtm\" will be the key of the entity.\r\n	 *\r\n	 * @return a KeyProvider for DTM\r\n	 */\r\n	@Path(\"dtm\")\r\n	ModelKeyProvider<DTM> key();\r\n\r\n	/**\r\n	 * Returns ValueProvider for DTM dtm (value) attribute.\r\n	 *\r\n	 * @return CodedTerm ValueProvier for displayName\r\n	 */\r\n	@Path(\"dtm\")//.string\r\n	ValueProvider<DTM, Date> dtm();\r\n\r\n}\r\n'),(4492,5601,'package gov.nist.hit.ds.docentryeditor.client.editor.properties;\r\n\r\nimport com.google.gwt.editor.client.Editor.Path;\r\nimport com.sencha.gxt.core.client.ValueProvider;\r\nimport com.sencha.gxt.data.shared.ModelKeyProvider;\r\nimport com.sencha.gxt.data.shared.PropertyAccess;\r\nimport gov.nist.hit.ds.docentryeditor.shared.model.InternationalString;\r\nimport gov.nist.hit.ds.docentryeditor.shared.model.LanguageCode;\r\n\r\n/**\r\n * Property Access interface for InternationalString entity. It handles the\r\n * access to InternationalString\'s attributes for GXT Stores. It handles the\r\n * access to a key for the internationalString object as well as the\r\n * InternationalString language code and the InternationalString Value.\r\n *\r\n *\r\n * @see InternationalString\r\n *\r\n * @author Olivier\r\n *\r\n */\r\npublic interface InternationalStringProperties extends PropertyAccess<InternationalString> {\r\n	/**\r\n	 * Returns the KeyProvider for InternationalString. It is consider that\r\n	 * InternationalString\'s attribute \"value\" will be the key of the entity.\r\n	 *\r\n	 * @return a KeyProvider for InternationalString\r\n	 */\r\n	@Path(\"value\")\r\n	ModelKeyProvider<InternationalString> key();\r\n\r\n	/**\r\n	 * Returns ValueProvider for InternationalString languageCode. It handles\r\n	 * the access to the languageCode InternationalString\'s attribute.\r\n	 *\r\n	 * @return InternationalString ValueProvier for languageCode\r\n	 */\r\n	@Path(\"langCode\")\r\n	ValueProvider<InternationalString, LanguageCode> langCode();\r\n\r\n	/**\r\n	 * Returns ValueProvider for InternationalString value. It handles the\r\n	 * access to the value InternationalString\'s attribute.\r\n	 *\r\n	 * @return InternationalString ValueProvier for languageCode\r\n	 */\r\n	@Path(\"value.string\")\r\n	ValueProvider<InternationalString, String> value();\r\n}\r\n'),(4493,5602,'package gov.nist.hit.ds.docentryeditor.client.editor.properties;\r\n\r\nimport com.google.gwt.editor.client.Editor.Path;\r\nimport com.sencha.gxt.core.client.ValueProvider;\r\nimport com.sencha.gxt.data.shared.ModelKeyProvider;\r\nimport com.sencha.gxt.data.shared.PropertyAccess;\r\nimport gov.nist.hit.ds.docentryeditor.shared.model.String256;\r\n\r\n/**\r\n * Property Access interface for String256 entity. It handles the access to\r\n * String256 attributes for GXT Stores. It handles the access to a key for the\r\n * string256 object as well as the String256 value.\r\n *\r\n *\r\n * @see String256\r\n *\r\n * @author Olivier\r\n *\r\n */\r\npublic interface String256Properties extends PropertyAccess<String256> {\r\n	/**\r\n	 * Returns the KeyProvider for String256. It is consider that String256\'s\r\n	 * attribute \"string\" will be the key of the entity.\r\n	 *\r\n	 * @return a KeyProvider for String256\r\n	 */\r\n	@Path(\"string\")\r\n	ModelKeyProvider<String256> key();\r\n\r\n	/**\r\n	 * Returns ValueProvider for String256 value. It handles the access to the\r\n	 * string String256\'s attribute.\r\n	 *\r\n	 * @return String256 ValueProvier for string\r\n	 */\r\n	ValueProvider<String256, String> string();\r\n}\r\n'),(4494,5604,'package gov.nist.hit.ds.docentryeditor.client.editor.submissionSetEditor;\r\n\r\nimport com.google.gwt.activity.shared.AbstractActivity;\r\nimport com.google.gwt.event.shared.EventBus;\r\nimport com.google.gwt.user.client.Timer;\r\nimport com.google.gwt.user.client.ui.AcceptsOneWidget;\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport com.sencha.gxt.core.client.Style;\r\nimport com.sencha.gxt.widget.core.client.ContentPanel;\r\nimport com.sencha.gxt.widget.core.client.container.BorderLayoutContainer;\r\nimport com.sencha.gxt.widget.core.client.container.SimpleContainer;\r\nimport gov.nist.hit.ds.docentryeditor.client.event.MetadataEditorEventBus;\r\nimport gov.nist.hit.ds.docentryeditor.client.generics.ActivityDisplayer;\r\nimport gov.nist.hit.ds.docentryeditor.client.generics.GenericMVP;\r\nimport gov.nist.hit.ds.docentryeditor.shared.model.XdsSubmissionSet;\r\n\r\nimport javax.inject.Inject;\r\nimport java.util.logging.Logger;\r\n\r\n/**\r\n * Place for the Submission Set editor.\r\n * This enables the navigation within the application thanks to\r\n * the Activity-place design.\r\n */\r\npublic class SubmissionSetEditorActivity extends AbstractActivity{\r\n    @Inject\r\n    private ActivityDisplayer displayer;\r\n    @Inject\r\n    private MetadataEditorEventBus metadataEditorEventBus;\r\n\r\n    private GenericMVP<XdsSubmissionSet,SubmissionSetEditorView,SubmissionSetEditorPresenter> editorMVP;\r\n    @Inject\r\n    private SubmissionSetEditorView editorView;\r\n    @Inject\r\n    private SubmissionSetEditorPresenter editorPresenter;\r\n\r\n    private SimpleContainer sc;\r\n    private BorderLayoutContainer blc;\r\n\r\n    // method automatically called in the GWT Activity-Place design.\r\n    @Override\r\n    public void start(AcceptsOneWidget panel, EventBus eventBus) {\r\n        editorMVP=buildEditorMVP();\r\n        editorMVP.init();\r\n        displayer.display(getContainer(), panel, eventBus);\r\n        // timer to solve a gwt issue (ugly)\r\n        Timer t = new Timer() {\r\n            @Override\r\n            public void run() {\r\n                Logger.getLogger(this.getClass().getName()).info(\"Fire Editor UI loaded event...\");\r\n                // signal that the editor view has loaded.\r\n                metadataEditorEventBus.fireXdsEditorLoadedEvent();\r\n            }\r\n        };\r\n\r\n        // Schedule the timer to run once in 1 milliseconds.\r\n        t.schedule(1);\r\n    }\r\n\r\n    /**\r\n     * Build the editor layout with borderlayoutcontainer for the Submission Set.\r\n     * Made of a main panel for the editor itself and a collapsible and splittable validation panel underneath.\r\n     *\r\n     * @return widget editor container\r\n     */\r\n    private Widget getContainer() {\r\n        sc = new SimpleContainer();\r\n        blc = new BorderLayoutContainer();\r\n\r\n        ContentPanel validationView = new ContentPanel();\r\n        validationView.setHeadingText(\"Validation\");\r\n\r\n        ContentPanel center = new ContentPanel();\r\n        center.setHeaderVisible(false);\r\n        center.add(editorMVP.getDisplay());\r\n\r\n        blc.setCenterWidget(center);\r\n\r\n        BorderLayoutContainer.BorderLayoutData southData = new BorderLayoutContainer.BorderLayoutData(250);\r\n        southData.setCollapsible(true);\r\n        southData.setSplit(true);\r\n        southData.setCollapsed(true);\r\n\r\n        blc.setSouthWidget(validationView, southData);\r\n\r\n        blc.collapse(Style.LayoutRegion.SOUTH);\r\n\r\n        sc.add(blc);\r\n\r\n        return sc.asWidget();\r\n    }\r\n\r\n    /**\r\n     * Method that builds the Submission Set Editor (view and presenter for a specific model => Submission Set).\r\n     * @return Submission Set Editor MVP.\r\n     */\r\n    private GenericMVP<XdsSubmissionSet, SubmissionSetEditorView, SubmissionSetEditorPresenter> buildEditorMVP() {\r\n        return new GenericMVP<XdsSubmissionSet,SubmissionSetEditorView,SubmissionSetEditorPresenter>(editorView,editorPresenter);\r\n    }\r\n}\r\n'),(4495,5605,'package gov.nist.hit.ds.docentryeditor.client.editor.submissionSetEditor;\r\n\r\nimport gov.nist.hit.ds.docentryeditor.client.generics.abstracts.AbstractMVP;\r\nimport gov.nist.hit.ds.docentryeditor.shared.model.XdsSubmissionSet;\r\n\r\n/**\r\n * Class that represents and build the Model View Presenter objects for the Submission set editor view.\r\n * Created by onh2 on 3/2/2015.\r\n */\r\npublic class SubmissionSetEditorMVP extends AbstractMVP<XdsSubmissionSet,SubmissionSetEditorView,SubmissionSetEditorPresenter> {\r\n\r\n    @Override\r\n    public SubmissionSetEditorView buildView() {\r\n        return getView();\r\n    }\r\n\r\n    @Override\r\n    public SubmissionSetEditorPresenter buildPresenter() {\r\n        return getPresenter();\r\n    }\r\n}\r\n'),(4496,5606,'package gov.nist.hit.ds.docentryeditor.client.editor.submissionSetEditor;\r\n\r\nimport com.google.gwt.place.shared.Place;\r\nimport com.google.gwt.place.shared.PlaceTokenizer;\r\n\r\n/**\r\n * Place for the Submission Set editor.\r\n * This enables the browser navigation (w/ URLs) through the application thanks to the Activity-place design.\r\n * Created by onh2 on 3/2/2015.\r\n */\r\npublic class SubmissionSetEditorPlace extends Place {\r\n    private String placeName;\r\n\r\n    public SubmissionSetEditorPlace(String token){this.placeName=token;}\r\n\r\n    public SubmissionSetEditorPlace(){super();}\r\n\r\n    public String getPlaceName(){return this.placeName;}\r\n\r\n    public static class Tokenizer implements PlaceTokenizer<SubmissionSetEditorPlace> {\r\n\r\n        @Override\r\n        public SubmissionSetEditorPlace getPlace(String token) {\r\n            return new SubmissionSetEditorPlace(token);\r\n        }\r\n\r\n        @Override\r\n        public String getToken(SubmissionSetEditorPlace place) {\r\n            return place.getPlaceName();\r\n        }\r\n    }\r\n}\r\n'),(4497,5607,'package gov.nist.hit.ds.docentryeditor.client.editor.submissionSetEditor;\r\n\r\nimport com.google.gwt.core.client.GWT;\r\nimport com.google.gwt.editor.client.SimpleBeanEditorDriver;\r\nimport com.google.gwt.place.shared.PlaceChangeEvent;\r\nimport com.sencha.gxt.widget.core.client.Dialog;\r\nimport com.sencha.gxt.widget.core.client.box.ConfirmMessageBox;\r\nimport com.sencha.gxt.widget.core.client.event.DialogHideEvent;\r\nimport gov.nist.hit.ds.docentryeditor.client.event.MetadataEditorEventBus;\r\nimport gov.nist.hit.ds.docentryeditor.client.event.StartEditXdsSubmissionSetEvent;\r\nimport gov.nist.hit.ds.docentryeditor.client.generics.abstracts.AbstractPresenter;\r\nimport gov.nist.hit.ds.docentryeditor.shared.model.XdsSubmissionSet;\r\n\r\n/**\r\n * This class is the presenter that handles all the actions and events related to the Submission Set Editor view.\r\n * Created by onh2 on 3/2/2015.\r\n */\r\npublic class SubmissionSetEditorPresenter extends AbstractPresenter<SubmissionSetEditorView> {\r\n    protected XdsSubmissionSet model=new XdsSubmissionSet();\r\n    private SubmissionSetEditorDriver editorDriver = GWT.create(SubmissionSetEditorDriver.class);\r\n\r\n    /**\r\n     * Method that initializes the editor and the request factory on submission set activity start.\r\n     */\r\n    @Override\r\n    public void init() {\r\n        bind();\r\n        initDriver(model);\r\n        // requestFactory.initialize(eventBus);\r\n    }\r\n\r\n    /**\r\n     * Method that initializes the editor with a document entry object.\r\n     * @param model\r\n     */\r\n    private void initDriver(XdsSubmissionSet model) {\r\n        this.model=model;\r\n        editorDriver.initialize(view);\r\n        getView().authors.getAuthorWidget().initEditorDriver();\r\n        logger.info(\"Init driver with: \"+model.toString());\r\n        editorDriver.edit(model);\r\n        getView().refreshGridButtonsDisplay();\r\n    }\r\n\r\n    /**\r\n     * Method that ties actions and view together. It mostly handles gwt event form the event bus.\r\n     */\r\n    private void bind() {\r\n        // this event provides the presenter a submission set to edit and triggers its display in the submission set editor view.\r\n        ((MetadataEditorEventBus) getEventBus()).addStartEditXdsSubmissionSetHandler(new StartEditXdsSubmissionSetEvent.StartEditXdsSubmissionSetHandler(){\r\n\r\n            @Override\r\n            public void onStartEdit(StartEditXdsSubmissionSetEvent event) {\r\n                logger.info(\"... receive Start Edit Event\");\r\n                model = event.getSumissionSet();\r\n                initDriver(model);\r\n                getView().authors.editNewAuthor();\r\n            }\r\n        });\r\n        // this event tells the presenter the application Place is about to change.\r\n        getEventBus().addHandler(PlaceChangeEvent.TYPE, new PlaceChangeEvent.Handler() {\r\n            @Override\r\n            public void onPlaceChange(PlaceChangeEvent placeChangeEvent) {\r\n                // auto save on Place change.\r\n                logger.info(\"Submission set metadata auto save on Place change.\");\r\n                final XdsSubmissionSet tmp = editorDriver.flush();\r\n                model=tmp;\r\n            }\r\n        });\r\n    }\r\n\r\n    /**\r\n     * Method to save modified metadata (submission set) with editor\'s validation check.\r\n     */\r\n    public void doSave() {\r\n        if (editorDriver.isDirty()) {\r\n            model = editorDriver.flush();\r\n            logger.info(\"Saving submission set modifications...\");\r\n            if (editorDriver.hasErrors()) {\r\n                final ConfirmMessageBox cmb = new ConfirmMessageBox(\"Error\", \"There are errors in your editor. Are you sure you want to download a copy of these data? They may not be usable.\");\r\n                cmb.show();\r\n                cmb.addDialogHideHandler(new DialogHideEvent.DialogHideHandler() {\r\n                    public void onDialogHide(DialogHideEvent event) {\r\n                        if (event.getHideButton() == Dialog.PredefinedButton.YES) {\r\n                            // perform YES action\r\n                            save();\r\n                            cmb.hide();\r\n                        } else if (event.getHideButton() == Dialog.PredefinedButton.NO) {\r\n                            // perform NO action\r\n                        }\r\n                    }\r\n                });\r\n            } else {\r\n                save();\r\n            }\r\n        } else {\r\n            final ConfirmMessageBox cmb = new ConfirmMessageBox(\"\", \"Data has not changed. Are you sure you want to download a copy of this metadata entry?\");\r\n            cmb.show();\r\n            cmb.addDialogHideHandler(new DialogHideEvent.DialogHideHandler() {\r\n                public void onDialogHide(DialogHideEvent event) {\r\n                    if (event.getHideButton() == Dialog.PredefinedButton.YES) {\r\n                        // perform YES action\r\n                        save();\r\n                        cmb.hide();\r\n                    } else if (event.getHideButton() == Dialog.PredefinedButton.NO) {\r\n                        // perform NO action\r\n                    }\r\n                }\r\n            });\r\n        }\r\n    }\r\n    /**\r\n     * Method which actually handle saving (on server) and download for the edited metadata file.\r\n     */\r\n    private void save() {\r\n        ((MetadataEditorEventBus) eventBus).fireSaveFileEvent();\r\n    }\r\n\r\n    /**\r\n     * Method that cancels the last unsaved changes made to the submission set currently in edition.\r\n     */\r\n    public void rollbackChanges() {\r\n        logger.info(\"Cancel last unsaved submission set changes...\");\r\n        initDriver(model);\r\n        getView().authors.editNewAuthor();\r\n    }\r\n\r\n    /**\r\n     * Getter that returns the XDS Submission Set object in edition.\r\n     * @return Xds Submission Set object being edited.\r\n     */\r\n    public XdsSubmissionSet getModel(){\r\n        return model;\r\n    }\r\n\r\n    /**\r\n     * This method populate the submission set editor form with test data.\r\n     */\r\n    public void populate() {\r\n        model.populate();\r\n        initDriver(model);\r\n        getView().authors.editNewAuthor();\r\n    }\r\n\r\n    /**\r\n     * Interface of a XDS Submission Set Editor Driver\r\n     */\r\n    interface SubmissionSetEditorDriver extends SimpleBeanEditorDriver<XdsSubmissionSet, SubmissionSetEditorView> {\r\n\r\n    }\r\n}\r\n'),(4498,5608,'package gov.nist.hit.ds.docentryeditor.client.editor.submissionSetEditor;\r\n\r\nimport com.google.gwt.editor.client.Editor;\r\nimport com.google.gwt.event.logical.shared.ResizeEvent;\r\nimport com.google.gwt.event.logical.shared.ResizeHandler;\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;\r\nimport com.sencha.gxt.core.client.util.Margins;\r\nimport com.sencha.gxt.data.client.editor.ListStoreEditor;\r\nimport com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer;\r\nimport com.sencha.gxt.widget.core.client.container.SimpleContainer;\r\nimport com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;\r\nimport com.sencha.gxt.widget.core.client.event.SelectEvent;\r\nimport com.sencha.gxt.widget.core.client.form.FieldSet;\r\nimport com.sencha.gxt.widget.core.client.form.validator.RegExValidator;\r\nimport com.sencha.gxt.widget.core.client.tips.ToolTipConfig;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.widgets.AuthorWidgets.AuthorsListEditorWidget;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.widgets.CodedTermWidgets.PredefinedCodedTermComboBox;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.widgets.EditorFieldLabel;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.widgets.IdentifierWidgets.IdentifierOIDEditorWidget;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.widgets.IdentifierWidgets.IdentifierString256EditorWidget;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.widgets.InternationalStringWidgets.InternationalStringEditableGrid;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.widgets.NameValueWidgets.NameValueDTMEditorWidget;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.widgets.NameValueWidgets.NameValueString256EditorWidget;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.widgets.String256EditorWidget;\r\nimport gov.nist.hit.ds.docentryeditor.client.editor.widgets.UuidFormatClientValidator;\r\nimport gov.nist.hit.ds.docentryeditor.client.generics.abstracts.AbstractView;\r\nimport gov.nist.hit.ds.docentryeditor.client.parser.PredefinedCodes;\r\nimport gov.nist.hit.ds.docentryeditor.client.resources.AppImages;\r\nimport gov.nist.hit.ds.docentryeditor.client.resources.ToolTipResources;\r\nimport gov.nist.hit.ds.docentryeditor.client.widgets.EditorToolbar;\r\nimport gov.nist.hit.ds.docentryeditor.client.widgets.ToolbarIconButton;\r\nimport gov.nist.hit.ds.docentryeditor.shared.model.InternationalString;\r\nimport gov.nist.hit.ds.docentryeditor.shared.model.XdsSubmissionSet;\r\n\r\nimport javax.inject.Inject;\r\nimport java.util.HashMap;\r\nimport java.util.Map;\r\n\r\n/**\r\n * This class represents the view of the Submission Set editor.\r\n * It only handles the different widgets used to build the final\r\n * complete view of the editor.\r\n * It work with a presenter to handle the XdsSubmissionSet model.\r\n *\r\n * @see gov.nist.hit.ds.docentryeditor.shared.model.XdsSubmissionSet\r\n * @see gov.nist.hit.ds.docentryeditor.client.editor.submissionSetEditor.SubmissionSetEditorPresenter\r\n * Created by onh2 on 3/2/2015.\r\n */\r\npublic class SubmissionSetEditorView extends AbstractView<SubmissionSetEditorPresenter> implements Editor<XdsSubmissionSet>{\r\n    private final VerticalLayoutContainer mainContainer = new VerticalLayoutContainer();\r\n\r\n    private VerticalLayoutContainer requiredFields = new VerticalLayoutContainer();\r\n    private VerticalLayoutContainer optionalFields = new VerticalLayoutContainer();\r\n\r\n    // Required R in XDS (DS and DR) and in XDS DS.\r\n    @Inject\r\n    String256EditorWidget entryUUID;\r\n    @Inject\r\n    IdentifierOIDEditorWidget uniqueId;\r\n    @Inject\r\n    IdentifierOIDEditorWidget sourceId;\r\n    NameValueDTMEditorWidget submissionTime=new NameValueDTMEditorWidget(\"Submission Time\",false,1);\r\n    @Inject\r\n    IdentifierString256EditorWidget patientId;\r\n    PredefinedCodedTermComboBox contentTypeCode=new PredefinedCodedTermComboBox(PredefinedCodes.CONTENT_TYPE_CODE);\r\n    // Required if known R2 in XDS (DS and DR) and in XDS DS.\r\n    @Inject\r\n    AuthorsListEditorWidget authors;\r\n    // Optional O in XDS (DS and DR) and in XDS DS.\r\n    NameValueString256EditorWidget intendedRecipient=new NameValueString256EditorWidget(\"Intended Recipients\");\r\n    // ---- Titles Widgets\r\n    ListStoreEditor<InternationalString> title;\r\n    private InternationalStringEditableGrid titleGrid;\r\n    // ---- Comments Widgets\r\n    ListStoreEditor<InternationalString> comments;\r\n    private InternationalStringEditableGrid commentsGrid;\r\n    @Inject\r\n    String256EditorWidget availabilityStatus;\r\n    @Inject\r\n    String256EditorWidget homeCommunityId; // maybe OIDEditorWidget\r\n\r\n    // -- Button toolbars\r\n    @Inject\r\n    private EditorToolbar editorTopToolbar;\r\n    @Inject\r\n    private EditorToolbar editorBottomToolbar;\r\n    private ToolbarIconButton populateTopButton;\r\n    private ToolbarIconButton populateBottomButton;\r\n\r\n    /**\r\n     * This is the abstract method implementation that builds a collection of objects\r\n     * mapping a String key to a Widget for the Submission Set editor view.\r\n     * @return Map of widgets for the Submission Set editor view.\r\n     */\r\n    @Override\r\n    protected Map<String, Widget> getPathToWidgetsMap() {\r\n        Map<String,Widget> map=new HashMap<String,Widget>();\r\n        map.put(\"entryUUID\",entryUUID);\r\n        map.put(\"uniqueId\",uniqueId);\r\n        map.put(\"sourceId\",sourceId);\r\n        map.put(\"submissionTime\",submissionTime);\r\n        map.put(\"patientId\",patientId);\r\n        map.put(\"contentTypeCode\",contentTypeCode);\r\n        map.put(\"authors\",authors.asWidget());\r\n        map.put(\"intendedRecipient\",intendedRecipient);\r\n        map.put(\"title\",titleGrid);\r\n        map.put(\"comments\",commentsGrid);\r\n        map.put(\"availabilityStatus\",availabilityStatus);\r\n        map.put(\"homeCommunityId\",homeCommunityId);\r\n        return map;\r\n    }\r\n\r\n    /**\r\n     * This is the implementation of the abstract method supposed to construct\r\n     * the Submission Set editor view as a widget.\r\n     * @return Submission Set editor view as a Widget.\r\n     */\r\n    @Override\r\n    protected Widget buildUI() {\r\n        VerticalLayoutContainer container=new VerticalLayoutContainer();\r\n        container.getElement().setMargins(10);\r\n        container.setBorders(false);\r\n\r\n        SimpleContainer requiredFieldsContainer = new SimpleContainer();\r\n        requiredFieldsContainer.setTitle(\"Required fields\");\r\n        SimpleContainer optionalFieldsContainer = new SimpleContainer();\r\n        optionalFieldsContainer.setTitle(\"Optional fields\");\r\n\r\n        requiredFieldsContainer.add(requiredFields);\r\n        optionalFieldsContainer.add(optionalFields);\r\n\r\n        populateTopButton=new ToolbarIconButton(\"Populate\",AppImages.INSTANCE.pen(),85);\r\n        populateTopButton.setToolTip(\"Populate the submission set editor form with test data.\");\r\n        editorTopToolbar.addButton(populateTopButton);\r\n\r\n        // Adding required and optional fields panels to the main container of editor view.\r\n        container.add(editorTopToolbar, new VerticalLayoutContainer.VerticalLayoutData(-1,30));\r\n        container.add(new HtmlLayoutContainer(\"<h2>Submission Set Editor</h2>\"));\r\n        container.add(new HtmlLayoutContainer(\"<h3>Required fields</h3>\"));\r\n        container.add(requiredFieldsContainer, new VerticalLayoutContainer.VerticalLayoutData(1, -1, new Margins(0, 0, 10, 0)));\r\n        container.add(new HtmlLayoutContainer(\"<h3>Optional fields</h3>\"));\r\n        container.add(optionalFieldsContainer, new VerticalLayoutContainer.VerticalLayoutData(1, -1, new Margins(0, 0, 10, 0)));\r\n\r\n        // /////////////////////////////////////// //\r\n        // - Required \"simple\" fields.\r\n        EditorFieldLabel entryUUIDLabel = new EditorFieldLabel(entryUUID,\"Entry UUID\");\r\n        EditorFieldLabel uniqueIdLabel = new EditorFieldLabel(uniqueId,\"Unique ID\");\r\n        EditorFieldLabel sourceIdlabel = new EditorFieldLabel(sourceId,\"Source ID\");\r\n        EditorFieldLabel patientIdLabel = new EditorFieldLabel(patientId,\"Patient ID\");\r\n        EditorFieldLabel contentTypeCodeLabel = new EditorFieldLabel(contentTypeCode.getDisplay(),\"Content type code\");\r\n\r\n        // - Optional \"simple\" fields.\r\n        EditorFieldLabel availabilityStatusLabel = new EditorFieldLabel(availabilityStatus,\"Availability status\");\r\n        EditorFieldLabel homeCommunityIdLabel = new EditorFieldLabel(homeCommunityId,\"Home community ID\");\r\n\r\n        // - Optional widget fields.\r\n        titleGrid = new InternationalStringEditableGrid(\"Titles\");\r\n        title = new ListStoreEditor<InternationalString>(titleGrid.getStore());\r\n        commentsGrid = new InternationalStringEditableGrid(\"Comments\");\r\n        comments = new ListStoreEditor<InternationalString>(commentsGrid.getStore());\r\n\r\n        // - simple required fields container.\r\n        VerticalLayoutContainer simpleRequiredFieldsContainer = new VerticalLayoutContainer();\r\n        simpleRequiredFieldsContainer.add(entryUUIDLabel, new VerticalLayoutContainer.VerticalLayoutData(1, -1));\r\n        simpleRequiredFieldsContainer.add(uniqueIdLabel, new VerticalLayoutContainer.VerticalLayoutData(1, -1));\r\n        simpleRequiredFieldsContainer.add(sourceIdlabel, new VerticalLayoutContainer.VerticalLayoutData(1, -1));\r\n        simpleRequiredFieldsContainer.add(patientIdLabel, new VerticalLayoutContainer.VerticalLayoutData(1, -1));\r\n        simpleRequiredFieldsContainer.add(contentTypeCodeLabel, new VerticalLayoutContainer.VerticalLayoutData(1, -1));\r\n\r\n        // - simple optional fields container.\r\n        VerticalLayoutContainer simpleOptionalFieldsContainer = new VerticalLayoutContainer();\r\n        simpleOptionalFieldsContainer.add(availabilityStatusLabel, new VerticalLayoutContainer.VerticalLayoutData(1,-1));\r\n        simpleOptionalFieldsContainer.add(homeCommunityIdLabel, new VerticalLayoutContainer.VerticalLayoutData(1,-1));\r\n\r\n        // - Required field set.\r\n        FieldSet simpleRequiredFieldSet = new FieldSet();\r\n        simpleRequiredFieldSet.setHeadingText(\"General\");\r\n        simpleRequiredFieldSet.setCollapsible(true);\r\n        simpleRequiredFieldSet.add(simpleRequiredFieldsContainer);\r\n\r\n        // - Optional field sets.\r\n        FieldSet simpleOptionalFieldSet = new FieldSet();\r\n        simpleOptionalFieldSet.setHeadingText(\"General\");\r\n        simpleOptionalFieldSet.setCollapsible(true);\r\n        simpleOptionalFieldSet.add(simpleOptionalFieldsContainer);\r\n\r\n        FieldSet authorsFieldSet = new FieldSet();\r\n        authorsFieldSet.setHeadingText(\"Authors\");\r\n        authorsFieldSet.setCollapsible(true);\r\n        authorsFieldSet.add(authors.asWidget());\r\n\r\n        // Add every required fields to the required fields panel.\r\n        requiredFields.add(simpleRequiredFieldSet,new VerticalLayoutContainer.VerticalLayoutData(1,-1, new Margins(0, 0, 10, 0)));\r\n        requiredFields.add(submissionTime.getDisplay(),new VerticalLayoutContainer.VerticalLayoutData(1,-1, new Margins(0, 0, 10, 0)));\r\n        // Add every optional fields to the optional fields panel.\r\n        optionalFields.add(simpleOptionalFieldSet,new VerticalLayoutContainer.VerticalLayoutData(1,-1,new Margins(0,0,10,0)));\r\n        optionalFields.add(authorsFieldSet,new VerticalLayoutContainer.VerticalLayoutData(1,-1,new Margins(0,0,10,0)));\r\n        optionalFields.add(intendedRecipient.getDisplay(),new VerticalLayoutContainer.VerticalLayoutData(1,-1,new Margins(0,0,10,0)));\r\n        optionalFields.add(titleGrid.getDisplay(),new VerticalLayoutContainer.VerticalLayoutData(1,-1,new Margins(0,0,10,0)));\r\n        optionalFields.add(commentsGrid.getDisplay(),new VerticalLayoutContainer.VerticalLayoutData(1,-1,new Margins(0,0,10,0)));\r\n\r\n        // configure help information and client validations for the entire editor.\r\n        setWidgetsInfo();\r\n\r\n        // Bottom toolbar container.\r\n        populateBottomButton=new ToolbarIconButton(\"Populate\",AppImages.INSTANCE.pen(),85);\r\n        populateBottomButton.setToolTip(\"Populate the submission set editor form with test data.\");\r\n        editorBottomToolbar.addButton(populateBottomButton);\r\n        SimpleContainer bottomToolbarContainer = new SimpleContainer();\r\n        bottomToolbarContainer.setHeight(35);\r\n        bottomToolbarContainer.add(editorBottomToolbar);\r\n        optionalFields.add(bottomToolbarContainer);\r\n\r\n        mainContainer.setScrollMode(ScrollMode.AUTO);\r\n        mainContainer.add(container);\r\n        mainContainer.forceLayout();\r\n\r\n        return mainContainer;\r\n    }\r\n\r\n    /**\r\n     * Implementation of the abstract method that binds together\r\n     * widgets actions (such as a button click) with presenter actions.\r\n     */\r\n    @Override\r\n    protected void bindUI() {\r\n        mainContainer.addResizeHandler(new ResizeHandler() {\r\n            @Override\r\n            public void onResize(ResizeEvent event) {\r\n                mainContainer.forceLayout();\r\n            }\r\n        });\r\n        SelectEvent.SelectHandler saveHandler = new SelectEvent.SelectHandler() {\r\n            @Override\r\n            public void onSelect(SelectEvent selectEvent) {\r\n                presenter.doSave();\r\n            }\r\n        };\r\n        editorTopToolbar.addSaveHandler(saveHandler);\r\n        editorBottomToolbar.addSaveHandler(saveHandler);\r\n        SelectEvent.SelectHandler cancelHandler = new SelectEvent.SelectHandler() {\r\n            @Override\r\n            public void onSelect(SelectEvent selectEvent) {\r\n                presenter.rollbackChanges();\r\n            }\r\n        };\r\n        editorTopToolbar.addCancelHandler(cancelHandler);\r\n        editorBottomToolbar.addCancelHandler(cancelHandler);\r\n        SelectEvent.SelectHandler populateHandler = new SelectEvent.SelectHandler() {\r\n            @Override\r\n            public void onSelect(SelectEvent selectEvent) {\r\n                presenter.populate();\r\n            }\r\n        };\r\n        populateBottomButton.addSelectHandler(populateHandler);\r\n        populateTopButton.addSelectHandler(populateHandler);\r\n    }\r\n\r\n    public void refreshGridButtonsDisplay() {\r\n        submissionTime.refreshNewButton();\r\n        if (commentsGrid!=null) {\r\n            commentsGrid.refreshNewButton();\r\n        }\r\n        if (intendedRecipient != null) {\r\n            intendedRecipient.refreshNewButton();\r\n        }\r\n        if (titleGrid != null){\r\n            titleGrid.refreshNewButton();\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Configures information about each widgets to guide the user as well as\r\n     * client side validations (Tooltips, empty texts and client validators).\r\n     */\r\n    private void setWidgetsInfo() {\r\n        // availability status\r\n        availabilityStatus.setAllowBlank(true);\r\n        availabilityStatus.setEmptyText(\"ex: urn:oasis:names:tc:ebxml-regrep:StatusType:Approved\");\r\n        availabilityStatus.setToolTipConfig(new ToolTipConfig(\"It represents the status of the SubmissionSet. Since the deprecation of SubmissionSets is not\\n\" +\r\n                \"allowed, this value shall always be Approved.\\n\\nThe availabilityStatus value shall be \\\"urn:oasis:names:tc:ebxml-regrep:StatusType:Approved\\\"\"));\r\n        // comments\r\n        commentsGrid.setToolbarHelpButtonTooltip(new ToolTipConfig(\"Help on comments\",\"It contains comments associated with the SubmissionSet (Max length is unbounded).\"));\r\n        // content type code\r\n        contentTypeCode.setEmptyText(\"Select a content type...\");\r\n        contentTypeCode.clear();\r\n        contentTypeCode.setAllowBlank(false);\r\n        // entry uuid\r\n        entryUUID.setToolTipConfig(new ToolTipConfig(\"ID is a string\", ToolTipResources.INSTANCE.getString256ToolTip()));\r\n        entryUUID.setAllowBlank(false);\r\n        entryUUID.addValidator(new UuidFormatClientValidator());\r\n        // home community id\r\n        homeCommunityId.setAllowBlank(true);\r\n        homeCommunityId.setEmptyText(\"ex: urn:oid:1.2.3\");\r\n        homeCommunityId.addValidator(new RegExValidator(\"^urn:oid:[1-9][0-9]*(\\\\.[1-9][0-9]*)+(\\\\^[1-9][0-9]+)?$\", \"Value\'s format is not a correct. It is supposed to be a suite of figures separated by periods preceded by \\\"urn:oid:\\\".\"));\r\n        homeCommunityId.setToolTipConfig(new ToolTipConfig(\"It is an OID URN.\",\"It is a globally unique identifier for a community. It should be  an OID URN (ex: \\\"urn:oid:1.2.3\\\").\"));\r\n        // intended recipents\r\n        // TODO Add regex validator\r\n        intendedRecipient.setToolbarHelpButtonTooltip(new ToolTipConfig(\"Help of intended recipients\",\"It represents the organization(s) or person(s) for whom the SubmissionSet is intended at time of\\n\" +\r\n                \"submission. Each slot value shall include at least one of the organization, person, or\\n\" +\r\n                \"telecommunications address fields described below. It is highly recommended to define the\\n\" +\r\n                \"organization for all the persons, avoiding errors in the transmission of the documents. \" +\r\n                \"Values shall be formatted as <b>XON|XCN|XTN</b>.\"));\r\n        intendedRecipient.setEmptyTexts(\"ex: \\\"Some Hospital^^^^^^^^^1.2.3.9.1789.45|^Wel^Marcus^^^Dr^MD|^^Internet^mwel@healthcare.example.org\\\"\");\r\n        intendedRecipient.setEditingFieldToolTip(\"The value shall be a <b>XON|XCN|XTN</b>\\n\" +\r\n                \"                where: <ul><li><b>XON</b> identifies the organization,</li> <li><b>XCN</b> identifies a person</li> <li><b>XTN</b> identifies the\" +\r\n                \"                telecommunications.</li></ul>\" +\r\n                \"                There is a \\\"<b>|</b>\\\" character separator between the organization and the person, and between the person and\" +\r\n                \"                the telecommunications address, which is required when the person or the telecommunications\" +\r\n                \"                address information is present.\");\r\n        // patient id\r\n        patientId.setEmptyTexts(\"ex: 76cc^^1.3.6367.2005.3.7&ISO\", \"ex: urn:uuid:6b5aea1a-625s-5631-v4se-96a0a7b38446\");\r\n        patientId.setToolTipConfigs(new ToolTipConfig(\"Patient ID is a String256 in HL7 CX format\", \"The required format is:\" +\r\n                \"IDNumber^^^&OIDofAssigningAuthority&ISO\"), new ToolTipConfig(\r\n                \"idType is a string256 in HL7 CX format\", \"The required format is: \" +\r\n                \"IDNumber^^^&OIDofAssigningAuthority&ISO\"));\r\n        patientId.setAllowBlanks(false, false);\r\n        patientId.addValueFieldValidator(new RegExValidator(\"^(([A-Za-z])|([1-9]))*[0-9A-z]+\\\\^{3}&[1-9][0-9]*(\\\\.[1-9][0-9]*)+(&ISO)$\", \"Value\'s format is not a correct. \\nIt should be like this: 6578946^^^&1.3.6.1.4.1.21367.2005.3.7&ISO.\"));\r\n        // source id\r\n        sourceId.setAllowBlanks(false,false);\r\n        sourceId.addValueFieldValidator(new RegExValidator(\"^[1-9][0-9]*(\\\\.[1-9][0-9]*)+(\\\\^[1-9][0-9]+)?$\", \"Value\'s format is not a correct. It is supposed to be a suite of figures separated by periods.\"));\r\n        sourceId.setEmptyTexts(\"ex: 1.3.6.1.4.1.21367.2005.3.7\", \"ex: 1.3.6.1.4.1.21367.2005.3.7\");\r\n        sourceId.setToolTipConfigs(new ToolTipConfig(\"Source ID is an OID\", \"Source ID is the globally unique, immutable, identifier of the entity that contributed the SubmissionSet. It is an OID, as defined in the HL7 implementation for OID (http://www.hl7.org/implement/standards/product_brief.cfm?product_id=210)<br/>Unique ID format is \\\"[1-9](\\\\.[0-9]+)*]\\\"\"),\r\n                new ToolTipConfig(\r\n                        \"idType is an OID\",\r\n                        \"As defined in the HL7 implementation for OID (http://www.hl7.org/implement/standards/product_brief.cfm?product_id=210)<br/>Unique ID format is \\\"[1-9](\\\\.[0-9]+)*]\\\"\"));\r\n        // submission time\r\n        submissionTime.setToolbarHelpButtonTooltip(new ToolTipConfig(\"Help on Submission time\", \"Represents the point in time at the creating entity when the Submission Set was submitted.\\n\" +\r\n                \"This shall be provided by the submitting system.\"));\r\n        // title\r\n        titleGrid.setToolbarHelpButtonTooltip(new ToolTipConfig(\"Help on Titles\", \"Represents the title of the Submission Set. The format of a title shall be any string of length less than 256 characters.\\n\"));\r\n        // Unique ID\r\n        uniqueId.setAllowBlanks(false, false);\r\n        uniqueId.addValueFieldValidator(new RegExValidator(\"^[1-9][0-9]*(\\\\.[1-9][0-9]*)+(\\\\^[1-9][0-9]+)?$\", \"Value\'s format is not a correct. It is supposed to be a suite of figures separated by periods.\"));\r\n        uniqueId.setEmptyTexts(\"ex: 2008.8.1.35447^5846\", \"ex: 2008.8.1.35447\");\r\n        uniqueId.setToolTipConfigs(\r\n                new ToolTipConfig(\"Unique ID is an OID\", \"As defined in the HL7 implementation for OID (http://www.hl7.org/implement/standards/product_brief.cfm?product_id=210)<br/>Unique ID format is \\\"[1-9](\\\\.[0-9]+)*]\\\"\"),\r\n                new ToolTipConfig(\r\n                        \"idType is an OID\",\r\n                        \"As defined in the HL7 implementation for OID (http://www.hl7.org/implement/standards/product_brief.cfm?product_id=210)<br/>Unique ID format is \\\"[1-9](\\\\.[0-9]+)*]\\\"\"));\r\n    }\r\n}\r\n'),(4499,5610,'package gov.nist.hit.ds.docentryeditor.client.editor.validation;\r\n\r\nimport gov.nist.hit.ds.docentryeditor.client.generics.abstracts.AbstractMVP;\r\nimport gov.nist.hit.ds.docentryeditor.shared.model.XdsDocumentEntry;\r\n\r\n/**\r\n * Class handling the GWT Model view presenter design for Validation results.\r\n */\r\npublic class ValidationMVP extends AbstractMVP<XdsDocumentEntry, ValidationView, ValidationPresenter> {\r\n\r\n    @Override\r\n    public ValidationView buildView() {\r\n        // TODO instantiate validation view\r\n        return null;\r\n    }\r\n\r\n    @Override\r\n    public ValidationPresenter buildPresenter() {\r\n        // TODO instantiate validation presenter\r\n        return null;\r\n    }\r\n\r\n}\r\n'),(4500,5611,'package gov.nist.hit.ds.docentryeditor.client.editor.validation;\r\n\r\nimport gov.nist.hit.ds.docentryeditor.client.generics.abstracts.AbstractPresenter;\r\n\r\npublic class ValidationPresenter extends AbstractPresenter<ValidationView> {\r\n\r\n    /**\r\n     * Method that initializes the Presenter\r\n     * for the Validation result panel.\r\n     */\r\n    @Override\r\n    public void init() {\r\n\r\n    }\r\n}\r\n'),(4501,5612,'package gov.nist.hit.ds.docentryeditor.client.editor.validation;\r\n\r\nimport com.google.gwt.user.client.ui.Widget;\r\nimport gov.nist.hit.ds.docentryeditor.client.generics.abstracts.AbstractView;\r\n\r\nimport java.util.HashMap;\r\nimport java.util.Map;\r\n\r\n/**\r\n * Class that represents the view for Validation result panel.\r\n */\r\npublic class ValidationView extends AbstractView<ValidationPresenter> {\r\n\r\n    /**\r\n     * Implementation of the abstract getter that returns a map of\r\n     * paths to widgets from IDs.\r\n     * @return\r\n     */\r\n    @Override\r\n    protected Map<String, Widget> getPathToWidgetsMap() {\r\n        return new HashMap<String, Widget>();\r\n    }\r\n\r\n    /**\r\n     * Implementation of the abstract method that builds\r\n     * the UI widget for the Validation result panel.\r\n     * @return Validation result panel widget\r\n     */\r\n    @Override\r\n    protected Widget buildUI() {\r\n        // TODO implement validation view\r\n        return null;\r\n    }\r\n\r\n    /**\r\n     * Implementation of the abstract method that binds the UI\r\n     * widgets of the Validation result panel with their actions.\r\n     */\r\n    @Override\r\n    protected void bindUI() {\r\n        // TODO bind validation view actions\r\n\r\n    }\r\n\r\n}\r\n'),