id
stringlengths 7
40
| content
stringlengths 401
37k
| summary
stringclasses 1
value | layer
stringclasses 2
values |
---|---|---|---|
UC1.txt | Use case name ELIMINABENECULTURALE
Delete a cultural object in the system.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. View the list of BeniCulturali as a result of the use case RicercaBeneCulturale, it selects and activates a function of elimination.
2 Asks confirmation.
3 Confirm the operation.
4 Delete the cultural choice.
Exit conditions • The system shall notify the successful elimination of the cultural.
• Operator Agency cancels the operation.
• Interruption of connection to the server ETOUR.
Quality
The system requirements blocks of input controls on receipt of confirmation of cancellation to avoid multiple submissions before the end of the operation.
| Use Case |
|
UC10.txt | Use case name VISUALIZZASCHEDAPUNTODIRISTORO
View the details of a selected point of rest.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. View the list of points of rest as a result of the use case RicercaPuntoDiRistoro, it selects and activates a function to view the card.
2 Upload data to a selected restaurant.
Exit conditions • The system displays the details of the selected point of rest.
• Interruption of the connection to the server ETOUR.
Quality
requirements | Use Case |
|
UC11.txt | Use case name VISUALIZZASTORICOCONVENZIONI
View the history of conventions derived from a selected point of rest.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The Agency is in the form of a designated point of rest.
Flow of events User System
1. Access the features on the display of historical conventions.
2 Upload data on conventions from the restaurant selected.
Exit conditions • The system displays the history of conventions concerning the point of eating selected.
• Interruption of the connection to the server ETOUR.
Quality
requirements | Use Case |
|
UC12.txt | Use case name VISUALIZZASCHEDATURISTA
View the details of a selected account Turista.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. Tourists from the list obtained by activating the use case RicercaTurista will select and activate a function for displaying the card.
2 Upload data to the selected account.
Exit conditions • The system displays the card's Tourist selected.
• Interruption of the connection to the server ETOUR.
Quality requirements | Use Case |
|
UC13.txt | Use case name ACTIVE / DISATTIVAACCOUNTTURISTA
Enable or disable the account of a tourist.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The Agency is in the form of a tourist.
Flow of events User System
1. Activate the feature for the activation / deactivation by a given sheet tourist.
2 Asks for confirmation of activation / deactivation.
3 Confirm the operation.
4 Enable / disable the account of the visitor you selected.
Exit conditions • The notification of the outcome.
• Interruption of the connection to the server ETOUR.
Quality requirements
| Use Case |
|
UC14.txt | Use case name RICERCATURISTA
Returns the list of tourist account in the system according to certain parameters.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. Access the search functionality of a tourist.
2 Show the form.
3 Fill out the form and submit.
4 Processing the request.
Exit conditions • The system returns a list of accounts that meet Turista your search criteria.
• Interruption of the connection to the server ETOUR.
Quality requirements
| Use Case |
|
UC15.txt | Use case name MODIFICADATIACCOUNTTURISTA
Change data of a selected account Turista.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. Tourists from the list obtained by activating the use case RicercaTurista it selects and activates a function to modify data.
2 Loads the data selected and displays them in a form allowing the change.
3 Edit the fields in the form and submit.
4 Verify the information and asks for confirmation of the change. Where the data is invalid or insufficient, the system activates the use case Errored.
5 Confirm the operation.
6. Stores the modified data selected account.
Exit conditions • The system has been reporting the information required by the selected account Turista.
• Interruption of the connection to the server ETOUR.
Quality requirements
| Use Case |
|
UC16.txt | Use case name ELIMINAACCOUNTTURISTA
Delete the account of a tourist from the system.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. Tourists from the list obtained by activating the use case RicercaTurista will select and activate a feature for disposal.
2 Asks for confirmation of the transaction.
3 Confirm the operation.
4 Delete the selected data.
Exit conditions • The notification system has been elimination of selected accounts Turista.
• Interruption of the connection to the server ETOUR.
Quality requirements | Use Case |
|
UC17.txt | Use case name MODIFICABANNER
Changing the image of a banner ad.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. Receives a list of turning points of the rest use case RicercaPuntiDiRistoro and select one from accessing the function of editing a banner.
2 View the list of banner associated with the point of rest.
3 Select a banner from the list and enter the editing functionality.
4 Displays a form for the selection of an image.
5 Select a picture and send the request to change the system.
6. Check the characteristics of the inserted and asks for confirmation of the change of the banner. In the event that the inserted image is not valid, enable the use case Errored.
7 Confirmation of the transaction change.
8 Bookmark this new image for the selected banner.
Exit conditions • The system shall notify the successful modification of the banner.
• Interruption of the connection to the server ETOUR.
Quality requirements
| Use Case |
|
UC18.txt | Use case name CONTROLLANUMEROBANNER
Check if a point Refreshments included the maximum number of allowed banners to it.
Partecipating
Actor
Entry
Operator conditions • The agency wants to put a new banner
Flow of events User System
1. Load the data of the Convention of refreshment point and verify that the number of banners is less than the specified number of the current banner. If not checked, will end the operation input and displays a notification.
2 Confirmation of the reading of the notification.
3 Recovers the previous state.
Exit conditions • The system returns control to the user interaction.
• Interruption of the connection to the server ETOUR.
Quality requirements
| Use Case |
|
UC19.txt | Use case name ELIMINABANNER
Delete a banner ad associated with a refreshment bar on the computer.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. Receives a list of turning points of the rest use case RicercaPuntiDiRistoro and select one from accessing the function of removal of the banner.
2 View the list of banner associated with the point of rest.
3 Select a banner from the list and enter the function of elimination.
4 Displays a message confirming the deletion.
5 Confirm the operation.
6. Removes the banner.
Exit conditions • The system shall notify the successful elimination of the selected banner.
• Interruption of the connection to the server ETOUR.
Quality requirements
| Use Case |
|
UC2.txt | Use case name INSERISCIBENECULTURALE
Inserts a new cultural object in the system.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. Activate the feature for the insertion of a new cultural good.
2 Displays the corresponding form.
3 Fill out the form with the data of the cultural and submit.
4 Verify the data entered and asks for confirmation of the transaction. Where the data is invalid or insufficient, the system activates the use case Errored.
5 Confirm the operation.
6. Memorize your new cultural good.
Exit conditions • The system shall notify the proper inclusion of the cultural.
• Operator Agency cancels the operation.
• Interruption of the connection to the server ETOUR.
Quality
The system requirements will not accept duplicates cultural heritage.
| Use Case |
|
UC20.txt | Use case name INSERISCIBANNER
Inserting a new banner associated with a point of rest.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. Receives a list of turning points of the rest use case RicercaPuntiDiRistoro and select one from the list and access to the function of inserting banners.
2 Displays a form for the selection of an image.
3 Select an image and sends the request for entering the system.
4 Check the characteristics of the inserted, check that the number of banner did not exceed the maximum point of the restaurant and asks for confirmation of the insertion of the banner. In the event that the inserted image is not valid, enable the use case Errored.
5 Confirm the operation of insertion.
6. Remember the banners associated with the selected point of rest.
Exit conditions • The notification about the insertion of new banner to the Refreshments selected.
• The Operator Agency cancels the operation.
• The point of eating has already entered the maximum number of banners allowed.
• Interruption of the connection to the server ETOUR.
Quality requirements | Use Case |
|
UC21.txt | Use case name INSERISCINEWS
Inserts a new news in the system.
Participating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. Activate the feature to insert a news.
2 Displays the corresponding form.
3 Fill out the form and submit.
4 Verify the data entered and asks for confirmation of the transaction. Where the data is invalid or insufficient, the system activates the use case Errored.
5 Confirm the operation of insertion.
6. Stores the data of the new news.
Exit conditions • The system shall notify the proper placement of the news.
• The Operator Agency cancels the operation.
• Interruption of the connection to the server ETOUR.
Quality
requirements | Use Case |
|
UC22.txt | Use case name ELIMINANEWS
Delete a news in the system.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. Activate the function of elimination of a news.
2 View all news in a form.
3 Select a news from the list and submit the form.
4 Asks for confirmation of the transaction.
5 Confirm the deletion of the news.
6. Delete the data news.
Exit conditions • The system shall notify the successful elimination of the news.
• The Operator Agency cancels the operation.
• Interruption of the connection to the server ETOUR.
Quality
requirements
| Use Case |
|
UC23.txt | Use case name MODIFICANEWS
Change data of a news on the computer.
Participating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. Activate the editing functionality of a news.
2 View all news in a form.
3 Select a news from the list and submit the form.
4 Load the data of news and displays them in a form for editing.
5 Change data in the form and submit.
6. Check the modified information and asks for confirmation of the transaction. Where the data is invalid or insufficient, the system activates the use case Errored.
7 Confirm the operation of changing the data news.
8 Stores data modified news.
Exit conditions • The system shall notify the successful amendment of news.
• The Operator Agency cancels the operation.
• Interruption of the connection to the server ETOUR.
Quality
requirements
| Use Case |
|
UC24.txt | Use case name VISUALIZZAFEEDBACK
View all feedback for a particular site.
Participating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. View the list of sites as a result of the use case RicercaSito, it selects and activates a function to view the feedback.
2 Upload Site Feedback selected.
Exit conditions • The system displays all feedback regarding the site selected.
• Interruption of the connection to the server
Quality
requirements | Use Case |
|
UC25.txt | Use case name VISUALIZZAREPORTSTATISTICI
View statistical report relating to a selected location.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. Activate the feature on the statistical report.
2 Upload the list of places in the system and displays them in a form.
3 Select a location and submit the form.
4 Upload midsize site feedback obtained by activating the RicercaSito use case for the location selected. Prepare the statistical report.
Exit conditions • The system displays the statistical report for the selected location.
• Interruption of the connection to the server
Quality
requirements | Use Case |
|
UC26.txt | Use case name MODIFICACOMMENTO
Editing a comment by a feedback selected.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. View the list of sites as a result of the use case RicercaSito, it selects and activates a function of change in the selected comment.
2 Upload feedback issued to that site and displays them in a form.
3 Select a feedback from the list and submit the form.
4 Displays a form for editing the comment of feedback selected.
5 Edit the comment and submit the form.
6. Verify the data entered and asks for confirmation of the change. Where the data is invalid or insufficient, the system activates the use case Errored.
7 Confirm the operation.
8 Remember the comment changed.
Exit conditions • The notification system has been modified for the comment feedback selected.
• Operator Agency cancels the operation.
• Interruption of the connection to the server
Quality
requirements
| Use Case |
|
UC27.txt | Use case name RICERCASITO
Searching for a specific site on the computer.
Partecipating
Actor
Entry
conditions
Flow of events User System
1. Activate the search functionality of a site.
2 Show the form for research
3 Fill in the form of research and submit
4 Processing the request
Exit conditions • The system returns a list of sites found
• Interruption of the connection to the server ETOUR.
Quality
The system requirements should return the results within a time limit set
| Use Case |
|
UC28.txt | Use case name ELIMINATAG
Removes one or more search tags in the system.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. Access the functionality to delete a tag.
2 Research in the existing system, the tags and displays them in a form.
3 Select one or more tags from the list and sends the request for deletion.
4 Delete the selected search tag.
Exit conditions • The system shall notify the successful elimination of selected tags.
• Interruption of the connection to the server ETOUR.
Quality requirements
| Use Case |
|
UC29.txt | Use case name ERRORETAGESISTENTE
E 'was asked to enter a search tags already in the system.
Participating
Actor
Entry
conditions • He was asked to enter a search tags already in the system.
Flow of events User System
1. Notice the error message and asks for confirmation of its reading.
2 Confirmation of the reading of the notification.
3 Recovers the previous state.
Exit conditions • The system returns control to the user interaction.
Quality requirements | Use Case |
|
UC3.txt | Use case name MODIFICABENECULTURALE
Change data of a cultural object in the system.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. View the list of cultural goods as a result of the use case RicercaBeneCulturale, it selects and activates a function of change.
2 Load the data of the cultural and displays the form for editing.
3 Change data in the form and submit.
4 Verify the data entered and asks for confirmation of the transaction. Where the data is invalid or insufficient, the system activates the use case Errored.
5 Confirm the operation.
6. Stores the modified data of the cultural.
Exit conditions • The notification system has been changing the data of the cultural.
• Operator Agency cancels the operation.
• Interruption of the connection to the server ETOUR.
Quality
The system requirements blocks of input controls in the form once we receive confirmation of the change to avoid multiple submissions before the end of the operation.
| Use Case |
|
UC30.txt | Use case name INSERISCITAG
Inserts a new tag search.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. Access the functionality of inserting new tag search.
2 Show the form for entering a tag.
3 Fill out the form with the required information and submit.
4 Verify the data entered and check if the tag is already present in the system. In the latter case the active use case ErroreTagEsistente. Instead, if the data is invalid or insufficient, the system activates the use case Errored.
Exit conditions • The notification about the inclusion of the tag.
• Interruption of the connection to the server ETOUR.
Quality requirements
| Use Case |
|
UC31.txt | Use case name MODIFICAPASSWORD
The Agency Operator chooses to change the password associated with your account
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
5 Choose to change your password by pressing the appropriate
Button
6. Upload the form to change the password associated with that work agency
7 Change your password by entering the new choice and confirming
8 Save your changes
Exit conditions • The system confirms the success of Operation
• Interruption of the connection to the server
Quality
requirements | Use Case |
|
UC32.txt | Use case name ERROREMODIFICAPASSWORD
E 'was asked to enter a password but is not confirmed in a correct way.
Participating
Actor
Entry
conditions • It has been pressed the button to confirm the password change
Flow of events User System
4 Notify an error message.
5 Confirmation of the reading of the notification.
6. Back to change your password.
Exit conditions • The system returns control to the user interaction.
Quality requirements | Use Case |
|
UC33.txt | Use case name REGISTRATION
Requires the creation of a new system.
Partecipating
Actor initialized by Guest User
Entry
conditions • Guest User have access to the system.
Flow of events User System
1. Enable the logging feature.
2 View the registration form.
3 Fill out the form and submit.
4 Verify the data entered and asks for confirmation of the transaction. Where the data is invalid or insufficient, the system activates the use case Errored.
5 Confirm the operation.
6. Create a new account with the data entered.
Exit conditions • The system shall notify the successful operation of recording.
• Guest User cancels the operation.
• Interruption of the connection to the server ETOUR.
Quality
requirements
| Use Case |
|
UC34.txt | Use case name SEARCH
Research and cultural heritage for all.
Participating
Actor initialized by Guest User
Entry
conditions • Guest User logs on.
Flow of events User System
1. Activate the search functionality.
2 Displays the corresponding form.
3 Fill out the form and submit.
4 Gets the position dell'Utente Guest citing the case of use location and process research.
Exit conditions • The system displays a list of sites that meet the search criteria.
• Interruption of the connection to the server ETOUR.
Quality
requirements | Use Case |
|
UC35.txt | Use case name LOGIN
Ensures a registered user to access the system with the privileges that fall.
Partecipating
Actor initialization Registered User
Entry
conditions • A registered user has access to the system.
Flow of events User System
1. Activate the login feature.
2 Displays the corresponding form.
3 Fill out the form with login information and submit.
4 Check the correctness of the data, if not corrected on the use case LoginErrato.
Exit conditions • The system displays the area of work registered.
• The registered user cancels the operation.
• Interruption of the connection to the server ETOUR ..
Quality requirements | Use Case |
|
UC36.txt | Use case name LOGINERRATO
The data supplied for the login is incorrect.
Participating
Actor
Entry
Conditions • The data supplied for the login is incorrect.
Flow of events User System
1. Notice that the data entered for the login is not valid and asks for confirmation of the reading.
2 Confirmation of the reading of the notification.
3 Recovers the previous state.
Exit conditions • The system returns control to the user interaction.
Quality requirements | Use Case |
|
UC37.txt | Use case name LOGOUT
Ends the current session.
Participating
Actor initialization Registered User
Entry
conditions • A registered user has previously made a successful Login.
Flow of events User System
1. Access the functionality of disconnection from the system.
2 Asks for confirmation of the transaction.
3 Confirm the request for disconnection.
4 Disconnects the Registered User.
Exit conditions • The system shall notify the successful operation logout.
Quality requirements
| Use Case |
|
UC38.txt | Use case name INSERISCIBANNER
Inserting a new banner associated with the point of rest.
Partecipating
Actor initialization Operator Point Of Restaurants
Entry
conditions • The Point Of Restaurant Operator has successfully authenticated to the system.
Flow of events User System
1. Select the feature for the insertion of a new banner.
2 Displays a form for the selection of an image.
3 Select an image and sends the request for entering the system.
4 Check the characteristics of the inserted, check that the number of banner did not exceed the maximum point of the restaurant and asks for confirmation of the insertion of the banner. In the event that the inserted image is not valid, enable the use case Errored.
5 Confirm the operation of insertion.
6. Remember the banners associated with the point of rest.
Exit conditions • The notification about the insertion of new banner.
• The Point Of Operator Restaurant cancels the operation.
• The point of eating has already entered the maximum number of banners allowed.
• Interruption of the connection to the server ETOUR.
Quality requirements
| Use Case |
|
UC39.txt | Use case name MODIFICABANNER
Changing the image of a banner ad.
Partecipating
Actor initialization Operator Point Of Restaurants
Entry
conditions • The Point Of Restaurant Operator has successfully authenticated to the system.
Flow of events User System
1. Select the editing functionality of the banner.
2 View the list of banner associated with the point of rest.
3 Select a banner from the list and enter the editing functionality.
4 Displays a form for the selection of an image.
5 Select a picture and send the request to change the system.
6. Check the characteristics of the inserted and asks for confirmation of the change of the banner. In the event that the inserted image is not valid, enable the use case Errored.
7 Confirmation of the transaction change.
8 Bookmark this new image for the selected banner.
Exit conditions • The system shall notify the successful modification of the banner.
• The Point Of Operator Restaurant cancels the operation.
• Interruption of the connection to the server ETOUR.
Quality requirements | Use Case |
|
UC4.txt | Use case name RICERCABENECULTURALE
Returns the list of cultural objects in the system according to certain parameters.
Partecipating
Actor
Entry
conditions
Flow of events User System
1. Activate the search functionality of a cultural object.
2 Show the form for research.
3 Fill in the search form and submit.
4 Processing the request.
Exit conditions • The system returns a list of cultural goods that meet the search criteria.
• Interruption of the connection to the server ETOUR.
Quality
The system requirements should return the results within a set time.
| Use Case |
|
UC40.txt | Use case name ELIMINABANNER
Delete a banner ad associated with the point of rest.
Partecipating
Actor initialization Operator Point Of Restaurants
Entry
conditions • The Point Of Restaurant Operator has successfully authenticated to the system.
Flow of events User System
1. Select the feature for 'removal of the banner.
2 View the list of banner associated with the point of rest.
3 Select a banner from the list and enter the function of elimination.
4 Displays a message confirming the deletion.
5 Confirm the operation.
6. Removes the banner.
Exit conditions • The system shall notify the successful elimination of the selected banner.
• The Point Of Operator Restaurant cancels the operation.
• Interruption of the connection to the server ETOUR.
Quality requirements | Use Case |
|
UC41.txt | Use case name MODIFICAMENÙ
Change the daily menu of a restaurant.
Partecipating
Actor initialization Operator Point Of Restaurants
Entry
conditions • The Point Of Restaurant Operator has successfully authenticated to the system.
Flow of events User System
1. Activate the editing functionality of the menu.
2 Displays a form with seven days of the week.
3 Select a day of the week and submit the form.
4 Upload the data menu for the selected day and loads them into a form.
5 Edit menu of the selected day and submit the form.
6. Verify the data entered and asks for confirmation of the edit menu. Where the data are insufficient or invalid, the active use case Errored.
7 Confirm the operation.
8 Saves changes to the menu selected.
Exit conditions • The system shall notify the successful modification of the menu.
• Restaurant Point Of Operator cancels the operation.
• Interruption of the connection to the server ETOUR.
Quality
requirements | Use Case |
|
UC42.txt | Use case name ELIMINAMENÙ
Delete a daily menu of a restaurant.
Partecipating
Actor initialization Operator Point Of Restaurants
Entry
conditions • The Point Of Restaurant Operator has successfully authenticated to the system.
Flow of events User System
1. Enable the functionality of deleting a menu.
2 Displays a form containing the seven days of the week.
3 Select a day of the week and submit the form.
4 Calls to confirm the deletion.
5 Confirm the operation.
6. Delete the daily menu selection.
Exit conditions • The system shall notify the successful elimination of the daily menu selection.
• Restaurant Point Of Operator cancels the operation.
• Interruption of the connection to the server ETOUR.
Quality
requirements | Use Case |
|
UC43.txt | Use case name MODIFICADATIPUNTODIRISTORO
Change data point associated refreshment.
Partecipating
Actor initialization Operator Point Of Restaurants
Entry
conditions • The Point Restaurant Operator has successfully authenticated to the system.
Flow of events User System
1. Enable the functionality of the information required by the point of rest.
2 Upload data point Refreshments and displays them in a form.
3 Change data in the form and submit.
4 Verify the data entered and asks for confirmation of the change. Where the data is invalid or insufficient, the system activates the use case Errored.
5 Confirm the operation.
6. Stores the modified data of the point of rest.
Exit conditions • The notification system has been changing the data point selected restaurants.
• Restaurant Point Of Operator cancels the operation.
• Interruption of the connection to the server ETOUR.
Quality
requirements | Use Case |
|
UC44.txt | Use case name RICHIESTACONVENZIONE
Require to conclude a Convention between the points of rest and the agency involved.
Partecipating
Actor initialization Operator Point Of Restaurants
Entry
conditions • The Point Of Restaurant Operator has successfully authenticated to the system.
Flow of events User System
1. Enable the functionality to request the Convention to the Agency.
2 Displays a form for entering data of the Convention.
3 Inserts the data in the form of the agreement and submit.
4 Verify the data entered and asks for confirmation of the request. Where the data is invalid or insufficient, the system activates the use case Errored.
5 Confirm the operation.
6. Send the request to the Convention.
Exit conditions • The notification about the call for the Convention to the Agency.
• Restaurant Point Of Operator cancels the operation.
• Interruption of the connection to the server ETOUR.
Quality
requirements | Use Case |
|
UC45.txt | Use case name VISUALIZZASTATISTICHEPERSONALI
Viewing statistics for Point Of Restaurants
Partecipating
Actor initialization Operator Point Of Restaurants
Entry
conditions • The Point Of Restaurant Operator has successfully authenticated to the system.
Flow of events User System
1. Select the feature to display personal statistics.
2 Displays a form that shows data for the statistics associated refreshment point.
Exit conditions • The system displays the data on the screen.
• Interruption of the connection to the server.
Quality requirements | Use Case |
|
UC46.txt | Use case name MODIFICAPREFERENZEDIRICERCA
Edit your personal search preferences.
Partecipating
Actor initialized by Tourist
Entry
conditions • The Tourist has successfully authenticated to the system.
Flow of events User System
1. Access to functionality for the modification of personal search preferences.
2 Upload your search preferences and displays them in a form.
3 Edit the fields in the form and submit.
4 Asks confirmation.
5 Confirmation for changing search preferences.
6. Memorize search preferences changed.
Exit conditions • The system shall notify the successful modification of search preferences.
• The Tourist cancels the operation.
• Interruption of the connection to the server ETOUR.
Quality
requirements | Use Case |
|
UC47.txt |
Use case name MODIFICADATITURISTA
Change data associated with your account.
Partecipating
Actor initialized by Tourist
Entry
Conditions • Tourism has successfully authenticated to the system.
Flow of events User System
1. Access to functionality for the modification of data.
2 Loads the data and displays them in a form.
3 Edit the fields in the form and submit.
4 Check the modified information and asks for confirmation of the change. Where the data is invalid or insufficient, the system activates the use case Errored.
5 Confirmation of the transaction change.
6. Stores the modified data.
Exit conditions • The system shall notify the successful modification of data.
• The Tourist cancels the operation.
• Interruption of the connection to the server ETOUR.
Quality
requirements | Use Case |
|
UC48.txt | Use case name MODIFICAPREFERENZEGENERICHE
Edit Preferences generic personal.
Partecipating
Actor initialized by Tourist
Entry
Conditions • Tourism has successfully authenticated to the system.
Flow of events User System
1. Access to functionality for the modification of generic personal preferences.
2 Upload your preferences and the general view in a form.
3 Edit the fields in the form and submit.
4 Asks for confirmation of the change.
5 Confirm the operation.
6. Stores preferences changed.
Exit conditions • The system shall notify the successful modification of general preferences.
• The Tourist cancels the operation.
• Interruption of the connection to the server ETOUR.
Quality
requirements | Use Case |
|
UC49.txt | Use case name VISUALIZZASITIPREFERITI
View the list of personal favorites.
Participating
Actor initialized by Tourist
Entry
conditions • The Tourist has successfully authenticated to the system.
Flow of events User System
1. Select the feature to display the list of personal favorites.
2 Upload the list of bookmarks.
Exit conditions • The system displays the list of bookmarks.
• Interruption of the connection to the server ETOUR.
Quality
requirements | Use Case |
|
UC5.txt | Use case name VISUALIZZASCHEDABENECULTURALE
View the details of the selected cultural.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. View the list of cultural goods as a result of the use case RicercaBeneCulturale, it selects and activates a function to view the card.
2 Loads the data for the selected cultural.
Exit conditions • The system displays the details of the selected cultural.
• Interruption of the connection to the server ETOUR.
Quality
requirements | Use Case |
|
UC50.txt | Use case name VISUALIZZASITIVISITATI
View the list of sites for which it has issued a feedback.
Participating
Actor initialized by Tourist
Entry
• conditions Turista has successfully authenticated to the system.
Flow of events User System
1. Select the feature to display the list of sites visited personal.
2 Upload the list of sites for which the tourist has issued a Feedback
Exit conditions • The system displays a list of sites visited.
• Interruption of the connection to the server ETOUR.
Quality
requirements | Use Case |
|
UC51.txt | Use case name INSERISCISITONEIPREFERITI
Inserts a site selected in the list of bookmarks.
Partecipating
Actor initialized by Tourist
Entry
conditions • The tourist card is in a particular site.
Flow of events User System
1. Activate the feature for the insertion of the selected site from the bookmarks.
2 Prompt the inclusion
3 Confirm the input.
4 Inserts the selected site in the list of bookmarks.
Exit conditions • The notification about the insertion site to favorites
• Interruption of connection to the server ETOUR.
Quality
requirements
| Use Case |
|
UC52.txt | Use case name ELIMINASITODAIPREFERITI
Tourism delete a site from the list of bookmarks.
Partecipating
Actor initialized by Tourist
Entry
conditions • The tourist card is in a particular site.
Flow of events User System
1. Choose to remove your site from the list of bookmarks by specific features.
2 Prompt removal
3 Confirm the removal.
4 Removes the selected site from the list of bookmarks.
Exit conditions • The notification system has been removed from the site bookmarks.
• The Tourist cancel the operation
• Interruption of the connection to the server ETOUR.
Quality
requirements | Use Case |
|
UC53.txt | Use case name INSERISCIFEEDBACK
Inserts a feedback for the selected site.
Partecipating
Actor initialized by Tourist
Entry
conditions • The tourist card is in a particular site.
Flow of events User System
1. Activate the feature on the issue of feedback.
2 Verify that the visitor has not already issued a feedback for the site and displays a form for entering the feedback for the selected site. In case the visitor has already issued a feedback for the site selected, activates the use case FeedbackGiàRilasciato.
3 Fill out the form, selecting one vote and inserting a comment, then submit.
4 Verify the data entered and confirm the cheide. Where the data is invalid or insufficient, the system activates the use case Errored.
5 Confirming the issue of feedback.
6. Remember feedback and inserts the selected site in the list of sites visited.
Exit conditions • The system shall notify the successful combination of feedback to the site
• The Tourist cancel the operation
• Interruption of the connection to the server ETOUR.
Quality
requirements | Use Case |
|
UC54.txt | Use case name MODIFICACOMMENTO
Edit the comment previously issued.
Partecipating
Actor initialized by Tourist
Entry
• Tourist conditions is in the details of a particular site.
Flow of events User System
1. Choose to change the comment on the feedback for the site issued by the appropriate functionality.
2 Verify the data entered and asks for confirmation of the change. Where the data is invalid or insufficient, the system activates the use case Errored.
3 Confirm the change of the comment.
4 Edit commentary on selected feedback
Exit conditions • The system shall notify the alterations of the comment
• Interruption of the connection to the server ETOUR.
Quality
requirements
| Use Case |
|
UC55.txt | Use case name FEEDBACKGIA'RILASCIATO
E 'already been issued with a feedback for the selected site.
Partecipating
Actor initialization
Entry
conditions • E 'already been issued with a feedback for the selected site.
Flow of events User System
1. Notification that the user has already issued a feedback for the site and cancel the operation to insert a new feedback.
2 Confirmation of the reading of the notification.
3 Recovers the previous state.
Exit conditions • The system returns control to the user interaction.
Quality
requirements | Use Case |
|
UC56.txt | Use case name LOCALIZATION
Returns the current position of the tourist.
Partecipating
Actor System initialization
Entry
conditions • E 'began a search or an advanced search.
Flow of events Gps System
1. The system requires the data for the position.
2 The GPS calculates the position of the tourist.
3 The system is on hold until the data of the position.
Exit conditions • The system receives the position of the tourist.
• The position of the tourist is not detectable by GPS.
Quality
The GPS requirements into the transaction in more than 5 seconds. | Use Case |
|
UC57.txt | Use case name RICERCAAVANZATA
The tourist searching for a site using the potential offered by the Advanced Search.
Partecipating
Actor initialized by Tourist
Entry
conditions • The Tourist has successfully authenticated to the system.
Flow of events User System
1. Enable the advanced search feature from your personal area.
2 View the advanced search form.
3 Fill in the form of advanced search and submit.
4 Gets the position of relying on the tourist event of the use location and process the request.
Exit conditions • The system displays a list of results.
• Interruption of the connection to the server ETOUR.
Quality
The system requirements into the transaction in more than 15 seconds. | Use Case |
|
UC58.txt | Use case name VISUALIZZASCHEDASITO
View the details of a particular site.
Partecipating
Actor initialized by Tourist
Entry
conditions • The Tourist has successfully authenticated to the system and is located in one of the following areas: Research Results, List of Sites Visited Sites and List of Favorites
Flow of events User System
1. Select the function for displaying the card on a site chosen.
2 Upload data from the database.
Exit conditions • The system displays the details of the selected site.
• Interruption of the connection to the server ETOUR.
Quality
requirements | Use Case |
|
UC6.txt | Use case name ELIMINAPUNTODIRISTORO
Delete a refreshment from the system.
Partecipating
Actor initialization Operator Agency.
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. View a list of points of rest as a result of the use case RicercaBeneCulturale, it selects and activates a function of elimination.
2 Asks for confirmation of the transaction.
3 Confirm the deletion.
4 Deletes the selected point of rest.
Exit conditions • The system shall notify the successful elimination of the point of rest.
• Operator Agency cancels the operation.
• Interruption ETOUR connection to the server.
Quality
requirements | Use Case |
|
UC7.txt | Use case name ATTIVACONVENZIONE
Convention active request by a refreshment point.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The Agency is in the form of a designated point of rest.
Flow of events User System
1. Enable the activation function of the Convention.
2 Load the data request of the Convention from the point of rest and displays the corresponding form.
3 Check the data of the agreement and decide for activation.
4 Asks for confirmation of the activation.
5 Confirm the operation.
6. Processing the request.
Exit conditions • The system shall notify the activation of the convention.
• Interruption of the connection to the server ETOUR.
Quality
requirements
| Use Case |
|
UC8.txt | Use case name MODIFICADATIPUNTODIRISTOROAGENZIA
Edit the data pertaining to a designated point of rest.
Partecipating
Actor initialization Agency Operator
Entry
Operator conditions • The agency has logged.
Flow of events User System
1. View a list of points of rest as a result of the use case RicercaPuntoDiRistoro, it selects an active and functional data changes.
2 Upload data from the point of rest and displays the form of change.
3 Change data in the form and submit.
4 Verify the data entered in form and asks for confirmation of the transaction. Where the data is invalid or insufficient, the system activates the use case Errored.
5 Confirm the operation.
6. Stores the modified data of the point of rest.
Exit conditions • The system has been reporting the information required by the point of rest.
• Operator Agency cancels the operation.
• Interruption of the connection to the server ETOUR.
Quality
The system requirements blocks of input controls in the form once we receive confirmation of the change to avoid multiple submissions before the end of the operation. | Use Case |
|
UC9.txt | Use case name RICERCAPUNTIDIRISTORO
Returns the list of points of rest in the system according to certain parameters.
Partecipating
Actor
Entry
conditions
Flow of events User System
1. Activate the search functionality of a point of rest.
2 Show the form for research.
3 Fill in the search form and submit.
4 Processing the request.
Exit conditions • The system returns a list of points of rest which meet your search criteria.
• Interruption of the connection to the server ETOUR.
Quality requirements • The system performs the operation in 15 seconds maximum | Use Case |
|
Autenticazione.txt | package unisa.gps.etour.control.GestioneUtentiRegistrati;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.sql.SQLException;
import unisa.gps.etour.bean.BeanTurista;
import unisa.gps.etour.repository.DBTurista;
import unisa.gps.etour.util.ControlloDati;
import unisa.gps.etour.util.MessaggiErrore;
public class Authentication extends UnicastRemoteObject implements IAutenticazione
(
private static final long serialVersionUID = 0L;
public Authentication () throws RemoteException
(
super ();
)
/ / Objects to manipulate data Turista
Private DBTurista tourist DBTurista = new ();
Private BeanTurista bTurista;
public int login (String pUsername, String pPassword, byte pTipologiaUtente)
throws RemoteException
(
/ / Check if the string username and password
if (ControlloDati.controllaStringa (pUsername, true, true, "_-", null,
6, 12)
& & ControlloDati.controllaStringa (pPassword, true, true, "_-",
null, 5, 12))
TRY
(
switch (pTipologiaUtente)
(
/ / If the type is Turista
VISITORS homes:
/ / Invoke the method to obtain the Bean del Turista
/ / Given the username
bTurista = turista.ottieniTurista (pUsername);
/ / Check that the Bean is not null and
/ / Passwords match
if (bTurista = null
BTurista.getPassword & & (). Equals (pPassword))
bTurista.getId return ();
/ / If the type and eateries
homes OP_PUNTO_DI_RISTORO:
/ / Not implemented was the operational point of
/ / Refreshment
return -1;
/ / If not match any known type
default:
return -1;
)
)
catch (SQLException e)
(
throw new RemoteException (
MessaggiErrore.ERRORE_DBMS);
)
catch (Exception e) (
throw new RemoteException (MessaggiErrore.ERRORE_SCONOSCIUTO);
)
/ / If the data are incorrect returns -1
return -1;
)
) | Code |
|
Banner.txt | package unisa.gps.etour.gui.operatoreagenzia;
import java.awt .*;
import java.awt.event .*;
import java.io.FileNotFoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import javax.swing .*;
import java.util .*;
import javax.swing.tree .*;
import javax.swing.border .*;
import unisa.gps.etour.gui.operatoreagenzia.BannerDialog;
import unisa.gps.etour.gui.operatoreagenzia.Home;
import unisa.gps.etour.gui.operatoreagenzia.TagPanel;
import unisa.gps.etour.gui.operatoreagenzia.tables.BannerNode;
import unisa.gps.etour.gui.operatoreagenzia.tables.PRNode;
import unisa.gps.etour.bean.BeanBanner;
import unisa.gps.etour.bean.BeanPuntoDiRistoro;
import unisa.gps.etour.bean.BeanTag;
import unisa.gps.etour.control.GestioneAdvertisement.IGestioneAdvertisementAgenzia;
import unisa.gps.etour.control.GestionePuntiDiRistoro.IGestionePuntiDiRistoroAgenzia;
import unisa.gps.etour.control.GestioneTag.IGestioneTagComune;
import unisa.gps.etour.gui.DeskManager;
import unisa.gps.etour.gui.HelpManager;
import unisa.gps.etour.gui.operatoreagenzia.tables.BannerRenderer;
public class JInternalFrame extends Banner
(
private JPanel jContentPane = null;
private JPanel rightPanel = null;
Private JToolBar bannerToolbar = null;
private JButton btnInserisci = null;
private JButton btnSostituisci = null;
private JButton btnElimina = null;
private JScrollPane JScrollPane = null;
private JPanel helpPanel = null;
private JTextPane textGuida = null;
Private TagPanel panelTag = null;
private JButton btnRicerca = null;
private JButton btnAzzera = null;
private JPanel panelSearch = null;
private JTextField nomePR = null;
private JTree treeBanner = null;
Private JDesktopPane JDesktopPane;
Private HelpManager bannerHelp;
protected DeskManager desktopManager;
protected IGestionePuntiDiRistoroAgenzia gestionePuntiRistoro;
protected IGestioneAdvertisementAgenzia gestioneBanner;
protected IGestioneTagComune tags;
/ **
* This ` the default constructor.
* /
public Banner ()
(
super ( "Banner");
resizable = true;
closable = true;
iconable = true;
maximizable = true;
setPreferredSize (Home.CHILD_SIZE);
frameIcon = new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "banner2.png"));
/ / Setting up dell'help manager for cultural.
textGuida = new JTextPane ();
TRY
(
bannerHelp = new HelpManager (Home.URL_HELP + "Banner.txt"
textGuida);
)
catch (FileNotFoundException e)
(
textGuida
. setText ( "<html> <b> Help not available </ b> </ html>");
)
setContentPane (getJContentPane ());
addInternalFrameListener (new InternalFrameAdapter ()
(
/ *
* Inclusion of the frame on the desktop retrieves the bread
* Link to the desktop pane.
* /
public void internalFrameOpened (InternalFrameEvent pEvent)
(
PEvent.getInternalFrame JInternalFrame frame = ();
JDesktopPane frame.getDesktopPane = ();
desktopManager = (DeskManager) jDesktopPane.getDesktopManager ();
/ / Setting up of remote objects for the management of cultural heritage.
TRY
(
Registry reg = LocateRegistry.getRegistry (Home.HOST);
gestioneBanner =
(IGestioneAdvertisementAgenzia) reg.lookup (GestioneBeniCulturaliAgenzia ");
tag =
(IGestioneTagComune) reg.lookup (GestioneTagComune ");
gestionePuntiRistoro =
(IGestionePuntiDiRistoroAgenzia) reg.lookup (GestionePuntiDiRistoroAgenzia ");
/ / Load data.
createTree ();
caricaTags ();
)
/ *
* Two exceptions: RemoteException and NotBoundException. The
* Result is the same. The management is not operable and
* After the error message window closes.
* /
catch (Exception ex)
(
JLabel error = new JLabel (
"<html> <h2> Unable to communicate with the server eTour. </ h2>"
+ "<h3> <u> The dialog management request is closed. </ U> </ h3>"
+ "<p> <b> Possible Causes: </ b>"
+ "<ul> <li> No connection to the network. </ Li>"
+ "Server <li> inactive. </ Li>"
+ "Server <li> clogged. </ Li> </ ul>"
+ "<p> Please try again later. </ P>"
+ "<p> If the error persists, please contact technical support. </ P>"
+ "<p> We apologize for the inconvenience. </ Html>");
Err = new ImageIcon ImageIcon (getClass (). GetResource (
Home.URL_IMAGES + "error48.png"));
JOptionPane.showMessageDialog (JDesktopPane, error,
"Error!" JOptionPane.ERROR_MESSAGE, err);
frame.dispose ();
)
)
));
)
/ **
* This method initializes the content pane.
*
* @ Return javax.swing.JPanel - the content pane.
* /
private JPanel getJContentPane ()
(
if (null == jContentPane)
(
jContentPane = new JPanel ();
jContentPane.setLayout (new BorderLayout ());
jContentPane.add (getRightPanel (), BorderLayout.EAST);
jContentPane.add (getBannerToolbar (), BorderLayout.NORTH);
jContentPane.add (getTreeBanner (), BorderLayout.CENTER);
)
jContentPane return;
)
/ **
* This method initializes the toolbar to the functions of management
* Banner.
*
* @ Return javax.swing.JToolBar - the toolbar.
* /
Private JToolBar getBannerToolbar ()
(
if (null == bannerToolbar)
(
bannerToolbar JToolBar = new ();
bannerToolbar.setLayout (null);
bannerToolbar.setPreferredSize (new Dimension (1, 50));
bannerToolbar.setFloatable (false);
bannerToolbar.add (getBtnInserisci ());
bannerToolbar.add (getBtnSostituisci ());
bannerToolbar.add (getBtnElimina ());
)
bannerToolbar return;
)
/ **
* This method initializes the button to insert a banner.
*
* @ Return javax.swing.JButton - the button for the insertion.
* /
private JButton getBtnInserisci ()
(
if (null == btnInserisci)
(
btnInserisci = new JButton ();
btnInserisci.setBounds (5, 5, 140, 40);
btnInserisci.setText ( "<html> <br> Show Banner </ html>");
btnInserisci.setIcon (new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "NuovoBanner32.png ")));
btnInserisci.setEnabled (false);
btnInserisci.setName (btnInserisci ");
btnInserisci.addMouseListener (bannerHelp);
btnInserisci.addActionListener (new ActionListener ()
(
public void actionPerformed (ActionEvent arg0)
(
DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) treeBanner
. getSelectionPath (). getLastPathComponent ();
OpenDialog (selectedNode);
)
));
)
btnInserisci return;
)
/ **
* This method initializes the button for editing a banner.
*
* @ Return javax.swing.JButton - the button for the change.
* /
private JButton getBtnSostituisci ()
(
if (null == btnSostituisci)
(
btnSostituisci = new JButton ();
btnSostituisci.setBounds (155, 5, 140, 40);
btnSostituisci.setText ( "Replace <html> <br> Banner </ html>");
btnSostituisci.setEnabled (false);
btnSostituisci.setIcon (new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "SostituisciBanner32.png ")));
btnSostituisci.setName (btnSostituisci ");
btnSostituisci.addMouseListener (bannerHelp);
btnSostituisci.addActionListener (new ActionListener ()
(
public void actionPerformed (ActionEvent arg0)
(
DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) treeBanner
. getSelectionPath (). getLastPathComponent ();
OpenDialog (selectedNode);
)
));
)
btnSostituisci return;
)
/ **
* This method initializes the delete button for a banner.
*
* @ Return javax.swing.JButton - the delete button for.
* /
private JButton getBtnElimina ()
(
if (null == btnElimina)
(
btnElimina = new JButton ();
btnElimina.setBounds (305, 5, 140, 40);
btnElimina.setText ( "Delete <html> <br> Banner </ html>");
btnElimina.setEnabled (false);
btnElimina.setIcon (new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "EliminaBanner32.png ")));
btnElimina.setName (btnElimina ");
btnElimina.addMouseListener (bannerHelp);
btnElimina.addActionListener (new ActionListener ()
(
public void actionPerformed (ActionEvent arg0)
(
Root = new JPanel JPanel (new BorderLayout ());
JLabel message = new JLabel (
"Are you sure you want to delete the banner selected?");
message.setFont (new Font ( "Dialog", Font.BOLD, 14));
JLabel alert = new JLabel (
"The banner can not be more recovered."
SwingConstants.CENTER);
avviso.setIcon (new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "warning16.png ")));
root.add (message, BorderLayout.NORTH);
root.add (notice, BorderLayout.CENTER);
String [] options = ( "Delete", "Cancel");
int choice = JOptionPane.showInternalOptionDialog (
jContentPane, root, "Confirm Delete",
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE, new ImageIcon (
getClass (). getResource (
Home.URL_IMAGES
+ "EliminaBanner48.png")),
options, options [1]);
if (choice == JOptionPane.YES_OPTION)
(
DefaultTreeModel model = (DefaultTreeModel) treeBanner
. getModel ();
model
. removeNodeFromParent ((DefaultMutableTreeNode) treeBanner
. getSelectionPath ()
. getLastPathComponent ());
JLabel confirm = new JLabel ( "The banner selected"
+ "Was deleted.");
confirm.setFont (new Font ( "Dialog", Font.BOLD, 14));
JOptionPane.showInternalMessageDialog (jContentPane,
confirm, "Banner out!"
JOptionPane.OK_OPTION, new ImageIcon (getClass ()
. getResource (
Home.URL_IMAGES + "ok32.png ")));
)
)
));
)
btnElimina return;
)
/ **
* This method creates the tree starting from the information contained in the two
* ArrayList of bean.
*
* @ Param ArrayList PPR <BeanPuntoDiRistoro> - the array of places to eat.
* @ Param pBanner ArrayList <BeanBanner> - the array of banners associated.
* /
private void createTree ()
(
/ / Create the root
DefaultMutableTreeNode root = new DefaultMutableTreeNode ( "eTour");
/ / For each refreshment dell'arraylist calls the method get
/ / Banner.
TRY
(
ArrayList <BeanPuntoDiRistoro> PPR =
gestionePuntiRistoro.ottieniPuntiDiRistoro ();
for (int i = 0; i <pPR.size (); i + +)
(
BeanPuntoDiRistoro current = pPR.get (i);
int id = corrente.getId ();
PRNode puntoDiRistoro = new PRNode (corrente.getNome (), id);
HashMap <BeanBanner, ImageIcon> banner = gestioneBanner.ottieniBannersDaID (id);
Iterator <BeanBanner> iteraBanner = banner.keySet (). Iterator ();
while (iteraBanner.hasNext ())
(
BeanBanner bannercorrente = iteraBanner.next ();
BannerNode nuovoBanner = new BannerNode (banner
. get (bannercorrente) bannercorrente.getId ());
puntoDiRistoro.add (nuovoBanner);
)
root.add (puntoDiRistoro);
)
)
catch (RemoteException ex)
(
JLabel error = new JLabel (
"<html> <h2> Unable to communicate with the server eTour. </ h2>"
+ <h3> <u> The list of banners was not loaded. </ U> </ h3> "
+ "<p> Please try again later. </ P>"
+ "<p> If the error persists, please contact technical support. </ P>"
+ "<p> We apologize for the inconvenience. </ Html>");
Err = new ImageIcon ImageIcon (getClass (). GetResource (
Home.URL_IMAGES + "error48.png"));
JOptionPane.showInternalMessageDialog (this, error,
"Error!" JOptionPane.ERROR_MESSAGE, err);
)
finally
(
treeBanner.setModel (new DefaultTreeModel (root));
)
)
/ **
* This method initializes the tree where it displays the banner.
*
* @ Return javax.swing.JTree
* /
private JScrollPane getTreeBanner ()
(
if (null == treeBanner)
(
treeBanner = new JTree (new DefaultTreeModel (new DefaultMutableTreeNode ( ""))); eTour
treeBanner.setScrollsOnExpand (true);
treeBanner.setAutoscrolls (true);
treeBanner.setScrollsOnExpand (true);
treeBanner.getSelectionModel (). setSelectionMode (
TreeSelectionModel.SINGLE_TREE_SELECTION);
treeBanner.setName (treeBanner ");
treeBanner.addMouseListener (bannerHelp);
treeBanner.setRootVisible (false);
treeBanner.setCellRenderer (new BannerRenderer ());
treeBanner.addTreeSelectionListener (new TreeSelectionListener ()
(
public void ValueChanged (TreeSelectionEvent s)
(
DefaultMutableTreeNode node = (DefaultMutableTreeNode) treeBanner
. getLastSelectedPathComponent ();
if (node instanceof PRNode)
(
btnInserisci.setEnabled (true);
btnElimina.setEnabled (false);
btnSostituisci.setEnabled (false);
)
else if (node instanceof BannerNode)
(
btnInserisci.setEnabled (false);
btnSostituisci.setEnabled (true);
btnElimina.setEnabled (true);
)
else
(
btnInserisci.setEnabled (false);
btnSostituisci.setEnabled (false);
btnElimina.setEnabled (false);
)
)
));
)
JScrollPane = new JScrollPane (treeBanner);
JScrollPane
. setVerticalScrollBarPolicy (JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
JScrollPane return;
)
/ **
* This method initializes the right side panel.
*
* @ Return javax.swing.JPanel - the right panel.
* /
private JPanel getRightPanel ()
(
if (null == rightPanel)
(
rightPanel = new JPanel ();
rightPanel.setLayout (new GridBagLayout ());
GridBagConstraints g = new GridBagConstraints ();
g.gridx = 0;
g.gridy = 0;
g.fill = GridBagConstraints.BOTH;
g.weighty = 0.7;
rightPanel.add (getSearchPanel (), g);
g.gridy + +;
g.weighty = 0.3;
rightPanel.add (getHelpPanel (), g);
)
rightPanel return;
)
/ **
* This method initializes the panel that contains the online help.
*
* @ Return javax.swing.JPanel - the panel for the guide.
* /
private JPanel getHelpPanel ()
(
if (null == helpPanel)
(
helpPanel = new JPanel ();
helpPanel.setLayout (new BorderLayout ());
helpPanel.setBorder (BorderFactory.createTitledBorder (BorderFactory
. createLineBorder (new Color (51, 102, 255), 3),
"Help", TitledBorder.DEFAULT_JUSTIFICATION,
TitledBorder.DEFAULT_POSITION, new Font ( "Dialog",
Font.BOLD, 12), new Color (0, 102, 204)));
helpPanel.setPreferredSize (new Dimension (200, 60));
textGuida.setPreferredSize (new Dimension (6, 30));
textGuida.setOpaque (false);
textGuida.setContentType ( "text / html");
textGuida.setText ( "<html> Move your mouse pointer over a control" +
"of interest to display the context-sensitive help. </ html>");
textGuida.setEditable (false);
textGuida.setName (textGuida ");
textGuida.addMouseListener (bannerHelp);
helpPanel.add (textGuida, BorderLayout.CENTER);
)
helpPanel return;
)
/ **
* This method initializes the panel for the detection of points
* Refreshments.
*
* @ Return javax.swing.JPanel - the panel for research.
* /
private JPanel getSearchPanel ()
(
if (null == panelSearch)
(
panelSearch = new JPanel ();
panelSearch.setLayout (new GridBagLayout ());
panelSearch.setBorder (BorderFactory.createTitledBorder (
BorderFactory.createLineBorder (new Color (51, 102, 255), 3),
Research Refreshment "
TitledBorder.DEFAULT_JUSTIFICATION,
TitledBorder.DEFAULT_POSITION, new Font ( "Dialog",
Font.BOLD, 12), new Color (0, 102, 204)));
GridBagConstraints g = new GridBagConstraints ();
g.anchor = GridBagConstraints.CENTER;
g.gridx = 0;
g.gridy = 0;
g.gridwidth = 2;
g.insets = new Insets (5, 5, 5, 5);
panelSearch.add (new JLabel ( "Name Refreshments:"), g);
nomePR = new JTextField ();
nomePR.setName (nomePR ");
nomePR.addMouseListener (bannerHelp);
nomePR.setColumns (12);
g.insets = new Insets (5, 5, 10, 5);
g.gridy + +;
panelSearch.add (nomePR, g);
g.insets = new Insets (5, 5, 5, 5);
g.gridy + +;
panelSearch.add (new JLabel ( "Select search tags:"), g);
g.weighty = 1.0;
g.insets = new Insets (5, 5, 10, 5);
g.gridy + +;
panelTag = new TagPanel ();
panelTag.setName (pannelloTag ");
panelTag.addMouseListener (bannerHelp);
panelTag.setPreferredSize (new Dimension (180, 10));
g.fill = GridBagConstraints.VERTICAL;
panelSearch.add (panelTag, g);
g.fill = GridBagConstraints.NONE;
g.insets = new Insets (5, 5, 5, 5);
g.weighty = 0;
g.gridy + +;
g.gridwidth = 1;
panelSearch.add (getBtnRicerca (), g);
g.gridx + +;
panelSearch.add (getBtnAzzera (), g);
)
panelSearch return;
)
/ **
* This method initializes the button for the submission of the form
* Search for a refreshment.
*
* @ Return javax.swing.JButton - the search button.
* /
private JButton getBtnRicerca ()
(
if (null == btnRicerca)
(
btnRicerca = new JButton ();
btnRicerca.setPreferredSize (new Dimension (98, 26));
btnRicerca.setText ( "Search");
btnRicerca.setIcon (new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "Ricerca16.png ")));
btnRicerca.setName (btnRicerca ");
btnRicerca.addMouseListener (bannerHelp);
)
btnRicerca return;
)
/ **
* This method initializes the button to reset the fields of
* Search Form for a refreshment.
*
* @ Return javax.swing.JButton - the Reset button.
* /
private JButton getBtnAzzera ()
(
if (null == btnAzzera)
(
btnAzzera = new JButton ();
btnAzzera.setPreferredSize (new Dimension (98, 26));
btnAzzera.setIcon (new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "Azzera16.png ")));
btnAzzera.setText ( "Clear");
btnAzzera.setHorizontalTextPosition (SwingConstants.LEADING);
btnAzzera.setName (btnAzzera ");
btnAzzera.addMouseListener (bannerHelp);
btnAzzera.addActionListener (new ActionListener ()
(
public void actionPerformed (ActionEvent arg0)
(
panelTag.azzera ();
nomePR.setText ("");
)
));
)
btnAzzera return;
)
/ **
* This method opens the dialog box for entering a new
* Banner or editing a banner selected.
*
* @ Param pSelectedNode DefaultMutableTreeNode - the selected node.
* /
private void OpenDialog (DefaultMutableTreeNode pSelectedNode)
(
/ / This class intercepts mouse events and then
/ / Makes the frame below blocked.
class ModalAdapter extends InternalFrameAdapter
(
Component glass;
public ModalAdapter (Component pGlassComponent)
(
this.glass = pGlassComponent;
MouseInputAdapter adapter = new MouseInputAdapter ()
(
);
pGlassComponent.addMouseListener (adapter);
pGlassComponent.addMouseMotionListener (adapter);
)
public void internalFrameClosed (InternalFrameEvent s)
(
glass.setVisible (false);
)
)
/ / Construction of the dialog
JOptionPane optionPane = new JOptionPane ();
final JInternalFrame modal = optionPane.createInternalFrame (
JDesktopPane, "");
final JPanel glass = new JPanel ();
BannerDialog final BannerDialog dialog = new ();
optionPane.setMessage (dialogue);
optionPane.setMessageType (JOptionPane.INFORMATION_MESSAGE);
JButton [] options = new JButton [2];
options [0] = new JButton ();
options [1] = new JButton ( "Cancel");
options [0]. setIcon (new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "Salva16.png ")));
options [1]. setIcon (new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "Annulla16.png ")));
optionPane.setOptions (options);
options [1]. addActionListener (new ActionListener ()
(
public void actionPerformed (ActionEvent arg0)
(
modal.setVisible (false);
glass.setVisible (false);
)
));
glass.setOpaque (false);
modal.addInternalFrameListener (new ModalAdapter (glass));
glass.add (modal);
setGlassPane (glass);
modal.setLocation (this.getWidth () / 2, this.getHeight () / 2);
glass.setVisible (true);
modal.setVisible (true);
if (pSelectedNode instanceof BannerNode) / / Replace
(
final BannerNode banner = (BannerNode) pSelectedNode;
options [0]. setText ( "Replace");
options [0]. addActionListener (new ActionListener ()
(
public void actionPerformed (ActionEvent arg0)
(
DefaultTreeModel model = (DefaultTreeModel) treeBanner
. getModel ();
banner.setBanner (dialogo.getSelectedBanner ());
model.nodeChanged (banner);
glass.setVisible (false);
modal.setVisible (false);
)
));
optionPane.setIcon (new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "SostituisciBanner48.png ")));
modal.setTitle ( "Replace the banner to the point of relief"
+ ((PRNode) pSelectedNode.getParent ()). GetUserObject ()
. toString ());
)
else if (pSelectedNode instanceof PRNode) / / Inserting
(
PRNode final pr = (PRNode) pSelectedNode;
options [0]. setText ( "Save");
options [0]. addActionListener (new ActionListener ()
(
public void actionPerformed (ActionEvent arg0)
(
DefaultTreeModel model = (DefaultTreeModel) treeBanner
. getModel ();
BannerNode new = new BannerNode (dialogue
. getSelectedBanner (), pr.getID ());
model.insertNodeInto (new, pr, 0);
glass.setVisible (false);
modal.setVisible (false);
)
));
optionPane.setIcon (new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "nuovoBanner48.png ")));
modal.setTitle ( "Enter banner to the point of relief"
PSelectedNode.getUserObject + (). ToString ());
)
)
private void caricaTags ()
(
ArrayList <BeanTag> beanTags = null;
TRY
(
beanTags = tag.ottieniTags ();
)
/ / If an error displays an error message.
catch (RemoteException e)
(
)
finally
(
for (BeanTag b: beanTags)
(
panelTag.insertTag (b);
)
panelTag.repaint ();
)
)
) | Code |
|
BannerDialog.txt | package unisa.gps.etour.gui.operatoreagenzia;
import java.awt .*;
import java.awt.event .*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing .*;
import javax.swing.filechooser.FileFilter;
import javax.swing.border .*;
import unisa.gps.etour.gui.operatoreagenzia.Home;
/ **
* This class realizes the panel for the dialog for entering a
* New banner or a banner for replacing selected.
*
* @ Version 1.0
* @ Author Mario Gallo
*
* © 2007 eTour Project - Copyright by DMI SE @ SA Lab --
* University of Salerno
* /
public class JPanel extends BannerDialog
(
private final static Dimension bannerSize = new Dimension (140, 40);
private JLabel preview = null;
private JButton btnCarica = null;
private JPanel that;
/ **
* This is the default constructor.
* /
public BannerDialog ()
(
super (null);
this = this;
setPreferredSize (new Dimension (420, 160));
preview = new JLabel ();
anteprima.setBounds (new Rectangle (40, 20, 250, 60));
anteprima.setBorder (BorderFactory.createTitledBorder (BorderFactory
. createLineBorder (new Color (51, 102, 255), 3),
Preview Banner ", TitledBorder.DEFAULT_JUSTIFICATION,
TitledBorder.DEFAULT_POSITION,
new Font ( "Dialog", Font.BOLD, 12), new Color (0, 102, 204)));
btnCarica = new JButton ();
btnCarica.setBounds (new Rectangle (320, 30, 50, 40));
btnCarica.setIcon (new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "ApriFile.png ")));
btnCarica.addActionListener (new ActionListener ()
(
public void actionPerformed (ActionEvent arg0)
(
File f = apriFileDialog ();
if (f == null)
(
return;
)
BufferedImage img = null;
TRY
(
img = ImageIO.read (f);
if (img.getWidth ()> bannerSize.width
| | Img.getHeight ()> bannerSize.height)
(
img.getSubimage img = (0, 0, bannerSize.width,
bannerSize.height);
)
)
catch (Exception e)
(
e.printStackTrace ();
)
N = new ImageIcon ImageIcon (img);
anteprima.setIcon (n);
anteprima.repaint ();
)
));
JLabel txtAttenzione = new JLabel ( "Warning!");
txtAttenzione.setIcon (new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "warning16.png ")));
txtAttenzione.setBounds (10, 85, 100, 30);
JLabel txtTest = new JLabel (
"<html> <ul> <li> image for the banner can not exceed <b> <font color=\"red\">"
+ BannerSize.width
+ "X"
+ BannerSize.height
+ "</ Font> </ b> pixels."
+ "<li> Images of magnitude larger will be resized. </ Ul> </ html>");
txtTesto.setBounds (0, 90, 420, 80);
add (txtTest, null);
add (txtAttenzione, null);
add (prev, null);
add (btnCarica, null);
)
/ **
* This method initializes the image contained in the preview.
*
* @ Param pBanner ImageIcon - an image of a banner.
* /
public void setSelectedBanner (ImageIcon pBanner)
(
anteprima.setIcon (pBanner);
)
/ **
* This method returns the image contained in the preview.
*
* @ Return ImageIcon - the image of the banner.
* /
public ImageIcon getSelectedBanner ()
(
return (ImageIcon) anteprima.getIcon ();
)
/ **
* This method opens the dialog for selecting a file from disk.
*
* @ Return
* <ul>
* <li> Files - the selected file.
* <li> Null - if you have not selected any files.
* </ Ul>
* /
private File apriFileDialog ()
(
JFileChooser apriFile = new JFileChooser ();
apriFile.setDialogTitle ( "Select a new image");
apriFile.setAcceptAllFileFilterUsed (false);
apriFile.setMultiSelectionEnabled (false);
/ / File Filter for the window to open the file.
apriFile.setFileFilter (new FileFilter ()
(
public boolean accept (File arg0)
(
if (arg0.isDirectory ())
return true;
String name = arg0.getName (). ToLowerCase ();
if (nome.endsWith ( "jpg") | | nome.endsWith ( "gif")
| | Nome.endsWith ( "png"))
return true;
else
return false;
)
public String getDescription ()
(
return "Images (*. PNG, *. GIF, *. JPG)";
)
));
int returnVal = apriFile.showOpenDialog (this);
if (returnVal == JFileChooser.APPROVE_OPTION)
(
apriFile.getSelectedFile return ();
)
else
return null;
)
) | Code |
|
BannerNode.txt | package unisa.gps.etour.gui.operatoreagenzia.tables;
import javax.swing.ImageIcon;
import javax.swing.tree.DefaultMutableTreeNode;
/ **
* This class creates a node in a JTree to store
* Information about a banner.
*
* @ Version 1.0
* @ Author Mario Gallo
*
* © 2007 eTour Project - Copyright by DMI SE @ SA Lab --
* University of Salerno
* /
public class DefaultMutableTreeNode extends BannerNode
(
private int id;
/ **
* This is the default constructor.
*
* /
public BannerNode ()
(
super ();
)
/ **
* Create a node with the image of the banner and
* Your id supplied as parameters.
*
* @ Param pBanner Imagelcon - the image of the banner.
PID * @ param int - the id of the banner.
* @ Throws IllegalArgumentException - if the image provided as input is invalid.
*
* /
public BannerNode (ImageIcon pBanner, int pid) throws IllegalArgumentException
(
super ();
if (null == pBanner)
(
throw new IllegalArgumentException ( "Image is invalid.");
)
setUserObject (pBanner);
id = pid;
)
/ **
*
* Returns the node type PRNode father.
*
* @ Return PRNode - the parent node.
*
* /
public PRNode getParent ()
(
return (PRNode) super.getParent ();
)
/ **
*
* Returns the id of the banner for which information
* Are stored in this node.
*
* @ Return int - the id of the banner.
*
* /
public int getID ()
(
return id;
)
/ **
*
* Stores the id of the banner supplied input.
*
* @ Param int PID - an ID of a banner.
*
* /
public void setID (int pid)
(
id = pid;
)
/ **
*
* Returns the banner image.
*
* @ Return ImageIcon - the image.
* /
public ImageIcon getBanner ()
(
return (ImageIcon) getUserObject ();
)
/ **
*
* Save the image provided as input.
*
* @ Param pImmagine Imagelcon - the image to be stored.
* @ Throws IllegalArgumentException - if the supplied parameter is null.
* /
public void setBanner (ImageIcon pImmagine) throws IllegalArgumentException
(
if (null == pImmagine)
(
throw new IllegalArgumentException ( "Image is invalid.");
)
setUserObject (pImmagine);
)
) | Code |
|
BannerRenderer.txt | package unisa.gps.etour.gui.operatoreagenzia.tables;
import java.awt.Color;
import java.awt.Component;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer;
public class BannerRenderer extends DefaultTreeCellRenderer
(
public Component getTreeCellRendererComponent (pTree JTree, Object pValue,
pSelected boolean, boolean pExpanded, boolean pLeaf, int prow,
boolean pHasFocus)
(
Object obj = ((DefaultMutableTreeNode) pValue). GetUserObject ();
if ((object instanceof ImageIcon))
(
throw new IllegalArgumentException ( "Value cell unexpected.");
)
ImageIcon image = (ImageIcon) object;
JLabel aLabel = new JLabel ();
aLabel.setIcon (image);
aLabel.setSize (immagine.getIconWidth () + 10, image
. getIconHeight () + 10);
if (pSelected)
(
aLabel.setBorder (BorderFactory.createLineBorder (Color.red, 2));
)
aLabel return;
)
) | Code |
|
BeanBanner.txt | package unisa.gps.etour.bean;
/ **
* Bean which contains data on the Banner
*
* @ Author Mauro Miranda
* @ Version 0.1 2007 eTour Project - Copyright by SE @ SA Lab DMI University
* Of Salerno
* /
import java.io.Serializable;
public class BeanBanner implements Serializable
(
private static final long serialVersionUID =-872783211721655763L;
private int id;
private int idPuntoDiRistoro;
private String filepath;
/ **
* Parameterized constructor
*
* @ Param pId
* @ Param pPercorsoFile
* @ Param pidPuntoDiRistoro
* /
public BeanBanner (int pid, String pPercorsoFile, int pidPuntoDiRistoro)
(
setId (PID);
setPercorsoFile (pPercorsoFile);
setIdPuntoDiRistoro (pidPuntoDiRistoro);
)
/ **
* Empty Constructor
*
* /
public BeanBanner ()
(
)
/ **
* Returns the value of FilePath
*
* @ Return value of FilePath.
* /
public String getPercorsoFile ()
(
return filepath;
)
/ **
* Sets the new value of filepath
*
* @ Param pPercorsoFile New value filepath.
* /
public void setPercorsoFile (String pPercorsoFile)
(
filepath = pPercorsoFile;
)
/ **
* Returns the value of id
*
* @ Return value id.
* /
public int getId ()
(
return id;
)
/ **
* Returns the value of idPuntoDiRistoro
*
* @ Return value idPuntoDiRistoro.
* /
public int getIdPuntoDiRistoro ()
(
idPuntoDiRistoro return;
)
/ **
* Sets the new value of id
*
* @ Param pId New value for id.
* /
public void setId (int pid)
(
id = pid;
)
/ **
* Sets the new value of idPuntoDiRistoro
*
* @ Param value pIdPuntoDiRistoro New idPuntoDiRistoro.
* /
public void setIdPuntoDiRistoro (int pIdPuntoDiRistoro)
(
idPuntoDiRistoro = pIdPuntoDiRistoro;
)
) | Code |
|
BeanBeneCulturale.txt | package unisa.gps.etour.bean;
/ **
* Bean containing information relating to a cultural heritage
*
* @ Author Mauro Miranda
* @ Version 0.1 2007 eTour Project - Copyright by SE @ SA Lab DMI University
* Of Salerno
* /
import java.io.Serializable;
import java.util.Date;
import unisa.gps.etour.util.Punto3D;
public class BeanBeneCulturale implements Serializable
(
private static final long serialVersionUID =-460705346474984466L;
private int id;
private int numeroVoti;
private String name;
private String city;
private String phone;
private String description;
private String location;
private String street;
private String cap;
private String province;
private String giornoChiusura;
Private Punto3D position;
private Date orarioApertura;
private Date orarioChiusura;
private double costoBiglietto;
private double mediaVoti;
/ **
* Parameterized constructor
*
* @ Param pId
* @ Param pNumeroVoti
* @ Param Pnom
* @ Param pCitta
* @ Param pTelefono
* @ Param pDescrizione
* @ Param pLocalita
* @ Param pVia
* @ Param pcap
* @ Param pProvincia
* @ Param pPosizione
* @ Param pOrarioApertura
* @ Param pOrarioChiusura
* @ Param pGiornoChiusura
* @ Param pCostoBiglietto
* @ Param pMediaVoti
* /
public BeanBeneCulturale (int pid, int pNumeroVoti, String Pnom,
PCitta String, String pTelefono, String pDescrizione,
PLocalita String, String pVia, pcap String, String pProvincia,
Punto3D pPosizione, Date pOrarioApertura, Date pOrarioChiusura,
String pGiornoChiusura, double pCostoBiglietto, double pMediaVoti)
(
setId (PID);
setNumeroVoti (pNumeroVoti);
setNome (Phnom);
setCitta (pCitta);
setTelefono (pTelefono);
setDescrizione (pDescrizione);
setlocale (pLocalita);
setvar (pVia);
setCap (PCAP);
setProvincia (pProvincia);
setPosizione (pPosizione);
setOrarioApertura (pOrarioApertura);
setOrarioChiusura (pOrarioChiusura);
setGiornoChiusura (pGiornoChiusura);
setCostoBiglietto (pCostoBiglietto);
setMediaVoti (pMediaVoti);
)
/ **
* Empty Constructor
* /
public BeanBeneCulturale ()
(
)
/ **
* Returns the value of giornoChiusura
*
* @ Return value giornoChiusura.
* /
public String getGiornoChiusura ()
(
giornoChiusura return;
)
/ **
* Sets the new value of giornoChiusura
*
* @ Param value pGiornoChiusura New giornoChiusura.
* /
public void setGiornoChiusura (String pGiornoChiusura)
(
giornoChiusura = pGiornoChiusura;
)
/ **
* Returns the value of cap
*
* @ Return value cap.
* /
public String getCap ()
(
return cap;
)
/ **
* Sets the new value of cap
*
New pcap * @ param value cap.
* /
public void setCap (String PCAP)
(
ch = pcap;
)
/ **
* Returns the value of city
*
* @ Return Value of city.
* /
public String getCitta ()
(
return city;
)
/ **
* Sets the new value of city
*
* @ Param value New pCitta city.
* /
public void setCitta (String pCitta)
(
City = pCitta;
)
/ **
* Returns the value of costoBiglietto
*
* @ Return value costoBiglietto.
* /
public double getCostoBiglietto ()
(
costoBiglietto return;
)
/ **
* Sets the new value of costoBiglietto
*
* @ Param value pCostoBiglietto New costoBiglietto.
* /
public void setCostoBiglietto (double pCostoBiglietto)
(
costoBiglietto = pCostoBiglietto;
)
/ **
* Returns the value of description
*
* @ Return value of description.
* /
public String getDescrizione ()
(
return description;
)
/ **
* Sets the new value of description
*
* @ Param pDescrizione New value of description.
* /
public void setDescrizione (String pDescrizione)
(
description = pDescrizione;
)
/ **
* Returns the value of location
*
* @ Return locale values.
* /
public String getLocal ()
(
return location;
)
/ **
* Sets the new value of location
*
* @ Param pLocalita New locale values.
* /
public void setLocale (String pLocalita)
(
location = pLocalita;
)
/ **
* Returns the value of mediaVoti
*
* @ Return value mediaVoti.
* /
public double getMediaVoti ()
(
mediaVoti return;
)
/ **
* Sets the new value of mediaVoti
*
* @ Param value pMediaVoti New mediaVoti.
* /
public void setMediaVoti (double pMediaVoti)
(
mediaVoti = pMediaVoti;
)
/ **
* Returns the value of name
*
* @ Return value of name.
* /
public String getName ()
(
return name;
)
/ **
* Sets the new name value
*
* @ Param name New value Pnom.
* /
public void setNome (String Pnom)
(
name = Pnom;
)
/ **
* Returns the value of numeroVoti
*
* @ Return value numeroVoti.
* /
public int getNumeroVoti ()
(
numeroVoti return;
)
/ **
* Sets the new value of numeroVoti
*
* @ Param value pNumeroVoti New numeroVoti.
* /
public void setNumeroVoti (int pNumeroVoti)
(
numeroVoti = pNumeroVoti;
)
/ **
* Returns the value of orarioApertura
*
* @ Return value orarioApertura.
* /
public Date getOrarioApertura ()
(
orarioApertura return;
)
/ **
* Sets the new value of orarioApertura
*
* @ Param value pString New orarioApertura.
* /
public void setOrarioApertura (Date pString)
(
orarioApertura = pString;
)
/ **
* Returns the value of orarioChiusura
*
* @ Return value orarioChiusura.
* /
public Date getOrarioChiusura ()
(
orarioChiusura return;
)
/ **
* Sets the new value of orarioChiusura
*
* @ Param value pOrarioChiusura New orarioChiusura.
* /
public void setOrarioChiusura (Date pOrarioChiusura)
(
orarioChiusura = pOrarioChiusura;
)
/ **
* Returns the value of position
*
* @ Return value of position.
* /
public Punto3D getPosizione ()
(
return position;
)
/ **
* Sets the new position value
*
* @ Param pPosizione New position value.
* /
public void setPosizione (Punto3D pPosizione)
(
position = pPosizione;
)
/ **
* Returns the value of the province
*
* @ Return value of the province.
* /
public String getProvincia ()
(
return province;
)
/ **
* Sets the new value of the province
*
* @ Param pProvincia New value for the province.
* /
public void setProvincia (String pProvincia)
(
province = pProvincia;
)
/ **
* Returns the value of telephone
*
* @ Return Value of the phone.
* /
public String getTelefono ()
(
return phone;
)
/ **
* Sets the new value of telephone
*
* @ Param value New pTelefono phone.
* /
public void setTelefono (String pTelefono)
(
phone = pTelefono;
)
/ **
* Returns the value of street
*
* @ Return value on.
* /
public String getVar ()
(
return path;
)
/ **
* Sets the new value via
*
* @ Param value New pVia on.
* /
public void setvar (String pVia)
(
via = pVia;
)
/ **
* Returns the value of id
*
* @ Return value id.
* /
public int getId ()
(
return id;
)
/ **
* Sets the new value of id
*
* @ Param pId New value for id.
* /
public void setId (int pid)
(
id = pid;
)
) | Code |
|
BeanConvenzione.txt | package unisa.gps.etour.bean;
import java.io.Serializable;
import java.util.Date;
/ **
* Bean containing information relating to a Convention
*
* @ Author Joseph Martone
* @ Version 0.1 2007 eTour Project - Copyright by SE @ SA Lab DMI University
* Of Salerno
* /
public class BeanConvenzione implements Serializable
(
private static final long serialVersionUID =-3255500940680220001L;
private int id;
private int maxBanner;
private Date StartDate;
private Date EndDate;
private double price;
private boolean active;
private int idPuntoDiRistoro;
/ **
* Parameterized constructor
*
* @ Param pId
* @ Param pMaxBanner
* @ Param pDataInizio
* @ Param pDataFine
* @ Param pPrezzo
* @ Param pacts
* @ Param pidPuntoDiRistoro
* /
public BeanConvenzione (int pid, int pMaxBanner, Date pDataInizio,
Date pDataFine, double pPrezzo, boolean terms,
int pidPuntoDiRistoro)
(
setId (PID);
setMaxBanner (pMaxBanner);
setDataInizio (pDataInizio);
setDataFine (pDataFine);
setPrezzo (pPrezzo);
setAttiva (Patti);
setIdPuntoDiRistoro (pidPuntoDiRistoro);
)
/ **
* Empty Constructor
*
* /
public BeanConvenzione ()
(
)
/ **
* Returns the value of active
*
* @ Return value of assets.
* /
public boolean isAttiva ()
(
return active;
)
/ **
* Sets the new value of active
*
* @ Param new value terms of assets.
* /
public void setAttiva (boolean Patti)
(
active = Pact;
)
/ **
* Returns the value of EndDate
*
* @ Return Value EndDate.
* /
public Date getDataFine ()
(
EndDate return;
)
/ **
* Sets the new value for EndDate
*
* @ Param pDataFine New value for EndDate.
* /
public void setDataFine (Date pDataFine)
(
EndDate = pDataFine;
)
/ **
* Returns the value of StartDate
*
* @ Return value StartDate.
* /
public Date getDataInizio ()
(
StartDate return;
)
/ **
* Sets the new value of StartDate
*
* @ Param new value pDataInizio StartDate.
* /
public void setDataInizio (Date pDataInizio)
(
StartDate = pDataInizio;
)
/ **
* Returns the value of maxBanner
*
* @ Return value maxBanner.
* /
public int getMaxBanner ()
(
maxBanner return;
)
/ **
* Sets the new value of maxBanner
*
* @ Param value pMaxBanner New maxBanner.
* /
public void setMaxBanner (int pMaxBanner)
(
maxBanner = pMaxBanner;
)
/ **
* Returns the value of money
*
* @ Return value price.
* /
public double getPrezzo ()
(
return price;
)
/ **
* Sets the new value of money
*
* @ Param pPrezzo New value for money.
* /
public void setPrezzo (double pPrezzo)
(
Price = pPrezzo;
)
/ **
* Returns the value of id
*
* @ Return value id.
* /
public int getId ()
(
return id;
)
/ **
* Returns the value of idPuntoDiRistoro
*
* @ Return value idPuntoDiRistoro.
* /
public int getIdPuntoDiRistoro ()
(
idPuntoDiRistoro return;
)
/ **
* Sets the new value of id
*
* @ Param pId New value for id.
* /
public void setId (int pid)
(
id = pid;
)
/ **
* Sets the new value of idPuntoDiRistoro
*
* @ Param value pIdPuntoDiRistoro New idPuntoDiRistoro.
* /
public void setIdPuntoDiRistoro (int pIdPuntoDiRistoro)
(
idPuntoDiRistoro = pIdPuntoDiRistoro;
)
) | Code |
|
BeanMenu.txt | package unisa.gps.etour.bean;
import java.io.Serializable;
/ **
* Bean containing information relating to a Menu
*
* @ Author Joseph Martone
* @ Version 0.1 2007 eTour Project - Copyright by SE @ SA Lab DMI University
* Of Salerno
* /
public class BeanMenu implements Serializable
(
private static final long serialVersionUID =-3112032222839565409L;
private int id;
private String day;
private int idPuntoDiRistoro;
/ **
* Parameterized constructor
*
* @ Param pId
* @ Param pGiorno
* @ Param pIdPuntoDiRistoro
* /
public BeanMenu (int pid, String pGiorno, int pIdPuntoDiRistoro)
(
setId (PID);
setGiorno (pGiorno);
setIdPuntoDiRistoro (pIdPuntoDiRistoro);
)
/ **
* Empty Constructor
* /
public BeanMenu ()
(
)
/ **
* Returns the value of days
*
* @ Return Value of the day.
* /
public String getGiorno ()
(
return day
)
/ **
* Sets the new value of days
*
* @ Param value New pGiorno day.
* /
public void setGiorno (String pGiorno)
(
day = pGiorno;
)
/ **
* Returns the value of id
*
* @ Return value id.
* /
public int getId ()
(
return id;
)
/ **
* Returns the value of idPuntoDiRistoro
*
* @ Return value idPuntoDiRistoro.
* /
public int getIdPuntoDiRistoro ()
(
idPuntoDiRistoro return;
)
/ **
* Sets the new value of id
*
* @ Param pId New value for id.
* /
public void setId (int pid)
(
id = pid;
)
/ **
* Sets the new value of idPuntoDiRistoro
*
* @ Param value pIdPuntoDiRistoro New idPuntoDiRistoro.
* /
public void setIdPuntoDiRistoro (int pIdPuntoDiRistoro)
(
idPuntoDiRistoro = pIdPuntoDiRistoro;
)
)
| Code |
|
BeanNews.txt | package unisa.gps.etour.bean;
/ **
* Bean containing information relating to the News
*
* @ Author Mauro Miranda
* @ Version 0.1 2007 eTour Project - Copyright by SE @ SA Lab DMI University
* Of Salerno
* /
import java.io.Serializable;
import java.util.Date;
public class BeanNews implements Serializable
(
private String news;
private Date dataPubblicazione;
private Date dataScadenza;
private int priority;
private int id;
private static final long serialVersionUID =-6249491056436689386L;
/ **
* Parameterized constructor
*
* @ Param Pnews
* @ Param pDataPubblicazione
* @ Param pDataScadenza
* @ Param pPriorita
* @ Param pId
* /
public BeanNews (String Pnews, Date pDataPubblicazione, Date pDataScadenza,
pPriorita int, int pid)
(
setNews (Pnews);
setDataPubblicazione (pDataPubblicazione);
setDataScadenza (pDataScadenza);
setPriorita (pPriorita);
setId (PID);
)
/ **
* Empty Constructor
*
* /
public BeanNews ()
(
)
/ **
* Returns the value of dataPubblicazione
*
* @ Return value dataPubblicazione.
* /
public Date getDataPubblicazione ()
(
dataPubblicazione return;
)
/ **
* Sets the new value of dataPubblicazione
*
* @ Param value pDataPubblicazione New dataPubblicazione.
* /
public void setDataPubblicazione (Date pDataPubblicazione)
(
dataPubblicazione = pDataPubblicazione;
)
/ **
* Returns the value of dataScadenza
*
* @ Return value dataScadenza.
* /
public Date getDataScadenza ()
(
dataScadenza return;
)
/ **
* Sets the new value of dataScadenza
*
* @ Param value pDataScadenza New dataScadenza.
* /
public void setDataScadenza (Date pDataScadenza)
(
dataScadenza = pDataScadenza;
)
/ **
* Returns the value of news
*
* @ Return value of news.
* /
public String getNews ()
(
return news;
)
/ **
* Sets the new value of news
*
* @ Param value New Pnews news.
* /
public void setNews (String Pnews)
(
news = Pnews;
)
/ **
* Returns the priority value
*
* @ Return the priority value.
* /
public int getPriorita ()
(
return priority;
)
/ **
* Set the new priority value
*
* @ Param pPriorita New priority value.
* /
public void setPriorita (int pPriorita)
(
Priority = pPriorita;
)
/ **
* Returns the value of id
*
* @ Return value id.
* /
public int getId ()
(
return id;
)
/ **
* Sets the new value of id
*
* @ Param pId New value for id.
* /
public void setId (int pid)
(
id = pid;
)
) | Code |
|
BeanOperatoreAgenzia.txt | package unisa.gps.etour.bean;
import java.io.Serializable;
/ **
* Bean containing information relating to an Agency Operator
*
* @ Author Joseph Martone
* @ Version 0.1 2007 eTour Project - Copyright by SE @ SA Lab DMI University
* Of Salerno
* /
public class BeanOperatoreAgenzia implements Serializable
(
/ **
*
* /
private static final long serialVersionUID =-3489147679484477440L;
private int id;
private String username;
private String name;
private String name;
private String password;
/ **
* Parameterized constructor
*
* @ Param pid
* @ Param pUsername
* @ Param Pnom
* @ Param pCognome
* @ Param pPassword
* /
public BeanOperatoreAgenzia (int pid, String pUsername, String Pnom,
PCognome String, String pPassword)
(
setId (pid);
setUsername (pUsername);
setNome (Phnom);
setCognome (pCognome);
setPassword (pPassword);
)
/ **
* Empty Constructor
* /
public BeanOperatoreAgenzia ()
(
)
/ **
* Returns the value of name
*
* @ Return value of name.
* /
public String getCognome ()
(
return name;
)
/ **
* Sets the new value of name
*
* @ Param value New pCognome surname.
* /
public void setCognome (String pCognome)
(
last = pCognome;
)
/ **
* Returns the value of name
*
* @ Return value of name.
* /
public String getName ()
(
return name;
)
/ **
* Sets the new name value
*
* @ Param name New value Pnom.
* /
public void setNome (String Pnom)
(
name = Pnom;
)
/ **
* Returns the value of password
*
* @ Return value of password.
* /
public String getPassword ()
(
return password;
)
/ **
* Sets the new password value
*
* @ Param pPassword new password value.
* /
public void setPassword (String pPassword)
(
password = pPassword;
)
/ **
* Returns the value of username
*
* @ Return value of username.
* /
public String GetUserName ()
(
return username;
)
/ **
* Sets the new value of username
*
* @ Param pUsername New value for username.
* /
public void setUsername (String pUsername)
(
username = pUsername;
)
/ **
* Sets the new value of id
*
* @ Param new value of id pid.
* /
public void setId (int pid)
(
id = pid;
)
/ **
* Returns the value of id
*
* @ Return value id.
* /
public int getId ()
(
return id;
)
) | Code |
|
BeanOperatorePuntoDiRistoro.txt | package unisa.gps.etour.bean;
import java.io.Serializable;
/ **
* Bean containing information relating to food
*
* @ Author Joseph Martone
* @ Version 0.1 2007 eTour Project - Copyright by SE @ SA Lab DMI University
* Of Salerno
* /
public class BeanOperatorePuntoDiRistoro implements Serializable
(
private int id;
private String name;
private String name;
private String username;
private String password;
private String email;
private int idPuntoDiRistoro;
private static final long serialVersionUID =-6485826396352557404L;
/ **
* Parameterized constructor
*
* @ Param pId
* @ Param Pnom
* @ Param pCognome
* @ Param pUsername
* @ Param pPassword
* @ Param pEmail
* @ Param pIdPuntoDiRistoro
* /
public BeanOperatorePuntoDiRistoro (int pid, Phnom String, String pCognome,
PUsername String, String pPassword, String pEmail,
int pIdPuntoDiRistoro)
(
setId (PID);
setNome (Phnom);
setCognome (pCognome);
setUsername (pUsername);
setPassword (pPassword);
setEmail (pEmail);
setIdPuntoDiRistoro (pIdPuntoDiRistoro);
)
/ **
* Empty Constructor
* /
public BeanOperatorePuntoDiRistoro ()
(
)
/ **
* Returns the value of name
*
* @ Return value of name.
* /
public String getCognome ()
(
return name;
)
/ **
* Sets the new value of name
*
* @ Param value New pCognome surname.
* /
public void setCognome (String pCognome)
(
last = pCognome;
)
/ **
* Returns the value of email
*
* @ Return value of email.
* /
public String getEmail ()
(
return email;
)
/ **
* Sets the new value of email
*
* @ Param pEmail New value of email.
* /
public void setEmail (String pEmail)
(
email = pEmail;
)
/ **
* Returns the value of name
*
* @ Return value of name.
* /
public String getName ()
(
return name;
)
/ **
* Sets the new name value
*
* @ Param name New value Pnom.
* /
public void setNome (String Pnom)
(
name = Pnom;
)
/ **
* Returns the value of password
*
* @ Return value of password.
* /
public String getPassword ()
(
return password;
)
/ **
* Sets the new password value
*
* @ Param pPassword new password value.
* /
public void setPassword (String pPassword)
(
password = pPassword;
)
/ **
* Returns the value of username
*
* @ Return value of username.
* /
public String GetUserName ()
(
return username;
)
/ **
* Sets the new value of username
*
* @ Param pUsername New value for username.
* /
public void setUsername (String pUsername)
(
username = pUsername;
)
/ **
* Returns the value of idPuntoDiRistoro
*
* @ Return value idPuntoDiRistoro.
* /
public int getIdPuntoDiRistoro ()
(
idPuntoDiRistoro return;
)
/ **
* Sets the new value of idPuntoDiRistoro
*
* @ Param value pIdPuntoDiRistoro New idPuntoDiRistoro.
* /
public void setIdPuntoDiRistoro (int pIdPuntoDiRistoro)
(
idPuntoDiRistoro = pIdPuntoDiRistoro;
)
/ **
* Returns the value of id
*
* @ Return value id.
* /
public int getId ()
(
return id;
)
/ **
* Sets the new value of id
*
* @ Param pId New value for id.
* /
public void setId (int pid)
(
id = pid;
)
)
| Code |
|
BeanPiatto.txt | package unisa.gps.etour.bean;
import java.io.Serializable;
/ **
* Bean containing information relating to food
*
* @ Author Joseph Martone
* @ Version 0.1 2007 eTour Project - Copyright by SE @ SA Lab DMI University
* Of Salerno
* /
public class BeanPiatto implements Serializable
(
private int id;
private String name;
private double price;
private int idMenu;
private static final long serialVersionUID =-3775462843748984482L;
/ **
* Parameterized constructor
*
* @ Param pId
* @ Param Pnom
* @ Param pPrezzo
* @ Param pIdMenu
* /
public BeanPiatto (int pid, String Pnom, double pPrezzo, int pIdMenu)
(
setId (PID);
setNome (Phnom);
setPrezzo (pPrezzo);
setIdMenu (pIdMenu);
)
/ **
* Empty Constructor
* /
public BeanPiatto ()
(
)
/ **
* Returns the value of name
*
* @ Return value of name.
* /
public String getName ()
(
return name;
)
/ **
* Sets the new name value
*
* @ Param name New value Pnom.
* /
public void setNome (String Pnom)
(
name = Pnom;
)
/ **
* Returns the value of money
*
* @ Return value price.
* /
public double getPrezzo ()
(
return price;
)
/ **
* Sets the new value of money
*
* @ Param pPrezzo New value for money.
* /
public void setPrezzo (double pPrezzo)
(
Price = pPrezzo;
)
/ **
* Returns the value of id
*
* @ Return value id.
* /
public int getId ()
(
return id;
)
/ **
* Returns the value of idMenu
*
* @ Return value idMenu.
* /
public int getIdMenu ()
(
idMenu return;
)
/ **
* Sets the new value of id
*
* @ Param pId New value for id.
* /
public void setId (int pid)
(
id = pid;
)
/ **
* Sets the new value of idMenu
*
* @ Param value pIdMenu New idMenu.
* /
public void setIdMenu (int pIdMenu)
(
idMenu = pIdMenu;
)
) | Code |
|
BeanPreferenzaDiRicerca.txt | package unisa.gps.etour.bean;
import java.io.Serializable;
/ **
* Bean which contains data search preferences
*
* @ Author Joseph Martone
* @ Version 0.1 2007 eTour Project - Copyright by SE @ SA Lab DMI University
* Of Salerno
* /
public class BeanPreferenzaDiRicerca implements Serializable
(
private static final long serialVersionUID = 7576354037868937929L;
private int id;
private String name;
/ **
* Parameterized constructor
*
* @ Param pId
* @ Param Pnom
* /
public BeanPreferenzaDiRicerca (int pid, String Pnom)
(
setId (PID);
setNome (Phnom);
)
/ **
* Empty Constructor
*
* /
public BeanPreferenzaDiRicerca ()
(
)
/ **
* Returns the value of name
*
* @ Return value of name.
* /
public String getName ()
(
return name;
)
/ **
* Sets the new name value
*
* @ Param name New value Pnom.
* /
public void setNome (String Pnom)
(
name = Pnom;
)
/ **
* Returns the value of id
*
* @ Return value id.
* /
public int getId ()
(
return id;
)
/ **
* Sets the new value of id
*
* @ Param pId New value for id.
* /
public void setId (int pid)
(
id = pid;
)
)
| Code |
|
BeanPreferenzeGeneriche.txt | package unisa.gps.etour.bean;
/ **
* Bean containing information relating to the General Preferences
*
* @ Author Mauro Miranda
* @ Version 0.1 2007 eTour Project - Copyright by SE @ SA Lab DMI University
* Of Salerno
* /
import java.io.Serializable;
public class BeanPreferenzeGeneriche implements Serializable
(
private static final long serialVersionUID = 6805656922951334071L;
private int id;
private int dimensioneFont;
private String font;
private String subject;
private int idTurista;
/ **
* Parameterized constructor
*
* @ Param pId
* @ Param pDimensioneFont
* @ Param pFont
* @ Param pTema
* @ Param pIdTurista
* /
public BeanPreferenzeGeneriche (int pid, int pDimensioneFont, String pFont,
PTema String, int pIdTurista)
(
setId (PID);
setDimensioneFont (pDimensioneFont);
setFont (pFont);
September (pTema);
setIdTurista (pIdTurista);
)
/ **
* Empty Constructor
* /
public BeanPreferenzeGeneriche ()
(
)
/ **
* Returns the value of dimensioneFont
*
* @ Return value dimensioneFont.
* /
public int getDimensioneFont ()
(
dimensioneFont return;
)
/ **
* Sets the new value of dimensioneFont
*
* @ Param value pDimensioneFont New dimensioneFont.
* /
public void setDimensioneFont (int pDimensioneFont)
(
dimensioneFont = pDimensioneFont;
)
/ **
* Returns the value of font
*
* @ Return Value of fonts.
* /
public String getFont ()
(
return font;
)
/ **
* Sets the new value of font
*
New value * @ param pFont font.
* /
public void setFont (String pFont)
(
font = pFont;
)
/ **
* Returns the value of the subject
*
* @ Return value issue.
* /
public String getTema ()
(
return theme;
)
/ **
* Sets the new value of the subject
*
* @ Param value New pTema theme.
* /
public void September (String pTema)
(
topic = pTema;
)
/ **
* Returns the value of id
*
* @ Return value id.
* /
public int getId ()
(
return id;
)
/ **
* Returns the value of usernameTurista
*
* @ Return value usernameTurista.
* /
public int getIdTurista ()
(
idTurista return;
)
/ **
* Sets the new value of usernameTurista
*
* @ Param value pIdTurista New usernameTurista.
* /
public void setIdTurista (int pIdTurista)
(
idTurista = pIdTurista;
)
/ **
* Sets the new value of id
*
* @ Param pId New value for id.
* /
public void setId (int pid)
(
id = pid;
)
) | Code |
|
BeanPuntoDiRistoro.txt | package unisa.gps.etour.bean;
import java.io.Serializable;
import java.util.Date;
import unisa.gps.etour.util.Punto3D;
/ **
* Bean for the storage of data refreshment
*
* @ Author Joseph Martone
* @ Version 0.1 2007 eTour Project - Copyright by SE @ SA Lab DMI University
* Of Salerno
* /
public class BeanPuntoDiRistoro implements Serializable
(
private static final long serialVersionUID = 8417686685147484931L;
private int id;
private int numeroVoti;
private double mediaVoti;
private String name;
private String description;
private String phone;
private String location;
private String city;
private String street;
private String cap;
private String province;
private String PartitaIva;
Private Punto3D position;
private Date orarioApertura;
private Date orarioChiusura;
private String giornoChiusura;
/ **
* Parameterized constructor
*
* @ Param pId
* @ Param pNumeroVoti
* @ Param pMediaVoti
* @ Param Pnom
* @ Param pDescrizione
* @ Param pTelefono
* @ Param pLocalita
* @ Param pCitta
* @ Param pVia
* @ Param pcap
* @ Param pProvincia
* @ Param pPartitaIva
* @ Param pPosizione
* @ Param pOrarioApertura
* @ Param pOrarioChiusura
* @ Param pGiornoChiusura
* /
public BeanPuntoDiRistoro (int pid, int pNumeroVoti, double pMediaVoti,
Phnom String, String pDescrizione, String pTelefono,
PLocalita String, String pCitta, pVia String, String pcap,
PProvincia String, String pPartitaIva, Punto3D pPosizione,
Date pOrarioApertura, Date pOrarioChiusura, String pGiornoChiusura)
(
setId (PID);
setNumeroVoti (pNumeroVoti);
setMediaVoti (pMediaVoti);
setNome (Phnom);
setDescrizione (pDescrizione);
setTelefono (pTelefono);
setlocale (pLocalita);
setCitta (pCitta);
setvar (pVia);
setCap (PCAP);
setProvincia (pProvincia);
setPartitaIva (pPartitaIva);
setPosizione (pPosizione);
setOrarioApertura (pOrarioApertura);
setOrarioChiusura (pOrarioChiusura);
setGiornoChiusura (pGiornoChiusura);
)
/ **
* Empty Constructor
*
* /
public BeanPuntoDiRistoro ()
(
)
/ **
* Returns the value of cap
*
* @ Return value cap.
* /
public String getCap ()
(
return cap;
)
/ **
* Sets the new value of cap
*
New pcap * @ param value cap.
* /
public void setCap (String PCAP)
(
ch = pcap;
)
/ **
* Returns the value of city
*
* @ Return Value of city.
* /
public String getCitta ()
(
return city;
)
/ **
* Sets the new value of city
*
* @ Param value New pCitta city.
* /
public void setCitta (String pCitta)
(
City = pCitta;
)
/ **
* Returns the value of description
*
* @ Return value of description.
* /
public String getDescrizione ()
(
return description;
)
/ **
* Sets the new value of description
*
* @ Param pDescrizione New value of description.
* /
public void setDescrizione (String pDescrizione)
(
description = pDescrizione;
)
/ **
* Returns the value of giornoChiusura
*
* @ Return value giornoChiusura.
* /
public String getGiornoChiusura ()
(
giornoChiusura return;
)
/ **
* Sets the new value of giornoChiusura
*
* @ Param value pGiornoChiusura New giornoChiusura.
* /
public void setGiornoChiusura (String pGiornoChiusura)
(
giornoChiusura = pGiornoChiusura;
)
/ **
* Returns the value of location
*
* @ Return locale values.
* /
public String getLocal ()
(
return location;
)
/ **
* Sets the new value of location
*
* @ Param pLocalita New locale values.
* /
public void setLocale (String pLocalita)
(
location = pLocalita;
)
/ **
* Returns the value of mediaVoti
*
* @ Return value mediaVoti.
* /
public double getMediaVoti ()
(
mediaVoti return;
)
/ **
* Sets the new value of mediaVoti
*
* @ Param value pMediaVoti New mediaVoti.
* /
public void setMediaVoti (double pMediaVoti)
(
mediaVoti = pMediaVoti;
)
/ **
* Returns the value of name
*
* @ Return value of name.
* /
public String getName ()
(
return name;
)
/ **
* Sets the new name value
*
* @ Param name New value Pnom.
* /
public void setNome (String Pnom)
(
name = Pnom;
)
/ **
* Returns the value of numeroVoti
*
* @ Return value numeroVoti.
* /
public int getNumeroVoti ()
(
numeroVoti return;
)
/ **
* Sets the new value of numeroVoti
*
* @ Param value pNumeroVoti New numeroVoti.
* /
public void setNumeroVoti (int pNumeroVoti)
(
numeroVoti = pNumeroVoti;
)
/ **
* Returns the value of orarioApertura
*
* @ Return value orarioApertura.
* /
public Date getOrarioApertura ()
(
orarioApertura return;
)
/ **
* Sets the new value of orarioApertura
*
* @ Param value pOrarioApertura New orarioApertura.
* /
public void setOrarioApertura (Date pOrarioApertura)
(
orarioApertura = pOrarioApertura;
)
/ **
* Returns the value of orarioChiusura
*
* @ Return value orarioChiusura.
* /
public Date getOrarioChiusura ()
(
orarioChiusura return;
)
/ **
* Sets the new value of orarioChiusura
*
* @ Param value pOrarioChiusura New orarioChiusura.
* /
public void setOrarioChiusura (Date pOrarioChiusura)
(
orarioChiusura = pOrarioChiusura;
)
/ **
* Returns the value of PartitaIva
*
* @ Return value of a political party.
* /
public String getPartitaIva ()
(
PartitaIva return;
)
/ **
* Sets the new value of PartitaIva
*
* @ Param pPartitaIva New value of political parties.
* /
public void setPartitaIva (String pPartitaIva)
(
PartitaIva = pPartitaIva;
)
/ **
* Returns the value of position
*
* @ Return value of position.
* /
public Punto3D getPosizione ()
(
return position;
)
/ **
* Sets the new position value
*
* @ Param pPosizione New position value.
* /
public void setPosizione (Punto3D pPosizione)
(
position = pPosizione;
)
/ **
* Returns the value of the province
*
* @ Return value of the province.
* /
public String getProvincia ()
(
return province;
)
/ **
* Sets the new value of the province
*
* @ Param pProvincia New value for the province.
* /
public void setProvincia (String pProvincia)
(
province = pProvincia;
)
/ **
* Returns the value of telephone
*
* @ Return Value of the phone.
* /
public String getTelefono ()
(
return phone;
)
/ **
* Sets the new value of telephone
*
* @ Param value New pTelefono phone.
* /
public void setTelefono (String pTelefono)
(
phone = pTelefono;
)
/ **
* Returns the value of street
*
* @ Return value on.
* /
public String getVar ()
(
return path;
)
/ **
* Sets the new value via
*
* @ Param value New pVia on.
* /
public void setvar (String pVia)
(
via = pVia;
)
/ **
* Returns the value of id
*
* @ Return value id.
* /
public int getId ()
(
return id;
)
/ **
* Sets the new value of id
*
* @ Param pId New value for id.
* /
public void setId (int pid)
(
id = pid;
)
) | Code |
|
BeanTag.txt | package unisa.gps.etour.bean;
/ **
* Bean that contains the data for a Tag
*
* @ Author Mauro Miranda
* @ Version 0.1 2007 eTour Project - Copyright by SE @ SA Lab DMI University
* Of Salerno
* /
import java.io.Serializable;
public class BeanTag implements Serializable
(
private static final long serialVersionUID =-6320421006595188597L;
private int id;
private String name;
private String description;
/ **
* Parameterized constructor
*
* @ Param pId
* @ Param Pnom
* @ Param pDescrizione
* /
public BeanTag (int pid, Phnom String, String pDescrizione)
(
setId (PID);
setNome (Phnom);
setDescrizione (pDescrizione);
)
/ **
* Empty Constructor
* /
public BeanTag ()
(
)
/ **
* Returns the value of description
*
* @ Return value of description.
* /
public String getDescrizione ()
(
return description;
)
/ **
* Sets the new value of description
*
* @ Param pDescrizione New value of description.
* /
public void setDescrizione (String pDescrizione)
(
description = pDescrizione;
)
/ **
* Returns the value of name
*
* @ Return value of name.
* /
public String getName ()
(
return name;
)
/ **
* Sets the new value of name
*
* @ Param Phnom New value for name.
* /
public void setNome (String Pnom)
(
name = Pnom;
)
/ **
* Returns the value of id
*
* @ Return value id.
* /
public int getId ()
(
return id;
)
/ **
* Sets the new value of id
*
* @ Param pId New value for id.
* /
public void setId (int pid)
(
id = pid;
)
)
| Code |
|
BeanTurista.txt | package unisa.gps.etour.bean;
import java.io.Serializable;
import java.util.Date;
/ **
* Bean containing information relating to a tourist
*
* @ Author Mauro Miranda
* @ Version 0.1 2007 eTour Project - Copyright by SE @ SA Lab DMI University
* Of Salerno
* /
public class BeanTurista implements Serializable
(
private static final long serialVersionUID = 4214744963263090577L;
private int id;
private String username;
private String name;
private String name;
private String cittaNascita;
private String cittaResidenza;
private String phone;
private String cap;
private String street;
private String province;
private String email;
private String password;
private Date dob;
private Date dataRegistrazione;
private boolean active;
/ **
* Parameterized constructor
*
* @ Param pid
* @ Param pUsername
* @ Param Pnom
* @ Param pCognome
* @ Param pCittaNascita
* @ Param pCittaResidenza
* @ Param pTelefono
* @ Param pcap
* @ Param pVia
* @ Param pProvincia
* @ Param pEmail
* @ Param pPassword
* @ Param pDataNascita
* @ Param pDataRegistrazione
* @ Param pacts
* /
public BeanTurista (int pid, String pUsername, String Pnom,
PCognome String, String pCittaNascita, String pCittaResidenza,
PTelefono String, String pcap, pVia String, String pProvincia,
PEmail String, String pPassword, Date pDataNascita,
Date pDataRegistrazione, boolean Patti)
(
setId (pid);
setUsername (pUsername);
setNome (Phnom);
setCognome (pCognome);
setCittaNascita (pCittaNascita);
setCittaResidenza (pCittaResidenza);
setTelefono (pTelefono);
setCap (PCAP);
setvar (pVia);
setProvincia (pProvincia);
setEmail (pEmail);
setPassword (pPassword);
setDataNascita (pDataNascita);
setDataRegistrazione (pDataRegistrazione);
setAttiva (Patti);
)
/ **
* Empty Constructor
* /
public BeanTurista ()
(
)
/ **
* Returns the value of cap
*
* @ Return value cap.
* /
public String getCap ()
(
return cap;
)
/ **
* Sets the new value of cap
*
New pcap * @ param value cap.
* /
public void setCap (String PCAP)
(
ch = pcap;
)
/ **
* Returns the value of cittaNascita
*
* @ Return value cittaNascita.
* /
public String getCittaNascita ()
(
cittaNascita return;
)
/ **
* Sets the new value of cittaNascita
*
* @ Param value pCittaNascita New cittaNascita.
* /
public void setCittaNascita (String pCittaNascita)
(
cittaNascita = pCittaNascita;
)
/ **
* Returns the value of cittaResidenza
*
* @ Return value cittaResidenza.
* /
public String getCittaResidenza ()
(
cittaResidenza return;
)
/ **
* Sets the new value of cittaResidenza
*
* @ Param value pCittaResidenza New cittaResidenza.
* /
public void setCittaResidenza (String pCittaResidenza)
(
cittaResidenza = pCittaResidenza;
)
/ **
* Returns the value of name
*
* @ Return value of name.
* /
public String getCognome ()
(
return name;
)
/ **
* Sets the new value of name
*
* @ Param value New pCognome surname.
* /
public void setCognome (String pCognome)
(
last = pCognome;
)
/ **
* Returns the value of dob
*
* @ Return value dob.
* /
public Date getDataNascita ()
(
return dob;
)
/ **
* Sets the new value of dob
*
* @ Param value New pDataNascita dob.
* /
public void setDataNascita (Date pDataNascita)
(
dob = pDataNascita;
)
/ **
* Returns the value of dataRegistrazione
*
* @ Return value dataRegistrazione.
* /
public Date getDataRegistrazione ()
(
dataRegistrazione return;
)
/ **
* Sets the new value of dataRegistrazione
*
* @ Param value pDataRegistrazione New dataRegistrazione.
* /
public void setDataRegistrazione (Date pDataRegistrazione)
(
dataRegistrazione = pDataRegistrazione;
)
/ **
* Returns the value of email
*
* @ Return value of email.
* /
public String getEmail ()
(
return email;
)
/ **
* Sets the new value of email
*
* @ Param pEmail New value of email.
* /
public void setEmail (String pEmail)
(
email = pEmail;
)
/ **
* Returns the value of name
*
* @ Return value of name.
* /
public String getName ()
(
return name;
)
/ **
* Sets the new name value
*
* @ Param name New value Pnom.
* /
public void setNome (String Pnom)
(
name = Pnom;
)
/ **
* Returns the value of password
*
* @ Return value of password.
* /
public String getPassword ()
(
return password;
)
/ **
* Sets the new password value
*
* @ Param pPassword new password value.
* /
public void setPassword (String pPassword)
(
password = pPassword;
)
/ **
* Returns the value of the province
*
* @ Return value of the province.
* /
public String getProvincia ()
(
return province;
)
/ **
* Sets the new value of the province
*
* @ Param pProvincia New value for the province.
* /
public void setProvincia (String pProvincia)
(
province = pProvincia;
)
/ **
* Returns the value of telephone
*
* @ Return Value of the phone.
* /
public String getTelefono ()
(
return phone;
)
/ **
* Sets the new value of telephone
*
* @ Param value New pTelefono phone.
* /
public void setTelefono (String pTelefono)
(
phone = pTelefono;
)
/ **
* Returns the value of street
*
* @ Return value on.
* /
public String getVar ()
(
return path;
)
/ **
* Sets the new value via
*
* @ Param value New pVia on.
* /
public void setvar (String pVia)
(
via = pVia;
)
/ **
* Returns the value of username
*
* @ Return value of username.
* /
public String GetUserName ()
(
return username;
)
/ **
Returns to be 1 or 0, indicating whether a tourist or not
* Active
*
* @ Return value of activation
* /
public boolean isAttiva ()
(
return active;
)
/ **
* Sets the new value of active
*
* @ Param new value terms of assets.
* /
public void setAttiva (boolean Patti)
(
active = Pact;
)
/ **
* Sets the new value of username
*
* @ Param pUsername New value for username.
* /
public void setUsername (String pUsername)
(
username = pUsername;
)
/ **
* Sets the new value of id
*
* @ Param new value of id pid.
* /
public void setId (int pid)
(
id = pid;
)
/ **
* Returns the value of id
*
* @ Return value id.
* /
public int getId ()
(
return id;
)
) | Code |
|
BeanVisitaBC.txt | package unisa.gps.etour.bean;
import java.io.Serializable;
import java.util.Date;
/ **
* Bean containing information relating to the feedback of a cultural
*
* @ Author Joseph Martone
* @ Version 0.1 2007 eTour Project - Copyright by SE @ SA Lab DMI University
* Of Salerno
* /
public class BeanVisitaBC implements Serializable
(
private static final long serialVersionUID = 3331567128449243852L;
private int rating;
private int idBeneCulturale;
private String comment;
private int IdTurista;
private Date dataVisita;
/ **
* Parameterized constructor
*
* @ Param pVoto
* @ Param pIdBeneCulturale
* @ Param pCommento
* @ Param pIdTurista
* @ Param pDataVisita
* /
public BeanVisitaBC (pVoto int, int pIdBeneCulturale,
PCommento String, int pIdTurista, Date pDataVisita)
(
setVoto (pVoto);
setIdBeneCulturale (pIdBeneCulturale);
setCommento (pCommento);
setIdTurista (pIdTurista);
setDataVisita (pDataVisita);
)
/ **
* Empty Constructor
* /
public BeanVisitaBC ()
(
)
/ **
* Returns the value of comment
*
* @ Return value of comment.
* /
public String getCommento ()
(
return comment;
)
/ **
* Sets the new value of comment
*
* @ Param value New pCommento comment.
* /
public void setCommento (String pCommento)
(
comment = pCommento;
)
/ **
* Returns the value of dataVisita
*
* @ Return value dataVisita.
* /
public Date getDataVisita ()
(
dataVisita return;
)
/ **
* Sets the new value of dataVisita
*
* @ Param value pDataVisita New dataVisita.
* /
public void setDataVisita (Date pDataVisita)
(
dataVisita = pDataVisita;
)
/ **
* Returns the value of idBeneCulturale
*
* @ Return value idBeneCulturale.
* /
public int getIdBeneCulturale ()
(
idBeneCulturale return;
)
/ **
* Sets the new value of idBeneCulturale
*
* @ Param value pIdBeneCulturale New idBeneCulturale.
* /
public void setIdBeneCulturale (int pIdBeneCulturale)
(
idBeneCulturale = pIdBeneCulturale;
)
/ **
* Returns the value of IdTurista
*
* @ Return value IdTurista.
* /
public int getIdTurista ()
(
IdTurista return;
)
/ **
* Sets the new value of IdTurista
*
* @ Param value pIdTurista New IdTurista.
* /
public void setIdTurista (int pIdTurista)
(
IdTurista = pIdTurista;
)
/ **
* Returns the value of voting
*
* @ Return value of vote.
* /
public int getVoto ()
(
return rating;
)
/ **
* Sets the new value of voting
*
New value * @ param pVoto to vote.
* /
public void setVoto (int pVoto)
(
vote = pVoto;
)
)
| Code |
|
BeanVisitaPR.txt | package unisa.gps.etour.bean;
import java.io.Serializable;
import java.util.Date;
/ **
* Bean that contains the data for feedback to a refreshment
*
* @ Author Joseph Martone
* @ Version 0.1 2007 eTour Project - Copyright by SE @ SA Lab DMI University
* Of Salerno
* /
public class BeanVisitaPR implements Serializable
(
private static final long serialVersionUID =-4065240072283418782L;
private int rating;
private int idPuntoDiRistoro;
private String comment;
private int IdTurista;
private Date dataVisita;
/ **
* Parameterized constructor
*
* @ Param pVoto
* @ Param pIdPuntoDiRistoro
* @ Param pCommento
* @ Param pIdTurista
* @ Param pDataVisita
* /
public BeanVisitaPR (pVoto int, int pIdPuntoDiRistoro,
PCommento String, int pIdTurista, Date pDataVisita)
(
setVoto (pVoto);
setIdPuntoDiRistoro (pIdPuntoDiRistoro);
setCommento (pCommento);
setIdTurista (pIdTurista);
setDataVisita (pDataVisita);
)
/ **
* Empty Constructor
* /
public BeanVisitaPR ()
(
)
/ **
* Returns the value of comment
*
* @ Return value of comment.
* /
public String getCommento ()
(
return comment;
)
/ **
* Sets the new value of comment
*
* @ Param value New pCommento comment.
* /
public void setCommento (String pCommento)
(
comment = pCommento;
)
/ **
* Returns the value of dataVisita
*
* @ Return value dataVisita.
* /
public Date getDataVisita ()
(
dataVisita return;
)
/ **
* Sets the new value of dataVisita
*
* @ Param value pDataVisita New dataVisita.
* /
public void setDataVisita (Date pDataVisita)
(
dataVisita = pDataVisita;
)
/ **
* Returns the value of idPuntoDiRistoro
*
* @ Return value idPuntoDiRistoro.
* /
public int getIdPuntoDiRistoro ()
(
idPuntoDiRistoro return;
)
/ **
* Sets the new value of idPuntoDiRistoro
*
* @ Param value pIdPuntoDiRistoro New idPuntoDiRistoro.
* /
public void setIdPuntoDiRistoro (int pIdPuntoDiRistoro)
(
idPuntoDiRistoro = pIdPuntoDiRistoro;
)
/ **
* Returns the value of IdTurista
*
* @ Return value IdTurista.
* /
public int getIdTurista ()
(
IdTurista return;
)
/ **
* Sets the new value of IdTurista
*
* @ Param value pIdTurista New IdTurista.
* /
public void setIdTurista (int pIdTurista)
(
IdTurista = pIdTurista;
)
/ **
* Returns the value of voting
*
* @ Return value of vote.
* /
public int getVoto ()
(
return rating;
)
/ **
* Sets the new value of voting
*
New value * @ param pVoto to vote.
* /
public void setVoto (int pVoto)
(
vote = pVoto;
)
)
| Code |
|
BeniCulturali.txt |
package unisa.gps.etour.gui.operatoreagenzia;
import java.awt .*;
import java.awt.event .*;
import javax.swing .*;
import java.util .*;
import javax.swing.border .*;
import unisa.gps.etour.bean.BeanBeneCulturale;
import unisa.gps.etour.bean.BeanTag;
import unisa.gps.etour.control.GestioneBeniCulturali.IGestioneBeniCulturaliAgenzia;
import unisa.gps.etour.control.GestioneBeniCulturali.IGestioneBeniCulturaliComune;
import unisa.gps.etour.control.GestioneTag.IGestioneTagComune;
import unisa.gps.etour.gui.DeskManager;
import unisa.gps.etour.gui.HelpManager;
import unisa.gps.etour.gui.operatoreagenzia.tables.MediaVotiRenderer;
import unisa.gps.etour.gui.operatoreagenzia.tables.Punto3DRenderer;
import unisa.gps.etour.gui.operatoreagenzia.tables.ScrollableTable;
import unisa.gps.etour.gui.operatoreagenzia.tables.SitoTableModel;
import unisa.gps.etour.util.Punto3D;
import java.io.FileNotFoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.ArrayList;
/ **
* Class that implements the interface for the management of cultural side
* Operator Agency.
*
* @ Author Mario Gallo
* @ Version 0.8
* © 2007 eTour Project - Copyright by DMI SE @ SA Lab --
* University of Salerno
* /
public class JInternalFrame extends Beniculturali
(
Private JDesktopPane JDesktopPane;
private JPanel jContentPane = null;
Private JToolBar BCToolbar = null;
private JButton btnNuovoBC = null;
private JButton btnSchedaBC = null;
private JButton btnEliminaBC = null;
private JButton btnModificaBC = null;
private JPanel rightPanel = null;
private JPanel searchPanel = null;
private JPanel helpPanel = null;
private JScrollPane JScrollPane = null;
private JTable tableBC = null;
Private TagPanel pannelloTag = null;
private JTextPane textGuida = null;
private JTextField nomeBC = null;
private JButton btnRicerca = null;
private JButton btnAzzera = null;
Private DeskManager desktopManager;
<SchedaBC> private ArrayList children;
private SitoTableModel TableModel;
Private HelpManager bcHelp;
Private IGestioneBeniCulturaliAgenzia gestioneBC;
Private IGestioneTagComune tags;
protected IGestioneBeniCulturaliComune ricercaBC;
/ **
* This is the default constructor.
* /
public Beniculturali ()
(
super ( "Cultural Heritage");
setPreferredSize (Home.CHILD_SIZE);
frameIcon = new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "BC.png"));
setDefaultCloseOperation (JInternalFrame.DO_NOTHING_ON_CLOSE);
closable = true;
resizable = true;
iconable = true;
maximizable = true;
/ / Setting up dell'help manager for cultural.
textGuida = new JTextPane ();
TRY
(
bcHelp = new HelpManager (Home.URL_HELP + "BeniCulturali.txt"
textGuida);
)
catch (FileNotFoundException e)
(
textGuida
. setText ( "<html> <b> Help not available </ b> </ html>");
)
setContentPane (getJContentPane ());
<SchedaBC> children = new ArrayList ();
addInternalFrameListener (new InternalFrameAdapter ()
(
/ *
* Inclusion of the frame on the desktop desktop retrieves bread bread
* And desktop manager and initializes the remote objects
* Management of cultural heritage.
* /
public void internalFrameOpened (InternalFrameEvent pEvent)
(
PEvent.getInternalFrame JInternalFrame frame = ();
JDesktopPane frame.getDesktopPane = ();
desktopManager = (DeskManager) jDesktopPane.getDesktopManager ();
/ / Setting up objects for remote asset management
/ / Cultural.
TRY
(
Registry reg = LocateRegistry.getRegistry (Home.HOST);
gestioneBC = (IGestioneBeniCulturaliAgenzia) reg
. lookup ( "GestioneBeniCulturaliAgenzia");
tag = (IGestioneTagComune) reg.lookup (GestioneTagComune ");
ricercaBC = (IGestioneBeniCulturaliComune) reg
. lookup ( "GestioneBeniCulturaliComune");
/ / Load data.
caricaTabella (false);
caricaTags ();
)
/ *
* Two exceptions: RemoteException and NotBoundException. The
* Result is the same. The management is not operable and
* After the error message window closes.
* /
catch (Exception ex)
(
JLabel error = new JLabel (
"<html> <h2> Unable to communicate with the server eTour. </ h2>"
+ "<h3> <u> The dialog management request is closed. </ U> </ h3>"
+ "<p> <b> Possible Causes: </ b>"
+ "<ul> <li> No connection to the network. </ Li>"
+ "Server <li> inactive. </ Li>"
+ "Server <li> clogged. </ Li> </ ul>"
+ "<p> Please try again later. </ P>"
+ "<p> If the error persists, please contact technical support. </ P>"
+ "<p> We apologize for the inconvenience. </ Html>");
Err = new ImageIcon ImageIcon (getClass (). GetResource (
Home.URL_IMAGES + "error48.png"));
JOptionPane.showMessageDialog (JDesktopPane, error,
"Error!" JOptionPane.ERROR_MESSAGE, err);
frame.dispose ();
)
)
/ *
* At the end of the frame displays the dialog
* Confirmation.
* /
public void internalFrameClosing (InternalFrameEvent pEvent)
(
/ / Create the confirmation dialog.
Root = new JPanel JPanel (new BorderLayout ());
JLabel message = new JLabel (
"Are you sure you want to close the management of cultural heritage?");
message.setFont (new Font ( "Dialog", Font.BOLD, 14));
JLabel alert = new JLabel (
"NB will be closed all the windows opened by this administration."
SwingConstants.CENTER);
avviso.setIcon (new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "warning16.png ")));
root.add (message, BorderLayout.NORTH);
root.add (notice, BorderLayout.CENTER);
String [] options = ( "Close", "Cancel");
int choice = JOptionPane.showInternalOptionDialog (jContentPane,
root, "Confirm closing of Cultural Heritage",
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE, frameIcon, options,
options [1]);
/ *
* If it is confirmed the closing of management, all
* Classes "daughters" are closed.
* /
if (choice == JOptionPane.OK_OPTION)
(
for (int i = 0; i <figli.size (); i + +)
(
figli.get (i). dispose ();
)
pEvent.getInternalFrame (). dispose ();
)
)
));
)
/ **
* Update the current model of the table of cultural property with the bean
* Of the cultural supplied input.
*
* @ Param pbc BeanBeneCulturale - the bean with which to update the
* Model.
* /
protected void updateTableModel (BeanBeneCulturale PBC)
(
tableModel.updateBC (PBC);
)
/ **
* Closes the tab cultural selected.
*
* @ Param pScheda SchedaBC - the cultural card to close.
* /
protected void closeScheda (SchedaBC pScheda)
(
figli.remove (pScheda);
pScheda.dispose ();
)
/ **
* This method initializes the content pane of the frame.
*
* @ Return javax.swing.JPanel - the content pane.
* /
private JPanel getJContentPane ()
(
if (null == jContentPane)
(
jContentPane = new JPanel ();
jContentPane.setLayout (new BorderLayout ());
jContentPane.add (getBCToolbar (), BorderLayout.NORTH);
jContentPane.add (getPannelloDestro (), BorderLayout.EAST);
jContentPane.add (getJScrollPane (), BorderLayout.CENTER);
)
jContentPane return;
)
/ **
* This method initializes the toolbar for features on
* Management of cultural heritage.
*
* @ Return javax.swing.JToolBar - the toolbar for managing assets
* Cultural.
* /
Private JToolBar getBCToolbar ()
(
if (null == BCToolbar)
(
BCToolbar JToolBar = new ();
BCToolbar.setPreferredSize (new Dimension (1, 50));
BCToolbar.setFloatable (false);
BCToolbar.setOrientation (JToolBar.HORIZONTAL);
BCToolbar.setLayout (null);
BCToolbar.add (getBtnNuovoBC ());
BCToolbar.addSeparator ();
BCToolbar.add (getBtnModificaBC ());
BCToolbar.addSeparator ();
BCToolbar.add (getBtnSchedaBC ());
BCToolbar.addSeparator ();
BCToolbar.add (getBtnEliminaBC ());
)
BCToolbar return;
)
/ **
* This method initializes the button to insert a new good
* Cultural.
*
* @ Return javax.swing.JButton - the button for the insertion.
* /
private JButton getBtnNuovoBC ()
(
if (null == btnNuovoBC)
(
btnNuovoBC = new JButton ();
btnNuovoBC.setText ( "<html> New <br> Cultural Heritage </ html>");
btnNuovoBC.setBounds (5, 5, 140, 40);
btnNuovoBC.setIcon (new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "nuovoBC.png ")));
btnNuovoBC.setName (btnNuovoBC ");
btnNuovoBC.addMouseListener (bcHelp);
btnNuovoBC
. setCursor (Cursor.getPredefinedCursor (Cursor.HAND_CURSOR));
btnNuovoBC.addActionListener (new ActionListener ()
(
public void actionPerformed (ActionEvent pEvent)
(
/ / Opens a form for entering a new good
/ / Cultural.
OpenOffice.org Messenger MSN Gaim (null, false);
)
));
)
btnNuovoBC return;
)
/ **
* This method initializes the button to access to details of property
* Cultural selected.
*
* @ Return javax.swing.JButton - the button for the card.
* /
private JButton getBtnSchedaBC ()
(
if (null == btnSchedaBC)
(
btnSchedaBC = new JButton ();
btnSchedaBC.setBounds (305, 5, 140, 40);
btnSchedaBC.setText ( "<html> Card <br> Cultural Heritage </ html>");
btnSchedaBC.setVerticalTextPosition (SwingConstants.TOP);
btnSchedaBC.setIcon (new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "scheda.png ")));
btnSchedaBC.setEnabled (false);
btnSchedaBC.setCursor (Cursor
. getPredefinedCursor (Cursor.HAND_CURSOR));
btnSchedaBC.setName (btnSchedaBC ");
btnSchedaBC.addMouseListener (bcHelp);
btnSchedaBC.addActionListener (new ActionListener ()
(
public void actionPerformed (ActionEvent pEvent)
(
int selectedRow = tableBC.getSelectedRow ();
BeanBeneCulturale todo = null;
TRY
(
todo = gestioneBC.ottieniBeneCulturale (TableModel
. getID (selectedRow));
/ / Open the card with the change of the cultural
/ / Disabled.
OpenOffice.org Messenger MSN Gaim (todo, false);
)
catch (Exception ex)
(
JLabel error = new JLabel (
"<html> <h2> Unable to communicate with the server eTour. </ h2>"
+ "The card <h3> <u> request can not be loaded. </ U> </ h3>"
+ "<p> Please try again later. </ P>"
+ "<p> If the error persists, please contact technical support. </ P>"
+ "<p> We apologize for the inconvenience. </ Html>");
Err = new ImageIcon ImageIcon (getClass (). GetResource (
Home.URL_IMAGES + "error48.png"));
JOptionPane.showMessageDialog (JDesktopPane, error,
"Error!" JOptionPane.ERROR_MESSAGE, err);
)
)
));
)
btnSchedaBC return;
)
/ **
* This method initializes the button to access the modification of a
* Cultural.
*
* @ Return javax.swing.JButton - the button for the card.
* /
private JButton getBtnModificaBC ()
(
if (null == btnModificaBC)
(
btnModificaBC = new JButton ();
btnModificaBC.setBounds (155, 5, 140, 40);
btnModificaBC
. setText ( "Edit Data <html> <br> Cultural Heritage </ html>");
btnModificaBC.setEnabled (false);
btnModificaBC.setCursor (Cursor
. getPredefinedCursor (Cursor.HAND_CURSOR));
btnModificaBC.setIcon (new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "ModificaBC32.png ")));
btnModificaBC.setName (btnModificaBC ");
btnModificaBC.addMouseListener (bcHelp);
btnModificaBC.addActionListener (new ActionListener ()
(
public void actionPerformed (ActionEvent pEvent)
(
int selectedRow = tableBC.getSelectedRow ();
BeanBeneCulturale todo = null;
TRY
(
todo = gestioneBC.ottieniBeneCulturale (TableModel
. getID (selectedRow));
/ / Open the card with the change of the cultural
/ / Enabled.
OpenOffice.org Messenger MSN Gaim (todo, true);
)
catch (Exception ex)
(
JLabel error = new JLabel (
"<html> <h2> Unable to communicate with the server eTour. </ h2>"
+ "The card <h3> <u> request can not be loaded. </ U> </ h3>"
+ "<p> Please try again later. </ P>"
+ "<p> If the error persists, please contact technical support. </ P>"
+ "<p> We apologize for the inconvenience. </ Html>");
Err = new ImageIcon ImageIcon (getClass (). GetResource (
Home.URL_IMAGES + "error48.png"));
JOptionPane.showMessageDialog (JDesktopPane, error,
"Error!" JOptionPane.ERROR_MESSAGE, err);
)
)
));
)
btnModificaBC return;
)
/ **
* This method initializes the button for the elimination of property
* Cultural selected.
*
* @ Return javax.swing.JButton - the delete button for.
* /
private JButton getBtnEliminaBC ()
(
if (null == btnEliminaBC)
(
btnEliminaBC = new JButton ();
btnEliminaBC.setBounds (455, 5, 140, 40);
btnEliminaBC.setText ( "Delete <html> <br> Cultural Heritage </ html>");
btnEliminaBC.setVerticalTextPosition (SwingConstants.TOP);
btnEliminaBC.setCursor (Cursor
. getPredefinedCursor (Cursor.HAND_CURSOR));
btnEliminaBC.setIcon (new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "EliminaBC32.png ")));
btnEliminaBC.setCursor (Cursor
. getPredefinedCursor (Cursor.HAND_CURSOR));
btnEliminaBC.setEnabled (false);
btnEliminaBC.addActionListener (new ActionListener ()
(
public void actionPerformed (ActionEvent pEvent)
(
int selectedRow = tableBC.getSelectedRow ();
String name = (String) TableModel
. getValueAt (selectedRow, 0);
/ / Create the delete confirmation dialog.
Root = new JPanel JPanel (new BorderLayout ());
JLabel message = new JLabel (
"Are you sure you want to delete the cultural heritage"
+ Name + "?");
message.setFont (new Font ( "Dialog", Font.BOLD, 14));
JLabel alert = new JLabel (
"The deleted data can not be filled again."
SwingConstants.CENTER);
avviso.setIcon (new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "warning16.png ")));
root.add (message, BorderLayout.NORTH);
root.add (notice, BorderLayout.CENTER);
String [] options = ( "Delete", "Cancel");
int choice = JOptionPane.showInternalOptionDialog (
jContentPane, root, "Confirm Delete",
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,
new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "EliminaBC48.png")),
options, options [1]);
/ / If the deletion is confirmed, remove the well
/ / Cultural selected.
if (choice == JOptionPane.YES_OPTION)
(
TRY
(
gestioneBC.cancellaBeneCulturale (TableModel
. getID (selectedRow));
tableModel.removeSito (selectedRow);
JLabel confirm = new JLabel ( "The cultural heritage"
+ Name + "was deleted.");
confirm.setFont (new Font ( "Dialog", Font.BOLD, 14));
JOptionPane.showInternalMessageDialog (jContentPane,
confirm, "Cultural Heritage"
JOptionPane.OK_OPTION, new ImageIcon (
getClass (). getResource (
Home.URL_IMAGES
+ "Ok32.png ")));
)
catch (Exception ex)
(
JLabel error = new JLabel (
"<html> <h2> Unable to communicate with the server eTour. </ h2>"
+ "<h3> <u> Delete operation request can not be completed. </ U> </ h3>"
+ "<p> Please try again later. </ P>"
+ "<p> If the error persists, please contact technical support. </ P>"
+ "<p> We apologize for the inconvenience. </ Html>");
Err = new ImageIcon ImageIcon (getClass ()
. getResource (
Home.URL_IMAGES + "error48.png"));
JOptionPane.showMessageDialog (JDesktopPane, error,
"Error!" JOptionPane.ERROR_MESSAGE, err);
)
)
)
));
btnEliminaBC.setName (btnEliminaBC ");
btnEliminaBC.addMouseListener (bcHelp);
)
btnEliminaBC return;
)
/ **
* This method initializes the right side of the interface.
*
* @ Return javax.swing.JPanel - the right pane of the interface.
* /
private JPanel getPannelloDestro ()
(
if (null == rightPanel)
(
rightPanel = new JPanel ();
rightPanel.setLayout (new BorderLayout ());
rightPanel.add (getHelpPanel (), BorderLayout.CENTER);
rightPanel.add (getSearchPanel (), BorderLayout.CENTER);
)
rightPanel return;
)
/ **
* This method initializes the panel for finding property
* Cultural.
*
* @ Return javax.swing.JPanel - the search panel.
* /
private JPanel getSearchPanel ()
(
if (null == searchPanel)
(
GridBagConstraints g = new GridBagConstraints ();
searchPanel = new JPanel (new GridBagLayout ());
searchPanel.setBorder (BorderFactory.createTitledBorder (
BorderFactory.createLineBorder (new Color (51, 102, 255), 3),
"Search for Cultural Heritage"
TitledBorder.DEFAULT_JUSTIFICATION,
TitledBorder.DEFAULT_POSITION, new Font ( "Dialog",
Font.BOLD, 12), new Color (0, 102, 204)));
g.anchor = GridBagConstraints.CENTER;
/ / Top - Left - Bottom - Right
g.insets = new Insets (5, 5, 5, 5);
g.gridwidth = 2;
g.gridx = 0;
g.gridy = 0;
searchPanel.add (new JLabel ( "Name of Cultural Heritage"), g);
g.gridy = 1;
nomeBC = new JTextField ();
nomeBC.setColumns (12);
nomeBC.setName (nomeBC ");
nomeBC.addMouseListener (bcHelp);
searchPanel.add (nomeBC, g);
g.gridy = 2;
searchPanel.add (new JLabel ( "Select search tags:"), g);
g.fill = GridBagConstraints.VERTICAL;
g.gridy = 3;
g.weightx = 1.0;
g.weighty = 1.0;
g.insets = new Insets (5, 5, 10, 5);
pannelloTag = new TagPanel ();
pannelloTag.setPreferredSize (new Dimension (180, 40));
pannelloTag.setName (pannelloTag ");
pannelloTag.addMouseListener (bcHelp);
searchPanel.add (pannelloTag, g);
g.insets = new Insets (5, 5, 5, 5);
g.weightx = 0;
g.weighty = 0;
g.gridwidth = 1;
g.gridy = 4;
g.fill = GridBagConstraints.NONE;
searchPanel.add (getBtnRicerca (), g);
g.gridx = 1;
searchPanel.add (getBtnAzzera (), g);
)
searchPanel return;
)
/ **
* This method initializes the panel containing the online help.
*
* @ Return javax.swing.JPanel - the panel of the guide.
* /
private JPanel getHelpPanel ()
(
if (null == helpPanel)
(
helpPanel = new JPanel ();
helpPanel.setLayout (new BorderLayout ());
helpPanel.setBorder (BorderFactory.createTitledBorder (BorderFactory
. createLineBorder (new Color (51, 102, 255), 3),
"Help", TitledBorder.DEFAULT_JUSTIFICATION,
TitledBorder.DEFAULT_POSITION, new Font ( "Dialog",
Font.BOLD, 12), new Color (0, 102, 204)));
textGuida.setPreferredSize (new Dimension (100, 80));
textGuida.setContentType ( "text / html");
textGuida
. setText ( "<html> Move your mouse pointer over a control"
+ "Of interest to display the context-sensitive help. </ Html>");
textGuida.setEditable (false);
textGuida.setOpaque (false);
helpPanel.add (textGuida, BorderLayout.CENTER);
)
helpPanel return;
)
/ **
* This method initializes the bread and table scroll of cultural heritage.
*
* @ Return javax.swing.JScrollPane - the scrollPane.
* /
private JScrollPane getJScrollPane ()
(
if (JScrollPane == null)
(
if (null == tableBC)
(
SitoTableModel = new TableModel ();
tableBC = new ScrollableTable (TableModel);
tableBC.setRowHeight (32);
tableBC.setDefaultRenderer (Double.class,
New MediaVotiRenderer ());
tableBC
. setDefaultRenderer (Punto3D.class,
New Punto3DRenderer ());
tableBC.setSelectionMode (ListSelectionModel.SINGLE_SELECTION);
tableBC.setSelectionForeground (Color.RED);
tableBC.setSelectionBackground (Color.white);
tableBC.setShowVerticalLines (false);
tableBC.setColumnSelectionAllowed (false);
tableBC.addMouseListener (bcHelp);
tableBC.setName (tableBC ");
/ *
* SelectionListener - if a selected row, the buttons
* Tab, edit and delete are active. Otherwise, are
* Disabled.
* /
ListSelectionModel selectionModel = tableBC.getSelectionModel ();
selectionModel
. addListSelectionListener (new ListSelectionListener ()
(
public void ValueChanged (ListSelectionEvent pEvent)
(
if (tableBC.getSelectedRow ()! = -1)
(
btnEliminaBC.setEnabled (true);
btnSchedaBC.setEnabled (true);
btnModificaBC.setEnabled (true);
)
else
(
btnEliminaBC.setEnabled (false);
btnSchedaBC.setEnabled (false);
btnModificaBC.setEnabled (false);
)
)
));
/ *
* KeyListener <ENTER> - Details of the cultural selected.
* <Backspace> - Delete the selected cultural. <space> --
* Modify the cultural selected.
* /
tableBC.addKeyListener (new KeyAdapter ()
(
public void keyPressed (KeyEvent pEvent)
(
int keyCode = pEvent.getKeyCode ();
if (keyCode == KeyEvent.VK_ENTER)
(
btnSchedaBC.doClick ();
)
else if (keyCode == KeyEvent.VK_BACK_SPACE)
(
btnEliminaBC.doClick ();
)
else if (keyCode == KeyEvent.VK_SPACE)
(
btnModificaBC.doClick ();
)
)
));
)
JScrollPane = new JScrollPane (tableBC);
JScrollPane
. setHorizontalScrollBarPolicy (JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
JScrollPane
. setVerticalScrollBarPolicy (JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
)
JScrollPane return;
)
/ **
* This method initializes the button to search for a good
* Cultural.
*
* @ Return javax.swing.JButton - the search button.
* /
private JButton getBtnRicerca ()
(
if (null == btnRicerca)
(
btnRicerca = new JButton ();
btnRicerca.setText ( "Search");
btnRicerca.setPreferredSize (new Dimension (98, 26));
btnRicerca.setIcon (new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "Ricerca16.png ")));
btnRicerca
. setCursor (Cursor.getPredefinedCursor (Cursor.HAND_CURSOR));
btnRicerca.setName (btnRicerca ");
btnRicerca.addMouseListener (bcHelp);
)
btnRicerca return;
)
/ **
* This method initializes the button to clear the form
* Cultural research.
*
* @ Return javax.swing.JButton - the button to reset the form.
* /
private JButton getBtnAzzera ()
(
if (null == btnAzzera)
(
btnAzzera = new JButton ();
btnAzzera.setText ( "Clear");
btnAzzera.setHorizontalTextPosition (SwingConstants.LEADING);
btnAzzera.setPreferredSize (new Dimension (98, 26));
btnAzzera.setIcon (new ImageIcon (getClass (). getResource (
Home.URL_IMAGES + "Azzera16.png ")));
btnAzzera.setName (btnAzzera ");
btnAzzera.setCursor (Cursor.getPredefinedCursor (Cursor.HAND_CURSOR));
btnAzzera.addMouseListener (bcHelp);
btnAzzera.addActionListener (new ActionListener ()
(
public void actionPerformed (ActionEvent arg0)
(
nomeBC.setText ("");
pannelloTag.azzera ();
)
));
)
btnAzzera return;
)
/ **
* This method opens a tab of the selected cultural or opens the
* Window for entering a new cultural object.
*
* @ Param pbc BeanBeneCulturale - the bean of the cultural property of which
* Want to see the card.
* @ Param boolean pModifica --
* <ul>
* <li> <i> True </ i> - indicates that you are making a change
* Data cultural.
* <li> <i> False </ i> indicates that you are viewing the card
* The cultural property.
* /
private void OpenOffice.org Messenger MSN Gaim (BeanBeneCulturale PBC, boolean pModifica)
(
SchedaBC new;
if (pbc == null)
(
new = new SchedaBC (this);
)
else
(
for (int i = 0; i <figli.size (); i + +)
(
SchedaBC current = figli.get (i);
if (pBc.getId () == corrente.getId ())
(
desktopManager.activateFrame (current);
return;
)
)
new = new SchedaBC (this, PBC, pModifica);
)
jDesktopPane.add (new, Integer.MAX_VALUE);
desktopManager.centerFrame (new);
nuova.setVisible (true);
figli.add (new);
)
/ **
* This method imports the cultural downloaded from the server in
* Table.
*
* @ Param boolean pRicerca
* <ul>
* <li> <i> True </ i> - include the search parameters.
* <li> <i> False </ i> otherwise.
* </ Ul>
* /
private void caricaTabella (boolean pRicerca)
(
ArrayList <BeanBeneCulturale> Beniculturali = null;
TRY
(
if (pRicerca)
(
)
else
(
Beniculturali gestioneBC.ottieniBeniCulturali = ();
)
)
/ / If an error displays an error message.
catch (RemoteException e)
(
JLabel error = new JLabel (
"<html> <h2> Unable to communicate with the server eTour. </ h2>"
+ "<h3> <u> The list of cultural goods has been loaded. </ U> </ h3>"
+ "<p> Please try again later. </ P>"
+ "<p> If the error persists, please contact technical support. </ P>"
+ "<p> We apologize for the inconvenience. </ Html>");
Err = new ImageIcon ImageIcon (getClass (). GetResource (
Home.URL_IMAGES + "error48.png"));
JOptionPane.showInternalMessageDialog (this, error, "Error!"
JOptionPane.ERROR_MESSAGE, err);
)
finally
(
SitoTableModel = new TableModel (Beniculturali);
tableBC.setModel (TableModel);
organizzaRiga ();
)
)
/ **
* This method loads the tags available in the system and import them into
* Panel tag.
* /
private void caricaTags ()
(
ArrayList <BeanTag> beanTags = null;
TRY
(
beanTags = tag.ottieniTags ();
for (BeanTag b: beanTags)
(
pannelloTag.insertTag (b);
)
pannelloTag.repaint ();
)
/ / If an error panel tag remains blank.
catch (RemoteException e)
(
)
)
/ **
* This method sets the size of columns for the data assets
* Cultural.
* /
private void organizzaRiga ()
(
/ / Name
tableBC.getColumnModel (). GetColumn (0). setPreferredWidth (120);
/ / Address
tableBC.getColumnModel (). GetColumn (1). setPreferredWidth (120);
/ / Phone
tableBC.getColumnModel (). GetColumn (2). setPreferredWidth (80);
/ / Location
tableBC.getColumnModel (). GetColumn (3). setPreferredWidth (80);
/ / City
tableBC.getColumnModel (). GetColumn (4). setPreferredWidth (80);
/ / CAP
tableBC.getColumnModel (). GetColumn (5). setPreferredWidth (50);
/ / Test
tableBC.getColumnModel (). GetColumn (6). setPreferredWidth (30);
/ / RATINGS
tableBC.getColumnModel (). GetColumn (7). setPreferredWidth (80);
/ / POSGEO
tableBC.getColumnModel (). GetColumn (8). setPreferredWidth (120);
)
) | Code |
|
Categoria.txt | package unisa.gps.etour.control.fuzzy;
import java.io.Serializable;
import java.util.Hashtable;
public class Category implements Serializable
(
/ **
* Class that describes the characteristics of a Category
* Contains a Hashtable that represents the dictionary on
* The category that contains and for each term associated
* In the category values of frequency, distance and relevance.
* Provides methods to access, modify and auxiliary methods.
* /
private static final long serialVersionUID =-8652232946927756089L;
private String name; / / name of the category
private Hashtable <string, float[]> terms, / / list of terms and their frequencies and distance rilavanza
/ *
* Manufacturer:
* Get the category name as a parameter to create
* /
public Category (String Pnom)
(
name = Pnom;
terms <String,float[]> = new Hashtable ();
)
/ *
* Returns the output Hashtable containing the terms
* With the respective values of frequency, relevance and distance
* /
<string, float[]> getTermini public Hashtable ()
(
return terms;
)
/ *
* Returns the name of the output category
* /
public String getName ()
(
return name;
)
/ *
* Get the string as a parameter representing the term
* Of which you want to pick the values of frequency, range and bearing
* /
public float [] getval (pTermine String) throws NullPointerException
(
if (esisteTermine (pTermine))
return termini.get (pTermine);
return null;
)
/ *
* Agiunge an end to dizinario category
* /
public void addTermine (String pTermine)
(
termini.put (pTermine, new float [3]);
)
/ *
* Agiunge an end to dizinario category
* Seven also the values of frequency, distance and rilavanza
* /
public boolean addTermine (String pTermine, float [] pVal)
(
if ((pVal == null) | | (pTermine.equals ("")))
return false;
termini.put (pTermine, pVal);
return true;
)
/ *
* Set the values for the period pTermine
* /
public boolean setValTermine (String pTermine, float [] pVal)
throws NullPointerException
(
if (esisteTermine (pTermine))
(
termini.put (pTermine, pVal);
return true;
)
return false;
)
public void setTermini (Hashtable <String,float[]> pTermini)
(
Term = pTermini;
)
/ *
* Returns True if the term is present in
* Dictionary of Category False otherwise
* /
public boolean esisteTermine (String pTermine)
(
TRY
(
float [] ret = termini.get (pTermine);
if (ret! = null)
return true;
)
catch (NullPointerException e)
(
return false;
)
return false;
)
) | Code |
|
ControlServerLauncher.txt | package unisa.gps.etour.control;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;
import unisa.gps.etour.control.GestioneBeniCulturali.GestioneBeniCulturaliComune;
import unisa.gps.etour.control.GestioneBeniCulturali.IGestioneBeniCulturaliComune;
/ **
* This is the entry point of the control server. This class is responsible for
* Make the deployment of services on the RMI registry, thus rendering the
* Some services are available and usable.
*
* @ Author Michelangelo De Simone
* @ Version 0.1 © 2007 eTour Project - Copyright by DMI SE @ SA Lab - University of Salerno
* /
public class ControlServerLauncher
(
/ **
* Entry point of ControlServer
*
* @ Param args The command line parameters
* /
public static void main (String [] args)
(
/ / *** WARNING *** *** WARNING *** EXPERIMENTAL EXPERIMENTAL
TRY
(
/ / GestioneBeniCulturaliComune is the class that implements the interface IGestioneBeniCulturaliComune,
/ / This interface on both the client, both the server
GestioneBeniCulturaliComune gBCC = new GestioneBeniCulturaliComune ();
/ / Here you create the stub for the registry, making it clear to the RMI system you are exporting the object on a gBCC
/ / Anonymous port
IGestioneBeniCulturaliComune stubGBCC = (IGestioneBeniCulturaliComune) UnicastRemoteObject.exportObject (gBCC, 0);
/ / There shall call the register (default is on localhost) and "bind" (alloy)
Registry registry = LocateRegistry.getRegistry ();
registry.bind (IGestioneBeniCulturaliComune "stubGBCC);
)
catch (Exception e)
(
System.out.println ( "Exception:" + e.getLocalizedMessage ());
)
)
)
| Code |
|
ControlloBeniCulturali.txt | package unisa.gps.etour.control.GestioneBeniCulturali;
import java.util.Date;
import unisa.gps.etour.bean.BeanBeneCulturale;
/ **
* This class has the task of checking the data of a cultural object.
* Various consistency checks are performed, such as length of strings,
* Null reference, dynamic types incorrect.
*
* @ Author Michelangelo De Simone
* @ Version 0.1
*
* © 2007 eTour Project - Copyright by DMI SE @ SA Lab - University of Salerno
* /
public class ControlloBeniCulturali
(
/ **
*
* Please consistency check by calling the appropriate methods.
* This method wrappa "all other methods of control with a single call.
* At the first false value the flow is interrupted.
*
* @ Param bean The PBC of the cultural object to be inspected
* @ Return boolean The result of the check: true if OK, false otherwise
* /
public static boolean controllaDatiBeneCulturale (BeanBeneCulturale PBC)
(
/ / This method checks the input parameter in the cases
/ / Null reference or dynamic Wrong
if (PBC == null | |! (PBC instanceof BeanBeneCulturale))
return false;
/ / This method checks if the ID passed as a parameter BeanBeneCulturale
/ / Is valid or not
if (! controllaIdBeneCulturale (pBC.getId ()))
return false;
/ / This method checks the objects contained in BeanBeneCulturale Date
/ / As such, a check is made null and reference checks
/ / On the dynamic.
if (! controllaDateBeneCulturale (PBC))
return false;
/ / This method checks all the fields in BeanBeneCulturale, research
/ / Any null references
if (! controllaDatiNulli (PBC))
return false;
/ / Check the correct length of string, in this case the CAP must
/ / To force of circumstances than five digits, while the province of two.
/ / TODO: To be completed
if (pBC.getCap (). length ()! = 5 | | pBC.getProvincia (). length ()! = 2)
return false;
return true;
)
/ **
*
* Check for null data in a bean cultural property.
* The check is performed on all fields of the bean.
*
* @ Param bean The PBC cultural property to be checked
* @ Return boolean The result of the check: true if there are no null references, false otherwise
* /
public static boolean controllaDatiNulli (BeanBeneCulturale PBC)
(
if (pBC.getCap () == null | | pBC.getCitta () == null | | pBC.getDescrizione () == null | | pBC.getGiornoChiusura () == null | |
pBC.getLocalita () == null | | pBC.getNome () == null | | pBC.getOrarioApertura () == null | |
pBC.getOrarioChiusura () == null | | pBC.getProvincia () == null | | pBC.getTelefono () == null | | pBC.getVia () == null)
return false;
return true;
)
/ **
*
* Check the consistency of dates within this BeanBeneCulturale.
* The check is performed only on objects, while not carried out
* No validity check 'on a date as a cultural object may also have
* Dates later than today (see for example on open exhibitions).
*
* @ Param The PBC BeanBeneCulturale which check the dates
* @ Return boolean The result of the check: true if the dates have consistency; false otherwise
* /
public static boolean controllaDateBeneCulturale (BeanBeneCulturale PBC)
(
if (pBC.getOrarioApertura () == null | |! (pBC.getOrarioApertura () instanceof Date) | |
pBC.getOrarioChiusura () == null | |! (pBC.getOrarioChiusura () instanceof Date))
return false;
return true;
)
/ **
*
* Check the ID of BeanBeneCulturale
*
* @ Param pId Id BeanBeneCulturale be checked
* @ Return boolean The result of the check: true if the ID is correct, false otherwise
* /
public static boolean controllaIdBeneCulturale (int pid)
(
return (pid> 0);
)
) | Code |
|
ControlloDati.txt | package unisa.gps.etour.util;
import java.awt.image.BufferedImage;
import java.util.Date;
import javax.swing.ImageIcon;
import unisa.gps.etour.bean.BeanBanner;
import unisa.gps.etour.bean.BeanBeneCulturale;
import unisa.gps.etour.bean.BeanConvenzione;
import unisa.gps.etour.bean.BeanMenu;
import unisa.gps.etour.bean.BeanNews;
import unisa.gps.etour.bean.BeanOperatorePuntoDiRistoro;
import unisa.gps.etour.bean.BeanPiatto;
import unisa.gps.etour.bean.BeanPreferenzaDiRicerca;
import unisa.gps.etour.bean.BeanPreferenzeGeneriche;
import unisa.gps.etour.bean.BeanPuntoDiRistoro;
import unisa.gps.etour.bean.BeanTag;
import unisa.gps.etour.bean.BeanTurista;
import unisa.gps.etour.bean.BeanVisitaBC;
import unisa.gps.etour.bean.BeanVisitaPR;
/ **
* Class for managing the control of the correctness of the strings
*
* @ Author Joseph Penna
* @ Version 0.1 © 2007 eTour Project - Copyright by DMI SE @ SA Lab --
* University of Salerno
* /
public class ControlloDati
(
private static final String letter = "abcdefghijklmnopqrstuvxywz"
+ "ABCDEFGHIJKLMNOPQRSTUVXYWZ";
private final static String numbers = "0123456789";
public final static int max_length = 64;
/ **
* Static method for verifying correctness of a string
*
* @ Param string to check pStringa
* @ Param letterePermesse Boolean: True if it is allowed to be present
* Letters in the string, False otherwise
* @ Param numeriPermessi Boolean: True if it is allowed to be present
* Numbers in the string, False otherwise
CaratteriPermessi * @ param string containing all characters
* Allowed in the string
* @ Param string contentente all caratteriNecessari characters
* Must be present in the string
* @ Param numeroCaratteriMin integer representing the minimum number of
* Characters allowed in string
* @ Param numeroCaratteriMax integer representing the maximum number of
* Characters allowed in string
* @ Return Boolean: True if the witch meets the conditions, False
* Otherwise
* /
public static boolean controllaStringa (String pStringa,
letterePermesse boolean, boolean numeriPermessi,
CaratteriPermessi String, String caratteriNecessari,
numeroCaratteriMin int, int numeroCaratteriMax)
(
Chance pStringa == null: the function returns false
if (null == pStringa)
return false;
int lunghezzaStringa = pStringa.length ();
CarattereCorrente character;
/ / Check the length of the string
if (lunghezzaStringa <numeroCaratteriMin
| | LunghezzaStringa> numeroCaratteriMax)
(
return false;
)
/ / Check the presence of the necessary characters in the string
if (caratteriNecessari = null)
(
if (! caratteriNecessari.equals (""))
for (int i = 0; i <caratteriNecessari.length (); i + +)
(
carattereCorrente = caratteriNecessari.charAt (i);
if (! pStringa.contains (carattereCorrente.toString ()))
(
return false;
)
)
)
/ / Create the string containing all characters allowed
String stringaCaratteriPermessi = caratteriPermessi
CaratteriNecessari + + (letterePermesse? Letters: "")
+ (NumeriPermessi? Numbers: "");
/ / Loop for the inspection of the characters of the string to check
for (int i = 0; i <lunghezzaStringa i + +)
(
carattereCorrente = pStringa.charAt (i);
/ / Condition: If the character you are watching is not
/ / In the string of characters allowed
/ / The string is incorrect and out of the loop.
if (! (stringaCaratteriPermessi.contains (carattereCorrente
. toString ())))
(
return false;
)
)
return true;
)
public static String correggiStringa (String pStringa,
letterePermesse boolean, boolean numeriPermessi,
CaratteriPermessi String, int numeroCaratteriMax)
(
if (null == pStringa)
return null;
String stringaCaratteriPermessi = caratteriPermessi
+ (LetterePermesse? Letters: "")
+ (NumeriPermessi? Numbers: "");
CarattereCorrente character;
int lunghezzaStringa = pStringa.length ();
int i = 0;
while (i <lunghezzaStringa)
(
carattereCorrente = pStringa.charAt (i);
if (! (stringaCaratteriPermessi.contains (carattereCorrente
. toString ())))
(
pStringa = pStringa.replaceAll ( "\ \"
CarattereCorrente.toString + (), "");
lunghezzaStringa = pStringa.length ();
)
else
i + +;
)
if (lunghezzaStringa> numeroCaratteriMax)
(
pStringa = pStringa.substring (0, numeroCaratteriMax);
)
pStringa return;
)
public static boolean controllaData (String pData)
(
/ / Still I have no idea how I will spend the time
return true;
)
public static boolean controllaDate (Date pDataInizio, Date pDataFine)
(
boolean back = false;
if (pDataInizio! = null & & pDataFine = null)
(
if (pDataInizio.before (pDataFine))
return = true;
)
return receipt;
)
public static boolean checkBeanTurista (BeanTurista pTurista)
(
if (pTurista = null & & pTurista instanceof BeanTurista)
return true;
return false;
)
public static boolean checkBeanPreferenzaDiRicerca (
BeanPreferenzaDiRicerca pPreferenzaDiRicerca)
(
if (pPreferenzaDiRicerca = null
& & PPreferenzaDiRicerca instanceof BeanPreferenzaDiRicerca)
return true;
return true;
)
public static boolean checkBeanPreferenzeGeneriche (
BeanPreferenzeGeneriche pPreferenzeGeneriche)
(
if (pPreferenzeGeneriche = null
& & PPreferenzeGeneriche instanceof BeanPreferenzeGeneriche)
return true;
return false;
)
public static boolean checkBeanBeneCulturale (
BeanBeneCulturale pBeneCulturale)
(
if (pBeneCulturale = null
& & PBeneCulturale instanceof BeanBeneCulturale)
return true;
return false;
)
public static boolean checkBeanPuntoDiRistoto (
BeanPuntoDiRistoro pPuntoDiRistoro)
(
if (pPuntoDiRistoro = null
& & PPuntoDiRistoro instanceof BeanPuntoDiRistoro)
return true;
return false;
)
public static boolean checkBeanOperatorePuntoDiRistoro (
BeanOperatorePuntoDiRistoro pOperaotorePuntoDiRistoro)
(
if (pOperaotorePuntoDiRistoro = null
& & POperaotorePuntoDiRistoro instanceof BeanOperatorePuntoDiRistoro)
return true;
return false;
)
/ **
* Please formal control and consistency on the data of the banner
* Content in the bean passed by parameter.
*
* @ Author Fabio Palladino
* @ Param pBanner bean contains the data of the banner.
* @ Return True if the data of the banner is correct false otherwise.
* /
public static boolean checkBeanBanner (BeanBanner pBanner)
(
toReturn boolean = false;
if (pBanner = null & & pBanner instanceof BeanBanner)
(
toReturn = (pBanner.getId ()> 0 & & pBanner.getPercorsoFile ()! = "" & & pBanner
. getIdPuntoDiRistoro ()> 0);
)
toReturn return;
)
/ **
* Method which controls the image contained in the object ImageIcon past
* Per parameter.
*
* @ Author Fabio Palladino
* @ Param image ImageIcon object containing the image to be checked
* @ Return true if the image contained in the object is an instance ImageIcon
* Class BufferedImage.
* /
public static boolean checkImmagine (ImageIcon image)
(
if (image! = null)
(
return (immagine.getImage () instanceof BufferedImage);
)
return false;
)
/ **
* Function that checks the data in a news;
*
* @ Author Fabio Palladino
* @ Param bean Pnews containing details of a news.
* @ Return
* /
public static boolean checkBeanNews (BeanNews Pnews)
(
toReturn boolean = false;
/ * Check the validity of the general method parameter * /
if (Pnews = null)
(
PNews.getDataPubblicazione Date dataPubb = () / / Date of
/ / Publishing
Date dataScad = pNews.getDataScadenza () / / Due Date
PNews.getNews String news = (), / / Text of News
int priority = pNews.getPriorita ();
/ * Checking the invalidity of the fields * /
if (dataPubb! dataScad = null & &! = null & & news = null)
(
/ * Check the consistency of the dates * /
toReturn = dataPubb.before (dataScad);
/ * Check that the text is not empty * /
toReturn = toReturn & & (news! = "");
/ * Check that the ID is greater than 0 * /
toReturn = toReturn & & (pNews.getId ()> 0);
/ * Check the priority value * /
toReturn = toReturn
& & (Priority <= CostantiGlobali.MAX_PRIORITY_NEWS)
& & (Priority> = CostantiGlobali.MIN_PRIORITY_NEWS);
)
)
toReturn return;
)
public static boolean checkBeanTag (BeanTag ptagi)
(
if (ptagi! = null & & instanceof ptagi BeanTag)
return true;
return false;
)
public static boolean checkBeanConvenzione (BeanConvenzione pConvenzione)
(
if (pConvenzione = null & & pConvenzione instanceof BeanConvenzione)
return true;
return false;
)
public static boolean checkBeanMenu (BeanMenu pMenu)
(
if (pMenu = null & & instanceof pMenu BeanMenu)
return true;
return false;
)
public static boolean checkBeanPiatto (BeanPiatto pPiatto)
(
if (pPiatto = null & & pPiatto instanceof BeanPiatto)
return true;
return false;
)
public static boolean checkBeanVisitaBC (BeanVisitaBC pVisitaBC)
(
if (pVisitaBC = null & & pVisitaBC instanceof BeanVisitaBC)
return true;
return false;
)
public static boolean checkBeanVisitaPR (BeanVisitaPR pVisitaPR)
(
if (pVisitaPR = null & & pVisitaPR instanceof BeanVisitaPR)
return true;
return false;
)
) | Code |
|
ControlloDatiAdvertisement.txt | / **
* Class that contains static methods that perform
* Consistency checks on the data bean banner
* And news.
*
* @ Author Fabio Palladino
* @ Version 0.1
*
* © 2007 eTour Project - Copyright by DMI SE @ SA Lab - University of Salerno
* /
package com.trapan.spg.control.GestioneAdvertisement;
import java.util.Date;
import com.trapan.spg.bean.BeanBanner;
import com.trapan.spg.bean.BeanNews;
public class ControlloDatiAdvertisement
(
/ **
* Please formal control and consistency on
* Data content of the banner in the bean passed by parameter.
* @ Param pBanner bean contains the data of the banner.
* @ Return
* /
public static boolean controlloBanner (BeanBanner pBanner) (
toReturn boolean = false;
if (pBanner = null) (
toReturn = (pBanner.getId ()> 0 & & & & pBanner.getPercorsoFile ()!=""
pBanner.getIdPuntoDiRistoro ()> 0);
)
toReturn return;
)
/ **
* Method that performs consistency checks and
* Correctness of the information contained in the bean past
* Per parameter, in particular check that the dates
* Publication and expiration of the news are consistent,
* Or that the second is the later.
*
* @ Param Pnews bean containing data news
* @ Return Returns true if the bean contains consistent data
* /
public static boolean controlloNews (BeanNews Pnews) (
toReturn boolean = false;
/ * Check the validity of the general method parameter * /
if (Pnews = null) (
Date dataPubb = pNews.getDataPubblicazione () / / Released
Date dataScad = pNews.getDataScadenza () / / Due Date
PNews.getNews String news = (), / / Text of News
/ * Checking the invalidity of the fields * /
if (dataPubb! dataScad = null & &! = null & & news = null) (
/ * Check the consistency of the dates * /
toReturn = dataPubb.before (dataScad);
/ * Check that the text is not empty * /
toReturn = toReturn & & (news! = "");
/ * Check that the ID is greater than 0 * /
toReturn = toReturn & & (pNews.getId ()> 0);
/ * Check the priority value * /
)
)
toReturn return;
)
) | Code |
|
ControlloVisiteBeniCulturali.txt | package unisa.gps.etour.control.GestioneBeniCulturali;
import unisa.gps.etour.bean.BeanVisitaBC;
/ **
* This class has the task of monitoring data from a cultural visit.
* Various consistency checks are performed, such as length of strings,
* Null reference, dynamic types incorrect.
*
* @ Author Michelangelo De Simone
* @ Version 0.1
*
* © 2007 eTour Project - Copyright by DMI SE @ SA Lab - University of Salerno
* /
public class ControlloVisiteBeniCulturali
(
/ **
*
* Please consistency check by calling the appropriate methods
*
* @ Param bean The pVBC cultural visit to check
* @ Return boolean The result of the check: true if OK, false otherwise
* /
public static boolean controllaDatiVisitaBeneCulturale (BeanVisitaBC pVBC)
(
/ / If the bean is null
if (pVBC == null | |! (pVBC instanceof BeanVisitaBC))
return false;
/ / Check the ID of a cultural visit
/ / And the id of its tourist
if (! (pVBC.getIdBeneCulturale ()> 0) | |! (pVBC.getIdTurista ()> 0))
return false;
/ / Check the vote (of course ratings are accepted only between 1 and 5
if (! (pVBC.getVoto ()> = 1 & & pVBC.getVoto () <= 5))
return false;
/ / Check for null references in the bean
if (! controllaDatiNulli (pVBC))
return false;
/ / Check the correct length of string
if (! (pVBC.getCommento (). length ()> 0))
return false;
return true;
)
/ **
*
* Check for null data in a bean cultural visit
*
* @ Param bean The PBC cultural visit to check
* @ Return boolean The result of the check: true if there are no null references, false otherwise
* /
public static boolean controllaDatiNulli (BeanVisitaBC PBC)
(
/ / Check the nullity of the fields of feedback
if (pBC.getCommento () == null | | pBC.getDataVisita () == null)
return false;
return true;
)
) | Code |
|
CostantiGlobali.txt | package unisa.gps.etour.util;
import java.io.File;
/ **
* Class that contains the constants of the environmental system.
*
* @ Author Fabio Palladino
* @ Version 0.1
*
* © 2007 eTour Project - Copyright by DMI SE @ SA Lab - University of Salerno
* /
public class CostantiGlobali
(
/ ** Highest precedence of news. * /
public static final int MAX_PRIORITY_NEWS = 5;
/ ** Priority least one news. * /
public static final int MIN_PRIORITY_NEWS = 1;
/ ** Maximum number of news on the machine. * /
public static final int MAX_NEWS_ATTIVE = 10;
/ ** Path to directory containing the images
* Banners stored on the server. * /
public static final String SERVER_IMAGE_PATH = "c:"
File.separator + + "ImmaginiBanner" + file.separator;
/ ** URL of the server for RMI calls * /
public static final String server_url = "localhost /";
/ ** Milliseconds of 30 days * /
public static final long TRENTA_GIORNI = 2592000000L;
)
| Code |
|
DBBanner.txt | / **
* Stubs for dynamic class DBBanner. Is used for testing
* Class package GestioneAdvertisement.
*
* @ Author Fabio Palladino
* @ Version 0.1
*
* © 2007 eTour Project - Copyright by DMI SE @ SA Lab - University of Salerno
* /
package unisa.gps.etour.control.GestioneAdvertisement.test.stubs;
import java.sql.SQLException;
import java.util.ArrayList;
import unisa.gps.etour.bean.BeanBanner;
import unisa.gps.etour.repository.IDBBanner;
public class DBBanner implements IDBBanner
(
private static int NUM_TEST = 0;
public boolean cancellaBanner (int pIdBanner) throws SQLException
(
if (NUM_TEST == 5)
(
throw new SQLException ();
)
else
(
return true;
)
)
/ * (Non-Javadoc)
* @ See unisa.gps.etour.repository.IDBBanner # inserisciBanner (unisa.gps.etour.bean.BeanBanner)
* /
public boolean inserisciBanner (BeanBanner pBanner) throws SQLException
(
if (NUM_TEST == 1 | | NUM_TEST == 2)
(
return true;
) else
(
return false;
)
)
/ * (Non-Javadoc)
* @ See unisa.gps.etour.repository.IDBBanner # modificaBanner (unisa.gps.etour.bean.BeanBanner)
* /
public boolean modificaBanner (BeanBanner pBanner) throws SQLException
(
return true;
)
/ * (Non-Javadoc)
* @ See unisa.gps.etour.repository.IDBBanner # ottieniBanner (int)
* /
<BeanBanner> ottieniBanner public ArrayList (int pIdPuntoDiRistoro)
throws SQLException
(
<BeanBanner> ToReturn ArrayList <BeanBanner> = new ArrayList ();
if (NUM_TEST == 1 | | NUM_TEST == 2)
(
/ * Must return an ArrayList with 3 elements * /
toReturn.add (new BeanBanner ());
toReturn.add (new BeanBanner ());
toReturn.add (new BeanBanner ());
toReturn return;
)
else if (NUM_TEST == 4)
(
toReturn.add (new BeanBanner (3, "c: \ \ ProvaBannerInserimento.jpg", 55));
toReturn.add (new BeanBanner (4, "c: \ \ ProvaBannerInserimento.jpg", 55));
toReturn.add (new BeanBanner (5, "c: \ \ ProvaBannerInserimento.jpg", 55));
toReturn.add (new BeanBanner (5, "c: \ \ ProvaBannerInserimento.jpg", 55));
toReturn return;
) else
(
return null;
)
)
/ * (Non-Javadoc)
* @ See unisa.gps.etour.repository.IDBBanner # ottieniBannerDaID (int)
* /
public BeanBanner ottieniBannerDaID (int pIdBanner) throws SQLException
(
if (NUM_TEST == 7)
(
return null;
)
else
(
return new BeanBanner (55, "c: / / ProvaBanner.jpg", 3);
)
)
public static void setNUM_TEST (int num_test)
(
NUM_TEST = num_test;
)
)
| Code |
|
DBBeneCulturale.txt | package unisa.gps.etour.control.GestioneBeniCulturali.test.stub;
import java.sql.SQLException;
import java.util.ArrayList;
import unisa.gps.etour.bean.BeanBeneCulturale;
import unisa.gps.etour.bean.BeanTag;
import unisa.gps.etour.repository.IDBBeneCulturale;
import unisa.gps.etour.util.Punto3D;
public class DBBeneCulturale implements IDBBeneCulturale
(
private ArrayList <BeanBeneCulturale> b;
public DBBeneCulturale ()
(
b = new ArrayList <BeanBeneCulturale> (0);
)
public boolean cancellaBeneCulturale (int pIdBene) throws SQLException
(
boolean res = false;
for (int i = 0; i <b.size (); i + +)
if (b.get (i). getId () == pIdBene)
(
b.remove (i);
res = true;
)
return res;
)
public boolean inserisciBeneCulturale (BeanBeneCulturale pBene)
throws SQLException
(
return (b.add (pBene));
)
public boolean modificaBeneCulturale (BeanBeneCulturale pBene)
throws SQLException
(
boolean res = false;
for (int i = 0; i <b.size (); i + +)
if (b.get (i). getId () == pBene.getId ())
(
b.set (i, pBene);
return true;
)
return res;
)
public BeanBeneCulturale ottieniBeneCulturale (int pid) throws SQLException
(
BeanBeneCulturale res = null;
for (int i = 0; i <b.size (); i + +)
if (b.get (i). getId () == pid)
res = b.get (i);
return res;
)
<BeanBeneCulturale> ottieniListaBC public ArrayList () throws SQLException
(
return b;
)
public int ottieniNumeroElementiRicerca (String pKeyword,
ArrayList <BeanTag> pTags, Punto3D pPosizione,
double pDistanzaMassima) throws SQLException
(
/ / TODO Auto-generated method stub
return 0;
)
public int ottieniNumeroElementiRicercaAvanzata (int pIdTurista,
PKeyword String, ArrayList <BeanTag> pTags, Punto3D pPosizione,
double pDistanzaMassima) throws SQLException
(
/ / TODO Auto-generated method stub
return 0;
)
public ArrayList <BeanBeneCulturale> search (String pKeyword,
ArrayList <BeanTag> pTags, int pNumPagina,
int pNumeroElementiPerPagina, Punto3D pPosizione,
double pDistanzaMassima) throws SQLException
(
/ / TODO Auto-generated method stub
return null;
)
<BeanBeneCulturale> ricercaAvanzata public ArrayList (int pIdTurista,
PKeyword String, ArrayList <BeanTag> pTags, int pNumPagina,
int pNumeroElementiPerPagina, Punto3D pPosizione,
double pDistanzaMassima) throws SQLException
(
/ / TODO Auto-generated method stub
return null;
)
) | Code |
|
DBConnessionePool.txt | package unisa.gps.etour.repository;
import Java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
/ **
* Class that creates the connection to the database using JDBC and
* Allows you to query both read and edit the contents of
* Database. E 'implemented to provide a pool of connections to
* Provide a connection to each thread.
*
* @ Author Mauro Miranda
* @ Version 0.1 2007 eTour Project - Copyright by SE @ SA Lab DMI University
* Of Salerno
* /
public class DBConnessionePool
(
private final static String driver = "com.mysql.jdbc.Driver";
private final static String urlConnessione = "jdbc: mysql: / / localhost / eTour? user = & password = mauro mauro";
private static List <Connection> connessioniLibere;
/ * Private constructor that initiates the connection to the database * /
/ *
* Static initialization block is used to load the driver
* Memory
* /
static
(
connessioniLibere = <Connection> new ArrayList ();
TRY
(
Class.forName (driver);
)
catch (ClassNotFoundException e)
(
e.printStackTrace ();
)
)
/ **
* Method to get the connection to the server.
*
* @ Return Returns the database connection
* @ Throws SQLException
* /
public static synchronized Connection ottieniConnessione ()
throws SQLException
(
Connection connection;
if (! connessioniLibere.isEmpty ())
(
/ / Extract a connection from the free db connection queue
connection = connessioniLibere.get (0);
DBConnessionePool.connessioniLibere.remove (0);
TRY
(
/ / If the connection is not valid, a new connection will be
/ / Analyzed
if (connection.isClosed ())
DBConnessionePool.ottieniConnessione connection = ();
)
catch (SQLException e)
(
DBConnessionePool.ottieniConnessione connection = ();
)
)
else
/ / The free db connection queue is empty, so a new connection will
/ / Be created
DBConnessionePool.creaDBConnessione connection = ();
return connection;
)
public static void rilasciaConnessione (Connection pReleasedConnection)
(
/ / Add the connection to the free db connection queue
DBConnessionePool.connessioniLibere.add (pReleasedConnection);
)
private static Connection creaDBConnessione () throws SQLException
(
Connection nuovaConnessione = null;
/ / Create a new db connection using the db properties
nuovaConnessione = DriverManager.getConnection (urlConnessione);
nuovaConnessione.setAutoCommit (true);
nuovaConnessione return;
)
) | Code |
|
DBConvenzione.txt | / **
Attribute_Definition
*
* @ Author Fabio Palladino
* @ Version 0.1
*
* © 2007 eTour Project - Copyright by DMI SE @ SA Lab - University of Salerno
* /
package unisa.gps.etour.control.GestioneAdvertisement.test.stubs;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import unisa.gps.etour.bean.BeanConvenzione;
import unisa.gps.etour.bean.BeanPuntoDiRistoro;
import unisa.gps.etour.repository.IDBConvenzione;
public class DBConvenzione implements IDBConvenzione
(
private static int NUM_TEST = 1;
/ * (Non-Javadoc)
* @ See unisa.gps.etour.repository.IDBConvenzione # cancellaConvenzione (int)
* /
public boolean cancellaConvenzione (int pIdConvenzione) throws SQLException
(
/ / TODO Auto-generated method stub
return false;
)
/ * (Non-Javadoc)
* @ See unisa.gps.etour.repository.IDBConvenzione # getStoricoConvenzione (int)
* /
<BeanConvenzione> ottieniStoricoConvenzione public ArrayList (int idPuntoDiRistoro)
throws SQLException
(
/ / TODO Auto-generated method stub
return null;
)
/ * (Non-Javadoc)
* @ See unisa.gps.etour.repository.IDBConvenzione # inserisciConvenzione (unisa.gps.etour.bean.BeanConvenzione)
* /
public boolean inserisciConvenzione (BeanConvenzione pConvenzione)
throws SQLException
(
/ / TODO Auto-generated method stub
return false;
)
/ * (Non-Javadoc)
* @ See unisa.gps.etour.repository.IDBConvenzione # modificaConvenzione (unisa.gps.etour.bean.BeanConvenzione)
* /
public boolean modificaConvenzione (BeanConvenzione pConvenzione)
throws SQLException
(
/ / TODO Auto-generated method stub
return false;
)
/ * (Non-Javadoc)
* @ See unisa.gps.etour.repository.IDBConvenzione # ottieniConvezioneAttiva (int)
* /
public BeanConvenzione ottieniConvezioneAttiva (int pIdPuntoDiRistoro)
throws SQLException
(
BeanConvenzione Convention BeanConvenzione = new ();
convenzione.setAttiva (true);
convenzione.setDataFine (new Date ());
convenzione.setDataInizio (new Date ());
convenzione.setId (12);
convenzione.setIdPuntoDiRistoro (3);
convenzione.setPrezzo (100);
if (NUM_TEST == 1)
(
/ * Test banners allowed * /
convenzione.setMaxBanner (4);
return agreement;
)
else if (NUM_TEST == 2)
(
/ * Test banners not allowed * /
convenzione.setMaxBanner (3);
return agreement;
) else (
return null;
)
)
/ * (Non-Javadoc)
* @ See unisa.gps.etour.repository.IDBConvenzione # ottieniListaConvenzioneAttivaPR ()
* /
<BeanPuntoDiRistoro> ottieniListaConvenzioneAttivaPR public ArrayList ()
throws SQLException
(
/ / TODO Auto-generated method stub
return null;
)
public static void setNUM_TEST (int num_test)
(
NUM_TEST = num_test;
)
)
| Code |
|
DBMenu.txt | package unisa.gps.etour.repository;
import Java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import unisa.gps.etour.bean.BeanMenu;
/ **
* Class that implements the interface Menu
*
* @ Author Joseph Martone
* @ Version 0.1 2007 eTour Project - Copyright by SE @ SA Lab DMI University
* Of Salerno
* /
public class DBMenu implements IDBMenu
(
/ / Empty constructor
public DBMenu ()
(
)
public boolean cancellaMenu (int pIdMenu) throws SQLException
(
/ / Variables for database connection
Connection conn = null;
/ / Variable for the query
Statement stat = null;
TRY
(
/ / Get the connection
DBConnessionePool.ottieniConnessione conn = ();
/ / Create the Statement
stat = conn.createStatement ();
/ / Query cancellation
String query = "DELETE FROM menu WHERE id =" + pIdMenu;
/ / You run the query Cancellation
int i = stat.executeUpdate (query);
/ / This returns the backup
return (i == 1);
)
/ / Is always done and takes care of closing the Statement and the
/ / Connect
finally
(
if (stat = null)
(
stat.close ();
)
if (conn! = null)
(
DBConnessionePool.rilasciaConnessione (conn);
)
)
)
public boolean inserisciMenu (BeanMenu pMenu) throws SQLException
(
/ / Variables for database connection
Connection conn = null;
/ / Variable for the query
Statement stat = null;
TRY
(
/ / Get the connection
DBConnessionePool.ottieniConnessione conn = ();
/ / Create the Statement
stat = conn.createStatement ();
/ / Query for the insertion
String query = "INSERT INTO menu (Day, IdPuntoDiRistoro) VALUES ( '"
+ PMenu.getGiorno ()
+ " ',"
+ PMenu.getIdPuntoDiRistoro ()
+ ")";
/ / You run the insert query
int i = stat.executeUpdate (query);
/ / This returns the backup
return (i == 1);
)
/ / Always runs and takes care of closing the Statement and the
/ / Connect
finally
(
if (stat = null)
(
stat.close ();
)
if (conn! = null)
(
DBConnessionePool.rilasciaConnessione (conn);
)
)
)
public boolean modificaMenu (BeanMenu pMenu) throws SQLException
(
/ / Variables for database connection
Connection conn = null;
/ / Variable for the query
Statement stat = null;
TRY
(
/ / Get the connection
DBConnessionePool.ottieniConnessione conn = ();
/ / Create the Statement
stat = conn.createStatement ();
/ / Query for amendment
String query = "UPDATE menu SET" + "Date = '"
PMenu.getGiorno + () + " 'WHERE Id =" + pMenu.getId ();
/ / You run the query for Change
int i = stat.executeUpdate (query);
/ / This returns the backup
return (i == 1);
)
/ / Is always done and takes care of closing the Statement and the
/ / Connect
finally
(
if (stat = null)
(
stat.close ();
)
if (conn! = null)
(
DBConnessionePool.rilasciaConnessione (conn);
)
)
)
<BeanMenu> ottieniMenu public ArrayList (int pIdPuntoDiRistoro)
throws SQLException
(
/ / Variables for database connection
Connection conn = null;
/ / Variable for the query
Statement stat = null;
/ / Variable for the query results
ResultSet result = null;
TRY
(
/ / Get the connection
DBConnessionePool.ottieniConnessione conn = ();
/ / Create the Statement
stat = conn.createStatement ();
/ / Query to extract the list of Menu
String query = "SELECT * FROM menu WHERE IdPuntoDiRistoro ="
+ PIdPuntoDiRistoro;
/ / The query is executed
result = stat.executeQuery (query);
/ / List that will contain all BeanMenu obtained
<BeanMenu> ArrayList list = new ArrayList <BeanMenu> ();
/ / We extract the results from the result set and moves in
/ / List
/ / To be returned
while (result.next ())
(
/ / Fill the list
list
. add (new BeanMenu (result.getInt ( "Id"), result
. getString ( "Day"), result
. getInt ( "IdPuntoDiRistoro ")));
)
/ / Return the list
return list;
)
/ / Is always done and takes care to close the Result, the Statement
/ / And Connection
finally
(
if (result! = null)
(
result.close ();
)
if (stat = null)
(
stat.close ();
)
if (conn! = null)
(
DBConnessionePool.rilasciaConnessione (conn);
)
)
)
public BeanMenu ottieniMenuDelGiorno (int pIdPuntoDiRistoro, String pGiorno)
throws SQLException
(
/ / Variables for database connection
Connection conn = null;
/ / Variable for the query
Statement stat = null;
/ / Variable for the query results
ResultSet result = null;
TRY
(
/ / Get the connection
DBConnessionePool.ottieniConnessione conn = ();
/ / Create the Statement
stat = conn.createStatement ();
/ / Query for the extraction of Daily Menu
String query = "SELECT * FROM menu WHERE IdPuntoDiRistoro ="
PIdPuntoDiRistoro + + "AND day = '" + pGiorno + "'";
/ / The query is executed
result = stat.executeQuery (query);
/ / Get the bean of the daily menu based on the ID of the point of
/ / Dining and a day
BeanMenu beanTemp = null;
if (result.next ())
(
/ / Create the proceeds Bean
beanTemp = new BeanMenu (result.getInt ( "Id"), result
. getString ( "Day"), result.getInt ( "IdPuntoDiRistoro"));
)
/ / Return the Bean obtained
beanTemp return;
)
/ / Is always done and takes care to close the Result, the Statement
/ / And Connection
finally
(
if (result! = null)
(
result.close ();
)
if (stat = null)
(
stat.close ();
)
if (conn! = null)
(
DBConnessionePool.rilasciaConnessione (conn);
)
)
)
) | Code |
|
DBNews.txt | / **
* Stubs used for testing the class GestioneAdvertisementAgenzia
*
* @ Author Fabio Palladino
* @ Version 0.1
*
* © 2007 eTour Project - Copyright by DMI SE @ SA Lab - University of Salerno
* /
package unisa.gps.etour.control.GestioneAdvertisement.test.stubs;
import java.sql.SQLException;
import java.util.ArrayList;
import unisa.gps.etour.bean.BeanNews;
import unisa.gps.etour.repository.IDBNews;
import unisa.gps.etour.util.CostantiGlobali;
public class DBNews implements IDBNews
(
/ ** Static field that stores the number of test * /
private static int NUM_TEST = 0;
/ * (Non-Javadoc)
* @ See unisa.gps.etour.repository.IDBNews # cancellaNews (int)
* /
public boolean cancellaNews (int pIdNews) throws SQLException
(
if (NUM_TEST == 1) (
return true;
) else if (NUM_TEST == 2) (
throw new SQLException ();
)
return true;
)
/ * (Non-Javadoc)
* @ See unisa.gps.etour.repository.IDBNews # inserisciNews (unisa.gps.etour.bean.BeanNews)
* /
public boolean inserisciNews (BeanNews Pnews) throws SQLException
(
if (NUM_TEST == 7) (
return false;
) else (
return true;
)
)
/ * (Non-Javadoc)
* @ See unisa.gps.etour.repository.IDBNews # modificaNews (unisa.gps.etour.bean.BeanNews)
* /
public boolean modificaNews (BeanNews Pnews) throws SQLException
(
return true;
)
/ * (Non-Javadoc)
* @ See unisa.gps.etour.repository.IDBNews # ottieniNews ()
* /
<BeanNews> ottieniNews public ArrayList () throws SQLException
(
<BeanNews> ToReturn ArrayList <BeanNews> = new ArrayList ();
if (NUM_TEST == 5) (
for (int i = 1; i <= CostantiGlobali.MAX_NEWS_ATTIVE i + +) (
toReturn.add (new BeanNews ());
)
toReturn return;
) else (
toReturn.add (new BeanNews ());
toReturn return;
)
)
/ **
* Set the number of tests in progress
*
* @ Param num_test
* /
public static void setNUM_TEST (int num_test)
(
NUM_TEST = num_test;
)
) | Code |
|
DBOperatoreAgenzia.txt | / **
* Class that implements the Agency's Operator
*
* @ Author Joseph Martone
* @ Version 0.1
*
* © 2007 eTour Project - Copyright by DMI SE @ SA Lab - University of Salerno
* /
package unisa.gps.etour.repository;
import Java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import unisa.gps.etour.bean.BeanOperatoreAgenzia;
public class DBOperatoreAgenzia implements IDBOperatoreAgenzia
(
/ * (Non-Javadoc)
* @ See unisa.gps.etour.repository.IDBOperatoreAgenzia # ottieniOperatoreAgenzia (int)
* /
public BeanOperatoreAgenzia ottieniOperatoreAgenzia (String pUsername)
throws SQLException
(
/ / Connect to database
Connection conn = null;
/ / Statement for running queries
Statement stat = null;
/ / Resut set where the output of the query is inserted
ResultSet result = null;
/ / Try block which performs the query and the database connection
TRY
(
/ / You get the database connection from the pool
DBConnessionePool.ottieniConnessione conn = ();
/ / Create the statement
stat = conn.createStatement ();
/ / Query
String query = "SELECT * FROM operatoreagenzia WHERE Username = '"
PUsername + + " '";
result = stat.executeQuery (query);
Or BeanOperatoreAgenzia = null;
if (result.next ())
(
/ / Build the bean when the query returns a
/ / Value
/ / Otherwise will return null
or BeanOperatoreAgenzia = new ();
oa.setId (result.getInt ( "Id"));
oa.setUsername (result.getString ( "Username"));
oa.setNome (result.getString ( "Name"));
oa.setCognome (result.getString ( "Name"));
oa.setPassword (result.getString ( "Password"));
)
or return;
)
/ / Finally block that contains the instructions to close the connections
/ / Hyenas run in any case
finally
(
/ / This closes the result set only if and 'the query was made
if (result! = null)
(
result.close ();
)
/ / This closes the if statement and 'opened
if (stat = null)
(
stat.close ();
)
/ / It returns the connection to the pool if and 'opened
if (conn! = null)
(
DBConnessionePool.rilasciaConnessione (conn);
)
)
)
/ * (Non-Javadoc)
* @ See unisa.gps.etour.repository.IDBOperatoreAgenzia # modificaPassword (java.lang.String)
* /
public boolean modificaPassword (BeanOperatoreAgenzia poa) throws SQLException
(
/ / Connect to database
Connection conn = null;
/ / Statement for running queries
Statement stat = null;
/ / Try block which performs the query and the database connection
TRY
(
/ / You get the database connection from the pool
DBConnessionePool.ottieniConnessione conn = ();
/ / Create the statement
stat = conn.createStatement ();
/ / Query
String query = "UPDATE operatoreagenzia SET" + "Password = '"
POa.getPassword + () + " 'WHERE Id =" + pOa.getId ();
/ / You run the query
int i = stat.executeUpdate (query);
return (i == 1);
)
/ / Finally block that contains the instructions to close the connections
/ / Hyenas run in any case
finally
(
/ / This closes the if statement and 'opened
if (stat = null)
(
stat.close ();
)
/ / It returns the connection to the pool if and 'opened
if (conn! = null)
(
DBConnessionePool.rilasciaConnessione (conn);
)
)
)
)
| Code |
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 75