multilingual-ctap-web/src/main/java/com/ctapweb/web/client/component/UserHome.java
private void showUserPage() {

		String historyToken = History.getToken();
		String[] tokenSplit = historyToken.split("\\?");
		String pageToken = tokenSplit[0];

		logger.finer("Displaying " + pageToken + " module...");
		switch (pageToken) {
		case HistoryToken.corpusmanager:
			clearAndAddToMainPanel(new CorpusManager());
			break;
		case HistoryToken.textmanager:
			if (tokenSplit.length > 1) {
				// get the corpus=n part
				String corpusStr[] = tokenSplit[1].split("=");
				if (corpusStr.length > 1 && corpusStr[0].equals("corpusID")) {
					// try to parse the corpusID
					int corpusID;
					try {
						corpusID = Integer.parseInt(corpusStr[1]);
					} catch (NumberFormatException e) {
						logger.warning("CorpusID not a number, please provide correct format (corpusID=x). "
								+ "Redirecting to corpus manager...");
						History.newItem(HistoryToken.corpusmanager);
						break;
					}
					clearAndAddToMainPanel(new TextManager(corpusID));
				} else {
					logger.warning("Incorrect parameter format, text manager accepts only one paramerter in the "
							+ "form of corpusID=x. Redirecting to corpus manager...");
					History.newItem(HistoryToken.corpusmanager);

				}
			} else {
				logger.warning("No corpus ID provided for text manager, redirecting to corpus manager...");
				History.newItem(HistoryToken.corpusmanager);
			}
			break;
		case HistoryToken.featureselector:
			clearAndAddToMainPanel(new FeatureSelector());
			break;
		case HistoryToken.featuresetmanager:
			if (tokenSplit.length > 1) {
				// get the featureSetID=n part
				String featureSetStr[] = tokenSplit[1].split("=");
				if (featureSetStr.length > 1 && featureSetStr[0].equals("featureSetID")) {
					// try to parse the feature set id
					int featureSetID;
					try {
						featureSetID = Integer.parseInt(featureSetStr[1]);
					} catch (NumberFormatException e) {
						logger.warning("Feature set id not a number, please provide correct format (featureSetID=x). "
								+ "Redirecting to feature selector...");
						History.newItem(HistoryToken.featureselector);
						break;
					}
					clearAndAddToMainPanel(new FeatureSetManager(featureSetID));
				} else {
					logger.warning("Incorrect parameter format, feature set manager accepts only one paramerter in the "
							+ "form of featureSetID=x. Redirecting to feature selector...");
					History.newItem(HistoryToken.featureselector);

				}
			} else {
				logger.warning(
						"No feature set ID provided for feature set manager, redirecting to feature selector...");
				History.newItem(HistoryToken.featureselector);
			}
			break;
		case HistoryToken.analysisgenerator:
			clearAndAddToMainPanel(new AnalysisGenerator());
			break;
		case HistoryToken.resultvisualizer:
			clearAndAddToMainPanel(new ResultVisualizer());
			break;
		case HistoryToken.groupsetmanager:
			if (tokenSplit.length > 1) {
				// get the analysisID=n part
				String analysisIDStr[] = tokenSplit[1].split("=");
				if (analysisIDStr.length > 1 && analysisIDStr[0].equals("analysisID")) {
					// try to parse the feature set id
					int analysisID;
					try {
						analysisID = Integer.parseInt(analysisIDStr[1]);
					} catch (NumberFormatException e) {
						logger.warning("Analysis id not a number, please provide correct format (analysisID=x). "
								+ "Redirecting to result visualizer...");
						History.newItem(HistoryToken.resultvisualizer);
						break;
					}
//					clearAndAddToMainPanel(new GroupSetManager(analysisID));
				} else {
					logger.warning("Incorrect parameter format, group set manager accepts only one paramerter in the "
							+ "form of analysisID=x. Redirecting to result visualizer...");
					History.newItem(HistoryToken.resultvisualizer);
				}
			} else {
				logger.warning("No analysis ID provided for feature set manager, redirecting to result visualizer...");
				History.newItem(HistoryToken.resultvisualizer);
			}
			break;
		case HistoryToken.groupmanager:
			if (tokenSplit.length > 1) {
				// get the groupID=n part
				String groupIDStr[] = tokenSplit[1].split("=");
				if (groupIDStr.length > 1 && groupIDStr[0].equals("groupID")) {
					// try to parse the feature set id
					int groupID;
					try {
						groupID = Integer.parseInt(groupIDStr[1]);
					} catch (NumberFormatException e) {
						logger.warning("Group id not a number, please provide correct format (groupID=x). "
								+ "Redirecting to result visualizer...");
						History.newItem(HistoryToken.resultvisualizer);
						break;
					}
//					clearAndAddToMainPanel(new GroupManager(groupID));
				} else {
					logger.warning("Incorrect parameter format, group manager accepts only one paramerter in the "
							+ "form of groupID=x. Redirecting to result visualizer...");
					History.newItem(HistoryToken.resultvisualizer);
				}
			} else {
				logger.warning("No group ID provided for group manager, redirecting to result visualizer...");
				History.newItem(HistoryToken.resultvisualizer);
			}
			break;
		case HistoryToken.editprofile:
			clearAndAddToMainPanel(new EditProfile());
			break;
		case HistoryToken.sendfeedback:
			clearAndAddToMainPanel(new SendFeedback());
			break;
		case HistoryToken.documentation:
			clearAndAddToMainPanel(new Documentation());
			break;
		case HistoryToken.adminDB:
			clearAndAddToMainPanel(new DBManager());
			break;
		case HistoryToken.adminAE:
			clearAndAddToMainPanel(new AdminAE());
			break;

		case HistoryToken.adminCF:
			clearAndAddToMainPanel(new AdminCF());
			break;

		case HistoryToken.userhome:
		case HistoryToken.dashboard:
		default:
			clearAndAddToMainPanel(new Dashboard());

		}

	}
