public class CableRequestManager extends Object implements Serializable
| Constructor and Description |
|---|
CableRequestManager()
Constructs the controller bean and handles one time setup.
|
| Modifier and Type | Method and Description |
|---|---|
List<CableStatus> |
allCableStatuses()
Lists cable statuses when reusing a cable on UI
|
void |
cableFileUpload(org.primefaces.event.FileUploadEvent event)
Uploads and stores the file.
|
void |
cableImport()
Performs the cable import from the file that was last uploaded.
|
void |
cableImportTest()
Performs a test of the cable import from the file that was last uploaded.
|
boolean |
canChangeStatus()
In order to determine if user can change status for selected cable
|
boolean |
canImportCables() |
void |
checkCablesForDeletion()
The method builds a list of cables that are already deleted.
|
void |
clearFillFromEnclosureEssName()
Clear and (possibly) fill From Enclosure ESS Name with value corresponding to From Enclosure FBS Tag,
for selected cable.
|
void |
clearFillFromEnclosureFbsTag()
Clear and (possibly) fill From Enclosure FBS Tag with value corresponding to From Enclosure ESS Name,
for selected cable.
|
void |
clearFillFromEssName()
Clear and (possibly) fill From ESS Name with value corresponding to From FBS Tag, for selected cable.
|
void |
clearFillFromFbsTag()
Clear and (possibly) fill From FBS Tag with value corresponding to From ESS Name, for selected cable.
|
void |
clearFillToEnclosureEssName()
Clear and (possibly) fill To Enclosure ESS Name with value corresponding to To Enclosure FBS Tag,
for selected cable.
|
void |
clearFillToEnclosureFbsTag()
Clear and (possibly) fill To Enclosure FBS Tag with value corresponding to To Enclosure ESS Name,
for selected cable.
|
void |
clearFillToEssName()
Clear and (possibly) fill To ESS Name with value corresponding to To FBS Tag, for selected cable.
|
void |
clearFillToFbsTag()
Clear and (possibly) fill To FBS Tag with value corresponding to To ESS Name, for selected cable.
|
void |
clearImportState()
Clears the import state.
|
void |
clearSelectedCables()
Clears the current cable selection.
|
void |
clearSelection()
Clears the newly created selected cable so editing is disabled
|
List<String> |
completeCableArticle(String query)
Autocomplete method for cable articles.
|
List<String> |
completeCableNames(String query)
Function used to autocomplete cable names to be reused
|
List<String> |
completeCableType(String query)
Autocomplete method for cable types.
|
List<String> |
completeConnectors(String query)
Autocomplete method for connectors.
|
List<String> |
completeDeviceNames(String query)
Autocomplete method for device names.
|
List<String> |
completeFbsTags(String query)
Return a list of FBS tags starting with given parameter.
|
List<String> |
completeFilter(CableColumnUI column)
Provide suggestions for cable given cable column.
|
List<String> |
completeFilter(String query)
Provide suggestions for cable given query to filter for.
|
List<InstallationPackage> |
completeInstallationPackage(String query)
Autocomplete method for installation packages.
|
List<String> |
completeUsers(String query)
Autocomplete method for users.
|
void |
conditionalClearCableType()
(Possibly) Clear cable type for selected cable.
|
String |
encodeURL(String url)
Encode a URL and return the encoded value.
|
void |
excuteQueryId(long id)
Execute query with given id
|
void |
executeQuery(javax.faces.event.ActionEvent e)
Execute selected query.
|
List<javax.faces.model.SelectItem> |
filterOptions(CableColumnUI column)
Provide filter options given cable column.
|
List<InstallationPackage> |
getAvailableInstallationPackages() |
String[] |
getCableClasses() |
String |
getCableNumberingSheetURL() |
List<CableUI> |
getCables() |
org.primefaces.model.StreamedContent |
getCableSheetWithCablesToExport() |
org.primefaces.model.StreamedContent |
getCableSheetWithImportedCables() |
List<Cable> |
getCablesToExport()
Returns the cables to be exported, which are the currently filtered and selected cables, or all filtered cables
without deleted ones if none selected.
|
Long |
getCablesToExportSize()
Return counter for number of cables to be exported.
|
String |
getChessURL() |
String |
getDateFormatString() |
List<CableUI> |
getDeletedCables() |
List<String> |
getDeviceNames() |
boolean |
getEditCable() |
boolean |
getFileToBeImportedExists() |
LoaderResult<Cable> |
getImportResult() |
org.primefaces.model.StreamedContent |
getImportTemplate() |
List<String> |
getInstallationPackageNames() |
boolean |
getIsAddPopupOpened() |
boolean |
getIsAdmin() |
boolean |
getIsDisabledChangeCableName()
Return boolean about if ability to change cable name is disabled.
|
boolean |
getIsEmptyChessId()
Return true if chess id not set for selected cable.
|
boolean |
getIsEmptyDeviceA() |
boolean |
getIsEmptyDeviceAFbsTag() |
boolean |
getIsEmptyDeviceB() |
boolean |
getIsEmptyDeviceBFbsTag() |
boolean |
getIsRequiredArticle()
Return if cable article is required.
|
boolean |
getIsSystemSelected() |
org.primefaces.model.LazyDataModel<CableUI> |
getLazyModel() |
String |
getLongOverlayURL() |
String |
getLongTextOverlayContent()
Gets overlay content text.
|
String |
getLongTextOverlayHeader()
Gets overlay header text.
|
static int |
getNumberOfEntitiesPerPage() |
String |
getNumberOfFilteredItems() |
List<CableStatus> |
getPossibleCableStatus() |
ReuseCableDetails |
getReuseCableDetails() |
int |
getRowNumber()
Returns row number, if applicable, for first entry in page that contains selected entry (in list of all entries).
|
int |
getRows()
Returns (current) number of rows/entries per page in pagination component.
|
CableUI |
getSelectedCable() |
String |
getSelectedCableCableArticle() |
String |
getSelectedCableCableType() |
String |
getSelectedCableConnectorA() |
String |
getSelectedCableConnectorB() |
String |
getSelectedCableInstallationPackage() |
String |
getSelectedCableName() |
List<String> |
getSelectedCableOwners() |
List<CableUI> |
getSelectedCables() |
String |
getSelectedDevice() |
QueryUI |
getSelectedQuery() |
SessionObject |
getSessionObject() |
String |
getStyleCableFbsTag()
Return inline style of field for cable fbs tag.
|
String |
getStyleCableType()
Return style of cable type field.
|
String[] |
getSubsystems() |
String[] |
getSubsystems(String systemCharacter)
Return available subsystems for given system.
|
String[] |
getSystems() |
void |
init()
Initializes the bean for initial view display, and invokes service availability check at first invocation.
|
void |
initReuseCableDetails()
Initializes the object for reusing a cable
|
boolean |
isCableEdit(String value)
Check if parameter matches cable edit
|
boolean |
isCableEditable(CableUI cable)
Decides if a cable is locked-, or unlocked for editing for the currently logged in user.
|
boolean |
isCableLocked(Cable cable)
Decides if a cable cable can be edited, or not.
|
boolean |
isChangeCableOwnerAllowed() |
boolean |
isColumnVisible(CableColumnUI column)
Returns column visibility for given column.
|
boolean |
isColumnVisible(int columnIndex)
Returns column visibility for column with given index.
|
boolean |
isDeleteButtonEnabled() |
boolean |
isEditButtonEnabled()
Function to determine if Edit button can be enabled, or disabled for user
|
boolean |
isExportButtonEnabled() |
void |
isFloatEntered(javax.faces.context.FacesContext ctx,
javax.faces.component.UIComponent component,
Object value)
Validates if entered value is Float number.
|
boolean |
isSingleCableSelected() |
boolean |
isUploadButtonEnabled() |
void |
isURLEntered(javax.faces.context.FacesContext ctx,
javax.faces.component.UIComponent component,
Object value)
Validates if entered value is URL.
|
void |
isValidCableClass(javax.faces.context.FacesContext ctx,
javax.faces.component.UIComponent component,
Object value)
Validates if entered value is not valid cable class.
|
void |
isValidLbsTag(javax.faces.context.FacesContext ctx,
javax.faces.component.UIComponent component,
Object value)
Validates if entered value is valid LBS tag.
|
void |
isValidSubsystem(javax.faces.context.FacesContext ctx,
javax.faces.component.UIComponent component,
Object value)
Validates if entered value is valid subsystem.
|
void |
isValidSystem(javax.faces.context.FacesContext ctx,
javax.faces.component.UIComponent component,
Object value)
Validates if entered value is valid system.
|
boolean |
linkToChess(CableUI cableUI,
CableColumnUI cableColumnUI)
Return boolean if given information allows link to Chess.
|
void |
onCableAdd()
Event triggered when cable is created.
|
void |
onCableDelete()
Event triggered when cable is deleted.
|
void |
onCableEdit()
Event triggered when cable is updated.
|
void |
onCableEditApply()
Event triggered when cable is updated with apply.
|
void |
onPaginate()
Event triggered when paging for data table.
|
void |
onRowSelect()
Event triggered when row is selected in table in UI.
|
void |
onToggle(org.primefaces.event.ToggleEvent event)
Event triggered when toggling column visibility.
|
void |
prepareAddPopup()
Prepare for Add cable dialog.
|
void |
prepareEditPopup()
Prepare for Edit cable dialog.
|
void |
redirect(String url,
String page)
Redirects to the device extremities.
|
void |
redirectToCCDB(javax.faces.event.ActionEvent actionEvent)
Redirects to configuration cable database device extremities.
|
void |
redirectToNamingService(javax.faces.event.ActionEvent actionEvent)
Redirects to naming service device definition extremities.
|
void |
resetQuery()
Reset query and refresh cables.
|
void |
resetValues()
Reset values.
|
String |
retrieveCableClassLabel(String cableClass)
Return cable class name which corresponds to cable class letter.
|
String |
retrieveSubsystemLabel(String subsystemNumber)
Return subsystem name which corresponds to subsystem number.
|
String |
retrieveSystemLabel(String systemNumber)
Return system name which corresponds to system number.
|
void |
reuseCable()
Reuses the cable with desired parameters, and shows result on Message
|
boolean |
reuseCableNameButtonEnabled()
Determines if user can reuse a cable name
|
void |
setAvailableInstallationPackages(List<InstallationPackage> availableInstallationPackages) |
void |
setCables(List<CableUI> cables) |
void |
setLongOverlayURL(String longOverlayURL)
Sets the URL for the long general popup.
|
void |
setLongTextOverlayContent(String longTextOverlayContent)
Sets overlay content text.
|
void |
setLongTextOverlayHeader(String longTextOverlayHeader)
Sets overlay header text.
|
void |
setRows(int rows)
Sets (current) number of rows/entries per page in pagination component.
|
void |
setSelectedCableCableArticle(String name)
Set selected cable cable article.
|
void |
setSelectedCableCableType(String name)
Set selected cable cable type.
|
void |
setSelectedCableConnectorA(String name)
Set selected cable connector A.
|
void |
setSelectedCableConnectorB(String name)
Set selected cable connector B.
|
void |
setSelectedCableInstallationPackage(String name) |
void |
setSelectedCableOwners(List<String> cableOwners) |
void |
setSelectedCables(List<CableUI> selectedCables) |
void |
setSelectedDevice(String selectedDevice)
Set selected device.
|
void |
setSelectedQuery(QueryUI selectedQuery) |
void |
setSessionObject(SessionObject sessionObject) |
String |
tooltipForEditLock(CableUI cable)
Tooltip util function for showing tooltip for cable Lock column.
|
String |
tooltipForEditMenu()
Tooltip util function for showing tooltip for cable Edit button.
|
String |
tooltipForLabel(CableColumnUI column)
Return tooltip for cable label.
|
String |
tooltipForLink(String label,
String column,
String value)
Return tooltip for cable link.
|
String |
tooltipForProblem(CableUI cableUi)
Generates the tooltip message when there is a problem with cable
|
String |
tooltipForValue(CableUI cable,
String label,
String column,
String value)
Return tooltip for cable value.
|
void |
unselectAllRows()
Unselect all rows and proceed accordingly, i.e.
|
void |
updateCablesToExportSize()
Update counter for number of cables to be exported.
|
void |
validateCables()
Invokes explicit cable validation.
|
public CableRequestManager()
@PostConstruct public void init()
public void initReuseCableDetails()
public boolean canImportCables()
public boolean getFileToBeImportedExists()
true if the uploaded file that hasn't been imported yet exists, false otherwisepublic List<CableUI> getSelectedCables()
public void setSelectedCables(List<CableUI> selectedCables)
selectedCables - the cables to selectpublic void clearSelectedCables()
public List<Cable> getCablesToExport()
public LoaderResult<Cable> getImportResult()
public void clearImportState()
public void cableFileUpload(org.primefaces.event.FileUploadEvent event)
event - the event containing the filepublic void cableImportTest()
public void cableImport()
public void validateCables()
public org.primefaces.model.StreamedContent getCableSheetWithImportedCables()
public org.primefaces.model.StreamedContent getCableSheetWithCablesToExport()
public org.primefaces.model.StreamedContent getImportTemplate()
public String getCableNumberingSheetURL()
public String getDateFormatString()
public String getSelectedDevice()
public void setSelectedDevice(String selectedDevice)
selectedDevice - selected devicepublic void onPaginate()
public void onToggle(org.primefaces.event.ToggleEvent event)
event - toggle eventpublic boolean isColumnVisible(int columnIndex)
columnIndex - column indexpublic boolean isColumnVisible(CableColumnUI column)
column - given columnpublic void unselectAllRows()
public void onRowSelect()
public boolean isSingleCableSelected()
true if a single cable is selected, false otherwisepublic String getSelectedCableName()
public boolean getIsEmptyChessId()
public String getStyleCableFbsTag()
public boolean getIsRequiredArticle()
public void conditionalClearCableType()
public String getStyleCableType()
public boolean getIsAddPopupOpened()
public void prepareAddPopup()
public void onCableAdd()
public void prepareEditPopup()
public void onCableEdit()
public boolean isCableEdit(String value)
value - onCableAdd or onCableEditpublic void onCableEditApply()
public void resetValues()
public void checkCablesForDeletion()
public void onCableDelete()
public String[] getSystems()
public String[] getSubsystems()
public String[] getSubsystems(String systemCharacter)
systemCharacter - system character (number)public String[] getCableClasses()
public String retrieveSystemLabel(String systemNumber)
systemNumber - system numberpublic String retrieveSubsystemLabel(String subsystemNumber)
subsystemNumber - subsystem numberpublic String retrieveCableClassLabel(String cableClass)
cableClass - cable class letterpublic boolean getIsSystemSelected()
public CableUI getSelectedCable()
public List<String> getDeviceNames()
public List<String> completeCableArticle(String query)
query - query to filter cable articlespublic List<String> completeCableType(String query)
query - query to filter cable typespublic List<String> completeDeviceNames(String query)
query - query to filter device namespublic List<String> completeCableNames(String query)
query - part of the cable name that has to be searched forpublic List<String> completeFbsTags(String query)
query - start of FBS tagpublic List<String> completeConnectors(String query)
query - query to filter connectorspublic List<String> getSelectedCableOwners()
public void setSelectedCableOwners(List<String> cableOwners)
cableOwners - cable owners to set on selected cablepublic List<String> completeUsers(String query)
query - query to filter userspublic List<CableStatus> getPossibleCableStatus()
public boolean canChangeStatus()
public boolean getIsDisabledChangeCableName()
public List<InstallationPackage> completeInstallationPackage(String query)
query - query to filter installation packagespublic String getSelectedCableInstallationPackage()
public void setSelectedCableInstallationPackage(String name)
public String getSelectedCableCableArticle()
public void setSelectedCableCableArticle(String name)
name - cable article name (manufacturer.externalId)public String getSelectedCableCableType()
public void setSelectedCableCableType(String name)
name - cable type namepublic String getSelectedCableConnectorA()
public void setSelectedCableConnectorA(String name)
name - connector namepublic String getSelectedCableConnectorB()
public void setSelectedCableConnectorB(String name)
name - connector namepublic void isValidSystem(javax.faces.context.FacesContext ctx,
javax.faces.component.UIComponent component,
Object value)
ctx - faces contextcomponent - componentvalue - entered valuejavax.faces.validator.ValidatorException - if entered value is not valid systempublic void isValidSubsystem(javax.faces.context.FacesContext ctx,
javax.faces.component.UIComponent component,
Object value)
ctx - faces contextcomponent - componentvalue - entered valuejavax.faces.validator.ValidatorException - if entered value is not valid subsystempublic void isValidCableClass(javax.faces.context.FacesContext ctx,
javax.faces.component.UIComponent component,
Object value)
ctx - faces contextcomponent - componentvalue - entered valuejavax.faces.validator.ValidatorException - if entered value is not valid cable classpublic void isValidLbsTag(javax.faces.context.FacesContext ctx,
javax.faces.component.UIComponent component,
Object value)
ctx - faces contextcomponent - componentvalue - entered valuejavax.faces.validator.ValidatorException - if entered value is not valid subsystempublic void isFloatEntered(javax.faces.context.FacesContext ctx,
javax.faces.component.UIComponent component,
Object value)
ctx - faces contextcomponent - componentvalue - entered valuejavax.faces.validator.ValidatorException - if entered value is not Double numberpublic void isURLEntered(javax.faces.context.FacesContext ctx,
javax.faces.component.UIComponent component,
Object value)
ctx - faces contextcomponent - componentvalue - entered valuejavax.faces.validator.ValidatorException - if entered value is not URLpublic boolean getEditCable()
public boolean isEditButtonEnabled()
true if user can edit, and Edit button can be enabled
false if user can not edit, and Edit button should be disabledpublic boolean reuseCableNameButtonEnabled()
true if user can reuse cableNames, and false if user can not reuse cableNamespublic boolean isUploadButtonEnabled()
public boolean isChangeCableOwnerAllowed()
public boolean isDeleteButtonEnabled()
public boolean isExportButtonEnabled()
public void redirectToCCDB(javax.faces.event.ActionEvent actionEvent)
actionEvent - action eventpublic void redirectToNamingService(javax.faces.event.ActionEvent actionEvent)
actionEvent - action eventpublic void redirect(String url, String page)
url - URL to redirect topage - page to redirect topublic List<javax.faces.model.SelectItem> filterOptions(CableColumnUI column)
column - cable columnpublic List<String> completeFilter(CableColumnUI column)
column - cable columnpublic List<String> completeFilter(String query)
query - query to filter forpublic QueryUI getSelectedQuery()
public void setSelectedQuery(QueryUI selectedQuery)
public void executeQuery(javax.faces.event.ActionEvent e)
e - action eventpublic void excuteQueryId(long id)
id - query idpublic void resetQuery()
public String getNumberOfFilteredItems()
public org.primefaces.model.LazyDataModel<CableUI> getLazyModel()
public Long getCablesToExportSize()
public void updateCablesToExportSize()
public boolean getIsAdmin()
public void setLongTextOverlayHeader(String longTextOverlayHeader)
longTextOverlayHeader - the overlay header text.public String getLongTextOverlayHeader()
public void setLongTextOverlayContent(String longTextOverlayContent)
longTextOverlayContent - the overlay content text.public String getLongTextOverlayContent()
public void setLongOverlayURL(String longOverlayURL)
longOverlayURL - the url to where the popup is pointing.public String getLongOverlayURL()
public static int getNumberOfEntitiesPerPage()
public List<InstallationPackage> getAvailableInstallationPackages()
public void setAvailableInstallationPackages(List<InstallationPackage> availableInstallationPackages)
public void clearSelection()
public String getChessURL()
public boolean linkToChess(CableUI cableUI, CableColumnUI cableColumnUI)
cableUI - The cable UI componentcableColumnUI - The cable column UI componentpublic String encodeURL(String url)
url - the url to encodeURLUtility.encodeURL(String)public int getRowNumber()
public int getRows()
public void setRows(int rows)
rows - number of rows per pagepublic String tooltipForProblem(CableUI cableUi)
cableUi - cablepublic String tooltipForValue(CableUI cable, String label, String column, String value)
cable - cablelabel - labelcolumn - columnvalue - valuepublic String tooltipForLink(String label, String column, String value)
label - labelcolumn - columnvalue - (part of) tooltippublic String tooltipForLabel(CableColumnUI column)
column - cable columnpublic boolean getIsEmptyDeviceA()
public boolean getIsEmptyDeviceAFbsTag()
public boolean getIsEmptyDeviceB()
public boolean getIsEmptyDeviceBFbsTag()
public void clearFillFromEssName()
public void clearFillFromFbsTag()
public void clearFillFromEnclosureEssName()
public void clearFillFromEnclosureFbsTag()
public void clearFillToEssName()
public void clearFillToFbsTag()
public void clearFillToEnclosureEssName()
public void clearFillToEnclosureFbsTag()
public SessionObject getSessionObject()
public void setSessionObject(SessionObject sessionObject)
public ReuseCableDetails getReuseCableDetails()
public void reuseCable()
public List<CableStatus> allCableStatuses()
public String tooltipForEditMenu()
public String tooltipForEditLock(CableUI cable)
cable - cable for which to prepare tooltip for Lock columnpublic boolean isCableLocked(Cable cable)
cable - the cable for which the lock state for editing has to be determinedtrue if cable can be edited
false if cable can not be editedpublic boolean isCableEditable(CableUI cable)
cable - the cable for which the lock state for editing has to be determinedtrue if cable editing is locked
false if cable editing is unlockedCopyright © 2025 European Spallation Source. All rights reserved.