[jboss-svn-commits] JBL Code SVN: r5368 - in labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme: . gwt/client services

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jul 31 17:00:19 EDT 2006


Author: szimano
Date: 2006-07-31 17:00:05 -0400 (Mon, 31 Jul 2006)
New Revision: 5368

Added:
   labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/AddTagsPanel.java
   labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/BrowseTagsPanel.java
   labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/SearchTagsPanel.java
Modified:
   labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/TagMeServlet.java
   labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/DeleteTagClickListener.java
   labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/SearchListener.java
   labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/TagMeClickListener.java
   labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/TagMeShowPopupListener.java
   labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/TaggingService.java
   labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/TaggingServiceAsync.java
   labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/services/ShotokuTaggingService.java
   labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/services/TagMeTagger.java
Log:
new mockups compatibility


Modified: labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/TagMeServlet.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/TagMeServlet.java	2006-07-31 20:59:07 UTC (rev 5367)
+++ labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/TagMeServlet.java	2006-07-31 21:00:05 UTC (rev 5368)
@@ -145,14 +145,14 @@
 		return vect;
 	}
 
-	public Vector getAllTags(String clas) {
+	public Vector getAllTags(String resourceId, String clas) {
 		Vector vect = null;
 
 		try {
 			TagMeTagger tagger = (TagMeTagger) Class.forName(clas)
 					.newInstance();
 
-			vect = tagger.getAllTags();
+			vect = tagger.getAllTags(resourceId);
 		} catch (InstantiationException e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();

Added: labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/AddTagsPanel.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/AddTagsPanel.java	2006-07-31 20:59:07 UTC (rev 5367)
+++ labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/AddTagsPanel.java	2006-07-31 21:00:05 UTC (rev 5368)
@@ -0,0 +1,230 @@
+package org.jboss.labs.tagme.gwt.client;
+
+import java.util.Vector;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.rpc.ServiceDefTarget;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.CheckBox;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.FlexTable;
+import com.google.gwt.user.client.ui.HasHorizontalAlignment;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.ListBox;
+import com.google.gwt.user.client.ui.TextBox;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class AddTagsPanel extends VerticalPanel {
+	private String path;
+
+	private String user;
+
+	private String clas;
+
+	private boolean website;
+
+	private TagMeShowPopupListener parent;
+
+	private LabsDialogBox dialog;
+
+	private ListBox allTagsBox;
+
+	private ListBox suggBox;
+
+	private Button saveBtn;
+
+	private Label info;
+
+	public AddTagsPanel(String path, String user, String clas, boolean website,
+			TagMeShowPopupListener parent, LabsDialogBox dialog) {
+
+		this.path = path;
+		this.user = user;
+		this.clas = clas;
+		this.website = website;
+		this.parent = parent;
+		this.dialog = dialog;
+
+		buildGui();
+	}
+
+	private void buildGui() {
+		VerticalPanel panel = new VerticalPanel();
+		
+		info = new Label();
+		
+		panel.add(info);
+
+		VerticalPanel input = new VerticalPanel();
+		input.add(new Label("Add a Tag:"));
+		HorizontalPanel customs = new HorizontalPanel();
+		VerticalPanel boxes = new VerticalPanel();
+		VerticalPanel descriptions = new VerticalPanel();
+
+		customs.add(boxes);
+		customs.add(descriptions);
+		input.add(customs);
+
+		suggBox = new ListBox();
+		suggBox.setVisibleItemCount(5);
+		suggBox.setMultipleSelect(true);
+		
+		allTagsBox = new ListBox();
+		allTagsBox.setVisibleItemCount(5);
+		allTagsBox.setMultipleSelect(true);
+		
+
+		FlexTable boxesAndDesc = new FlexTable();
+		
+		boxesAndDesc.setWidget(0, 0, new Label("All tags"));
+		boxesAndDesc.setWidget(1, 0, allTagsBox);
+		boxesAndDesc.setWidget(0, 1, new Label("Sugestions"));
+		boxesAndDesc.setWidget(1, 1, suggBox);
+		
+		DOM.setAttribute(allTagsBox.getElement(), "id", "alltags");
+		DOM.setAttribute(suggBox.getElement(), "id", "alltags");
+
+		panel.add(boxesAndDesc);
+
+		Vector textBoxes = new Vector();
+		Vector descBoxes = new Vector();
+
+		for (int i = 0; i < 3; i++) {
+			TextBox box = new TextBox();
+			TextBox desc = new TextBox();
+
+			textBoxes.add(box);
+			descBoxes.add(desc);
+
+			boxes.add(new Label("Name"));
+			boxes.add(box);
+
+			descriptions.add(new Label("Description"));
+			descriptions.add(desc);
+		}
+
+		panel.add(input);
+
+		HorizontalPanel btnPanel = new HorizontalPanel();
+		btnPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
+		
+		this.saveBtn = new Button(TagMeShowPopupListener.SAVE_BTN, new TagMeClickListener(path, user,
+				clas, textBoxes, descBoxes, info, suggBox, allTagsBox, parent,
+				website));
+		btnPanel.add(saveBtn);
+		
+		saveBtn.setStyleName("button");
+
+		Button closeBtn = new Button(TagMeShowPopupListener.CANCEL_BTN, new ClickListener() {
+
+			public void onClick(Widget sender) {
+				dialog.hide();
+			}
+
+		});
+
+		closeBtn.setStyleName("button");
+
+		btnPanel.add(closeBtn);
+	
+
+		LabsSimplePanel outlinePanel = new LabsSimplePanel();
+
+		outlinePanel.add(panel);
+
+		DOM.setAttribute(outlinePanel.getElement(), "id", "tagmeoutline");
+
+		this.add(outlinePanel);
+		this.add(btnPanel);
+		
+	}
+
+	public void refreshSugestions() {
+		suggBox.setEnabled(true);
+
+		suggBox.clear();
+
+		TaggingServiceAsync tagging = (TaggingServiceAsync) GWT
+				.create(TaggingService.class);
+
+		ServiceDefTarget endpoint = (ServiceDefTarget) tagging;
+		endpoint.setServiceEntryPoint("/tagme-servlet/tag/");
+
+		AsyncCallback callback = new AsyncCallback() {
+			public void onSuccess(Object result) {
+				Vector vect = (Vector) result;
+
+				if (vect.size() > 0) {
+					int rowLen = (int) Math.sqrt(vect.size());
+
+					for (int i = 0; i < vect.size(); i++) {
+						suggBox.addItem((String) vect.get(i));
+					}
+				} else {
+					suggBox.addItem("No suggestions");
+					suggBox.setEnabled(false);
+				}
+			}
+
+			public void onFailure(Throwable caught) {
+				Window.alert("Error ! " + caught.getMessage() + " Throwable: "
+						+ caught);
+			}
+		};
+
+		// call AJAX methos, after that callback is going to be executed
+		tagging.getSugestions(path, clas, callback);
+	}
+
+	public void refreshAllTags() {
+		allTagsBox.clear();
+		allTagsBox.setEnabled(true);
+		
+		TaggingServiceAsync tagging = (TaggingServiceAsync) GWT
+				.create(TaggingService.class);
+
+		ServiceDefTarget endpoint = (ServiceDefTarget) tagging;
+		endpoint.setServiceEntryPoint("/tagme-servlet/tag/");
+
+		AsyncCallback callback = new AsyncCallback() {
+			public void onSuccess(Object result) {
+				Vector res = (Vector) result;
+
+				for (int i = 0; i < res.size(); i++) {
+					allTagsBox.addItem(res.get(i).toString());
+				}
+				
+				if (res.size() == 0) {
+					allTagsBox.addItem("No tags yet");
+					allTagsBox.setEnabled(false);
+				}
+			}
+
+			public void onFailure(Throwable caught) {
+				Window.alert("Error ! " + caught.getMessage() + " Throwable: "
+						+ caught);
+			}
+		};
+
+		// call AJAX methos, after that callback is going to be executed
+		tagging.getAllTags(path, clas, callback);
+	}
+	
+	public void refreshTags() {
+		refreshAllTags();
+		refreshSugestions();
+	}
+
+	public void setInfo(String text) {
+		info.setText(text);
+	}
+
+	public String getInfo() {
+		return info.getText();
+	}
+}

Added: labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/BrowseTagsPanel.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/BrowseTagsPanel.java	2006-07-31 20:59:07 UTC (rev 5367)
+++ labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/BrowseTagsPanel.java	2006-07-31 21:00:05 UTC (rev 5368)
@@ -0,0 +1,289 @@
+package org.jboss.labs.tagme.gwt.client;
+
+import java.util.HashMap;
+import java.util.Vector;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.rpc.ServiceDefTarget;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.FlexTable;
+import com.google.gwt.user.client.ui.HTMLTable;
+import com.google.gwt.user.client.ui.HasHorizontalAlignment;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class BrowseTagsPanel extends VerticalPanel {
+
+	private String path;
+
+	private String currentUser;
+
+	private String clas;
+
+	private HTMLTable table;
+
+	private Label info;
+
+	private boolean website;
+
+	private TagMeShowPopupListener parent;
+
+	private LabsDialogBox dialog;
+
+	public BrowseTagsPanel(String path, String user, String clas,
+			boolean website, TagMeShowPopupListener parent, LabsDialogBox dialog) {
+
+		this.path = path;
+		this.currentUser = user;
+		this.clas = clas;
+		this.website = website;
+		this.parent = parent;
+		this.dialog = dialog;
+
+		buildGui();
+	}
+
+	
+	public void setInfo(String infoText) {
+		info.setText(infoText);
+	}
+
+	public String getInfo() {
+		return info.getText();
+	}
+
+	private void buildGui() {
+		VerticalPanel panel = new VerticalPanel();
+
+		info = new Label();
+
+		panel.add(info);
+
+		table = new FlexTable();
+
+		table.setStyleName("tagmetable");
+
+		table.setCellSpacing(0);
+		table.setBorderWidth(0);
+
+		LabsSimplePanel tagTableDiv = new LabsSimplePanel();
+
+		tagTableDiv.add(table);
+		DOM.setAttribute(tagTableDiv.getElement(), "id", "tagTableDiv");
+
+		panel.add(tagTableDiv);
+		
+		Button addATag = new Button("Add a Tag", new ClickListener() {
+
+			public void onClick(Widget sender) {
+				parent.switchTab(TagMeShowPopupListener.ADDTAG_TAB);
+			}
+			
+		});
+		
+		addATag.setStyleName("button");
+		
+		panel.add(addATag);
+
+		HorizontalPanel btnPanel = new HorizontalPanel();
+		btnPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
+
+		Button saveBtn = new Button(TagMeShowPopupListener.SAVE_BTN);
+		
+		saveBtn.setStyleName("buttonNotEnabled");
+		
+		saveBtn.setEnabled(false);
+
+		Button closeBtn = new Button(TagMeShowPopupListener.CANCEL_BTN, new ClickListener() {
+
+			public void onClick(Widget sender) {
+				dialog.hide();
+			}
+
+		});
+
+		closeBtn.setStyleName("button");
+
+		btnPanel.add(saveBtn);
+		btnPanel.add(closeBtn);
+
+		LabsSimplePanel outlinePanel = new LabsSimplePanel();
+
+		outlinePanel.add(panel);
+
+		DOM.setAttribute(outlinePanel.getElement(), "id", "tagmeoutline");
+
+		this.add(outlinePanel);
+		this.add(btnPanel);
+	}
+
+	public void refreshTags() {
+
+		TaggingServiceAsync tagging = (TaggingServiceAsync) GWT
+				.create(TaggingService.class);
+
+		ServiceDefTarget endpoint = (ServiceDefTarget) tagging;
+		endpoint.setServiceEntryPoint("/tagme-servlet/tag/");
+
+		AsyncCallback callback = new AsyncCallback() {
+			public void onSuccess(Object result) {
+				Vector vect = (Vector) result;
+
+				table.setHTML(0, 0, "# Subscribers");
+				table.setHTML(0, 1, "Author");
+				table.setHTML(0, 2, "Tags");
+
+				table.getCellFormatter()
+						.setStyleName(0, 0, "tagmetable-header");
+				table.getCellFormatter()
+						.setStyleName(0, 1, "tagmetable-header");
+				table.getCellFormatter().setStyleName(0, 2,
+						"tagmetable-headernr");
+
+				HashMap rows = new HashMap();
+
+				int rowsNum = 0;
+
+				for (int i = 0; i < vect.size(); i++) {
+					String[] to = ((String) vect.get(i))
+							.split(TagMeClickListener.TAG_SEP);
+
+					String tag = to[0];
+					String user = to[1];
+					String fullName = to[2];
+					String feed = to[3];
+					String authorFeed = to[4];
+					String authorUniqueFeed = to[5];
+					String allResFeed = to[6];
+					String desc = to[7];
+					int subsc = Integer.parseInt(to[8]);
+
+					if (!rows.keySet().contains(user)) {
+						rows.put(user, new Integer(rowsNum + 1));
+						table.setHTML(rowsNum + 1, 0, String.valueOf(subsc));
+						table.setWidget(++rowsNum, 1, parent.getAuthorLink(
+								fullName, user, authorFeed, authorUniqueFeed));
+
+						// delete all cells (if they are any from last
+						// refreshing)
+						// while (table.getCellCount(rowsNum) > 2) {
+						// table.removeCell(rowsNum, table
+						// .getCellCount(rowsNum) - 1);
+						// }
+
+						table.setWidget(rowsNum, 2, new VerticalPanel());
+
+					}
+
+					int curRow = ((Integer) rows.get(user)).intValue();
+
+					VerticalPanel tagPanel = (VerticalPanel) table.getWidget(
+							curRow, 2);
+
+					if (currentUser.equals(user)) {
+						// current user - add delete button
+						Image im = new Image("/tagme-servlet/images/delete.gif");
+						im.setStyleName("tagme_btn");
+
+						HorizontalPanel hpanel = new HorizontalPanel();
+
+						hpanel.add(parent.getLink(desc, feed, allResFeed, tag,
+								user));
+
+						hpanel.add(im);
+
+						im.addClickListener(new DeleteTagClickListener(user,
+								tag, path, parent, clas));
+
+						// table.setWidget(curRow, table.getCellCount(curRow),
+						// hpanel);
+
+						tagPanel.add(hpanel);
+					} else {
+						// just show tag
+						// table.setWidget(curRow, table.getCellCount(curRow),
+						// getLink(desc, feed, allResFeed, tag, user));
+						tagPanel.add(parent.getLink(desc, feed, allResFeed,
+								tag, user));
+					}
+				}
+
+				/*
+				 * if ((rowsNum + 1) < table.getRowCount()) { for (int i =
+				 * rowsNum + 1; i < table.getRowCount(); i++) { for (int j = 0;
+				 * j < table.getCellCount(i); j++) { table.setWidget(i, j, new
+				 * Label("")); } } } // add all non-existing tds // find the
+				 * longest one int cellMax = 0; for (int i = 0; i <
+				 * table.getRowCount(); i++) { if (cellMax <
+				 * table.getCellCount(i)) { cellMax = table.getCellCount(i); } } //
+				 * make all rows same length
+				 * 
+				 * for (int i = 0; i < table.getRowCount(); i++) { for (int j =
+				 * table.getCellCount(i); j < cellMax; j++) { table.setWidget(i,
+				 * j, new HTML("&nbsp;"));
+				 * 
+				 * if (i == 0) { table.getCellFormatter().setStyleName(i, j,
+				 * "tagmetable-headernr"); } } }
+				 */
+
+				// set styles
+				for (int i = 1; i < table.getRowCount(); i++) {
+
+					switch (i % 2) {
+					case 0:
+						table.getRowFormatter().setStyleName(i,
+								"tagmetable-rowgrey");
+						break;
+					case 1:
+						table.getRowFormatter().setStyleName(i,
+								"tagmetable-rowwhite");
+						break;
+					}
+
+					for (int j = 0; j < 2 && j < table.getCellCount(i); j++) {
+						switch (i % 2) {
+						case 0:
+							table.getCellFormatter().setStyleName(i, j,
+									"tagmetable-stripegrey");
+							break;
+						case 1:
+							table.getCellFormatter().setStyleName(i, j,
+									"tagmetable-stripewhite");
+							break;
+						}
+					}
+
+					for (int j = 2; j < table.getCellCount(i); j++) {
+						switch (i % 2) {
+						case 0:
+							table.getCellFormatter().setStyleName(i, j,
+									"tagmetable-stripegreynr");
+							break;
+						case 1:
+							table.getCellFormatter().setStyleName(i, j,
+									"tagmetable-stripewhitenr");
+							break;
+						}
+					}
+				}
+			}
+
+			public void onFailure(Throwable caught) {
+				Window.alert("Error ! " + caught.getMessage() + " Throwable: "
+						+ caught);
+			}
+		};
+
+		// call AJAX methos, after that callback is going to be executed
+		tagging.getTags(path, clas, callback);
+
+	}
+
+}

Modified: labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/DeleteTagClickListener.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/DeleteTagClickListener.java	2006-07-31 20:59:07 UTC (rev 5367)
+++ labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/DeleteTagClickListener.java	2006-07-31 21:00:05 UTC (rev 5368)
@@ -60,6 +60,7 @@
 			AsyncCallback callback = new AsyncCallback() {
 
 				public void onSuccess(Object result) {
+					Window.alert("bleh");
 					parent.stopProgressAnim("Tag deleted");
 					parent.refreshTags();
 				}

Modified: labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/SearchListener.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/SearchListener.java	2006-07-31 20:59:07 UTC (rev 5367)
+++ labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/SearchListener.java	2006-07-31 21:00:05 UTC (rev 5368)
@@ -1,5 +1,8 @@
 package org.jboss.labs.tagme.gwt.client;
 
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
 import java.util.Vector;
 
 import com.google.gwt.core.client.GWT;
@@ -29,25 +32,28 @@
 	private TextBox keyword;
 
 	private HTML bio;
-	
+
 	private Button button;
 
-	public SearchListener(VerticalPanel results, TextBox tags, TextBox author,
-			TextBox keyword, String clas, HTML bio) {
+	private VerticalPanel authorList;
+
+	public SearchListener(VerticalPanel results, VerticalPanel authorList,
+			TextBox tags, TextBox author, TextBox keyword, String clas, HTML bio) {
 		this.results = results;
 		this.clas = clas;
 		this.tags = tags;
 		this.keyword = keyword;
 		this.author = author;
 		this.bio = bio;
+		this.authorList = authorList;
 	}
 
 	public void onClick(Widget sender) {
 		results.clear();
 		bio.setHTML(" ");
-		
-		button = ((Button)sender);
-		
+
+		button = ((Button) sender);
+
 		button.setEnabled(false);
 
 		TaggingServiceAsync tagging = (TaggingServiceAsync) GWT
@@ -63,19 +69,29 @@
 				String last = "";
 				boolean oneAuthor = true;
 
-				for (int i = 0; i < res.size(); i += 5) {
+				Set allAuthors = new HashSet();
 
+				for (int i = 0; i < res.size(); i += 8) {
+
 					String tag = (String) res.get(i);
 					String author = (String) res.get(i + 1);
 					String desc = (String) res.get(i + 2);
 					String feed = (String) res.get(i + 3);
 					String allResFeed = (String) res.get(i + 4);
+					String authorFull = (String) res.get(i + 5);
+					String authorUnique = (String) res.get(i + 6);
+					String authorAll = (String) res.get(i + 7);
 
 					if (oneAuthor && last.equals("")) {
 						last = author.toString();
+						allAuthors.add(TagMeShowPopupListener.getAuthorLink(
+								authorFull, author, authorAll, authorUnique));
 					} else if (oneAuthor) {
 						if (!last.equals(author)) {
 							oneAuthor = false;
+							allAuthors.add(TagMeShowPopupListener
+									.getAuthorLink(authorFull, author,
+											authorAll, authorUnique));
 						}
 					}
 
@@ -93,8 +109,15 @@
 
 				if (oneAuthor && res.size() > 0) {
 					getBio(last);
+				} else if (!oneAuthor && res.size() > 0) {
+					Iterator it = allAuthors.iterator();
+
+					while (it.hasNext()) {
+						HTML author = (HTML) it.next();
+						authorList.add(author);
+					}
 				}
-				
+
 				button.setEnabled(true);
 
 			}
@@ -102,7 +125,7 @@
 			public void onFailure(Throwable caught) {
 				Window.alert("Error ! " + caught.getMessage() + " Throwable: "
 						+ caught);
-				
+
 				button.setEnabled(true);
 			}
 		};

Added: labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/SearchTagsPanel.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/SearchTagsPanel.java	2006-07-31 20:59:07 UTC (rev 5367)
+++ labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/SearchTagsPanel.java	2006-07-31 21:00:05 UTC (rev 5368)
@@ -0,0 +1,103 @@
+package org.jboss.labs.tagme.gwt.client;
+
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.TextBox;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class SearchTagsPanel extends VerticalPanel {
+	private String path;
+
+	private String user;
+
+	private String clas;
+
+	private boolean website;
+
+	private TagMeShowPopupListener parent;
+
+	private LabsDialogBox dialog;
+
+	private HTML bio;
+
+	private VerticalPanel authorList;
+
+	public SearchTagsPanel(String path, String user, String clas,
+			boolean website, TagMeShowPopupListener parent, LabsDialogBox dialog) {
+
+		this.path = path;
+		this.user = user;
+		this.clas = clas;
+		this.website = website;
+		this.parent = parent;
+		this.dialog = dialog;
+
+		buildGui();
+	}
+
+	private void buildGui() {
+		VerticalPanel searchPanel = new VerticalPanel();
+		searchPanel
+				.add(new Label(
+						"Search for tagged content by tag name, author or keyword search of the description"));
+		searchPanel.add(new Label("Tag"));
+		TextBox tags = new TextBox();
+		tags.setText("");
+		searchPanel.add(tags);
+		searchPanel.add(new Label("Author"));
+		TextBox author = new TextBox();
+		author.setText("");
+		searchPanel.add(author);
+		searchPanel.add(new Label("Keyword"));
+		TextBox keyword = new TextBox();
+		keyword.setText("");
+		searchPanel.add(keyword);
+
+		bio = new HTML();
+
+		searchPanel.add(bio);
+
+		authorList = new VerticalPanel();
+		
+		searchPanel.add(authorList);
+
+		searchPanel.add(new HTML(
+				"<div class=\"tagme-search-results\">Search results</div>"));
+
+		VerticalPanel results = new VerticalPanel();
+
+		searchPanel.add(results);
+
+		HorizontalPanel buttons = new HorizontalPanel();
+
+		Button searchBtn = new Button(TagMeShowPopupListener.SEARCH_BTN,
+				new SearchListener(results, authorList, tags, author, keyword,
+						clas, bio));
+
+		searchBtn.setStyleName("button");
+
+		buttons.add(searchBtn);
+
+		searchPanel.add(buttons);
+
+		Button closeBtn = new Button(TagMeShowPopupListener.CANCEL_BTN,
+				new ClickListener() {
+
+					public void onClick(Widget sender) {
+						dialog.hide();
+					}
+
+				});
+		closeBtn.setStyleName("button");
+
+		buttons.add(closeBtn);
+
+		searchPanel.add(buttons);
+
+		this.add(searchPanel);
+	}
+}

Modified: labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/TagMeClickListener.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/TagMeClickListener.java	2006-07-31 20:59:07 UTC (rev 5367)
+++ labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/TagMeClickListener.java	2006-07-31 21:00:05 UTC (rev 5368)
@@ -24,7 +24,6 @@
 import java.util.Vector;
 
 import com.google.gwt.core.client.GWT;
-import com.google.gwt.user.client.Timer;
 import com.google.gwt.user.client.Window;
 import com.google.gwt.user.client.rpc.AsyncCallback;
 import com.google.gwt.user.client.rpc.ServiceDefTarget;
@@ -32,6 +31,7 @@
 import com.google.gwt.user.client.ui.CheckBox;
 import com.google.gwt.user.client.ui.ClickListener;
 import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.ListBox;
 import com.google.gwt.user.client.ui.TextBox;
 import com.google.gwt.user.client.ui.Widget;
 
@@ -55,21 +55,23 @@
 
 	private TagMeShowPopupListener parent;
 
-	private Vector suggestionCheckboxes;
+	private ListBox suggBox;
 
+	private ListBox allTagsBox;
+
 	private boolean website;
 
 	public TagMeClickListener(String path, String user, String clas,
-			Vector textBoxes, Vector descBoxes, Label info,
-			Vector suggestionCheckboxes, TagMeShowPopupListener parent,
-			boolean website) {
+			Vector textBoxes, Vector descBoxes, Label info, ListBox suggBox,
+			ListBox allTagsBox, TagMeShowPopupListener parent, boolean website) {
 		this.path = path;
 		this.user = user;
 		this.textBoxes = textBoxes;
 		this.clas = clas;
 		this.info = info;
 		this.parent = parent;
-		this.suggestionCheckboxes = suggestionCheckboxes;
+		this.suggBox = suggBox;
+		this.allTagsBox = allTagsBox;
 		this.descBoxes = descBoxes;
 		this.website = website;
 	}
@@ -97,7 +99,8 @@
 			}
 
 			public void onFailure(Throwable caught) {
-				Window.alert("Please fill in at least one tag or check at least one suggestion (if available)");
+				Window
+						.alert("Please fill in at least one tag or check at least one suggestion (if available)");
 				parent.stopProgressAnim("Error while adding tags");
 			}
 		};
@@ -127,20 +130,34 @@
 			}
 		}
 
-		for (int i = 0; i < suggestionCheckboxes.size(); i++) {
-			CheckBox chBox = (CheckBox) suggestionCheckboxes.get(i);
+		// suggboxes
+		for (int i = 0; i < suggBox.getItemCount(); i++) {
 
-			if (chBox.isChecked()) {
+			if (suggBox.isItemSelected(i)) {
 				if (tags.length() == 0) {
-					tags = chBox.getText();
-					descs = chBox.getText();
+					tags = suggBox.getItemText(i);
+					descs = suggBox.getItemText(i);
 				} else {
-					tags += TAG_SEP + chBox.getText();
-					descs += TAG_SEP + chBox.getText();
+					tags += TAG_SEP + suggBox.getItemText(i);
+					descs += TAG_SEP + suggBox.getItemText(i);
 				}
 			}
 		}
 
+		// all tags boxes
+		for (int i = 0; i < allTagsBox.getItemCount(); i++) {
+
+			if (allTagsBox.isItemSelected(i)) {
+				if (tags.length() == 0) {
+					tags = allTagsBox.getItemText(i);
+					descs = allTagsBox.getItemText(i);
+				} else {
+					tags += TAG_SEP + allTagsBox.getItemText(i);
+					descs += TAG_SEP + allTagsBox.getItemText(i);
+				}
+			}
+		}
+
 		tagging.addTag(user, path, clas, tags, descs, website, callback);
 
 	}

Modified: labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/TagMeShowPopupListener.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/TagMeShowPopupListener.java	2006-07-31 20:59:07 UTC (rev 5367)
+++ labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/TagMeShowPopupListener.java	2006-07-31 21:00:05 UTC (rev 5368)
@@ -21,28 +21,13 @@
  */
 package org.jboss.labs.tagme.gwt.client;
 
-import java.util.HashMap;
-import java.util.Vector;
-
-import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
 import com.google.gwt.user.client.Timer;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.google.gwt.user.client.rpc.ServiceDefTarget;
 import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.CheckBox;
 import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.FlexTable;
 import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.HorizontalPanel;
 import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.ListBox;
 import com.google.gwt.user.client.ui.TabPanel;
-import com.google.gwt.user.client.ui.TextBox;
-import com.google.gwt.user.client.ui.VerticalPanel;
 import com.google.gwt.user.client.ui.Widget;
 
 public class TagMeShowPopupListener implements ClickListener {
@@ -57,24 +42,35 @@
 
 	private String clas;
 
-	private Label info;
+	private Button saveBtn;
 
-	private FlexTable table;
+	private Image parentButton;
 
-	private Button saveBtn;
+	private boolean website;
 
-	private FlexTable suggTable;
+	private BrowseTagsPanel browseTags;
 
-	private HTML bio;
+	private LabsDialogBox dialog;
 
-	private Vector suggestionCheckboxes;
+	private AddTagsPanel addTags;
 
-	private Image parentButton;
+	private SearchTagsPanel searchTags;
 
-	private ListBox listBox;
+	private TabPanel tabs;
+	
+	public final static String SAVE_BTN = "Save";
+	
+	public final static String CANCEL_BTN = "Cancel";
 
-	private boolean website;
+	public static final byte BROWSE_TAB = 0;
 
+	public static final byte ADDTAG_TAB = 1;
+
+	public static final byte SEARCH_TAB = 2;
+
+	public static final String SEARCH_BTN = "Search";
+	
+
 	public TagMeShowPopupListener(String path, String user, String clas,
 			Image parentButton, boolean website) {
 		this.path = path;
@@ -88,244 +84,6 @@
 		return this;
 	}
 
-	public void refreshSugestions() {
-		suggestionCheckboxes = new Vector();
-
-		while (suggTable.getRowCount() > 0) {
-			suggTable.removeRow(0);
-		}
-
-		TaggingServiceAsync tagging = (TaggingServiceAsync) GWT
-				.create(TaggingService.class);
-
-		ServiceDefTarget endpoint = (ServiceDefTarget) tagging;
-		endpoint.setServiceEntryPoint("/tagme-servlet/tag/");
-
-		AsyncCallback callback = new AsyncCallback() {
-			public void onSuccess(Object result) {
-				Vector vect = (Vector) result;
-
-				if (vect.size() > 0) {
-					int rowLen = (int) Math.sqrt(vect.size());
-
-					for (int i = 0; i < vect.size(); i++) {
-						CheckBox chBox = new CheckBox((String) vect.get(i));
-						suggTable.setWidget(i / rowLen, i % rowLen, chBox);
-						suggestionCheckboxes.add(chBox);
-					}
-				} else {
-					suggTable.setHTML(0, 0,
-							"<i>There are no suggestions available</i>");
-				}
-			}
-
-			public void onFailure(Throwable caught) {
-				Window.alert("Error ! " + caught.getMessage() + " Throwable: "
-						+ caught);
-			}
-		};
-
-		// call AJAX methos, after that callback is going to be executed
-		tagging.getSugestions(path, clas, callback);
-	}
-
-	public void refreshAllTags() {
-		listBox.clear();
-
-		TaggingServiceAsync tagging = (TaggingServiceAsync) GWT
-				.create(TaggingService.class);
-
-		ServiceDefTarget endpoint = (ServiceDefTarget) tagging;
-		endpoint.setServiceEntryPoint("/tagme-servlet/tag/");
-
-		AsyncCallback callback = new AsyncCallback() {
-			public void onSuccess(Object result) {
-				Vector res = (Vector) result;
-
-				for (int i = 0; i < res.size(); i++) {
-					listBox.addItem(res.get(i).toString());
-				}
-			}
-
-			public void onFailure(Throwable caught) {
-				Window.alert("Error ! " + caught.getMessage() + " Throwable: "
-						+ caught);
-			}
-		};
-
-		// call AJAX methos, after that callback is going to be executed
-		tagging.getAllTags(clas, callback);
-	}
-
-	public void refreshTags() {
-
-		TaggingServiceAsync tagging = (TaggingServiceAsync) GWT
-				.create(TaggingService.class);
-
-		ServiceDefTarget endpoint = (ServiceDefTarget) tagging;
-		endpoint.setServiceEntryPoint("/tagme-servlet/tag/");
-
-		AsyncCallback callback = new AsyncCallback() {
-			public void onSuccess(Object result) {
-				Vector vect = (Vector) result;
-
-				table.setHTML(0, 0, "# Subscribers");
-				table.setHTML(0, 1, "Author");
-				table.setHTML(0, 2, "Tags");
-
-				table.getCellFormatter()
-						.setStyleName(0, 0, "tagmetable-header");
-				table.getCellFormatter()
-						.setStyleName(0, 1, "tagmetable-header");
-				table.getCellFormatter().setStyleName(0, 2,
-						"tagmetable-headernr");
-
-				HashMap rows = new HashMap();
-
-				int rowsNum = 0;
-
-				for (int i = 0; i < vect.size(); i++) {
-					String[] to = ((String) vect.get(i))
-							.split(TagMeClickListener.TAG_SEP);
-
-					String tag = to[0];
-					String user = to[1];
-					String fullName = to[2];
-					String feed = to[3];
-					String authorFeed = to[4];
-					String authorUniqueFeed = to[5];
-					String allResFeed = to[6];
-					String desc = to[7];
-					int subsc = Integer.parseInt(to[8]);
-
-					if (!rows.keySet().contains(user)) {
-						rows.put(user, new Integer(rowsNum + 1));
-						table.setHTML(rowsNum + 1, 0, String.valueOf(subsc));
-						table.setWidget(++rowsNum, 1, getAuthorLink(fullName,
-								user, authorFeed, authorUniqueFeed));
-
-						// delete all cells (if they are any from last
-						// refreshing)
-						while (table.getCellCount(rowsNum) > 2) {
-							table.removeCell(rowsNum, table
-									.getCellCount(rowsNum) - 1);
-						}
-
-					}
-
-					int curRow = ((Integer) rows.get(user)).intValue();
-
-					if (user.equals(currentUser)) {
-						// current user - add delete button
-						Image im = new Image("/tagme-servlet/images/delete.gif");
-						im.setStyleName("tagme_btn");
-
-						HorizontalPanel hpanel = new HorizontalPanel();
-
-						hpanel.add(getLink(desc, feed, allResFeed, tag, user));
-
-						hpanel.add(im);
-
-						im.addClickListener(new DeleteTagClickListener(
-								currentUser, tag, path, getMyself(), clas));
-
-						table.setWidget(curRow, table.getCellCount(curRow),
-								hpanel);
-					} else {
-						// just show tag
-						table.setWidget(curRow, table.getCellCount(curRow),
-								getLink(desc, feed, allResFeed, tag, user));
-					}
-				}
-
-				if ((rowsNum + 1) < table.getRowCount()) {
-					for (int i = rowsNum + 1; i < table.getRowCount(); i++) {
-						for (int j = 0; j < table.getCellCount(i); j++) {
-							table.setWidget(i, j, new Label(""));
-						}
-					}
-				}
-				
-				// add all non-existing tds
-				
-				// find the longest one
-				int cellMax = 0;
-				for (int i = 0; i < table.getRowCount(); i++) {
-					if (cellMax < table.getCellCount(i)) {
-						cellMax = table.getCellCount(i);
-					}
-				}
-				
-				// make all rows same length
-				
-				for (int i = 0; i < table.getRowCount(); i++) {
-					for (int j = table.getCellCount(i); j < cellMax; j++) {
-						table.setWidget(i, j, new HTML("&nbsp;"));
-						
-						if (i == 0) {
-							table.getCellFormatter().setStyleName(i, j, "tagmetable-headernr");
-						}
-					}
-				}
-
-				// set styles
-				for (int i = 1; i < table.getRowCount(); i++) {
-
-					switch (i % 2) {
-					case 0:
-						table.getRowFormatter().setStyleName(i,
-								"tagmetable-rowgrey");
-						break;
-					case 1:
-						table.getRowFormatter().setStyleName(i,
-								"tagmetable-rowwhite");
-						break;
-					}
-
-					for (int j = 0; j < 2 && j < table.getCellCount(i); j++) {
-						switch (i % 2) {
-						case 0:
-							table.getCellFormatter().setStyleName(i, j,
-									"tagmetable-stripegrey");
-							break;
-						case 1:
-							table.getCellFormatter().setStyleName(i, j,
-									"tagmetable-stripewhite");
-							break;
-						}
-					}
-
-					for (int j = 2; j < table.getCellCount(i); j++) {
-						switch (i % 2) {
-						case 0:
-							table.getCellFormatter().setStyleName(i, j,
-									"tagmetable-stripegreynr");
-							break;
-						case 1:
-							table.getCellFormatter().setStyleName(i, j,
-									"tagmetable-stripewhitenr");
-							break;
-						}
-					}
-				}
-			}
-
-			public void onFailure(Throwable caught) {
-				Window.alert("Error ! " + caught.getMessage() + " Throwable: "
-						+ caught);
-			}
-		};
-
-		// call AJAX methos, after that callback is going to be executed
-		tagging.getTags(path, clas, callback);
-
-		// refresh tags also
-		refreshSugestions();
-
-		// refresh all tags list
-		refreshAllTags();
-	}
-
 	public static HTML getLink(String desc, String feed, String allResFeed,
 			String tag, String user) {
 		HTML link = new HTML("<a href='" + /* feed */""
@@ -351,170 +109,45 @@
 		return link;
 	}
 
+	public void switchTab(byte tab) {
+		switch(tab) {
+		case BROWSE_TAB: tabs.selectTab(0); break;
+		case ADDTAG_TAB: tabs.selectTab(1); break;
+		case SEARCH_TAB: tabs.selectTab(2); break;
+		}
+	}
+	
 	public void onClick(Widget sender) {
-		VerticalPanel panel = new VerticalPanel();
 
-		info = new Label();
+		dialog = new LabsDialogBox();
 
-		panel.add(info);
+		browseTags = new BrowseTagsPanel(path, currentUser, clas, website,
+				this, dialog);
 
-		table = new FlexTable();
+		tabs = new TabPanel();
 
-		table.setStyleName("tagmetable");
-		
-		table.setCellSpacing(0);
-		table.setBorderWidth(0);
-		
-		panel.add(table);
-
-		HorizontalPanel hPanel = new HorizontalPanel();
-		VerticalPanel input = new VerticalPanel();
-		input.add(new Label("Add a Tag:"));
-		HorizontalPanel customs = new HorizontalPanel();
-		VerticalPanel boxes = new VerticalPanel();
-		VerticalPanel descriptions = new VerticalPanel();
-
-		customs.add(boxes);
-		customs.add(descriptions);
-		input.add(customs);
-
-		VerticalPanel suggestions = new VerticalPanel();
-		suggTable = new FlexTable();
-		suggestions.add(new Label("Suggestions:"));
-		suggestions.add(suggTable);
-
-		hPanel.add(suggestions);
-		listBox = new ListBox();
-		listBox.setVisibleItemCount(5);
-		hPanel.add(listBox);
-
-		DOM.setAttribute(listBox.getElement(), "id", "alltags");
-
-		panel.add(hPanel);
-
-		Vector textBoxes = new Vector();
-		Vector descBoxes = new Vector();
-
-		for (int i = 0; i < 3; i++) {
-			TextBox box = new TextBox();
-			TextBox desc = new TextBox();
-
-			textBoxes.add(box);
-			descBoxes.add(desc);
-
-			boxes.add(new Label("Name"));
-			boxes.add(box);
-
-			descriptions.add(new Label("Description"));
-			descriptions.add(desc);
-		}
-
-		panel.add(input);
-
-		refreshTags();
-
-		final LabsDialogBox dialog = new LabsDialogBox();
-
-		HorizontalPanel btnPanel = new HorizontalPanel();
-		this.saveBtn = new Button("Save", new TagMeClickListener(path,
-				currentUser, clas, textBoxes, descBoxes, info,
-				suggestionCheckboxes, this, website));
-		btnPanel.add(saveBtn);
-
-		saveBtn.setStyleName("button");
-
-		Button closeBtn = new Button("Close", new ClickListener() {
-
-			public void onClick(Widget sender) {
-				dialog.hide();
-			}
-
-		});
-
-		closeBtn.setStyleName("button");
-
-		btnPanel.add(closeBtn);
-
-		LabsSimplePanel outlinePanel = new LabsSimplePanel();
-
-		outlinePanel.add(panel);
-
-		DOM.setAttribute(outlinePanel.getElement(), "id", "tagmeoutline");
-
-		VerticalPanel wholeTagme = new VerticalPanel();
-
-		wholeTagme.add(outlinePanel);
-		wholeTagme.add(btnPanel);
-
-		// PopupPanel popUp = new PopupPanel(true);
-
-		// popUp.setStyleName(TAGME_STYLE);
-
-		// popUp.add(panel);
-
-		// popUp.setPopupPosition(sender.getAbsoluteLeft(),
-		// sender.getAbsoluteTop());
-
-		// popUp.show();
-
-		TabPanel tabs = new TabPanel();
-
 		DOM.setAttribute(tabs.getTabBar().getElement(), "id", "tabnav");
 
 		tabs
 				.add(
-						wholeTagme,
+						browseTags,
 						"<div class='tagBar-inside'><span class='bar' >Tag&nbsp;Content</span></div>",
 						true);
 
-		VerticalPanel searchPanel = new VerticalPanel();
-		searchPanel
-				.add(new Label(
-						"Search for tagged content by tag name, author or keyword search of the description"));
-		searchPanel.add(new Label("Tag"));
-		TextBox tags = new TextBox();
-		tags.setText("");
-		searchPanel.add(tags);
-		searchPanel.add(new Label("Author"));
-		TextBox author = new TextBox();
-		author.setText("");
-		searchPanel.add(author);
-		searchPanel.add(new Label("Keyword"));
-		TextBox keyword = new TextBox();
-		keyword.setText("");
-		searchPanel.add(keyword);
+		addTags = new AddTagsPanel(path, currentUser, clas, website, this,
+				dialog);
 
-		bio = new HTML();
+		tabs
+				.add(
+						addTags,
+						"<div class='tagBar-inside'><span class='bar' >My&nbsp;Tags</span></div>",
+						true);
 
-		searchPanel.add(bio);
-
-		searchPanel.add(new HTML(
-				"<div class=\"tagme-search-results\">Search results</div>"));
-
-		VerticalPanel results = new VerticalPanel();
-
-		searchPanel.add(results);
-
-		HorizontalPanel buttons = new HorizontalPanel();
-
-		buttons.add(new Button("Search", new SearchListener(results, tags,
-				author, keyword, clas, bio)));
-
-		searchPanel.add(buttons);
-
-		buttons.add(new Button("Close", new ClickListener() {
-
-			public void onClick(Widget sender) {
-				dialog.hide();
-			}
-
-		}));
-
-		searchPanel.add(buttons);
-
+		searchTags = new SearchTagsPanel(path, currentUser, clas, website, this, dialog);
+		
 		tabs
 				.add(
-						searchPanel,
+						searchTags,
 						"<div class='tagBar-inside'><span class='bar' >Tag&nbsp;Search</span></div>",
 						true);
 
@@ -530,16 +163,20 @@
 				DOM.getAbsoluteTop(parentButton.getElement()));
 
 		dialog.show();
+		
+		refreshTags();
 
 	}
 
 	public void startProgressAnim(String text) {
-		info.setText(text);
+		browseTags.setInfo(text);
+		addTags.setInfo(text);
 
 		timer = new Timer() {
 
 			public void run() {
-				info.setText(info.getText() + ".");
+				browseTags.setInfo(browseTags.getInfo() + ".");
+				addTags.setInfo(addTags.getInfo() + ".");
 			}
 
 		};
@@ -550,7 +187,13 @@
 	public void stopProgressAnim(String text) {
 		timer.cancel();
 		saveBtn.setEnabled(true);
-		info.setText(text);
+		browseTags.setInfo(text);
+		addTags.setInfo(text);
 	}
 
+	public void refreshTags() {
+		browseTags.refreshTags();
+		addTags.refreshTags();
+	}
+
 }

Modified: labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/TaggingService.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/TaggingService.java	2006-07-31 20:59:07 UTC (rev 5367)
+++ labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/TaggingService.java	2006-07-31 21:00:05 UTC (rev 5368)
@@ -47,7 +47,7 @@
 	
 	public Vector getSugestions(String path, String clas);
 	
-	public Vector getAllTags(String clas);
+	public Vector getAllTags(String resourceId, String clas);
 	
 	public Vector search(String tags, String author, String keyword, String clas);
 	

Modified: labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/TaggingServiceAsync.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/TaggingServiceAsync.java	2006-07-31 20:59:07 UTC (rev 5367)
+++ labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/TaggingServiceAsync.java	2006-07-31 21:00:05 UTC (rev 5368)
@@ -41,7 +41,7 @@
 
 	public void getSugestions(String path, String clas, AsyncCallback callback);
 	
-	public void getAllTags(String clas, AsyncCallback callback);
+	public void getAllTags(String resourceId, String clas, AsyncCallback callback);
 
 	public void search(String tags, String author, String keyword, String clas, AsyncCallback callback);
 	

Modified: labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/services/ShotokuTaggingService.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/services/ShotokuTaggingService.java	2006-07-31 20:59:07 UTC (rev 5367)
+++ labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/services/ShotokuTaggingService.java	2006-07-31 21:00:05 UTC (rev 5368)
@@ -179,10 +179,10 @@
 		}
 	}
 
-	public Vector getAllTags() {
+	public Vector getAllTags(String resourceId) {
 		Vector<String> ret = new Vector<String>();
 		try {
-			List<String> tags = service.getAllTagsNames();
+			List<String> tags = service.getAllTagsNames(resourceId);
 
 			for (String tag : tags) {
 				ret.add(tag);
@@ -230,7 +230,9 @@
 							tagData, "rss2"));
 					result.add(service.getFeedLink(FeedType.TAGS,
 							tag.getName(), "rss2"));
-
+					result.add(TagMeTools.getFullName(tag.getAuthor()));
+					result.add(service.getFeedLink(FeedType.AUTHOR_UNIQUE, tag.getAuthor(), "rss2"));
+					result.add(service.getFeedLink(FeedType.AUTHOR_ALL, tag.getAuthor(), "rss2"));
 					lastTag = tag.getName();
 				}
 			}

Modified: labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/services/TagMeTagger.java
===================================================================
--- labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/services/TagMeTagger.java	2006-07-31 20:59:07 UTC (rev 5367)
+++ labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/services/TagMeTagger.java	2006-07-31 21:00:05 UTC (rev 5368)
@@ -32,7 +32,7 @@
 	
 	public Vector getSuggestions(String path);
 
-	public Vector getAllTags();
+	public Vector getAllTags(String resourceId);
 
 	public Vector search(String tags, String author, String keyword);
 }




More information about the jboss-svn-commits mailing list