/**
	 * Shows corresponding user page according to history token.
	 */
Shows corresponding user page according to history token.
Shows corresponding user page according to history token .
private void showUserPage() {
		String historyToken = History.getToken();
		String[] tokenSplit = historyToken.split("\\?");
		String pageToken = tokenSplit[0];
		logger.finer("Displaying " + pageToken + " module...");
		switch (pageToken) {
		case HistoryToken.corpusmanager:
			clearAndAddToMainPanel(new CorpusManager());
			break;
		case HistoryToken.textmanager:
			if (tokenSplit.length > 1) {
				String corpusStr[] = tokenSplit[1].split("=");
				if (corpusStr.length > 1 && corpusStr[0].equals("corpusID")) {
					int corpusID;
					try {
						corpusID = Integer.parseInt(corpusStr[1]);
					} catch (NumberFormatException e) {
						logger.warning("CorpusID not a number, please provide correct format (corpusID=x). "
								+ "Redirecting to corpus manager...");
						History.newItem(HistoryToken.corpusmanager);
						break;
					}
					clearAndAddToMainPanel(new TextManager(corpusID));
				} else {
					logger.warning("Incorrect parameter format, text manager accepts only one paramerter in the "
							+ "form of corpusID=x. Redirecting to corpus manager...");
					History.newItem(HistoryToken.corpusmanager);
				}
			} else {
				logger.warning("No corpus ID provided for text manager, redirecting to corpus manager...");
				History.newItem(HistoryToken.corpusmanager);
			}
			break;
		case HistoryToken.featureselector:
			clearAndAddToMainPanel(new FeatureSelector());
			break;
		case HistoryToken.featuresetmanager:
			if (tokenSplit.length > 1) {
				String featureSetStr[] = tokenSplit[1].split("=");
				if (featureSetStr.length > 1 && featureSetStr[0].equals("featureSetID")) {
					int featureSetID;
					try {
						featureSetID = Integer.parseInt(featureSetStr[1]);
					} catch (NumberFormatException e) {
						logger.warning("Feature set id not a number, please provide correct format (featureSetID=x). "
								+ "Redirecting to feature selector...");
						History.newItem(HistoryToken.featureselector);
						break;
					}
					clearAndAddToMainPanel(new FeatureSetManager(featureSetID));
				} else {
					logger.warning("Incorrect parameter format, feature set manager accepts only one paramerter in the "
							+ "form of featureSetID=x. Redirecting to feature selector...");
					History.newItem(HistoryToken.featureselector);
				}
			} else {
				logger.warning(
						"No feature set ID provided for feature set manager, redirecting to feature selector...");
				History.newItem(HistoryToken.featureselector);
			}
			break;
		case HistoryToken.analysisgenerator:
			clearAndAddToMainPanel(new AnalysisGenerator());
			break;
		case HistoryToken.resultvisualizer:
			clearAndAddToMainPanel(new ResultVisualizer());
			break;
		case HistoryToken.groupsetmanager:
			if (tokenSplit.length > 1) {
				String analysisIDStr[] = tokenSplit[1].split("=");
				if (analysisIDStr.length > 1 && analysisIDStr[0].equals("analysisID")) {
					int analysisID;
					try {
						analysisID = Integer.parseInt(analysisIDStr[1]);
					} catch (NumberFormatException e) {
						logger.warning("Analysis id not a number, please provide correct format (analysisID=x). "
								+ "Redirecting to result visualizer...");
						History.newItem(HistoryToken.resultvisualizer);
						break;
					}
				} else {
					logger.warning("Incorrect parameter format, group set manager accepts only one paramerter in the "
							+ "form of analysisID=x. Redirecting to result visualizer...");
					History.newItem(HistoryToken.resultvisualizer);
				}
			} else {
				logger.warning("No analysis ID provided for feature set manager, redirecting to result visualizer...");
				History.newItem(HistoryToken.resultvisualizer);
			}
			break;
		case HistoryToken.groupmanager:
			if (tokenSplit.length > 1) {
				String groupIDStr[] = tokenSplit[1].split("=");
				if (groupIDStr.length > 1 && groupIDStr[0].equals("groupID")) {
					int groupID;
					try {
						groupID = Integer.parseInt(groupIDStr[1]);
					} catch (NumberFormatException e) {
						logger.warning("Group id not a number, please provide correct format (groupID=x). "
								+ "Redirecting to result visualizer...");
						History.newItem(HistoryToken.resultvisualizer);
						break;
					}
				} else {
					logger.warning("Incorrect parameter format, group manager accepts only one paramerter in the "
							+ "form of groupID=x. Redirecting to result visualizer...");
					History.newItem(HistoryToken.resultvisualizer);
				}
			} else {
				logger.warning("No group ID provided for group manager, redirecting to result visualizer...");
				History.newItem(HistoryToken.resultvisualizer);
			}
			break;
		case HistoryToken.editprofile:
			clearAndAddToMainPanel(new EditProfile());
			break;
		case HistoryToken.sendfeedback:
			clearAndAddToMainPanel(new SendFeedback());
			break;
		case HistoryToken.documentation:
			clearAndAddToMainPanel(new Documentation());
			break;
		case HistoryToken.adminDB:
			clearAndAddToMainPanel(new DBManager());
			break;
		case HistoryToken.adminAE:
			clearAndAddToMainPanel(new AdminAE());
			break;
		case HistoryToken.adminCF:
			clearAndAddToMainPanel(new AdminCF());
			break;
		case HistoryToken.userhome:
		case HistoryToken.dashboard:
		default:
			clearAndAddToMainPanel(new Dashboard());
		}
	}
private void showUserPage ( ) { String historyToken = History . getToken ( ) ; String [ ] tokenSplit = historyToken . split ( "\\?" ) ; String pageToken = tokenSplit [ 0 ] ; logger . finer ( "Displaying " + pageToken + " module..." ) ; switch ( pageToken ) { case HistoryToken . corpusmanager : clearAndAddToMainPanel ( new CorpusManager ( ) ) ; break ; case HistoryToken . textmanager : if ( tokenSplit . length > 1 ) { String corpusStr [ ] = tokenSplit [ 1 ] . split ( "=" ) ; if ( corpusStr . length > 1 && corpusStr [ 0 ] . equals ( "corpusID" ) ) { int corpusID ; try { corpusID = Integer . parseInt ( corpusStr [ 1 ] ) ; } catch ( NumberFormatException e ) { logger . warning ( "CorpusID not a number, please provide correct format (corpusID=x). " + "Redirecting to corpus manager..." ) ; History . newItem ( HistoryToken . corpusmanager ) ; break ; } clearAndAddToMainPanel ( new TextManager ( corpusID ) ) ; } else { logger . warning ( "Incorrect parameter format, text manager accepts only one paramerter in the " + "form of corpusID=x. Redirecting to corpus manager..." ) ; History . newItem ( HistoryToken . corpusmanager ) ; } } else { logger . warning ( "No corpus ID provided for text manager, redirecting to corpus manager..." ) ; History . newItem ( HistoryToken . corpusmanager ) ; } break ; case HistoryToken . featureselector : clearAndAddToMainPanel ( new FeatureSelector ( ) ) ; break ; case HistoryToken . featuresetmanager : if ( tokenSplit . length > 1 ) { String featureSetStr [ ] = tokenSplit [ 1 ] . split ( "=" ) ; if ( featureSetStr . length > 1 && featureSetStr [ 0 ] . equals ( "featureSetID" ) ) { int featureSetID ; try { featureSetID = Integer . parseInt ( featureSetStr [ 1 ] ) ; } catch ( NumberFormatException e ) { logger . warning ( "Feature set id not a number, please provide correct format (featureSetID=x). " + "Redirecting to feature selector..." ) ; History . newItem ( HistoryToken . featureselector ) ; break ; } clearAndAddToMainPanel ( new FeatureSetManager ( featureSetID ) ) ; } else { logger . warning ( "Incorrect parameter format, feature set manager accepts only one paramerter in the " + "form of featureSetID=x. Redirecting to feature selector..." ) ; History . newItem ( HistoryToken . featureselector ) ; } } else { logger . warning ( "No feature set ID provided for feature set manager, redirecting to feature selector..." ) ; History . newItem ( HistoryToken . featureselector ) ; } break ; case HistoryToken . analysisgenerator : clearAndAddToMainPanel ( new AnalysisGenerator ( ) ) ; break ; case HistoryToken . resultvisualizer : clearAndAddToMainPanel ( new ResultVisualizer ( ) ) ; break ; case HistoryToken . groupsetmanager : if ( tokenSplit . length > 1 ) { String analysisIDStr [ ] = tokenSplit [ 1 ] . split ( "=" ) ; if ( analysisIDStr . length > 1 && analysisIDStr [ 0 ] . equals ( "analysisID" ) ) { int analysisID ; try { analysisID = Integer . parseInt ( analysisIDStr [ 1 ] ) ; } catch ( NumberFormatException e ) { logger . warning ( "Analysis id not a number, please provide correct format (analysisID=x). " + "Redirecting to result visualizer..." ) ; History . newItem ( HistoryToken . resultvisualizer ) ; break ; } } else { logger . warning ( "Incorrect parameter format, group set manager accepts only one paramerter in the " + "form of analysisID=x. Redirecting to result visualizer..." ) ; History . newItem ( HistoryToken . resultvisualizer ) ; } } else { logger . warning ( "No analysis ID provided for feature set manager, redirecting to result visualizer..." ) ; History . newItem ( HistoryToken . resultvisualizer ) ; } break ; case HistoryToken . groupmanager : if ( tokenSplit . length > 1 ) { String groupIDStr [ ] = tokenSplit [ 1 ] . split ( "=" ) ; if ( groupIDStr . length > 1 && groupIDStr [ 0 ] . equals ( "groupID" ) ) { int groupID ; try { groupID = Integer . parseInt ( groupIDStr [ 1 ] ) ; } catch ( NumberFormatException e ) { logger . warning ( "Group id not a number, please provide correct format (groupID=x). " + "Redirecting to result visualizer..." ) ; History . newItem ( HistoryToken . resultvisualizer ) ; break ; } } else { logger . warning ( "Incorrect parameter format, group manager accepts only one paramerter in the " + "form of groupID=x. Redirecting to result visualizer..." ) ; History . newItem ( HistoryToken . resultvisualizer ) ; } } else { logger . warning ( "No group ID provided for group manager, redirecting to result visualizer..." ) ; History . newItem ( HistoryToken . resultvisualizer ) ; } break ; case HistoryToken . editprofile : clearAndAddToMainPanel ( new EditProfile ( ) ) ; break ; case HistoryToken . sendfeedback : clearAndAddToMainPanel ( new SendFeedback ( ) ) ; break ; case HistoryToken . documentation : clearAndAddToMainPanel ( new Documentation ( ) ) ; break ; case HistoryToken . adminDB : clearAndAddToMainPanel ( new DBManager ( ) ) ; break ; case HistoryToken . adminAE : clearAndAddToMainPanel ( new AdminAE ( ) ) ; break ; case HistoryToken . adminCF : clearAndAddToMainPanel ( new AdminCF ( ) ) ; break ; case HistoryToken . userhome : case HistoryToken . dashboard : default : clearAndAddToMainPanel ( new Dashboard ( ) ) ; } }
Shows corresponding user page according to history token.
Shows corresponding user page according to history token .
// get the corpus=n part // try to parse the corpusID // get the featureSetID=n part // try to parse the feature set id // get the analysisID=n part // try to parse the feature set id //					clearAndAddToMainPanel(new GroupSetManager(analysisID)); // get the groupID=n part // try to parse the feature set id //					clearAndAddToMainPanel(new GroupManager(groupID));