kune-commits
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 1587 discussions
Author: ecarrerasg
Date: 2011-06-26 12:49:54 +0200 (Sun, 26 Jun 2011)
New Revision: 1421
Modified:
donate/src/cc/kune/sandbox/donate/client/DonatePanel.ui.xml
Log:
UiBinder changes
Modified: donate/src/cc/kune/sandbox/donate/client/DonatePanel.ui.xml
===================================================================
--- donate/src/cc/kune/sandbox/donate/client/DonatePanel.ui.xml 2011-06-26 10:45:35 UTC (rev 1420)
+++ donate/src/cc/kune/sandbox/donate/client/DonatePanel.ui.xml 2011-06-26 10:49:54 UTC (rev 1421)
@@ -258,7 +258,7 @@
<g:Hidden name="sra" value="1"></g:Hidden>
<g:Hidden name="lc" value="us"></g:Hidden>
<g:Label addStyleNames="{style.labelOther}" ui:field="lblOtherValueDollar">
- €/month
+ $/month
</g:Label>
</g:FlowPanel>
</g:FormPanel>
1
0
Author: ecarrerasg
Date: 2011-06-26 12:45:35 +0200 (Sun, 26 Jun 2011)
New Revision: 1420
Added:
donate/src/cc/kune/sandbox/donate/client/DonatePanel.java
donate/src/cc/kune/sandbox/donate/client/DonatePanel.ui.xml
Modified:
donate/src/cc/kune/sandbox/donate/client/Donate.java
Log:
UiBinder changes
Modified: donate/src/cc/kune/sandbox/donate/client/Donate.java
===================================================================
--- donate/src/cc/kune/sandbox/donate/client/Donate.java 2011-06-26 03:26:13 UTC (rev 1419)
+++ donate/src/cc/kune/sandbox/donate/client/Donate.java 2011-06-26 10:45:35 UTC (rev 1420)
@@ -1,20 +1,7 @@
package cc.kune.sandbox.donate.client;
import com.google.gwt.core.client.EntryPoint;
-import com.google.gwt.user.client.ui.Anchor;
-import com.google.gwt.user.client.ui.Hidden;
import com.google.gwt.user.client.ui.RootPanel;
-import com.google.gwt.user.client.ui.HTMLPanel;
-import com.google.gwt.user.client.ui.TextBox;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.TextBoxBase;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.FormPanel;
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.event.dom.client.BlurHandler;
-import com.google.gwt.event.dom.client.BlurEvent;
-import com.google.gwt.event.dom.client.FocusHandler;
-import com.google.gwt.event.dom.client.FocusEvent;
/**
* Entry point classes define <code>onModuimport com.google.gwt.user.client.ui.VerticalPanel;
@@ -23,506 +10,9 @@
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class Donate implements EntryPoint {
- //Cons
- private final String sDefaultValue = "other value";
- private final String sDefaultTitle = "Type other value and press Enter";
- //Definition of variables
- private TextBox txtbxOtherValueEUR = new TextBox();
- private TextBox txtbxOtherValueDollar = new TextBox();
-
- @SuppressWarnings("deprecation")
public void onModuleLoad() {
- RootPanel rootPanel = RootPanel.get();
- rootPanel.setHeight("100%");
-
- //Parent div
- HTMLPanel divEntries = new HTMLPanel("");
- divEntries.setStyleName("entries");
- rootPanel.add(divEntries, 10, 10);
-
- //Child empty div
- HTMLPanel divRightedit = new HTMLPanel("");
- divRightedit.setStyleName("rightedit");
- divEntries.add(divRightedit);
-
- //Child content div
- HTMLPanel divPost = new HTMLPanel("");
- divPost.setStyleName("post");
- divEntries.add(divPost);
-
- HTML divTitle = new HTML("Donate to Comunes", true);
- divPost.add(divTitle);
- divTitle.setStyleName("title");
-
- HTML divIntro = new HTML("Comunes is a non-profit organization dedicated to encourage the commons, those goods collectively owned by everybody, and also serves as an umbrella for other related initiatives. We rely on the generous support of people like you and other collectives to help us continue the work we do.", true);
- divIntro.setStyleName("intro");
- divPost.add(divIntro);
-
- HTML divTitleRegular = new HTML("Regular donation per month (the most necessary for us)", true);
- divTitleRegular.setStyleName("titleRegular");
- divPost.add(divTitleRegular);
-
- //Panel for Regular Donations in Euros
- HTMLPanel divRegularDonationsEUR = new HTMLPanel("");
- divRegularDonationsEUR.setStyleName("pnlOptions");
- divPost.add(divRegularDonationsEUR);
- divRegularDonationsEUR.setSize("550px", "28px");
-
- HTMLPanel pnlRegularDonation10EUR = new HTMLPanel("");
- pnlRegularDonation10EUR.setStyleName("option");
- divRegularDonationsEUR.add(pnlRegularDonation10EUR);
- pnlRegularDonation10EUR.setSize("115px", "28px");
-
- Anchor lnk1EUR = new Anchor();
- lnk1EUR.setStyleName("optionLeft");
- lnk1EUR.setHTML("10 \u20AC/month");
- lnk1EUR.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=do… Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png");
- pnlRegularDonation10EUR.add(lnk1EUR);
- lnk1EUR.setSize("85px", "28px");
-
- HTMLPanel pnlRegularDonation15EUR = new HTMLPanel("");
- pnlRegularDonation15EUR.setStyleName("option");
- divRegularDonationsEUR.add(pnlRegularDonation15EUR);
- pnlRegularDonation15EUR.setSize("115px", "28px");
-
- Anchor lnk2EUR = new Anchor();
- lnk2EUR.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=do… Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png");
- lnk2EUR.setStyleName("optionLeft");
- lnk2EUR.setHTML("15 \u20AC/month");
- pnlRegularDonation15EUR.add(lnk2EUR);
- lnk2EUR.setSize("85px", "28px");
-
- HTMLPanel pnlRegularDonation20EUR = new HTMLPanel("");
- pnlRegularDonation20EUR.setStyleName("option");
- divRegularDonationsEUR.add(pnlRegularDonation20EUR);
- pnlRegularDonation20EUR.setSize("115px", "28px");
-
- Anchor lnk3EUR = new Anchor();
- lnk3EUR.setStyleName("optionLeft");
- lnk3EUR.setHTML("20 \u20AC/month");
- lnk3EUR.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=do… Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png");
- pnlRegularDonation20EUR.add(lnk3EUR);
- lnk3EUR.setSize("85px", "28px");
-
- HTMLPanel pnlRegularDonationOtherEUR = new HTMLPanel("");
- pnlRegularDonationOtherEUR.setStyleName("optionOther");
- divRegularDonationsEUR.add(pnlRegularDonationOtherEUR);
- pnlRegularDonationOtherEUR.setSize("174px", "28px");
-
- FormPanel formPanelEUR = new FormPanel();
- formPanelEUR.setAction("https://www.paypal.com/cgi-bin/webscr");
- formPanelEUR.setMethod(FormPanel.METHOD_GET);
- pnlRegularDonationOtherEUR.add(formPanelEUR);
-
- FlowPanel flowPanelEUR = new FlowPanel();
- formPanelEUR.setWidget(flowPanelEUR);
- flowPanelEUR.setSize("100%", "100%");
- txtbxOtherValueEUR.setVisibleLength(10);
- txtbxOtherValueEUR.setName("a3");
-
- //Other Value Euro events
- txtbxOtherValueEUR.addFocusHandler(new FocusHandler() {
- public void onFocus(FocusEvent event) {
- String sDefaultValue = "other value";
- //Window.alert(txtbxOtherValue.getText());
- if(txtbxOtherValueEUR.getText().equals(sDefaultValue))
- {
- txtbxOtherValueEUR.setText("");
- }
- }
- });
-
- txtbxOtherValueEUR.addBlurHandler(new BlurHandler() {
- String sDefaultValue = "other value";
- public void onBlur(BlurEvent event) {
- String sActualValue = txtbxOtherValueEUR.getText();
- int iActualValue = 0;
- if(!sActualValue.equals(""))
- {
- iActualValue = Integer.parseInt(sActualValue);
- }
- //validate
- if(sActualValue == "" || iActualValue == 0 || sActualValue != "" + iActualValue)
- {
- txtbxOtherValueEUR.setText(sDefaultValue);
- }
- }
- });
- //End Other Value Euro events
-
- Hidden h1EUR = new Hidden("business");
- h1EUR.setDefaultValue("donate(a)ourproject.org");
- flowPanelEUR.add(h1EUR);
-
- Hidden h2EUR = new Hidden("cmd");
- h2EUR.setDefaultValue("_xclick-subscriptions");
- flowPanelEUR.add(h2EUR);
-
- Hidden h3EUR = new Hidden("item_name");
- h3EUR.setDefaultValue(" Donate to comunes.org");
- flowPanelEUR.add(h3EUR);
-
- Hidden h4EUR = new Hidden("currency_code");
- h4EUR.setDefaultValue("EUR");
- flowPanelEUR.add(h4EUR);
-
- Hidden h5EUR = new Hidden("no_shipping");
- h5EUR.setDefaultValue("1");
- flowPanelEUR.add(h5EUR);
-
- Hidden h6EUR = new Hidden("t3");
- h6EUR.setDefaultValue("M");
- flowPanelEUR.add(h6EUR);
-
- Hidden h7EUR = new Hidden("p3");
- h7EUR.setDefaultValue("1");
- flowPanelEUR.add(h7EUR);
-
- Hidden h8EUR = new Hidden("src");
- h8EUR.setDefaultValue("1");
- flowPanelEUR.add(h8EUR);
-
- Hidden h9EUR = new Hidden("image_url");
- h9EUR.setDefaultValue("http://comunes.org/cm/images/logo-pp.png");
- flowPanelEUR.add(h9EUR);
-
- Hidden h10EUR = new Hidden("sra");
- h10EUR.setDefaultValue("1");
- flowPanelEUR.add(h10EUR);
-
- Hidden h11EUR = new Hidden("lc");
- h11EUR.setDefaultValue("us");
- flowPanelEUR.add(h11EUR);
-
- flowPanelEUR.add(txtbxOtherValueEUR);
- txtbxOtherValueEUR.setSize("83px", "16px");
- txtbxOtherValueEUR.setTextAlignment(TextBoxBase.ALIGN_CENTER);
- txtbxOtherValueEUR.setText(sDefaultValue);
- txtbxOtherValueEUR.setTitle(sDefaultTitle);
-
- Label lblOtherEUR = new Label("\u20AC/month");
- flowPanelEUR.add(lblOtherEUR);
- lblOtherEUR.setStyleName("labelOther");
- //End of Panel for Regular Donations in Euros
-
- //Panel for Regular Donations in Dollars
- HTMLPanel divRegularDonationsDollar = new HTMLPanel("");
- divRegularDonationsDollar.setStyleName("pnlOptions");
- divPost.add(divRegularDonationsDollar);
- divRegularDonationsDollar.setSize("550px", "28px");
-
- HTMLPanel pnlRegularDonation10Dollar = new HTMLPanel("");
- pnlRegularDonation10Dollar.setStyleName("option");
- divRegularDonationsDollar.add(pnlRegularDonation10Dollar);
- pnlRegularDonation10Dollar.setSize("115px", "28px");
-
- Anchor lnk1Dollar = new Anchor();
- lnk1Dollar.setStyleName("optionLeft");
- lnk1Dollar.setHTML("10 $/month");
- lnk1Dollar.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=do… Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png");
- pnlRegularDonation10Dollar.add(lnk1Dollar);
- lnk1Dollar.setSize("85px", "28px");
-
- HTMLPanel pnlRegularDonation15Dollar = new HTMLPanel("");
- pnlRegularDonation15Dollar.setStyleName("option");
- divRegularDonationsDollar.add(pnlRegularDonation15Dollar);
- pnlRegularDonation15Dollar.setSize("115px", "28px");
-
- Anchor lnk2Dollar = new Anchor();
- lnk2Dollar.setStyleName("optionLeft");
- lnk2Dollar.setHTML("15 $/month");
- lnk2Dollar.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=do… Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png");
- pnlRegularDonation15Dollar.add(lnk2Dollar);
- lnk2Dollar.setSize("85px", "28px");
-
- HTMLPanel pnlRegularDonation20Dollar = new HTMLPanel("");
- pnlRegularDonation20Dollar.setStyleName("option");
- divRegularDonationsDollar.add(pnlRegularDonation20Dollar);
- pnlRegularDonation20Dollar.setSize("115px", "28px");
-
- Anchor lnk3Dollar = new Anchor();
- lnk3Dollar.setStyleName("optionLeft");
- lnk3Dollar.setHTML("20 $/month");
- lnk3Dollar.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=do… Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png");
- pnlRegularDonation20Dollar.add(lnk3Dollar);
- lnk3Dollar.setSize("85px", "28px");
-
- HTMLPanel pnlRegularDonationOtherDollar = new HTMLPanel("");
- pnlRegularDonationOtherDollar.setStyleName("optionOther");
- divRegularDonationsDollar.add(pnlRegularDonationOtherDollar);
- pnlRegularDonationOtherDollar.setSize("174px", "28px");
-
- FormPanel formPanelDollar = new FormPanel();
- formPanelDollar.setMethod(FormPanel.METHOD_GET);
- formPanelDollar.setAction("https://www.paypal.com/cgi-bin/webscr");
- pnlRegularDonationOtherDollar.add(formPanelDollar);
-
- FlowPanel flowPanelDollar = new FlowPanel();
- formPanelDollar.setWidget(flowPanelDollar);
- flowPanelDollar.setSize("100%", "100%");
- txtbxOtherValueDollar.setName("a3");
- txtbxOtherValueDollar.setVisibleLength(10);
-
- txtbxOtherValueDollar.setTitle("Type other value and press Enter");
- txtbxOtherValueDollar.setTextAlignment(TextBoxBase.ALIGN_CENTER);
- txtbxOtherValueDollar.setText("other value");
-
- //Other Value Dollar events
- txtbxOtherValueDollar.addFocusHandler(new FocusHandler() {
- public void onFocus(FocusEvent event) {
- String sDefaultValue = "other value";
- //Window.alert(txtbxOtherValue.getText());
- if(txtbxOtherValueDollar.getText().equals(sDefaultValue))
- {
- txtbxOtherValueDollar.setText("");
- }
- }
- });
-
- txtbxOtherValueDollar.addBlurHandler(new BlurHandler() {
- String sDefaultValue = "other value";
- public void onBlur(BlurEvent event) {
- String sActualValue = txtbxOtherValueDollar.getText();
- int iActualValue = 0;
- if(!sActualValue.equals(""))
- {
- iActualValue = Integer.parseInt(sActualValue);
- }
- //validate
- if(sActualValue == "" || iActualValue == 0 || sActualValue != "" + iActualValue)
- {
- txtbxOtherValueDollar.setText(sDefaultValue);
- }
- }
- });
- //End Other Value Dollar events
-
- Hidden h1Dollar = new Hidden("business");
- h1Dollar.setDefaultValue("donate(a)ourproject.org");
- flowPanelDollar.add(h1Dollar);
-
- Hidden h2Dollar = new Hidden("cmd");
- h2Dollar.setDefaultValue("_xclick-subscriptions");
- flowPanelDollar.add(h2Dollar);
-
- Hidden h3Dollar = new Hidden("item_name");
- h3Dollar.setDefaultValue(" Donate to comunes.org");
- flowPanelDollar.add(h3Dollar);
-
- Hidden h4Dollar = new Hidden("currency_code");
- h4Dollar.setDefaultValue("USD");
- flowPanelDollar.add(h4Dollar);
-
- Hidden h5Dollar = new Hidden("no_shipping");
- h5Dollar.setDefaultValue("1");
- flowPanelDollar.add(h5Dollar);
-
- Hidden h6Dollar = new Hidden("t3");
- h6Dollar.setDefaultValue("M");
- flowPanelDollar.add(h6Dollar);
-
- Hidden h7Dollar = new Hidden("p3");
- h7Dollar.setDefaultValue("1");
- flowPanelDollar.add(h7Dollar);
-
- Hidden h8Dollar = new Hidden("src");
- h8Dollar.setDefaultValue("1");
- flowPanelDollar.add(h8Dollar);
-
- Hidden h9Dollar = new Hidden("image_url");
- h9Dollar.setDefaultValue("http://comunes.org/cm/images/logo-pp.png");
- flowPanelDollar.add(h9Dollar);
-
- Hidden h10Dollar = new Hidden("sra");
- h10Dollar.setDefaultValue("1");
- flowPanelDollar.add(h10Dollar);
-
- Hidden h11Dollar = new Hidden("lc");
- h11Dollar.setDefaultValue("us");
- flowPanelDollar.add(h11Dollar);
-
- flowPanelDollar.add(txtbxOtherValueDollar);
- txtbxOtherValueDollar.setSize("83px", "16px");
-
- Label lblOtherDollar = new Label("$/month");
- lblOtherDollar.setStyleName("labelOther");
- flowPanelDollar.add(lblOtherDollar);
-
- HTML divTitleSingle = new HTML("Single donation", true);
- divPost.add(divTitleSingle);
- divTitleSingle.setStyleName("titleRegular");
-
- HTMLPanel divSingleDonationEUR = new HTMLPanel("");
- divSingleDonationEUR.setStyleName("pnlOptions");
- divPost.add(divSingleDonationEUR);
- divSingleDonationEUR.setSize("340px", "28px");
-
- HTMLPanel pnlRegularDonation25EUR = new HTMLPanel("");
- pnlRegularDonation25EUR.setStyleName("option");
- divSingleDonationEUR.add(pnlRegularDonation25EUR);
- pnlRegularDonation25EUR.setSize("75px", "28px");
-
- Anchor lnk1SingleEUR = new Anchor();
- lnk1SingleEUR.setStyleName("optionLeft");
- lnk1SingleEUR.setHTML("25 \u20AC");
- lnk1SingleEUR.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@ourpro… Donate to comunes.org¤cy_code=EUR&amount=25&image_url=http://comunes.org/cm/ima…");
- pnlRegularDonation25EUR.add(lnk1SingleEUR);
- lnk1SingleEUR.setSize("45px", "28px");
-
- HTMLPanel pnlRegularDonation75EUR = new HTMLPanel("");
- pnlRegularDonation75EUR.setStyleName("option");
- divSingleDonationEUR.add(pnlRegularDonation75EUR);
- pnlRegularDonation75EUR.setSize("75px", "28px");
-
- Anchor lnk2SingleEUR = new Anchor();
- lnk2SingleEUR.setStyleName("optionLeft");
- lnk2SingleEUR.setHTML("75 \u20AC");
- lnk2SingleEUR.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@ourpro… Donate to comunes.org¤cy_code=EUR&amount=75&image_url=http://comunes.org/cm/ima…");
- pnlRegularDonation75EUR.add(lnk2SingleEUR);
- lnk2SingleEUR.setSize("45px", "28px");
-
- HTMLPanel pnlRegularDonation150EUR = new HTMLPanel("");
- pnlRegularDonation150EUR.setStyleName("option");
- divSingleDonationEUR.add(pnlRegularDonation150EUR);
- pnlRegularDonation150EUR.setSize("75px", "28px");
-
- Anchor lnk3SingleEUR = new Anchor();
- lnk3SingleEUR.setStyleName("optionLeft");
- lnk3SingleEUR.setHTML("100 \u20AC");
- lnk3SingleEUR.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@ourpro… Donate to comunes.org¤cy_code=EUR&amount=100&image_url=http://comunes.org/cm/im…");
- pnlRegularDonation150EUR.add(lnk3SingleEUR);
- lnk3SingleEUR.setSize("45px", "28px");
-
- HTMLPanel pnlRegularDonation300EUR = new HTMLPanel("");
- pnlRegularDonation300EUR.setStyleName("option");
- divSingleDonationEUR.add(pnlRegularDonation300EUR);
- pnlRegularDonation300EUR.setSize("75px", "28px");
-
- Anchor lnk4SingleEUR = new Anchor();
- lnk4SingleEUR.setStyleName("optionLeft");
- lnk4SingleEUR.setHTML("300 \u20AC");
- lnk4SingleEUR.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@ourpro… Donate to comunes.org¤cy_code=EUR&amount=300&image_url=http://comunes.org/cm/im…");
- pnlRegularDonation300EUR.add(lnk4SingleEUR);
- lnk4SingleEUR.setSize("45px", "28px");
-
- HTMLPanel divSingleDonationDollar = new HTMLPanel("");
- divSingleDonationDollar.setStyleName("pnlOptions");
- divPost.add(divSingleDonationDollar);
- divSingleDonationDollar.setSize("340px", "28px");
-
- HTMLPanel pnlRegularDonation25Dollar = new HTMLPanel("");
- pnlRegularDonation25Dollar.setStyleName("option");
- divSingleDonationDollar.add(pnlRegularDonation25Dollar);
- pnlRegularDonation25Dollar.setSize("75px", "28px");
-
- Anchor lnk1SingleDollar = new Anchor();
- lnk1SingleDollar.setStyleName("optionLeft");
- lnk1SingleDollar.setHTML("25 $");
- lnk1SingleDollar.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@ourpro… Donate to comunes.org¤cy_code=USD&amount=25&image_url=http://comunes.org/cm/ima…");
- pnlRegularDonation25Dollar.add(lnk1SingleDollar);
- lnk1SingleDollar.setSize("45px", "28px");
-
- HTMLPanel pnlRegularDonation75Dollar = new HTMLPanel("");
- pnlRegularDonation75Dollar.setStyleName("option");
- divSingleDonationDollar.add(pnlRegularDonation75Dollar);
- pnlRegularDonation75Dollar.setSize("75px", "28px");
-
- Anchor lnk2SingleDollar = new Anchor();
- lnk2SingleDollar.setStyleName("optionLeft");
- lnk2SingleDollar.setHTML("75 $");
- lnk2SingleDollar.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@ourpro… Donate to comunes.org¤cy_code=USD&amount=75&image_url=http://comunes.org/cm/ima…");
- pnlRegularDonation75Dollar.add(lnk2SingleDollar);
- lnk2SingleDollar.setSize("45px", "28px");
-
- HTMLPanel pnlRegularDonation100Dollar = new HTMLPanel("");
- pnlRegularDonation100Dollar.setStyleName("option");
- divSingleDonationDollar.add(pnlRegularDonation100Dollar);
- pnlRegularDonation100Dollar.setSize("75px", "28px");
-
- Anchor lnk3SingleDollar = new Anchor();
- lnk3SingleDollar.setStyleName("optionLeft");
- lnk3SingleDollar.setHTML("100 $");
- lnk3SingleDollar.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@ourpro… Donate to comunes.org¤cy_code=USD&amount=100&image_url=http://comunes.org/cm/im…");
- pnlRegularDonation100Dollar.add(lnk3SingleDollar);
- lnk3SingleDollar.setSize("45px", "28px");
-
- HTMLPanel pnlRegularDonation300Dollar = new HTMLPanel("");
- pnlRegularDonation300Dollar.setStyleName("option");
- divSingleDonationDollar.add(pnlRegularDonation300Dollar);
- pnlRegularDonation300Dollar.setSize("75px", "28px");
-
- Anchor lnk4SingleDollar = new Anchor();
- lnk4SingleDollar.setStyleName("optionLeft");
- lnk4SingleDollar.setHTML("300 $");
- lnk4SingleDollar.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@ourpro… Donate to comunes.org¤cy_code=USD&amount=300&image_url=http://comunes.org/cm/im…");
- pnlRegularDonation300Dollar.add(lnk4SingleDollar);
- lnk4SingleDollar.setSize("45px", "28px");
-
- HTMLPanel divTextOther = new HTMLPanel("");
- divTextOther.setStyleName("divTextDonate");
- divPost.add(divTextOther);
-
- HTML htmlOther = new HTML("For other amounts use", true);
- htmlOther.setStyleName("textDonate");
- divTextOther.add(htmlOther);
- htmlOther.setWidth("148px");
-
- Anchor lnkTextOtherEUR = new Anchor();
- lnkTextOtherEUR.setText("this link for Euros");
- lnkTextOtherEUR.setStyleName("textDonate");
- lnkTextOtherEUR.setHTML("this link for Euros");
- lnkTextOtherEUR.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@ourpro… Donate to comunes.org¤cy_code=EUR&image_url=http://comunes.org/cm/images/logo-p…");
- divTextOther.add(lnkTextOtherEUR);
- lnkTextOtherEUR.setSize("127px", "28px");
-
- HTML htmlOther2 = new HTML("or", true);
- htmlOther2.setStyleName("textDonate");
- divTextOther.add(htmlOther2);
- htmlOther2.setWidth("17px");
-
- Anchor lnkTextOtherDollar = new Anchor();
- lnkTextOtherDollar.setText("this link for USD.");
- lnkTextOtherDollar.setStyleName("textDonate");
- lnkTextOtherDollar.setHTML("this link for USD.");
- lnkTextOtherDollar.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@ourpro… Donate to comunes.org¤cy_code=USD&image_url=http://comunes.org/cm/images/logo-p…");
- divTextOther.add(lnkTextOtherDollar);
- lnkTextOtherDollar.setSize("127px", "28px");
-
- HTML htmlOther3 = new HTML("Please consider donating more if you can afford it. ", true);
- htmlOther3.setStyleName("textDonateNewLine");
- divTextOther.add(htmlOther3);
- htmlOther3.setWidth("471px");
-
- HTML divTitleBank = new HTML("Give using your Bank", true);
- divTitleBank.setStyleName("titleRegular");
- divPost.add(divTitleBank);
-
- HTMLPanel divTextOtherBank = new HTMLPanel("");
- divTextOtherBank.setStyleName("divTextOtherBank");
- divPost.add(divTextOtherBank);
-
- Anchor lnkBank = new Anchor();
- lnkBank.setText("See our Bank account info page");
- lnkBank.setStyleName("textDonate");
- lnkBank.setHTML("See our Bank account info page");
- lnkBank.setHref("http://comunes.org/bank-info/");
- divTextOtherBank.add(lnkBank);
- lnkBank.setSize("471px", "28px");
-
- HTML htmlBank1 = new HTML("Unless you specify the contrary, we will add you to our donor list. ", true);
- htmlBank1.setStyleName("textDonateNewLine");
- divTextOtherBank.add(htmlBank1);
- htmlBank1.setWidth("471px");
-
- HTML htmlBank2 = new HTML("If you have doubts please contact us at donate at ourproject dot org. ", true);
- htmlBank2.setStyleName("textDonateNewLine");
- divTextOtherBank.add(htmlBank2);
- htmlBank2.setWidth("471px");
-
- HTML divTitleFinal = new HTML("Thanks indeed!", true);
- divTitleFinal.setStyleName("titleRegular");
- divPost.add(divTitleFinal);
- //End of Panel for Regular Donations in Dollars
+ final DonatePanel dPanel = new DonatePanel();
+ RootPanel.get().add(dPanel);
}
}
\ No newline at end of file
Added: donate/src/cc/kune/sandbox/donate/client/DonatePanel.java
===================================================================
--- donate/src/cc/kune/sandbox/donate/client/DonatePanel.java (rev 0)
+++ donate/src/cc/kune/sandbox/donate/client/DonatePanel.java 2011-06-26 10:45:35 UTC (rev 1420)
@@ -0,0 +1,335 @@
+package cc.kune.sandbox.donate.client;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.BlurEvent;
+import com.google.gwt.event.dom.client.BlurHandler;
+import com.google.gwt.event.dom.client.FocusEvent;
+import com.google.gwt.event.dom.client.FocusHandler;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.ui.Anchor;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.FormPanel;
+import com.google.gwt.user.client.ui.HTMLPanel;
+import com.google.gwt.user.client.ui.TextBox;
+import com.google.gwt.user.client.ui.Widget;
+
+public class DonatePanel extends Composite {
+ //Cons
+ private final String DEFAULT_VALUE = "other value";
+ private final String DEFAULT_TITLE = "Type other value and press Enter";
+ private final String NAME_TB = "a3";
+ private final int REGULAR_DONATION_EURO = 1;
+ private final int REGULAR_DONATION_DOLLAR = 2;
+ private final int SINGLE_DONATION_EURO = 3;
+ private final int SINGLE_DONATION_DOLLAR = 4;
+ private final String EURO_REGULAR_DONATION = " \u20AC/month";
+ private final String DOLLAR_REGULAR_DONATION = " $/month";
+ private final String EURO_DONATION = " \u20AC";
+ private final String DOLLAR_DONATION = " $";
+ private final String LNK_EURO_REGULAR_DONATION_1 = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=do… Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png";
+ private final String LNK_EURO_REGULAR_DONATION_2 = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=do… Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png";
+ private final String LNK_EURO_REGULAR_DONATION_3 = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=do… Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png";
+ private final String LNK_EURO_SINGLE_DONATION_1 = "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@ourpro… Donate to comunes.org¤cy_code=EUR&amount=25&image_url=http://comunes.org/cm/ima…";
+ private final String LNK_EURO_SINGLE_DONATION_2 = "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@ourpro… Donate to comunes.org¤cy_code=EUR&amount=75&image_url=http://comunes.org/cm/ima…";
+ private final String LNK_EURO_SINGLE_DONATION_3 = "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@ourpro… Donate to comunes.org¤cy_code=EUR&amount=150&image_url=http://comunes.org/cm/im…";
+ private final String LNK_EURO_SINGLE_DONATION_4 = "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@ourpro… Donate to comunes.org¤cy_code=EUR&amount=300&image_url=http://comunes.org/cm/im…";
+ private final String LNK_DOLLAR_REGULAR_DONATION_1 = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=do… Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png";
+ private final String LNK_DOLLAR_REGULAR_DONATION_2 = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=do… Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png";
+ private final String LNK_DOLLAR_REGULAR_DONATION_3 = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=do… Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png";
+ private final String LNK_DOLLAR_SINGLE_DONATION_1 = "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@ourpro… Donate to comunes.org¤cy_code=USD&amount=25&image_url=http://comunes.org/cm/ima…";
+ private final String LNK_DOLLAR_SINGLE_DONATION_2 = "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@ourpro… Donate to comunes.org¤cy_code=USD&amount=75&image_url=http://comunes.org/cm/ima…";
+ private final String LNK_DOLLAR_SINGLE_DONATION_3 = "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@ourpro… Donate to comunes.org¤cy_code=USD&amount=150&image_url=http://comunes.org/cm/im…";
+ private final String LNK_DOLLAR_SINGLE_DONATION_4 = "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@ourpro… Donate to comunes.org¤cy_code=USD&amount=300&image_url=http://comunes.org/cm/im…";
+ private final String LNK_REGULAR_OTHER_VALUE_EUROS = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=do… Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png";
+ private final String LNK_REGULAR_OTHER_VALUE_DOLLAR = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=do… Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png";
+ private final String LNK_SINGLE_OTHER_VALUE_EUROS = "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@ourpro… Donate to comunes.org¤cy_code=EUR&image_url=http://comunes.org/cm/images/logo-p…";
+ private final String LNK_SINGLE_OTHER_VALUE_DOLLAR = "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@ourpro… Donate to comunes.org¤cy_code=USD&image_url=http://comunes.org/cm/images/logo-p…";
+ private final String LNK_BANK = "http://comunes.org/bank-info/";
+
+ @UiField
+ HTMLPanel divEntries;
+ @UiField
+ HTMLPanel divRightedit;
+ @UiField
+ HTMLPanel divPost;
+ @UiField
+ HTMLPanel divPostTitle;
+ @UiField
+ Label lblPostTitle;
+ @UiField
+ HTMLPanel divIntro;
+ @UiField
+ Label lblPostIntro;
+ @UiField
+ HTMLPanel divTitleRegular;
+ @UiField
+ Label lblRegularTitle;
+ @UiField
+ HTMLPanel divRegularDonationsEuros;
+ @UiField
+ HTMLPanel optRegularDonationEuros1;
+ @UiField
+ Anchor lnkEuros1;
+ @UiField
+ HTMLPanel optRegularDonationEuros2;
+ @UiField
+ Anchor lnkEuros2;
+ @UiField
+ HTMLPanel optRegularDonationEuros3;
+ @UiField
+ Anchor lnkEuros3;
+ @UiField
+ HTMLPanel optRegularDonationOtherEuros;
+ @UiField
+ FormPanel formPanelEuros;
+ @UiField
+ FlowPanel flowPanelEuros;
+ @UiField
+ TextBox txtbxOtherValueEuros;
+ @UiField
+ Label lblOtherValueEuros;
+ @UiField
+ HTMLPanel divRegularDonationsDollar;
+ @UiField
+ HTMLPanel optRegularDonationDollar1;
+ @UiField
+ Anchor lnkDollar1;
+ @UiField
+ HTMLPanel optRegularDonationDollar2;
+ @UiField
+ Anchor lnkDollar2;
+ @UiField
+ HTMLPanel optRegularDonationDollar3;
+ @UiField
+ Anchor lnkDollar3;
+ @UiField
+ HTMLPanel optRegularDonationOtherDollar;
+ @UiField
+ FormPanel formPanelDollar;
+ @UiField
+ FlowPanel flowPanelDollar;
+ @UiField
+ TextBox txtbxOtherValueDollar;
+ @UiField
+ Label lblOtherValueDollar;
+ @UiField
+ HTMLPanel divTitleSingle;
+ @UiField
+ Label lblSingleTitle;
+ @UiField
+ HTMLPanel divSingleDonationEuros;
+ @UiField
+ HTMLPanel optSingleDonationEuros1;
+ @UiField
+ Anchor lnkSingleEuros1;
+ @UiField
+ HTMLPanel optSingleDonationEuros2;
+ @UiField
+ Anchor lnkSingleEuros2;
+ @UiField
+ HTMLPanel optSingleDonationEuros3;
+ @UiField
+ Anchor lnkSingleEuros3;
+ @UiField
+ HTMLPanel optSingleDonationEuros4;
+ @UiField
+ Anchor lnkSingleEuros4;
+ @UiField
+ HTMLPanel divSingleDonationDollar;
+ @UiField
+ HTMLPanel optSingleDonationDollar1;
+ @UiField
+ Anchor lnkSingleDollar1;
+ @UiField
+ HTMLPanel optSingleDonationDollar2;
+ @UiField
+ Anchor lnkSingleDollar2;
+ @UiField
+ HTMLPanel optSingleDonationDollar3;
+ @UiField
+ Anchor lnkSingleDollar3;
+ @UiField
+ HTMLPanel optSingleDonationDollar4;
+ @UiField
+ Anchor lnkSingleDollar4;
+ @UiField
+ HTMLPanel divTextOther;
+ @UiField
+ Anchor lnkTextSingleOtherEuros;
+ @UiField
+ Anchor lnkTextSingleOtherDollar;
+ @UiField
+ HTMLPanel divTextOther2;
+ @UiField
+ HTMLPanel divTitleBank;
+ @UiField
+ Label lblTitleBank;
+ @UiField
+ HTMLPanel divTextOther3;
+ @UiField
+ Anchor lnkTextBank;
+ @UiField
+ HTMLPanel divTextOther4;
+ @UiField
+ HTMLPanel divTextOther5;
+ @UiField
+ HTMLPanel divTitleFinal;
+ @UiField
+ Label lblTitleFinal;
+
+ private static DonatePanelUiBinder uiBinder = GWT.create(DonatePanelUiBinder.class);
+
+ interface DonatePanelUiBinder extends UiBinder<Widget, DonatePanel> {
+ }
+
+ public DonatePanel() {
+ initWidget(uiBinder.createAndBindUi(this));
+ //Config of Dollar Regular Donations
+ lnkEuros1.setHTML(getTextDonation(REGULAR_DONATION_EURO, 10));
+ lnkEuros1.setHref(LNK_EURO_REGULAR_DONATION_1);
+
+ lnkEuros2.setHTML(getTextDonation(REGULAR_DONATION_EURO, 15));
+ lnkEuros2.setHref(LNK_EURO_REGULAR_DONATION_2);
+
+ lnkEuros3.setHTML(getTextDonation(REGULAR_DONATION_EURO, 20));
+ lnkEuros3.setHref(LNK_EURO_REGULAR_DONATION_3);
+
+ formPanelEuros.setMethod(FormPanel.METHOD_GET);
+ formPanelEuros.setAction(LNK_REGULAR_OTHER_VALUE_EUROS);
+
+ txtbxOtherValueEuros.setVisibleLength(10);
+ txtbxOtherValueEuros.setName(NAME_TB);
+ txtbxOtherValueEuros.setText(DEFAULT_VALUE);
+ txtbxOtherValueEuros.setTitle(DEFAULT_TITLE);
+
+ txtbxOtherValueEuros.addFocusHandler(new FocusHandler() {
+ public void onFocus(FocusEvent event) {
+ if(txtbxOtherValueEuros.getText().equals(DEFAULT_VALUE))
+ {
+ txtbxOtherValueEuros.setText("");
+ }
+ }
+ });
+
+ txtbxOtherValueEuros.addBlurHandler(new BlurHandler() {
+
+ @Override
+ public void onBlur(BlurEvent event) {
+ String sActualValue = txtbxOtherValueEuros.getText();
+ int iActualValue = 0;
+ if(!sActualValue.equals(""))
+ {
+ iActualValue = Integer.parseInt(sActualValue);
+ }
+
+ //validate
+ if(sActualValue == "" || iActualValue == 0)
+ {
+ txtbxOtherValueEuros.setText(DEFAULT_VALUE);
+ }
+ }
+ });
+
+ //Config of Dollar Regular Donations
+ lnkDollar1.setHTML(getTextDonation(REGULAR_DONATION_DOLLAR, 10));
+ lnkDollar1.setHref(LNK_DOLLAR_REGULAR_DONATION_1);
+
+ lnkDollar2.setHTML(getTextDonation(REGULAR_DONATION_DOLLAR, 15));
+ lnkDollar2.setHref(LNK_DOLLAR_REGULAR_DONATION_2);
+
+ lnkDollar3.setHTML(getTextDonation(REGULAR_DONATION_DOLLAR, 20));
+ lnkDollar3.setHref(LNK_DOLLAR_REGULAR_DONATION_3);
+
+ formPanelDollar.setAction(LNK_REGULAR_OTHER_VALUE_DOLLAR);
+ formPanelDollar.setMethod(FormPanel.METHOD_GET);
+
+ txtbxOtherValueDollar.setVisibleLength(10);
+ txtbxOtherValueDollar.setName(NAME_TB);
+ txtbxOtherValueDollar.setText(DEFAULT_VALUE);
+ txtbxOtherValueDollar.setTitle(DEFAULT_TITLE);
+
+ txtbxOtherValueDollar.addFocusHandler(new FocusHandler() {
+ public void onFocus(FocusEvent event) {
+ if(txtbxOtherValueDollar.getText().equals(DEFAULT_VALUE))
+ {
+ txtbxOtherValueDollar.setText("");
+ }
+ }
+ });
+
+ txtbxOtherValueDollar.addBlurHandler(new BlurHandler() {
+ public void onBlur(BlurEvent event) {
+ String sActualValue = txtbxOtherValueDollar.getText();
+ int iActualValue = 0;
+ if(!sActualValue.equals(""))
+ {
+ iActualValue = Integer.parseInt(sActualValue);
+ }
+ //validate
+ if(sActualValue == "" || iActualValue == 0)
+ {
+ txtbxOtherValueDollar.setText(DEFAULT_VALUE);
+ }
+ }
+ });
+
+ //Config of Euros Single Donations
+ lnkSingleEuros1.setHTML(getTextDonation(SINGLE_DONATION_EURO, 25));
+ lnkSingleEuros1.setHref(LNK_EURO_SINGLE_DONATION_1);
+
+ lnkSingleEuros2.setHTML(getTextDonation(SINGLE_DONATION_EURO, 75));
+ lnkSingleEuros2.setHref(LNK_EURO_SINGLE_DONATION_2);
+
+ lnkSingleEuros3.setHTML(getTextDonation(SINGLE_DONATION_EURO, 150));
+ lnkSingleEuros3.setHref(LNK_EURO_SINGLE_DONATION_3);
+
+ lnkSingleEuros4.setHTML(getTextDonation(SINGLE_DONATION_EURO, 300));
+ lnkSingleEuros4.setHref(LNK_EURO_SINGLE_DONATION_4);
+
+ //Config of Dollar Single Donations
+ lnkSingleDollar1.setHTML(getTextDonation(SINGLE_DONATION_DOLLAR, 25));
+ lnkSingleDollar1.setHref(LNK_DOLLAR_SINGLE_DONATION_1);
+
+ lnkSingleDollar2.setHTML(getTextDonation(SINGLE_DONATION_DOLLAR, 75));
+ lnkSingleDollar2.setHref(LNK_DOLLAR_SINGLE_DONATION_2);
+
+ lnkSingleDollar3.setHTML(getTextDonation(SINGLE_DONATION_DOLLAR, 150));
+ lnkSingleDollar3.setHref(LNK_DOLLAR_SINGLE_DONATION_3);
+
+ lnkSingleDollar4.setHTML(getTextDonation(SINGLE_DONATION_DOLLAR, 300));
+ lnkSingleDollar4.setHref(LNK_DOLLAR_SINGLE_DONATION_4);
+
+ //other text
+ lnkTextSingleOtherEuros.setHref(LNK_SINGLE_OTHER_VALUE_EUROS);
+ lnkTextSingleOtherDollar.setHref(LNK_SINGLE_OTHER_VALUE_DOLLAR);
+
+ lnkTextBank.setHref(LNK_BANK);
+ }
+
+ /*
+ * Function to get the text of link for donations by type
+ */
+ private String getTextDonation (int iTypeDonation, int iValueDonation)
+ {
+ String sText = "" + iValueDonation;
+ switch (iTypeDonation)
+ {
+ case REGULAR_DONATION_EURO:
+ sText += EURO_REGULAR_DONATION;
+ break;
+ case SINGLE_DONATION_EURO:
+ sText += EURO_DONATION;
+ break;
+ case REGULAR_DONATION_DOLLAR:
+ sText += DOLLAR_REGULAR_DONATION;
+ break;
+ case SINGLE_DONATION_DOLLAR:
+ sText += DOLLAR_DONATION;
+ break;
+ }
+ return sText;
+ }
+}
Property changes on: donate/src/cc/kune/sandbox/donate/client/DonatePanel.java
___________________________________________________________________
Name: svn:executable
+ *
Added: donate/src/cc/kune/sandbox/donate/client/DonatePanel.ui.xml
===================================================================
--- donate/src/cc/kune/sandbox/donate/client/DonatePanel.ui.xml (rev 0)
+++ donate/src/cc/kune/sandbox/donate/client/DonatePanel.ui.xml 2011-06-26 10:45:35 UTC (rev 1420)
@@ -0,0 +1,330 @@
+<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
+<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
+ xmlns:g="urn:import:com.google.gwt.user.client.ui">
+ <ui:style>
+ a {
+ color: #FE7047;
+ font-weight: bold;
+ outline: medium none;
+ text-decoration: none;
+ }
+
+ a:hover {
+ background: inherit;
+ color: #029A00;
+ outline: 0 none;
+ text-decoration: none;
+ }
+
+ a:visited {
+ outline: 0 none;
+ text-decoration: none;
+ }
+
+ .entries {
+ float: left;
+ line-height: 1.7em;
+ padding: 0 0 15px;
+ width: 590px;
+ }
+
+ div#entries {
+ border-right: 0 solid #F2F2F2;
+ padding-right: 15px;
+ }
+
+ .rightedit{
+ }
+
+ .post {
+ margin-bottom: 2em;
+ text-align: justify;
+ }
+
+ .titlePost {
+ display: inline;
+ font-size: 2em;
+ line-height: 1em;
+ margin-bottom: 0.2em;
+ margin-top: 2.5em;
+ font-weight: bold;
+ }
+
+ .introPost {
+ padding-bottom: 5px;
+ padding-top: 5px;
+ }
+
+ .titleRegular {
+ clear: both;
+ padding-top: 1em;
+ border-bottom: medium none;
+ letter-spacing: normal;
+ margin-bottom: -0.5em;
+ color: #555555;
+ font-size: 17px;
+ font-weight: bold;
+ text-transform: none
+ }
+
+ .pnlOptions {
+ border-bottom: 1px solid #E7E7E7;
+ background-color: #FFFFFF;
+ clear: left;
+ float: left;
+ list-style: none outside none;
+ margin: 10px 10px;
+ margin-top: 15px;
+ padding: 5px;
+ display: inline;
+ with: 550px;
+ height: 28px;
+ }
+
+ .option {
+ background: url("btn-blue.png") no-repeat scroll right top transparent;
+ float: left;
+ margin-right: 10px;
+ width: 115px;
+ height: 28px;
+ }
+
+ .optionSingle {
+ background: url("btn-blue.png") no-repeat scroll right top transparent;
+ float: left;
+ margin-right: 10px;
+ width: 75px;
+ height: 28px;
+ }
+
+ .option a {
+ background: url("btn-blue.png") no-repeat scroll left top transparent;
+ color: #13335B;
+ cursor: pointer;
+ float: left;
+ font: 900 14px/22px "Arial",Helvetica,sans-serif;
+ text-decoration: none;
+ padding: 1px 8px 5px 18px;
+ }
+
+ .option a:hover {
+ color: #951400;
+ }
+
+ .option a:active {
+ color: #029A00;
+ }
+
+ .optionSingle a {
+ background: url("btn-blue.png") no-repeat scroll left top transparent;
+ color: #13335B;
+ cursor: pointer;
+ float: left;
+ font: 900 14px/22px "Arial",Helvetica,sans-serif;
+ text-decoration: none;
+ padding: 1px 8px 5px 18px;
+ }
+
+ .optionSingle a:hover {
+ color: #951400;
+ }
+
+ .optionSingle a:active {
+ color: #029A00;
+ }
+
+ .lnkBotonBlue {
+ width: 85px;
+ height: 28px;
+ }
+
+ .lnkBotonBlueSingle {
+ width: 45px;
+ height: 28px;
+ }
+
+ .optionOther {
+ float: left;
+ width: 174px;
+ height: 28px;
+ }
+
+ .otherValue {
+ width: 83px;
+ height: 16px;
+ text-align: center;
+ margin: 5px 10px;
+ float: left;
+ }
+
+ .labelOther {
+ float: left;
+ }
+
+ .divTextDonate {
+ clear: both;
+ float: none;
+ }
+
+ .textDonateNewLine {
+ clear: both;
+ float: none;
+ margin-top: 10px;
+ margin-bottom: 10px;
+ }
+
+ </ui:style>
+
+ <g:HTMLPanel addStyleNames="{style.entries}" ui:field="divEntries">
+ <g:HTMLPanel addStyleNames="{style.rightedit}" ui:field="divRightedit">
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.post}" ui:field="divPost">
+ <g:HTMLPanel ui:field="divPostTitle">
+ <g:Label addStyleNames="{style.titlePost}" ui:field="lblPostTitle">
+ Donate to comunes
+ </g:Label>
+ </g:HTMLPanel>
+ <g:HTMLPanel ui:field="divIntro">
+ <g:Label addStyleNames="{style.introPost}" ui:field="lblPostIntro">
+ Comunes is a non-profit organization dedicated to encourage the commons,
+ those goods collectively owned by everybody, and also serves as an umbrella
+ for other related initiatives. We rely on the generous support of people
+ like you and other collectives to help us continue the work we do.
+ </g:Label>
+ </g:HTMLPanel>
+ <g:HTMLPanel ui:field="divTitleRegular">
+ <g:Label addStyleNames="{style.titleRegular}" ui:field="lblRegularTitle">
+ Regular donation per month (the most necessary for us)
+ </g:Label>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.pnlOptions}" ui:field="divRegularDonationsEuros">
+ <g:HTMLPanel addStyleNames="{style.option}" ui:field="optRegularDonationEuros1">
+ <g:Anchor addStyleNames="{style.lnkBotonBlue}" ui:field="lnkEuros1"></g:Anchor>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.option}" ui:field="optRegularDonationEuros2">
+ <g:Anchor addStyleNames="{style.lnkBotonBlue}" ui:field="lnkEuros2"></g:Anchor>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.option}" ui:field="optRegularDonationEuros3">
+ <g:Anchor addStyleNames="{style.lnkBotonBlue}" ui:field="lnkEuros3"></g:Anchor>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.optionOther}" ui:field="optRegularDonationOtherEuros">
+ <g:FormPanel ui:field="formPanelEuros">
+ <g:FlowPanel ui:field="flowPanelEuros">
+ <g:TextBox addStyleNames="{style.otherValue}" ui:field="txtbxOtherValueEuros">
+ </g:TextBox>
+ <g:Hidden name="business" value="donate(a)ourproject.org"></g:Hidden>
+ <g:Hidden name="cmd" value="_xclick-subscriptions"></g:Hidden>
+ <g:Hidden name="item_name" value=" Donate to comunes.org"></g:Hidden>
+ <g:Hidden name="currency_code" value="EUR"></g:Hidden>
+ <g:Hidden name="no_shipping" value="1"></g:Hidden>
+ <g:Hidden name="t3" value="M"></g:Hidden>
+ <g:Hidden name="p3" value="1"></g:Hidden>
+ <g:Hidden name="src" value="1"></g:Hidden>
+ <g:Hidden name="image_url" value="http://comunes.org/cm/images/logo-pp.png"></g:Hidden>
+ <g:Hidden name="sra" value="1"></g:Hidden>
+ <g:Hidden name="lc" value="us"></g:Hidden>
+ <g:Label addStyleNames="{style.labelOther}" ui:field="lblOtherValueEuros">
+ €/month
+ </g:Label>
+ </g:FlowPanel>
+
+ </g:FormPanel>
+ </g:HTMLPanel>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.pnlOptions}" ui:field="divRegularDonationsDollar">
+ <g:HTMLPanel addStyleNames="{style.option}" ui:field="optRegularDonationDollar1">
+ <g:Anchor addStyleNames="{style.lnkBotonBlue}" ui:field="lnkDollar1"></g:Anchor>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.option}" ui:field="optRegularDonationDollar2">
+ <g:Anchor addStyleNames="{style.lnkBotonBlue}" ui:field="lnkDollar2"></g:Anchor>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.option}" ui:field="optRegularDonationDollar3">
+ <g:Anchor addStyleNames="{style.lnkBotonBlue}" ui:field="lnkDollar3"></g:Anchor>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.optionOther}" ui:field="optRegularDonationOtherDollar">
+ <g:FormPanel ui:field="formPanelDollar">
+ <g:FlowPanel ui:field="flowPanelDollar">
+ <g:TextBox addStyleNames="{style.otherValue}" ui:field="txtbxOtherValueDollar">
+ </g:TextBox>
+ <g:Hidden name="business" value="donate(a)ourproject.org"></g:Hidden>
+ <g:Hidden name="cmd" value="_xclick-subscriptions"></g:Hidden>
+ <g:Hidden name="item_name" value=" Donate to comunes.org"></g:Hidden>
+ <g:Hidden name="currency_code" value="USD"></g:Hidden>
+ <g:Hidden name="no_shipping" value="1"></g:Hidden>
+ <g:Hidden name="t3" value="M"></g:Hidden>
+ <g:Hidden name="p3" value="1"></g:Hidden>
+ <g:Hidden name="src" value="1"></g:Hidden>
+ <g:Hidden name="image_url" value="http://comunes.org/cm/images/logo-pp.png"></g:Hidden>
+ <g:Hidden name="sra" value="1"></g:Hidden>
+ <g:Hidden name="lc" value="us"></g:Hidden>
+ <g:Label addStyleNames="{style.labelOther}" ui:field="lblOtherValueDollar">
+ €/month
+ </g:Label>
+ </g:FlowPanel>
+ </g:FormPanel>
+ </g:HTMLPanel>
+ </g:HTMLPanel>
+ <g:HTMLPanel ui:field="divTitleSingle">
+ <g:Label addStyleNames="{style.titleRegular}" ui:field="lblSingleTitle">
+ Single donation
+ </g:Label>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.pnlOptions}" ui:field="divSingleDonationEuros">
+ <g:HTMLPanel addStyleNames="{style.optionSingle}" ui:field="optSingleDonationEuros1">
+ <g:Anchor addStyleNames="{style.lnkBotonBlueSingle}" ui:field="lnkSingleEuros1"></g:Anchor>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.optionSingle}" ui:field="optSingleDonationEuros2">
+ <g:Anchor addStyleNames="{style.lnkBotonBlueSingle}" ui:field="lnkSingleEuros2"></g:Anchor>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.optionSingle}" ui:field="optSingleDonationEuros3">
+ <g:Anchor addStyleNames="{style.lnkBotonBlueSingle}" ui:field="lnkSingleEuros3"></g:Anchor>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.optionSingle}" ui:field="optSingleDonationEuros4">
+ <g:Anchor addStyleNames="{style.lnkBotonBlueSingle}" ui:field="lnkSingleEuros4"></g:Anchor>
+ </g:HTMLPanel>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.pnlOptions}" ui:field="divSingleDonationDollar">
+ <g:HTMLPanel addStyleNames="{style.optionSingle}" ui:field="optSingleDonationDollar1">
+ <g:Anchor addStyleNames="{style.lnkBotonBlueSingle}" ui:field="lnkSingleDollar1"></g:Anchor>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.optionSingle}" ui:field="optSingleDonationDollar2">
+ <g:Anchor addStyleNames="{style.lnkBotonBlueSingle}" ui:field="lnkSingleDollar2"></g:Anchor>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.optionSingle}" ui:field="optSingleDonationDollar3">
+ <g:Anchor addStyleNames="{style.lnkBotonBlueSingle}" ui:field="lnkSingleDollar3"></g:Anchor>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.optionSingle}" ui:field="optSingleDonationDollar4">
+ <g:Anchor addStyleNames="{style.lnkBotonBlueSingle}" ui:field="lnkSingleDollar4"></g:Anchor>
+ </g:HTMLPanel>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.divTextDonate}" ui:field="divTextOther">
+ For other amounts use
+ <g:Anchor ui:field="lnkTextSingleOtherEuros">this link for Euros</g:Anchor>
+ or
+ <g:Anchor ui:field="lnkTextSingleOtherDollar">this one for USD.</g:Anchor>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.textDonateNewLine}" ui:field="divTextOther2">
+ Please consider donating more if you can afford it.
+ </g:HTMLPanel>
+ <g:HTMLPanel ui:field="divTitleBank">
+ <g:Label addStyleNames="{style.titleRegular}" ui:field="lblTitleBank">
+ Give using your Bank
+ </g:Label>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.textDonateNewLine}" ui:field="divTextOther3">
+ <g:Anchor ui:field="lnkTextBank">See our Bank account info page</g:Anchor>
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.textDonateNewLine}" ui:field="divTextOther4">
+ Unless you specify the contrary, we will add you to our donor list.
+ </g:HTMLPanel>
+ <g:HTMLPanel addStyleNames="{style.textDonateNewLine}" ui:field="divTextOther5">
+ If you have doubts please contact us at donate at ourproject dot org.
+ </g:HTMLPanel>
+ <g:HTMLPanel ui:field="divTitleFinal">
+ <g:Label addStyleNames="{style.titleRegular}" ui:field="lblTitleFinal">
+ Thanks indeed!
+ </g:Label>
+ </g:HTMLPanel>
+ </g:HTMLPanel>
+ </g:HTMLPanel>
+</ui:UiBinder>
\ No newline at end of file
Property changes on: donate/src/cc/kune/sandbox/donate/client/DonatePanel.ui.xml
___________________________________________________________________
Name: svn:executable
+ *
1
0
Author: vjrj_
Date: 2011-06-26 05:26:13 +0200 (Sun, 26 Jun 2011)
New Revision: 1419
Added:
trunk/src/main/java/cc/kune/core/client/actions/xml/
trunk/src/main/java/cc/kune/core/client/actions/xml/NewGadgetAction.java
trunk/src/main/java/cc/kune/core/client/actions/xml/WaveExtension.java
trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java
trunk/src/main/java/cc/kune/core/client/actions/xml/XMLGuiActionDescriptor.java
trunk/src/main/java/cc/kune/core/client/actions/xml/XMLKuneClientActions.java
trunk/src/main/java/cc/kune/core/client/actions/xml/XMLRol.java
trunk/src/main/java/cc/kune/core/client/actions/xml/XMLTypeId.java
trunk/src/main/java/cc/kune/core/client/actions/xml/XMLWaveExtension.java
trunk/src/main/java/cc/kune/core/server/content/XMLActionReader.java
trunk/src/main/webapp/others/kune-client-actions.xml
trunk/src/test/java/cc/kune/core/client/actions/xml/
trunk/src/test/java/cc/kune/core/client/actions/xml/XMLKuneClientActionsTest.java
Removed:
trunk/src/main/java/cc/kune/core/client/actions/WaveExtension.java
trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java
trunk/src/main/webapp/others/kune-wave-extensions.xml
trunk/src/test/java/org/ourproject/kune/chat/
Modified:
trunk/.classpath
trunk/pom.xml
trunk/src/main/java/cc/kune/client/KuneGinjector.java
trunk/src/main/java/cc/kune/core/KuneCore.gwt.xml
trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java
trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java
trunk/src/main/java/cc/kune/core/public/ws.css
trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
trunk/src/main/java/cc/kune/core/server/content/CreationService.java
trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java
trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
trunk/src/main/java/cc/kune/gspace/client/actions/AbstractNewMenu.java
Log:
XML Actions almost finished
Modified: trunk/.classpath
===================================================================
--- trunk/.classpath 2011-06-25 02:06:47 UTC (rev 1418)
+++ trunk/.classpath 2011-06-26 03:26:13 UTC (rev 1419)
@@ -136,6 +136,7 @@
<classpathentry kind="var" path="M2_REPO/org/yaml/snakeyaml/1.6/snakeyaml-1.6.jar" sourcepath="M2_REPO/org/yaml/snakeyaml/1.6/snakeyaml-1.6-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0.1/stax-api-1.0.1.jar"/>
<classpathentry kind="var" path="M2_REPO/org/testng/testng/6.0.1/testng-6.0.1.jar" sourcepath="M2_REPO/org/testng/testng/6.0.1/testng-6.0.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/tigase/tigase-xmltools/3.3.5/tigase-xmltools-3.3.5.jar" sourcepath="M2_REPO/tigase/tigase-xmltools/3.3.5/tigase-xmltools-3.3.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/waveprotocol/util-src/0.3.1-SNAPSHOT/util-src-0.3.1-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/waveprotocol/waveinabox-server-0.3/0.3.1-SNAPSHOT/waveinabox-server-0.3-0.3.1-SNAPSHOT.jar"/>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-06-25 02:06:47 UTC (rev 1418)
+++ trunk/pom.xml 2011-06-26 03:26:13 UTC (rev 1419)
@@ -144,6 +144,11 @@
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</repository>
+ <repository>
+ <id>tigase</id>
+ <name>Tigase Repository</name>
+ <url>http://maven.tigase.org</url>
+ </repository>
</repositories>
<pluginRepositories>
<!-- cc -->
@@ -528,6 +533,12 @@
<version>6.0.1</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>tigase</groupId>
+ <artifactId>tigase-xmltools</artifactId>
+ <version>3.3.5</version>
+ <!-- <scope>test</scope> -->
+ </dependency>
<!-- If you want to start a selenium server, you will need the following
dependency: -->
<!-- <dependency> -->
Modified: trunk/src/main/java/cc/kune/client/KuneGinjector.java
===================================================================
--- trunk/src/main/java/cc/kune/client/KuneGinjector.java 2011-06-25 02:06:47 UTC (rev 1418)
+++ trunk/src/main/java/cc/kune/client/KuneGinjector.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -32,7 +32,7 @@
import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
import cc.kune.core.client.CoreGinModule;
import cc.kune.core.client.CoreParts;
-import cc.kune.core.client.actions.XMLActionsParser;
+import cc.kune.core.client.actions.xml.XMLActionsParser;
import cc.kune.core.client.auth.RegisterPresenter;
import cc.kune.core.client.auth.SignInPresenter;
import cc.kune.core.client.cookies.CookiesManager;
Modified: trunk/src/main/java/cc/kune/core/KuneCore.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/core/KuneCore.gwt.xml 2011-06-25 02:06:47 UTC (rev 1418)
+++ trunk/src/main/java/cc/kune/core/KuneCore.gwt.xml 2011-06-26 03:26:13 UTC (rev 1419)
@@ -14,6 +14,8 @@
<inherits name="cc.kune.gspace.GSpace" />
<inherits name="cc.kune.msgs.KuneMsgs" />
<inherits name="cc.kune.common.KuneCommon" />
+ <!-- Because of XML actions -->
+ <inherits name='com.calclab.emite.core.EmiteCore' />
<inherits name="com.extjs.gxt.ui.GXT" />
<!-- <inherits name="com.jhickman.web.gwt.gxtuibinder.GxtUiBinder" />-->
<inherits name="com.calclab.suco.Suco" />
Modified: trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreGinModule.java 2011-06-25 02:06:47 UTC (rev 1418)
+++ trunk/src/main/java/cc/kune/core/client/CoreGinModule.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -30,7 +30,7 @@
import cc.kune.common.client.ui.MaskWidget;
import cc.kune.common.client.ui.MaskWidgetView;
import cc.kune.core.client.actions.ActionRegistryByType;
-import cc.kune.core.client.actions.XMLActionsParser;
+import cc.kune.core.client.actions.xml.XMLActionsParser;
import cc.kune.core.client.auth.Register;
import cc.kune.core.client.auth.RegisterPanel;
import cc.kune.core.client.auth.RegisterPresenter;
@@ -107,6 +107,8 @@
import cc.kune.msgs.client.UserMessagesPanel;
import cc.kune.msgs.client.UserMessagesPresenter;
+import com.calclab.emite.core.client.services.Services;
+import com.calclab.emite.core.client.services.gwt.GWTServices;
import com.google.gwt.event.shared.EventBus;
import com.google.inject.Singleton;
import com.gwtplatform.mvp.client.DefaultProxyFailureHandler;
@@ -215,6 +217,7 @@
s(ErrorsDialog.class);
s(XMLActionsParser.class);
+ bind(Services.class).to(GWTServices.class);
}
}
Deleted: trunk/src/main/java/cc/kune/core/client/actions/WaveExtension.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/WaveExtension.java 2011-06-25 02:06:47 UTC (rev 1418)
+++ trunk/src/main/java/cc/kune/core/client/actions/WaveExtension.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -1,78 +0,0 @@
-package cc.kune.core.client.actions;
-
-public class WaveExtension {
- public static class Builder {
- private String gadgetUrl;
- private String iconCss;
- private String iconUrl;
- private String installerUrl;
- private String name;
-
- public Builder() {
- }
-
- public WaveExtension build() {
- return new WaveExtension(this);
- }
-
- public Builder gadgetUrl(final String gadgetUrl) {
- this.gadgetUrl = gadgetUrl;
- return this;
- }
-
- public Builder iconCss(final String iconCss) {
- this.iconCss = iconCss;
- return this;
- }
-
- public Builder iconUrl(final String iconUrl) {
- this.iconUrl = iconUrl;
- return this;
- }
-
- public Builder installerUrl(final String installerUrl) {
- this.installerUrl = installerUrl;
- return this;
- }
-
- public Builder name(final String name) {
- this.name = name;
- return this;
- }
- }
-
- private final String gadgetUrl;
- private final String iconCss;
- private final String iconUrl;
- private final String installerUrl;
- private final String name;
-
- public WaveExtension(final Builder builder) {
- gadgetUrl = builder.gadgetUrl;
- iconCss = builder.iconCss;
- iconUrl = builder.iconUrl;
- installerUrl = builder.installerUrl;
- name = builder.name;
- }
-
- public String getGadgetUrl() {
- return gadgetUrl;
- }
-
- public String getIconCss() {
- return iconCss;
- }
-
- public String getIconUrl() {
- return iconUrl;
- }
-
- public String getInstallerUrl() {
- return installerUrl;
- }
-
- public String getName() {
- return name;
- }
-
-}
Deleted: trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java 2011-06-25 02:06:47 UTC (rev 1418)
+++ trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -1,192 +0,0 @@
-package cc.kune.core.client.actions;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import cc.kune.common.client.actions.Action;
-import cc.kune.common.client.actions.ActionEvent;
-import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
-import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
-import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
-import cc.kune.common.client.actions.ui.descrip.SubMenuDescriptor;
-import cc.kune.common.client.errors.UIException;
-import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.TextUtils;
-import cc.kune.core.client.actions.WaveExtension.Builder;
-import cc.kune.core.client.errors.ErrorHandler;
-import cc.kune.core.client.registry.NewMenusForTypeIdsRegistry;
-import cc.kune.core.client.rpcservices.ContentServiceAsync;
-import cc.kune.core.shared.dto.AccessRolDTO;
-import cc.kune.gspace.client.actions.ActionGroups;
-
-import com.google.gwt.http.client.Request;
-import com.google.gwt.http.client.RequestBuilder;
-import com.google.gwt.http.client.RequestCallback;
-import com.google.gwt.http.client.RequestException;
-import com.google.gwt.http.client.Response;
-import com.google.gwt.xml.client.Document;
-import com.google.gwt.xml.client.Element;
-import com.google.gwt.xml.client.Node;
-import com.google.gwt.xml.client.NodeList;
-import com.google.gwt.xml.client.XMLParser;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public class XMLActionsParser {
-
- public static class GadgetAction extends RolAction {
-
- private final Provider<ContentServiceAsync> contentService;
- private final String gadgetName;
-
- public GadgetAction(final Provider<ContentServiceAsync> contentService, final AccessRolDTO rok,
- final boolean authNeeded, final String gadgetName, final String iconUrl) {
- super(rok, authNeeded);
- this.contentService = contentService;
- this.gadgetName = gadgetName;
- putValue(Action.SMALL_ICON, iconUrl);
- }
-
- @Override
- public void actionPerformed(final ActionEvent event) {
- NotifyUser.info("Created succesfully");
- }
-
- }
-
- private static final String SEP = "»";
-
- private final ActionRegistryByType actionRegistry;
- private final Provider<ContentServiceAsync> contentService;
- private final ErrorHandler errHandler;
- private final Map<String, WaveExtension> extensionsMap;
- private final NewMenusForTypeIdsRegistry newMenusRegistry;
- private final HashMap<String, SubMenuDescriptor> submenus;
-
- @Inject
- public XMLActionsParser(final ErrorHandler errHandler, final ActionRegistryByType actionRegistry,
- final Provider<ContentServiceAsync> contentService,
- final NewMenusForTypeIdsRegistry newMenusRegistry) {
- this.errHandler = errHandler;
- this.actionRegistry = actionRegistry;
- this.contentService = contentService;
- this.newMenusRegistry = newMenusRegistry;
- extensionsMap = new HashMap<String, WaveExtension>();
- submenus = new HashMap<String, SubMenuDescriptor>();
-
- // Based on:
- // http://www.roseindia.net/tutorials/gwt/retrieving-xml-data.shtml
- final RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET,
- "/others/kune-wave-extensions.xml");
- try {
- requestBuilder.sendRequest(null, new RequestCallback() {
- @Override
- public void onError(final Request request, final Throwable ex) {
- onFailed(ex);
- }
-
- @Override
- public void onResponseReceived(final Request request, final Response response) {
- parseXML(response.getText());
- }
- });
- } catch (final RequestException ex) {
- onFailed(ex);
- }
- }
-
- private String get(final Element extension, final String id) {
- final Node child = extension.getElementsByTagName(id).item(0).getFirstChild();
- return child != null ? child.getNodeValue() : "";
- }
-
- private SubMenuDescriptor getSubMenu(final MenuDescriptor menu, final String typeId,
- final String parentS) {
- final String[] path = parentS.split(SEP);
- SubMenuDescriptor current = null;
- for (int i = 0; i < path.length; i++) {
- final String name = path[i];
- final String subpathId = getSubPathId(typeId, path, i);
- SubMenuDescriptor subMenuDescriptor = submenus.get(subpathId);
- if (subMenuDescriptor == null) {
- final GuiActionDescrip parent = (i == 0 ? menu : submenus.get(getSubPathId(typeId, path, i - 1)));
- assert parent != null;
- subMenuDescriptor = new SubMenuDescriptor(parent, name);
- // subMenuDescriptor.setVisible(false);
- submenus.put(subpathId, subMenuDescriptor);
- actionRegistry.addAction(ActionGroups.TOOLBAR, subMenuDescriptor, typeId);
- }
- current = subMenuDescriptor;
- }
- assert current != null;
- return current;
- }
-
- private String getSubPathId(final String typeId, final String[] path, final int i) {
- final StringBuffer id = new StringBuffer().append(typeId);
- for (int j = 0; j <= i; j++) {
- id.append(SEP).append(path[j]);
- }
- return id.toString();
- }
-
- private void onFailed(final Throwable ex) {
- errHandler.process(ex);
- }
-
- private void parseXML(final String text) {
- final Document parse = XMLParser.parse(text);
- final NodeList extensions = ((Element) parse.getElementsByTagName("extensions").item(0)).getElementsByTagName("extension");
- for (int i = 0; i < extensions.getLength(); i++) {
- final Element extension = (Element) extensions.item(i);
- final Builder builder = new WaveExtension.Builder();
- final String name = get(extension, "name");
- builder.name(name);
- builder.gadgetUrl(get(extension, "gadgetUrl"));
- builder.iconUrl(get(extension, "iconUrl"));
- builder.iconCss(get(extension, "iconCss"));
- builder.installerUrl(get(extension, "installerUrl"));
- extensionsMap.put(name, builder.build());
- }
- final NodeList guiDescriptors = ((Element) parse.getElementsByTagName("guiActionDescriptors").item(0)).getElementsByTagName("guiActionDescriptor");
- for (int i = 0; i < guiDescriptors.getLength(); i++) {
- final Element guiDescriptor = (Element) guiDescriptors.item(i);
- if (Boolean.parseBoolean(get(guiDescriptor, "enabled"))) {
- final String type = get(guiDescriptor, "type");
- if (type.equals("wave-gadget")) {
- final String extensionName = get(guiDescriptor, "extensionName");
- final WaveExtension extension = extensionsMap.get(extensionName);
- if (extension == null) {
- throw new UIException("Undefined extension " + extensionName);
- }
- final String name = get(guiDescriptor, "name");
- final String description = get(guiDescriptor, "description");
- final AccessRolDTO rol = AccessRolDTO.valueOf(get(guiDescriptor, "rolRequired"));
- final GadgetAction action = new GadgetAction(contentService, rol, Boolean.parseBoolean(get(
- guiDescriptor, "authNeed")), extension.getGadgetUrl(), extension.getIconUrl());
- final NodeList typeIds = ((Element) guiDescriptor.getElementsByTagName("typeIds").item(0)).getElementsByTagName("typeId");
- final int length = typeIds.getLength();
-
- for (int j = 0; j < length; j++) {
- final Element typeIdElem = (Element) typeIds.item(j);
- final String typeId = typeIdElem.getFirstChild().getNodeValue();
- final MenuDescriptor menu = newMenusRegistry.get(typeId);
- assert menu != null;
- final String parent = get(guiDescriptor, "parent");
- final SubMenuDescriptor submenu = getSubMenu(menu, typeId, parent);
- final Provider<GuiActionDescrip> menuItemProvider = new Provider<GuiActionDescrip>() {
- @Override
- public GuiActionDescrip get() {
- final MenuItemDescriptor menuItem = new MenuItemDescriptor(action);
- menuItem.withText(name).withToolTip(description);
- menuItem.setParent(TextUtils.notEmpty(parent) ? submenu : menu);
- return menuItem;
- }
- };
- actionRegistry.addAction(ActionGroups.TOOLBAR, menuItemProvider, typeId);
- }
- }
- }
- }
- }
-}
Added: trunk/src/main/java/cc/kune/core/client/actions/xml/NewGadgetAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/xml/NewGadgetAction.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/actions/xml/NewGadgetAction.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -0,0 +1,56 @@
+package cc.kune.core.client.actions.xml;
+
+import cc.kune.common.client.actions.Action;
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.core.client.actions.RolAction;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.rpcservices.ContentServiceAsync;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.dto.AccessRolDTO;
+import cc.kune.core.shared.dto.StateContentDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Provider;
+
+public class NewGadgetAction extends RolAction {
+
+ private final String body;
+ private final Provider<ContentServiceAsync> contentService;
+ private final String gadgetName;
+ private final I18nTranslationService i18n;
+ private final Session session;
+ private final StateManager stateManager;
+ private final String title;
+ private final String typeId;
+
+ public NewGadgetAction(final Provider<ContentServiceAsync> contentService,
+ final StateManager stateManager, final Session session, final I18nTranslationService i18n,
+ final AccessRolDTO rol, final boolean authNeeded, final String gadgetName, final String typeId,
+ final String iconUrl, final String title, final String body) {
+ super(rol, authNeeded);
+ this.contentService = contentService;
+ this.stateManager = stateManager;
+ this.i18n = i18n;
+ this.gadgetName = gadgetName;
+ this.session = session;
+ this.typeId = typeId;
+ this.title = title;
+ this.body = body;
+ putValue(Action.SMALL_ICON, iconUrl);
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ contentService.get().addGadget(session.getUserHash(), session.getCurrentStateToken(), gadgetName,
+ typeId, i18n.t(title), i18n.t(body), new AsyncCallbackSimple<StateContentDTO>() {
+ @Override
+ public void onSuccess(final StateContentDTO result) {
+ NotifyUser.info(i18n.t("[%s] created succesfully", title));
+ stateManager.setRetrievedStateAndGo(result);
+ }
+ });
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/src/main/java/cc/kune/core/client/actions/xml/NewGadgetAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/src/main/java/cc/kune/core/client/actions/xml/WaveExtension.java (from rev 1409, trunk/src/main/java/cc/kune/core/client/actions/WaveExtension.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/xml/WaveExtension.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/actions/xml/WaveExtension.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -0,0 +1,78 @@
+package cc.kune.core.client.actions.xml;
+
+public class WaveExtension {
+ public static class Builder {
+ private String gadgetUrl;
+ private String iconCss;
+ private String iconUrl;
+ private String installerUrl;
+ private String name;
+
+ public Builder() {
+ }
+
+ public WaveExtension build() {
+ return new WaveExtension(this);
+ }
+
+ public Builder gadgetUrl(final String gadgetUrl) {
+ this.gadgetUrl = gadgetUrl;
+ return this;
+ }
+
+ public Builder iconCss(final String iconCss) {
+ this.iconCss = iconCss;
+ return this;
+ }
+
+ public Builder iconUrl(final String iconUrl) {
+ this.iconUrl = iconUrl;
+ return this;
+ }
+
+ public Builder installerUrl(final String installerUrl) {
+ this.installerUrl = installerUrl;
+ return this;
+ }
+
+ public Builder name(final String name) {
+ this.name = name;
+ return this;
+ }
+ }
+
+ private final String gadgetUrl;
+ private final String iconCss;
+ private final String iconUrl;
+ private final String installerUrl;
+ private final String name;
+
+ public WaveExtension(final Builder builder) {
+ gadgetUrl = builder.gadgetUrl;
+ iconCss = builder.iconCss;
+ iconUrl = builder.iconUrl;
+ installerUrl = builder.installerUrl;
+ name = builder.name;
+ }
+
+ public String getGadgetUrl() {
+ return gadgetUrl;
+ }
+
+ public String getIconCss() {
+ return iconCss;
+ }
+
+ public String getIconUrl() {
+ return iconUrl;
+ }
+
+ public String getInstallerUrl() {
+ return installerUrl;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/actions/xml/WaveExtension.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java (from rev 1417, trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -0,0 +1,146 @@
+package cc.kune.core.client.actions.xml;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
+import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
+import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.common.client.actions.ui.descrip.SubMenuDescriptor;
+import cc.kune.common.client.utils.TextUtils;
+import cc.kune.core.client.actions.ActionRegistryByType;
+import cc.kune.core.client.errors.ErrorHandler;
+import cc.kune.core.client.registry.NewMenusForTypeIdsRegistry;
+import cc.kune.core.client.rpcservices.ContentServiceAsync;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.actions.ActionGroups;
+
+import com.calclab.emite.core.client.services.Services;
+import com.google.gwt.http.client.Request;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.RequestCallback;
+import com.google.gwt.http.client.RequestException;
+import com.google.gwt.http.client.Response;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class XMLActionsParser {
+
+ public static final String ACTIONS_XML_LOCATION = "/others/kune-client-actions.xml";
+
+ private static final String SEP = "»";
+
+ private final ActionRegistryByType actionRegistry;
+ private final Provider<ContentServiceAsync> contentService;
+ private final ErrorHandler errHandler;
+ private final I18nTranslationService i18n;
+ private final NewMenusForTypeIdsRegistry newMenusRegistry;
+
+ private final Session session;
+
+ private final StateManager stateManager;
+
+ private final HashMap<String, SubMenuDescriptor> submenus;
+
+ @Inject
+ public XMLActionsParser(final ErrorHandler errHandler, final ActionRegistryByType actionRegistry,
+ final Provider<ContentServiceAsync> contentService, final Session session,
+ final StateManager stateManager, final I18nTranslationService i18n,
+ final NewMenusForTypeIdsRegistry newMenusRegistry, final Services services) {
+ this.errHandler = errHandler;
+ this.actionRegistry = actionRegistry;
+ this.contentService = contentService;
+ this.session = session;
+ this.stateManager = stateManager;
+ this.i18n = i18n;
+ this.newMenusRegistry = newMenusRegistry;
+ submenus = new HashMap<String, SubMenuDescriptor>();
+
+ // Based on:
+ // http://www.roseindia.net/tutorials/gwt/retrieving-xml-data.shtml
+ final RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET, ACTIONS_XML_LOCATION);
+ try {
+ requestBuilder.sendRequest(null, new RequestCallback() {
+ @Override
+ public void onError(final Request request, final Throwable ex) {
+ onFailed(ex);
+ }
+
+ @Override
+ public void onResponseReceived(final Request request, final Response response) {
+ parse(new XMLKuneClientActions(services, response.getText()));
+ }
+ });
+ } catch (final RequestException ex) {
+ onFailed(ex);
+ }
+ }
+
+ private SubMenuDescriptor getSubMenu(final MenuDescriptor menu, final String typeId,
+ final String parentS) {
+ final String[] path = parentS.split(SEP);
+ SubMenuDescriptor current = null;
+ for (int i = 0; i < path.length; i++) {
+ final String name = path[i];
+ final String subpathId = getSubPathId(typeId, path, i);
+ SubMenuDescriptor subMenuDescriptor = submenus.get(subpathId);
+ if (subMenuDescriptor == null) {
+ final GuiActionDescrip parent = (i == 0 ? menu : submenus.get(getSubPathId(typeId, path, i - 1)));
+ assert parent != null;
+ subMenuDescriptor = new SubMenuDescriptor(parent, i18n.t(name));
+ // subMenuDescriptor.setVisible(false);
+ submenus.put(subpathId, subMenuDescriptor);
+ actionRegistry.addAction(ActionGroups.TOOLBAR, subMenuDescriptor, typeId);
+ }
+ current = subMenuDescriptor;
+ }
+ assert current != null;
+ return current;
+ }
+
+ private String getSubPathId(final String typeId, final String[] path, final int i) {
+ final StringBuffer id = new StringBuffer().append(typeId);
+ for (int j = 0; j <= i; j++) {
+ id.append(SEP).append(path[j]);
+ }
+ return id.toString();
+ }
+
+ private void onFailed(final Throwable ex) {
+ errHandler.process(ex);
+ }
+
+ private void parse(final XMLKuneClientActions xml) {
+ final Map<String, XMLWaveExtension> extensions = xml.getExtensions();
+ for (final XMLGuiActionDescriptor descrip : xml.getGuiActionDescriptors()) {
+ if (descrip.isEnabled()) {
+ final XMLWaveExtension extension = extensions.get(descrip.getExtensionName());
+ assert extension != null;
+ for (final XMLTypeId typeId : descrip.getTypeIds()) {
+ final String origTypeId = typeId.getOrigTypeId();
+ final String contentIntro = descrip.getNewContentTextIntro();
+ final NewGadgetAction action = new NewGadgetAction(contentService, stateManager, session,
+ i18n, descrip.getRol().getRolRequired(), descrip.getRol().isAuthNeed(),
+ extension.getExtName(), typeId.getDestTypeId(), extension.getIconUrl(),
+ descrip.getNewContentTitle(), TextUtils.empty(contentIntro) ? "" : contentIntro);
+ final String path = descrip.getPath();
+ final MenuDescriptor menu = newMenusRegistry.get(origTypeId);
+ assert menu != null;
+ final SubMenuDescriptor submenu = getSubMenu(menu, origTypeId, path);
+ final Provider<GuiActionDescrip> menuItemProvider = new Provider<GuiActionDescrip>() {
+ @Override
+ public GuiActionDescrip get() {
+ final MenuItemDescriptor menuItem = new MenuItemDescriptor(action);
+ menuItem.withText(descrip.getDescName()).withToolTip(descrip.getDescription());
+ menuItem.setParent(TextUtils.notEmpty(path) ? submenu : menu);
+ return menuItem;
+ }
+ };
+ actionRegistry.addAction(ActionGroups.TOOLBAR, menuItemProvider, origTypeId);
+ }
+ }
+ }
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/core/client/actions/xml/XMLGuiActionDescriptor.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/xml/XMLGuiActionDescriptor.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/actions/xml/XMLGuiActionDescriptor.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -0,0 +1,71 @@
+package cc.kune.core.client.actions.xml;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.calclab.emite.core.client.packet.DelegatedPacket;
+import com.calclab.emite.core.client.packet.IPacket;
+
+public class XMLGuiActionDescriptor extends DelegatedPacket {
+
+ private XMLRol rol;
+
+ private List<XMLTypeId> typeIds;
+
+ public XMLGuiActionDescriptor(final IPacket xml) {
+ super(xml);
+ }
+
+ public String getDescName() {
+ return getFirstChild("name").getText();
+ }
+
+ public String getDescription() {
+ return getFirstChild("description").getText();
+ }
+
+ public String getExtensionName() {
+ return getFirstChild("extensionName").getText();
+ }
+
+ public String getNewContentTextIntro() {
+ return getFirstChild("new-content-textintro").getText();
+ }
+
+ public String getNewContentTitle() {
+ return getFirstChild("new-content-title").getText();
+ }
+
+ public String getParticipants() {
+ return getFirstChild("participants").getText();
+ }
+
+ public String getPath() {
+ return getFirstChild("path").getText();
+ }
+
+ public XMLRol getRol() {
+ if (rol == null) {
+ rol = new XMLRol(getFirstChild("rol"));
+ }
+ return rol;
+ }
+
+ public String getType() {
+ return getFirstChild("type").getText();
+ }
+
+ public List<XMLTypeId> getTypeIds() {
+ if (typeIds == null) {
+ typeIds = new ArrayList<XMLTypeId>();
+ for (final IPacket p : getFirstChild("typeIds").getChildren()) {
+ typeIds.add(new XMLTypeId(p));
+ }
+ }
+ return typeIds;
+ }
+
+ public boolean isEnabled() {
+ return Boolean.valueOf(getFirstChild("enabled").getText());
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/actions/xml/XMLGuiActionDescriptor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/core/client/actions/xml/XMLKuneClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/xml/XMLKuneClientActions.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/actions/xml/XMLKuneClientActions.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -0,0 +1,41 @@
+package cc.kune.core.client.actions.xml;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.calclab.emite.core.client.packet.DelegatedPacket;
+import com.calclab.emite.core.client.packet.IPacket;
+import com.calclab.emite.core.client.services.Services;
+
+public class XMLKuneClientActions extends DelegatedPacket {
+
+ private Map<String, XMLWaveExtension> extensions;
+ private List<XMLGuiActionDescriptor> guiActionDescriptors;
+
+ public XMLKuneClientActions(final Services services, final String xmlS) {
+ super(services.toXML(xmlS));
+ }
+
+ public Map<String, XMLWaveExtension> getExtensions() {
+ if (extensions == null) {
+ extensions = new HashMap<String, XMLWaveExtension>();
+ for (final IPacket x : getFirstChild("waveExtensions").getChildren()) {
+ final XMLWaveExtension extension = new XMLWaveExtension(x);
+ extensions.put(extension.getExtName(), extension);
+ }
+ }
+ return extensions;
+ }
+
+ public List<XMLGuiActionDescriptor> getGuiActionDescriptors() {
+ if (guiActionDescriptors == null) {
+ guiActionDescriptors = new ArrayList<XMLGuiActionDescriptor>();
+ for (final IPacket x : getFirstChild("guiActionDescriptors").getChildren()) {
+ guiActionDescriptors.add(new XMLGuiActionDescriptor(x));
+ }
+ }
+ return guiActionDescriptors;
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/actions/xml/XMLKuneClientActions.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/core/client/actions/xml/XMLRol.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/xml/XMLRol.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/actions/xml/XMLRol.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -0,0 +1,21 @@
+package cc.kune.core.client.actions.xml;
+
+import cc.kune.core.shared.dto.AccessRolDTO;
+
+import com.calclab.emite.core.client.packet.DelegatedPacket;
+import com.calclab.emite.core.client.packet.IPacket;
+
+public class XMLRol extends DelegatedPacket {
+
+ public XMLRol(final IPacket delegate) {
+ super(delegate);
+ }
+
+ public AccessRolDTO getRolRequired() {
+ return AccessRolDTO.valueOf(getFirstChild("rolRequired").getText());
+ }
+
+ public boolean isAuthNeed() {
+ return Boolean.valueOf(getFirstChild("authNeed").getText());
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/actions/xml/XMLRol.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/core/client/actions/xml/XMLTypeId.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/xml/XMLTypeId.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/actions/xml/XMLTypeId.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -0,0 +1,20 @@
+package cc.kune.core.client.actions.xml;
+
+import com.calclab.emite.core.client.packet.DelegatedPacket;
+import com.calclab.emite.core.client.packet.IPacket;
+
+public class XMLTypeId extends DelegatedPacket {
+
+ public XMLTypeId(final IPacket delegate) {
+ super(delegate);
+ }
+
+ public String getDestTypeId() {
+ return getAttribute("destTypeId");
+ }
+
+ public String getOrigTypeId() {
+ return getAttribute("origTypeId");
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/actions/xml/XMLTypeId.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/core/client/actions/xml/XMLWaveExtension.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/xml/XMLWaveExtension.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/actions/xml/XMLWaveExtension.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -0,0 +1,32 @@
+package cc.kune.core.client.actions.xml;
+
+import com.calclab.emite.core.client.packet.DelegatedPacket;
+import com.calclab.emite.core.client.packet.IPacket;
+
+public class XMLWaveExtension extends DelegatedPacket {
+
+ public XMLWaveExtension(final IPacket xml) {
+ super(xml);
+ }
+
+ public String getExtName() {
+ return getFirstChild("name").getText();
+ }
+
+ public String getGadgetUrl() {
+ return getFirstChild("gadgetUrl").getText();
+ }
+
+ public String getIconCss() {
+ return getFirstChild("iconCss").getText();
+ }
+
+ public String getIconUrl() {
+ return getFirstChild("iconUrl").getText();
+ }
+
+ public String getInstallerUrl() {
+ return getFirstChild("installerUrl").getText();
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/actions/xml/XMLWaveExtension.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java 2011-06-25 02:06:47 UTC (rev 1418)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -46,6 +46,9 @@
StateContainerDTO addFolder(String hash, StateToken parentToken, String typeId, String title)
throws DefaultException;
+ StateContentDTO addGadget(String userHash, StateToken currentStateToken, String gadgetName,
+ String typeId, String title, String body);
+
void addParticipant(String userHash, StateToken token, String participant) throws DefaultException;
StateContainerDTO addRoom(String user, StateToken parentToken, String name) throws DefaultException;
@@ -80,5 +83,4 @@
StateAbstractDTO setStatusAsAdmin(String userHash, StateToken stateToken, ContentStatus status);
TagCloudResult setTags(String userHash, StateToken token, String tags) throws DefaultException;
-
}
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java 2011-06-25 02:06:47 UTC (rev 1418)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -45,6 +45,9 @@
void addFolder(String hash, StateToken parentToken, String title, String typeId,
AsyncCallback<StateContainerDTO> callback);
+ void addGadget(String userHash, StateToken currentStateToken, String gadgetName, String typeId,
+ String title, String body, AsyncCallback<StateContentDTO> asyncCallback);
+
void addParticipant(String userHash, StateToken token, String authorShortName,
AsyncCallback<Void> asyncCallback) throws DefaultException;
Modified: trunk/src/main/java/cc/kune/core/public/ws.css
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.css 2011-06-25 02:06:47 UTC (rev 1418)
+++ trunk/src/main/java/cc/kune/core/public/ws.css 2011-06-26 03:26:13 UTC (rev 1419)
@@ -1,5 +1,4 @@
-CHARSET "UTF-8 ";
-body {
+CHARSET "UTF-8 "; body {
background-color: transparent;
color: black;
font-family: 'Ubuntu', Arial;
@@ -271,14 +270,16 @@
}
-.gwt-SplitLayoutPanel .gwt-SplitLayoutPanel-HDragger {
+.gwt-SplitLayoutPanel .gwt-SplitLayoutPanel-HDragger,.gwt-SplitLayoutPanel-HDragger
+ {
background-color: transparent;
background: url("images/spliter-top.png") no-repeat scroll center bottom
transparent;
cursor: col-resize;
}
-.gwt-SplitLayoutPanel .gwt-SplitLayoutPanel-VDragger {
+.gwt-SplitLayoutPanel .gwt-SplitLayoutPanel-VDragger,.gwt-SplitLayoutPanel-VDragger
+ {
background-color: white;
background: none;
cursor: row-resize;
@@ -949,9 +950,11 @@
}
.k-sn-2nd-spanel {
+
}
.k-sn-3rd-panel {
+
}
.k-sn-adminsscroll,.k-sn-collabsscroll,.k-sn-pendingsscroll {
@@ -1127,6 +1130,7 @@
}
.k-tool-panel {
+
}
.k-tool-item {
@@ -1136,6 +1140,7 @@
}
.k-tool-item-focus {
+
}
.k-tool-item-nofocus {
@@ -1143,9 +1148,11 @@
}
.k-tool-item-selected {
+
}
.k-tool-item-notselected {
+
}
.k-def-docbtn span {
@@ -1194,7 +1201,7 @@
-webkit-border-bottom-left-radius: 5px;
-moz-border-radius-bottomleft: 5px;
border-bottom-left-radius: 5px;
- kfilter: alpha(opacity = 90);
+ kfilter: alpha(opacity = 90);
-moz-opacity: 0.90;
-khtml-opacity: 0.90;
opacity: 0.90;
Modified: trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java 2011-06-25 02:06:47 UTC (rev 1418)
+++ trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -46,6 +46,7 @@
import cc.kune.core.server.content.ContentManagerDefault;
import cc.kune.core.server.content.CreationService;
import cc.kune.core.server.content.CreationServiceDefault;
+import cc.kune.core.server.content.XMLActionReader;
import cc.kune.core.server.i18n.I18nTranslationServiceDefault;
import cc.kune.core.server.manager.ExtMediaDescripManager;
import cc.kune.core.server.manager.FileManager;
@@ -151,6 +152,7 @@
bind(StateService.class).to(StateServiceDefault.class);
bind(I18nTranslationService.class).to(I18nTranslationServiceDefault.class);
bind(SessionService.class).to(SessionServiceDefault.class);
+ bind(XMLActionReader.class);
}
@Override
Modified: trunk/src/main/java/cc/kune/core/server/content/CreationService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/CreationService.java 2011-06-25 02:06:47 UTC (rev 1418)
+++ trunk/src/main/java/cc/kune/core/server/content/CreationService.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -19,7 +19,6 @@
*/
package cc.kune.core.server.content;
-
import cc.kune.domain.Container;
import cc.kune.domain.Content;
import cc.kune.domain.Group;
@@ -28,10 +27,14 @@
public interface CreationService {
- Content createContent(String title, String body, User user, Container container, String typeId);
+ Content createContent(String title, String body, User user, Container container, String typeId);
- Container createFolder(Group group, Long parentFolderId, String name, I18nLanguage language, String contentTypeId);
+ Container createFolder(Group group, Long parentFolderId, String name, I18nLanguage language,
+ String contentTypeId);
- Content saveContent(User editor, Content descriptor, String content);
+ Content createGadget(User user, Container container, String gadgetname, String typeId, String title,
+ String body);
+ Content saveContent(User editor, Content descriptor, String content);
+
}
Modified: trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java 2011-06-25 02:06:47 UTC (rev 1418)
+++ trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -19,8 +19,14 @@
*/
package cc.kune.core.server.content;
+import java.net.MalformedURLException;
import java.net.URL;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import cc.kune.core.client.actions.xml.XMLKuneClientActions;
+import cc.kune.core.client.actions.xml.XMLWaveExtension;
import cc.kune.core.server.tool.ServerTool;
import cc.kune.core.server.tool.ServerToolRegistry;
import cc.kune.core.server.tool.ServerWaveTool;
@@ -36,16 +42,21 @@
@Singleton
public class CreationServiceDefault implements CreationService {
+ private final XMLKuneClientActions actions;
private final ContainerManager containerManager;
private final ContentManager contentManager;
+ private final Log LOG = LogFactory.getLog(CreationServiceDefault.class);
+
private final ServerToolRegistry tools;
@Inject
public CreationServiceDefault(final ContainerManager containerManager,
- final ContentManager contentManager, final ServerToolRegistry toolRegistry) {
+ final ContentManager contentManager, final ServerToolRegistry toolRegistry,
+ final XMLActionReader xmlActionReader) {
this.containerManager = containerManager;
this.contentManager = contentManager;
this.tools = toolRegistry;
+ this.actions = xmlActionReader.getActions();
}
@Override
@@ -73,6 +84,27 @@
}
@Override
+ public Content createGadget(final User user, final Container container, final String gadgetname,
+ final String typeIdChild, final String title, final String body) {
+ final String toolName = container.getToolName();
+ final ServerTool tool = tools.get(toolName);
+ tool.checkTypesBeforeContentCreation(container.getTypeId(), typeIdChild);
+ final XMLWaveExtension extension = actions.getExtensions().get(gadgetname);
+ assert extension != null;
+ URL gadgetUrl = null;
+ final String urlS = extension.getGadgetUrl();
+ try {
+ gadgetUrl = new URL(urlS);
+ } catch (final MalformedURLException e) {
+ LOG.error("Parsing gadget URL: " + urlS, e);
+ }
+ final Content content = contentManager.createContent(title, body, user, container, typeIdChild,
+ gadgetUrl);
+ tool.onCreateContent(content, container);
+ return content;
+ }
+
+ @Override
public Content saveContent(final User editor, final Content content, final String body) {
return contentManager.save(editor, content, body);
}
Added: trunk/src/main/java/cc/kune/core/server/content/XMLActionReader.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/XMLActionReader.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/content/XMLActionReader.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -0,0 +1,40 @@
+package cc.kune.core.server.content;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.nio.MappedByteBuffer;
+import java.nio.channels.FileChannel;
+import java.nio.charset.Charset;
+
+import cc.kune.core.client.actions.xml.XMLActionsParser;
+import cc.kune.core.client.actions.xml.XMLKuneClientActions;
+
+import com.calclab.emite.xtesting.ServicesTester;
+import com.google.inject.Singleton;
+
+@Singleton
+public class XMLActionReader {
+
+ private XMLKuneClientActions actions;
+
+ public XMLActionReader() throws IOException {
+ final File xmlFile = new File("src/main/webapp/" + XMLActionsParser.ACTIONS_XML_LOCATION);
+
+ // Inspired in:
+ // http://stackoverflow.com/questions/326390/how-to-create-a-java-string-from-…
+ final FileInputStream stream = new FileInputStream(xmlFile);
+ try {
+ final FileChannel fc = stream.getChannel();
+ final MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size());
+ final String xml = Charset.forName("UTF-8").decode(bb).toString();
+ actions = new XMLKuneClientActions(new ServicesTester(), xml);
+ } finally {
+ stream.close();
+ }
+ }
+
+ public XMLKuneClientActions getActions() {
+ return actions;
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/core/server/content/XMLActionReader.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2011-06-25 02:06:47 UTC (rev 1418)
+++ trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -141,6 +141,21 @@
@Override
@Authenticated
+ @Authorizated(actionLevel = ActionLevel.container, accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
+ @Transactional
+ public StateContentDTO addGadget(final String userHash, final StateToken parentToken,
+ final String gadgetname, final String typeId, final String title, final String body)
+ throws DefaultException {
+ final User user = getCurrentUser();
+ final Container container = accessService.accessToContainer(
+ ContentUtils.parseId(parentToken.getFolder()), user, AccessRol.Editor);
+ final Content addedContent = creationService.createGadget(user, container, gadgetname, typeId,
+ title, body);
+ return getState(user, addedContent);
+ }
+
+ @Override
+ @Authenticated
@Authorizated(accessRolRequired = AccessRol.Editor, mustCheckMembership = false)
@Transactional
public void addParticipant(final String userHash, final StateToken token, final String participant)
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/AbstractNewMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/AbstractNewMenu.java 2011-06-25 02:06:47 UTC (rev 1418)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/AbstractNewMenu.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -34,7 +34,7 @@
public AbstractNewMenu(final CoreResources res, final I18nTranslationService i18n,
final AccessRightsClientManager rightsManager) {
super();
- this.withIcon(res.arrowdownsitebar()).withStyles("k-button, k-btn, k-5corners, k-def-docbtn, k-fl").withText(
+ this.withIcon(res.addGreen()).withStyles("k-button, k-btn, k-5corners, k-def-docbtn, k-fl").withText(
"New");
rightsManager.onRightsChanged(true, new AccessRightsChangedHandler() {
Copied: trunk/src/main/webapp/others/kune-client-actions.xml (from rev 1418, trunk/src/main/webapp/others/kune-wave-extensions.xml)
===================================================================
--- trunk/src/main/webapp/others/kune-client-actions.xml (rev 0)
+++ trunk/src/main/webapp/others/kune-client-actions.xml 2011-06-26 03:26:13 UTC (rev 1419)
@@ -0,0 +1,215 @@
+<?xml version="1.0" ?>
+
+<kuneClientActions>
+
+ <!-- List of Wave extensions to use in Kune ===================== -->
+ <waveExtensions>
+
+ <extension>
+ <name>pollo</name>
+ <installerUrl>http://wavepollo.appspot.com/pollo.xml
+ </installerUrl>
+ <gadgetUrl>http://wavepollo.appspot.com/wavepollo/com.appspot.wavepollo.client.PolloWa…
+ </gadgetUrl>
+ <iconUrl>https://flinz-pollo.appspot.com/document_graph.png
+ </iconUrl>
+ <iconCss></iconCss>
+ </extension>
+
+ <extension>
+ <name>waffle</name>
+ <installerUrl>http://www.waffle.dk/install.xml
+ </installerUrl>
+ <gadgetUrl>http://www.waffle.dk/waffle.xml
+ </gadgetUrl>
+ <iconUrl>http://www.waffle.dk/waffleThumb.png
+ </iconUrl>
+ <iconCss></iconCss>
+ </extension>
+
+ <extension>
+ <name>massmob</name>
+ <installerUrl>http://mass-mob.appspot.com/massmob/massmob-extension.xml
+ </installerUrl>
+ <gadgetUrl>http://mass-mob.appspot.com/massmob/org.ourproject.massmob.client.MassmobGa…
+ </gadgetUrl>
+ <iconUrl>http://mass-mob.appspot.com/logo.png
+ </iconUrl>
+ <iconCss></iconCss>
+ </extension>
+
+ <extension>
+ <name>twitter-search</name>
+ <installerUrl>https://google-wave-resources.googlecode.com/svn/trunk/samples/extensions/g…
+ </installerUrl>
+ <gadgetUrl>http://google-wave-resources.googlecode.com/svn/trunk/samples/extensions/ga…
+ </gadgetUrl>
+ <iconUrl>http://google-wave-resources.googlecode.com/svn/trunk/samples/extensions/ga…
+ </iconUrl>
+ <iconCss></iconCss>
+ </extension>
+
+ <extension>
+ <name>wavetube</name>
+ <installerUrl>http://everybodywave.appspot.com/gadget/WaveTube/xt.xml
+ </installerUrl>
+ <gadgetUrl>http://everybodywave.appspot.com/gadget/WaveTube/main.xml
+ </gadgetUrl>
+ <iconUrl>http://everybodywave.appspot.com/gadget/WaveTube/thumb.png
+ </iconUrl>
+ <iconCss></iconCss>
+ </extension>
+
+ </waveExtensions>
+
+ <!-- Where and how to use the above extensions ================ -->
+
+ <guiActionDescriptors>
+
+ <guiActionDescriptor>
+ <type>wave-gadget</type>
+ <extensionName>massmob</extensionName>
+ <name>New meeting</name>
+ <path>Gadget»Calendar</path>
+ <description>Call and speed-up of events as meeting, smartmobs,
+ flashmobs, protest demonstrations, etc.</description>
+ <new-content-title>New meeting</new-content-title>
+ <new-content-textintro></new-content-textintro>
+ <enabled>true</enabled>
+ <typeIds>
+ <typeId origTypeId="docs.folder" destTypeId="docs.doc" />
+ <typeId origTypeId="docs.root" destTypeId="docs.doc" />
+ <typeId origTypeId="blogs.blog" destTypeId="blogs.post" />
+ </typeIds>
+ <rol>
+ <!-- Administrator, Editor, Viewer -->
+ <rolRequired>Editor</rolRequired>
+ <authNeed>true</authNeed>
+ </rol>
+ <!-- only for new waves: anyone, onlymembers, onlyadmins, ask (not
+ used yet) -->
+ <participants>ask</participants>
+ </guiActionDescriptor>
+
+ <guiActionDescriptor>
+ <type>wave-gadget</type>
+ <extensionName>pollo</extensionName>
+ <name>New poll</name>
+ <path>Gadget»Voting</path>
+ <description>Make some poll (allow single and multiple polls))
+ </description>
+ <new-content-title>New poll</new-content-title>
+ <new-content-textintro></new-content-textintro>
+ <enabled>true</enabled>
+ <typeIds>
+ <typeId origTypeId="docs.folder" destTypeId="docs.doc" />
+ <typeId origTypeId="docs.root" destTypeId="docs.doc" />
+ <typeId origTypeId="blogs.blog" destTypeId="blogs.post" />
+ </typeIds>
+ <rol>
+ <!-- Administrator, Editor, Viewer -->
+ <rolRequired>Editor</rolRequired>
+ <authNeed>true</authNeed>
+ </rol>
+ <!-- only for new waves: anyone, onlymembers, onlyadmins, ask (not
+ used yet) -->
+ <participants>ask</participants>
+ </guiActionDescriptor>
+
+ <guiActionDescriptor>
+ <type>wave-gadget</type>
+ <extensionName>waffle</extensionName>
+ <name>New meet coordination</name>
+ <path>Gadget»Calendar</path>
+ <description>Users are polled to determine the best time and date
+ to meet
+ </description>
+ <new-content-title>New meet coordination</new-content-title>
+ <new-content-textintro></new-content-textintro>
+ <enabled>true</enabled>
+ <typeIds>
+ <typeId origTypeId="docs.folder" destTypeId="docs.doc" />
+ <typeId origTypeId="docs.root" destTypeId="docs.doc" />
+ <typeId origTypeId="blogs.blog" destTypeId="blogs.post" />
+ </typeIds>
+ <rol>
+ <!-- Administrator, Editor, Viewer -->
+ <rolRequired>Editor</rolRequired>
+ <authNeed>true</authNeed>
+ </rol>
+ <!-- only for new waves: anyone, onlymembers, onlyadmins, ask (not
+ used yet) -->
+ <participants>ask</participants>
+ </guiActionDescriptor>
+
+ <guiActionDescriptor>
+ <type>wave-gadget</type>
+ <extensionName>twitter-search</extensionName>
+ <name>New twitter search</name>
+ <path>Gadget»News</path>
+ <description>Shows results from Twitter for a given search term.
+ Participants can edit to specify new term.</description>
+ <new-content-title>Twitter search</new-content-title>
+ <new-content-textintro></new-content-textintro>
+ <enabled>true</enabled>
+ <typeIds>
+ <typeId origTypeId="docs.folder" destTypeId="docs.doc" />
+ <typeId origTypeId="docs.root" destTypeId="docs.doc" />
+ <typeId origTypeId="blogs.blog" destTypeId="blogs.post" />
+ </typeIds>
+ <rol>
+ <!-- Administrator, Editor, Viewer -->
+ <rolRequired>Editor</rolRequired>
+ <authNeed>true</authNeed>
+ </rol>
+ <!-- only for new waves: anyone, onlymembers, onlyadmins, ask (not
+ used yet) -->
+ <participants>ask</participants>
+ </guiActionDescriptor>
+
+ <guiActionDescriptor>
+ <type>wave-gadget</type>
+ <extensionName>wavetube</extensionName>
+ <name>New Youtube video</name>
+ <path>Gadget»Media</path>
+ <description>Adds a YouTube player that displays the list of
+ viewers in real time</description>
+ <new-content-title>New Youtube video</new-content-title>
+ <new-content-textintro></new-content-textintro>
+ <enabled>true</enabled>
+ <typeIds>
+ <typeId origTypeId="docs.folder" destTypeId="docs.doc" />
+ <typeId origTypeId="docs.root" destTypeId="docs.doc" />
+ <typeId origTypeId="blogs.blog" destTypeId="blogs.post" />
+ </typeIds>
+ <rol>
+ <!-- Administrator, Editor, Viewer -->
+ <rolRequired>Editor</rolRequired>
+ <authNeed>true</authNeed>
+ </rol>
+ <!-- only for new waves: anyone, onlymembers, onlyadmins, ask (not
+ used yet) -->
+ <participants>ask</participants>
+ </guiActionDescriptor>
+
+ <guiActionDescriptor>
+ <type>wave-gadget</type>
+ <extensionName>massmob</extensionName>
+ <name>Add a meeting</name>
+ <path>Gadget»Calendar</path>
+ <description>Call and speed-up of events as meeting, smartmobs,
+ flashmobs, protest demonstrations, etc.</description>
+ <enabled>false</enabled>
+ <typeIds>
+ <typeId origTypeId="docs.folder" destTypeId="docs.doc" />
+ </typeIds>
+ <rol>
+ <!-- Administrator, Editor, Viewer -->
+ <rolRequired>Editor</rolRequired>
+ <authNeed>true</authNeed>
+ </rol>
+ </guiActionDescriptor>
+
+ </guiActionDescriptors>
+
+</kuneClientActions>
\ No newline at end of file
Property changes on: trunk/src/main/webapp/others/kune-client-actions.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/src/main/webapp/others/kune-wave-extensions.xml
===================================================================
--- trunk/src/main/webapp/others/kune-wave-extensions.xml 2011-06-25 02:06:47 UTC (rev 1418)
+++ trunk/src/main/webapp/others/kune-wave-extensions.xml 2011-06-26 03:26:13 UTC (rev 1419)
@@ -1,223 +0,0 @@
-<?xml version="1.0" ?>
-
-<kuneWaveExtensions>
-
- <!-- List of Wave extensions to use in Kune ===================== -->
-
- <extensions>
-
- <extension>
- <name>pollo</name>
- <installerUrl>http://wavepollo.appspot.com/pollo.xml
- </installerUrl>
- <gadgetUrl>http://wavepollo.appspot.com/wavepollo/com.appspot.wavepollo.client.PolloWa…
- </gadgetUrl>
- <iconUrl>https://flinz-pollo.appspot.com/document_graph.png
- </iconUrl>
- <iconCss></iconCss>
- </extension>
-
- <extension>
- <name>waffle</name>
- <installerUrl>http://www.waffle.dk/install.xml
- </installerUrl>
- <gadgetUrl>http://www.waffle.dk/waffle.xml
- </gadgetUrl>
- <iconUrl>http://www.waffle.dk/waffleThumb.png
- </iconUrl>
- <iconCss></iconCss>
- </extension>
-
- <extension>
- <name>massmob</name>
- <installerUrl>http://mass-mob.appspot.com/massmob/massmob-extension.xml
- </installerUrl>
- <gadgetUrl>http://mass-mob.appspot.com/massmob/org.ourproject.massmob.client.MassmobGa…
- </gadgetUrl>
- <iconUrl>http://mass-mob.appspot.com/logo.png</iconUrl>
- <iconCss></iconCss>
- </extension>
-
- <extension>
- <name>twitter-search</name>
- <installerUrl>https://google-wave-resources.googlecode.com/svn/trunk/samples/extensions/g…
- </installerUrl>
- <gadgetUrl>http://google-wave-resources.googlecode.com/svn/trunk/samples/extensions/ga…
- </gadgetUrl>
- <iconUrl>http://google-wave-resources.googlecode.com/svn/trunk/samples/extensions/ga…
- </iconUrl>
- <iconCss></iconCss>
- </extension>
-
- <extension>
- <name>wavetube</name>
- <installerUrl>http://everybodywave.appspot.com/gadget/WaveTube/xt.xml
- </installerUrl>
- <gadgetUrl>http://everybodywave.appspot.com/gadget/WaveTube/main.xml
- </gadgetUrl>
- <iconUrl>http://everybodywave.appspot.com/gadget/WaveTube/thumb.png
- </iconUrl>
- <iconCss></iconCss>
- </extension>
-
- </extensions>
-
- <!-- Where and how to use the above extensions ================ -->
-
- <guiActionDescriptors>
-
- <guiActionDescriptor>
- <type>wave-gadget</type>
- <extensionName>massmob</extensionName>
- <name>New meeting</name>
- <parent>Gadget»Calendar</parent>
- <description>Call and speed-up of events as meeting, smartmobs,
- flashmobs, protest demonstrations, etc.</description>
- <enabled>true</enabled>
- <typeIds>
- <typeId>docs.folder</typeId>
- <typeId>docs.root</typeId>
- <typeId>blogs.blog</typeId>
- </typeIds>
- <name></name>
- <location>
- <rol>
- <!-- Administrator, Editor, Viewer -->
- <rolRequired>Editor</rolRequired>
- <authNeed>true</authNeed>
- </rol>
- </location>
- <!-- only for new waves: anyone, onlymembers, onlyadmins, ask (not
- used yet) -->
- <participants>ask</participants>
- </guiActionDescriptor>
-
- <guiActionDescriptor>
- <type>wave-gadget</type>
- <extensionName>pollo</extensionName>
- <name>New poll</name>
- <parent>Gadget»Voting</parent>
- <description>Make some poll (allow single and multiple polls))
- </description>
- <enabled>true</enabled>
- <typeIds>
- <typeId>docs.folder</typeId>
- <typeId>docs.root</typeId>
- <typeId>blogs.blog</typeId>
- </typeIds>
- <name></name>
- <location>
- <rol>
- <!-- Administrator, Editor, Viewer -->
- <rolRequired>Editor</rolRequired>
- <authNeed>true</authNeed>
- </rol>
- </location>
- <!-- only for new waves: anyone, onlymembers, onlyadmins, ask (not
- used yet) -->
- <participants>ask</participants>
- </guiActionDescriptor>
-
- <guiActionDescriptor>
- <type>wave-gadget</type>
- <extensionName>waffle</extensionName>
- <name>New meet coordination</name>
- <parent>Gadget»Calendar</parent>
- <description>Users are polled to determine the best time and date
- to meet
- </description>
- <enabled>true</enabled>
- <typeIds>
- <typeId>docs.folder</typeId>
- <typeId>docs.root</typeId>
- <typeId>blogs.blog</typeId>
- </typeIds>
- <name></name>
- <location>
- <rol>
- <!-- Administrator, Editor, Viewer -->
- <rolRequired>Editor</rolRequired>
- <authNeed>true</authNeed>
- </rol>
- </location>
- <!-- only for new waves: anyone, onlymembers, onlyadmins, ask (not
- used yet) -->
- <participants>ask</participants>
- </guiActionDescriptor>
-
- <guiActionDescriptor>
- <type>wave-gadget</type>
- <extensionName>twitter-search</extensionName>
- <name>New twitter search</name>
- <parent>Gadget»News</parent>
- <description>Shows results from Twitter for a given search term.
- Participants can edit to specify new term.</description>
- <enabled>true</enabled>
- <typeIds>
- <typeId>docs.folder</typeId>
- <typeId>docs.root</typeId>
- <typeId>blogs.blog</typeId>
- </typeIds>
- <name></name>
- <location>
- <rol>
- <!-- Administrator, Editor, Viewer -->
- <rolRequired>Editor</rolRequired>
- <authNeed>true</authNeed>
- </rol>
- </location>
- <!-- only for new waves: anyone, onlymembers, onlyadmins, ask (not
- used yet) -->
- <participants>ask</participants>
- </guiActionDescriptor>
-
- <guiActionDescriptor>
- <type>wave-gadget</type>
- <extensionName>wavetube</extensionName>
- <name>New youtube video</name>
- <parent>Gadget»Media</parent>
- <description>Adds a YouTube player that displays the list of viewers in real time</description>
- <enabled>true</enabled>
- <typeIds>
- <typeId>docs.folder</typeId>
- <typeId>docs.root</typeId>
- <typeId>blogs.blog</typeId>
- </typeIds>
- <name></name>
- <location>
- <rol>
- <!-- Administrator, Editor, Viewer -->
- <rolRequired>Editor</rolRequired>
- <authNeed>true</authNeed>
- </rol>
- </location>
- <!-- only for new waves: anyone, onlymembers, onlyadmins, ask (not
- used yet) -->
- <participants>ask</participants>
- </guiActionDescriptor>
-
-
- <guiActionDescriptor>
- <type>wave-gadget</type>
- <extensionName>massmob</extensionName>
- <name>Add a meeting</name>
- <parent>Gadget»Calendar</parent>
- <description>Call and speed-up of events as meeting, smartmobs,
- flashmobs, protest demonstrations, etc.</description>
- <enabled>false</enabled>
- <typeIds>
- <typeId>docs.doc</typeId>
- </typeIds>
- <name></name>
- <location>
- <rol>
- <!-- Administrator, Editor, Viewer -->
- <rolRequired>Editor</rolRequired>
- <authNeed>true</authNeed>
- </rol>
- </location>
- </guiActionDescriptor>
-
- </guiActionDescriptors>
-
-</kuneWaveExtensions>
\ No newline at end of file
Added: trunk/src/test/java/cc/kune/core/client/actions/xml/XMLKuneClientActionsTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/client/actions/xml/XMLKuneClientActionsTest.java (rev 0)
+++ trunk/src/test/java/cc/kune/core/client/actions/xml/XMLKuneClientActionsTest.java 2011-06-26 03:26:13 UTC (rev 1419)
@@ -0,0 +1,57 @@
+package cc.kune.core.client.actions.xml;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import cc.kune.core.server.content.XMLActionReader;
+
+public class XMLKuneClientActionsTest {
+
+ private XMLKuneClientActions actions;
+
+ @Before
+ public void before() throws IOException {
+ actions = new XMLActionReader().getActions();
+ }
+
+ @Test
+ public void testExtensions() {
+ final Map<String, XMLWaveExtension> extensions = actions.getExtensions();
+ assertTrue(extensions.size() > 0);
+ for (final XMLWaveExtension extension : extensions.values()) {
+ assertTrue(extension.getExtName().length() > 0);
+ assertTrue(extension.getGadgetUrl().length() > 0);
+ assertTrue(extension.getIconUrl().length() > 0 || extension.getIconCss().length() > 0);
+ }
+ }
+
+ @Test
+ public void testGuiActions() {
+ final List<XMLGuiActionDescriptor> guiActionDescriptors = actions.getGuiActionDescriptors();
+ assertTrue(guiActionDescriptors.size() > 0);
+ for (final XMLGuiActionDescriptor descrip : guiActionDescriptors) {
+ assertTrue(descrip.getDescName().length() > 0);
+ assertTrue(descrip.getType().length() > 0);
+ assertTrue(descrip.getExtensionName().length() > 0);
+ assertTrue(descrip.getPath().length() >= 0);
+ assertTrue(descrip.isEnabled() || !descrip.isEnabled());
+ final List<XMLTypeId> typeIds = descrip.getTypeIds();
+ assertTrue(typeIds.size() > 0);
+ for (final XMLTypeId typeId : typeIds) {
+ assertTrue(typeId.getOrigTypeId().length() > 0);
+ assertTrue(typeId.getDestTypeId().length() > 0);
+ }
+ final XMLRol rol = descrip.getRol();
+ assertNotNull(rol);
+ assertTrue(rol.isAuthNeed() || !rol.isAuthNeed());
+ assertTrue(rol.getRolRequired() != null);
+ }
+ }
+}
Property changes on: trunk/src/test/java/cc/kune/core/client/actions/xml/XMLKuneClientActionsTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
1
0
Author: vjrj_
Date: 2011-06-25 04:06:47 +0200 (Sat, 25 Jun 2011)
New Revision: 1418
Modified:
trunk/src/main/webapp/others/kune-wave-extensions.xml
Log:
More useful extensions
Modified: trunk/src/main/webapp/others/kune-wave-extensions.xml
===================================================================
--- trunk/src/main/webapp/others/kune-wave-extensions.xml 2011-06-24 23:04:18 UTC (rev 1417)
+++ trunk/src/main/webapp/others/kune-wave-extensions.xml 2011-06-25 02:06:47 UTC (rev 1418)
@@ -18,6 +18,17 @@
</extension>
<extension>
+ <name>waffle</name>
+ <installerUrl>http://www.waffle.dk/install.xml
+ </installerUrl>
+ <gadgetUrl>http://www.waffle.dk/waffle.xml
+ </gadgetUrl>
+ <iconUrl>http://www.waffle.dk/waffleThumb.png
+ </iconUrl>
+ <iconCss></iconCss>
+ </extension>
+
+ <extension>
<name>massmob</name>
<installerUrl>http://mass-mob.appspot.com/massmob/massmob-extension.xml
</installerUrl>
@@ -27,6 +38,28 @@
<iconCss></iconCss>
</extension>
+ <extension>
+ <name>twitter-search</name>
+ <installerUrl>https://google-wave-resources.googlecode.com/svn/trunk/samples/extensions/g…
+ </installerUrl>
+ <gadgetUrl>http://google-wave-resources.googlecode.com/svn/trunk/samples/extensions/ga…
+ </gadgetUrl>
+ <iconUrl>http://google-wave-resources.googlecode.com/svn/trunk/samples/extensions/ga…
+ </iconUrl>
+ <iconCss></iconCss>
+ </extension>
+
+ <extension>
+ <name>wavetube</name>
+ <installerUrl>http://everybodywave.appspot.com/gadget/WaveTube/xt.xml
+ </installerUrl>
+ <gadgetUrl>http://everybodywave.appspot.com/gadget/WaveTube/main.xml
+ </gadgetUrl>
+ <iconUrl>http://everybodywave.appspot.com/gadget/WaveTube/thumb.png
+ </iconUrl>
+ <iconCss></iconCss>
+ </extension>
+
</extensions>
<!-- Where and how to use the above extensions ================ -->
@@ -54,7 +87,8 @@
<authNeed>true</authNeed>
</rol>
</location>
- <!-- only for new waves: anyone, onlymembers, onlyadmins, ask -->
+ <!-- only for new waves: anyone, onlymembers, onlyadmins, ask (not
+ used yet) -->
<participants>ask</participants>
</guiActionDescriptor>
@@ -79,12 +113,92 @@
<authNeed>true</authNeed>
</rol>
</location>
- <!-- only for new waves: anyone, onlymembers, onlyadmins, ask -->
+ <!-- only for new waves: anyone, onlymembers, onlyadmins, ask (not
+ used yet) -->
<participants>ask</participants>
</guiActionDescriptor>
<guiActionDescriptor>
<type>wave-gadget</type>
+ <extensionName>waffle</extensionName>
+ <name>New meet coordination</name>
+ <parent>Gadget»Calendar</parent>
+ <description>Users are polled to determine the best time and date
+ to meet
+ </description>
+ <enabled>true</enabled>
+ <typeIds>
+ <typeId>docs.folder</typeId>
+ <typeId>docs.root</typeId>
+ <typeId>blogs.blog</typeId>
+ </typeIds>
+ <name></name>
+ <location>
+ <rol>
+ <!-- Administrator, Editor, Viewer -->
+ <rolRequired>Editor</rolRequired>
+ <authNeed>true</authNeed>
+ </rol>
+ </location>
+ <!-- only for new waves: anyone, onlymembers, onlyadmins, ask (not
+ used yet) -->
+ <participants>ask</participants>
+ </guiActionDescriptor>
+
+ <guiActionDescriptor>
+ <type>wave-gadget</type>
+ <extensionName>twitter-search</extensionName>
+ <name>New twitter search</name>
+ <parent>Gadget»News</parent>
+ <description>Shows results from Twitter for a given search term.
+ Participants can edit to specify new term.</description>
+ <enabled>true</enabled>
+ <typeIds>
+ <typeId>docs.folder</typeId>
+ <typeId>docs.root</typeId>
+ <typeId>blogs.blog</typeId>
+ </typeIds>
+ <name></name>
+ <location>
+ <rol>
+ <!-- Administrator, Editor, Viewer -->
+ <rolRequired>Editor</rolRequired>
+ <authNeed>true</authNeed>
+ </rol>
+ </location>
+ <!-- only for new waves: anyone, onlymembers, onlyadmins, ask (not
+ used yet) -->
+ <participants>ask</participants>
+ </guiActionDescriptor>
+
+ <guiActionDescriptor>
+ <type>wave-gadget</type>
+ <extensionName>wavetube</extensionName>
+ <name>New youtube video</name>
+ <parent>Gadget»Media</parent>
+ <description>Adds a YouTube player that displays the list of viewers in real time</description>
+ <enabled>true</enabled>
+ <typeIds>
+ <typeId>docs.folder</typeId>
+ <typeId>docs.root</typeId>
+ <typeId>blogs.blog</typeId>
+ </typeIds>
+ <name></name>
+ <location>
+ <rol>
+ <!-- Administrator, Editor, Viewer -->
+ <rolRequired>Editor</rolRequired>
+ <authNeed>true</authNeed>
+ </rol>
+ </location>
+ <!-- only for new waves: anyone, onlymembers, onlyadmins, ask (not
+ used yet) -->
+ <participants>ask</participants>
+ </guiActionDescriptor>
+
+
+ <guiActionDescriptor>
+ <type>wave-gadget</type>
<extensionName>massmob</extensionName>
<name>Add a meeting</name>
<parent>Gadget»Calendar</parent>
1
0
Author: vjrj_
Date: 2011-06-25 01:04:18 +0200 (Sat, 25 Jun 2011)
New Revision: 1417
Added:
trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembers.java
Modified:
trunk/TODO
trunk/src/main/java/cc/kune/chat/client/ChatParts.java
trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java
trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java
trunk/src/main/java/cc/kune/chat/client/actions/OpenRoomBtn.java
trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtMenuGui.java
trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/SubMenuDescriptor.java
trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java
trunk/src/main/java/cc/kune/core/client/actions/RolActionAutoUpdated.java
trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java
trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java
trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java
trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java
trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNConfActions.java
trunk/src/main/java/cc/kune/gspace/client/actions/AbstractNewMenu.java
trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerBtn.java
trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java
trunk/src/main/java/cc/kune/gspace/client/actions/NewMenuProvider.java
trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java
trunk/src/main/webapp/others/kune-wave-extensions.xml
Log:
Gadgets hierarchy. Chat new actions (Assembly in chatroom, add as buddie menuitem)
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2011-06-24 16:50:59 UTC (rev 1416)
+++ trunk/TODO 2011-06-24 23:04:18 UTC (rev 1417)
@@ -371,6 +371,8 @@
** vjrj <v> IconHyperlink.java and IconLabel.java to gwt1.5
* MID-TERM
+** Menubar submenus problem
+https://groups.google.com/group/google-web-toolkit/browse_thread/thread/aa887d470ed609c/c76d622622e39a56?lnk=gst&q=menubar+left+#c76d622622e39a56
** Template system for new waves with legal free/open procedures
New
Templates
Modified: trunk/src/main/java/cc/kune/chat/client/ChatParts.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatParts.java 2011-06-24 16:50:59 UTC (rev 1416)
+++ trunk/src/main/java/cc/kune/chat/client/ChatParts.java 2011-06-24 23:04:18 UTC (rev 1417)
@@ -20,16 +20,22 @@
package cc.kune.chat.client;
import cc.kune.chat.client.actions.AddAsBuddieHeaderButton;
+import cc.kune.chat.client.actions.AddAsBuddieHeaderButton.AddAsBuddieAction;
import cc.kune.chat.client.actions.ChatClientActions;
import cc.kune.chat.client.actions.ChatSitebarActions;
import cc.kune.chat.client.actions.OpenGroupPublicChatRoomAction;
+import cc.kune.chat.client.actions.StartAssemblyWithMembers;
import cc.kune.chat.client.actions.StartChatWithMemberAction;
import cc.kune.chat.client.actions.StartChatWithThisBuddieAction;
import cc.kune.chat.client.actions.StartChatWithUserAction;
import cc.kune.chat.shared.ChatConstants;
+import cc.kune.common.client.actions.AbstractAction;
+import cc.kune.common.client.actions.PropertyChangeEvent;
+import cc.kune.common.client.actions.PropertyChangeListener;
import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
import cc.kune.core.client.init.AppStartEvent;
import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.sn.GroupSNPresenter;
import cc.kune.core.client.sn.actions.conditions.IsCurrentStateAGroupCondition;
import cc.kune.core.client.sn.actions.conditions.IsCurrentStateAdministrableCondition;
import cc.kune.core.client.sn.actions.conditions.IsCurrentStateEditableCondition;
@@ -58,15 +64,16 @@
final Provider<GroupSNAdminsMenuItemsRegistry> snAdminsRegistry,
final Provider<GroupSNCollabsMenuItemsRegistry> snCollabsItemsRegistry,
final Provider<GroupSNPendingsMenuItemsRegistry> snPendingItemsRegistry,
- final Provider<GroupSNConfActions> groupConfActions,
+ final Provider<GroupSNConfActions> groupConfActions, final Provider<GroupSNPresenter> groupSN,
final Provider<UserSNMenuItemsRegistry> userItemsRegistry, final IsNotMeCondition isNotMe,
final IsCurrentStateAdministrableCondition isAdministrableCondition,
final IsCurrentStateEditableCondition isEditableCondition,
final IsCurrentStateAGroupCondition isGroupCondition, final IsPersonCondition isPersonCondition,
+ final Provider<AddAsBuddieAction> addAsBuddie,
final Provider<StartChatWithMemberAction> startChatWithMemberAction,
final IsLoggedCondition isLogged, final Provider<StartChatWithUserAction> startChatWithUserAction,
final Provider<StartChatWithThisBuddieAction> startChatWithBuddieAction,
- final ChatClientActions chatActions,
+ final ChatClientActions chatActions, final Provider<StartAssemblyWithMembers> startAssembly,
final Provider<OpenGroupPublicChatRoomAction> openGroupRoomAction,
// final Provider<OpenGroupPublicChatRoomButton> openGroupRoom,
final ContentViewerSelector viewerSelector, final FolderViewerPresenter folderViewer) {
@@ -96,35 +103,47 @@
return item;
}
};
- final Provider<MenuItemDescriptor> startChatWithUserItem = new Provider<MenuItemDescriptor>() {
+ final Provider<MenuItemDescriptor> addAsBuddieItem = new Provider<MenuItemDescriptor>() {
@Override
public MenuItemDescriptor get() {
- final MenuItemDescriptor item = new MenuItemDescriptor(startChatWithUserAction.get());
+ final AddAsBuddieAction action = addAsBuddie.get();
+ final MenuItemDescriptor item = new MenuItemDescriptor(action);
item.add(isNotMe);
item.add(isLogged);
item.add(isPersonCondition);
+ /**
+ * FIXME Buggy & duplicate code with {@link AddAsBuddieHeaderButton}
+ */
+ action.addPropertyChangeListener(new PropertyChangeListener() {
+ @Override
+ public void propertyChange(final PropertyChangeEvent event) {
+ if (event.getPropertyName().equals(AbstractAction.ENABLED)) {
+ item.setVisible((Boolean) event.getNewValue());
+ }
+ }
+ });
return item;
}
};
- final Provider<MenuItemDescriptor> openChatAndInvite = new Provider<MenuItemDescriptor>() {
+ final Provider<MenuItemDescriptor> startChatWithUserItem = new Provider<MenuItemDescriptor>() {
@Override
public MenuItemDescriptor get() {
- final OpenGroupPublicChatRoomAction action = openGroupRoomAction.get();
- action.setInviteMembers(true);
- final MenuItemDescriptor item = new MenuItemDescriptor(action);
- item.withText(i18n.t("Open group's room with members")).withToolTip(
- i18n.t("Enter to this group public chat room and invite members"));
- item.setParent(GroupSNConfActions.OPTIONS_MENU);
- item.setPosition(0);
+ final MenuItemDescriptor item = new MenuItemDescriptor(startChatWithUserAction.get());
+ item.add(isNotMe);
+ item.add(isLogged);
+ item.add(isPersonCondition);
return item;
}
};
+
snAdminsRegistry.get().add(startChatWithMemberItem);
snCollabsItemsRegistry.get().add(startChatWithMemberItem);
snPendingItemsRegistry.get().add(startChatWithUserItem);
userItemsRegistry.get().add(startChatWithBuddieItem);
- groupConfActions.get().add(openChatAndInvite.get());
+ userItemsRegistry.get().add(addAsBuddieItem);
+ groupConfActions.get().add(startAssembly.get());
buddieButton.get();
+ groupSN.get().refreshActions();
// openGroupRoom.get();
}
});
Modified: trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java 2011-06-24 16:50:59 UTC (rev 1416)
+++ trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java 2011-06-24 23:04:18 UTC (rev 1417)
@@ -91,7 +91,7 @@
public NewRoomBtn(final I18nTranslationService i18n, final NewRoomAction action, final NavResources res) {
super(action);
this.withText(i18n.t("New room")).withToolTip(i18n.t("Create a new chat room")).withStyles(
- "k-def-docbtn, k-fr").withIcon(res.roomAdd());
+ "k-def-docbtn, k-fl").withIcon(res.roomAdd());
}
}
Modified: trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java 2011-06-24 16:50:59 UTC (rev 1416)
+++ trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java 2011-06-24 23:04:18 UTC (rev 1417)
@@ -48,93 +48,96 @@
public class OpenGroupPublicChatRoomAction extends RolActionAutoUpdated {
- private final ChatClient chatClient;
- private final I18nTranslationService i18n;
- private boolean inviteMembers;
- private final RoomManager roomManager;
- private final Session session;
+ private final ChatClient chatClient;
+ private final I18nTranslationService i18n;
+ private boolean inviteMembers;
+ private final RoomManager roomManager;
+ private final Session session;
- @SuppressWarnings("deprecation")
- @Inject
- public OpenGroupPublicChatRoomAction(final Session session,
- final AccessRightsClientManager accessRightsClientManager, final ChatClient chatClient,
- final StateManager stateManager, final I18nTranslationService i18n, final ChatResources res) {
- super(stateManager, session, accessRightsClientManager, AccessRolDTO.Editor, true, false, true);
- this.session = session;
- this.chatClient = chatClient;
- this.i18n = i18n;
- roomManager = Suco.get(RoomManager.class);
- stateManager.onStateChanged(true, new StateChangedHandler() {
- @Override
- public void onStateChanged(final StateChangedEvent event) {
- setState(session.getCurrentState());
- }
- });
- putValue(Action.NAME, i18n.t("Group's public room"));
- putValue(Action.SHORT_DESCRIPTION, i18n.t("Enter to this group public chat room"));
- putValue(Action.SMALL_ICON, res.groupChat());
- setInviteMembersImpl(false);
- }
+ @SuppressWarnings("deprecation")
+ @Inject
+ public OpenGroupPublicChatRoomAction(final Session session,
+ final AccessRightsClientManager accessRightsClientManager, final ChatClient chatClient,
+ final StateManager stateManager, final I18nTranslationService i18n, final ChatResources res) {
+ super(stateManager, session, accessRightsClientManager, AccessRolDTO.Editor, true, false, true);
+ this.session = session;
+ this.chatClient = chatClient;
+ this.i18n = i18n;
+ roomManager = Suco.get(RoomManager.class);
+ stateManager.onStateChanged(true, new StateChangedHandler() {
+ @Override
+ public void onStateChanged(final StateChangedEvent event) {
+ // setState(session.getCurrentState());
+ }
+ });
+ putValue(Action.NAME, i18n.t("Group's public room"));
+ putValue(Action.SHORT_DESCRIPTION, i18n.t("Enter to this group public chat room"));
+ putValue(Action.SMALL_ICON, res.groupChat());
+ setInviteMembersImpl(false);
+ }
- @Override
- public void actionPerformed(final ActionEvent event) {
- final String currentGroupName = session.getCurrentGroupShortName();
- final Room room = chatClient.joinRoom(currentGroupName, session.getCurrentUser().getShortName());
- inviteMembers(room);
- chatClient.show();
- }
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ final String currentGroupName = session.getCurrentGroupShortName();
+ final Room room = chatClient.joinRoom(currentGroupName, session.getCurrentUser().getShortName());
+ inviteMembers(room);
+ chatClient.show();
+ }
- private void addGroup(final List<XmppURI> membersUris, final GroupDTO member) {
- membersUris.add(chatClient.uriFrom(member.getShortName()));
- }
+ private void addGroup(final List<XmppURI> membersUris, final GroupDTO member) {
+ membersUris.add(chatClient.uriFrom(member.getShortName()));
+ }
- private boolean currentGroupsIsAsPerson(final StateAbstractDTO state) {
- return state.getGroup().isPersonal();
- }
+ private boolean currentGroupsIsAsPerson(final StateAbstractDTO state) {
+ return state.getGroup().isPersonal();
+ }
- private void inviteMembers(final Room room) {
- if (inviteMembers) {
- room.addChatStateChangedHandler(true, new com.calclab.emite.core.client.events.StateChangedHandler() {
- @Override
- public void onStateChanged(final com.calclab.emite.core.client.events.StateChangedEvent event) {
- if (event.getState().equals(ChatStates.ready)) {
- // When ready we invite to the rest of members
- final SocialNetworkDTO groupMembers = session.getCurrentState().getGroupMembers();
- final List<XmppURI> membersUris = new ArrayList<XmppURI>();
- for (final GroupDTO member : groupMembers.getAccessLists().getAdmins().getList()) {
- addGroup(membersUris, member);
- }
- for (final GroupDTO member : groupMembers.getAccessLists().getEditors().getList()) {
- addGroup(membersUris, member);
- }
- for (final Occupant occupant : room.getOccupants()) {
- // Remove all member that are in the room
- membersUris.remove(occupant.getJID());
- }
- for (final XmppURI memberNotPresent : membersUris) {
- room.sendInvitationTo(memberNotPresent,
- i18n.t("Join us in [%s] public room!", room.getURI().getNode()));
- }
- }
+ private void inviteMembers(final Room room) {
+ if (inviteMembers) {
+ room.addChatStateChangedHandler(true,
+ new com.calclab.emite.core.client.events.StateChangedHandler() {
+ @Override
+ public void onStateChanged(final com.calclab.emite.core.client.events.StateChangedEvent event) {
+ if (event.getState().equals(ChatStates.ready)) {
+ // When ready we invite to the rest of members
+ final SocialNetworkDTO groupMembers = session.getCurrentState().getGroupMembers();
+ final List<XmppURI> membersUris = new ArrayList<XmppURI>();
+ for (final GroupDTO member : groupMembers.getAccessLists().getAdmins().getList()) {
+ addGroup(membersUris, member);
}
- });
- }
+ for (final GroupDTO member : groupMembers.getAccessLists().getEditors().getList()) {
+ addGroup(membersUris, member);
+ }
+ for (final Occupant occupant : room.getOccupants()) {
+ // Remove all member that are in the room
+ membersUris.remove(occupant.getJID());
+ }
+ for (final XmppURI memberNotPresent : membersUris) {
+ room.sendInvitationTo(memberNotPresent,
+ i18n.t("Join us in [%s] public room!", room.getURI().getNode()));
+ }
+ }
+ }
+ });
}
+ }
- public void setInviteMembers(final boolean inviteMembers) {
- setInviteMembersImpl(inviteMembers);
- }
+ public void setInviteMembers(final boolean inviteMembers) {
+ setInviteMembersImpl(inviteMembers);
+ }
- private void setInviteMembersImpl(final boolean inviteMembers) {
- this.inviteMembers = inviteMembers;
- }
+ private void setInviteMembersImpl(final boolean inviteMembers) {
+ this.inviteMembers = inviteMembers;
+ }
- private void setState(final StateAbstractDTO state) {
- final boolean imLogged = session.isLogged();
- if (imLogged && !currentGroupsIsAsPerson(state)) {
- setEnabled(true);
- } else {
- setEnabled(false);
- }
+ private void setState(final StateAbstractDTO state) {
+ final boolean imLogged = session.isLogged();
+ if (imLogged && !currentGroupsIsAsPerson(state)) {
+ setEnabled(false);
+ setEnabled(true);
+ } else {
+ setEnabled(true);
+ setEnabled(false);
}
+ }
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/chat/client/actions/OpenRoomBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/OpenRoomBtn.java 2011-06-24 16:50:59 UTC (rev 1416)
+++ trunk/src/main/java/cc/kune/chat/client/actions/OpenRoomBtn.java 2011-06-24 23:04:18 UTC (rev 1417)
@@ -12,6 +12,6 @@
public OpenRoomBtn(final I18nTranslationService i18n, final OpenChatAction action,
final NavResources res) {
super(action);
- this.withText(i18n.t("Enter to this room")).withIcon(res.room()).withStyles("k-def-docbtn, k-fr");
+ this.withText(i18n.t("Enter to this room")).withIcon(res.room()).withStyles("k-def-docbtn, k-fl");
}
}
\ No newline at end of file
Added: trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembers.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembers.java (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembers.java 2011-06-24 23:04:18 UTC (rev 1417)
@@ -0,0 +1,21 @@
+package cc.kune.chat.client.actions;
+
+import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.core.client.sn.actions.registry.GroupSNConfActions;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+
+public class StartAssemblyWithMembers extends MenuItemDescriptor {
+
+ @Inject
+ public StartAssemblyWithMembers(final OpenGroupPublicChatRoomAction action,
+ final I18nTranslationService i18n) {
+ super(action);
+ action.setInviteMembers(true);
+ withText(i18n.t("Start a public assembly with members")).withToolTip(
+ i18n.t("Enter to this group public chat room and invite members"));
+ setParent(GroupSNConfActions.OPTIONS_MENU);
+ setPosition(0);
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembers.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtMenuGui.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtMenuGui.java 2011-06-24 16:50:59 UTC (rev 1416)
+++ trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtMenuGui.java 2011-06-24 23:04:18 UTC (rev 1417)
@@ -40,112 +40,112 @@
public abstract class AbstractGwtMenuGui extends AbstractChildGuiItem implements ParentWidget {
- protected MenuBar menu;
- private PopupPanel popup;
+ protected MenuBar menu;
+ private PopupPanel popup;
- public AbstractGwtMenuGui() {
- }
+ public AbstractGwtMenuGui() {
+ }
- public AbstractGwtMenuGui(final GuiActionDescrip descriptor) {
- super(descriptor);
- }
+ public AbstractGwtMenuGui(final GuiActionDescrip descriptor) {
+ super(descriptor);
+ }
- @Override
- public void add(final UIObject item) {
- menu.addItem((MenuItem) item);
- }
+ @Override
+ public void add(final UIObject item) {
+ menu.addItem((MenuItem) item);
+ }
- public void addSeparator() {
- menu.addSeparator();
- }
+ public void addSeparator() {
+ menu.addSeparator();
+ }
- @Override
- public void configureItemFromProperties() {
- super.configureItemFromProperties();
- descriptor.addPropertyChangeListener(new PropertyChangeListener() {
- @Override
- public void propertyChange(final PropertyChangeEvent event) {
- if (event.getPropertyName().equals(MenuDescriptor.MENU_CLEAR)) {
- menu.clearItems();
- }
- }
- });
- }
+ @Override
+ public void configureItemFromProperties() {
+ super.configureItemFromProperties();
+ descriptor.addPropertyChangeListener(new PropertyChangeListener() {
+ @Override
+ public void propertyChange(final PropertyChangeEvent event) {
+ if (event.getPropertyName().equals(MenuDescriptor.MENU_CLEAR)) {
+ menu.clearItems();
+ }
+ }
+ });
+ }
- @Override
- public AbstractGuiItem create(final GuiActionDescrip descriptor) {
- super.create(descriptor);
- menu = new MenuBar(true, SubMenuResources.INSTANCE);
- menu.setAutoOpen(true);
- menu.setFocusOnHoverEnabled(true);
- menu.setAnimationEnabled(true);
- descriptor.addPropertyChangeListener(new PropertyChangeListener() {
- @Override
- public void propertyChange(final PropertyChangeEvent event) {
- if (event.getPropertyName().equals(MenuDescriptor.MENU_HIDE)) {
- if (popup != null && popup.isShowing()) {
- popup.hide();
- }
- }
- }
- });
- descriptor.addPropertyChangeListener(new PropertyChangeListener() {
- @Override
- public void propertyChange(final PropertyChangeEvent event) {
- if (event.getPropertyName().equals(MenuDescriptor.MENU_SHOW)) {
- show(descriptor.getValue(MenuDescriptor.MENU_SHOW_NEAR_TO));
- }
- }
- });
- return this;
- }
-
- private PopupPanel createPopup() {
- popup = new PopupPanel(true);
- popup.setStyleName("oc-menu");
- popup.add(menu);
- popup.addCloseHandler(new CloseHandler<PopupPanel>() {
- @Override
- public void onClose(final CloseEvent<PopupPanel> event) {
- descriptor.putValue(MenuDescriptor.MENU_ONHIDE, popup);
- }
- });
- return popup;
- }
-
- public void hide() {
- if (popup != null) {
- // if menu (not submenu)
+ @Override
+ public AbstractGuiItem create(final GuiActionDescrip descriptor) {
+ super.create(descriptor);
+ menu = new MenuBar(true, SubMenuResources.INSTANCE);
+ menu.setAutoOpen(true);
+ menu.setFocusOnHoverEnabled(true);
+ menu.setAnimationEnabled(true);
+ descriptor.addPropertyChangeListener(new PropertyChangeListener() {
+ @Override
+ public void propertyChange(final PropertyChangeEvent event) {
+ if (event.getPropertyName().equals(MenuDescriptor.MENU_HIDE)) {
+ if (popup != null && popup.isShowing()) {
popup.hide();
+ }
}
- }
+ }
+ });
+ descriptor.addPropertyChangeListener(new PropertyChangeListener() {
+ @Override
+ public void propertyChange(final PropertyChangeEvent event) {
+ if (event.getPropertyName().equals(MenuDescriptor.MENU_SHOW)) {
+ show(descriptor.getValue(MenuDescriptor.MENU_SHOW_NEAR_TO));
+ }
+ }
+ });
+ return this;
+ }
- @Override
- public void insert(final int position, final UIObject item) {
- menu.insertItem((MenuItem) item, position);
- }
+ private PopupPanel createPopup() {
+ popup = new PopupPanel(true);
+ popup.setStyleName("oc-menu");
+ popup.add(menu);
+ popup.addCloseHandler(new CloseHandler<PopupPanel>() {
+ @Override
+ public void onClose(final CloseEvent<PopupPanel> event) {
+ descriptor.putValue(MenuDescriptor.MENU_ONHIDE, popup);
+ }
+ });
+ return popup;
+ }
- @Override
- public boolean shouldBeAdded() {
- return !descriptor.isChild();
+ public void hide() {
+ if (popup != null) {
+ // if menu (not submenu)
+ popup.hide();
}
+ }
- public void show(final Object relative) {
- createPopup();
- if (relative instanceof String) {
- popup.showRelativeTo(RootPanel.get((String) relative));
- } else if (relative instanceof UIObject) {
- popup.showRelativeTo((UIObject) relative);
- } else if (relative instanceof Position) {
- popup.setPopupPositionAndShow(new PositionCallback() {
- @Override
- public void setPosition(final int offsetWidth, final int offsetHeight) {
- final Position position = (Position) relative;
- popup.setPopupPosition(position.getX(), position.getY());
- }
- });
+ @Override
+ public void insert(final int position, final UIObject item) {
+ menu.insertItem((MenuItem) item, position);
+ }
+
+ @Override
+ public boolean shouldBeAdded() {
+ return !descriptor.isChild();
+ }
+
+ public void show(final Object relative) {
+ createPopup();
+ if (relative instanceof String) {
+ popup.showRelativeTo(RootPanel.get((String) relative));
+ } else if (relative instanceof UIObject) {
+ popup.showRelativeTo((UIObject) relative);
+ } else if (relative instanceof Position) {
+ popup.setPopupPositionAndShow(new PositionCallback() {
+ @Override
+ public void setPosition(final int offsetWidth, final int offsetHeight) {
+ final Position position = (Position) relative;
+ popup.setPopupPosition(position.getX(), position.getY());
}
- descriptor.putValue(MenuDescriptor.MENU_ONSHOW, popup);
+ });
}
+ descriptor.putValue(MenuDescriptor.MENU_ONSHOW, popup);
+ }
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/SubMenuDescriptor.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/SubMenuDescriptor.java 2011-06-24 16:50:59 UTC (rev 1416)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/SubMenuDescriptor.java 2011-06-24 23:04:18 UTC (rev 1417)
@@ -26,46 +26,51 @@
public class SubMenuDescriptor extends MenuDescriptor {
- public SubMenuDescriptor() {
- this(new BaseAction(null, null));
- }
+ public SubMenuDescriptor() {
+ this(new BaseAction(null, null));
+ }
- public SubMenuDescriptor(final AbstractAction action) {
- this(NO_PARENT, action);
- }
+ public SubMenuDescriptor(final AbstractAction action) {
+ this(NO_PARENT, action);
+ }
- public SubMenuDescriptor(final GuiActionDescrip parent, final AbstractAction action) {
- super(action);
- setParent(parent);
- putValue(MENU_HIDE, false);
- putValue(MENU_SHOW, false);
- putValue(MENU_CLEAR, false);
- putValue(MENU_STANDALONE, false);
- }
+ public SubMenuDescriptor(final GuiActionDescrip parent, final AbstractAction action) {
+ super(action);
+ setParent(parent);
+ putValue(MENU_HIDE, false);
+ putValue(MENU_SHOW, false);
+ putValue(MENU_CLEAR, false);
+ putValue(MENU_STANDALONE, false);
+ }
- public SubMenuDescriptor(final String text) {
- this(new BaseAction(text, null));
- }
+ public SubMenuDescriptor(final GuiActionDescrip parent, final String text) {
+ this(text);
+ setParent(parent);
+ }
- public SubMenuDescriptor(final String text, final ImageResource icon) {
- this(new BaseAction(text, null, icon));
- }
+ public SubMenuDescriptor(final String text) {
+ this(new BaseAction(text, null));
+ }
- public SubMenuDescriptor(final String text, final String tooltip) {
- this(new BaseAction(text, tooltip));
- }
+ public SubMenuDescriptor(final String text, final ImageResource icon) {
+ this(new BaseAction(text, null, icon));
+ }
- public SubMenuDescriptor(final String text, final String tooltip, final ImageResource icon) {
- this(new BaseAction(text, tooltip, icon));
- }
+ public SubMenuDescriptor(final String text, final String tooltip) {
+ this(new BaseAction(text, tooltip));
+ }
- public SubMenuDescriptor(final String text, final String tooltip, final String icon) {
- this(new BaseAction(text, tooltip, icon));
- }
+ public SubMenuDescriptor(final String text, final String tooltip, final ImageResource icon) {
+ this(new BaseAction(text, tooltip, icon));
+ }
- @Override
- public Class<?> getType() {
- return SubMenuDescriptor.class;
- }
+ public SubMenuDescriptor(final String text, final String tooltip, final String icon) {
+ this(new BaseAction(text, tooltip, icon));
+ }
+ @Override
+ public Class<?> getType() {
+ return SubMenuDescriptor.class;
+ }
+
}
Modified: trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java 2011-06-24 16:50:59 UTC (rev 1416)
+++ trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java 2011-06-24 23:04:18 UTC (rev 1417)
@@ -59,6 +59,15 @@
addAction(GENERIC_GROUP_ACTION, action, GENERIC_TYPE_ID);
}
+ public void addAction(final String actionsGroupId, final GuiActionDescrip descrip, final String typeId) {
+ addAction(actionsGroupId, new Provider<GuiActionDescrip>() {
+ @Override
+ public GuiActionDescrip get() {
+ return descrip;
+ }
+ }, typeId);
+ }
+
public void addAction(@Nonnull final String actionsGroupId,
final Provider<? extends GuiActionDescrip> action) {
addAction(actionsGroupId, action, GENERIC_TYPE_ID);
Modified: trunk/src/main/java/cc/kune/core/client/actions/RolActionAutoUpdated.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/RolActionAutoUpdated.java 2011-06-24 16:50:59 UTC (rev 1416)
+++ trunk/src/main/java/cc/kune/core/client/actions/RolActionAutoUpdated.java 2011-06-24 23:04:18 UTC (rev 1417)
@@ -53,7 +53,6 @@
public void onAccessRightsChanged(final AccessRightsChangedEvent event) {
refreshStatus(rolRequired, authNeed, session.isLogged(), visibleForMembers, visibleForNonMemb,
event.getCurrentRights());
-
}
});
}
@@ -75,6 +74,7 @@
newVisibility = false;
}
}
+ setEnabled(!newEnabled);
setEnabled(newEnabled);
// Workaround to force change ...
putValue(GuiActionDescrip.VISIBLE, !newVisibility);
Modified: trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java 2011-06-24 16:50:59 UTC (rev 1416)
+++ trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java 2011-06-24 23:04:18 UTC (rev 1417)
@@ -8,8 +8,10 @@
import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.common.client.actions.ui.descrip.SubMenuDescriptor;
import cc.kune.common.client.errors.UIException;
import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.client.utils.TextUtils;
import cc.kune.core.client.actions.WaveExtension.Builder;
import cc.kune.core.client.errors.ErrorHandler;
import cc.kune.core.client.registry.NewMenusForTypeIdsRegistry;
@@ -52,11 +54,14 @@
}
+ private static final String SEP = "»";
+
private final ActionRegistryByType actionRegistry;
private final Provider<ContentServiceAsync> contentService;
private final ErrorHandler errHandler;
private final Map<String, WaveExtension> extensionsMap;
private final NewMenusForTypeIdsRegistry newMenusRegistry;
+ private final HashMap<String, SubMenuDescriptor> submenus;
@Inject
public XMLActionsParser(final ErrorHandler errHandler, final ActionRegistryByType actionRegistry,
@@ -67,6 +72,7 @@
this.contentService = contentService;
this.newMenusRegistry = newMenusRegistry;
extensionsMap = new HashMap<String, WaveExtension>();
+ submenus = new HashMap<String, SubMenuDescriptor>();
// Based on:
// http://www.roseindia.net/tutorials/gwt/retrieving-xml-data.shtml
@@ -94,6 +100,36 @@
return child != null ? child.getNodeValue() : "";
}
+ private SubMenuDescriptor getSubMenu(final MenuDescriptor menu, final String typeId,
+ final String parentS) {
+ final String[] path = parentS.split(SEP);
+ SubMenuDescriptor current = null;
+ for (int i = 0; i < path.length; i++) {
+ final String name = path[i];
+ final String subpathId = getSubPathId(typeId, path, i);
+ SubMenuDescriptor subMenuDescriptor = submenus.get(subpathId);
+ if (subMenuDescriptor == null) {
+ final GuiActionDescrip parent = (i == 0 ? menu : submenus.get(getSubPathId(typeId, path, i - 1)));
+ assert parent != null;
+ subMenuDescriptor = new SubMenuDescriptor(parent, name);
+ // subMenuDescriptor.setVisible(false);
+ submenus.put(subpathId, subMenuDescriptor);
+ actionRegistry.addAction(ActionGroups.TOOLBAR, subMenuDescriptor, typeId);
+ }
+ current = subMenuDescriptor;
+ }
+ assert current != null;
+ return current;
+ }
+
+ private String getSubPathId(final String typeId, final String[] path, final int i) {
+ final StringBuffer id = new StringBuffer().append(typeId);
+ for (int j = 0; j <= i; j++) {
+ id.append(SEP).append(path[j]);
+ }
+ return id.toString();
+ }
+
private void onFailed(final Throwable ex) {
errHandler.process(ex);
}
@@ -116,34 +152,39 @@
for (int i = 0; i < guiDescriptors.getLength(); i++) {
final Element guiDescriptor = (Element) guiDescriptors.item(i);
if (Boolean.parseBoolean(get(guiDescriptor, "enabled"))) {
- final String extensionName = get(guiDescriptor, "extensionName");
- final WaveExtension extension = extensionsMap.get(extensionName);
- if (extension == null) {
- throw new UIException("Undefined extension " + extensionName);
- }
- final String name = get(guiDescriptor, "name");
- final String description = get(guiDescriptor, "description");
- final AccessRolDTO rol = AccessRolDTO.valueOf(get(guiDescriptor, "rolRequired"));
- final GadgetAction action = new GadgetAction(contentService, rol, Boolean.parseBoolean(get(
- guiDescriptor, "authNeed")), extension.getGadgetUrl(), extension.getIconUrl());
- final NodeList typeIds = ((Element) guiDescriptor.getElementsByTagName("typeIds").item(0)).getElementsByTagName("typeId");
- final int length = typeIds.getLength();
+ final String type = get(guiDescriptor, "type");
+ if (type.equals("wave-gadget")) {
+ final String extensionName = get(guiDescriptor, "extensionName");
+ final WaveExtension extension = extensionsMap.get(extensionName);
+ if (extension == null) {
+ throw new UIException("Undefined extension " + extensionName);
+ }
+ final String name = get(guiDescriptor, "name");
+ final String description = get(guiDescriptor, "description");
+ final AccessRolDTO rol = AccessRolDTO.valueOf(get(guiDescriptor, "rolRequired"));
+ final GadgetAction action = new GadgetAction(contentService, rol, Boolean.parseBoolean(get(
+ guiDescriptor, "authNeed")), extension.getGadgetUrl(), extension.getIconUrl());
+ final NodeList typeIds = ((Element) guiDescriptor.getElementsByTagName("typeIds").item(0)).getElementsByTagName("typeId");
+ final int length = typeIds.getLength();
- for (int j = 0; j < length; j++) {
- final Element typeIdElem = (Element) typeIds.item(j);
- final String typeId = typeIdElem.getFirstChild().getNodeValue();
- final MenuDescriptor menu = newMenusRegistry.get(typeId);
- assert menu != null;
- final Provider<GuiActionDescrip> menuItemProvider = new Provider<GuiActionDescrip>() {
- @Override
- public GuiActionDescrip get() {
- final MenuItemDescriptor menuItem = new MenuItemDescriptor(action);
- menuItem.withText(name).withToolTip(description);
- menuItem.setParent(menu);
- return menuItem;
- }
- };
- actionRegistry.addAction(ActionGroups.TOOLBAR, menuItemProvider, typeId);
+ for (int j = 0; j < length; j++) {
+ final Element typeIdElem = (Element) typeIds.item(j);
+ final String typeId = typeIdElem.getFirstChild().getNodeValue();
+ final MenuDescriptor menu = newMenusRegistry.get(typeId);
+ assert menu != null;
+ final String parent = get(guiDescriptor, "parent");
+ final SubMenuDescriptor submenu = getSubMenu(menu, typeId, parent);
+ final Provider<GuiActionDescrip> menuItemProvider = new Provider<GuiActionDescrip>() {
+ @Override
+ public GuiActionDescrip get() {
+ final MenuItemDescriptor menuItem = new MenuItemDescriptor(action);
+ menuItem.withText(name).withToolTip(description);
+ menuItem.setParent(TextUtils.notEmpty(parent) ? submenu : menu);
+ return menuItem;
+ }
+ };
+ actionRegistry.addAction(ActionGroups.TOOLBAR, menuItemProvider, typeId);
+ }
}
}
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java 2011-06-24 16:50:59 UTC (rev 1416)
+++ trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java 2011-06-24 23:04:18 UTC (rev 1417)
@@ -133,15 +133,10 @@
public void onUserSignOut(final UserSignOutEvent event) {
refreshOnSignInSignOut(session);
}
-
});
- createActions();
+ refreshActionsImpl();
}
- private void createActions() {
- getView().getBottomToolbar().addAll(actionsRegistry);
- }
-
@Override
public GroupSNView getView() {
return (GroupSNView) super.getView();
@@ -162,6 +157,15 @@
}
}
+ public void refreshActions() {
+ refreshActionsImpl();
+ }
+
+ private void refreshActionsImpl() {
+ getView().getBottomToolbar().clear();
+ getView().getBottomToolbar().addAll(actionsRegistry);
+ }
+
private void refreshOnSignInSignOut(final Session session) {
final StateAbstractDTO currentState = session.getCurrentState();
if (currentState != null) {
Modified: trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java 2011-06-24 16:50:59 UTC (rev 1416)
+++ trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java 2011-06-24 23:04:18 UTC (rev 1417)
@@ -126,13 +126,9 @@
UserSNPresenter.this.onStateChanged(event.getState());
}
});
- createActions();
+ refreshActionsImpl();
}
- private void createActions() {
- getView().getBottomToolbar().addAll(confActionsRegistry);
- }
-
@Override
public UserSNView getView() {
return (UserSNView) super.getView();
@@ -156,6 +152,15 @@
}
}
+ public void refreshActions() {
+ refreshActionsImpl();
+ }
+
+ private void refreshActionsImpl() {
+ getView().getBottomToolbar().clear();
+ getView().getBottomToolbar().addAll(confActionsRegistry);
+ }
+
private void refreshOnSignInSignOut(final Session session) {
final StateAbstractDTO currentState = session.getCurrentState();
if (currentState != null) {
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java 2011-06-24 16:50:59 UTC (rev 1416)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java 2011-06-24 23:04:18 UTC (rev 1417)
@@ -26,6 +26,7 @@
import cc.kune.common.client.actions.ui.descrip.MenuTitleItemDescriptor;
import cc.kune.common.client.actions.ui.descrip.SubMenuDescriptor;
import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.sn.GroupSNPresenter;
import cc.kune.core.client.sn.actions.JoinGroupAction;
import cc.kune.core.client.sn.actions.MembersModerationMenuItem;
import cc.kune.core.client.sn.actions.MembersVisibilityMenuItem;
@@ -45,6 +46,13 @@
import com.google.inject.Inject;
import com.google.inject.Provider;
+/**
+ *
+ * You must call {@link GroupSNPresenter#refreshActions()} when adding some
+ * action externally with
+ * {@link #add(cc.kune.common.client.actions.ui.descrip.GuiActionDescrip)}
+ *
+ */
@SuppressWarnings("serial")
public class GroupSNConfActions extends AbstractSNActionsRegistry {
@@ -73,24 +81,24 @@
final MenuRadioItemDescriptor moderatedItem = membersModeration.get().withModeration(
AdmissionType.Moderated);
final MenuRadioItemDescriptor openItem = membersModeration.get().withModeration(AdmissionType.Open);
- add(OPTIONS_MENU);
- add(optionsTitle);
- add(VISIBILITY_SUBMENU.withText(i18n.t("Those who can view this member list")).withParent(
+ addImpl(OPTIONS_MENU);
+ addImpl(optionsTitle);
+ addImpl(VISIBILITY_SUBMENU.withText(i18n.t("Those who can view this member list")).withParent(
OPTIONS_MENU));
- add(MODERATION_SUBMENU.withText(i18n.t("New members policy")).withParent(OPTIONS_MENU));
- add(anyoneItem.withParent(VISIBILITY_SUBMENU).withText(i18n.t("anyone")));
- add(onlyMembersItem.withParent(VISIBILITY_SUBMENU).withText(i18n.t("only members")));
- add(onlyAdminsItem.withParent(VISIBILITY_SUBMENU).withText(i18n.t("only admins")));
- add(moderatedItem.withParent(MODERATION_SUBMENU).withText(i18n.t("moderate request to join")));
- add(openItem.withParent(MODERATION_SUBMENU).withText(i18n.t("auto accept request to join")));
+ addImpl(MODERATION_SUBMENU.withText(i18n.t("New members policy")).withParent(OPTIONS_MENU));
+ addImpl(anyoneItem.withParent(VISIBILITY_SUBMENU).withText(i18n.t("anyone")));
+ addImpl(onlyMembersItem.withParent(VISIBILITY_SUBMENU).withText(i18n.t("only members")));
+ addImpl(onlyAdminsItem.withParent(VISIBILITY_SUBMENU).withText(i18n.t("only admins")));
+ addImpl(moderatedItem.withParent(MODERATION_SUBMENU).withText(i18n.t("moderate request to join")));
+ addImpl(openItem.withParent(MODERATION_SUBMENU).withText(i18n.t("auto accept request to join")));
// add(closedItem.withParent(MODERATION_SUBMENU).withText(
// i18n.t("closed for new members")));
final ButtonDescriptor joinBtn = new ButtonDescriptor(joinGroupAction);
final ButtonDescriptor unJoinBtn = new ButtonDescriptor(unJoinGroupAction);
// unJoinBtn.add(isLoggedCondition);
- add(joinBtn); // .withStyles("k-no-backimage, k-noborder, k-nobackcolor"));
- add(unJoinBtn); // .withStyles("k-no-backimage, k-noborder, k-nobackcolor"));
+ addImpl(joinBtn); // .withStyles("k-no-backimage, k-noborder, k-nobackcolor"));
+ addImpl(unJoinBtn); // .withStyles("k-no-backimage, k-noborder, k-nobackcolor"));
stateManager.onStateChanged(true, new StateChangedHandler() {
@Override
@@ -128,4 +136,21 @@
}
});
}
+
+ /**
+ *
+ * You must call {@link GroupSNPresenter#refreshActions()} when adding some
+ * action externally with
+ * {@link #add(cc.kune.common.client.actions.ui.descrip.GuiActionDescrip)}
+ *
+ */
+ @Override
+ public boolean add(final GuiActionDescrip action) {
+ return addImpl(action);
+ }
+
+ private boolean addImpl(final GuiActionDescrip action) {
+ return super.add(action);
+ }
+
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNConfActions.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNConfActions.java 2011-06-24 16:50:59 UTC (rev 1416)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNConfActions.java 2011-06-24 23:04:18 UTC (rev 1417)
@@ -20,10 +20,12 @@
package cc.kune.core.client.sn.actions.registry;
import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
import cc.kune.common.client.actions.ui.descrip.MenuRadioItemDescriptor;
import cc.kune.common.client.actions.ui.descrip.SubMenuDescriptor;
import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.sn.UserSNPresenter;
import cc.kune.core.client.sn.actions.AddNewBuddiesAction;
import cc.kune.core.client.sn.actions.UserSNVisibilityMenuItem;
import cc.kune.core.client.sn.actions.conditions.IsGroupCondition;
@@ -38,6 +40,13 @@
import com.google.inject.Inject;
import com.google.inject.Provider;
+/**
+ *
+ * You must call {@link UserSNPresenter#refreshActions()} when adding some
+ * action externally with
+ * {@link #add(cc.kune.common.client.actions.ui.descrip.GuiActionDescrip)}
+ *
+ */
@SuppressWarnings("serial")
public class UserSNConfActions extends AbstractSNActionsRegistry {
@@ -59,15 +68,16 @@
UserSNetVisibility.onlyyou);
assert anyoneItem.getAction() != onlyYourBuddiesItem.getAction();
assert anyoneItem.getAction() != onlyYou.getAction();
- add(OPTIONS_MENU);
- add(VISIBILITY_SUBMENU.withText(i18n.t("Those who can view your network")).withParent(OPTIONS_MENU));
- add(anyoneItem.withParent(VISIBILITY_SUBMENU).withText(i18n.t("anyone")));
- add(onlyYourBuddiesItem.withParent(VISIBILITY_SUBMENU).withText(i18n.t("only your buddies")));
- add(onlyYou.withParent(VISIBILITY_SUBMENU).withText(i18n.t("only you")));
+ addImpl(OPTIONS_MENU);
+ addImpl(VISIBILITY_SUBMENU.withText(i18n.t("Those who can view your network")).withParent(
+ OPTIONS_MENU));
+ addImpl(anyoneItem.withParent(VISIBILITY_SUBMENU).withText(i18n.t("anyone")));
+ addImpl(onlyYourBuddiesItem.withParent(VISIBILITY_SUBMENU).withText(i18n.t("only your buddies")));
+ addImpl(onlyYou.withParent(VISIBILITY_SUBMENU).withText(i18n.t("only you")));
final ButtonDescriptor addBuddieBtn = new ButtonDescriptor(addNewBuddiesAction);
- add(addBuddieBtn.withStyles("k-no-backimage"));
+ addImpl(addBuddieBtn.withStyles("k-no-backimage"));
stateManager.onStateChanged(true, new StateChangedHandler() {
@Override
@@ -97,4 +107,21 @@
}
});
}
+
+ /**
+ *
+ * You must call {@link UserSNPresenter#refreshActions()} when adding some
+ * action externally with
+ * {@link #add(cc.kune.common.client.actions.ui.descrip.GuiActionDescrip)}
+ *
+ */
+ @Override
+ public boolean add(final GuiActionDescrip action) {
+ return addImpl(action);
+ }
+
+ private boolean addImpl(final GuiActionDescrip action) {
+ return super.add(action);
+ }
+
}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/AbstractNewMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/AbstractNewMenu.java 2011-06-24 16:50:59 UTC (rev 1416)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/AbstractNewMenu.java 2011-06-24 23:04:18 UTC (rev 1417)
@@ -21,9 +21,9 @@
import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.UserSignInOrSignOutEvent;
-import cc.kune.core.client.state.UserSignInOrSignOutEvent.UserSignInOrSignOutHandler;
+import cc.kune.core.client.state.AccessRightsChangedEvent;
+import cc.kune.core.client.state.AccessRightsChangedEvent.AccessRightsChangedHandler;
+import cc.kune.core.client.state.AccessRightsClientManager;
import cc.kune.core.shared.i18n.I18nTranslationService;
import com.google.inject.Inject;
@@ -32,14 +32,15 @@
@Inject
public AbstractNewMenu(final CoreResources res, final I18nTranslationService i18n,
- final Session session) {
+ final AccessRightsClientManager rightsManager) {
super();
- this.withIcon(res.arrowdownsitebar()).withStyles("k-button, k-btn, k-5corners, k-def-docbtn, k-fr").withText(
+ this.withIcon(res.arrowdownsitebar()).withStyles("k-button, k-btn, k-5corners, k-def-docbtn, k-fl").withText(
"New");
- session.onUserSignInOrSignOut(true, new UserSignInOrSignOutHandler() {
+
+ rightsManager.onRightsChanged(true, new AccessRightsChangedHandler() {
@Override
- public void onUserSignInOrSignOut(final UserSignInOrSignOutEvent event) {
- AbstractNewMenu.this.setVisible(event.isLogged());
+ public void onAccessRightsChanged(final AccessRightsChangedEvent event) {
+ AbstractNewMenu.this.setVisible(event.getCurrentRights().isEditable());
}
});
}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerBtn.java 2011-06-24 16:50:59 UTC (rev 1416)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerBtn.java 2011-06-24 23:04:18 UTC (rev 1417)
@@ -93,6 +93,6 @@
// The name given to this new content
action.putValue(NEW_NAME, newName);
action.putValue(ID, id);
- this.withText(title).withToolTip(tooltip).withIcon(icon).withStyles("k-def-docbtn, k-fr");
+ this.withText(title).withToolTip(tooltip).withIcon(icon).withStyles("k-def-docbtn, k-fl");
}
}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java 2011-06-24 16:50:59 UTC (rev 1416)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java 2011-06-24 23:04:18 UTC (rev 1417)
@@ -97,7 +97,7 @@
// final KeyStroke shortcut = Shortcut.getShortcut(false, true, false,
// false, Character.valueOf('N'));
// shorcutReg.put(shortcut, action);
- this.withText(title).withToolTip(tooltip).withIcon(icon).withStyles("k-def-docbtn, k-fr");
+ this.withText(title).withToolTip(tooltip).withIcon(icon).withStyles("k-def-docbtn, k-fl");
}
}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/NewMenuProvider.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewMenuProvider.java 2011-06-24 16:50:59 UTC (rev 1416)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewMenuProvider.java 2011-06-24 23:04:18 UTC (rev 1417)
@@ -5,7 +5,7 @@
import com.google.inject.Provider;
/**
- * The Class NewMenusProvider ins a way to create a kind of singeltons for menu
+ * The Class NewMenusProvider is a way to create a kind of singletons for menu
* entries. This can be register in a list of Providers<GuiDescriptor> but in
* fact only references one item and can be used to select the parent of some
* menu items
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java 2011-06-24 16:50:59 UTC (rev 1416)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java 2011-06-24 23:04:18 UTC (rev 1417)
@@ -100,10 +100,10 @@
void showEmptyMsg(String contentTypeId);
}
- protected static final String CSSBTN = "k-button";
- protected static final String CSSBTNC = "k-button, k-button-center";
- protected static final String CSSBTNL = "k-button, k-button-left";
- protected static final String CSSBTNR = "k-button, k-button-right";
+ protected static final String CSSBTN = "k-button, k-fr";
+ protected static final String CSSBTNC = "k-button, k-button-center, k-fr";
+ protected static final String CSSBTNL = "k-button, k-button-left, k-fr";
+ protected static final String CSSBTNR = "k-button, k-button-right, k-fr";
private final ActionRegistryByType actionsRegistry;
@@ -236,7 +236,7 @@
final ContainerSimpleDTO[] path = container.getAbsolutePath();
final int pathLength = path.length;
if (pathLength > 0) {
- for (int i = 0; i < pathLength; i++) {
+ for (int i = pathLength - 1; i >= 0; i--) {
final ButtonDescriptor btn = createPathButton(path[i], pathLength, i);
actions.add(btn);
}
Modified: trunk/src/main/webapp/others/kune-wave-extensions.xml
===================================================================
--- trunk/src/main/webapp/others/kune-wave-extensions.xml 2011-06-24 16:50:59 UTC (rev 1416)
+++ trunk/src/main/webapp/others/kune-wave-extensions.xml 2011-06-24 23:04:18 UTC (rev 1417)
@@ -2,99 +2,108 @@
<kuneWaveExtensions>
-<!-- List of Wave extensions to use in Kune ===================== -->
+ <!-- List of Wave extensions to use in Kune ===================== -->
-<extensions>
+ <extensions>
- <extension>
- <name>pollo</name>
- <installerUrl>http://wavepollo.appspot.com/pollo.xml
- </installerUrl>
- <gadgetUrl>http://wavepollo.appspot.com/wavepollo/com.appspot.wavepollo.client.PolloWa…
- </gadgetUrl>
- <iconUrl>https://flinz-pollo.appspot.com/document_graph.png</iconUrl>
- <iconCss></iconCss>
- </extension>
- <extension>
- <name>massmob</name>
- <installerUrl>http://mass-mob.appspot.com/massmob/massmob-extension.xml
- </installerUrl>
- <gadgetUrl>http://mass-mob.appspot.com/massmob/org.ourproject.massmob.client.MassmobGa…
- </gadgetUrl>
- <iconUrl>http://mass-mob.appspot.com/logo.png</iconUrl>
- <iconCss></iconCss>
- </extension>
+ <extension>
+ <name>pollo</name>
+ <installerUrl>http://wavepollo.appspot.com/pollo.xml
+ </installerUrl>
+ <gadgetUrl>http://wavepollo.appspot.com/wavepollo/com.appspot.wavepollo.client.PolloWa…
+ </gadgetUrl>
+ <iconUrl>https://flinz-pollo.appspot.com/document_graph.png
+ </iconUrl>
+ <iconCss></iconCss>
+ </extension>
-</extensions>
+ <extension>
+ <name>massmob</name>
+ <installerUrl>http://mass-mob.appspot.com/massmob/massmob-extension.xml
+ </installerUrl>
+ <gadgetUrl>http://mass-mob.appspot.com/massmob/org.ourproject.massmob.client.MassmobGa…
+ </gadgetUrl>
+ <iconUrl>http://mass-mob.appspot.com/logo.png</iconUrl>
+ <iconCss></iconCss>
+ </extension>
-<!-- Where and how to use the above extensions ================ -->
+ </extensions>
-<guiActionDescriptors>
+ <!-- Where and how to use the above extensions ================ -->
- <guiActionDescriptor>
- <extensionName>massmob</extensionName>
- <name>New meeting</name>
- <description>Call and speed-up of events as meeting, smartmobs,
- flashmobs, protest demonstrations, etc.</description>
- <enabled>true</enabled>
- <typeIds>
- <typeId>docs.folder</typeId>
- <typeId>docs.root</typeId>
- <typeId>blogs.blog</typeId>
- </typeIds>
- <name></name>
- <location>
- <rol>
- <!-- Administrator, Editor, Viewer -->
- <rolRequired>Editor</rolRequired>
- <authNeed>true</authNeed>
- </rol>
- </location>
- <!-- only for new waves: anyone, onlymembers, onlyadmins, ask -->
- <participants>ask</participants>
- </guiActionDescriptor>
+ <guiActionDescriptors>
- <guiActionDescriptor>
- <extensionName>pollo</extensionName>
- <name>New poll</name>
- <description>Make some poll (allow single and multiple polls))</description>
- <enabled>true</enabled>
- <typeIds>
- <typeId>docs.folder</typeId>
- <typeId>docs.root</typeId>
- <typeId>blogs.blog</typeId>
- </typeIds>
- <name></name>
- <location>
- <rol>
- <!-- Administrator, Editor, Viewer -->
- <rolRequired>Editor</rolRequired>
- <authNeed>true</authNeed>
- </rol>
- </location>
- <!-- only for new waves: anyone, onlymembers, onlyadmins, ask -->
- <participants>ask</participants>
- </guiActionDescriptor>
+ <guiActionDescriptor>
+ <type>wave-gadget</type>
+ <extensionName>massmob</extensionName>
+ <name>New meeting</name>
+ <parent>Gadget»Calendar</parent>
+ <description>Call and speed-up of events as meeting, smartmobs,
+ flashmobs, protest demonstrations, etc.</description>
+ <enabled>true</enabled>
+ <typeIds>
+ <typeId>docs.folder</typeId>
+ <typeId>docs.root</typeId>
+ <typeId>blogs.blog</typeId>
+ </typeIds>
+ <name></name>
+ <location>
+ <rol>
+ <!-- Administrator, Editor, Viewer -->
+ <rolRequired>Editor</rolRequired>
+ <authNeed>true</authNeed>
+ </rol>
+ </location>
+ <!-- only for new waves: anyone, onlymembers, onlyadmins, ask -->
+ <participants>ask</participants>
+ </guiActionDescriptor>
- <guiActionDescriptor>
- <extensionName>massmob</extensionName>
- <name>Add a meeting</name>
- <description>Call and speed-up of events as meeting, smartmobs,
- flashmobs, protest demonstrations, etc.</description>
- <enabled>false</enabled>
- <typeIds>
- <typeId>docs.doc</typeId>
- </typeIds>
- <name></name>
- <location>
- <rol>
- <!-- Administrator, Editor, Viewer -->
- <rolRequired>Editor</rolRequired>
- <authNeed>true</authNeed>
- </rol>
- </location>
- </guiActionDescriptor>
+ <guiActionDescriptor>
+ <type>wave-gadget</type>
+ <extensionName>pollo</extensionName>
+ <name>New poll</name>
+ <parent>Gadget»Voting</parent>
+ <description>Make some poll (allow single and multiple polls))
+ </description>
+ <enabled>true</enabled>
+ <typeIds>
+ <typeId>docs.folder</typeId>
+ <typeId>docs.root</typeId>
+ <typeId>blogs.blog</typeId>
+ </typeIds>
+ <name></name>
+ <location>
+ <rol>
+ <!-- Administrator, Editor, Viewer -->
+ <rolRequired>Editor</rolRequired>
+ <authNeed>true</authNeed>
+ </rol>
+ </location>
+ <!-- only for new waves: anyone, onlymembers, onlyadmins, ask -->
+ <participants>ask</participants>
+ </guiActionDescriptor>
-</guiActionDescriptors>
+ <guiActionDescriptor>
+ <type>wave-gadget</type>
+ <extensionName>massmob</extensionName>
+ <name>Add a meeting</name>
+ <parent>Gadget»Calendar</parent>
+ <description>Call and speed-up of events as meeting, smartmobs,
+ flashmobs, protest demonstrations, etc.</description>
+ <enabled>false</enabled>
+ <typeIds>
+ <typeId>docs.doc</typeId>
+ </typeIds>
+ <name></name>
+ <location>
+ <rol>
+ <!-- Administrator, Editor, Viewer -->
+ <rolRequired>Editor</rolRequired>
+ <authNeed>true</authNeed>
+ </rol>
+ </location>
+ </guiActionDescriptor>
+ </guiActionDescriptors>
+
</kuneWaveExtensions>
\ No newline at end of file
1
0
r1416 - in trunk: . script src/main/java/cc/kune/gspace/client/viewers src/main/java/cc/kune/wave/client src/main/java/cc/kune/wave/server
by Vicente J. Ruiz Jurado 24 Jun '11
by Vicente J. Ruiz Jurado 24 Jun '11
24 Jun '11
Author: vjrj_
Date: 2011-06-24 18:50:59 +0200 (Fri, 24 Jun 2011)
New Revision: 1416
Modified:
trunk/.classpath
trunk/.project
trunk/pom.xml
trunk/script/repopubli.sh
trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPanel.java
trunk/src/main/java/cc/kune/wave/client/WebClient.java
trunk/src/main/java/cc/kune/wave/client/WebClient.ui.xml
trunk/src/main/java/cc/kune/wave/server/CustomWaveClientServlet.java
trunk/src/main/java/cc/kune/wave/server/WaveMain.java
Log:
wave code updated (with several fixes)
Modified: trunk/.classpath
===================================================================
--- trunk/.classpath 2011-06-24 01:51:23 UTC (rev 1415)
+++ trunk/.classpath 2011-06-24 16:50:59 UTC (rev 1416)
@@ -11,15 +11,18 @@
<classpathentry kind="var" path="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar" sourcepath="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/appengine/appengine-api-1.0-sdk/1.3.1/appengine-api-1.0-sdk-1.3.1.jar"/>
<classpathentry kind="var" path="M2_REPO/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box-src/0.3.0-SNAPSHOT/box-src-0.3.0-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box/0.3.1-SNAPSHOT/box-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box-src/0.3.1-SNAPSHOT/box-src-0.3.1-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar"/>
<classpathentry kind="var" path="M2_REPO/c3p0/c3p0/0.9.1/c3p0-0.9.1.jar" sourcepath="M2_REPO/c3p0/c3p0/0.9.1/c3p0-0.9.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common-src/0.3.0-SNAPSHOT/client-common-src-0.3.0-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-scheduler-src/0.3.0-SNAPSHOT/client-scheduler-src-0.3.0-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-src/0.3.0-SNAPSHOT/client-src-0.3.0-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client/0.3.1-SNAPSHOT/client-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common/0.3.1-SNAPSHOT/client-common-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common-src/0.3.1-SNAPSHOT/client-common-src-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-scheduler-src/0.3.1-SNAPSHOT/client-scheduler-src-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-src/0.3.1-SNAPSHOT/client-src-0.3.1-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/org/cobogw/gwt/cobogw/1.3.1/cobogw-1.3.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/common-src/0.3.0-SNAPSHOT/common-src-0.3.0-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/common-src/0.3.1-SNAPSHOT/common-src-0.3.1-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar" sourcepath="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-cli/commons-cli/1.2/commons-cli-1.2.jar" sourcepath="M2_REPO/commons-cli/commons-cli/1.2/commons-cli-1.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4.jar" sourcepath="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4-sources.jar"/>
@@ -29,8 +32,8 @@
<classpathentry kind="var" path="M2_REPO/commons-io/commons-io/1.3.1/commons-io-1.3.1.jar" sourcepath="M2_REPO/commons-io/commons-io/1.3.1/commons-io-1.3.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/communication-src/0.3.0-SNAPSHOT/communication-src-0.3.0-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/concurrencycontrol-src/0.3.0-SNAPSHOT/concurrencycontrol-src-0.3.0-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/communication-src/0.3.1-SNAPSHOT/communication-src-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/concurrencycontrol-src/0.3.1-SNAPSHOT/concurrencycontrol-src-0.3.1-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sourceforge/htmlunit/crawl_htmlunit/r5662-gae/crawl_htmlunit-r5662-gae.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5.jar" sourcepath="M2_REPO/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/>
@@ -40,7 +43,7 @@
<classpathentry kind="var" path="M2_REPO/com/calclab/emite/emite-proxy/0.1/emite-proxy-0.1.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/ezmorph/ezmorph/1.0.3/ezmorph-1.0.3.jar" sourcepath="M2_REPO/net/sf/ezmorph/ezmorph/1.0.3/ezmorph-1.0.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/freemarker/freemarker/2.3.8/freemarker-2.3.8.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/google/guava/guava-gwt/r07/guava-gwt-r07.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/google/guava/guava-gwt/r09/guava-gwt-r09.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/inject/guice/3.0-rc2/guice-3.0-rc2.jar" sourcepath="M2_REPO/com/google/inject/guice/3.0-rc2/guice-3.0-rc2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/inject/extensions/guice-assisted-inject/2.0/guice-assisted-inject-2.0.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/inject/extensions/guice-persist/3.0-rc2/guice-persist-3.0-rc2.jar" sourcepath="M2_REPO/com/google/inject/extensions/guice-persist/3.0-rc2/guice-persist-3.0-rc2-sources.jar"/>
@@ -50,7 +53,7 @@
<classpathentry kind="var" path="M2_REPO/com/allen_sauer/gwt/log/gwt-log/gwt-log/3.0.1/gwt-log-3.0.1.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/gwt/gwt-servlet/2.1.1/gwt-servlet-2.1.1.jar" sourcepath="M2_REPO/com/google/gwt/gwt-servlet/2.1.1/gwt-servlet-2.1.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/gwt/gwt-user/2.1.1/gwt-user-2.1.1.jar" sourcepath="M2_REPO/com/google/gwt/gwt-user/2.1.1/gwt-user-2.1.1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/gwt-util-src/0.3.0-SNAPSHOT/gwt-util-src-0.3.0-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/gwt-util-src/0.3.1-SNAPSHOT/gwt-util-src-0.3.1-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/com/allen_sauer/gwt/voices/gwt-voices/gwt-voices/2.0.0/gwt-voices-2.0.0.jar"/>
<classpathentry kind="var" path="M2_REPO/com/gwtext/gwtext/2.0.5/gwtext-2.0.5.jar"/>
<classpathentry kind="var" path="M2_REPO/com/gwtextux/gwtextux/0.4.0.924/gwtextux-0.4.0.924.jar"/>
@@ -81,7 +84,7 @@
<classpathentry kind="var" path="M2_REPO/net/sourceforge/htmlunit/htmlunit-core-js/2.7/htmlunit-core-js-2.7.jar" sourcepath="M2_REPO/net/sourceforge/htmlunit/htmlunit-core-js/2.7/htmlunit-core-js-2.7-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javassist/javassist/3.4.GA/javassist-3.4.GA.jar"/>
<classpathentry kind="var" path="M2_REPO/org/slf4j/jcl-over-slf4j/1.6.1/jcl-over-slf4j-1.6.1.jar" sourcepath="M2_REPO/org/slf4j/jcl-over-slf4j/1.6.1/jcl-over-slf4j-1.6.1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/beust/jcommander/1.5/jcommander-1.5.jar" sourcepath="M2_REPO/com/beust/jcommander/1.5/jcommander-1.5-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/beust/jcommander/1.12/jcommander-1.12.jar" sourcepath="M2_REPO/com/beust/jcommander/1.12/jcommander-1.12-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/codehaus/jettison/jettison/1.0-RC2/jettison-1.0-RC2.jar" sourcepath="M2_REPO/org/codehaus/jettison/jettison/1.0-RC2/jettison-1.0-RC2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/jmagick/jmagick/6.2.6-0/jmagick-6.2.6-0.jar"/>
<classpathentry kind="var" path="M2_REPO/net/java/dev/jna/jna/3.2.2/jna-3.2.2.jar" sourcepath="M2_REPO/net/java/dev/jna/jna/3.2.2/jna-3.2.2-sources.jar"/>
@@ -92,7 +95,7 @@
<classpathentry kind="var" path="M2_REPO/net/sourceforge/findbugs/jsr-305/v0r47/jsr-305-v0r47.jar" sourcepath="M2_REPO/net/sourceforge/findbugs/jsr-305/v0r47/jsr-305-v0r47-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hibernate/jtidy/r8-20060801/jtidy-r8-20060801.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jukito/jukito/1.0/jukito-1.0.jar" sourcepath="M2_REPO/org/jukito/jukito/1.0/jukito-1.0-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/junit/junit/4.8.1/junit-4.8.1.jar" sourcepath="M2_REPO/junit/junit/4.8.1/junit-4.8.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/4.8.2/junit-4.8.2.jar" sourcepath="M2_REPO/junit/junit/4.8.2/junit-4.8.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/liquibase/liquibase-core/1.7.0/liquibase-core-1.7.0.jar"/>
<classpathentry kind="var" path="M2_REPO/org/liquibase/liquibase-plugin/1.7.0.0/liquibase-plugin-1.7.0.0.jar"/>
<classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16.jar" sourcepath="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16-sources.jar"/>
@@ -105,15 +108,15 @@
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-profile/2.0/maven-profile-2.0.jar" sourcepath="M2_REPO/org/apache/maven/maven-profile/2.0/maven-profile-2.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-project/2.0/maven-project-2.0.jar" sourcepath="M2_REPO/org/apache/maven/maven-project/2.0/maven-project-2.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-repository-metadata/2.0/maven-repository-metadata-2.0.jar" sourcepath="M2_REPO/org/apache/maven/maven-repository-metadata/2.0/maven-repository-metadata-2.0-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/media-src/0.3.0-SNAPSHOT/media-src-0.3.0-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/media-src/0.3.1-SNAPSHOT/media-src-0.3.1-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/org/mockito/mockito-core/1.8.5/mockito-core-1.8.5.jar" sourcepath="M2_REPO/org/mockito/mockito-core/1.8.5/mockito-core-1.8.5-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/model-src/0.3.0-SNAPSHOT/model-src-0.3.0-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/model-src/0.3.1-SNAPSHOT/model-src-0.3.1-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/mysql/mysql-connector-java/5.1.13/mysql-connector-java-5.1.13.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sourceforge/nekohtml/nekohtml/1.9.14/nekohtml-1.9.14.jar" sourcepath="M2_REPO/net/sourceforge/nekohtml/nekohtml/1.9.14/nekohtml-1.9.14-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/objenesis/objenesis/1.0/objenesis-1.0.jar" sourcepath="M2_REPO/org/objenesis/objenesis/1.0/objenesis-1.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-8/plexus-container-default-1.0-alpha-8.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-8/plexus-container-default-1.0-alpha-8-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/proto-msg/0.3.0-SNAPSHOT/proto-msg-0.3.0-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/proto-msg/0.3.1-SNAPSHOT/proto-msg-0.3.1-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/org/w3c/css/sac/1.3/sac-1.3.jar" sourcepath="M2_REPO/org/w3c/css/sac/1.3/sac-1.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium/2.0a4/selenium-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium/2.0a4/selenium-2.0a4-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-chrome-driver/2.0a4/selenium-chrome-driver-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-chrome-driver/2.0a4/selenium-chrome-driver-2.0a4-sources.jar"/>
@@ -130,11 +133,12 @@
<classpathentry kind="var" path="M2_REPO/jivesoftware/smack/3.1.0/smack-3.1.0.jar"/>
<classpathentry kind="var" path="M2_REPO/jivesoftware/smackx/3.1.0/smackx-3.1.0.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jivesoftware/smackx/debugger/smackx-debugger/3.0.4/smackx-debugger-3.0.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/yaml/snakeyaml/1.6/snakeyaml-1.6.jar" sourcepath="M2_REPO/org/yaml/snakeyaml/1.6/snakeyaml-1.6-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0.1/stax-api-1.0.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/testng/testng/5.14/testng-5.14.jar" sourcepath="M2_REPO/org/testng/testng/5.14/testng-5.14-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/util-src/0.3.0-SNAPSHOT/util-src-0.3.0-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/testng/testng/6.0.1/testng-6.0.1.jar" sourcepath="M2_REPO/org/testng/testng/6.0.1/testng-6.0.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/util-src/0.3.1-SNAPSHOT/util-src-0.3.1-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/waveinabox-server-0.3/0.3.0-SNAPSHOT/waveinabox-server-0.3-0.3.0-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/waveinabox-server-0.3/0.3.1-SNAPSHOT/waveinabox-server-0.3-0.3.1-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/xalan/xalan/2.7.1/xalan-2.7.1.jar" sourcepath="M2_REPO/xalan/xalan/2.7.1/xalan-2.7.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/>
<classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar" sourcepath="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2-sources.jar"/>
Modified: trunk/.project
===================================================================
--- trunk/.project 2011-06-24 01:51:23 UTC (rev 1415)
+++ trunk/.project 2011-06-24 16:50:59 UTC (rev 1416)
@@ -1,66 +1,46 @@
-<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>kune</name>
- <comment>kune free/open/libre collaboration platform. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.common.project.facet.core.builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.instantiations.assist.eclipse.coverage.instrumentationBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>net.sourceforge.pmd.eclipse.plugin.pmdBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.recommenders.rcp.analysis.RecommendersBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
- <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
- <nature>org.eclipse.ajdt.ui.ajnature</nature>
- <nature>com.google.gwt.eclipse.core.gwtNature</nature>
- <nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>
- <nature>com.instantiations.assist.eclipse.coverage.codeCoverageNature</nature>
- <nature>net.sourceforge.pmd.eclipse.plugin.pmdNature</nature>
- <nature>org.eclipse.recommenders.rcp.analysis.RecommendersNature</nature>
- </natures>
-</projectDescription>
+ <name>kune</name>
+ <comment>kune free/open/libre collaboration platform. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
+ </buildCommand>
+ <buildCommand>
+ <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>com.instantiations.assist.eclipse.coverage.instrumentationBuilder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sourceforge.pmd.eclipse.plugin.pmdBuilder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.recommenders.rcp.analysis.RecommendersBuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.ajdt.ui.ajnature</nature>
+ <nature>com.google.gwt.eclipse.core.gwtNature</nature>
+ <nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>
+ <nature>com.instantiations.assist.eclipse.coverage.codeCoverageNature</nature>
+ <nature>net.sourceforge.pmd.eclipse.plugin.pmdNature</nature>
+ <nature>org.eclipse.recommenders.rcp.analysis.RecommendersNature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-06-24 01:51:23 UTC (rev 1415)
+++ trunk/pom.xml 2011-06-24 16:50:59 UTC (rev 1416)
@@ -547,72 +547,87 @@
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>waveinabox-server-0.3</artifactId>
- <version>0.3.0-SNAPSHOT</version>
+ <version>0.3.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>proto-msg</artifactId>
- <version>0.3.0-SNAPSHOT</version>
+ <version>0.3.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>gwt-util-src</artifactId>
- <version>0.3.0-SNAPSHOT</version>
+ <version>0.3.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-gwt</artifactId>
- <version>r07</version>
+ <version>r09</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
+ <artifactId>box</artifactId>
+ <version>0.3.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.waveprotocol</groupId>
<artifactId>box-src</artifactId>
- <version>0.3.0-SNAPSHOT</version>
+ <version>0.3.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>model-src</artifactId>
- <version>0.3.0-SNAPSHOT</version>
+ <version>0.3.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
+ <artifactId>client</artifactId>
+ <version>0.3.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.waveprotocol</groupId>
<artifactId>client-src</artifactId>
- <version>0.3.0-SNAPSHOT</version>
+ <version>0.3.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
+ <artifactId>client-common</artifactId>
+ <version>0.3.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.waveprotocol</groupId>
<artifactId>client-common-src</artifactId>
- <version>0.3.0-SNAPSHOT</version>
+ <version>0.3.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>common-src</artifactId>
- <version>0.3.0-SNAPSHOT</version>
+ <version>0.3.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>util-src</artifactId>
- <version>0.3.0-SNAPSHOT</version>
+ <version>0.3.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>concurrencycontrol-src</artifactId>
- <version>0.3.0-SNAPSHOT</version>
+ <version>0.3.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client-scheduler-src</artifactId>
- <version>0.3.0-SNAPSHOT</version>
+ <version>0.3.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>media-src</artifactId>
- <version>0.3.0-SNAPSHOT</version>
+ <version>0.3.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>communication-src</artifactId>
- <version>0.3.0-SNAPSHOT</version>
+ <version>0.3.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.sourceforge.findbugs</groupId>
Modified: trunk/script/repopubli.sh
===================================================================
--- trunk/script/repopubli.sh 2011-06-24 01:51:23 UTC (rev 1415)
+++ trunk/script/repopubli.sh 2011-06-24 16:50:59 UTC (rev 1416)
@@ -47,5 +47,5 @@
-Dversion=$VER \
-Dpackaging=$PACKAGING \
-Dfile=$JAR \
- -Durl=scpexe://kune.ourproject.org/home/groups/kune/htdocs/mavenrepo/ \
+ -Durl=scpexe://ourproject.org/home/groups/kune/htdocs/mavenrepo/ \
-DrepositoryId=kune.ourproject.org
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPanel.java 2011-06-24 01:51:23 UTC (rev 1415)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPanel.java 2011-06-24 16:50:59 UTC (rev 1416)
@@ -212,7 +212,7 @@
waveHolder.getElement().appendChild(loading);
final Element holder = waveHolder.getElement().appendChild(Document.get().createDivElement());
final StagesProvider wave = new StagesProvider(holder, waveHolder, waveRef, channel, idGenerator,
- profiles, waveStore, isNewWave);
+ profiles, waveStore, isNewWave, org.waveprotocol.box.webclient.client.Session.get().getDomain());
this.wave = wave;
wave.load(new Command() {
@Override
Modified: trunk/src/main/java/cc/kune/wave/client/WebClient.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WebClient.java 2011-06-24 01:51:23 UTC (rev 1415)
+++ trunk/src/main/java/cc/kune/wave/client/WebClient.java 2011-06-24 16:50:59 UTC (rev 1416)
@@ -196,49 +196,34 @@
// Please also see WebClientDemo.gwt.xml.
private static final Logger REMOTE_LOG = Logger.getLogger("REMOTE_LOG");
- /**
- * Returns <code>ws://yourhost[:port]/</code>.
- */
- // XXX check formatting wrt GPE
- public native static String getWebSocketBaseUrl(String moduleBase) /*-{
- return "ws" + /:\/\/[^\/]+/.exec(moduleBase)[0] + "/";
- }-*/;
+ // TODO (Yuri Z.) Change the implementation to RemoteProfileManagerImpl when
+ // it will be ready.
+ private final ProfileManager profiles = new ProfileManagerImpl();
- public native static boolean useSocketIO() /*-{
- return !!$wnd.__useSocketIO
- }-*/;
+ @UiField
+ SplitLayoutPanel splitPanel;
- private RemoteViewServiceMultiplexer channel;
-
private final EventBus eventBus;
- private IdGenerator idGenerator;
- private final Element loading = new LoadingIndicator().getElement();
+ @UiField
+ Style style;
- private ParticipantId loggedInUser;
-
@UiField
- DebugMessagePanel logPanel;
+ FramedPanel waveFrame;
- private final ProfileManager profiles = new ProfileManagerImpl(Session.get().getDomain());
+ ImplPanel waveHolder;
+ private final Element loading = new LoadingIndicator().getElement();
+
@UiField(provided = true)
final SearchPanelWidget searchPanel = new SearchPanelWidget(new SearchPanelRenderer(profiles));
@UiField
- SplitLayoutPanel splitPanel;
+ DebugMessagePanel logPanel;
- @UiField
- Style style;
-
/** The wave panel, if a wave is open. */
private StagesProvider wave;
-@UiField
-FramedPanel waveFrame;
-
- ImplPanel waveHolder;
-
private final WaveStore waveStore = new SimpleWaveStore();
/**
@@ -246,6 +231,12 @@
*/
private WaveWebSocketClient websocket;
+ private ParticipantId loggedInUser;
+
+ private IdGenerator idGenerator;
+
+ private RemoteViewServiceMultiplexer channel;
+
/**
* This is the entry point method.
*/
@@ -279,7 +270,7 @@
setupUi();
- // History.fireCurrentHistoryState();
+ // History.fireCurrentHistoryState();
LOG.info("SimpleWebClient.onModuleLoad() done");
}
@@ -328,7 +319,19 @@
return websocket;
}
/**
+ * Returns <code>ws://yourhost[:port]/</code>.
*/
+ // XXX check formatting wrt GPE
+ private native String getWebSocketBaseUrl(String moduleBase) /*-{
+ return "ws" + /:\/\/[^\/]+/.exec(moduleBase)[0] + "/";
+ }-*/;
+
+ private native boolean useSocketIO() /*-{
+ return !!$wnd.__useSocketIO
+ }-*/;
+
+ /**
+ */
private void loginToServer() {
assert loggedInUser != null;
channel = new RemoteViewServiceMultiplexer(websocket, loggedInUser.getAddress());
@@ -369,7 +372,7 @@
waveHolder.getElement().appendChild(loading);
final Element holder = waveHolder.getElement().appendChild(Document.get().createDivElement());
final StagesProvider wave = new StagesProvider(
- holder, waveHolder, waveRef, channel, idGenerator, profiles, waveStore, isNewWave);
+ holder, waveHolder, waveRef, channel, idGenerator, profiles, waveStore, isNewWave, Session.get().getDomain());
this.wave = wave;
wave.load(new Command() {
@Override
@@ -426,17 +429,18 @@
private void setupSearchPanel() {
// On wave selection, fire an event.
- final SearchPresenter.WaveSelectionHandler selectHandler =
+ SearchPresenter.WaveSelectionHandler selectHandler =
new SearchPresenter.WaveSelectionHandler() {
@Override
- public void onWaveSelected(final WaveId id) {
+ public void onWaveSelected(WaveId id) {
ClientEvents.get().fireEvent(new WaveSelectionEvent(WaveRef.of(id)));
}
};
- final Search search = SimpleSearch.create(RemoteSearchService.create(), waveStore);
- SearchPresenter.create(search, searchPanel, selectHandler);
+ Search search = SimpleSearch.create(RemoteSearchService.create(), waveStore);
+ SearchPresenter.create(search, searchPanel, selectHandler, profiles);
}
+
private void setupUi() {
// Set up UI
final DockLayoutPanel self = BINDER.createAndBindUi(this);
Modified: trunk/src/main/java/cc/kune/wave/client/WebClient.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WebClient.ui.xml 2011-06-24 01:51:23 UTC (rev 1415)
+++ trunk/src/main/java/cc/kune/wave/client/WebClient.ui.xml 2011-06-24 16:50:59 UTC (rev 1416)
@@ -22,20 +22,19 @@
}
.splitPanel {
-
}
@external gwt-SplitLayoutPanel-HDragger;
@external gwt-SplitLayoutPanel-VDragger;
- .splitPanel .gwt-SplitLayoutPanel-HDragger,.splitPanel .gwt-SplitLayoutPanel-VDragger
- {
+ .splitPanel .gwt-SplitLayoutPanel-HDragger,.splitPanel .gwt-SplitLayoutPanel-VDragger {
background-color: rootBackground;
}
- .searchPanel { /*
- * GWT's drag panel separators are already huge, so no margin needed on
- * sides that have drag panels.
- */
+ .searchPanel {
+ /*
+ * GWT's drag panel separators are already huge, so no margin needed on
+ * sides that have drag panels.
+ */
margin: gap 0 0 gap;
}
@@ -46,10 +45,11 @@
margin: 0 gap gap gap;
}
- .wavePanel { /*
- * GWT's drag panel separators are already huge, so no margin needed on
- * sides that have drag panels.
- */
+ .wavePanel {
+ /*
+ * GWT's drag panel separators are already huge, so no margin needed on
+ * sides that have drag panels.
+ */
margin: gap 0 0 0;
}
@@ -63,19 +63,15 @@
</ui:style>
<g:DockLayoutPanel unit="PX" styleName="{style.root}">
<g:center>
- <g:SplitLayoutPanel ui:field="splitPanel"
- stylePrimaryName="{style.splitPanel}">
+ <g:SplitLayoutPanel ui:field="splitPanel" stylePrimaryName="{style.splitPanel}">
<g:south size="200">
- <d:DebugMessagePanel ui:field="logPanel"
- addStyleNames="{style.debugPanel}" />
+ <d:DebugMessagePanel ui:field="logPanel" addStyleNames="{style.debugPanel}" />
</g:south>
<g:west size="400">
- <s:SearchPanelWidget ui:field="searchPanel"
- addStyleNames="{style.searchPanel}" />
+ <s:SearchPanelWidget ui:field="searchPanel" addStyleNames="{style.searchPanel}"/>
</g:west>
<g:center>
- <f:FramedPanel ui:field="waveFrame"
- addStyleNames="{style.wavePanel}">
+ <f:FramedPanel ui:field="waveFrame" addStyleNames="{style.wavePanel}">
<!-- <w:ImplPanel ui:field="waveHolder"
addStyleNames="{style.waveHolder}" /> -->
</f:FramedPanel>
Modified: trunk/src/main/java/cc/kune/wave/server/CustomWaveClientServlet.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/CustomWaveClientServlet.java 2011-06-24 01:51:23 UTC (rev 1415)
+++ trunk/src/main/java/cc/kune/wave/server/CustomWaveClientServlet.java 2011-06-24 16:50:59 UTC (rev 1416)
@@ -23,6 +23,7 @@
import java.util.Enumeration;
import java.util.HashMap;
+import javax.inject.Singleton;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -45,7 +46,6 @@
import com.google.common.collect.Maps;
import com.google.gxp.base.GxpContext;
import com.google.inject.Inject;
-import com.google.inject.Singleton;
import com.google.inject.name.Named;
/**
Modified: trunk/src/main/java/cc/kune/wave/server/WaveMain.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/WaveMain.java 2011-06-24 01:51:23 UTC (rev 1415)
+++ trunk/src/main/java/cc/kune/wave/server/WaveMain.java 2011-06-24 16:50:59 UTC (rev 1416)
@@ -19,8 +19,17 @@
package cc.kune.wave.server;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Map;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServlet;
+
import org.apache.commons.configuration.ConfigurationException;
-import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.servlets.ProxyServlet;
import org.waveprotocol.box.common.comms.WaveClientRpc.ProtocolWaveClientRpc;
import org.waveprotocol.box.server.CoreSettings;
@@ -37,11 +46,14 @@
import org.waveprotocol.box.server.robots.RobotApiModule;
import org.waveprotocol.box.server.robots.RobotRegistrationServlet;
import org.waveprotocol.box.server.robots.active.ActiveApiServlet;
+import org.waveprotocol.box.server.robots.agent.passwd.PasswordAdminRobot;
+import org.waveprotocol.box.server.robots.agent.passwd.PasswordRobot;
import org.waveprotocol.box.server.robots.dataapi.DataApiOAuthServlet;
import org.waveprotocol.box.server.robots.dataapi.DataApiServlet;
import org.waveprotocol.box.server.robots.passive.RobotsGateway;
import org.waveprotocol.box.server.rpc.AttachmentServlet;
import org.waveprotocol.box.server.rpc.AuthenticationServlet;
+import org.waveprotocol.box.server.rpc.FetchProfilesServlet;
import org.waveprotocol.box.server.rpc.FetchServlet;
import org.waveprotocol.box.server.rpc.SearchServlet;
import org.waveprotocol.box.server.rpc.ServerRpcProvider;
@@ -62,9 +74,12 @@
import com.google.gwt.logging.server.RemoteLoggingServiceImpl;
import com.google.inject.Guice;
+import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.Module;
+import com.google.inject.Singleton;
+import com.google.inject.name.Named;
import com.google.inject.name.Names;
/**
@@ -72,66 +87,40 @@
*/
public class WaveMain {
- /**
- * This is the name of the system property used to find the server config file.
- */
- private static final String PROPERTIES_FILE_KEY = "wave.server.config";
+ @SuppressWarnings("serial")
+ @Singleton
+ public static class GadgetProxyServlet extends HttpServlet {
- private static final Log LOG = Log.get(WaveMain.class);
+ ProxyServlet.Transparent proxyServlet;
- public static void main(String... args) {
- try {
- Module coreSettings = SettingsBinder.bindSettings(PROPERTIES_FILE_KEY, CoreSettings.class);
- run(coreSettings);
- return;
- } catch (PersistenceException e) {
- LOG.severe("PersistenceException when running server:", e);
- } catch (ConfigurationException e) {
- LOG.severe("ConfigurationException when running server:", e);
- } catch (WaveServerException e) {
- LOG.severe("WaveServerException when running server:", e);
+ @Inject
+ public GadgetProxyServlet((a)Named(CoreSettings.GADGET_SERVER_HOSTNAME) final String gadgetServerHostname,
+ @Named(CoreSettings.GADGET_SERVER_PORT) final int gadgetServerPort){
+
+ LOG.info("Starting GadgetProxyServlet for " + gadgetServerHostname + ":" + gadgetServerPort);
+ proxyServlet = new ProxyServlet.Transparent("/gadgets", "http", gadgetServerHostname,
+ gadgetServerPort,"/gadgets");
}
- }
- public static void run(Module coreSettings) throws PersistenceException,
- ConfigurationException, WaveServerException {
- Injector settingsInjector = Guice.createInjector(coreSettings);
- boolean enableFederation = settingsInjector.getInstance(Key.get(Boolean.class,
- Names.named(CoreSettings.ENABLE_FEDERATION)));
-
- if (enableFederation) {
- Module federationSettings =
- SettingsBinder.bindSettings(PROPERTIES_FILE_KEY, FederationSettings.class);
- // This MUST happen first, or bindings will fail if federation is enabled.
- settingsInjector = settingsInjector.createChildInjector(federationSettings);
+ @Override
+ public void init(final ServletConfig config) throws ServletException {
+ proxyServlet.init(config);
}
- Module federationModule = buildFederationModule(settingsInjector, enableFederation);
- PersistenceModule persistenceModule = settingsInjector.getInstance(PersistenceModule.class);
- Injector injector =
- settingsInjector.createChildInjector(new ServerModule(enableFederation),
- new RobotApiModule(), federationModule, persistenceModule);
-
- ServerRpcProvider server = injector.getInstance(ServerRpcProvider.class);
- WaveBus waveBus = injector.getInstance(WaveBus.class);
-
- String domain =
- injector.getInstance(Key.get(String.class, Names.named(CoreSettings.WAVE_SERVER_DOMAIN)));
- if (!ParticipantIdUtil.isDomainAddress(ParticipantIdUtil.makeDomainAddress(domain))) {
- throw new WaveServerException("Invalid wave domain: " + domain);
+ @Override
+ public void service(final ServletRequest req, final ServletResponse res) throws ServletException, IOException {
+ proxyServlet.service(req, res);
}
+ }
- initializeServer(injector, domain);
- initializeServlets(injector, server);
- initializeRobots(injector, waveBus);
- initializeFrontend(injector, server, waveBus);
- initializeFederation(injector);
+ private static final Log LOG = Log.get(WaveMain.class);
- LOG.info("Starting server");
- server.startWebSocketServer(injector);
- }
+ /**
+ * This is the name of the system property used to find the server config file.
+ */
+ private static final String PROPERTIES_FILE_KEY = "wave.server.config";
- private static Module buildFederationModule(Injector settingsInjector, boolean enableFederation)
+ private static Module buildFederationModule(final Injector settingsInjector, final boolean enableFederation)
throws ConfigurationException {
Module federationModule;
if (enableFederation) {
@@ -142,78 +131,132 @@
return federationModule;
}
- private static void initializeServer(Injector injector, String waveDomain)
+ private static void initializeFederation(final Injector injector) {
+ final FederationTransport federationManager = injector.getInstance(FederationTransport.class);
+ federationManager.startFederation();
+ }
+
+ private static void initializeFrontend(final Injector injector, final ServerRpcProvider server,
+ final WaveBus waveBus) throws WaveServerException {
+ final HashedVersionFactory hashFactory = injector.getInstance(HashedVersionFactory.class);
+
+ final WaveletProvider provider = injector.getInstance(WaveletProvider.class);
+ final ClientFrontend frontend =
+ ClientFrontendImpl.create(hashFactory, provider, waveBus);
+
+ final ProtocolWaveClientRpc.Interface rpcImpl = WaveClientRpcImpl.create(frontend, false);
+ server.registerService(ProtocolWaveClientRpc.newReflectiveService(rpcImpl));
+ }
+
+ private static void initializeRobotAgents(final Injector injector, final ServerRpcProvider server) {
+ final PasswordRobot passRobot = new PasswordRobot(injector);
+ final PasswordAdminRobot passAdminRobot = new PasswordAdminRobot(injector);
+ injector.injectMembers(passRobot);
+ server.addServlet(PasswordRobot.ROBOT_URI + "/*", passRobot);
+ server.addServlet(PasswordAdminRobot.ROBOT_URI + "/*", passAdminRobot);
+ }
+
+ private static void initializeRobots(final Injector injector, final WaveBus waveBus) {
+ final RobotsGateway robotsGateway = injector.getInstance(RobotsGateway.class);
+ waveBus.subscribe(robotsGateway);
+ }
+
+ private static void initializeServer(final Injector injector, final String waveDomain)
throws PersistenceException, WaveServerException {
- AccountStore accountStore = injector.getInstance(AccountStore.class);
+ final AccountStore accountStore = injector.getInstance(AccountStore.class);
accountStore.initializeAccountStore();
AccountStoreHolder.init(accountStore, waveDomain);
// Initialize the SignerInfoStore.
- CertPathStore certPathStore = injector.getInstance(CertPathStore.class);
+ final CertPathStore certPathStore = injector.getInstance(CertPathStore.class);
if (certPathStore instanceof SignerInfoStore) {
((SignerInfoStore)certPathStore).initializeSignerInfoStore();
}
// Initialize the server.
- WaveletProvider waveServer = injector.getInstance(WaveletProvider.class);
+ final WaveletProvider waveServer = injector.getInstance(WaveletProvider.class);
waveServer.initialize();
}
- private static void initializeServlets(Injector injector, ServerRpcProvider server) {
+ private static void initializeServlets(final Injector injector, final ServerRpcProvider server) {
server.addServlet("/attachment/*", injector.getInstance(AttachmentServlet.class));
- server.addServlet(SessionManager.SIGN_IN_URL,
- injector.getInstance(AuthenticationServlet.class));
+ server.addServlet(SessionManager.SIGN_IN_URL, injector.getInstance(AuthenticationServlet.class));
server.addServlet("/auth/signout", injector.getInstance(SignOutServlet.class));
server.addServlet("/auth/register", injector.getInstance(UserRegistrationServlet.class));
-
server.addServlet("/fetch/*", injector.getInstance(FetchServlet.class));
-
server.addServlet("/search/*", injector.getInstance(SearchServlet.class));
server.addServlet("/robot/dataapi", injector.getInstance(DataApiServlet.class));
- server.addServlet(DataApiOAuthServlet.DATA_API_OAUTH_PATH + "/*",
- injector.getInstance(DataApiOAuthServlet.class));
+ server.addServlet(DataApiOAuthServlet.DATA_API_OAUTH_PATH + "/*", injector.getInstance(DataApiOAuthServlet.class));
server.addServlet("/robot/dataapi/rpc", injector.getInstance(DataApiServlet.class));
server.addServlet("/robot/register/*", injector.getInstance(RobotRegistrationServlet.class));
server.addServlet("/robot/rpc", injector.getInstance(ActiveApiServlet.class));
+ server.addServlet("/webclient/remote_logging", injector.getInstance(RemoteLoggingServiceImpl.class));
+ server.addServlet("/profile/*", injector.getInstance(FetchProfilesServlet.class));
- String gadgetServerHostname =injector.getInstance(Key.get(String.class,
- Names.named(CoreSettings.GADGET_SERVER_HOSTNAME)));
- int gadgetServerPort =
- injector.getInstance(Key.get(int.class, Names.named(CoreSettings.GADGET_SERVER_PORT)));
- String gadgetServerPath =
- injector.getInstance(Key.get(String.class, Names.named(CoreSettings.GADGET_SERVER_PATH)));
- ProxyServlet.Transparent proxyServlet =
- new ProxyServlet.Transparent("/gadgets", "http", gadgetServerHostname,gadgetServerPort,
- gadgetServerPath);
- ServletHolder proxyServletHolder = server.addServlet("/gadgets/*", proxyServlet);
- proxyServletHolder.setInitParameter("HostHeader", gadgetServerHostname);
-
- server.addServlet("/webclient/remote_logging",
- injector.getInstance(RemoteLoggingServiceImpl.class));
- // server.addServlet("/", injector.getInstance(WaveClientServlet.class));
+ final String gadgetHostName =
+ injector
+ .getInstance(Key.get(String.class, Names.named(CoreSettings.GADGET_SERVER_HOSTNAME)));
+ final int port =
+ injector.getInstance(Key.get(Integer.class, Names.named(CoreSettings.GADGET_SERVER_PORT)));
+ final Map<String, String> initParams =
+ Collections.singletonMap("HostHeader", gadgetHostName + ":" + port);
+ server.addServlet("/gadgets/*", injector.getInstance(GadgetProxyServlet.class), initParams);
+
+ //server.addServlet("/", injector.getInstance(WaveClientServlet.class));
}
- private static void initializeRobots(Injector injector, WaveBus waveBus) {
- RobotsGateway robotsGateway = injector.getInstance(RobotsGateway.class);
- waveBus.subscribe(robotsGateway);
+ public static void main(final String... args) {
+ try {
+ final Module coreSettings = SettingsBinder.bindSettings(PROPERTIES_FILE_KEY, CoreSettings.class);
+ run(coreSettings);
+ return;
+ } catch (final PersistenceException e) {
+ LOG.severe("PersistenceException when running server:", e);
+ } catch (final ConfigurationException e) {
+ LOG.severe("ConfigurationException when running server:", e);
+ } catch (final WaveServerException e) {
+ LOG.severe("WaveServerException when running server:", e);
+ }
}
- private static void initializeFrontend(Injector injector, ServerRpcProvider server,
- WaveBus waveBus) throws WaveServerException {
- HashedVersionFactory hashFactory = injector.getInstance(HashedVersionFactory.class);
-
- WaveletProvider provider = injector.getInstance(WaveletProvider.class);
- ClientFrontend frontend =
- ClientFrontendImpl.create(hashFactory, provider, waveBus);
+ public static void run(final Module coreSettings) throws PersistenceException,
+ ConfigurationException, WaveServerException {
+ Injector settingsInjector = Guice.createInjector(coreSettings);
+ final boolean enableFederation = settingsInjector.getInstance(Key.get(Boolean.class,
+ Names.named(CoreSettings.ENABLE_FEDERATION)));
- ProtocolWaveClientRpc.Interface rpcImpl = WaveClientRpcImpl.create(frontend, false);
- server.registerService(ProtocolWaveClientRpc.newReflectiveService(rpcImpl));
- }
+ if (enableFederation) {
+ final Module federationSettings =
+ SettingsBinder.bindSettings(PROPERTIES_FILE_KEY, FederationSettings.class);
+ // This MUST happen first, or bindings will fail if federation is enabled.
+ settingsInjector = settingsInjector.createChildInjector(federationSettings);
+ }
- private static void initializeFederation(Injector injector) {
- FederationTransport federationManager = injector.getInstance(FederationTransport.class);
- federationManager.startFederation();
+ final Module federationModule = buildFederationModule(settingsInjector, enableFederation);
+ final PersistenceModule persistenceModule = settingsInjector.getInstance(PersistenceModule.class);
+ final Injector injector =
+ settingsInjector.createChildInjector(new ServerModule(enableFederation),
+ new RobotApiModule(), federationModule, persistenceModule);
+
+ final ServerRpcProvider server = injector.getInstance(ServerRpcProvider.class);
+ final WaveBus waveBus = injector.getInstance(WaveBus.class);
+
+ final String domain =
+ injector.getInstance(Key.get(String.class, Names.named(CoreSettings.WAVE_SERVER_DOMAIN)));
+ if (!ParticipantIdUtil.isDomainAddress(ParticipantIdUtil.makeDomainAddress(domain))) {
+ throw new WaveServerException("Invalid wave domain: " + domain);
+ }
+
+ initializeServer(injector, domain);
+ initializeServlets(injector, server);
+ initializeRobotAgents(injector, server);
+ initializeRobots(injector, waveBus);
+ initializeFrontend(injector, server, waveBus);
+ initializeFederation(injector);
+
+ LOG.info("Starting server");
+ server.startWebSocketServer(injector);
}
}
1
0
Author: vjrj_
Date: 2011-06-24 03:51:23 +0200 (Fri, 24 Jun 2011)
New Revision: 1415
Added:
trunk/src/main/java/cc/kune/blogs/client/actions/NewPostMenuItem.java
trunk/src/main/java/cc/kune/docs/client/actions/NewDocMenuItem.java
trunk/src/main/java/cc/kune/docs/client/actions/NewFolderMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/actions/NewContentMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/actions/NewMenuProvider.java
trunk/src/main/java/cc/kune/wiki/client/actions/WikiFolderNewMenu.java
Removed:
trunk/src/main/java/cc/kune/blogs/client/actions/NewPostBtn.java
trunk/src/main/java/cc/kune/docs/client/actions/DocsRootNewMenu.java
trunk/src/main/java/cc/kune/docs/client/actions/NewDocBtn.java
trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java
trunk/src/main/java/cc/kune/gspace/client/actions/NewMenusProvider.java
Modified:
trunk/.project
trunk/TODO
trunk/src/main/java/cc/kune/barters/client/actions/BartersClientActions.java
trunk/src/main/java/cc/kune/blogs/client/BlogsGinModule.java
trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java
trunk/src/main/java/cc/kune/blogs/client/actions/BlogsNewMenu.java
trunk/src/main/java/cc/kune/chat/client/actions/ChatClientActions.java
trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtMenuItemGui.java
trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractComposedGuiItem.java
trunk/src/main/java/cc/kune/common/public/kune-common.css
trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java
trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java
trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java
trunk/src/main/java/cc/kune/docs/client/DocsGinModule.java
trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
trunk/src/main/java/cc/kune/docs/client/actions/DocsFolderNewMenu.java
trunk/src/main/java/cc/kune/gspace/client/actions/ActionGroups.java
trunk/src/main/java/cc/kune/gspace/client/actions/ContentViewerOptionsMenu.java
trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java
trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java
trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java
trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java
trunk/src/main/java/cc/kune/meets/client/actions/MeetingsClientActions.java
trunk/src/main/java/cc/kune/wiki/client/WikiGinModule.java
trunk/src/main/java/cc/kune/wiki/client/actions/NewFolderBtn.java
trunk/src/main/java/cc/kune/wiki/client/actions/NewWikiBtn.java
trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java
Log:
New menus updated, and menu items created only under demand
Modified: trunk/.project
===================================================================
--- trunk/.project 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/.project 2011-06-24 01:51:23 UTC (rev 1415)
@@ -1,42 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>kune</name>
- <comment>kune free/open/libre collaboration platform. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
- <projects/>
- <buildSpec>
- <buildCommand>
- <name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
- </buildCommand>
- <buildCommand>
- <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.common.project.facet.core.builder</name>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
- </buildCommand>
- <buildCommand>
- <name>edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder</name>
- </buildCommand>
- <buildCommand>
- <name>com.instantiations.assist.eclipse.coverage.instrumentationBuilder</name>
- </buildCommand>
- <buildCommand>
- <name>net.sourceforge.pmd.eclipse.plugin.pmdBuilder</name>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
- <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
- <nature>org.eclipse.ajdt.ui.ajnature</nature>
- <nature>com.google.gwt.eclipse.core.gwtNature</nature>
- <nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>
- <nature>com.instantiations.assist.eclipse.coverage.codeCoverageNature</nature>
- <nature>net.sourceforge.pmd.eclipse.plugin.pmdNature</nature>
- </natures>
-</projectDescription>
\ No newline at end of file
+ <name>kune</name>
+ <comment>kune free/open/libre collaboration platform. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.instantiations.assist.eclipse.coverage.instrumentationBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sourceforge.pmd.eclipse.plugin.pmdBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.recommenders.rcp.analysis.RecommendersBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.ajdt.ui.ajnature</nature>
+ <nature>com.google.gwt.eclipse.core.gwtNature</nature>
+ <nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>
+ <nature>com.instantiations.assist.eclipse.coverage.codeCoverageNature</nature>
+ <nature>net.sourceforge.pmd.eclipse.plugin.pmdNature</nature>
+ <nature>org.eclipse.recommenders.rcp.analysis.RecommendersNature</nature>
+ </natures>
+</projectDescription>
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/TODO 2011-06-24 01:51:23 UTC (rev 1415)
@@ -371,6 +371,17 @@
** vjrj <v> IconHyperlink.java and IconLabel.java to gwt1.5
* MID-TERM
+** Template system for new waves with legal free/open procedures
+New
+ Templates
+ In English
+ In Spanish
+ Legal
+ Procedimiento A
+ Procedimiento B
+ Borrador de Estutos de Asociación
+ (...)
+
** Archive of xmpp conversations
*** http://community.igniterealtime.org/docs/DOC-1094 (for openfire)
** Enable two Waves per doc: 1 for the doc (no comments enabled), other for comments. Similar to docs.google.com comments approach.
Modified: trunk/src/main/java/cc/kune/barters/client/actions/BartersClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/barters/client/actions/BartersClientActions.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/barters/client/actions/BartersClientActions.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -53,17 +53,17 @@
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<DelFolderMenuItem> delFolderMenuItem, final Provider<RefreshContentMenuItem> refresh) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.VIEW, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.VIEW, refresh, all);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, contents);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.VIEW, newBartersBtn, containers);
- actionsRegistry.addAction(ActionGroups.VIEW, participateBtn, contents);
- actionsRegistry.addAction(ActionGroups.VIEW, newFolderBtn, containers);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.MENUITEM, delContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, delFolderMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newBartersBtn, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, participateBtn, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newFolderBtn, containers);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, delContentMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
}
@Override
Modified: trunk/src/main/java/cc/kune/blogs/client/BlogsGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/BlogsGinModule.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/blogs/client/BlogsGinModule.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -20,16 +20,16 @@
package cc.kune.blogs.client;
import cc.kune.blogs.client.actions.BlogsClientActions;
+import cc.kune.blogs.client.actions.BlogsNewMenu;
+import cc.kune.common.client.ExtendedGinModule;
-import com.google.inject.Singleton;
-import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
+public class BlogsGinModule extends ExtendedGinModule {
-public class BlogsGinModule extends AbstractPresenterModule {
+ @Override
+ protected void configure() {
+ s(BlogsNewMenu.class);
+ s(BlogsClientTool.class);
+ s(BlogsClientActions.class);
+ }
- @Override
- protected void configure() {
- bind(BlogsClientTool.class).in(Singleton.class);
- bind(BlogsClientActions.class).in(Singleton.class);
- }
-
}
Modified: trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -51,7 +51,7 @@
@Inject
public BlogsClientActions(final I18nUITranslationService i18n, final Session session,
final StateManager stateManager, final ActionRegistryByType registry, final CoreResources res,
- final Provider<GoParentBlogBtn> folderGoUp, final Provider<NewPostBtn> newDocBtn,
+ final Provider<GoParentBlogBtn> folderGoUp, final Provider<NewPostMenuItem> newDocBtn,
final Provider<NewBlogBtn> newFolderBtn, final Provider<OpenBlogMenuItem> openContentMenuItem,
final Provider<DelPostMenuItem> delContentMenuItem,
final Provider<RefreshContentMenuItem> refresh,
@@ -61,20 +61,20 @@
final Provider<DelBlogMenuItem> delFolderMenuItem,
final Provider<SetAsHomePageMenuItem> setAsHomePage) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.VIEW, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.VIEW, refresh, all);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, contents);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.VIEW, participateBtn, contents);
- actionsRegistry.addAction(ActionGroups.VIEW, newDocBtn, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.VIEW, newFolderBtn, TYPE_ROOT);
- actionsRegistry.addAction(ActionGroups.VIEW, chatAbout, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.MENUITEM, delContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, delFolderMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, blogNewMenu, TYPE_BLOG);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, participateBtn, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newDocBtn, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newFolderBtn, TYPE_ROOT);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, chatAbout, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, delContentMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
newMenusRegistry.register(TYPE_BLOG, blogNewMenu.get());
- actionsRegistry.addAction(ActionGroups.VIEW, blogNewMenu, TYPE_BLOG);
}
@Override
Modified: trunk/src/main/java/cc/kune/blogs/client/actions/BlogsNewMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/BlogsNewMenu.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/BlogsNewMenu.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -1,11 +1,11 @@
package cc.kune.blogs.client.actions;
import cc.kune.gspace.client.actions.AbstractNewMenu;
-import cc.kune.gspace.client.actions.NewMenusProvider;
+import cc.kune.gspace.client.actions.NewMenuProvider;
import com.google.inject.Inject;
-public class BlogsNewMenu extends NewMenusProvider {
+public class BlogsNewMenu extends NewMenuProvider {
@Inject
public BlogsNewMenu(final AbstractNewMenu menu) {
Deleted: trunk/src/main/java/cc/kune/blogs/client/actions/NewPostBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/NewPostBtn.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/NewPostBtn.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.blogs.client.actions;
-
-import cc.kune.blogs.shared.BlogsConstants;
-import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
-import cc.kune.core.client.resources.nav.NavResources;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.actions.NewContentBtn;
-
-import com.google.inject.Inject;
-
-public class NewPostBtn extends NewContentBtn {
-
- @Inject
- public NewPostBtn(final I18nTranslationService i18n, final NewContentAction action,
- final NavResources res, final GlobalShortcutRegister shorcutReg) {
- super(i18n, action, res.blogAdd(), shorcutReg, i18n.t("New post"), i18n.t("Create a new blog post"),
- i18n.t("New post"), BlogsConstants.TYPE_POST);
- }
-
-}
Copied: trunk/src/main/java/cc/kune/blogs/client/actions/NewPostMenuItem.java (from rev 1409, trunk/src/main/java/cc/kune/blogs/client/actions/NewPostBtn.java)
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/NewPostMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/NewPostMenuItem.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -0,0 +1,39 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.blogs.client.actions;
+
+import cc.kune.blogs.shared.BlogsConstants;
+import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.actions.NewContentMenuItem;
+
+import com.google.inject.Inject;
+
+public class NewPostMenuItem extends NewContentMenuItem {
+
+ @Inject
+ public NewPostMenuItem(final I18nTranslationService i18n, final NewContentAction action,
+ final NavResources res, final GlobalShortcutRegister shorcutReg, final BlogsNewMenu blogsNewMenu) {
+ super(i18n, action, res.blogAdd(), shorcutReg, i18n.t("New post"), i18n.t("Create a new blog post"),
+ i18n.t("New post"), BlogsConstants.TYPE_POST, blogsNewMenu.get());
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/blogs/client/actions/NewPostMenuItem.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/chat/client/actions/ChatClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/ChatClientActions.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/chat/client/actions/ChatClientActions.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -50,13 +50,13 @@
final Provider<OpenRoomBtn> openRoomBtn,
final Provider<ContentViewerOptionsMenu> optionsMenuContent) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.VIEW, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.VIEW, refresh, all);
- actionsRegistry.addAction(ActionGroups.VIEW, newRoomBtn, TYPE_ROOT);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.VIEW, openRoomBtn, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openRoomMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openRoomArchiveMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newRoomBtn, TYPE_ROOT);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, openRoomBtn, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openRoomMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openRoomArchiveMenuItem, containersNoRoot);
}
@Override
Modified: trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtMenuItemGui.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtMenuItemGui.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtMenuItemGui.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -132,6 +132,9 @@
final int position = descriptor.getPosition();
final AbstractGwtMenuGui menu = getParentMenu(descriptor);
if (menu == null) {
+ // Note: Be careful if you have two menus (not a singleton) and you add
+ // one but
+ // no the other that it associated with this menuitem
throw new UIException("Warning: To add a menu item you need to add the menu before. Item: "
+ descriptor);
}
Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractComposedGuiItem.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractComposedGuiItem.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractComposedGuiItem.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -30,77 +30,77 @@
import com.google.gwt.user.client.ui.Composite;
public abstract class AbstractComposedGuiItem extends Composite implements IsActionExtensible {
- private final GuiProvider bindings;
- private GuiActionDescCollection guiItems;
+ private final GuiProvider bindings;
+ private GuiActionDescCollection guiItems;
- public AbstractComposedGuiItem(final GuiProvider bindings) {
- super();
- this.bindings = bindings;
- }
+ public AbstractComposedGuiItem(final GuiProvider bindings) {
+ super();
+ this.bindings = bindings;
+ }
- public void add(final GuiActionDescCollection descriptors) {
- for (final GuiActionDescrip descriptor : descriptors) {
- add(descriptor);
- }
+ public void add(final GuiActionDescCollection descriptors) {
+ for (final GuiActionDescrip descriptor : descriptors) {
+ add(descriptor);
}
+ }
- @Override
- public void add(final GuiActionDescrip... descriptors) {
- for (final GuiActionDescrip descriptor : descriptors) {
- add(descriptor);
- }
+ @Override
+ public void add(final GuiActionDescrip... descriptors) {
+ for (final GuiActionDescrip descriptor : descriptors) {
+ add(descriptor);
}
+ }
- @Override
- public void add(final GuiActionDescrip descriptor) {
- getGuiItems().add(descriptor);
- beforeAddWidget(descriptor);
- }
+ @Override
+ public void add(final GuiActionDescrip descriptor) {
+ getGuiItems().add(descriptor);
+ beforeAddWidget(descriptor);
+ }
- public void addActions(final List<GuiActionDescrip> descriptors) {
- for (final GuiActionDescrip descriptor : descriptors) {
- add(descriptor);
- }
+ public void addActions(final List<GuiActionDescrip> descriptors) {
+ for (final GuiActionDescrip descriptor : descriptors) {
+ add(descriptor);
}
+ }
- @Override
- public void addAll(final GuiActionDescCollection descriptors) {
- for (final GuiActionDescrip descriptor : descriptors) {
- add(descriptor);
- }
+ @Override
+ public void addAll(final GuiActionDescCollection descriptors) {
+ for (final GuiActionDescrip descriptor : descriptors) {
+ add(descriptor);
}
+ }
- protected abstract void addWidget(AbstractGuiItem item);
+ protected abstract void addWidget(AbstractGuiItem item);
- protected void beforeAddWidget(final GuiActionDescrip descrip) {
- if (descrip.mustBeAdded()) {
- final GuiBinding binding = bindings.get(descrip.getType());
- if (binding == null) {
- throw new UIException("Unknown binding for: " + descrip);
- } else {
- final AbstractGuiItem item = binding.create(descrip);
- if (binding.shouldBeAdded()) {
- if (descrip.getPosition() == GuiActionDescrip.NO_POSITION) {
- addWidget(item);
- } else {
- insertWidget(item, descrip.getPosition());
- }
- }
- }
+ protected void beforeAddWidget(final GuiActionDescrip descrip) {
+ if (descrip.mustBeAdded()) {
+ final GuiBinding binding = bindings.get(descrip.getType());
+ if (binding == null) {
+ throw new UIException("Unknown binding for: " + descrip);
+ } else {
+ final AbstractGuiItem item = binding.create(descrip);
+ if (binding.shouldBeAdded()) {
+ if (descrip.getPosition() == GuiActionDescrip.NO_POSITION) {
+ addWidget(item);
+ } else {
+ insertWidget(item, descrip.getPosition());
+ }
}
+ }
}
+ }
- @Override
- public void clear() {
- getGuiItems().clear();
- }
+ @Override
+ public void clear() {
+ getGuiItems().clear();
+ }
- public GuiActionDescCollection getGuiItems() {
- if (guiItems == null) {
- guiItems = new GuiActionDescCollection();
- }
- return guiItems;
+ public GuiActionDescCollection getGuiItems() {
+ if (guiItems == null) {
+ guiItems = new GuiActionDescCollection();
}
+ return guiItems;
+ }
- protected abstract void insertWidget(AbstractGuiItem item, int position);
+ protected abstract void insertWidget(AbstractGuiItem item, int position);
}
Modified: trunk/src/main/java/cc/kune/common/public/kune-common.css
===================================================================
--- trunk/src/main/java/cc/kune/common/public/kune-common.css 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/common/public/kune-common.css 2011-06-24 01:51:23 UTC (rev 1415)
@@ -441,7 +441,7 @@
}
.k-no-backimage,.k-no-backimage td {
- background-image: none;
+ background-image: none !important;
}
.k-nobackcolor {
Modified: trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -39,98 +39,100 @@
*
*/
public class ActionRegistryByType {
- private static final String GENERIC_GROUP_ACTION = "kgengroup";
- private static final String GENERIC_TYPE_ID = "kgentype";
- private static final String KEY_SEPARATOR = "-";
+ private static final String GENERIC_GROUP_ACTION = "kgengroup";
+ private static final String GENERIC_TYPE_ID = "kgentype";
+ private static final String KEY_SEPARATOR = "-";
- private final Map<String, GuiActionDescProviderCollection> actions;
+ private final Map<String, GuiActionDescProviderCollection> actions;
- public ActionRegistryByType() {
- actions = new HashMap<String, GuiActionDescProviderCollection>();
- }
+ public ActionRegistryByType() {
+ actions = new HashMap<String, GuiActionDescProviderCollection>();
+ }
- private void add(final GuiActionDescCollection collection, final GuiActionDescrip descrip, final Object targetItem) {
- descrip.setTarget(targetItem);
- collection.add(descrip);
- }
+ private void add(final GuiActionDescCollection collection, final GuiActionDescrip descrip,
+ final Object targetItem) {
+ descrip.setTarget(targetItem);
+ collection.add(descrip);
+ }
- public void addAction(final Provider<? extends GuiActionDescrip> action) {
- addAction(GENERIC_GROUP_ACTION, action, GENERIC_TYPE_ID);
- }
+ public void addAction(final Provider<? extends GuiActionDescrip> action) {
+ addAction(GENERIC_GROUP_ACTION, action, GENERIC_TYPE_ID);
+ }
- public void addAction(@Nonnull final String actionsGroupId, final Provider<? extends GuiActionDescrip> action) {
- addAction(actionsGroupId, action, GENERIC_TYPE_ID);
- }
+ public void addAction(@Nonnull final String actionsGroupId,
+ final Provider<? extends GuiActionDescrip> action) {
+ addAction(actionsGroupId, action, GENERIC_TYPE_ID);
+ }
- public void addAction(@Nonnull final String actionsGroupId,
- final @Nonnull Provider<? extends GuiActionDescrip> action, @Nonnull final String... typeIds) {
- for (final String typeId : typeIds) {
- final GuiActionDescProviderCollection actionColl = getActions(actionsGroupId, typeId);
- actionColl.add(action);
- actions.put(genKey(actionsGroupId, typeId), actionColl);
- }
+ public void addAction(@Nonnull final String actionsGroupId,
+ final @Nonnull Provider<? extends GuiActionDescrip> action, @Nonnull final String... typeIds) {
+ for (final String typeId : typeIds) {
+ final GuiActionDescProviderCollection actionColl = getActions(actionsGroupId, typeId);
+ actionColl.add(action);
+ actions.put(genKey(actionsGroupId, typeId), actionColl);
}
+ }
- private String genKey(final String actionsGroupId, final String typeId) {
- return actionsGroupId + KEY_SEPARATOR + typeId;
- }
+ private String genKey(final String actionsGroupId, final String typeId) {
+ return actionsGroupId + KEY_SEPARATOR + typeId;
+ }
- private GuiActionDescProviderCollection getActions(final String actionsGroupId, final String typeId) {
- final String key = genKey(actionsGroupId, typeId);
- GuiActionDescProviderCollection actionColl = actions.get(key);
- if (actionColl == null) {
- actionColl = new GuiActionDescProviderCollection();
- actions.put(key, actionColl);
- }
- return actionColl;
+ private GuiActionDescProviderCollection getActions(final String actionsGroupId, final String typeId) {
+ final String key = genKey(actionsGroupId, typeId);
+ GuiActionDescProviderCollection actionColl = actions.get(key);
+ if (actionColl == null) {
+ actionColl = new GuiActionDescProviderCollection();
+ actions.put(key, actionColl);
}
+ return actionColl;
+ }
- public GuiActionDescCollection getCurrentActions(final Object targetItem, final boolean isLogged,
- final AccessRights rights) {
- return getCurrentActions(targetItem, GENERIC_TYPE_ID, isLogged, rights, null);
- }
+ public GuiActionDescCollection getCurrentActions(final Object targetItem, final boolean isLogged,
+ final AccessRights rights) {
+ return getCurrentActions(targetItem, GENERIC_TYPE_ID, isLogged, rights, null);
+ }
- public GuiActionDescCollection getCurrentActions(final Object targetItem, final boolean isLogged,
- final AccessRights rights, @Nullable final String actionsGroup) {
- return getCurrentActions(targetItem, GENERIC_TYPE_ID, isLogged, rights, actionsGroup);
- }
+ public GuiActionDescCollection getCurrentActions(final Object targetItem, final boolean isLogged,
+ final AccessRights rights, @Nullable final String actionsGroup) {
+ return getCurrentActions(targetItem, GENERIC_TYPE_ID, isLogged, rights, actionsGroup);
+ }
- public GuiActionDescCollection getCurrentActions(final Object targetItem, final String typeId,
- final boolean isLogged, final AccessRights rights) {
- return getCurrentActions(targetItem, typeId, isLogged, rights, null);
- }
+ public GuiActionDescCollection getCurrentActions(final Object targetItem, final String typeId,
+ final boolean isLogged, final AccessRights rights) {
+ return getCurrentActions(targetItem, typeId, isLogged, rights, null);
+ }
- public <T> GuiActionDescCollection getCurrentActions(final Object targetItem, final String typeId,
- final boolean isLogged, final AccessRights rights, @Nullable final String actionsGroupId) {
- final GuiActionDescCollection collection = new GuiActionDescCollection();
- for (final Provider<? extends GuiActionDescrip> descripProv : getActions(actionsGroupId, typeId)) {
- final GuiActionDescrip descrip = descripProv.get();
- final AbstractAction action = descrip.getAction();
- if (action instanceof RolAction) {
- if (mustAdd((RolAction) action, isLogged, rights)) {
- add(collection, descrip, targetItem);
- }
- } else {
- add(collection, descrip, targetItem);
- }
+ public <T> GuiActionDescCollection getCurrentActions(final Object targetItem, final String typeId,
+ final boolean isLogged, final AccessRights rights, @Nullable final String actionsGroupId) {
+ final GuiActionDescCollection collection = new GuiActionDescCollection();
+ for (final Provider<? extends GuiActionDescrip> descripProv : getActions(actionsGroupId, typeId)) {
+ final GuiActionDescrip descrip = descripProv.get();
+ final AbstractAction action = descrip.getAction();
+ if (action instanceof RolAction) {
+ if (mustAdd((RolAction) action, isLogged, rights)) {
+ add(collection, descrip, targetItem);
}
- return collection;
+ } else {
+ add(collection, descrip, targetItem);
+ }
}
+ return collection;
+ }
- private boolean mustAdd(final RolAction action, final boolean isLogged, final AccessRights rights) {
- if (action.isAuthNeed()) {
- if (!isLogged) {
- return false;
- }
- }
- switch (action.getRolRequired()) {
- case Administrator:
- return rights.isAdministrable();
- case Editor:
- return rights.isEditable();
- case Viewer:
- default:
- return rights.isVisible();
- }
+ private boolean mustAdd(final RolAction action, final boolean isLogged, final AccessRights rights) {
+ if (action.isAuthNeed()) {
+ if (!isLogged) {
+ return false;
+ }
}
+ switch (action.getRolRequired()) {
+ case Administrator:
+ return rights.isAdministrable();
+ case Editor:
+ return rights.isEditable();
+ case Viewer:
+ default:
+ return rights.isVisible();
+ }
+ }
}
Modified: trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -143,7 +143,7 @@
return menuItem;
}
};
- actionRegistry.addAction(ActionGroups.VIEW, menuItemProvider, typeId);
+ actionRegistry.addAction(ActionGroups.TOOLBAR, menuItemProvider, typeId);
}
}
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -50,7 +50,7 @@
public static final SubMenuDescriptor MODERATION_SUBMENU = new SubMenuDescriptor();
public static final MenuDescriptor OPTIONS_MENU = new MenuDescriptor();
- public static final String OPTIONS_STYLES = "k-sn-options-menu, k-noborder, k-nobackcolor, k-btn-min";
+ public static final String OPTIONS_STYLES = "k-sn-options-menu, k-noborder, k-nobackcolor, k-no-backimage, k-btn-min";
public static final SubMenuDescriptor VISIBILITY_SUBMENU = new SubMenuDescriptor();
@Inject
Modified: trunk/src/main/java/cc/kune/docs/client/DocsGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsGinModule.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/docs/client/DocsGinModule.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -19,17 +19,17 @@
*/
package cc.kune.docs.client;
+import cc.kune.common.client.ExtendedGinModule;
import cc.kune.docs.client.actions.DocsClientActions;
+import cc.kune.docs.client.actions.DocsFolderNewMenu;
-import com.google.inject.Singleton;
-import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
+public class DocsGinModule extends ExtendedGinModule {
-public class DocsGinModule extends AbstractPresenterModule {
+ @Override
+ protected void configure() {
+ s(DocsClientTool.class);
+ s(DocsClientActions.class);
+ s(DocsFolderNewMenu.class);
+ }
- @Override
- protected void configure() {
- bind(DocsClientTool.class).in(Singleton.class);
- bind(DocsClientActions.class).in(Singleton.class);
- }
-
}
Modified: trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -52,33 +52,33 @@
@Inject
public DocsClientActions(final I18nUITranslationService i18n, final Session session,
final StateManager stateManager, final ActionRegistryByType registry, final CoreResources res,
- final Provider<GoParentFolderBtn> folderGoUp, final Provider<NewDocBtn> newDocBtn,
- final Provider<NewFolderBtn> newFolderBtn, final Provider<OpenDocMenuItem> openContentMenuItem,
+ final Provider<GoParentFolderBtn> folderGoUp, final Provider<NewDocMenuItem> newDocBtn,
+ final Provider<NewFolderMenuItem> newFolderBtn,
+ final Provider<OpenDocMenuItem> openContentMenuItem,
final Provider<DelDocMenuItem> delContentMenuItem,
final Provider<ContentViewerOptionsMenu> optionsMenuContent,
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<DelFolderMenuItem> delFolderMenuItem,
final Provider<ChatAboutContentBtn> chatAbout, final Provider<RefreshContentMenuItem> refresh,
- final Provider<SetAsHomePageMenuItem> setAsHomePage, final DocsRootNewMenu rootNewMenu,
+ final Provider<SetAsHomePageMenuItem> setAsHomePage,
final NewMenusForTypeIdsRegistry newMenusRegistry, final DocsFolderNewMenu folderNewMenu) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.VIEW, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.VIEW, refresh, all);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, contents);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.VIEW, newDocBtn, containers);
- actionsRegistry.addAction(ActionGroups.VIEW, participateBtn, contents);
- actionsRegistry.addAction(ActionGroups.VIEW, newFolderBtn, containers);
- actionsRegistry.addAction(ActionGroups.VIEW, chatAbout, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.MENUITEM, delContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, delFolderMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.MENUITEM, setAsHomePage, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderNewMenu, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newDocBtn, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, participateBtn, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newFolderBtn, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, chatAbout, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, delContentMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, setAsHomePage, contents);
newMenusRegistry.register(TYPE_FOLDER, folderNewMenu.get());
- newMenusRegistry.register(TYPE_ROOT, rootNewMenu.get());
- actionsRegistry.addAction(ActionGroups.VIEW, folderNewMenu, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.VIEW, rootNewMenu, root);
+ newMenusRegistry.register(TYPE_ROOT, folderNewMenu.get());
}
@Override
Modified: trunk/src/main/java/cc/kune/docs/client/actions/DocsFolderNewMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DocsFolderNewMenu.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DocsFolderNewMenu.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -1,14 +1,16 @@
package cc.kune.docs.client.actions;
+import javax.annotation.Nonnull;
+
import cc.kune.gspace.client.actions.AbstractNewMenu;
-import cc.kune.gspace.client.actions.NewMenusProvider;
+import cc.kune.gspace.client.actions.NewMenuProvider;
import com.google.inject.Inject;
-public class DocsFolderNewMenu extends NewMenusProvider {
+public class DocsFolderNewMenu extends NewMenuProvider {
@Inject
- public DocsFolderNewMenu(final AbstractNewMenu menu) {
+ public DocsFolderNewMenu(final @Nonnull AbstractNewMenu menu) {
super(menu);
}
Deleted: trunk/src/main/java/cc/kune/docs/client/actions/DocsRootNewMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DocsRootNewMenu.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DocsRootNewMenu.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -1,15 +0,0 @@
-package cc.kune.docs.client.actions;
-
-import cc.kune.gspace.client.actions.AbstractNewMenu;
-import cc.kune.gspace.client.actions.NewMenusProvider;
-
-import com.google.inject.Inject;
-
-public class DocsRootNewMenu extends NewMenusProvider {
-
- @Inject
- public DocsRootNewMenu(final AbstractNewMenu menu) {
- super(menu);
- }
-
-}
Deleted: trunk/src/main/java/cc/kune/docs/client/actions/NewDocBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/NewDocBtn.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/docs/client/actions/NewDocBtn.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -1,41 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.docs.client.actions;
-
-import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
-import cc.kune.core.client.resources.nav.NavResources;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.docs.shared.DocsConstants;
-import cc.kune.gspace.client.actions.NewContentBtn;
-
-import com.google.inject.Inject;
-
-public class NewDocBtn extends NewContentBtn {
-
- @Inject
- public NewDocBtn(final I18nTranslationService i18n, final NewContentAction action,
- final NavResources res, final GlobalShortcutRegister shorcutReg) {
- super(i18n, action, res.pageAdd(), shorcutReg, i18n.t("New document"),
- i18n.t("Create a New Document here. "
- + "This document will be a new 'Page' in the public web if you publish it"),
- i18n.t("New document"), DocsConstants.TYPE_DOCUMENT);
- }
-
-}
Copied: trunk/src/main/java/cc/kune/docs/client/actions/NewDocMenuItem.java (from rev 1409, trunk/src/main/java/cc/kune/docs/client/actions/NewDocBtn.java)
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/NewDocMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/actions/NewDocMenuItem.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -0,0 +1,42 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.docs.client.actions;
+
+import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.docs.shared.DocsConstants;
+import cc.kune.gspace.client.actions.NewContentMenuItem;
+
+import com.google.inject.Inject;
+
+public class NewDocMenuItem extends NewContentMenuItem {
+
+ @Inject
+ public NewDocMenuItem(final I18nTranslationService i18n, final NewContentAction action,
+ final NavResources res, final GlobalShortcutRegister shorcutReg,
+ final DocsFolderNewMenu docsFolderNewMenu) {
+ super(i18n, action, res.pageAdd(), shorcutReg, i18n.t("New document"),
+ i18n.t("Create a New Document here. "
+ + "This document will be a new 'Page' in the public web if you publish it"),
+ i18n.t("New document"), DocsConstants.TYPE_DOCUMENT, docsFolderNewMenu.get());
+ }
+
+}
Deleted: trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.docs.client.actions;
-
-import cc.kune.core.client.resources.nav.NavResources;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.docs.shared.DocsConstants;
-import cc.kune.gspace.client.actions.NewContainerBtn;
-
-import com.google.inject.Inject;
-
-public class NewFolderBtn extends NewContainerBtn {
-
- @Inject
- public NewFolderBtn(final I18nTranslationService i18n, final NewContainerAction action,
- final NavResources res) {
- super(i18n, action, res.folderAdd(), i18n.t("New folder"),
- i18n.t("Create a new folder here. A folder will be a 'section' in the public web"),
- i18n.t("New folder"), DocsConstants.TYPE_FOLDER);
- }
-
-}
Copied: trunk/src/main/java/cc/kune/docs/client/actions/NewFolderMenuItem.java (from rev 1409, trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java)
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/NewFolderMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/actions/NewFolderMenuItem.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -0,0 +1,39 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.docs.client.actions;
+
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.docs.shared.DocsConstants;
+import cc.kune.gspace.client.actions.NewContainerMenuItem;
+
+import com.google.inject.Inject;
+
+public class NewFolderMenuItem extends NewContainerMenuItem {
+
+ @Inject
+ public NewFolderMenuItem(final I18nTranslationService i18n, final NewContainerAction action,
+ final NavResources res, final DocsFolderNewMenu docsFolderNewMenu) {
+ super(i18n, action, res.folderAdd(), i18n.t("New folder"),
+ i18n.t("Create a new folder here. A folder will be a 'section' in the public web"),
+ i18n.t("New folder"), DocsConstants.TYPE_FOLDER, docsFolderNewMenu.get());
+ }
+
+}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/ActionGroups.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/ActionGroups.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/ActionGroups.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -25,8 +25,8 @@
*/
public final class ActionGroups {
public final static String EDIT = "edit";
- public final static String MENUITEM = "menu-item";
- public final static String VIEW = "view";
+ public final static String ITEM_MENU = "menu-item";
+ public final static String TOOLBAR = "view";
private ActionGroups() {
}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/ContentViewerOptionsMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/ContentViewerOptionsMenu.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/ContentViewerOptionsMenu.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -26,10 +26,11 @@
public class ContentViewerOptionsMenu extends MenuDescriptor {
- @Inject
- public ContentViewerOptionsMenu(final CoreResources res) {
- super();
- this.withIcon(res.arrowdownsitebar()).withStyles("k-def-docbtn, k-fr, k-noborder, k-nobackcolor");
- }
+ @Inject
+ public ContentViewerOptionsMenu(final CoreResources res) {
+ super();
+ this.withIcon(res.arrowdownsitebar()).withStyles(
+ "k-def-docbtn, k-fr, k-noborder, k-no-backimage, k-nobackcolor");
+ }
}
Copied: trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerMenuItem.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerBtn.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerMenuItem.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -0,0 +1,102 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.actions;
+
+import javax.annotation.Nonnull;
+
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
+import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.core.client.actions.RolAction;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.rpcservices.ContentServiceAsync;
+import cc.kune.core.client.state.ContentCache;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.dto.AccessRolDTO;
+import cc.kune.core.shared.dto.HasContent;
+import cc.kune.core.shared.dto.StateContainerDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.viewers.FolderViewerPresenter;
+
+import com.google.gwt.resources.client.ImageResource;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class NewContainerMenuItem extends MenuItemDescriptor {
+
+ public static class NewContainerAction extends RolAction {
+
+ private final ContentCache cache;
+ private final Provider<ContentServiceAsync> contentService;
+ private final FolderViewerPresenter folderViewer;
+ private final I18nTranslationService i18n;
+ private final Session session;
+ private final StateManager stateManager;
+
+ @Inject
+ public NewContainerAction(final Session session, final StateManager stateManager,
+ final I18nTranslationService i18n, final Provider<ContentServiceAsync> contentService,
+ final ContentCache cache, final FolderViewerPresenter folderViewer) {
+ super(AccessRolDTO.Editor, true);
+ this.session = session;
+ this.stateManager = stateManager;
+ this.i18n = i18n;
+ this.contentService = contentService;
+ this.cache = cache;
+ this.folderViewer = folderViewer;
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ NotifyUser.showProgressProcessing();
+ stateManager.gotoStateToken(((HasContent) session.getCurrentState()).getContainer().getStateToken());
+ final String newName = (String) getValue(NEW_NAME);
+ contentService.get().addFolder(session.getUserHash(), session.getCurrentStateToken(), newName,
+ (String) getValue(ID), new AsyncCallbackSimple<StateContainerDTO>() {
+ @Override
+ public void onSuccess(final StateContainerDTO state) {
+ // contextNavigator.setEditOnNextStateChange(true);
+ stateManager.setRetrievedStateAndGo(state);
+ NotifyUser.hideProgress();
+ NotifyUser.info(i18n.tWithNT("[%s] created", "New folder created, for instance", newName));
+ folderViewer.blinkTitle();
+ }
+ });
+ cache.removeContent(session.getCurrentStateToken());
+ }
+
+ }
+
+ private static final String ID = "ctnernewid";
+ private static final String NEW_NAME = "ctnernewname";
+
+ public NewContainerMenuItem(final I18nTranslationService i18n, final NewContainerAction action,
+ final ImageResource icon, final String title, final String tooltip, final String newName,
+ final String id, final @Nonnull MenuDescriptor parent) {
+ super(action);
+ setParent(parent);
+ // The name given to this new content
+ action.putValue(NEW_NAME, newName);
+ action.putValue(ID, id);
+ this.withText(title).withToolTip(tooltip).withIcon(icon).withStyles("k-def-docbtn, k-fr");
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerMenuItem.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -39,7 +39,7 @@
import com.google.inject.Inject;
import com.google.inject.Provider;
-public class NewContentBtn extends ButtonDescriptor {
+public abstract class NewContentBtn extends ButtonDescriptor {
public static class NewContentAction extends RolAction {
Copied: trunk/src/main/java/cc/kune/gspace/client/actions/NewContentMenuItem.java (from rev 1414, trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewContentMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewContentMenuItem.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -0,0 +1,106 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.actions;
+
+import javax.annotation.Nonnull;
+
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
+import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
+import cc.kune.core.client.actions.RolAction;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.rpcservices.ContentServiceAsync;
+import cc.kune.core.client.state.ContentCache;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.dto.AccessRolDTO;
+import cc.kune.core.shared.dto.HasContent;
+import cc.kune.core.shared.dto.StateContentDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.viewers.ContentViewerPresenter;
+
+import com.google.gwt.resources.client.ImageResource;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class NewContentMenuItem extends MenuItemDescriptor {
+
+ public static class NewContentAction extends RolAction {
+
+ private final ContentCache cache;
+ private final Provider<ContentServiceAsync> contentService;
+ private final ContentViewerPresenter contentViewer;
+ private final I18nTranslationService i18n;
+ private final Session session;
+ private final StateManager stateManager;
+
+ @Inject
+ public NewContentAction(final Session session, final StateManager stateManager,
+ final I18nTranslationService i18n, final Provider<ContentServiceAsync> contentService,
+ final ContentViewerPresenter contentViewerPresenter, final ContentCache cache) {
+ super(AccessRolDTO.Editor, true);
+ this.session = session;
+ this.stateManager = stateManager;
+ this.i18n = i18n;
+ this.contentService = contentService;
+ this.contentViewer = contentViewerPresenter;
+ this.cache = cache;
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ NotifyUser.showProgressProcessing();
+ stateManager.gotoStateToken(((HasContent) session.getCurrentState()).getContainer().getStateToken());
+ final String newName = (String) getValue(NEW_NAME);
+ contentService.get().addContent(session.getUserHash(), session.getCurrentStateToken(), newName,
+ (String) getValue(ID), new AsyncCallbackSimple<StateContentDTO>() {
+ @Override
+ public void onSuccess(final StateContentDTO state) {
+ stateManager.setRetrievedStateAndGo(state);
+ NotifyUser.hideProgress();
+ // stateManager.refreshCurrentGroupState();
+ // contextNavigator.setEditOnNextStateChange(true);
+ NotifyUser.info(i18n.tWithNT("[%s] created", "New content created, for instance", newName));
+ contentViewer.blinkTitle();
+ }
+ });
+ cache.removeContent(session.getCurrentStateToken());
+ }
+ }
+
+ private static final String ID = "ctnnewid";
+ private static final String NEW_NAME = "ctnnewname";
+
+ public NewContentMenuItem(final I18nTranslationService i18n, final NewContentAction action,
+ final ImageResource icon, final GlobalShortcutRegister shorcutReg, final String title,
+ final String tooltip, final String newName, final String id, @Nonnull final MenuDescriptor parent) {
+ super(parent, action);
+ // The name given to this new content
+ action.putValue(NEW_NAME, newName);
+ action.putValue(ID, id);
+ // final KeyStroke shortcut = Shortcut.getShortcut(false, true, false,
+ // false, Character.valueOf('N'));
+ // shorcutReg.put(shortcut, action);
+ this.withText(title).withToolTip(tooltip).withIcon(icon).withStyles("k-def-docbtn, k-fr");
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/actions/NewContentMenuItem.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/src/main/java/cc/kune/gspace/client/actions/NewMenuProvider.java (from rev 1414, trunk/src/main/java/cc/kune/gspace/client/actions/NewMenusProvider.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewMenuProvider.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewMenuProvider.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -0,0 +1,26 @@
+package cc.kune.gspace.client.actions;
+
+import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
+
+import com.google.inject.Provider;
+
+/**
+ * The Class NewMenusProvider ins a way to create a kind of singeltons for menu
+ * entries. This can be register in a list of Providers<GuiDescriptor> but in
+ * fact only references one item and can be used to select the parent of some
+ * menu items
+ */
+public abstract class NewMenuProvider implements Provider<MenuDescriptor> {
+
+ private final AbstractNewMenu menu;
+
+ public NewMenuProvider(final AbstractNewMenu menu) {
+ this.menu = menu;
+ }
+
+ @Override
+ public MenuDescriptor get() {
+ return menu;
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/actions/NewMenuProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/src/main/java/cc/kune/gspace/client/actions/NewMenusProvider.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewMenusProvider.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewMenusProvider.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -1,20 +0,0 @@
-package cc.kune.gspace.client.actions;
-
-import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
-
-import com.google.inject.Provider;
-
-public abstract class NewMenusProvider implements Provider<MenuDescriptor> {
-
- private final AbstractNewMenu menu;
-
- public NewMenusProvider(final AbstractNewMenu menu) {
- this.menu = menu;
- }
-
- @Override
- public MenuDescriptor get() {
- return menu;
- }
-
-}
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -187,7 +187,7 @@
}
}
final GuiActionDescCollection actions = actionsRegistry.getCurrentActions(stateContent.getGroup(),
- stateContent.getTypeId(), session.isLogged(), rights, ActionGroups.VIEW);
+ stateContent.getTypeId(), session.isLogged(), rights, ActionGroups.TOOLBAR);
getView().setActions(actions);
}
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -87,17 +87,7 @@
}
itemWidget.setMenu(toolbar);
// Tooltip.to(itemWidget, item.getTooltip());
- final MenuDescriptor menu = new MenuDescriptor(i18n.t("Actions"));
- menu.withIcon(res.arrowdown()).withStyles("k-def-docbtn, k-btn, k-button");
- menu.setStandalone(false);
- itemWidget.setMenuVisible(false);
- toolbar.add(menu);
- final GuiActionDescCollection actions = item.getActionCollection();
- toolbar.setVisible(actions.size() > 0);
- for (final GuiActionDescrip menuItem : actions) {
- menuItem.setParent(menu);
- toolbar.add(menuItem);
- }
+ // FIXME make this under demand
itemWidget.getRowClick().addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
@@ -119,8 +109,30 @@
}
});
itemWidget.getRowMouse().addMouseOverHandler(new MouseOverHandler() {
+ MenuDescriptor menu;
+
+ private MenuDescriptor createMenu(final FolderItemDescriptor item,
+ final FolderItemWidget itemWidget, final ActionSimplePanel toolbar) {
+ MenuDescriptor menu;
+ menu = new MenuDescriptor(i18n.t("Actions"));
+ menu.withIcon(res.arrowdown()).withStyles("k-def-docbtn, k-btn, k-button");
+ menu.setStandalone(false);
+ itemWidget.setMenuVisible(false);
+ toolbar.add(menu);
+ final GuiActionDescCollection actions = item.getActionCollection();
+ toolbar.setVisible(actions.size() > 0);
+ for (final GuiActionDescrip menuItem : actions) {
+ menuItem.setParent(menu);
+ toolbar.add(menuItem);
+ }
+ return menu;
+ }
+
@Override
public void onMouseOver(final MouseOverEvent event) {
+ if (menu == null) {
+ menu = createMenu(item, itemWidget, toolbar);
+ }
// menu.setVisible(true);
itemWidget.setMenuVisible(true);
}
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -149,7 +149,7 @@
capabilitiesRegistry.isDragable(typeId) && rights.isAdministrable(),
capabilitiesRegistry.isDropable(typeId) && rights.isAdministrable(),
actionsRegistry.getCurrentActions(content, typeId, session.isLogged(), rights,
- ActionGroups.MENUITEM));
+ ActionGroups.ITEM_MENU));
if (status.equals(ContentStatus.inTheDustbin) && !session.getShowDeletedContent()) {
// Don't show
// NotifyUser.info("Deleted, don't show");
@@ -300,7 +300,7 @@
getView().setContainer(stateContainer);
final AccessRights rights = stateContainer.getContainerRights();
final GuiActionDescCollection actions = actionsRegistry.getCurrentActions(stateContainer.getGroup(),
- stateContainer.getTypeId(), session.isLogged(), rights, ActionGroups.VIEW);
+ stateContainer.getTypeId(), session.isLogged(), rights, ActionGroups.TOOLBAR);
final ContainerDTO container = stateContainer.getContainer();
createPath(container, actions);
getView().setActions(actions);
Modified: trunk/src/main/java/cc/kune/meets/client/actions/MeetingsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/meets/client/actions/MeetingsClientActions.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/meets/client/actions/MeetingsClientActions.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -51,14 +51,14 @@
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<RefreshContentMenuItem> refresh) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.VIEW, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.VIEW, refresh, all);
- actionsRegistry.addAction(ActionGroups.VIEW, newMeetingsBtn, containers);
- actionsRegistry.addAction(ActionGroups.VIEW, participateBtn, contents);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.MENUITEM, delContentMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newMeetingsBtn, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, participateBtn, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, delContentMenuItem, contents);
}
@Override
Modified: trunk/src/main/java/cc/kune/wiki/client/WikiGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/wiki/client/WikiGinModule.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/wiki/client/WikiGinModule.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -19,17 +19,17 @@
*/
package cc.kune.wiki.client;
+import cc.kune.common.client.ExtendedGinModule;
import cc.kune.wiki.client.actions.WikiClientActions;
+import cc.kune.wiki.client.actions.WikiFolderNewMenu;
-import com.google.inject.Singleton;
-import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
+public class WikiGinModule extends ExtendedGinModule {
-public class WikiGinModule extends AbstractPresenterModule {
-
@Override
protected void configure() {
- bind(WikiClientTool.class).in(Singleton.class);
- bind(WikiClientActions.class).in(Singleton.class);
+ s(WikiClientTool.class);
+ s(WikiClientActions.class);
+ s(WikiFolderNewMenu.class);
}
}
Modified: trunk/src/main/java/cc/kune/wiki/client/actions/NewFolderBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/wiki/client/actions/NewFolderBtn.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/wiki/client/actions/NewFolderBtn.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -21,19 +21,19 @@
import cc.kune.core.client.resources.nav.NavResources;
import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.actions.NewContainerBtn;
+import cc.kune.gspace.client.actions.NewContainerMenuItem;
import cc.kune.wiki.shared.WikiConstants;
import com.google.inject.Inject;
-public class NewFolderBtn extends NewContainerBtn {
+public class NewFolderBtn extends NewContainerMenuItem {
@Inject
public NewFolderBtn(final I18nTranslationService i18n, final NewContainerAction action,
- final NavResources res) {
+ final NavResources res, final WikiFolderNewMenu wikiFolderNewMenu) {
super(i18n, action, res.wikiAdd(), i18n.t("New folder"),
i18n.t("Create a new folder here. A folder will be a 'section' in the public web"),
- i18n.t("New folder"), WikiConstants.TYPE_FOLDER);
+ i18n.t("New folder"), WikiConstants.TYPE_FOLDER, wikiFolderNewMenu.get());
}
}
Modified: trunk/src/main/java/cc/kune/wiki/client/actions/NewWikiBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/wiki/client/actions/NewWikiBtn.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/wiki/client/actions/NewWikiBtn.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -22,20 +22,21 @@
import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
import cc.kune.core.client.resources.nav.NavResources;
import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.actions.NewContentBtn;
+import cc.kune.gspace.client.actions.NewContentMenuItem;
import cc.kune.wiki.shared.WikiConstants;
import com.google.inject.Inject;
-public class NewWikiBtn extends NewContentBtn {
+public class NewWikiBtn extends NewContentMenuItem {
@Inject
public NewWikiBtn(final I18nTranslationService i18n, final NewContentAction action,
- final NavResources res, final GlobalShortcutRegister shorcutReg) {
+ final NavResources res, final GlobalShortcutRegister shorcutReg,
+ final WikiFolderNewMenu wikiFolderNewMenu) {
super(i18n, action, res.wikipageAdd(), shorcutReg, i18n.t("New wikipage"),
i18n.t("Create a New Wikipage here. "
+ "This document will be a new 'Page' in the public web if you publish it"),
- i18n.t("New wikipage"), WikiConstants.TYPE_WIKIPAGE);
+ i18n.t("New wikipage"), WikiConstants.TYPE_WIKIPAGE, wikiFolderNewMenu.get());
}
}
Modified: trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -26,6 +26,7 @@
import cc.kune.chat.client.actions.ChatAboutContentBtn;
import cc.kune.core.client.actions.ActionRegistryByType;
import cc.kune.core.client.i18n.I18nUITranslationService;
+import cc.kune.core.client.registry.NewMenusForTypeIdsRegistry;
import cc.kune.core.client.resources.CoreResources;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
@@ -44,6 +45,7 @@
final String[] containers = { TYPE_ROOT, TYPE_FOLDER };
final String[] containersNoRoot = { TYPE_FOLDER };
final String[] contents = { TYPE_WIKIPAGE, TYPE_UPLOADEDFILE };
+ final String[] root = { TYPE_ROOT };
@Inject
public WikiClientActions(final I18nUITranslationService i18n, final Session session,
@@ -55,21 +57,25 @@
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<DelFolderMenuItem> delFolderMenuItem,
final Provider<ChatAboutContentBtn> chatAbout, final Provider<RefreshContentMenuItem> refresh,
- final Provider<SetAsHomePageMenuItem> setAsHomePage) {
+ final Provider<SetAsHomePageMenuItem> setAsHomePage,
+ final NewMenusForTypeIdsRegistry newMenusRegistry, final WikiFolderNewMenu folderNewMenu) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.VIEW, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.VIEW, refresh, all);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, contents);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.VIEW, newWikiBtn, containers);
- actionsRegistry.addAction(ActionGroups.VIEW, participateBtn, contents);
- actionsRegistry.addAction(ActionGroups.VIEW, newFolderBtn, containers);
- actionsRegistry.addAction(ActionGroups.VIEW, chatAbout, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.MENUITEM, delContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, delFolderMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.MENUITEM, setAsHomePage, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderNewMenu, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newWikiBtn, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, participateBtn, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newFolderBtn, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, chatAbout, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, delContentMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, setAsHomePage, contents);
+ newMenusRegistry.register(TYPE_FOLDER, folderNewMenu.get());
+ newMenusRegistry.register(TYPE_ROOT, folderNewMenu.get());
}
@Override
Added: trunk/src/main/java/cc/kune/wiki/client/actions/WikiFolderNewMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/wiki/client/actions/WikiFolderNewMenu.java (rev 0)
+++ trunk/src/main/java/cc/kune/wiki/client/actions/WikiFolderNewMenu.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -0,0 +1,15 @@
+package cc.kune.wiki.client.actions;
+
+import cc.kune.gspace.client.actions.AbstractNewMenu;
+import cc.kune.gspace.client.actions.NewMenuProvider;
+
+import com.google.inject.Inject;
+
+public class WikiFolderNewMenu extends NewMenuProvider {
+
+ @Inject
+ public WikiFolderNewMenu(final AbstractNewMenu menu) {
+ super(menu);
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/wiki/client/actions/WikiFolderNewMenu.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
1
0
22 Jun '11
Author: vjrj_
Date: 2011-06-22 18:39:13 +0200 (Wed, 22 Jun 2011)
New Revision: 1414
Added:
trunk/src/main/java/cc/kune/blogs/client/actions/BlogsNewMenu.java
trunk/src/main/java/cc/kune/core/client/registry/NewMenusForTypeIdsRegistry.java
trunk/src/main/java/cc/kune/docs/client/actions/DocsFolderNewMenu.java
trunk/src/main/java/cc/kune/docs/client/actions/DocsRootNewMenu.java
trunk/src/main/java/cc/kune/gspace/client/actions/AbstractNewMenu.java
trunk/src/main/java/cc/kune/gspace/client/actions/NewMenusProvider.java
Modified:
trunk/src/main/java/cc/kune/barters/client/BartersClientTool.java
trunk/src/main/java/cc/kune/blogs/client/BlogsClientTool.java
trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java
trunk/src/main/java/cc/kune/client/KuneEntryPoint.java
trunk/src/main/java/cc/kune/client/OnAppStartFactory.java
trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtMenuItemGui.java
trunk/src/main/java/cc/kune/common/client/actions/gwtui/GwtMenuGui.java
trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java
trunk/src/main/java/cc/kune/core/client/registry/ContentCapabilitiesRegistry.java
trunk/src/main/java/cc/kune/docs/client/DocsClientTool.java
trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java
trunk/src/main/java/cc/kune/gspace/client/tool/FoldableAbstractClientTool.java
trunk/src/main/webapp/others/kune-wave-extensions.xml
Log:
New items based in wave extensions
Modified: trunk/src/main/java/cc/kune/barters/client/BartersClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/barters/client/BartersClientTool.java 2011-06-21 21:29:32 UTC (rev 1413)
+++ trunk/src/main/java/cc/kune/barters/client/BartersClientTool.java 2011-06-22 16:39:13 UTC (rev 1414)
@@ -50,7 +50,6 @@
registerRenamableTypes(TYPE_FOLDER, TYPE_BARTER);
registerTageableTypes(TYPE_BARTER);
registerTranslatableTypes(TYPE_FOLDER, TYPE_BARTER);
-
registerIcons();
}
Modified: trunk/src/main/java/cc/kune/blogs/client/BlogsClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/BlogsClientTool.java 2011-06-21 21:29:32 UTC (rev 1413)
+++ trunk/src/main/java/cc/kune/blogs/client/BlogsClientTool.java 2011-06-22 16:39:13 UTC (rev 1414)
@@ -51,7 +51,6 @@
registerRenamableTypes(TYPE_BLOG, TYPE_POST, TYPE_UPLOADEDFILE);
registerTageableTypes(TYPE_BLOG, TYPE_UPLOADEDFILE, TYPE_POST);
// registerTranslatableTypes();
-
registerIcons();
}
Modified: trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java 2011-06-21 21:29:32 UTC (rev 1413)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java 2011-06-22 16:39:13 UTC (rev 1414)
@@ -26,6 +26,7 @@
import cc.kune.chat.client.actions.ChatAboutContentBtn;
import cc.kune.core.client.actions.ActionRegistryByType;
import cc.kune.core.client.i18n.I18nUITranslationService;
+import cc.kune.core.client.registry.NewMenusForTypeIdsRegistry;
import cc.kune.core.client.resources.CoreResources;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
@@ -55,8 +56,9 @@
final Provider<DelPostMenuItem> delContentMenuItem,
final Provider<RefreshContentMenuItem> refresh,
final Provider<ContentViewerOptionsMenu> optionsMenuContent,
- final Provider<ParticipateInContentBtn> participateBtn,
- final Provider<ChatAboutContentBtn> chatAbout, final Provider<DelBlogMenuItem> delFolderMenuItem,
+ final Provider<ParticipateInContentBtn> participateBtn, final BlogsNewMenu blogNewMenu,
+ final NewMenusForTypeIdsRegistry newMenusRegistry, final Provider<ChatAboutContentBtn> chatAbout,
+ final Provider<DelBlogMenuItem> delFolderMenuItem,
final Provider<SetAsHomePageMenuItem> setAsHomePage) {
super(session, stateManager, i18n, registry);
actionsRegistry.addAction(ActionGroups.VIEW, optionsMenuContent, all);
@@ -71,8 +73,8 @@
actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, containersNoRoot);
actionsRegistry.addAction(ActionGroups.MENUITEM, delContentMenuItem, contents);
actionsRegistry.addAction(ActionGroups.MENUITEM, delFolderMenuItem, containersNoRoot);
- // actionsRegistry.addAction(ActionGroups.MENUITEM, setAsHomePage,
- // TYPE_BLOG);
+ newMenusRegistry.register(TYPE_BLOG, blogNewMenu.get());
+ actionsRegistry.addAction(ActionGroups.VIEW, blogNewMenu, TYPE_BLOG);
}
@Override
Added: trunk/src/main/java/cc/kune/blogs/client/actions/BlogsNewMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/BlogsNewMenu.java (rev 0)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/BlogsNewMenu.java 2011-06-22 16:39:13 UTC (rev 1414)
@@ -0,0 +1,15 @@
+package cc.kune.blogs.client.actions;
+
+import cc.kune.gspace.client.actions.AbstractNewMenu;
+import cc.kune.gspace.client.actions.NewMenusProvider;
+
+import com.google.inject.Inject;
+
+public class BlogsNewMenu extends NewMenusProvider {
+
+ @Inject
+ public BlogsNewMenu(final AbstractNewMenu menu) {
+ super(menu);
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/blogs/client/actions/BlogsNewMenu.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/client/KuneEntryPoint.java
===================================================================
--- trunk/src/main/java/cc/kune/client/KuneEntryPoint.java 2011-06-21 21:29:32 UTC (rev 1413)
+++ trunk/src/main/java/cc/kune/client/KuneEntryPoint.java 2011-06-22 16:39:13 UTC (rev 1414)
@@ -91,6 +91,7 @@
ginjector.getCoreParts();
ginjector.getGSpaceParts();
ginjector.getPSpaceParts();
+ ginjector.getXmlActionsParser();
ginjector.getContentViewerSelector().init();
}
}
Modified: trunk/src/main/java/cc/kune/client/OnAppStartFactory.java
===================================================================
--- trunk/src/main/java/cc/kune/client/OnAppStartFactory.java 2011-06-21 21:29:32 UTC (rev 1413)
+++ trunk/src/main/java/cc/kune/client/OnAppStartFactory.java 2011-06-22 16:39:13 UTC (rev 1414)
@@ -19,22 +19,19 @@
*/
package cc.kune.client;
-import cc.kune.core.client.actions.XMLActionsParser;
import cc.kune.core.client.init.AppStartEvent;
import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
import cc.kune.core.client.state.Session;
import com.google.inject.Inject;
-import com.google.inject.Provider;
public class OnAppStartFactory {
@Inject
- public OnAppStartFactory(final Session session, final Provider<XMLActionsParser> actionsParser) {
+ public OnAppStartFactory(final Session session) {
session.onAppStart(true, new AppStartHandler() {
@Override
public void onAppStart(final AppStartEvent event) {
- actionsParser.get();
}
});
}
Modified: trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtMenuItemGui.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtMenuItemGui.java 2011-06-21 21:29:32 UTC (rev 1413)
+++ trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtMenuItemGui.java 2011-06-22 16:39:13 UTC (rev 1414)
@@ -226,6 +226,7 @@
protected void setToolTipText(final String text) {
if (text != null) {
final KeyStroke key = (KeyStroke) descriptor.getValue(Action.ACCELERATOR_KEY);
+ // FIXME This doesn't works... (don't show the tooltip)
Tooltip.to(iconLabel, key == null ? text : text + key.toString());
layout();
}
Modified: trunk/src/main/java/cc/kune/common/client/actions/gwtui/GwtMenuGui.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/gwtui/GwtMenuGui.java 2011-06-21 21:29:32 UTC (rev 1413)
+++ trunk/src/main/java/cc/kune/common/client/actions/gwtui/GwtMenuGui.java 2011-06-22 16:39:13 UTC (rev 1414)
@@ -41,9 +41,9 @@
@Override
protected void addStyle(final String style) {
if (notStandAlone) {
- iconLabel.addStyleName(style);
+ // iconLabel.addStyleName(style);
button.addStyleName(style);
- layout();
+ // layout();
}
}
@@ -56,7 +56,7 @@
notStandAlone = !((MenuDescriptor) descriptor).isStandalone();
if (notStandAlone) {
button = new Button();
- button.setStylePrimaryName("oc-button");
+ // button.setStylePrimaryName("oc-button");
iconLabel = new IconLabel("");
final ImageResource rightIcon = ((MenuDescriptor) descriptor).getRightIcon();
if (rightIcon != null) {
Modified: trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreGinModule.java 2011-06-21 21:29:32 UTC (rev 1413)
+++ trunk/src/main/java/cc/kune/core/client/CoreGinModule.java 2011-06-22 16:39:13 UTC (rev 1414)
@@ -60,6 +60,7 @@
import cc.kune.core.client.notify.spiner.SpinerPresenter;
import cc.kune.core.client.notify.spiner.SpinerViewImpl;
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
+import cc.kune.core.client.registry.NewMenusForTypeIdsRegistry;
import cc.kune.core.client.sitebar.ErrorsDialog;
import cc.kune.core.client.sitebar.SiteUserOptions;
import cc.kune.core.client.sitebar.SiteUserOptionsPresenter;
@@ -195,6 +196,7 @@
eagle(TokenMatcher.class);
s(ActionRegistryByType.class);
s(ContentCapabilitiesRegistry.class);
+ s(NewMenusForTypeIdsRegistry.class);
eagle(CoreParts.class);
// SN
@@ -212,7 +214,7 @@
s(SitebarSignOutLink.class);
s(ErrorsDialog.class);
- eagle(XMLActionsParser.class);
+ s(XMLActionsParser.class);
}
}
Modified: trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java 2011-06-21 21:29:32 UTC (rev 1413)
+++ trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java 2011-06-22 16:39:13 UTC (rev 1414)
@@ -3,13 +3,19 @@
import java.util.HashMap;
import java.util.Map;
-import cc.kune.common.client.actions.AbstractExtendedAction;
+import cc.kune.common.client.actions.Action;
import cc.kune.common.client.actions.ActionEvent;
import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
+import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.common.client.errors.UIException;
+import cc.kune.common.client.notify.NotifyUser;
import cc.kune.core.client.actions.WaveExtension.Builder;
import cc.kune.core.client.errors.ErrorHandler;
+import cc.kune.core.client.registry.NewMenusForTypeIdsRegistry;
import cc.kune.core.client.rpcservices.ContentServiceAsync;
+import cc.kune.core.shared.dto.AccessRolDTO;
+import cc.kune.gspace.client.actions.ActionGroups;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
@@ -26,27 +32,40 @@
public class XMLActionsParser {
- public static class GadgetAction extends AbstractExtendedAction {
+ public static class GadgetAction extends RolAction {
private final Provider<ContentServiceAsync> contentService;
+ private final String gadgetName;
- @Inject
- public GadgetAction(final Provider<ContentServiceAsync> contentService) {
+ public GadgetAction(final Provider<ContentServiceAsync> contentService, final AccessRolDTO rok,
+ final boolean authNeeded, final String gadgetName, final String iconUrl) {
+ super(rok, authNeeded);
this.contentService = contentService;
+ this.gadgetName = gadgetName;
+ putValue(Action.SMALL_ICON, iconUrl);
}
@Override
public void actionPerformed(final ActionEvent event) {
+ NotifyUser.info("Created succesfully");
}
}
+ private final ActionRegistryByType actionRegistry;
+ private final Provider<ContentServiceAsync> contentService;
private final ErrorHandler errHandler;
private final Map<String, WaveExtension> extensionsMap;
+ private final NewMenusForTypeIdsRegistry newMenusRegistry;
@Inject
- public XMLActionsParser(final ErrorHandler errHandler) {
+ public XMLActionsParser(final ErrorHandler errHandler, final ActionRegistryByType actionRegistry,
+ final Provider<ContentServiceAsync> contentService,
+ final NewMenusForTypeIdsRegistry newMenusRegistry) {
this.errHandler = errHandler;
+ this.actionRegistry = actionRegistry;
+ this.contentService = contentService;
+ this.newMenusRegistry = newMenusRegistry;
extensionsMap = new HashMap<String, WaveExtension>();
// Based on:
@@ -81,7 +100,7 @@
private void parseXML(final String text) {
final Document parse = XMLParser.parse(text);
- final NodeList extensions = parse.getElementsByTagName("extensions");
+ final NodeList extensions = ((Element) parse.getElementsByTagName("extensions").item(0)).getElementsByTagName("extension");
for (int i = 0; i < extensions.getLength(); i++) {
final Element extension = (Element) extensions.item(i);
final Builder builder = new WaveExtension.Builder();
@@ -93,17 +112,40 @@
builder.installerUrl(get(extension, "installerUrl"));
extensionsMap.put(name, builder.build());
}
- final NodeList guiDescriptors = parse.getElementsByTagName("guiActionDescriptors");
+ final NodeList guiDescriptors = ((Element) parse.getElementsByTagName("guiActionDescriptors").item(0)).getElementsByTagName("guiActionDescriptor");
for (int i = 0; i < guiDescriptors.getLength(); i++) {
- final Element extension = (Element) extensions.item(i);
- final Provider<GuiActionDescrip> provider = new Provider<GuiActionDescrip>() {
- @Override
- public GuiActionDescrip get() {
- // TODO Auto-generated method stub
- new MenuItemDescriptor(null);
- return null;
+ final Element guiDescriptor = (Element) guiDescriptors.item(i);
+ if (Boolean.parseBoolean(get(guiDescriptor, "enabled"))) {
+ final String extensionName = get(guiDescriptor, "extensionName");
+ final WaveExtension extension = extensionsMap.get(extensionName);
+ if (extension == null) {
+ throw new UIException("Undefined extension " + extensionName);
}
- };
+ final String name = get(guiDescriptor, "name");
+ final String description = get(guiDescriptor, "description");
+ final AccessRolDTO rol = AccessRolDTO.valueOf(get(guiDescriptor, "rolRequired"));
+ final GadgetAction action = new GadgetAction(contentService, rol, Boolean.parseBoolean(get(
+ guiDescriptor, "authNeed")), extension.getGadgetUrl(), extension.getIconUrl());
+ final NodeList typeIds = ((Element) guiDescriptor.getElementsByTagName("typeIds").item(0)).getElementsByTagName("typeId");
+ final int length = typeIds.getLength();
+
+ for (int j = 0; j < length; j++) {
+ final Element typeIdElem = (Element) typeIds.item(j);
+ final String typeId = typeIdElem.getFirstChild().getNodeValue();
+ final MenuDescriptor menu = newMenusRegistry.get(typeId);
+ assert menu != null;
+ final Provider<GuiActionDescrip> menuItemProvider = new Provider<GuiActionDescrip>() {
+ @Override
+ public GuiActionDescrip get() {
+ final MenuItemDescriptor menuItem = new MenuItemDescriptor(action);
+ menuItem.withText(name).withToolTip(description);
+ menuItem.setParent(menu);
+ return menuItem;
+ }
+ };
+ actionRegistry.addAction(ActionGroups.VIEW, menuItemProvider, typeId);
+ }
+ }
}
}
}
Modified: trunk/src/main/java/cc/kune/core/client/registry/ContentCapabilitiesRegistry.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/registry/ContentCapabilitiesRegistry.java 2011-06-21 21:29:32 UTC (rev 1413)
+++ trunk/src/main/java/cc/kune/core/client/registry/ContentCapabilitiesRegistry.java 2011-06-22 16:39:13 UTC (rev 1414)
@@ -33,6 +33,7 @@
private final EmptyMessagesRegistry emptyMessagesRegistry;
private final IconsRegistry iconsRegistry;
private final LicensableRegistry licensable;
+ private final NewMenusForTypeIdsRegistry newMenus;
private final PublishModerableRegistry publishModerable;
private final RateableRegistry rateable;
private final RenamableRegistry renamable;
@@ -44,16 +45,17 @@
@Inject
public ContentCapabilitiesRegistry(final AuthorableRegistry authorableRegistry,
- final AclEditableRegistry aclEditableRegistry, final IconsRegistry iconsRegistry,
- final CanBeHomepageRegistry canBeHomepage, final ComentableRegistry comentable,
- final DragableRegistry dragable, final DropableRegistry dropable,
- final EmailSubscribeAbleRegistry emailSubscribeAble, final LicensableRegistry licensable,
- final PublishModerableRegistry publishModerable, final RateableRegistry rateable,
- final TageableRegistry tageable, final RenamableRegistry renamable,
- final TranslatableRegistry translatable, final VersionableRegistry versionable,
- final EmptyMessagesRegistry emptyMessagesRegistry, final XmppComentableRegistry xmppComentable,
- final XmppNotifyCapableRegistry xmppNotifyCapable) {
+ final NewMenusForTypeIdsRegistry newMenus, final AclEditableRegistry aclEditableRegistry,
+ final IconsRegistry iconsRegistry, final CanBeHomepageRegistry canBeHomepage,
+ final ComentableRegistry comentable, final DragableRegistry dragable,
+ final DropableRegistry dropable, final EmailSubscribeAbleRegistry emailSubscribeAble,
+ final LicensableRegistry licensable, final PublishModerableRegistry publishModerable,
+ final RateableRegistry rateable, final TageableRegistry tageable,
+ final RenamableRegistry renamable, final TranslatableRegistry translatable,
+ final VersionableRegistry versionable, final EmptyMessagesRegistry emptyMessagesRegistry,
+ final XmppComentableRegistry xmppComentable, final XmppNotifyCapableRegistry xmppNotifyCapable) {
this.authorable = authorableRegistry;
+ this.newMenus = newMenus;
this.aclEditable = aclEditableRegistry;
this.iconsRegistry = iconsRegistry;
this.canBeHomepage = canBeHomepage;
@@ -117,6 +119,10 @@
return licensable;
}
+ public NewMenusForTypeIdsRegistry getNewMenus() {
+ return newMenus;
+ }
+
public PublishModerableRegistry getPublishModerable() {
return publishModerable;
}
Added: trunk/src/main/java/cc/kune/core/client/registry/NewMenusForTypeIdsRegistry.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/registry/NewMenusForTypeIdsRegistry.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/registry/NewMenusForTypeIdsRegistry.java 2011-06-22 16:39:13 UTC (rev 1414)
@@ -0,0 +1,45 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ \*/
+package cc.kune.core.client.registry;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
+
+public class NewMenusForTypeIdsRegistry {
+ private final Map<String, MenuDescriptor> registry;
+
+ public NewMenusForTypeIdsRegistry() {
+ registry = new HashMap<String, MenuDescriptor>();
+ }
+
+ public MenuDescriptor get(final String typeId) {
+ return registry.get(typeId);
+ }
+
+ public int length() {
+ return registry.size();
+ }
+
+ public void register(final String contentTypeId, final MenuDescriptor menu) {
+ registry.put(contentTypeId, menu);
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/registry/NewMenusForTypeIdsRegistry.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/docs/client/DocsClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsClientTool.java 2011-06-21 21:29:32 UTC (rev 1413)
+++ trunk/src/main/java/cc/kune/docs/client/DocsClientTool.java 2011-06-22 16:39:13 UTC (rev 1414)
@@ -51,7 +51,6 @@
registerRenamableTypes(TYPE_DOCUMENT, TYPE_FOLDER, TYPE_UPLOADEDFILE);
registerTageableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE);
registerTranslatableTypes(TYPE_DOCUMENT, TYPE_FOLDER);
-
registerIcons();
}
Modified: trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java 2011-06-21 21:29:32 UTC (rev 1413)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java 2011-06-22 16:39:13 UTC (rev 1414)
@@ -26,6 +26,7 @@
import cc.kune.chat.client.actions.ChatAboutContentBtn;
import cc.kune.core.client.actions.ActionRegistryByType;
import cc.kune.core.client.i18n.I18nUITranslationService;
+import cc.kune.core.client.registry.NewMenusForTypeIdsRegistry;
import cc.kune.core.client.resources.CoreResources;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
@@ -46,6 +47,7 @@
final String[] containersNoRoot = { TYPE_FOLDER };
final String[] contents = { TYPE_DOCUMENT, TYPE_UPLOADEDFILE };
final String[] contentsModerated = { TYPE_DOCUMENT, TYPE_UPLOADEDFILE };
+ final String[] root = { TYPE_ROOT };
@Inject
public DocsClientActions(final I18nUITranslationService i18n, final Session session,
@@ -57,7 +59,8 @@
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<DelFolderMenuItem> delFolderMenuItem,
final Provider<ChatAboutContentBtn> chatAbout, final Provider<RefreshContentMenuItem> refresh,
- final Provider<SetAsHomePageMenuItem> setAsHomePage) {
+ final Provider<SetAsHomePageMenuItem> setAsHomePage, final DocsRootNewMenu rootNewMenu,
+ final NewMenusForTypeIdsRegistry newMenusRegistry, final DocsFolderNewMenu folderNewMenu) {
super(session, stateManager, i18n, registry);
actionsRegistry.addAction(ActionGroups.VIEW, optionsMenuContent, all);
actionsRegistry.addAction(ActionGroups.VIEW, refresh, all);
@@ -72,6 +75,10 @@
actionsRegistry.addAction(ActionGroups.MENUITEM, delContentMenuItem, contents);
actionsRegistry.addAction(ActionGroups.MENUITEM, delFolderMenuItem, containersNoRoot);
actionsRegistry.addAction(ActionGroups.MENUITEM, setAsHomePage, contents);
+ newMenusRegistry.register(TYPE_FOLDER, folderNewMenu.get());
+ newMenusRegistry.register(TYPE_ROOT, rootNewMenu.get());
+ actionsRegistry.addAction(ActionGroups.VIEW, folderNewMenu, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.VIEW, rootNewMenu, root);
}
@Override
Added: trunk/src/main/java/cc/kune/docs/client/actions/DocsFolderNewMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DocsFolderNewMenu.java (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DocsFolderNewMenu.java 2011-06-22 16:39:13 UTC (rev 1414)
@@ -0,0 +1,15 @@
+package cc.kune.docs.client.actions;
+
+import cc.kune.gspace.client.actions.AbstractNewMenu;
+import cc.kune.gspace.client.actions.NewMenusProvider;
+
+import com.google.inject.Inject;
+
+public class DocsFolderNewMenu extends NewMenusProvider {
+
+ @Inject
+ public DocsFolderNewMenu(final AbstractNewMenu menu) {
+ super(menu);
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/docs/client/actions/DocsFolderNewMenu.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/docs/client/actions/DocsRootNewMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DocsRootNewMenu.java (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DocsRootNewMenu.java 2011-06-22 16:39:13 UTC (rev 1414)
@@ -0,0 +1,15 @@
+package cc.kune.docs.client.actions;
+
+import cc.kune.gspace.client.actions.AbstractNewMenu;
+import cc.kune.gspace.client.actions.NewMenusProvider;
+
+import com.google.inject.Inject;
+
+public class DocsRootNewMenu extends NewMenusProvider {
+
+ @Inject
+ public DocsRootNewMenu(final AbstractNewMenu menu) {
+ super(menu);
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/docs/client/actions/DocsRootNewMenu.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/gspace/client/actions/AbstractNewMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/AbstractNewMenu.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/AbstractNewMenu.java 2011-06-22 16:39:13 UTC (rev 1414)
@@ -0,0 +1,47 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.actions;
+
+import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.UserSignInOrSignOutEvent;
+import cc.kune.core.client.state.UserSignInOrSignOutEvent.UserSignInOrSignOutHandler;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+
+public class AbstractNewMenu extends MenuDescriptor {
+
+ @Inject
+ public AbstractNewMenu(final CoreResources res, final I18nTranslationService i18n,
+ final Session session) {
+ super();
+ this.withIcon(res.arrowdownsitebar()).withStyles("k-button, k-btn, k-5corners, k-def-docbtn, k-fr").withText(
+ "New");
+ session.onUserSignInOrSignOut(true, new UserSignInOrSignOutHandler() {
+ @Override
+ public void onUserSignInOrSignOut(final UserSignInOrSignOutEvent event) {
+ AbstractNewMenu.this.setVisible(event.isLogged());
+ }
+ });
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/actions/AbstractNewMenu.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java 2011-06-21 21:29:32 UTC (rev 1413)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java 2011-06-22 16:39:13 UTC (rev 1414)
@@ -20,8 +20,6 @@
package cc.kune.gspace.client.actions;
import cc.kune.common.client.actions.ActionEvent;
-import cc.kune.common.client.actions.KeyStroke;
-import cc.kune.common.client.actions.Shortcut;
import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
import cc.kune.common.client.notify.NotifyUser;
import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
@@ -96,10 +94,10 @@
// The name given to this new content
action.putValue(NEW_NAME, newName);
action.putValue(ID, id);
- final KeyStroke shortcut = Shortcut.getShortcut(false, true, false, false, Character.valueOf('N'));
- shorcutReg.put(shortcut, action);
- this.withText(title).withToolTip(tooltip).withIcon(icon).withShortcut(shortcut).withStyles(
- "k-def-docbtn, k-fr");
+ // final KeyStroke shortcut = Shortcut.getShortcut(false, true, false,
+ // false, Character.valueOf('N'));
+ // shorcutReg.put(shortcut, action);
+ this.withText(title).withToolTip(tooltip).withIcon(icon).withStyles("k-def-docbtn, k-fr");
}
}
Added: trunk/src/main/java/cc/kune/gspace/client/actions/NewMenusProvider.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewMenusProvider.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewMenusProvider.java 2011-06-22 16:39:13 UTC (rev 1414)
@@ -0,0 +1,20 @@
+package cc.kune.gspace.client.actions;
+
+import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
+
+import com.google.inject.Provider;
+
+public abstract class NewMenusProvider implements Provider<MenuDescriptor> {
+
+ private final AbstractNewMenu menu;
+
+ public NewMenusProvider(final AbstractNewMenu menu) {
+ this.menu = menu;
+ }
+
+ @Override
+ public MenuDescriptor get() {
+ return menu;
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/actions/NewMenusProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/gspace/client/tool/FoldableAbstractClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/FoldableAbstractClientTool.java 2011-06-21 21:29:32 UTC (rev 1413)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/FoldableAbstractClientTool.java 2011-06-22 16:39:13 UTC (rev 1414)
@@ -19,6 +19,7 @@
*/
package cc.kune.gspace.client.tool;
+import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
import cc.kune.core.shared.dto.BasicMimeTypeDTO;
import cc.kune.gspace.client.tool.selector.ToolSelector;
@@ -74,6 +75,10 @@
contentCapabilitiesRegistry.getLicensable().register(typeIds);
}
+ public void registerNewMenu(final String typeId, final MenuDescriptor menu) {
+ contentCapabilitiesRegistry.getNewMenus().register(typeId, menu);
+ }
+
protected void registerPublishModerableTypes(final String... typeIds) {
contentCapabilitiesRegistry.getPublishModerable().register(typeIds);
}
Modified: trunk/src/main/webapp/others/kune-wave-extensions.xml
===================================================================
--- trunk/src/main/webapp/others/kune-wave-extensions.xml 2011-06-21 21:29:32 UTC (rev 1413)
+++ trunk/src/main/webapp/others/kune-wave-extensions.xml 2011-06-22 16:39:13 UTC (rev 1414)
@@ -7,6 +7,15 @@
<extensions>
<extension>
+ <name>pollo</name>
+ <installerUrl>http://wavepollo.appspot.com/pollo.xml
+ </installerUrl>
+ <gadgetUrl>http://wavepollo.appspot.com/wavepollo/com.appspot.wavepollo.client.PolloWa…
+ </gadgetUrl>
+ <iconUrl>https://flinz-pollo.appspot.com/document_graph.png</iconUrl>
+ <iconCss></iconCss>
+ </extension>
+ <extension>
<name>massmob</name>
<installerUrl>http://mass-mob.appspot.com/massmob/massmob-extension.xml
</installerUrl>
@@ -24,13 +33,34 @@
<guiActionDescriptor>
<extensionName>massmob</extensionName>
- <name>Create a meeting</name>
+ <name>New meeting</name>
<description>Call and speed-up of events as meeting, smartmobs,
flashmobs, protest demonstrations, etc.</description>
<enabled>true</enabled>
<typeIds>
<typeId>docs.folder</typeId>
<typeId>docs.root</typeId>
+ <typeId>blogs.blog</typeId>
+ </typeIds>
+ <name></name>
+ <location>
+ <rol>
+ <!-- Administrator, Editor, Viewer -->
+ <rolRequired>Editor</rolRequired>
+ <authNeed>true</authNeed>
+ </rol>
+ </location>
+ <!-- only for new waves: anyone, onlymembers, onlyadmins, ask -->
+ <participants>ask</participants>
+ </guiActionDescriptor>
+
+ <guiActionDescriptor>
+ <extensionName>pollo</extensionName>
+ <name>New poll</name>
+ <description>Make some poll (allow single and multiple polls))</description>
+ <enabled>true</enabled>
+ <typeIds>
+ <typeId>docs.folder</typeId>
<typeId>docs.root</typeId>
<typeId>blogs.blog</typeId>
</typeIds>
@@ -51,7 +81,7 @@
<name>Add a meeting</name>
<description>Call and speed-up of events as meeting, smartmobs,
flashmobs, protest demonstrations, etc.</description>
- <enabled>true</enabled>
+ <enabled>false</enabled>
<typeIds>
<typeId>docs.doc</typeId>
</typeIds>
1
0
r1413 - in trunk/src/main: java/cc/kune/core/server/manager/file java/cc/kune/gspace/client java/cc/kune/gspace/client/options/license java/cc/kune/gspace/client/options/logo java/cc/kune/gspace/client/options/style java/cc/kune/gspace/client/options/tools java/cc/kune/gspace/client/themes resources
by Vicente J. Ruiz Jurado 21 Jun '11
by Vicente J. Ruiz Jurado 21 Jun '11
21 Jun '11
Author: vjrj_
Date: 2011-06-21 23:29:32 +0200 (Tue, 21 Jun 2011)
New Revision: 1413
Added:
trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptDefLicense.java
trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptDefLicensePanel.java
trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptDefLicensePresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptDefLicenseView.java
trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicense.java
trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicensePanel.java
trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicensePresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicenseView.java
trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicense.java
trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicensePanel.java
trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicensePresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicenseView.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogo.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoView.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptUploadButton.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogo.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoView.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogo.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoView.java
trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStyle.java
trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStylePanel.java
trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStylePresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStyleView.java
trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStyle.java
trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStylePanel.java
trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStylePresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStyleView.java
trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStyle.java
trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStylePanel.java
trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStylePresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStyleView.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptTools.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptToolsPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptToolsPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptToolsView.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptTools.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptToolsPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptToolsPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptToolsView.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptTools.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptToolsPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptToolsPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptToolsView.java
Removed:
trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicense.java
trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicensePanel.java
trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicensePresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicenseView.java
trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptionsDefLicense.java
trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptionsDefLicensePanel.java
trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptionsDefLicensePresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptionsDefLicenseView.java
trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptionsDefLicense.java
trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptionsDefLicensePanel.java
trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptionsDefLicensePresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptionsDefLicenseView.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogo.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoView.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsUploadButton.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogo.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogoPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogoPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogoView.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogo.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoView.java
trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConf.java
trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfView.java
trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConf.java
trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfView.java
trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConf.java
trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfView.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConf.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConfPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConfPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConfView.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptionsToolsConf.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptionsToolsConfPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptionsToolsConfPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptionsToolsConfView.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptionsToolsConf.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptionsToolsConfPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptionsToolsConfPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptionsToolsConfView.java
Modified:
trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundUploadManager.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityUploaderForm.java
trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeSelectorPresenter.java
trunk/src/main/resources/kune.properties
Log:
Background management (done)
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundUploadManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundUploadManager.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundUploadManager.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -96,8 +96,8 @@
groupManager.setGroupBackgroundImage(group, filenameUTF8, mimeTypeS);
} catch (final Exception e) {
- return i18n.t("Error uploading file");
+ return i18n.t("Error uploading background");
}
- return i18n.t("Success uploading");
+ return i18n.t("Backgroup changed");
}
}
Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -47,38 +47,38 @@
import cc.kune.gspace.client.options.UserOptionsPanel;
import cc.kune.gspace.client.options.UserOptionsPresenter;
import cc.kune.gspace.client.options.UserOptionsView;
-import cc.kune.gspace.client.options.license.GroupOptionsDefLicense;
-import cc.kune.gspace.client.options.license.GroupOptionsDefLicensePanel;
-import cc.kune.gspace.client.options.license.GroupOptionsDefLicensePresenter;
-import cc.kune.gspace.client.options.license.GroupOptionsDefLicenseView;
-import cc.kune.gspace.client.options.license.UserOptionsDefLicense;
-import cc.kune.gspace.client.options.license.UserOptionsDefLicensePanel;
-import cc.kune.gspace.client.options.license.UserOptionsDefLicensePresenter;
-import cc.kune.gspace.client.options.license.UserOptionsDefLicenseView;
-import cc.kune.gspace.client.options.logo.GroupOptionsLogo;
-import cc.kune.gspace.client.options.logo.GroupOptionsLogoPanel;
-import cc.kune.gspace.client.options.logo.GroupOptionsLogoPresenter;
-import cc.kune.gspace.client.options.logo.GroupOptionsLogoView;
-import cc.kune.gspace.client.options.logo.UserOptionsLogo;
-import cc.kune.gspace.client.options.logo.UserOptionsLogoPanel;
-import cc.kune.gspace.client.options.logo.UserOptionsLogoPresenter;
-import cc.kune.gspace.client.options.logo.UserOptionsLogoView;
-import cc.kune.gspace.client.options.style.GroupOptionsStyleConf;
-import cc.kune.gspace.client.options.style.GroupOptionsStyleConfPanel;
-import cc.kune.gspace.client.options.style.GroupOptionsStyleConfPresenter;
-import cc.kune.gspace.client.options.style.GroupOptionsStyleConfView;
-import cc.kune.gspace.client.options.style.UserOptionsStyleConf;
-import cc.kune.gspace.client.options.style.UserOptionsStyleConfPanel;
-import cc.kune.gspace.client.options.style.UserOptionsStyleConfPresenter;
-import cc.kune.gspace.client.options.style.UserOptionsStyleConfView;
-import cc.kune.gspace.client.options.tools.GroupOptionsToolsConf;
-import cc.kune.gspace.client.options.tools.GroupOptionsToolsConfPanel;
-import cc.kune.gspace.client.options.tools.GroupOptionsToolsConfPresenter;
-import cc.kune.gspace.client.options.tools.GroupOptionsToolsConfView;
-import cc.kune.gspace.client.options.tools.UserOptionsToolsConf;
-import cc.kune.gspace.client.options.tools.UserOptionsToolsConfPanel;
-import cc.kune.gspace.client.options.tools.UserOptionsToolsConfPresenter;
-import cc.kune.gspace.client.options.tools.UserOptionsToolsConfView;
+import cc.kune.gspace.client.options.license.GroupOptDefLicense;
+import cc.kune.gspace.client.options.license.GroupOptDefLicensePanel;
+import cc.kune.gspace.client.options.license.GroupOptDefLicensePresenter;
+import cc.kune.gspace.client.options.license.GroupOptDefLicenseView;
+import cc.kune.gspace.client.options.license.UserOptDefLicense;
+import cc.kune.gspace.client.options.license.UserOptDefLicensePanel;
+import cc.kune.gspace.client.options.license.UserOptDefLicensePresenter;
+import cc.kune.gspace.client.options.license.UserOptDefLicenseView;
+import cc.kune.gspace.client.options.logo.GroupOptLogo;
+import cc.kune.gspace.client.options.logo.GroupOptLogoPanel;
+import cc.kune.gspace.client.options.logo.GroupOptLogoPresenter;
+import cc.kune.gspace.client.options.logo.GroupOptLogoView;
+import cc.kune.gspace.client.options.logo.UserOptLogo;
+import cc.kune.gspace.client.options.logo.UserOptLogoPanel;
+import cc.kune.gspace.client.options.logo.UserOptLogoPresenter;
+import cc.kune.gspace.client.options.logo.UserOptLogoView;
+import cc.kune.gspace.client.options.style.GroupOptStyle;
+import cc.kune.gspace.client.options.style.GroupOptStylePanel;
+import cc.kune.gspace.client.options.style.GroupOptStylePresenter;
+import cc.kune.gspace.client.options.style.GroupOptStyleView;
+import cc.kune.gspace.client.options.style.UserOptStyle;
+import cc.kune.gspace.client.options.style.UserOptStylePanel;
+import cc.kune.gspace.client.options.style.UserOptStylePresenter;
+import cc.kune.gspace.client.options.style.UserOptStyleView;
+import cc.kune.gspace.client.options.tools.GroupOptTools;
+import cc.kune.gspace.client.options.tools.GroupOptToolsPanel;
+import cc.kune.gspace.client.options.tools.GroupOptToolsPresenter;
+import cc.kune.gspace.client.options.tools.GroupOptToolsView;
+import cc.kune.gspace.client.options.tools.UserOptTools;
+import cc.kune.gspace.client.options.tools.UserOptToolsPanel;
+import cc.kune.gspace.client.options.tools.UserOptToolsPresenter;
+import cc.kune.gspace.client.options.tools.UserOptToolsView;
import cc.kune.gspace.client.style.GSpaceBackManager;
import cc.kune.gspace.client.style.GSpaceBackManagerImpl;
import cc.kune.gspace.client.tags.TagsSummaryPanel;
@@ -134,23 +134,23 @@
s(UserOptionsCollection.class);
s(GroupOptionsCollection.class);
- s(GroupOptionsDefLicense.class, GroupOptionsDefLicensePresenter.class);
- s(GroupOptionsDefLicenseView.class, GroupOptionsDefLicensePanel.class);
- s(GroupOptionsStyleConf.class, GroupOptionsStyleConfPresenter.class);
- s(GroupOptionsStyleConfView.class, GroupOptionsStyleConfPanel.class);
- s(GroupOptionsLogo.class, GroupOptionsLogoPresenter.class);
- s(GroupOptionsLogoView.class, GroupOptionsLogoPanel.class);
- s(GroupOptionsToolsConf.class, GroupOptionsToolsConfPresenter.class);
- s(GroupOptionsToolsConfView.class, GroupOptionsToolsConfPanel.class);
+ s(GroupOptDefLicense.class, GroupOptDefLicensePresenter.class);
+ s(GroupOptDefLicenseView.class, GroupOptDefLicensePanel.class);
+ s(GroupOptStyle.class, GroupOptStylePresenter.class);
+ s(GroupOptStyleView.class, GroupOptStylePanel.class);
+ s(GroupOptLogo.class, GroupOptLogoPresenter.class);
+ s(GroupOptLogoView.class, GroupOptLogoPanel.class);
+ s(GroupOptTools.class, GroupOptToolsPresenter.class);
+ s(GroupOptToolsView.class, GroupOptToolsPanel.class);
- s(UserOptionsDefLicense.class, UserOptionsDefLicensePresenter.class);
- s(UserOptionsDefLicenseView.class, UserOptionsDefLicensePanel.class);
- s(UserOptionsStyleConf.class, UserOptionsStyleConfPresenter.class);
- s(UserOptionsStyleConfView.class, UserOptionsStyleConfPanel.class);
- s(UserOptionsLogo.class, UserOptionsLogoPresenter.class);
- s(UserOptionsLogoView.class, UserOptionsLogoPanel.class);
- s(UserOptionsToolsConf.class, UserOptionsToolsConfPresenter.class);
- s(UserOptionsToolsConfView.class, UserOptionsToolsConfPanel.class);
+ s(UserOptDefLicense.class, UserOptDefLicensePresenter.class);
+ s(UserOptDefLicenseView.class, UserOptDefLicensePanel.class);
+ s(UserOptStyle.class, UserOptStylePresenter.class);
+ s(UserOptStyleView.class, UserOptStylePanel.class);
+ s(UserOptLogo.class, UserOptLogoPresenter.class);
+ s(UserOptLogoView.class, UserOptLogoPanel.class);
+ s(UserOptTools.class, UserOptToolsPresenter.class);
+ s(UserOptToolsView.class, UserOptToolsPanel.class);
s(GSpaceBackManager.class, GSpaceBackManagerImpl.class);
s(GSpaceThemeSelectorPresenter.class);
Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -27,14 +27,14 @@
import cc.kune.gspace.client.options.GroupOptionsCollection;
import cc.kune.gspace.client.options.UserOptions;
import cc.kune.gspace.client.options.UserOptionsCollection;
-import cc.kune.gspace.client.options.license.GroupOptionsDefLicense;
-import cc.kune.gspace.client.options.license.UserOptionsDefLicense;
-import cc.kune.gspace.client.options.logo.GroupOptionsLogo;
-import cc.kune.gspace.client.options.logo.UserOptionsLogo;
-import cc.kune.gspace.client.options.style.GroupOptionsStyleConf;
-import cc.kune.gspace.client.options.style.UserOptionsStyleConf;
-import cc.kune.gspace.client.options.tools.GroupOptionsToolsConf;
-import cc.kune.gspace.client.options.tools.UserOptionsToolsConf;
+import cc.kune.gspace.client.options.license.GroupOptDefLicense;
+import cc.kune.gspace.client.options.license.UserOptDefLicense;
+import cc.kune.gspace.client.options.logo.GroupOptLogo;
+import cc.kune.gspace.client.options.logo.UserOptLogo;
+import cc.kune.gspace.client.options.style.GroupOptStyle;
+import cc.kune.gspace.client.options.style.UserOptStyle;
+import cc.kune.gspace.client.options.tools.GroupOptTools;
+import cc.kune.gspace.client.options.tools.UserOptTools;
import cc.kune.gspace.client.tags.TagsSummaryPresenter;
import cc.kune.gspace.client.themes.GSpaceThemeManager;
import cc.kune.gspace.client.tool.selector.ToolSelector;
@@ -55,11 +55,11 @@
final Provider<NoHomePageViewer> noHome, final Provider<ContentViewerPresenter> docsViewer,
final Provider<FolderViewerPresenter> folderViewer, final Provider<GroupOptions> go,
final Provider<UserOptions> uo, final Provider<GroupOptionsCollection> goc,
- final Provider<UserOptionsCollection> uoc, final Provider<GroupOptionsDefLicense> gdl,
- final Provider<GroupOptionsStyleConf> gps, final Provider<GroupOptionsLogo> gl,
- final Provider<GroupOptionsToolsConf> gtc, final Provider<UserOptionsDefLicense> udl,
- final Provider<UserOptionsStyleConf> ups, final Provider<UserOptionsLogo> ul,
- final Provider<UserOptionsToolsConf> utc, final Provider<SitebarSearchPresenter> siteSearch) {
+ final Provider<UserOptionsCollection> uoc, final Provider<GroupOptDefLicense> gdl,
+ final Provider<GroupOptStyle> gps, final Provider<GroupOptLogo> gl,
+ final Provider<GroupOptTools> gtc, final Provider<UserOptDefLicense> udl,
+ final Provider<UserOptStyle> ups, final Provider<UserOptLogo> ul,
+ final Provider<UserOptTools> utc, final Provider<SitebarSearchPresenter> siteSearch) {
session.onAppStart(true, new AppStartHandler() {
@Override
Copied: trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptDefLicense.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicense.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptDefLicense.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptDefLicense.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,24 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.license;
+
+public interface EntityOptDefLicense {
+
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptDefLicensePanel.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicensePanel.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptDefLicensePanel.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptDefLicensePanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,91 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.license;
+
+import cc.kune.common.client.tooltip.Tooltip;
+import cc.kune.common.client.ui.IconLabel;
+import cc.kune.common.client.ui.KuneWindowUtils;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.dto.LicenseDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.options.EntityOptionsView;
+
+import com.google.gwt.event.dom.client.HasClickHandlers;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.IsWidget;
+import com.google.gwt.user.client.ui.Label;
+
+public class EntityOptDefLicensePanel extends Composite implements EntityOptDefLicenseView {
+
+ private final Button change;
+ private final Image licenseImage;
+ private final IconLabel tabTitle;
+
+ public EntityOptDefLicensePanel(final I18nTranslationService i18n, final CoreResources res) {
+ tabTitle = new IconLabel(res.copyleft(), i18n.t("License"));
+ final FlowPanel flow = new FlowPanel();
+ final Label intro = new Label();
+ intro.setWordWrap(true);
+ intro.setText(i18n.t("This is the default license for all the contents of this group (you can also select another different license per content):"));
+ intro.addStyleName("kune-Margin-20-tb");
+ flow.add(intro);
+ licenseImage = new Image();
+ flow.add(licenseImage);
+ licenseImage.addStyleName("kune-pointer");
+ licenseImage.addStyleName("kune-Margin-10-r");
+ change = new Button(i18n.t("Change"));
+ change.addStyleName("k-button");
+ flow.add(change);
+ initWidget(flow);
+ flow.setHeight(String.valueOf(EntityOptionsView.HEIGHT) + "px");
+ flow.setWidth(String.valueOf(EntityOptionsView.WIDTH) + "px");
+ flow.addStyleName("k-overflow-y-auto");
+ flow.addStyleName("k-tab-panel");
+ }
+
+ @Override
+ public HasClickHandlers getChange() {
+ return change;
+ }
+
+ @Override
+ public HasClickHandlers getLicenseImage() {
+ return licenseImage;
+ }
+
+ @Override
+ public IsWidget getTabTitle() {
+ return tabTitle;
+ }
+
+ @Override
+ public void openWindow(final String url) {
+ KuneWindowUtils.open(url);
+ }
+
+ @Override
+ public void setLicense(final LicenseDTO defaultLicense) {
+ licenseImage.setUrl(defaultLicense.getImageUrl());
+ Tooltip.to(licenseImage, defaultLicense.getLongName());
+ }
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptDefLicensePresenter.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicensePresenter.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptDefLicensePresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptDefLicensePresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,113 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.license;
+
+import cc.kune.common.client.utils.SimpleResponseCallback;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.LicenseDTO;
+import cc.kune.gspace.client.licensewizard.LicenseChangeAction;
+import cc.kune.gspace.client.licensewizard.LicenseChooseCallback;
+import cc.kune.gspace.client.licensewizard.LicenseWizard;
+import cc.kune.gspace.client.options.EntityOptions;
+
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.ui.IsWidget;
+import com.google.inject.Provider;
+
+public abstract class EntityOptDefLicensePresenter {
+
+ private final EntityOptions entityOptions;
+ private final Provider<LicenseChangeAction> licChangeAction;
+ private final Provider<LicenseWizard> licenseWizard;
+ protected final Session session;
+ private EntityOptDefLicenseView view;
+
+ public EntityOptDefLicensePresenter(final EntityOptions entityOptions, final Session session,
+ final Provider<LicenseWizard> licenseWizard, final Provider<LicenseChangeAction> licChangeAction) {
+ this.entityOptions = entityOptions;
+ this.session = session;
+ this.licenseWizard = licenseWizard;
+ this.licChangeAction = licChangeAction;
+ }
+
+ protected abstract boolean applicable();
+
+ protected abstract LicenseDTO getCurrentDefLicense();
+
+ protected abstract StateToken getOperationToken();
+
+ public IsWidget getView() {
+ return view;
+ }
+
+ protected void init(final EntityOptDefLicenseView view) {
+ this.view = view;
+ entityOptions.addTab(view, view.getTabTitle());
+ setState();
+ view.getChange().addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(final ClickEvent event) {
+ onChange();
+ }
+ });
+ view.getLicenseImage().addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(final ClickEvent event) {
+ onLicenseClick();
+ }
+ });
+ }
+
+ public void onChange() {
+ licenseWizard.get().start(new LicenseChooseCallback() {
+
+ @Override
+ public void onSelected(final LicenseDTO license) {
+ licChangeAction.get().changeLicense(getOperationToken(), license, new SimpleResponseCallback() {
+
+ @Override
+ public void onCancel() {
+ }
+
+ @Override
+ public void onSuccess() {
+ setLicense(license);
+ }
+ });
+ }
+ });
+ }
+
+ public void onLicenseClick() {
+ view.openWindow(getCurrentDefLicense().getUrl());
+ }
+
+ private void setLicense(final LicenseDTO license) {
+ view.setLicense(license);
+ }
+
+ protected void setState() {
+ if (applicable()) {
+ setLicense(getCurrentDefLicense());
+ }
+ }
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptDefLicenseView.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicenseView.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptDefLicenseView.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptDefLicenseView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,37 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.license;
+
+import cc.kune.core.shared.dto.LicenseDTO;
+import cc.kune.gspace.client.options.EntityOptionsTabView;
+
+import com.google.gwt.event.dom.client.HasClickHandlers;
+
+public interface EntityOptDefLicenseView extends EntityOptionsTabView {
+
+ HasClickHandlers getChange();
+
+ HasClickHandlers getLicenseImage();
+
+ void openWindow(String url);
+
+ void setLicense(LicenseDTO defaultLicense);
+
+}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicense.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicense.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicense.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.license;
-
-public interface EntityOptionsDefLicense {
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicensePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicensePanel.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicensePanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,91 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.license;
-
-import cc.kune.common.client.tooltip.Tooltip;
-import cc.kune.common.client.ui.IconLabel;
-import cc.kune.common.client.ui.KuneWindowUtils;
-import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.shared.dto.LicenseDTO;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.options.EntityOptionsView;
-
-import com.google.gwt.event.dom.client.HasClickHandlers;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.IsWidget;
-import com.google.gwt.user.client.ui.Label;
-
-public class EntityOptionsDefLicensePanel extends Composite implements EntityOptionsDefLicenseView {
-
- private final Button change;
- private final Image licenseImage;
- private final IconLabel tabTitle;
-
- public EntityOptionsDefLicensePanel(final I18nTranslationService i18n, final CoreResources res) {
- tabTitle = new IconLabel(res.copyleft(), i18n.t("License"));
- final FlowPanel flow = new FlowPanel();
- final Label intro = new Label();
- intro.setWordWrap(true);
- intro.setText(i18n.t("This is the default license for all the contents of this group (you can also select another different license per content):"));
- intro.addStyleName("kune-Margin-20-tb");
- flow.add(intro);
- licenseImage = new Image();
- flow.add(licenseImage);
- licenseImage.addStyleName("kune-pointer");
- licenseImage.addStyleName("kune-Margin-10-r");
- change = new Button(i18n.t("Change"));
- change.addStyleName("k-button");
- flow.add(change);
- initWidget(flow);
- flow.setHeight(String.valueOf(EntityOptionsView.HEIGHT) + "px");
- flow.setWidth(String.valueOf(EntityOptionsView.WIDTH) + "px");
- flow.addStyleName("k-overflow-y-auto");
- flow.addStyleName("k-tab-panel");
- }
-
- @Override
- public HasClickHandlers getChange() {
- return change;
- }
-
- @Override
- public HasClickHandlers getLicenseImage() {
- return licenseImage;
- }
-
- @Override
- public IsWidget getTabTitle() {
- return tabTitle;
- }
-
- @Override
- public void openWindow(final String url) {
- KuneWindowUtils.open(url);
- }
-
- @Override
- public void setLicense(final LicenseDTO defaultLicense) {
- licenseImage.setUrl(defaultLicense.getImageUrl());
- Tooltip.to(licenseImage, defaultLicense.getLongName());
- }
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicensePresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicensePresenter.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicensePresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,113 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.license;
-
-import cc.kune.common.client.utils.SimpleResponseCallback;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.LicenseDTO;
-import cc.kune.gspace.client.licensewizard.LicenseChangeAction;
-import cc.kune.gspace.client.licensewizard.LicenseChooseCallback;
-import cc.kune.gspace.client.licensewizard.LicenseWizard;
-import cc.kune.gspace.client.options.EntityOptions;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.user.client.ui.IsWidget;
-import com.google.inject.Provider;
-
-public abstract class EntityOptionsDefLicensePresenter {
-
- private final EntityOptions entityOptions;
- private final Provider<LicenseChangeAction> licChangeAction;
- private final Provider<LicenseWizard> licenseWizard;
- protected final Session session;
- private EntityOptionsDefLicenseView view;
-
- public EntityOptionsDefLicensePresenter(final EntityOptions entityOptions, final Session session,
- final Provider<LicenseWizard> licenseWizard, final Provider<LicenseChangeAction> licChangeAction) {
- this.entityOptions = entityOptions;
- this.session = session;
- this.licenseWizard = licenseWizard;
- this.licChangeAction = licChangeAction;
- }
-
- protected abstract boolean applicable();
-
- protected abstract LicenseDTO getCurrentDefLicense();
-
- protected abstract StateToken getOperationToken();
-
- public IsWidget getView() {
- return view;
- }
-
- protected void init(final EntityOptionsDefLicenseView view) {
- this.view = view;
- entityOptions.addTab(view, view.getTabTitle());
- setState();
- view.getChange().addClickHandler(new ClickHandler() {
- @Override
- public void onClick(final ClickEvent event) {
- onChange();
- }
- });
- view.getLicenseImage().addClickHandler(new ClickHandler() {
- @Override
- public void onClick(final ClickEvent event) {
- onLicenseClick();
- }
- });
- }
-
- public void onChange() {
- licenseWizard.get().start(new LicenseChooseCallback() {
-
- @Override
- public void onSelected(final LicenseDTO license) {
- licChangeAction.get().changeLicense(getOperationToken(), license, new SimpleResponseCallback() {
-
- @Override
- public void onCancel() {
- }
-
- @Override
- public void onSuccess() {
- setLicense(license);
- }
- });
- }
- });
- }
-
- public void onLicenseClick() {
- view.openWindow(getCurrentDefLicense().getUrl());
- }
-
- private void setLicense(final LicenseDTO license) {
- view.setLicense(license);
- }
-
- protected void setState() {
- if (applicable()) {
- setLicense(getCurrentDefLicense());
- }
- }
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicenseView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicenseView.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/EntityOptionsDefLicenseView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,37 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.license;
-
-import cc.kune.core.shared.dto.LicenseDTO;
-import cc.kune.gspace.client.options.EntityOptionsTabView;
-
-import com.google.gwt.event.dom.client.HasClickHandlers;
-
-public interface EntityOptionsDefLicenseView extends EntityOptionsTabView {
-
- HasClickHandlers getChange();
-
- HasClickHandlers getLicenseImage();
-
- void openWindow(String url);
-
- void setLicense(LicenseDTO defaultLicense);
-
-}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicense.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptionsDefLicense.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicense.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicense.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,24 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.license;
+
+public interface GroupOptDefLicense extends EntityOptDefLicense {
+
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicensePanel.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptionsDefLicensePanel.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicensePanel.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicensePanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,34 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.license;
+
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+
+public class GroupOptDefLicensePanel extends EntityOptDefLicensePanel implements GroupOptDefLicenseView {
+
+ @Inject
+ public GroupOptDefLicensePanel(final I18nTranslationService i18n, final CoreResources res) {
+ super(i18n, res);
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicensePanel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicensePresenter.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptionsDefLicensePresenter.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicensePresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicensePresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,66 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.license;
+
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.client.state.UserSignInEvent;
+import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.LicenseDTO;
+import cc.kune.gspace.client.licensewizard.LicenseChangeAction;
+import cc.kune.gspace.client.licensewizard.LicenseWizard;
+import cc.kune.gspace.client.options.GroupOptions;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class GroupOptDefLicensePresenter extends EntityOptDefLicensePresenter implements
+ GroupOptDefLicense {
+
+ @Inject
+ public GroupOptDefLicensePresenter(final GroupOptions entityOptions,
+ final StateManager stateManager, final Session session, final GroupOptDefLicenseView view,
+ final Provider<LicenseWizard> licenseWizard, final Provider<LicenseChangeAction> licChangeAction) {
+ super(entityOptions, session, licenseWizard, licChangeAction);
+ init(view);
+ session.onUserSignIn(true, new UserSignInHandler() {
+ @Override
+ public void onUserSignIn(final UserSignInEvent event) {
+ setState();
+ }
+ });
+ }
+
+ @Override
+ protected boolean applicable() {
+ return session.isCurrentStateAGroup();
+ }
+
+ @Override
+ protected LicenseDTO getCurrentDefLicense() {
+ return session.getCurrentState().getGroup().getDefaultLicense();
+ }
+
+ @Override
+ protected StateToken getOperationToken() {
+ return session.getCurrentStateToken();
+ }
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicenseView.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptionsDefLicenseView.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicenseView.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicenseView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,24 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.license;
+
+public interface GroupOptDefLicenseView extends EntityOptDefLicenseView {
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicenseView.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptionsDefLicense.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptionsDefLicense.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptionsDefLicense.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.license;
-
-public interface GroupOptionsDefLicense extends EntityOptionsDefLicense {
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptionsDefLicensePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptionsDefLicensePanel.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptionsDefLicensePanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,34 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.license;
-
-import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.google.inject.Inject;
-
-public class GroupOptionsDefLicensePanel extends EntityOptionsDefLicensePanel implements GroupOptionsDefLicenseView {
-
- @Inject
- public GroupOptionsDefLicensePanel(final I18nTranslationService i18n, final CoreResources res) {
- super(i18n, res);
- }
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptionsDefLicensePresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptionsDefLicensePresenter.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptionsDefLicensePresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,66 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.license;
-
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.client.state.UserSignInEvent;
-import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.LicenseDTO;
-import cc.kune.gspace.client.licensewizard.LicenseChangeAction;
-import cc.kune.gspace.client.licensewizard.LicenseWizard;
-import cc.kune.gspace.client.options.GroupOptions;
-
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public class GroupOptionsDefLicensePresenter extends EntityOptionsDefLicensePresenter implements
- GroupOptionsDefLicense {
-
- @Inject
- public GroupOptionsDefLicensePresenter(final GroupOptions entityOptions,
- final StateManager stateManager, final Session session, final GroupOptionsDefLicenseView view,
- final Provider<LicenseWizard> licenseWizard, final Provider<LicenseChangeAction> licChangeAction) {
- super(entityOptions, session, licenseWizard, licChangeAction);
- init(view);
- session.onUserSignIn(true, new UserSignInHandler() {
- @Override
- public void onUserSignIn(final UserSignInEvent event) {
- setState();
- }
- });
- }
-
- @Override
- protected boolean applicable() {
- return session.isCurrentStateAGroup();
- }
-
- @Override
- protected LicenseDTO getCurrentDefLicense() {
- return session.getCurrentState().getGroup().getDefaultLicense();
- }
-
- @Override
- protected StateToken getOperationToken() {
- return session.getCurrentStateToken();
- }
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptionsDefLicenseView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptionsDefLicenseView.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptionsDefLicenseView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.license;
-
-public interface GroupOptionsDefLicenseView extends EntityOptionsDefLicenseView {
-
-}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicense.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptionsDefLicense.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicense.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicense.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,24 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.license;
+
+public interface UserOptDefLicense extends EntityOptDefLicense {
+
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicensePanel.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptionsDefLicensePanel.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicensePanel.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicensePanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,34 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.license;
+
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+
+public class UserOptDefLicensePanel extends EntityOptDefLicensePanel implements UserOptDefLicenseView {
+
+ @Inject
+ public UserOptDefLicensePanel(final I18nTranslationService i18n, final CoreResources res) {
+ super(i18n, res);
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicensePanel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicensePresenter.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptionsDefLicensePresenter.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicensePresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicensePresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,65 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.license;
+
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.UserSignInEvent;
+import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.LicenseDTO;
+import cc.kune.gspace.client.licensewizard.LicenseChangeAction;
+import cc.kune.gspace.client.licensewizard.LicenseWizard;
+import cc.kune.gspace.client.options.UserOptions;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class UserOptDefLicensePresenter extends EntityOptDefLicensePresenter implements
+ UserOptDefLicense {
+
+ @Inject
+ public UserOptDefLicensePresenter(final UserOptions entityOptions, final Session session,
+ final UserOptDefLicenseView view, final Provider<LicenseWizard> licenseWizard,
+ final Provider<LicenseChangeAction> licChangeAction) {
+ super(entityOptions, session, licenseWizard, licChangeAction);
+ init(view);
+ session.onUserSignIn(true, new UserSignInHandler() {
+ @Override
+ public void onUserSignIn(final UserSignInEvent event) {
+ setState();
+ }
+ });
+ }
+
+ @Override
+ protected boolean applicable() {
+ return session.isLogged();
+ }
+
+ @Override
+ protected LicenseDTO getCurrentDefLicense() {
+ return session.getCurrentState().getGroup().getDefaultLicense();
+ }
+
+ @Override
+ protected StateToken getOperationToken() {
+ return session.getCurrentUser().getStateToken();
+ }
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicenseView.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptionsDefLicenseView.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicenseView.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicenseView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,24 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.license;
+
+public interface UserOptDefLicenseView extends EntityOptDefLicenseView {
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicenseView.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptionsDefLicense.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptionsDefLicense.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptionsDefLicense.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.license;
-
-public interface UserOptionsDefLicense extends EntityOptionsDefLicense {
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptionsDefLicensePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptionsDefLicensePanel.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptionsDefLicensePanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,34 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.license;
-
-import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.google.inject.Inject;
-
-public class UserOptionsDefLicensePanel extends EntityOptionsDefLicensePanel implements UserOptionsDefLicenseView {
-
- @Inject
- public UserOptionsDefLicensePanel(final I18nTranslationService i18n, final CoreResources res) {
- super(i18n, res);
- }
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptionsDefLicensePresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptionsDefLicensePresenter.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptionsDefLicensePresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,65 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.license;
-
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.UserSignInEvent;
-import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.LicenseDTO;
-import cc.kune.gspace.client.licensewizard.LicenseChangeAction;
-import cc.kune.gspace.client.licensewizard.LicenseWizard;
-import cc.kune.gspace.client.options.UserOptions;
-
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public class UserOptionsDefLicensePresenter extends EntityOptionsDefLicensePresenter implements
- UserOptionsDefLicense {
-
- @Inject
- public UserOptionsDefLicensePresenter(final UserOptions entityOptions, final Session session,
- final UserOptionsDefLicenseView view, final Provider<LicenseWizard> licenseWizard,
- final Provider<LicenseChangeAction> licChangeAction) {
- super(entityOptions, session, licenseWizard, licChangeAction);
- init(view);
- session.onUserSignIn(true, new UserSignInHandler() {
- @Override
- public void onUserSignIn(final UserSignInEvent event) {
- setState();
- }
- });
- }
-
- @Override
- protected boolean applicable() {
- return session.isLogged();
- }
-
- @Override
- protected LicenseDTO getCurrentDefLicense() {
- return session.getCurrentState().getGroup().getDefaultLicense();
- }
-
- @Override
- protected StateToken getOperationToken() {
- return session.getCurrentUser().getStateToken();
- }
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptionsDefLicenseView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptionsDefLicenseView.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptionsDefLicenseView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.license;
-
-public interface UserOptionsDefLicenseView extends EntityOptionsDefLicenseView {
-
-}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogo.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogo.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogo.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogo.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,23 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ \*/
+package cc.kune.gspace.client.options.logo;
+
+public interface EntityOptLogo {
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogo.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPanel.java (from rev 1412, trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPanel.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPanel.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,117 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ \*/
+package cc.kune.gspace.client.options.logo;
+
+import gwtupload.client.IUploader.OnCancelUploaderHandler;
+import gwtupload.client.IUploader.OnChangeUploaderHandler;
+import gwtupload.client.IUploader.OnFinishUploaderHandler;
+import gwtupload.client.IUploader.OnStartUploaderHandler;
+import cc.kune.common.client.ui.IconLabel;
+import cc.kune.common.client.utils.OnAcceptCallback;
+import cc.kune.core.client.resources.CoreMessages;
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.client.services.FileConstants;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.options.EntityOptionsView;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.IsWidget;
+
+public class EntityOptLogoPanel extends Composite implements EntityOptLogoView {
+
+ public static final String ICON_UPLD_SERVLET = "servlets/EntityLogoUploadManager";
+ private final EntityUploaderForm uploader;
+ private final I18nTranslationService i18n;
+ private final IconLabel tabTitle;
+
+ public EntityOptLogoPanel(final EventBus eventBus, final I18nTranslationService i18n,
+ final String panelId, final String buttonId, final String inputId, final NavResources res) {
+ super();
+ this.i18n = i18n;
+ tabTitle = new IconLabel(res.picture(), "");
+
+ uploader = new EntityUploaderForm(ICON_UPLD_SERVLET, i18n.t("Choose"));
+
+ initWidget(uploader);
+ setHeight(String.valueOf(EntityOptionsView.HEIGHT) + "px");
+ setWidth(String.valueOf(EntityOptionsView.WIDTH) + "px");
+
+ addStyleName("k-overflow-y-auto");
+ addStyleName("k-tab-panel");
+ }
+
+ @Override
+ public HandlerRegistration addOnCancelUploadHandler(final OnCancelUploaderHandler handler) {
+ return uploader.addOnCancelUploadHandler(handler);
+ }
+
+ @Override
+ public HandlerRegistration addOnChangeUploadHandler(final OnChangeUploaderHandler handler) {
+ return uploader.addOnChangeUploadHandler(handler);
+ }
+
+ @Override
+ public HandlerRegistration addOnFinishUploadHandler(final OnFinishUploaderHandler handler) {
+ return uploader.addOnFinishUploadHandler(handler);
+ }
+
+ @Override
+ public HandlerRegistration addOnStartUploadHandler(final OnStartUploaderHandler handler) {
+ return uploader.addOnStartUploadHandler(handler);
+ }
+
+ @Override
+ public OnAcceptCallback getOnSubmit() {
+ return null;
+ }
+
+ @Override
+ public IsWidget getTabTitle() {
+ return tabTitle;
+ }
+
+ public void reset() {
+ uploader.reset();
+ }
+
+ @Override
+ public void setNormalGroupsLabels() {
+ uploader.setLabelText(i18n.t("Select an image in your computer as the logo for this group. "
+ + "For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.",
+ FileConstants.LOGO_DEF_HEIGHT, FileConstants.LOGO_DEF_HEIGHT));
+ tabTitle.setText(CoreMessages.ENT_LOGO_SELECTOR_NORMAL_TITLE);
+ }
+
+ @Override
+ public void setPersonalGroupsLabels() {
+ uploader.setLabelText(i18n.t("Select an image in your computer as your avatar. "
+ + "For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.",
+ FileConstants.LOGO_DEF_HEIGHT, FileConstants.LOGO_DEF_HEIGHT));
+ tabTitle.setText(CoreMessages.ENT_LOGO_SELECTOR_PERSON_TITLE);
+ }
+
+ @Override
+ public void setUploadParams(final String userHash, final String token) {
+ uploader.setUploadParams(userHash, token);
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPanel.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPresenter.java (from rev 1412, trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPresenter.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,94 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ \*/
+package cc.kune.gspace.client.options.logo;
+
+import gwtupload.client.IUploadStatus.Status;
+import gwtupload.client.IUploader;
+import gwtupload.client.IUploader.OnFinishUploaderHandler;
+import gwtupload.client.IUploader.OnStartUploaderHandler;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.core.client.rpcservices.UserServiceAsync;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.options.EntityOptions;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.gwt.user.client.ui.IsWidget;
+import com.google.inject.Provider;
+
+public abstract class EntityOptLogoPresenter implements GroupOptLogo, UserOptLogo {
+ private final EntityOptions entityOptions;
+ protected final EventBus eventBus;
+ private final I18nTranslationService i18n;
+ protected final Session session;
+ protected final Provider<UserServiceAsync> userService;
+ protected EntityOptLogoView view;
+
+ public EntityOptLogoPresenter(final EventBus eventBus, final Session session,
+ final EntityOptions entityOptions, final Provider<UserServiceAsync> userService,
+ final I18nTranslationService i18n) {
+ this.eventBus = eventBus;
+ this.session = session;
+ this.entityOptions = entityOptions;
+ this.userService = userService;
+ this.i18n = i18n;
+ }
+
+ public IsWidget getView() {
+ return view;
+ }
+
+ protected void init(final EntityOptLogoView view) {
+ this.view = view;
+ entityOptions.addTab(view, view.getTabTitle());
+ setState();
+ view.addOnStartUploadHandler(new OnStartUploaderHandler() {
+ @Override
+ public void onStart(final IUploader uploader) {
+ setState();
+ }
+ });
+ view.addOnFinishUploadHandler(new OnFinishUploaderHandler() {
+ @Override
+ public void onFinish(final IUploader uploader) {
+ onSubmitComplete(uploader);
+ }
+ });
+ }
+
+ public void onSubmitComplete(final IUploader uploader) {
+ final String response = uploader.getServerInfo().message;
+ if (uploader.getStatus() == Status.SUCCESS) {
+ if (response != null) {
+ NotifyUser.info(response);
+ }
+ CurrentLogoChangedEvent.fire(eventBus);
+ } else {
+ onSubmitFailed(response);
+ }
+ }
+
+ public void onSubmitFailed(final String responseText) {
+ NotifyUser.error(i18n.t("Error setting the logo", responseText));
+ }
+
+ protected abstract void setState();
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPresenter.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoView.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoView.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoView.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,47 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ \*/
+package cc.kune.gspace.client.options.logo;
+
+import gwtupload.client.IUploader;
+import gwtupload.client.IUploader.OnCancelUploaderHandler;
+import cc.kune.common.client.utils.OnAcceptCallback;
+import cc.kune.gspace.client.options.EntityOptionsTabView;
+
+import com.google.gwt.event.shared.HandlerRegistration;
+
+public interface EntityOptLogoView extends EntityOptionsTabView {
+
+ HandlerRegistration addOnCancelUploadHandler(OnCancelUploaderHandler handler);
+
+ HandlerRegistration addOnChangeUploadHandler(IUploader.OnChangeUploaderHandler handler);
+
+ HandlerRegistration addOnFinishUploadHandler(IUploader.OnFinishUploaderHandler handler);
+
+ HandlerRegistration addOnStartUploadHandler(IUploader.OnStartUploaderHandler handler);
+
+ OnAcceptCallback getOnSubmit();
+
+ void setNormalGroupsLabels();
+
+ void setPersonalGroupsLabels();
+
+ void setUploadParams(String userHash, String token);
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoView.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptUploadButton.java (from rev 1412, trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsUploadButton.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptUploadButton.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptUploadButton.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,33 @@
+package cc.kune.gspace.client.options.logo;
+
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.HasClickHandlers;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.DecoratorPanel;
+import com.google.gwt.user.client.ui.HasText;
+
+public class EntityOptUploadButton extends Composite implements HasClickHandlers {
+ private final Button btn;
+ DecoratorPanel widget = new DecoratorPanel();
+
+ public EntityOptUploadButton(final String text) {
+ final DecoratorPanel widget = new DecoratorPanel();
+ btn = new Button(text);
+ btn.addStyleName("k-button");
+ initWidget(widget);
+ widget.setWidget(btn);
+ widget.setHeight("50px");
+ }
+
+ @Override
+ public HandlerRegistration addClickHandler(final ClickHandler handler) {
+ return addDomHandler(handler, ClickEvent.getType());
+ }
+
+ public HasText getBtn() {
+ return btn;
+ }
+}
\ No newline at end of file
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptUploadButton.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogo.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogo.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogo.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,23 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package cc.kune.gspace.client.options.logo;
-
-public interface EntityOptionsLogo {
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPanel.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,117 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package cc.kune.gspace.client.options.logo;
-
-import gwtupload.client.IUploader.OnCancelUploaderHandler;
-import gwtupload.client.IUploader.OnChangeUploaderHandler;
-import gwtupload.client.IUploader.OnFinishUploaderHandler;
-import gwtupload.client.IUploader.OnStartUploaderHandler;
-import cc.kune.common.client.ui.IconLabel;
-import cc.kune.common.client.utils.OnAcceptCallback;
-import cc.kune.core.client.resources.CoreMessages;
-import cc.kune.core.client.resources.nav.NavResources;
-import cc.kune.core.client.services.FileConstants;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.options.EntityOptionsView;
-
-import com.google.gwt.event.shared.EventBus;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.IsWidget;
-
-public class EntityOptionsLogoPanel extends Composite implements EntityOptionsLogoView {
-
- public static final String ICON_UPLD_SERVLET = "servlets/EntityLogoUploadManager";
- private final EntityUploaderForm uploader;
- private final I18nTranslationService i18n;
- private final IconLabel tabTitle;
-
- public EntityOptionsLogoPanel(final EventBus eventBus, final I18nTranslationService i18n,
- final String panelId, final String buttonId, final String inputId, final NavResources res) {
- super();
- this.i18n = i18n;
- tabTitle = new IconLabel(res.picture(), "");
-
- uploader = new EntityUploaderForm(ICON_UPLD_SERVLET, i18n.t("Choose"));
-
- initWidget(uploader);
- setHeight(String.valueOf(EntityOptionsView.HEIGHT) + "px");
- setWidth(String.valueOf(EntityOptionsView.WIDTH) + "px");
-
- addStyleName("k-overflow-y-auto");
- addStyleName("k-tab-panel");
- }
-
- @Override
- public HandlerRegistration addOnCancelUploadHandler(final OnCancelUploaderHandler handler) {
- return uploader.addOnCancelUploadHandler(handler);
- }
-
- @Override
- public HandlerRegistration addOnChangeUploadHandler(final OnChangeUploaderHandler handler) {
- return uploader.addOnChangeUploadHandler(handler);
- }
-
- @Override
- public HandlerRegistration addOnFinishUploadHandler(final OnFinishUploaderHandler handler) {
- return uploader.addOnFinishUploadHandler(handler);
- }
-
- @Override
- public HandlerRegistration addOnStartUploadHandler(final OnStartUploaderHandler handler) {
- return uploader.addOnStartUploadHandler(handler);
- }
-
- @Override
- public OnAcceptCallback getOnSubmit() {
- return null;
- }
-
- @Override
- public IsWidget getTabTitle() {
- return tabTitle;
- }
-
- public void reset() {
- uploader.reset();
- }
-
- @Override
- public void setNormalGroupsLabels() {
- uploader.setLabelText(i18n.t("Select an image in your computer as the logo for this group. "
- + "For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.",
- FileConstants.LOGO_DEF_HEIGHT, FileConstants.LOGO_DEF_HEIGHT));
- tabTitle.setText(CoreMessages.ENT_LOGO_SELECTOR_NORMAL_TITLE);
- }
-
- @Override
- public void setPersonalGroupsLabels() {
- uploader.setLabelText(i18n.t("Select an image in your computer as your avatar. "
- + "For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.",
- FileConstants.LOGO_DEF_HEIGHT, FileConstants.LOGO_DEF_HEIGHT));
- tabTitle.setText(CoreMessages.ENT_LOGO_SELECTOR_PERSON_TITLE);
- }
-
- @Override
- public void setUploadParams(final String userHash, final String token) {
- uploader.setUploadParams(userHash, token);
- }
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPresenter.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,94 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package cc.kune.gspace.client.options.logo;
-
-import gwtupload.client.IUploadStatus.Status;
-import gwtupload.client.IUploader;
-import gwtupload.client.IUploader.OnFinishUploaderHandler;
-import gwtupload.client.IUploader.OnStartUploaderHandler;
-import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.core.client.rpcservices.UserServiceAsync;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.options.EntityOptions;
-
-import com.google.gwt.event.shared.EventBus;
-import com.google.gwt.user.client.ui.IsWidget;
-import com.google.inject.Provider;
-
-public abstract class EntityOptionsLogoPresenter implements GroupOptionsLogo, UserOptionsLogo {
- private final EntityOptions entityOptions;
- protected final EventBus eventBus;
- private final I18nTranslationService i18n;
- protected final Session session;
- protected final Provider<UserServiceAsync> userService;
- protected EntityOptionsLogoView view;
-
- public EntityOptionsLogoPresenter(final EventBus eventBus, final Session session,
- final EntityOptions entityOptions, final Provider<UserServiceAsync> userService,
- final I18nTranslationService i18n) {
- this.eventBus = eventBus;
- this.session = session;
- this.entityOptions = entityOptions;
- this.userService = userService;
- this.i18n = i18n;
- }
-
- public IsWidget getView() {
- return view;
- }
-
- protected void init(final EntityOptionsLogoView view) {
- this.view = view;
- entityOptions.addTab(view, view.getTabTitle());
- setState();
- view.addOnStartUploadHandler(new OnStartUploaderHandler() {
- @Override
- public void onStart(final IUploader uploader) {
- setState();
- }
- });
- view.addOnFinishUploadHandler(new OnFinishUploaderHandler() {
- @Override
- public void onFinish(final IUploader uploader) {
- onSubmitComplete(uploader);
- }
- });
- }
-
- public void onSubmitComplete(final IUploader uploader) {
- final String response = uploader.getServerInfo().message;
- if (uploader.getStatus() == Status.SUCCESS) {
- if (response != null) {
- NotifyUser.info(response);
- }
- CurrentLogoChangedEvent.fire(eventBus);
- } else {
- onSubmitFailed(response);
- }
- }
-
- public void onSubmitFailed(final String responseText) {
- NotifyUser.error(i18n.t("Error setting the logo", responseText));
- }
-
- protected abstract void setState();
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoView.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,47 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package cc.kune.gspace.client.options.logo;
-
-import gwtupload.client.IUploader;
-import gwtupload.client.IUploader.OnCancelUploaderHandler;
-import cc.kune.common.client.utils.OnAcceptCallback;
-import cc.kune.gspace.client.options.EntityOptionsTabView;
-
-import com.google.gwt.event.shared.HandlerRegistration;
-
-public interface EntityOptionsLogoView extends EntityOptionsTabView {
-
- HandlerRegistration addOnCancelUploadHandler(OnCancelUploaderHandler handler);
-
- HandlerRegistration addOnChangeUploadHandler(IUploader.OnChangeUploaderHandler handler);
-
- HandlerRegistration addOnFinishUploadHandler(IUploader.OnFinishUploaderHandler handler);
-
- HandlerRegistration addOnStartUploadHandler(IUploader.OnStartUploaderHandler handler);
-
- OnAcceptCallback getOnSubmit();
-
- void setNormalGroupsLabels();
-
- void setPersonalGroupsLabels();
-
- void setUploadParams(String userHash, String token);
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsUploadButton.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsUploadButton.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsUploadButton.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,27 +0,0 @@
-package cc.kune.gspace.client.options.logo;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.HasClickHandlers;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.DecoratorPanel;
-
-public class EntityOptionsUploadButton extends Composite implements HasClickHandlers {
- DecoratorPanel widget = new DecoratorPanel();
-
- public EntityOptionsUploadButton(final String text) {
- final DecoratorPanel widget = new DecoratorPanel();
- final Button btn = new Button(text);
- btn.addStyleName("k-button");
- initWidget(widget);
- widget.setWidget(btn);
- widget.setHeight("50px");
- }
-
- @Override
- public HandlerRegistration addClickHandler(final ClickHandler handler) {
- return addDomHandler(handler, ClickEvent.getType());
- }
-}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityUploaderForm.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityUploaderForm.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityUploaderForm.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -11,31 +11,30 @@
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.Hidden;
import com.google.gwt.user.client.ui.Label;
public class EntityUploaderForm extends Composite {
+ private final EntityOptUploadButton btn;
private final Label dialogInfoLabel;
private final Hidden tokenField;
private final MultiUploader uploader;
private final Hidden userhashField;
public EntityUploaderForm(final String servlet, final String btnText) {
- final EntityOptionsUploadButton btn = new EntityOptionsUploadButton(btnText);
+ btn = new EntityOptUploadButton(btnText);
uploader = new MultiUploader(FileInputType.CUSTOM.with(btn));
uploader.setServletPath(servlet);
uploader.setMaximumFiles(1);
+ uploader.setValidExtensions("png", "jpg", "gif", "jpeg", "bmp");
dialogInfoLabel = new Label();
dialogInfoLabel.setWordWrap(true);
dialogInfoLabel.addStyleName("kune-Margin-20-tb");
- uploader.setValidExtensions("png", "jpg", "gif", "jpeg", "bmp");
-
userhashField = new Hidden(FileConstants.HASH, FileConstants.HASH);
tokenField = new Hidden(FileConstants.TOKEN, FileConstants.TOKEN);
-
final FlowPanel holder = new FlowPanel();
-
uploader.add(userhashField);
uploader.add(tokenField);
holder.add(dialogInfoLabel);
@@ -59,6 +58,10 @@
return uploader.addOnStartUploadHandler(handler);
}
+ public HasText getBtn() {
+ return btn.getBtn();
+ }
+
public void reset() {
uploader.reset();
}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogo.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogo.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogo.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogo.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,24 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.logo;
+
+public interface GroupOptLogo extends EntityOptLogo {
+
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoPanel.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogoPanel.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoPanel.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoPanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,38 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.logo;
+
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.client.services.FileConstants;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+
+public class GroupOptLogoPanel extends EntityOptLogoPanel implements GroupOptLogoView {
+ public static final String BUTTON_ID = "k-golp-sendb";
+ public static final String PANEL_ID = "k-golp-pan";
+
+ @Inject
+ public GroupOptLogoPanel(final EventBus eventBus, final I18nTranslationService i18n, final NavResources res) {
+ super(eventBus, i18n, PANEL_ID, BUTTON_ID, FileConstants.GROUP_LOGO_FIELD, res);
+ }
+
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoPresenter.java (from rev 1412, trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogoPresenter.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoPresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoPresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,60 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.logo;
+
+import cc.kune.core.client.rpcservices.UserServiceAsync;
+import cc.kune.core.client.state.GroupChangedEvent;
+import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.options.GroupOptions;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class GroupOptLogoPresenter extends EntityOptLogoPresenter {
+
+ @Inject
+ public GroupOptLogoPresenter(final EventBus eventBus, final Session session,
+ final GroupOptions entityOptions, final StateManager stateManager,
+ final Provider<UserServiceAsync> userService, final GroupOptLogoView view,
+ final I18nTranslationService i18n) {
+ super(eventBus, session, entityOptions, userService, i18n);
+ init(view);
+ stateManager.onGroupChanged(true, new GroupChangedHandler() {
+ @Override
+ public void onGroupChanged(final GroupChangedEvent event) {
+ setState();
+ }
+ });
+ }
+
+ private void init(final GroupOptLogoView view) {
+ super.init(view);
+ view.setNormalGroupsLabels();
+ }
+
+ @Override
+ protected void setState() {
+ view.setUploadParams(session.getUserHash(), session.getCurrentStateToken().toString());
+ }
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoView.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogoView.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoView.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,24 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.logo;
+
+public interface GroupOptLogoView extends EntityOptLogoView {
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoView.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogo.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogo.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogo.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.logo;
-
-public interface GroupOptionsLogo extends EntityOptionsLogo {
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogoPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogoPanel.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogoPanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,38 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.logo;
-
-import cc.kune.core.client.resources.nav.NavResources;
-import cc.kune.core.client.services.FileConstants;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.google.gwt.event.shared.EventBus;
-import com.google.inject.Inject;
-
-public class GroupOptionsLogoPanel extends EntityOptionsLogoPanel implements GroupOptionsLogoView {
- public static final String BUTTON_ID = "k-golp-sendb";
- public static final String PANEL_ID = "k-golp-pan";
-
- @Inject
- public GroupOptionsLogoPanel(final EventBus eventBus, final I18nTranslationService i18n, final NavResources res) {
- super(eventBus, i18n, PANEL_ID, BUTTON_ID, FileConstants.GROUP_LOGO_FIELD, res);
- }
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogoPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogoPresenter.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogoPresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,60 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.logo;
-
-import cc.kune.core.client.rpcservices.UserServiceAsync;
-import cc.kune.core.client.state.GroupChangedEvent;
-import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.options.GroupOptions;
-
-import com.google.gwt.event.shared.EventBus;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public class GroupOptionsLogoPresenter extends EntityOptionsLogoPresenter {
-
- @Inject
- public GroupOptionsLogoPresenter(final EventBus eventBus, final Session session,
- final GroupOptions entityOptions, final StateManager stateManager,
- final Provider<UserServiceAsync> userService, final GroupOptionsLogoView view,
- final I18nTranslationService i18n) {
- super(eventBus, session, entityOptions, userService, i18n);
- init(view);
- stateManager.onGroupChanged(true, new GroupChangedHandler() {
- @Override
- public void onGroupChanged(final GroupChangedEvent event) {
- setState();
- }
- });
- }
-
- private void init(final GroupOptionsLogoView view) {
- super.init(view);
- view.setNormalGroupsLabels();
- }
-
- @Override
- protected void setState() {
- view.setUploadParams(session.getUserHash(), session.getCurrentStateToken().toString());
- }
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogoView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogoView.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogoView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.logo;
-
-public interface GroupOptionsLogoView extends EntityOptionsLogoView {
-
-}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogo.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogo.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogo.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogo.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,24 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.logo;
+
+public interface UserOptLogo extends EntityOptLogo {
+
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoPanel.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoPanel.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoPanel.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoPanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,38 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.logo;
+
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.client.services.FileConstants;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+
+public class UserOptLogoPanel extends EntityOptLogoPanel implements UserOptLogoView {
+ public static final String BUTTON_ID = "k-uolp-sendb";
+ public static final String PANEL_ID = "k-uolp-pan";
+
+ @Inject
+ public UserOptLogoPanel(final EventBus eventBus, final I18nTranslationService i18n, final NavResources res) {
+ super(eventBus, i18n, PANEL_ID, BUTTON_ID, FileConstants.USER_LOGO_FIELD, res);
+ }
+
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoPresenter.java (from rev 1412, trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoPresenter.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoPresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoPresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,79 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.logo;
+
+import gwtupload.client.IUploader;
+import cc.kune.core.client.events.AvatarChangedEvent;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.rpcservices.UserServiceAsync;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.client.state.UserSignInEvent;
+import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.shared.dto.GroupDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.options.UserOptions;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class UserOptLogoPresenter extends EntityOptLogoPresenter {
+
+ @Inject
+ public UserOptLogoPresenter(final EventBus eventBus, final Session session,
+ final UserOptions entityOptions, final StateManager stateManager,
+ final Provider<UserServiceAsync> userService, final UserOptLogoView view,
+ final I18nTranslationService i18n) {
+ super(eventBus, session, entityOptions, userService, i18n);
+ init(view);
+ session.onUserSignIn(true, new UserSignInHandler() {
+ @Override
+ public void onUserSignIn(final UserSignInEvent event) {
+ setState();
+ }
+ });
+ }
+
+ private void init(final UserOptLogoView view) {
+ super.init(view);
+ view.setPersonalGroupsLabels();
+ }
+
+ @Override
+ public void onSubmitComplete(final IUploader uploader) {
+ super.onSubmitComplete(uploader);
+ final GroupDTO group = session.getCurrentState().getGroup();
+ if (session.getCurrentUser().getShortName().equals(group.getShortName())) {
+ userService.get().getUserAvatarBaser64(session.getUserHash(), group.getStateToken(),
+ new AsyncCallbackSimple<String>() {
+ @Override
+ public void onSuccess(final String photoBinary) {
+ AvatarChangedEvent.fire(eventBus, photoBinary);
+ }
+ });
+ }
+ }
+
+ @Override
+ protected void setState() {
+ view.setUploadParams(session.getUserHash(), session.getCurrentUser().getStateToken().toString());
+ }
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoView.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoView.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoView.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,24 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.logo;
+
+public interface UserOptLogoView extends EntityOptLogoView {
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoView.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogo.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogo.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogo.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.logo;
-
-public interface UserOptionsLogo extends EntityOptionsLogo {
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoPanel.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoPanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,38 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.logo;
-
-import cc.kune.core.client.resources.nav.NavResources;
-import cc.kune.core.client.services.FileConstants;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.google.gwt.event.shared.EventBus;
-import com.google.inject.Inject;
-
-public class UserOptionsLogoPanel extends EntityOptionsLogoPanel implements UserOptionsLogoView {
- public static final String BUTTON_ID = "k-uolp-sendb";
- public static final String PANEL_ID = "k-uolp-pan";
-
- @Inject
- public UserOptionsLogoPanel(final EventBus eventBus, final I18nTranslationService i18n, final NavResources res) {
- super(eventBus, i18n, PANEL_ID, BUTTON_ID, FileConstants.USER_LOGO_FIELD, res);
- }
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoPresenter.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoPresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,79 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.logo;
-
-import gwtupload.client.IUploader;
-import cc.kune.core.client.events.AvatarChangedEvent;
-import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
-import cc.kune.core.client.rpcservices.UserServiceAsync;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.client.state.UserSignInEvent;
-import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
-import cc.kune.core.shared.dto.GroupDTO;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.options.UserOptions;
-
-import com.google.gwt.event.shared.EventBus;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public class UserOptionsLogoPresenter extends EntityOptionsLogoPresenter {
-
- @Inject
- public UserOptionsLogoPresenter(final EventBus eventBus, final Session session,
- final UserOptions entityOptions, final StateManager stateManager,
- final Provider<UserServiceAsync> userService, final UserOptionsLogoView view,
- final I18nTranslationService i18n) {
- super(eventBus, session, entityOptions, userService, i18n);
- init(view);
- session.onUserSignIn(true, new UserSignInHandler() {
- @Override
- public void onUserSignIn(final UserSignInEvent event) {
- setState();
- }
- });
- }
-
- private void init(final UserOptionsLogoView view) {
- super.init(view);
- view.setPersonalGroupsLabels();
- }
-
- @Override
- public void onSubmitComplete(final IUploader uploader) {
- super.onSubmitComplete(uploader);
- final GroupDTO group = session.getCurrentState().getGroup();
- if (session.getCurrentUser().getShortName().equals(group.getShortName())) {
- userService.get().getUserAvatarBaser64(session.getUserHash(), group.getStateToken(),
- new AsyncCallbackSimple<String>() {
- @Override
- public void onSuccess(final String photoBinary) {
- AvatarChangedEvent.fire(eventBus, photoBinary);
- }
- });
- }
- }
-
- @Override
- protected void setState() {
- view.setUploadParams(session.getUserHash(), session.getCurrentUser().getStateToken().toString());
- }
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoView.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.logo;
-
-public interface UserOptionsLogoView extends EntityOptionsLogoView {
-
-}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStyle.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConf.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStyle.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStyle.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,24 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.style;
+
+
+public interface EntityOptStyle {
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStylePanel.java (from rev 1412, trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfPanel.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStylePanel.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStylePanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,179 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.style;
+
+import gwtupload.client.IUploader.OnCancelUploaderHandler;
+import gwtupload.client.IUploader.OnChangeUploaderHandler;
+import gwtupload.client.IUploader.OnFinishUploaderHandler;
+import gwtupload.client.IUploader.OnStartUploaderHandler;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.client.tooltip.Tooltip;
+import cc.kune.common.client.ui.BasicThumb;
+import cc.kune.common.client.ui.IconLabel;
+import cc.kune.common.client.utils.TextUtils;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.options.EntityOptionsView;
+import cc.kune.gspace.client.options.logo.EntityUploaderForm;
+import cc.kune.gspace.client.themes.GSpaceThemeSelectorPanel;
+
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.HasClickHandlers;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.IsWidget;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+public class EntityOptStylePanel extends FlowPanel implements EntityOptStyleView {
+
+ public static final String ICON_UPLD_SERVLET = "servlets/EntityBackgroundUploadManager";
+ private final Label backgroundLabel;
+ private final Image backImage;
+ private final String changeImage;
+ private final String chooseImage;
+ private final Button clearBtn;
+ private final String hasBackLabel;
+ private final String noHasBacklabel;
+ private final IconLabel tabTitle;
+ private final EntityUploaderForm uploader;
+
+ public EntityOptStylePanel(final I18nTranslationService i18n, final CoreResources res,
+ final GSpaceThemeSelectorPanel styleSelector) {
+ tabTitle = new IconLabel(res.themeChoose(), i18n.t("Style"));
+ super.setHeight(String.valueOf(EntityOptionsView.HEIGHT) + "px");
+ super.setWidth(String.valueOf(EntityOptionsView.WIDTH) + "px");
+
+ final FlowPanel flow = new FlowPanel();
+ final Label wsThemeInfo = new Label(i18n.t("Change this workspace theme:"));
+ flow.addStyleName("kune-Margin-20-tb");
+ wsThemeInfo.addStyleName("k-fl");
+ styleSelector.addStyleName("k-fl");
+ styleSelector.addStyleName("kune-Margin-10-lr");
+ flow.add(wsThemeInfo);
+ flow.add(styleSelector);
+ hasBackLabel = i18n.t("Current background image: ");
+ noHasBacklabel = i18n.t("Also you can upload a background:");
+ backgroundLabel = new Label(hasBackLabel);
+ backgroundLabel.addStyleName("k-clear");
+ chooseImage = i18n.t("Choose");
+ changeImage = i18n.t("Change");
+ uploader = new EntityUploaderForm(ICON_UPLD_SERVLET, chooseImage);
+ uploader.addStyleName("k-fl");
+ backImage = new Image();
+ backImage.addStyleName("kune-Margin-Medium-trbl");
+ clearBtn = new Button(i18n.t("Clear"));
+ clearBtn.setStyleName("k-button");
+ clearBtn.addStyleName("k-fl");
+ clearBtn.addStyleName("kune-Margin-20-lr");
+ Tooltip.to(clearBtn, i18n.t("Remove current background image"));
+ flow.add(backgroundLabel);
+ flow.add(backImage);
+ flow.add(clearBtn);
+ flow.add(uploader);
+ flow.addStyleName("oc-clean");
+ backImage.addStyleName("k-fl");
+ add(flow);
+ final Label wsInfo = new Label(i18n.t("Select and configure the public space theme of this group:"));
+ wsInfo.addStyleName("kune-Margin-Medium-tb");
+ // add(wsInfo);
+
+ final VerticalPanel stylesPanel = new VerticalPanel();
+ final ClickHandler clickHandler = new ClickHandler() {
+
+ @Override
+ public void onClick(final ClickEvent event) {
+ NotifyUser.info(TextUtils.IN_DEVELOPMENT);
+ }
+ };
+ for (int i = 1; i <= 6; i++) {
+ final BasicThumb thumb = new BasicThumb("images/styles/styl" + i + ".png", "Style " + i,
+ clickHandler);
+ thumb.setTooltip(i18n.t("Click to select and configure this theme"));
+ // add(thumb);
+ }
+ stylesPanel.addStyleName("oc-clean");
+ add(stylesPanel);
+ setBackImageVisibleImpl(false);
+ super.addStyleName("k-overflow-y-auto");
+ super.addStyleName("k-tab-panel");
+ }
+
+ @Override
+ public HandlerRegistration addOnCancelUploadHandler(final OnCancelUploaderHandler handler) {
+ return uploader.addOnCancelUploadHandler(handler);
+ }
+
+ @Override
+ public HandlerRegistration addOnChangeUploadHandler(final OnChangeUploaderHandler handler) {
+ return uploader.addOnChangeUploadHandler(handler);
+ }
+
+ @Override
+ public HandlerRegistration addOnFinishUploadHandler(final OnFinishUploaderHandler handler) {
+ return uploader.addOnFinishUploadHandler(handler);
+ }
+
+ @Override
+ public HandlerRegistration addOnStartUploadHandler(final OnStartUploaderHandler handler) {
+ return uploader.addOnStartUploadHandler(handler);
+ }
+
+ @Override
+ public void clearBackImage() {
+ setBackImageVisibleImpl(false);
+ }
+
+ @Override
+ public HasClickHandlers getClearBtn() {
+ return clearBtn;
+ }
+
+ @Override
+ public IsWidget getTabTitle() {
+ return tabTitle;
+ }
+
+ @Override
+ public void reset() {
+ uploader.reset();
+ }
+
+ @Override
+ public void setBackImage(final String url) {
+ backImage.setUrl(url);
+ setBackImageVisibleImpl(true);
+ }
+
+ private void setBackImageVisibleImpl(final boolean visible) {
+ backImage.setVisible(visible);
+ clearBtn.setVisible(visible);
+ backgroundLabel.setText(visible ? hasBackLabel : noHasBacklabel);
+ uploader.getBtn().setText(visible ? changeImage : chooseImage);
+ }
+
+ @Override
+ public void setUploadParams(final String userHash, final String token) {
+ uploader.setUploadParams(userHash, token);
+ }
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStylePresenter.java (from rev 1412, trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfPresenter.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStylePresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStylePresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,169 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.style;
+
+import gwtupload.client.IUploadStatus.Status;
+import gwtupload.client.IUploader;
+import gwtupload.client.IUploader.OnFinishUploaderHandler;
+import gwtupload.client.IUploader.OnStartUploaderHandler;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.client.utils.TextUtils;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.rpcservices.GroupServiceAsync;
+import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.services.ImageSize;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateChangedEvent;
+import cc.kune.core.client.state.StateChangedEvent.StateChangedHandler;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.GroupDTO;
+import cc.kune.core.shared.dto.StateAbstractDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.options.EntityOptions;
+import cc.kune.gspace.client.style.ClearBackImageEvent;
+import cc.kune.gspace.client.style.GSpaceBackManager;
+import cc.kune.gspace.client.style.SetBackImageEvent;
+import cc.kune.gspace.client.themes.GSpaceThemeSelectorPresenter;
+
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.shared.EventBus;
+import com.google.gwt.user.client.ui.IsWidget;
+import com.google.inject.Provider;
+
+public abstract class EntityOptStylePresenter implements EntityOptStyle {
+ private final GSpaceBackManager backManager;
+ private final EntityOptions entityOptions;
+ private final EventBus eventBus;
+ private final FileDownloadUtils fileDownloadUtils;
+ private final Provider<GroupServiceAsync> groupService;
+ private final I18nTranslationService i18n;
+ private final Session session;
+ private final StateManager stateManager;
+ private EntityOptStyleView view;
+
+ protected EntityOptStylePresenter(final EventBus eventBus, final Session session,
+ final StateManager stateManager, final EntityOptions entityOptions,
+ final Provider<GroupServiceAsync> groupService, final GSpaceBackManager backManager,
+ final GSpaceThemeSelectorPresenter styleSelector, final I18nTranslationService i18n,
+ final FileDownloadUtils fileDownloadUtils) {
+ this.eventBus = eventBus;
+ this.session = session;
+ this.stateManager = stateManager;
+ this.entityOptions = entityOptions;
+ this.groupService = groupService;
+ this.backManager = backManager;
+ this.i18n = i18n;
+ this.fileDownloadUtils = fileDownloadUtils;
+ }
+
+ private void clearBackImage() {
+ groupService.get().clearGroupBackImage(session.getUserHash(), session.getCurrentStateToken(),
+ new AsyncCallbackSimple<GroupDTO>() {
+ @Override
+ public void onSuccess(final GroupDTO result) {
+ view.clearBackImage();
+ backManager.clearBackImage();
+ ClearBackImageEvent.fire(eventBus);
+ }
+ });
+ }
+
+ public IsWidget getView() {
+ return view;
+ }
+
+ public void init(final EntityOptStyleView view) {
+ this.view = view;
+ entityOptions.addTab(view, view.getTabTitle());
+ setState();
+ view.getClearBtn().addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(final ClickEvent event) {
+ clearBackImage();
+ }
+ });
+ stateManager.onStateChanged(true, new StateChangedHandler() {
+ @Override
+ public void onStateChanged(final StateChangedEvent event) {
+ setState();
+ }
+ });
+ eventBus.addHandler(SetBackImageEvent.getType(), new SetBackImageEvent.SetBackImageHandler() {
+ @Override
+ public void onSetBackImage(final SetBackImageEvent event) {
+ final StateToken token = event.getToken();
+ backManager.setBackImage(token);
+ setBackImage(event.getToken());
+ }
+ });
+ eventBus.addHandler(ClearBackImageEvent.getType(), new ClearBackImageEvent.ClearBackImageHandler() {
+ @Override
+ public void onClearBackImage(final ClearBackImageEvent event) {
+ view.clearBackImage();
+ }
+ });
+ view.addOnStartUploadHandler(new OnStartUploaderHandler() {
+ @Override
+ public void onStart(final IUploader uploader) {
+ setState();
+ }
+ });
+ view.addOnFinishUploadHandler(new OnFinishUploaderHandler() {
+ @Override
+ public void onFinish(final IUploader uploader) {
+ onSubmitComplete(uploader);
+ }
+ });
+ }
+
+ private void onSubmitComplete(final IUploader uploader) {
+ final String response = uploader.getServerInfo().message;
+ if (uploader.getStatus() == Status.SUCCESS) {
+ if (!TextUtils.empty(response)) {
+ NotifyUser.info(response);
+ }
+ SetBackImageEvent.fire(eventBus, session.getCurrentState().getGroup().getStateToken());
+ } else {
+ onSubmitFailed(response);
+ }
+ }
+
+ private void onSubmitFailed(final String responseText) {
+ NotifyUser.error(i18n.t("Error setting the background"), responseText);
+ }
+
+ private void setBackImage(final StateToken token) {
+ view.setBackImage(fileDownloadUtils.getBackgroundResizedUrl(token, ImageSize.thumb));
+ }
+
+ private void setState() {
+ final StateAbstractDTO state = session.getCurrentState();
+ final GroupDTO group = state.getGroup();
+ if (group.getBackgroundImage() == null) {
+ view.clearBackImage();
+ } else {
+ setBackImage(group.getStateToken());
+ }
+ view.setUploadParams(session.getUserHash(), session.getCurrentStateToken().toString());
+ }
+
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStyleView.java (from rev 1412, trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfView.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStyleView.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStyleView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,49 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.style;
+
+import gwtupload.client.IUploader;
+import gwtupload.client.IUploader.OnCancelUploaderHandler;
+import cc.kune.gspace.client.options.EntityOptionsTabView;
+
+import com.google.gwt.event.dom.client.HasClickHandlers;
+import com.google.gwt.event.shared.HandlerRegistration;
+
+public interface EntityOptStyleView extends EntityOptionsTabView {
+
+ HandlerRegistration addOnCancelUploadHandler(OnCancelUploaderHandler handler);
+
+ HandlerRegistration addOnChangeUploadHandler(IUploader.OnChangeUploaderHandler handler);
+
+ HandlerRegistration addOnFinishUploadHandler(IUploader.OnFinishUploaderHandler handler);
+
+ HandlerRegistration addOnStartUploadHandler(IUploader.OnStartUploaderHandler handler);
+
+ public void clearBackImage();
+
+ HasClickHandlers getClearBtn();
+
+ void reset();
+
+ public void setBackImage(final String url);
+
+ void setUploadParams(String userHash, String token);
+
+}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConf.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConf.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConf.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.style;
-
-
-public interface EntityOptionsStyleConf {
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfPanel.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfPanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,177 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.style;
-
-import gwtupload.client.IUploader.OnCancelUploaderHandler;
-import gwtupload.client.IUploader.OnChangeUploaderHandler;
-import gwtupload.client.IUploader.OnFinishUploaderHandler;
-import gwtupload.client.IUploader.OnStartUploaderHandler;
-import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.tooltip.Tooltip;
-import cc.kune.common.client.ui.BasicThumb;
-import cc.kune.common.client.ui.IconLabel;
-import cc.kune.common.client.utils.TextUtils;
-import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.options.EntityOptionsView;
-import cc.kune.gspace.client.options.logo.EntityUploaderForm;
-import cc.kune.gspace.client.themes.GSpaceThemeSelectorPanel;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.HasClickHandlers;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.IsWidget;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
-
-public class EntityOptionsStyleConfPanel extends FlowPanel implements EntityOptionsStyleConfView {
-
- public static final String ICON_UPLD_SERVLET = "servlets/EntityBackgroundUploadManager";
- private final Image backImage;
- private final Button clearBtn;
- private final Label currentBackLabel;
- private final Label noBackLabel;
- private final IconLabel tabTitle;
- private final EntityUploaderForm uploader;
-
- public EntityOptionsStyleConfPanel(final I18nTranslationService i18n, final CoreResources res,
- final GSpaceThemeSelectorPanel styleSelector) {
- ;
- tabTitle = new IconLabel(res.themeChoose(), i18n.t("Style"));
- super.setHeight(String.valueOf(EntityOptionsView.HEIGHT) + "px");
- super.setWidth(String.valueOf(EntityOptionsView.WIDTH) + "px");
-
- final FlowPanel flow = new FlowPanel();
- final Label wsThemeInfo = new Label(i18n.t("Change this workspace theme:"));
- flow.addStyleName("kune-Margin-20-tb");
- wsThemeInfo.addStyleName("k-fl");
- styleSelector.addStyleName("k-fl");
- styleSelector.addStyleName("kune-Margin-10-trbl");
- flow.add(wsThemeInfo);
- flow.add(styleSelector);
- currentBackLabel = new Label(i18n.t("Current background image: "));
- noBackLabel = new Label(i18n.t("Also you can upload a background:"));
- currentBackLabel.addStyleName("k-clear");
- noBackLabel.addStyleName("k-clear");
- uploader = new EntityUploaderForm(ICON_UPLD_SERVLET, i18n.t("Choose"));
- uploader.addStyleName("k-fl");
- backImage = new Image();
- backImage.addStyleName("kune-Margin-Medium-trbl");
- noBackLabel.addStyleName("kune-Margin-Medium-tb");
- clearBtn = new Button(i18n.t("Clear"));
- clearBtn.setStyleName("k-button");
- clearBtn.addStyleName("k-fl");
- Tooltip.to(clearBtn, i18n.t("Remove current background image"));
- flow.add(noBackLabel);
- flow.add(currentBackLabel);
- flow.add(backImage);
- flow.add(uploader);
- flow.add(clearBtn);
- flow.addStyleName("oc-clean");
- backImage.addStyleName("k-fr");
- add(flow);
- final Label wsInfo = new Label(i18n.t("Select and configure the public space theme of this group:"));
- wsInfo.addStyleName("kune-Margin-Medium-tb");
- // add(wsInfo);
-
- final VerticalPanel stylesPanel = new VerticalPanel();
- final ClickHandler clickHandler = new ClickHandler() {
-
- @Override
- public void onClick(final ClickEvent event) {
- NotifyUser.info(TextUtils.IN_DEVELOPMENT);
- }
- };
- for (int i = 1; i <= 6; i++) {
- final BasicThumb thumb = new BasicThumb("images/styles/styl" + i + ".png", "Style " + i,
- clickHandler);
- thumb.setTooltip(i18n.t("Click to select and configure this theme"));
- // add(thumb);
- }
- stylesPanel.addStyleName("oc-clean");
- add(stylesPanel);
- setBackImageVisibleImpl(false);
- super.addStyleName("k-overflow-y-auto");
- super.addStyleName("k-tab-panel");
- }
-
- @Override
- public HandlerRegistration addOnCancelUploadHandler(final OnCancelUploaderHandler handler) {
- return uploader.addOnCancelUploadHandler(handler);
- }
-
- @Override
- public HandlerRegistration addOnChangeUploadHandler(final OnChangeUploaderHandler handler) {
- return uploader.addOnChangeUploadHandler(handler);
- }
-
- @Override
- public HandlerRegistration addOnFinishUploadHandler(final OnFinishUploaderHandler handler) {
- return uploader.addOnFinishUploadHandler(handler);
- }
-
- @Override
- public HandlerRegistration addOnStartUploadHandler(final OnStartUploaderHandler handler) {
- return uploader.addOnStartUploadHandler(handler);
- }
-
- @Override
- public void clearBackImage() {
- setBackImageVisibleImpl(false);
- }
-
- @Override
- public HasClickHandlers getClearBtn() {
- return clearBtn;
- }
-
- @Override
- public IsWidget getTabTitle() {
- return tabTitle;
- }
-
- @Override
- public void reset() {
- uploader.reset();
- }
-
- @Override
- public void setBackImage(final String url) {
- // backImage.setUrl(downUtils.getImageResizedUrl(token, ImageSize.thumb));
- backImage.setUrl(url);
- setBackImageVisibleImpl(true);
- }
-
- private void setBackImageVisibleImpl(final boolean visible) {
- backImage.setVisible(visible);
- currentBackLabel.setVisible(visible);
- clearBtn.setVisible(visible);
- noBackLabel.setVisible(!visible);
- }
-
- @Override
- public void setUploadParams(final String userHash, final String token) {
- uploader.setUploadParams(userHash, token);
- }
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfPresenter.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfPresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,169 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.style;
-
-import gwtupload.client.IUploadStatus.Status;
-import gwtupload.client.IUploader;
-import gwtupload.client.IUploader.OnFinishUploaderHandler;
-import gwtupload.client.IUploader.OnStartUploaderHandler;
-import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.TextUtils;
-import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
-import cc.kune.core.client.rpcservices.GroupServiceAsync;
-import cc.kune.core.client.services.FileDownloadUtils;
-import cc.kune.core.client.services.ImageSize;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateChangedEvent;
-import cc.kune.core.client.state.StateChangedEvent.StateChangedHandler;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.GroupDTO;
-import cc.kune.core.shared.dto.StateAbstractDTO;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.options.EntityOptions;
-import cc.kune.gspace.client.style.ClearBackImageEvent;
-import cc.kune.gspace.client.style.GSpaceBackManager;
-import cc.kune.gspace.client.style.SetBackImageEvent;
-import cc.kune.gspace.client.themes.GSpaceThemeSelectorPresenter;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.shared.EventBus;
-import com.google.gwt.user.client.ui.IsWidget;
-import com.google.inject.Provider;
-
-public abstract class EntityOptionsStyleConfPresenter implements EntityOptionsStyleConf {
- private final GSpaceBackManager backManager;
- private final EntityOptions entityOptions;
- private final EventBus eventBus;
- private final FileDownloadUtils fileDownloadUtils;
- private final Provider<GroupServiceAsync> groupService;
- private final I18nTranslationService i18n;
- private final Session session;
- private final StateManager stateManager;
- private EntityOptionsStyleConfView view;
-
- protected EntityOptionsStyleConfPresenter(final EventBus eventBus, final Session session,
- final StateManager stateManager, final EntityOptions entityOptions,
- final Provider<GroupServiceAsync> groupService, final GSpaceBackManager backManager,
- final GSpaceThemeSelectorPresenter styleSelector, final I18nTranslationService i18n,
- final FileDownloadUtils fileDownloadUtils) {
- this.eventBus = eventBus;
- this.session = session;
- this.stateManager = stateManager;
- this.entityOptions = entityOptions;
- this.groupService = groupService;
- this.backManager = backManager;
- this.i18n = i18n;
- this.fileDownloadUtils = fileDownloadUtils;
- }
-
- private void clearBackImage() {
- groupService.get().clearGroupBackImage(session.getUserHash(), session.getCurrentStateToken(),
- new AsyncCallbackSimple<GroupDTO>() {
- @Override
- public void onSuccess(final GroupDTO result) {
- view.clearBackImage();
- backManager.clearBackImage();
- ClearBackImageEvent.fire(eventBus);
- }
- });
- }
-
- public IsWidget getView() {
- return view;
- }
-
- public void init(final EntityOptionsStyleConfView view) {
- this.view = view;
- entityOptions.addTab(view, view.getTabTitle());
- setState();
- view.getClearBtn().addClickHandler(new ClickHandler() {
- @Override
- public void onClick(final ClickEvent event) {
- clearBackImage();
- }
- });
- stateManager.onStateChanged(true, new StateChangedHandler() {
- @Override
- public void onStateChanged(final StateChangedEvent event) {
- setState();
- }
- });
- eventBus.addHandler(SetBackImageEvent.getType(), new SetBackImageEvent.SetBackImageHandler() {
- @Override
- public void onSetBackImage(final SetBackImageEvent event) {
- final StateToken token = event.getToken();
- backManager.setBackImage(token);
- setBackImage(event.getToken());
- }
- });
- eventBus.addHandler(ClearBackImageEvent.getType(), new ClearBackImageEvent.ClearBackImageHandler() {
- @Override
- public void onClearBackImage(final ClearBackImageEvent event) {
- view.clearBackImage();
- }
- });
- view.addOnStartUploadHandler(new OnStartUploaderHandler() {
- @Override
- public void onStart(final IUploader uploader) {
- setState();
- }
- });
- view.addOnFinishUploadHandler(new OnFinishUploaderHandler() {
- @Override
- public void onFinish(final IUploader uploader) {
- onSubmitComplete(uploader);
- }
- });
- }
-
- private void onSubmitComplete(final IUploader uploader) {
- final String response = uploader.getServerInfo().message;
- if (uploader.getStatus() == Status.SUCCESS) {
- if (!TextUtils.empty(response)) {
- NotifyUser.info(response);
- }
- SetBackImageEvent.fire(eventBus, session.getCurrentState().getGroup().getStateToken());
- } else {
- onSubmitFailed(response);
- }
- }
-
- private void onSubmitFailed(final String responseText) {
- NotifyUser.error(i18n.t("Error setting the background"), responseText);
- }
-
- private void setBackImage(final StateToken token) {
- view.setBackImage(fileDownloadUtils.getBackgroundResizedUrl(token, ImageSize.thumb));
- }
-
- private void setState() {
- final StateAbstractDTO state = session.getCurrentState();
- final GroupDTO group = state.getGroup();
- if (group.getBackgroundImage() == null) {
- view.clearBackImage();
- } else {
- setBackImage(group.getStateToken());
- }
- view.setUploadParams(session.getUserHash(), session.getCurrentStateToken().toString());
- }
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfView.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,49 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.style;
-
-import gwtupload.client.IUploader;
-import gwtupload.client.IUploader.OnCancelUploaderHandler;
-import cc.kune.gspace.client.options.EntityOptionsTabView;
-
-import com.google.gwt.event.dom.client.HasClickHandlers;
-import com.google.gwt.event.shared.HandlerRegistration;
-
-public interface EntityOptionsStyleConfView extends EntityOptionsTabView {
-
- HandlerRegistration addOnCancelUploadHandler(OnCancelUploaderHandler handler);
-
- HandlerRegistration addOnChangeUploadHandler(IUploader.OnChangeUploaderHandler handler);
-
- HandlerRegistration addOnFinishUploadHandler(IUploader.OnFinishUploaderHandler handler);
-
- HandlerRegistration addOnStartUploadHandler(IUploader.OnStartUploaderHandler handler);
-
- public void clearBackImage();
-
- HasClickHandlers getClearBtn();
-
- void reset();
-
- public void setBackImage(final String url);
-
- void setUploadParams(String userHash, String token);
-
-}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStyle.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConf.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStyle.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStyle.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,24 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.style;
+
+public interface GroupOptStyle extends EntityOptStyle {
+
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStylePanel.java (from rev 1412, trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfPanel.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStylePanel.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStylePanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,37 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.style;
+
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.themes.GSpaceThemeSelectorPanel;
+
+import com.google.inject.Inject;
+
+public class GroupOptStylePanel extends EntityOptStylePanel implements
+ GroupOptStyleView {
+
+ @Inject
+ public GroupOptStylePanel(final I18nTranslationService i18n, final CoreResources res,
+ final GSpaceThemeSelectorPanel styleSelector) {
+ super(i18n, res, styleSelector);
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStylePanel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStylePresenter.java (from rev 1412, trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfPresenter.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStylePresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStylePresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,49 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.style;
+
+import cc.kune.core.client.rpcservices.GroupServiceAsync;
+import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.options.GroupOptions;
+import cc.kune.gspace.client.style.GSpaceBackManager;
+import cc.kune.gspace.client.themes.GSpaceThemeSelectorPresenter;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class GroupOptStylePresenter extends EntityOptStylePresenter implements
+ GroupOptStyle {
+
+ @Inject
+ public GroupOptStylePresenter(final EventBus eventBus, final Session session,
+ final StateManager stateManager, final GroupOptions entityOptions,
+ final Provider<GroupServiceAsync> groupService, final GSpaceBackManager backManager,
+ final GroupOptStyleView view, final GSpaceThemeSelectorPresenter styleSelector,
+ final I18nTranslationService i18n, final FileDownloadUtils fileDownUtils) {
+ super(eventBus, session, stateManager, entityOptions, groupService, backManager, styleSelector,
+ i18n, fileDownUtils);
+ init(view);
+ }
+
+}
\ No newline at end of file
Copied: trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStyleView.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfView.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStyleView.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStyleView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,24 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.style;
+
+public interface GroupOptStyleView extends EntityOptStyleView {
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStyleView.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConf.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConf.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConf.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.style;
-
-public interface GroupOptionsStyleConf extends EntityOptionsStyleConf {
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfPanel.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfPanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,37 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.style;
-
-import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.themes.GSpaceThemeSelectorPanel;
-
-import com.google.inject.Inject;
-
-public class GroupOptionsStyleConfPanel extends EntityOptionsStyleConfPanel implements
- GroupOptionsStyleConfView {
-
- @Inject
- public GroupOptionsStyleConfPanel(final I18nTranslationService i18n, final CoreResources res,
- final GSpaceThemeSelectorPanel styleSelector) {
- super(i18n, res, styleSelector);
- }
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfPresenter.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfPresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,49 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.style;
-
-import cc.kune.core.client.rpcservices.GroupServiceAsync;
-import cc.kune.core.client.services.FileDownloadUtils;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.options.GroupOptions;
-import cc.kune.gspace.client.style.GSpaceBackManager;
-import cc.kune.gspace.client.themes.GSpaceThemeSelectorPresenter;
-
-import com.google.gwt.event.shared.EventBus;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public class GroupOptionsStyleConfPresenter extends EntityOptionsStyleConfPresenter implements
- GroupOptionsStyleConf {
-
- @Inject
- public GroupOptionsStyleConfPresenter(final EventBus eventBus, final Session session,
- final StateManager stateManager, final GroupOptions entityOptions,
- final Provider<GroupServiceAsync> groupService, final GSpaceBackManager backManager,
- final GroupOptionsStyleConfView view, final GSpaceThemeSelectorPresenter styleSelector,
- final I18nTranslationService i18n, final FileDownloadUtils fileDownUtils) {
- super(eventBus, session, stateManager, entityOptions, groupService, backManager, styleSelector,
- i18n, fileDownUtils);
- init(view);
- }
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfView.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.style;
-
-public interface GroupOptionsStyleConfView extends EntityOptionsStyleConfView {
-
-}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStyle.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConf.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStyle.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStyle.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,24 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.style;
+
+public interface UserOptStyle extends EntityOptStyle {
+
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStylePanel.java (from rev 1412, trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfPanel.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStylePanel.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStylePanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,37 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.style;
+
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.themes.GSpaceThemeSelectorPanel;
+
+import com.google.inject.Inject;
+
+public class UserOptStylePanel extends EntityOptStylePanel implements
+ UserOptStyleView {
+
+ @Inject
+ public UserOptStylePanel(final I18nTranslationService i18n, final CoreResources res,
+ final GSpaceThemeSelectorPanel styleSelector) {
+ super(i18n, res, styleSelector);
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStylePanel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStylePresenter.java (from rev 1412, trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfPresenter.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStylePresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStylePresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,50 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.style;
+
+import cc.kune.core.client.rpcservices.GroupServiceAsync;
+import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.options.UserOptions;
+import cc.kune.gspace.client.style.GSpaceBackManager;
+import cc.kune.gspace.client.themes.GSpaceThemeSelectorPresenter;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class UserOptStylePresenter extends EntityOptStylePresenter implements
+ UserOptStyle {
+
+ // private final WsThemeSelector themeSelector;
+
+ @Inject
+ public UserOptStylePresenter(final EventBus eventBus, final Session session,
+ final StateManager stateManager, final UserOptions entityOptions,
+ final Provider<GroupServiceAsync> groupService, final GSpaceBackManager backManager,
+ final UserOptStyleView view, final GSpaceThemeSelectorPresenter styleSelector,
+ final I18nTranslationService i18n, final FileDownloadUtils fileDownUtils) {
+ super(eventBus, session, stateManager, entityOptions, groupService, backManager, styleSelector,
+ i18n, fileDownUtils);
+ init(view);
+ }
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStyleView.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfView.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStyleView.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStyleView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,24 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.style;
+
+public interface UserOptStyleView extends EntityOptStyleView {
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStyleView.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConf.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConf.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConf.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.style;
-
-public interface UserOptionsStyleConf extends EntityOptionsStyleConf {
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfPanel.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfPanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,37 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.style;
-
-import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.themes.GSpaceThemeSelectorPanel;
-
-import com.google.inject.Inject;
-
-public class UserOptionsStyleConfPanel extends EntityOptionsStyleConfPanel implements
- UserOptionsStyleConfView {
-
- @Inject
- public UserOptionsStyleConfPanel(final I18nTranslationService i18n, final CoreResources res,
- final GSpaceThemeSelectorPanel styleSelector) {
- super(i18n, res, styleSelector);
- }
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfPresenter.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfPresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,50 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.style;
-
-import cc.kune.core.client.rpcservices.GroupServiceAsync;
-import cc.kune.core.client.services.FileDownloadUtils;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.options.UserOptions;
-import cc.kune.gspace.client.style.GSpaceBackManager;
-import cc.kune.gspace.client.themes.GSpaceThemeSelectorPresenter;
-
-import com.google.gwt.event.shared.EventBus;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public class UserOptionsStyleConfPresenter extends EntityOptionsStyleConfPresenter implements
- UserOptionsStyleConf {
-
- // private final WsThemeSelector themeSelector;
-
- @Inject
- public UserOptionsStyleConfPresenter(final EventBus eventBus, final Session session,
- final StateManager stateManager, final UserOptions entityOptions,
- final Provider<GroupServiceAsync> groupService, final GSpaceBackManager backManager,
- final UserOptionsStyleConfView view, final GSpaceThemeSelectorPresenter styleSelector,
- final I18nTranslationService i18n, final FileDownloadUtils fileDownUtils) {
- super(eventBus, session, stateManager, entityOptions, groupService, backManager, styleSelector,
- i18n, fileDownUtils);
- init(view);
- }
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfView.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.style;
-
-public interface UserOptionsStyleConfView extends EntityOptionsStyleConfView {
-
-}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptTools.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConf.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptTools.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptTools.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,24 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.tools;
+
+public interface EntityOptTools {
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptTools.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptToolsPanel.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConfPanel.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptToolsPanel.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptToolsPanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,158 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.tools;
+
+import java.util.HashMap;
+
+import cc.kune.common.client.log.Log;
+import cc.kune.common.client.tooltip.Tooltip;
+import cc.kune.common.client.ui.IconLabel;
+import cc.kune.common.client.ui.MaskWidget;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.ui.DefaultForm;
+import cc.kune.core.shared.dto.ToolSimpleDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.options.EntityOptionsView;
+
+import com.extjs.gxt.ui.client.event.BaseEvent;
+import com.extjs.gxt.ui.client.event.Events;
+import com.extjs.gxt.ui.client.event.Listener;
+import com.extjs.gxt.ui.client.widget.form.CheckBox;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.ui.IsWidget;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Widget;
+
+public class EntityOptToolsPanel extends DefaultForm implements EntityOptToolsView {
+ private final HashMap<String, CheckBox> fields;
+ private final I18nTranslationService i18n;
+ private final MaskWidget maskWidget;
+ private final IconLabel tabTitle;
+
+ public EntityOptToolsPanel(final I18nTranslationService i18n, final CoreResources res,
+ final MaskWidget maskWidget) {
+ this.maskWidget = maskWidget;
+ tabTitle = new IconLabel(res.kunePreferences(), i18n.t("Tools"));
+ this.i18n = i18n;
+ // super.setHeight(EntityOptionsView.HEIGHT);
+ super.setWidth(EntityOptionsView.WIDTH);
+ super.setFrame(true);
+ // super.add(new HiddenField());
+ super.getFormPanel().setLabelWidth(20);
+ fields = new HashMap<String, CheckBox>();
+ super.addStyleName("k-overflow-y-auto");
+ // super.addStyleName("k-tab-panel");
+ }
+
+ @Override
+ public void add(final ToolSimpleDTO tool, final boolean enabled, final boolean checked,
+ final ClickHandler handler) {
+ final CheckBox checkbox = new CheckBox();
+ checkbox.setFieldLabel(tool.getRootName());
+ // checkbox.setFireChangeEventOnSetValue(false);
+ checkbox.setValue(checked);
+ setEnabled(checkbox, enabled);
+ checkbox.addListener(Events.Change, new Listener<BaseEvent>() {
+ @Override
+ public void handleEvent(final BaseEvent be) {
+ handler.onClick(null);
+ }
+ });
+ super.add(checkbox);
+ fields.put(tool.getName(), checkbox);
+ doLayoutIfNeeded();
+ }
+
+ @Override
+ public Widget asWidget() {
+ return super.getFormPanel();
+ }
+
+ @Override
+ public void clear() {
+ super.getFormPanel().removeAll();
+ fields.clear();
+ final Label label = new Label();
+ label.setText(i18n.t("Here you can select the tools used:"));
+ label.addStyleName("kune-Margin-10-tb");
+ super.add(label);
+ }
+
+ private void doLayoutIfNeeded() {
+ if (super.getFormPanel().isRendered()) {
+ super.getFormPanel().layout();
+ }
+ }
+
+ @Override
+ public IsWidget getTabTitle() {
+ return tabTitle;
+ }
+
+ private CheckBox getTool(final String tool) {
+ final CheckBox field = fields.get(tool);
+ if (field == null) {
+ Log.error("Field " + tool + " not found in EOTCP");
+ }
+ return field;
+ }
+
+ @Override
+ public boolean isChecked(final String tool) {
+ final CheckBox field = getTool(tool);
+ return field.getValue();
+ }
+
+ @Override
+ public void mask() {
+ maskWidget.mask(this);
+ }
+
+ @Override
+ public void setChecked(final String tool, final boolean checked) {
+ final CheckBox field = getTool(tool);
+ field.setValue(checked);
+ }
+
+ private void setEnabled(final CheckBox checkbox, final boolean enabled) {
+ if (enabled) {
+ checkbox.enable();
+ } else {
+ checkbox.disable();
+ }
+ }
+
+ @Override
+ public void setEnabled(final String tool, final boolean enabled) {
+ final CheckBox field = getTool(tool);
+ setEnabled(field, enabled);
+ }
+
+ @Override
+ public void setTooltip(final String tool, final String tip) {
+ final CheckBox field = getTool(tool);
+ Tooltip.to(field, tip);
+ }
+
+ @Override
+ public void unmask() {
+ maskWidget.unMask();
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptToolsPanel.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptToolsPresenter.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConfPresenter.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptToolsPresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptToolsPresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,147 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.tools;
+
+import java.util.Collection;
+import java.util.List;
+
+import cc.kune.common.client.notify.NotifyLevel;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.core.client.rpcservices.GroupServiceAsync;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.ToolSimpleDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.options.EntityOptions;
+
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.ui.IsWidget;
+import com.google.inject.Provider;
+
+public abstract class EntityOptToolsPresenter {
+
+ private final EntityOptions entityOptions;
+ private final Provider<GroupServiceAsync> groupService;
+ protected final I18nTranslationService i18n;
+ protected final Session session;
+ protected final StateManager stateManager;
+ private EntityOptToolsView view;
+
+ public EntityOptToolsPresenter(final Session session, final StateManager stateManager,
+ final I18nTranslationService i18n, final EntityOptions entityOptions,
+ final Provider<GroupServiceAsync> groupService) {
+ this.session = session;
+ this.stateManager = stateManager;
+ this.i18n = i18n;
+ this.entityOptions = entityOptions;
+ this.groupService = groupService;
+ }
+
+ protected abstract boolean applicable();
+
+ protected abstract Collection<ToolSimpleDTO> getAllTools();
+
+ protected abstract StateToken getDefContentToken();
+
+ protected abstract String getDefContentTooltip();
+
+ protected abstract List<String> getEnabledTools();
+
+ protected abstract StateToken getOperationToken();
+
+ public IsWidget getView() {
+ return view;
+ }
+
+ protected abstract void gotoDifLocationIfNecessary(String toolName);
+
+ public void init(final EntityOptToolsView view) {
+ this.view = view;
+ setState();
+ entityOptions.addTab(view, view.getTabTitle());
+ }
+
+ private void onCheck(final ToolSimpleDTO tool, final boolean checked) {
+ final List<String> enabledTools = getEnabledTools();
+ final String toolName = tool.getName();
+ setToolCheckedInServer(checked, toolName);
+ if (!checked) {
+ if (enabledTools.contains(toolName)) {
+ // FIXME uncomment this when fixed
+ // setToolCheckedInServer(checked, toolName);
+ // gotoDifLocationIfNecessary(toolName);
+ }
+ }
+ }
+
+ protected void reset() {
+ view.clear();
+ entityOptions.hideMessages();
+ }
+
+ protected void setState() {
+ reset();
+ final Collection<ToolSimpleDTO> toolCollection = getAllTools();
+ final List<String> enabledTools = getEnabledTools();
+ for (final ToolSimpleDTO tool : toolCollection) {
+ final boolean checked = enabledTools.contains(tool.getName());
+ final boolean enabled = true;
+ view.add(tool, enabled, checked, new ClickHandler() {
+ @Override
+ public void onClick(final ClickEvent event) {
+ onCheck(tool, view.isChecked(tool.getName()));
+ }
+ });
+ }
+ // Disable def content tool (don't works now)
+ final StateToken token = getDefContentToken();
+ if (token != null) {
+ final String defContentTool = token.getTool();
+ if (defContentTool != null) {
+ // view.setEnabled(defContentTool, false);
+ view.setTooltip(defContentTool, getDefContentTooltip());
+ }
+ }
+ }
+
+ protected void setToolCheckedInServer(final boolean checked, final String toolName) {
+ // view.mask();
+ // NotifyUser.info("Dis/Enabling tool" + toolName + " - " + checked);
+ groupService.get().setToolEnabled(session.getUserHash(), getOperationToken(), toolName, checked,
+ new AsyncCallback<Void>() {
+ @Override
+ public void onFailure(final Throwable caught) {
+ view.setChecked(toolName, !checked);
+ entityOptions.setErrorMessage(i18n.t("Error configuring the tool"), NotifyLevel.error);
+ NotifyUser.error(i18n.t("Error configuring the tool"));
+ // view.unmask();
+ }
+
+ @Override
+ public void onSuccess(final Void result) {
+ stateManager.reload();
+ // view.unmask();
+ }
+ });
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptToolsPresenter.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptToolsView.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConfView.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptToolsView.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptToolsView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,44 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.tools;
+
+import cc.kune.core.shared.dto.ToolSimpleDTO;
+import cc.kune.gspace.client.options.EntityOptionsTabView;
+
+import com.google.gwt.event.dom.client.ClickHandler;
+
+public interface EntityOptToolsView extends EntityOptionsTabView {
+
+ void add(ToolSimpleDTO tool, boolean enabled, boolean checked, ClickHandler clickHandler);
+
+ void clear();
+
+ boolean isChecked(String tool);
+
+ void mask();
+
+ void setChecked(String tool, boolean checked);
+
+ void setEnabled(String tool, boolean enabled);
+
+ void setTooltip(String tool, String tip);
+
+ void unmask();
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptToolsView.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConf.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConf.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConf.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.tools;
-
-public interface EntityOptionsToolsConf {
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConfPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConfPanel.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConfPanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,158 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.tools;
-
-import java.util.HashMap;
-
-import cc.kune.common.client.log.Log;
-import cc.kune.common.client.tooltip.Tooltip;
-import cc.kune.common.client.ui.IconLabel;
-import cc.kune.common.client.ui.MaskWidget;
-import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.client.ui.DefaultForm;
-import cc.kune.core.shared.dto.ToolSimpleDTO;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.options.EntityOptionsView;
-
-import com.extjs.gxt.ui.client.event.BaseEvent;
-import com.extjs.gxt.ui.client.event.Events;
-import com.extjs.gxt.ui.client.event.Listener;
-import com.extjs.gxt.ui.client.widget.form.CheckBox;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.user.client.ui.IsWidget;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.Widget;
-
-public class EntityOptionsToolsConfPanel extends DefaultForm implements EntityOptionsToolsConfView {
- private final HashMap<String, CheckBox> fields;
- private final I18nTranslationService i18n;
- private final MaskWidget maskWidget;
- private final IconLabel tabTitle;
-
- public EntityOptionsToolsConfPanel(final I18nTranslationService i18n, final CoreResources res,
- final MaskWidget maskWidget) {
- this.maskWidget = maskWidget;
- tabTitle = new IconLabel(res.kunePreferences(), i18n.t("Tools"));
- this.i18n = i18n;
- // super.setHeight(EntityOptionsView.HEIGHT);
- super.setWidth(EntityOptionsView.WIDTH);
- super.setFrame(true);
- // super.add(new HiddenField());
- super.getFormPanel().setLabelWidth(20);
- fields = new HashMap<String, CheckBox>();
- super.addStyleName("k-overflow-y-auto");
- // super.addStyleName("k-tab-panel");
- }
-
- @Override
- public void add(final ToolSimpleDTO tool, final boolean enabled, final boolean checked,
- final ClickHandler handler) {
- final CheckBox checkbox = new CheckBox();
- checkbox.setFieldLabel(tool.getRootName());
- // checkbox.setFireChangeEventOnSetValue(false);
- checkbox.setValue(checked);
- setEnabled(checkbox, enabled);
- checkbox.addListener(Events.Change, new Listener<BaseEvent>() {
- @Override
- public void handleEvent(final BaseEvent be) {
- handler.onClick(null);
- }
- });
- super.add(checkbox);
- fields.put(tool.getName(), checkbox);
- doLayoutIfNeeded();
- }
-
- @Override
- public Widget asWidget() {
- return super.getFormPanel();
- }
-
- @Override
- public void clear() {
- super.getFormPanel().removeAll();
- fields.clear();
- final Label label = new Label();
- label.setText(i18n.t("Here you can select the tools used:"));
- label.addStyleName("kune-Margin-10-tb");
- super.add(label);
- }
-
- private void doLayoutIfNeeded() {
- if (super.getFormPanel().isRendered()) {
- super.getFormPanel().layout();
- }
- }
-
- @Override
- public IsWidget getTabTitle() {
- return tabTitle;
- }
-
- private CheckBox getTool(final String tool) {
- final CheckBox field = fields.get(tool);
- if (field == null) {
- Log.error("Field " + tool + " not found in EOTCP");
- }
- return field;
- }
-
- @Override
- public boolean isChecked(final String tool) {
- final CheckBox field = getTool(tool);
- return field.getValue();
- }
-
- @Override
- public void mask() {
- maskWidget.mask(this);
- }
-
- @Override
- public void setChecked(final String tool, final boolean checked) {
- final CheckBox field = getTool(tool);
- field.setValue(checked);
- }
-
- private void setEnabled(final CheckBox checkbox, final boolean enabled) {
- if (enabled) {
- checkbox.enable();
- } else {
- checkbox.disable();
- }
- }
-
- @Override
- public void setEnabled(final String tool, final boolean enabled) {
- final CheckBox field = getTool(tool);
- setEnabled(field, enabled);
- }
-
- @Override
- public void setTooltip(final String tool, final String tip) {
- final CheckBox field = getTool(tool);
- Tooltip.to(field, tip);
- }
-
- @Override
- public void unmask() {
- maskWidget.unMask();
- }
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConfPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConfPresenter.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConfPresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,147 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.tools;
-
-import java.util.Collection;
-import java.util.List;
-
-import cc.kune.common.client.notify.NotifyLevel;
-import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.core.client.rpcservices.GroupServiceAsync;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.ToolSimpleDTO;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.options.EntityOptions;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.google.gwt.user.client.ui.IsWidget;
-import com.google.inject.Provider;
-
-public abstract class EntityOptionsToolsConfPresenter {
-
- private final EntityOptions entityOptions;
- private final Provider<GroupServiceAsync> groupService;
- protected final I18nTranslationService i18n;
- protected final Session session;
- protected final StateManager stateManager;
- private EntityOptionsToolsConfView view;
-
- public EntityOptionsToolsConfPresenter(final Session session, final StateManager stateManager,
- final I18nTranslationService i18n, final EntityOptions entityOptions,
- final Provider<GroupServiceAsync> groupService) {
- this.session = session;
- this.stateManager = stateManager;
- this.i18n = i18n;
- this.entityOptions = entityOptions;
- this.groupService = groupService;
- }
-
- protected abstract boolean applicable();
-
- protected abstract Collection<ToolSimpleDTO> getAllTools();
-
- protected abstract StateToken getDefContentToken();
-
- protected abstract String getDefContentTooltip();
-
- protected abstract List<String> getEnabledTools();
-
- protected abstract StateToken getOperationToken();
-
- public IsWidget getView() {
- return view;
- }
-
- protected abstract void gotoDifLocationIfNecessary(String toolName);
-
- public void init(final EntityOptionsToolsConfView view) {
- this.view = view;
- setState();
- entityOptions.addTab(view, view.getTabTitle());
- }
-
- private void onCheck(final ToolSimpleDTO tool, final boolean checked) {
- final List<String> enabledTools = getEnabledTools();
- final String toolName = tool.getName();
- setToolCheckedInServer(checked, toolName);
- if (!checked) {
- if (enabledTools.contains(toolName)) {
- // FIXME uncomment this when fixed
- // setToolCheckedInServer(checked, toolName);
- // gotoDifLocationIfNecessary(toolName);
- }
- }
- }
-
- protected void reset() {
- view.clear();
- entityOptions.hideMessages();
- }
-
- protected void setState() {
- reset();
- final Collection<ToolSimpleDTO> toolCollection = getAllTools();
- final List<String> enabledTools = getEnabledTools();
- for (final ToolSimpleDTO tool : toolCollection) {
- final boolean checked = enabledTools.contains(tool.getName());
- final boolean enabled = true;
- view.add(tool, enabled, checked, new ClickHandler() {
- @Override
- public void onClick(final ClickEvent event) {
- onCheck(tool, view.isChecked(tool.getName()));
- }
- });
- }
- // Disable def content tool (don't works now)
- final StateToken token = getDefContentToken();
- if (token != null) {
- final String defContentTool = token.getTool();
- if (defContentTool != null) {
- // view.setEnabled(defContentTool, false);
- view.setTooltip(defContentTool, getDefContentTooltip());
- }
- }
- }
-
- protected void setToolCheckedInServer(final boolean checked, final String toolName) {
- // view.mask();
- // NotifyUser.info("Dis/Enabling tool" + toolName + " - " + checked);
- groupService.get().setToolEnabled(session.getUserHash(), getOperationToken(), toolName, checked,
- new AsyncCallback<Void>() {
- @Override
- public void onFailure(final Throwable caught) {
- view.setChecked(toolName, !checked);
- entityOptions.setErrorMessage(i18n.t("Error configuring the tool"), NotifyLevel.error);
- NotifyUser.error(i18n.t("Error configuring the tool"));
- // view.unmask();
- }
-
- @Override
- public void onSuccess(final Void result) {
- stateManager.reload();
- // view.unmask();
- }
- });
- }
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConfView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConfView.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/EntityOptionsToolsConfView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.tools;
-
-import cc.kune.core.shared.dto.ToolSimpleDTO;
-import cc.kune.gspace.client.options.EntityOptionsTabView;
-
-import com.google.gwt.event.dom.client.ClickHandler;
-
-public interface EntityOptionsToolsConfView extends EntityOptionsTabView {
-
- void add(ToolSimpleDTO tool, boolean enabled, boolean checked, ClickHandler clickHandler);
-
- void clear();
-
- boolean isChecked(String tool);
-
- void mask();
-
- void setChecked(String tool, boolean checked);
-
- void setEnabled(String tool, boolean enabled);
-
- void setTooltip(String tool, String tip);
-
- void unmask();
-}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptTools.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptionsToolsConf.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptTools.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptTools.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,24 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.tools;
+
+public interface GroupOptTools extends EntityOptTools {
+
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptToolsPanel.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptionsToolsConfPanel.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptToolsPanel.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptToolsPanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,37 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.tools;
+
+import cc.kune.common.client.ui.MaskWidget;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+
+public class GroupOptToolsPanel extends EntityOptToolsPanel implements
+ GroupOptToolsView {
+
+ @Inject
+ public GroupOptToolsPanel(final I18nTranslationService i18n, final CoreResources res,
+ final MaskWidget maskWidget) {
+ super(i18n, res, maskWidget);
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptToolsPanel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptToolsPresenter.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptionsToolsConfPresenter.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptToolsPresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptToolsPresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,98 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.tools;
+
+import java.util.Collection;
+import java.util.List;
+
+import cc.kune.core.client.rpcservices.GroupServiceAsync;
+import cc.kune.core.client.state.GroupChangedEvent;
+import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.ContentSimpleDTO;
+import cc.kune.core.shared.dto.ToolSimpleDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.options.GroupOptions;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class GroupOptToolsPresenter extends EntityOptToolsPresenter implements
+ GroupOptTools {
+
+ @Inject
+ public GroupOptToolsPresenter(final StateManager stateManager, final Session session,
+ final I18nTranslationService i18n, final GroupOptions entityOptions,
+ final Provider<GroupServiceAsync> groupService, final GroupOptToolsView view) {
+ super(session, stateManager, i18n, entityOptions, groupService);
+ init(view);
+ stateManager.onGroupChanged(true, new GroupChangedHandler() {
+ @Override
+ public void onGroupChanged(final GroupChangedEvent event) {
+ setState();
+ }
+ });
+ }
+
+ @Override
+ protected boolean applicable() {
+ return session.isCurrentStateAGroup();
+ }
+
+ @Override
+ protected Collection<ToolSimpleDTO> getAllTools() {
+ return session.getGroupTools();
+ }
+
+ @Override
+ protected StateToken getDefContentToken() {
+ final ContentSimpleDTO defaultContent = session.getCurrentState().getGroup().getDefaultContent();
+ return defaultContent == null ? null : defaultContent.getStateToken();
+ }
+
+ @Override
+ protected String getDefContentTooltip() {
+ // FIXME
+ return i18n.t("You cannot disable this tool because it's where the current group home page is located. To do that you have to select other content as the default group home page but in another tool.");
+ }
+
+ @Override
+ protected List<String> getEnabledTools() {
+ return session.getCurrentState().getEnabledTools();
+ }
+
+ @Override
+ protected StateToken getOperationToken() {
+ return session.getCurrentStateToken();
+ }
+
+ @Override
+ protected void gotoDifLocationIfNecessary(final String toolName) {
+ if (session.getCurrentStateToken().getTool().equals(toolName)) {
+ final ContentSimpleDTO defaultContent = session.getCurrentState().getGroup().getDefaultContent();
+ if (defaultContent != null) {
+ stateManager.gotoStateToken(defaultContent.getStateToken());
+ }
+ }
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptToolsPresenter.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptToolsView.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptionsToolsConfView.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptToolsView.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptToolsView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,24 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.tools;
+
+public interface GroupOptToolsView extends EntityOptToolsView {
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptToolsView.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptionsToolsConf.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptionsToolsConf.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptionsToolsConf.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.tools;
-
-public interface GroupOptionsToolsConf extends EntityOptionsToolsConf {
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptionsToolsConfPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptionsToolsConfPanel.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptionsToolsConfPanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,37 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.tools;
-
-import cc.kune.common.client.ui.MaskWidget;
-import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.google.inject.Inject;
-
-public class GroupOptionsToolsConfPanel extends EntityOptionsToolsConfPanel implements
- GroupOptionsToolsConfView {
-
- @Inject
- public GroupOptionsToolsConfPanel(final I18nTranslationService i18n, final CoreResources res,
- final MaskWidget maskWidget) {
- super(i18n, res, maskWidget);
- }
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptionsToolsConfPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptionsToolsConfPresenter.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptionsToolsConfPresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,98 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.tools;
-
-import java.util.Collection;
-import java.util.List;
-
-import cc.kune.core.client.rpcservices.GroupServiceAsync;
-import cc.kune.core.client.state.GroupChangedEvent;
-import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.ContentSimpleDTO;
-import cc.kune.core.shared.dto.ToolSimpleDTO;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.options.GroupOptions;
-
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public class GroupOptionsToolsConfPresenter extends EntityOptionsToolsConfPresenter implements
- GroupOptionsToolsConf {
-
- @Inject
- public GroupOptionsToolsConfPresenter(final StateManager stateManager, final Session session,
- final I18nTranslationService i18n, final GroupOptions entityOptions,
- final Provider<GroupServiceAsync> groupService, final GroupOptionsToolsConfView view) {
- super(session, stateManager, i18n, entityOptions, groupService);
- init(view);
- stateManager.onGroupChanged(true, new GroupChangedHandler() {
- @Override
- public void onGroupChanged(final GroupChangedEvent event) {
- setState();
- }
- });
- }
-
- @Override
- protected boolean applicable() {
- return session.isCurrentStateAGroup();
- }
-
- @Override
- protected Collection<ToolSimpleDTO> getAllTools() {
- return session.getGroupTools();
- }
-
- @Override
- protected StateToken getDefContentToken() {
- final ContentSimpleDTO defaultContent = session.getCurrentState().getGroup().getDefaultContent();
- return defaultContent == null ? null : defaultContent.getStateToken();
- }
-
- @Override
- protected String getDefContentTooltip() {
- // FIXME
- return i18n.t("You cannot disable this tool because it's where the current group home page is located. To do that you have to select other content as the default group home page but in another tool.");
- }
-
- @Override
- protected List<String> getEnabledTools() {
- return session.getCurrentState().getEnabledTools();
- }
-
- @Override
- protected StateToken getOperationToken() {
- return session.getCurrentStateToken();
- }
-
- @Override
- protected void gotoDifLocationIfNecessary(final String toolName) {
- if (session.getCurrentStateToken().getTool().equals(toolName)) {
- final ContentSimpleDTO defaultContent = session.getCurrentState().getGroup().getDefaultContent();
- if (defaultContent != null) {
- stateManager.gotoStateToken(defaultContent.getStateToken());
- }
- }
- }
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptionsToolsConfView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptionsToolsConfView.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptionsToolsConfView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.tools;
-
-public interface GroupOptionsToolsConfView extends EntityOptionsToolsConfView {
-
-}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptTools.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptionsToolsConf.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptTools.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptTools.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,24 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.tools;
+
+public interface UserOptTools extends EntityOptTools {
+
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptToolsPanel.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptionsToolsConfPanel.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptToolsPanel.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptToolsPanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,37 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.tools;
+
+import cc.kune.common.client.ui.MaskWidget;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+
+public class UserOptToolsPanel extends EntityOptToolsPanel implements
+ UserOptToolsView {
+
+ @Inject
+ public UserOptToolsPanel(final I18nTranslationService i18n, final CoreResources res,
+ final MaskWidget maskWidget) {
+ super(i18n, res, maskWidget);
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptToolsPanel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptToolsPresenter.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptionsToolsConfPresenter.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptToolsPresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptToolsPresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,94 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.tools;
+
+import java.util.Collection;
+import java.util.List;
+
+import cc.kune.core.client.rpcservices.GroupServiceAsync;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.client.state.UserSignInEvent;
+import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.ToolSimpleDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.options.UserOptions;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class UserOptToolsPresenter extends EntityOptToolsPresenter implements
+ UserOptTools {
+
+ @Inject
+ public UserOptToolsPresenter(final Session session, final StateManager stateManager,
+ final I18nTranslationService i18n, final UserOptions entityOptions,
+ final Provider<GroupServiceAsync> groupService, final UserOptToolsView view) {
+ super(session, stateManager, i18n, entityOptions, groupService);
+ init(view);
+ session.onUserSignIn(true, new UserSignInHandler() {
+ @Override
+ public void onUserSignIn(final UserSignInEvent event) {
+ setState();
+ }
+ });
+ }
+
+ @Override
+ protected boolean applicable() {
+ return session.isLogged();
+ }
+
+ @Override
+ protected Collection<ToolSimpleDTO> getAllTools() {
+ return session.getUserTools();
+ }
+
+ @Override
+ protected StateToken getDefContentToken() {
+ final String homePage = session.getCurrentUserInfo().getHomePage();
+ return homePage == null ? null : new StateToken(homePage);
+ }
+
+ @Override
+ protected String getDefContentTooltip() {
+ // FIXME
+ return i18n.t("You cannot disable this tool because it's where your home page is located. To do that you have to select other content as the default home page but in another tool.");
+ }
+
+ @Override
+ protected List<String> getEnabledTools() {
+ return session.getCurrentUserInfo().getEnabledTools();
+ }
+
+ @Override
+ protected StateToken getOperationToken() {
+ return session.getCurrentUser().getStateToken();
+ }
+
+ @Override
+ protected void gotoDifLocationIfNecessary(final String toolName) {
+ if (session.getCurrentStateToken().getGroup().equals(session.getCurrentUserInfo().getShortName())
+ && session.getCurrentStateToken().getTool().equals(toolName)) {
+ stateManager.gotoStateToken(session.getCurrentState().getGroup().getDefaultContent().getStateToken());
+ }
+ }
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptToolsView.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptionsToolsConfView.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptToolsView.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptToolsView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -0,0 +1,24 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.options.tools;
+
+public interface UserOptToolsView extends EntityOptToolsView {
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptToolsView.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptionsToolsConf.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptionsToolsConf.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptionsToolsConf.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.tools;
-
-public interface UserOptionsToolsConf extends EntityOptionsToolsConf {
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptionsToolsConfPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptionsToolsConfPanel.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptionsToolsConfPanel.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,37 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.tools;
-
-import cc.kune.common.client.ui.MaskWidget;
-import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.google.inject.Inject;
-
-public class UserOptionsToolsConfPanel extends EntityOptionsToolsConfPanel implements
- UserOptionsToolsConfView {
-
- @Inject
- public UserOptionsToolsConfPanel(final I18nTranslationService i18n, final CoreResources res,
- final MaskWidget maskWidget) {
- super(i18n, res, maskWidget);
- }
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptionsToolsConfPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptionsToolsConfPresenter.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptionsToolsConfPresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,94 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.tools;
-
-import java.util.Collection;
-import java.util.List;
-
-import cc.kune.core.client.rpcservices.GroupServiceAsync;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.client.state.UserSignInEvent;
-import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.ToolSimpleDTO;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.options.UserOptions;
-
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public class UserOptionsToolsConfPresenter extends EntityOptionsToolsConfPresenter implements
- UserOptionsToolsConf {
-
- @Inject
- public UserOptionsToolsConfPresenter(final Session session, final StateManager stateManager,
- final I18nTranslationService i18n, final UserOptions entityOptions,
- final Provider<GroupServiceAsync> groupService, final UserOptionsToolsConfView view) {
- super(session, stateManager, i18n, entityOptions, groupService);
- init(view);
- session.onUserSignIn(true, new UserSignInHandler() {
- @Override
- public void onUserSignIn(final UserSignInEvent event) {
- setState();
- }
- });
- }
-
- @Override
- protected boolean applicable() {
- return session.isLogged();
- }
-
- @Override
- protected Collection<ToolSimpleDTO> getAllTools() {
- return session.getUserTools();
- }
-
- @Override
- protected StateToken getDefContentToken() {
- final String homePage = session.getCurrentUserInfo().getHomePage();
- return homePage == null ? null : new StateToken(homePage);
- }
-
- @Override
- protected String getDefContentTooltip() {
- // FIXME
- return i18n.t("You cannot disable this tool because it's where your home page is located. To do that you have to select other content as the default home page but in another tool.");
- }
-
- @Override
- protected List<String> getEnabledTools() {
- return session.getCurrentUserInfo().getEnabledTools();
- }
-
- @Override
- protected StateToken getOperationToken() {
- return session.getCurrentUser().getStateToken();
- }
-
- @Override
- protected void gotoDifLocationIfNecessary(final String toolName) {
- if (session.getCurrentStateToken().getGroup().equals(session.getCurrentUserInfo().getShortName())
- && session.getCurrentStateToken().getTool().equals(toolName)) {
- stateManager.gotoStateToken(session.getCurrentState().getGroup().getDefaultContent().getStateToken());
- }
- }
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptionsToolsConfView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptionsToolsConfView.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptionsToolsConfView.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.options.tools;
-
-public interface UserOptionsToolsConfView extends EntityOptionsToolsConfView {
-
-}
Modified: trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeSelectorPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeSelectorPresenter.java 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeSelectorPresenter.java 2011-06-21 21:29:32 UTC (rev 1413)
@@ -84,6 +84,8 @@
this.manager = manager;
this.view = view;
itemMap = new HashMap<String, MenuRadioItemDescriptor>();
+ this.view = view;
+ createActions();
eventBus.addHandler(GSpaceThemeChangeEvent.getType(), new GSpaceThemeChangeHandler() {
@Override
public void onGsThemeChange(final GSpaceThemeChangeEvent event) {
@@ -92,8 +94,6 @@
select(oldTheme, newTheme);
}
});
- this.view = view;
- createActions();
}
private void createActions() {
Modified: trunk/src/main/resources/kune.properties
===================================================================
--- trunk/src/main/resources/kune.properties 2011-06-21 20:03:39 UTC (rev 1412)
+++ trunk/src/main/resources/kune.properties 2011-06-21 21:29:32 UTC (rev 1413)
@@ -35,7 +35,7 @@
### Workspace enabled themes
# This names are also the name of the items in the theme menu and there are translated
-kune.wsthemes = default,green,purple,grey,red,sahara,blue,redblack,camp,pink,highcontrast,whiteblack,blackwhite
+kune.wsthemes = default,green,purple,grey,red,sahara,blue,redblack,camp,pink,highcontrast,whiteblack,blackwhite,transparent
kune.wsthemes.default = default
kune.wsthemes.default.backgrounds = #deaa87, #d99e76, #ce7f4b, #d99e76, #f6e7dd, #d99e76, #FFF, #f8eee7
kune.wsthemes.default.colors = #FFF,#FFF,#FFF,#FFF,#552200,#FFF,#a05a2c,#a05a2c
@@ -63,6 +63,8 @@
kune.wsthemes.whiteblack.colors = #000, #000, #000, #000, #000, #000, #000, #000
kune.wsthemes.blackwhite.backgrounds = #000, #000, #808080, #000, #000, #e6e6e6, #000, #000
kune.wsthemes.blackwhite.colors = #FFF, #FFF, #000, #FFF, #FFF, #000, #FFF, #FFF
+kune.wsthemes.transparent.backgrounds = transparent, transparent, #e6e6e6, transparent, transparent, #e6e6e6, transparent, transparent
+kune.wsthemes.transparent.colors = #000, #000, #000, #000, #000, #000, #000, #000
### Gallery options
kune.upload.gallerypermittedextensions = jpg,jpeg,png,gif,bmp,svg,avi,mpg,mpeg,ogg,mov,tif,tiff,mp3,wav
1
0
Author: vjrj_
Date: 2011-06-21 22:03:39 +0200 (Tue, 21 Jun 2011)
New Revision: 1412
Added:
trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundDownloadManager.java
trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundUploadManager.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsUploadButton.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityUploaderForm.java
Modified:
trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java
trunk/src/main/java/cc/kune/common/public/kune-common.css
trunk/src/main/java/cc/kune/core/client/rpcservices/GroupService.java
trunk/src/main/java/cc/kune/core/client/rpcservices/GroupServiceAsync.java
trunk/src/main/java/cc/kune/core/client/services/FileDownloadUtils.java
trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java
trunk/src/main/java/cc/kune/core/public/ws.css
trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
trunk/src/main/java/cc/kune/core/server/manager/FileManager.java
trunk/src/main/java/cc/kune/core/server/manager/GroupManager.java
trunk/src/main/java/cc/kune/core/server/manager/file/FileGwtUploadAbstractServlet.java
trunk/src/main/java/cc/kune/core/server/manager/file/FileManagerDefault.java
trunk/src/main/java/cc/kune/core/server/manager/file/FileUploadManager.java
trunk/src/main/java/cc/kune/core/server/manager/file/FileUtils.java
trunk/src/main/java/cc/kune/core/server/manager/file/ImageUtilsDefault.java
trunk/src/main/java/cc/kune/core/server/manager/impl/GroupManagerDefault.java
trunk/src/main/java/cc/kune/core/server/rpc/GroupRPC.java
trunk/src/main/java/cc/kune/core/shared/dto/GroupDTO.java
trunk/src/main/java/cc/kune/domain/Group.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml
trunk/src/main/java/cc/kune/gspace/client/options/logo/CurrentLogoChangedEvent.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogoPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfView.java
trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfPresenter.java
trunk/src/main/java/cc/kune/gspace/client/resources/gSpaceArmor.css
trunk/src/main/java/cc/kune/gspace/client/style/GSpaceBackManager.java
trunk/src/main/java/cc/kune/gspace/client/style/GSpaceBackManagerImpl.java
trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeManager.java
trunk/src/main/java/cc/kune/pspace/client/PSpaceInDevelopment.ui.xml
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java
trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java
trunk/src/main/java/org/ourproject/kune/workspace/client/OldAbstractFoldableContentActions.java
Log:
Group Background management
Modified: trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -20,6 +20,7 @@
package cc.kune.common.client.notify;
import cc.kune.common.client.utils.SimpleResponseCallback;
+import cc.kune.common.client.utils.TextUtils;
import cc.kune.core.client.notify.msgs.UserNotifyEvent;
import cc.kune.core.client.notify.spiner.ProgressHideEvent;
import cc.kune.core.client.notify.spiner.ProgressShowEvent;
@@ -51,6 +52,11 @@
eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error, message, closeable));
}
+ public static void error(final String message, final String additionalMessage) {
+ eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error, message
+ + (TextUtils.empty(additionalMessage) ? "" : ": " + additionalMessage)));
+ }
+
public static void error(final String message, final String title, final boolean closeable) {
eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error, message, title, closeable));
}
Modified: trunk/src/main/java/cc/kune/common/public/kune-common.css
===================================================================
--- trunk/src/main/java/cc/kune/common/public/kune-common.css 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/common/public/kune-common.css 2011-06-21 20:03:39 UTC (rev 1412)
@@ -211,7 +211,7 @@
float: right;
}
-.oc-clean {
+.oc-clean,.k-clear,.oc-clear,.k-clean {
clear: both;
}
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/GroupService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/GroupService.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/GroupService.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -32,23 +32,23 @@
@RemoteServiceRelativePath("GroupService")
public interface GroupService extends RemoteService {
- void changeDefLicense(final String userHash, final StateToken groupToken, final LicenseDTO license);
+ void changeDefLicense(final String userHash, final StateToken groupToken, final LicenseDTO license);
- void changeGroupWsTheme(String userHash, StateToken groupToken, String theme) throws DefaultException;
+ void changeGroupWsTheme(String userHash, StateToken groupToken, String theme) throws DefaultException;
- GroupDTO clearGroupBackImage(String userHash, StateToken token);
+ GroupDTO clearGroupBackImage(String userHash, StateToken token);
- StateToken createNewGroup(String userHash, GroupDTO group, String publicDesc, String tags, String[] enabledTools)
- throws DefaultException;
+ StateToken createNewGroup(String userHash, GroupDTO group, String publicDesc, String tags,
+ String[] enabledTools) throws DefaultException;
- GroupDTO getGroup(String userHash, StateToken token);
+ GroupDTO getGroup(String userHash, StateToken token);
- GroupDTO setGroupBackImage(String userHash, StateToken token);
+ void setGroupNewMembersJoiningPolicy(String userHash, StateToken groupToken,
+ AdmissionType admissionPolicy);
- void setGroupNewMembersJoiningPolicy(String userHash, StateToken groupToken, AdmissionType admissionPolicy);
+ void setSocialNetworkVisibility(String userHash, StateToken groupToken,
+ SocialNetworkVisibility visibility);
- void setSocialNetworkVisibility(String userHash, StateToken groupToken, SocialNetworkVisibility visibility);
+ void setToolEnabled(String userHash, StateToken groupToken, String toolName, boolean enabled);
- void setToolEnabled(String userHash, StateToken groupToken, String toolName, boolean enabled);
-
}
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/GroupServiceAsync.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/GroupServiceAsync.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/GroupServiceAsync.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -29,27 +29,26 @@
public interface GroupServiceAsync {
- void changeDefLicense(final String userHash, final StateToken groupToken, final LicenseDTO license,
- AsyncCallback<Void> asyncCallback);
+ void changeDefLicense(final String userHash, final StateToken groupToken, final LicenseDTO license,
+ AsyncCallback<Void> asyncCallback);
- void changeGroupWsTheme(String userHash, StateToken groupToken, String theme, AsyncCallback<Void> callback);
+ void changeGroupWsTheme(String userHash, StateToken groupToken, String theme,
+ AsyncCallback<Void> callback);
- void clearGroupBackImage(String userHash, StateToken token, AsyncCallback<GroupDTO> asyncCallback);
+ void clearGroupBackImage(String userHash, StateToken token, AsyncCallback<GroupDTO> asyncCallback);
- void createNewGroup(String userHash, GroupDTO group, String publicDesc, String tags, String[] enabledTools,
- AsyncCallback<StateToken> callback);
+ void createNewGroup(String userHash, GroupDTO group, String publicDesc, String tags,
+ String[] enabledTools, AsyncCallback<StateToken> callback);
- void getGroup(String userHash, StateToken token, AsyncCallback<GroupDTO> asyncCallback);
+ void getGroup(String userHash, StateToken token, AsyncCallback<GroupDTO> asyncCallback);
- void setGroupBackImage(String userHash, StateToken token, AsyncCallback<GroupDTO> asyncCallback);
+ void setGroupNewMembersJoiningPolicy(String userHash, StateToken groupToken,
+ AdmissionType admissionPolicy, AsyncCallback<Void> asyncCallback);
- void setGroupNewMembersJoiningPolicy(String userHash, StateToken groupToken, AdmissionType admissionPolicy,
- AsyncCallback<Void> asyncCallback);
+ void setSocialNetworkVisibility(String userHash, StateToken token, SocialNetworkVisibility visibility,
+ AsyncCallback<Void> asyncCallback);
- void setSocialNetworkVisibility(String userHash, StateToken token, SocialNetworkVisibility visibility,
- AsyncCallback<Void> asyncCallback);
+ void setToolEnabled(String userHash, StateToken groupToken, String toolName, boolean enabled,
+ AsyncCallback<Void> asyncCallback);
- void setToolEnabled(String userHash, StateToken groupToken, String toolName, boolean enabled,
- AsyncCallback<Void> asyncCallback);
-
}
Modified: trunk/src/main/java/cc/kune/core/client/services/FileDownloadUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/services/FileDownloadUtils.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/core/client/services/FileDownloadUtils.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -33,6 +33,7 @@
public class FileDownloadUtils {
+ private static final String BACKDOWNLOADSERVLET = "servlets/EntityBackgroundDownloadManager";
private static final String DOWNLOADSERVLET = "servlets/FileDownloadManager";
protected static final String GROUP_NO_AVATAR_IMAGE = "images/group-def-icon.png";
private static final String LOGODOWNLOADSERVLET = "servlets/EntityLogoDownloadManager";
@@ -67,6 +68,16 @@
DOM.setElementAttribute(RootPanel.get("__download").getElement(), "src", url);
}
+ public String getBackgroundImageUrl(final StateToken token) {
+ return new Url(GWT.getModuleBaseURL() + BACKDOWNLOADSERVLET, new UrlParam(FileConstants.TOKEN,
+ token.toString())).toString();
+ }
+
+ public String getBackgroundResizedUrl(final StateToken token, final ImageSize imageSize) {
+ return new Url(GWT.getModuleBaseURL() + BACKDOWNLOADSERVLET, new UrlParam(FileConstants.TOKEN,
+ token.toString()), new UrlParam(FileConstants.IMGSIZE, imageSize.toString())).toString();
+ }
+
public String getGroupLogo(final GroupDTO group) {
return group.hasLogo() ? getLogoImageUrl(group.getStateToken())
: group.isPersonal() ? PERSON_NO_AVATAR_IMAGE : GROUP_NO_AVATAR_IMAGE;
Modified: trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -28,6 +28,7 @@
import cc.kune.core.client.state.TokenUtils;
import cc.kune.core.client.state.UserSignOutEvent;
import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.style.GSpaceBackManager;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
@@ -69,6 +70,7 @@
}
private final GSpaceArmor armor;
+ private final GSpaceBackManager backManager;
private Space currentSpace;
private String groupToken;
private String homeToken;
@@ -81,12 +83,13 @@
@Inject
public SpaceSelectorPresenter(final EventBus eventBus, final StateManager stateManager,
final SpaceSelectorView view, final SpaceSelectorProxy proxy, final GSpaceArmor armor,
- final Session session, final Provider<SignIn> signIn) {
+ final Session session, final Provider<SignIn> signIn, final GSpaceBackManager backManager) {
super(eventBus, view, proxy);
this.stateManager = stateManager;
this.armor = armor;
this.session = session;
this.signIn = signIn;
+ this.backManager = backManager;
currentSpace = null;
homeToken = SiteTokens.HOME;
userToken = SiteTokens.WAVEINBOX;
@@ -124,6 +127,7 @@
private void onGroupSpaceSelect() {
armor.selectGroupSpace();
+ backManager.restoreBackImage();
getView().setHomeBtnDown(false);
getView().setUserBtnDown(false);
getView().setGroupBtnDown(true);
@@ -133,6 +137,7 @@
private void onHomeSpaceSelect() {
armor.selectHomeSpace();
+ backManager.clearBackImage();
getView().setHomeBtnDown(true);
getView().setUserBtnDown(false);
getView().setGroupBtnDown(false);
@@ -142,6 +147,7 @@
private void onPublicSpaceSelect() {
armor.selectPublicSpace();
+ backManager.restoreBackImage();
getView().setHomeBtnDown(false);
getView().setUserBtnDown(false);
getView().setGroupBtnDown(false);
@@ -204,6 +210,7 @@
private void onUserSpaceSelect() {
if (session.isLogged()) {
armor.selectUserSpace();
+ backManager.clearBackImage();
getView().setHomeBtnDown(false);
getView().setUserBtnDown(true);
getView().setGroupBtnDown(false);
Modified: trunk/src/main/java/cc/kune/core/public/ws.css
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.css 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/core/public/ws.css 2011-06-21 20:03:39 UTC (rev 1412)
@@ -1,5 +1,6 @@
-CHARSET "UTF-8 "; body {
- background-color: white;
+CHARSET "UTF-8 ";
+body {
+ background-color: transparent;
color: black;
font-family: 'Ubuntu', Arial;
font-size: small;
Modified: trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/KuneRackModule.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/core/server/KuneRackModule.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -33,6 +33,8 @@
import cc.kune.core.client.rpcservices.SocialNetworkService;
import cc.kune.core.client.rpcservices.UserService;
import cc.kune.core.server.init.FinderRegistry;
+import cc.kune.core.server.manager.file.EntityBackgroundDownloadManager;
+import cc.kune.core.server.manager.file.EntityBackgroundUploadManager;
import cc.kune.core.server.manager.file.EntityLogoDownloadManager;
import cc.kune.core.server.manager.file.EntityLogoUploadManager;
import cc.kune.core.server.manager.file.FileDownloadManager;
@@ -139,7 +141,8 @@
builder.installRESTServices("^/ws/json/", TestJSONService.class, GroupJSONService.class,
UserJSONService.class, I18nTranslationJSONService.class, ContentJSONService.class);
builder.installServlet("^/ws/servlets/", FileUploadManager.class, FileDownloadManager.class,
- EntityLogoUploadManager.class, EntityLogoDownloadManager.class, FileGwtUploadServlet.class);
+ EntityLogoUploadManager.class, EntityLogoDownloadManager.class, FileGwtUploadServlet.class,
+ EntityBackgroundDownloadManager.class, EntityBackgroundUploadManager.class);
builder.at("^/ws/(.*)$").install(new ForwardFilter("^/ws/(.*)$", "/ws/{0}"));
}
Modified: trunk/src/main/java/cc/kune/core/server/manager/FileManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/FileManager.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/core/server/manager/FileManager.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -24,31 +24,39 @@
public interface FileManager {
- /**
- * Create a new file adding a numeric sequence if the file already exists
- *
- * @param dir
- * the directory (use File.separator for dir delimiters)
- * @param fileName
- * (the new file name)
- * @return if 'file.txt' exists it creates 'file 1.txt' and if 'file 1.txt'
- * exists it creates 'file 2.txt' and so on
- * @throws IOException
- */
- File createFileWithSequentialName(String dir, String fileName) throws IOException;
+ /**
+ * Create a new file adding a numeric sequence if the file already exists
+ *
+ * @param dir
+ * the directory (use File.separator for dir delimiters)
+ * @param fileName
+ * (the new file name)
+ * @return if 'file.txt' exists it creates 'file 1.txt' and if 'file 1.txt'
+ * exists it creates 'file 2.txt' and so on
+ * @throws IOException
+ */
+ File createFileWithSequentialName(String dir, String fileName) throws IOException;
- /**
- * @param dir
- * the directory (use File.separator for dir delimiters)
- * @return true if and only if the directory was created, along with all
- * necessary parent directories; false otherwise
- */
- boolean mkdir(String dir);
+ /**
+ * @param dir
+ * the directory (use File.separator for dir delimiters)
+ * @return true if and only if the directory was created, along with all
+ * necessary parent directories; false otherwise
+ */
+ boolean mkdir(String dir);
- /**
- * @param dir
- * the directory (use File.separator for dir delimiters)
- */
- boolean rmdir(String dir) throws IOException;
+ /**
+ * @param dir
+ * the directory (use File.separator for dir delimiters)
+ * @param file
+ * the file to remove
+ */
+ boolean rm(String dir, String file);
+ /**
+ * @param dir
+ * the directory (use File.separator for dir delimiters)
+ */
+ boolean rmdir(String dir) throws IOException;
+
}
Modified: trunk/src/main/java/cc/kune/core/server/manager/GroupManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/GroupManager.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/core/server/manager/GroupManager.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -32,46 +32,46 @@
public interface GroupManager extends Manager<Group, Long> {
- void changeDefLicense(User user, Group group, String licenseShortName);
+ void changeDefLicense(User user, Group group, String licenseShortName);
- void changeWsTheme(User user, Group group, String theme) throws AccessViolationException;
+ void changeWsTheme(User user, Group group, String theme) throws AccessViolationException;
- void clearGroupBackImage(Group group);
+ void clearGroupBackImage(Group group);
- Group createGroup(Group group, User user, String publicDescrip) throws GroupNameInUseException,
- UserMustBeLoggedException;
+ Group createGroup(Group group, User user, String publicDescrip) throws GroupNameInUseException,
+ UserMustBeLoggedException;
- Group createUserGroup(User user) throws GroupNameInUseException, EmailAddressInUseException;
+ Group createUserGroup(User user) throws GroupNameInUseException, EmailAddressInUseException;
- Group createUserGroup(User user, boolean wantPersonalHomepage) throws GroupNameInUseException,
- EmailAddressInUseException;
+ Group createUserGroup(User user, boolean wantPersonalHomepage) throws GroupNameInUseException,
+ EmailAddressInUseException;
- List<Group> findAdminInGroups(Long groupId);
+ List<Group> findAdminInGroups(Long groupId);
- Group findByShortName(String groupName);
+ Group findByShortName(String groupName);
- List<Group> findCollabInGroups(Long groupId);
+ List<Group> findCollabInGroups(Long groupId);
- List<String> findEnabledTools(Long id);
+ List<String> findEnabledTools(Long id);
- /**
- * IMPORTANT: returns null if userId is null
- *
- * @param userId
- * @return
- */
- Group getGroupOfUserWithId(Long userId);
+ /**
+ * IMPORTANT: returns null if userId is null
+ *
+ * @param userId
+ * @return
+ */
+ Group getGroupOfUserWithId(Long userId);
- Group getSiteDefaultGroup();
+ Group getSiteDefaultGroup();
- SearchResult<Group> search(String search);
+ SearchResult<Group> search(String search);
- SearchResult<Group> search(String search, Integer firstResult, Integer maxResults);
+ SearchResult<Group> search(String search, Integer firstResult, Integer maxResults);
- void setDefaultContent(String groupShortName, Content content);
+ void setDefaultContent(String groupShortName, Content content);
- void setGroupBackImage(Group group, Content content);
+ void setGroupBackgroundImage(Group group, String backgroundFileName, String mime);
- void setToolEnabled(User userLogged, String groupShortName, String toolName, boolean enabled);
+ void setToolEnabled(User userLogged, String groupShortName, String toolName, boolean enabled);
}
Added: trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundDownloadManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundDownloadManager.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundDownloadManager.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -0,0 +1,120 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ \*/
+package cc.kune.core.server.manager.file;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.OutputStream;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import cc.kune.core.client.errors.ContentNotFoundException;
+import cc.kune.core.client.services.FileConstants;
+import cc.kune.core.client.services.ImageSize;
+import cc.kune.core.server.manager.GroupManager;
+import cc.kune.core.server.properties.KuneProperties;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.domain.Group;
+
+import com.google.inject.Inject;
+
+/**
+ * Some snippets from:
+ * http://www.onjava.com/pub/a/onjava/excerpt/jebp_3/index1.html?page=1
+ *
+ */
+
+public class EntityBackgroundDownloadManager extends HttpServlet {
+
+ static final String APPLICATION_X_DOWNLOAD = "application/x-download";
+
+ public static final Log LOG = LogFactory.getLog(FileDownloadManager.class);
+ static final String RESP_HEADER_ATTACHMENT_FILENAME = "attachment; filename=\"";
+ static final String RESP_HEADER_CONTEND_DISP = "Content-Disposition";
+
+ static final String RESP_HEADER_END = "\"";
+
+ private static final long serialVersionUID = -1160659289588014049L;
+
+ @Inject
+ FileUtils fileUtils;
+ @Inject
+ GroupManager groupManager;
+ @Inject
+ KuneProperties kuneProperties;
+
+ String buildResponse(final StateToken statetoken, final String filename, final String mimeType,
+ final ImageSize imgsize, final HttpServletResponse resp) throws FileNotFoundException, IOException {
+ final String absDir = kuneProperties.get(KuneProperties.UPLOAD_LOCATION)
+ + FileUtils.groupToDir(statetoken.getGroup());
+ String absFilename = absDir + filename;
+
+ if (imgsize != null) {
+ final String imgsizePrefix = "." + imgsize;
+ final String extension = FileUtils.getFileNameExtension(filename, true);
+ final String filenameWithoutExtension = FileUtils.getFileNameWithoutExtension(filename, extension);
+ final String filenameResized = filenameWithoutExtension + imgsizePrefix + extension;
+ if (fileUtils.exist(absDir + filenameResized)) {
+ absFilename = absDir + filenameResized;
+ }
+ }
+
+ final File file = new File(absFilename);
+
+ resp.setContentLength((int) file.length());
+
+ final String contentType = mimeType.toString();
+
+ resp.setContentType(contentType);
+ LOG.info("Content type returned: " + contentType);
+
+ resp.setHeader(RESP_HEADER_CONTEND_DISP, RESP_HEADER_ATTACHMENT_FILENAME + filename
+ + RESP_HEADER_END);
+ return absFilename;
+ }
+
+ @Override
+ protected void doGet(final HttpServletRequest req, final HttpServletResponse resp)
+ throws ServletException, IOException {
+
+ final StateToken stateToken = new StateToken(req.getParameter(FileConstants.TOKEN));
+ final String imageSizeS = req.getParameter(FileConstants.IMGSIZE);
+ final ImageSize imgsize = imageSizeS == null ? null : ImageSize.valueOf(imageSizeS);
+
+ try {
+ final Group group = groupManager.findByShortName(stateToken.getGroup());
+
+ final String absFilename = buildResponse(stateToken, group.getBackgroundImage(),
+ group.getBackgroundMime(), imgsize, resp);
+ final OutputStream out = resp.getOutputStream();
+ FileDownloadManagerUtils.returnFile(absFilename, out);
+ } catch (final ContentNotFoundException e) {
+ FileDownloadManagerUtils.returnNotFound(resp);
+ return;
+ }
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundDownloadManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundUploadManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundUploadManager.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundUploadManager.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -0,0 +1,103 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ \*/
+package cc.kune.core.server.manager.file;
+
+import java.io.File;
+
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import cc.kune.core.server.auth.ActionLevel;
+import cc.kune.core.server.auth.Authenticated;
+import cc.kune.core.server.auth.Authorizated;
+import cc.kune.core.server.manager.FileManager;
+import cc.kune.core.server.manager.GroupManager;
+import cc.kune.core.server.properties.KuneProperties;
+import cc.kune.core.shared.domain.AccessRol;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.domain.BasicMimeType;
+import cc.kune.domain.Group;
+
+import com.google.inject.Inject;
+import com.google.inject.persist.Transactional;
+
+public class EntityBackgroundUploadManager extends FileGwtUploadAbstractServlet {
+
+ public static final Log LOG = LogFactory.getLog(FileGwtUploadServlet.class);
+ private static final long serialVersionUID = 1L;
+ private final FileManager fileManager;
+ private final GroupManager groupManager;
+ private final I18nTranslationService i18n;
+
+ @Inject
+ public EntityBackgroundUploadManager(final KuneProperties kuneProperties,
+ final GroupManager groupManager, final I18nTranslationService i18n, final FileManager fileManager) {
+ super(kuneProperties);
+ this.groupManager = groupManager;
+ this.i18n = i18n;
+ this.fileManager = fileManager;
+ }
+
+ @Override
+ @Authenticated
+ @Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.group)
+ @Transactional
+ protected String createUploadedFile(final String userHash, final StateToken stateToken,
+ final String fileName, final FileItem origFile, final String typeId) {
+ try {
+ final String mimeTypeS = origFile.getContentType();
+ final BasicMimeType mimeType = new BasicMimeType(mimeTypeS);
+ if (!mimeType.getType().equals("image")) {
+ return "Trying to set a non image (" + mimeTypeS + ") as group background";
+ }
+ final Group group = groupManager.findByShortName(stateToken.getGroup());
+
+ if (group == Group.NO_GROUP) {
+ LOG.error("Group not found trying to set the background");
+ return i18n.t("Error uploading file");
+ }
+
+ final String relDir = FileUtils.groupToDir(group.getShortName());
+ final String absDir = kuneProperties.get(KuneProperties.UPLOAD_LOCATION) + relDir;
+ fileManager.mkdir(absDir);
+
+ File destFile = null;
+ final String filenameUTF8 = new String(origFile.getName().getBytes(), UTF8);
+ destFile = fileManager.createFileWithSequentialName(absDir, filenameUTF8);
+ origFile.write(destFile);
+
+ final String extension = FileUtils.getFileNameExtension(filenameUTF8, false);
+ ImageUtilsDefault.generateThumbs(absDir, filenameUTF8, extension, false,
+ Integer.parseInt(kuneProperties.get(KuneProperties.IMAGES_RESIZEWIDTH)),
+ Integer.parseInt(kuneProperties.get(KuneProperties.IMAGES_THUMBSIZE)),
+ Integer.parseInt(kuneProperties.get(KuneProperties.IMAGES_CROPSIZE)),
+ Integer.parseInt(kuneProperties.get(KuneProperties.IMAGES_ICONSIZE)));
+
+ LOG.info("Mimetype: " + mimeType);
+ groupManager.setGroupBackgroundImage(group, filenameUTF8, mimeTypeS);
+
+ } catch (final Exception e) {
+ return i18n.t("Error uploading file");
+ }
+ return i18n.t("Success uploading");
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundUploadManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/FileGwtUploadAbstractServlet.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/FileGwtUploadAbstractServlet.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/FileGwtUploadAbstractServlet.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -34,12 +34,18 @@
import cc.kune.core.server.properties.KuneProperties;
import cc.kune.core.shared.domain.utils.StateToken;
+import com.google.inject.servlet.RequestScoped;
+
+@RequestScoped
public abstract class FileGwtUploadAbstractServlet extends UploadAction {
public static final Log LOG = LogFactory.getLog(FileGwtUploadAbstractServlet.class);
private static final long serialVersionUID = 1L;
+ protected static final String UTF8 = "UTF-8";
+ protected final KuneProperties kuneProperties;
public FileGwtUploadAbstractServlet(final KuneProperties kuneProperties) {
+ this.kuneProperties = kuneProperties;
this.maxSize = Integer.valueOf(kuneProperties.get(KuneProperties.UPLOAD_MAX_FILE_SIZE_IN_KS));
this.uploadDelay = Integer.valueOf(kuneProperties.get(KuneProperties.UPLOAD_DELAY_FOR_TEST));
}
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/FileManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/FileManagerDefault.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/FileManagerDefault.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -22,7 +22,6 @@
import java.io.File;
import java.io.IOException;
-
import cc.kune.core.server.manager.FileManager;
import com.google.inject.Singleton;
@@ -30,34 +29,43 @@
@Singleton
public class FileManagerDefault implements FileManager {
- public File createFileWithSequentialName(final String dir, final String fileName) throws IOException {
- String fileNameProposal = String.valueOf(fileName);
- File file = new File(dir, fileNameProposal);
- while (file.exists()) {
- fileNameProposal = FileUtils.getNextSequentialFileName(fileNameProposal, true);
- // @PMD:REVIEWED:AvoidInstantiatingObjectsInLoops: by vjrj on
- // 21/05/09 13:15
- file = new File(dir, fileNameProposal);
- }
- if (file.createNewFile()) {
- return file;
- } else {
- throw new IOException("Cannot create sequential file name");
- }
+ @Override
+ public File createFileWithSequentialName(final String dir, final String fileName) throws IOException {
+ String fileNameProposal = String.valueOf(fileName);
+ File file = new File(dir, fileNameProposal);
+ while (file.exists()) {
+ fileNameProposal = FileUtils.getNextSequentialFileName(fileNameProposal, true);
+ // @PMD:REVIEWED:AvoidInstantiatingObjectsInLoops: by vjrj on
+ // 21/05/09 13:15
+ file = new File(dir, fileNameProposal);
}
-
- public boolean mkdir(final String dir) {
- return new File(dir).mkdirs();
+ if (file.createNewFile()) {
+ return file;
+ } else {
+ throw new IOException("Cannot create sequential file name");
}
+ }
- public boolean rmdir(final String dir) throws IOException {
- final File file = new File(dir);
- if (!file.isDirectory()) {
- throw new IOException("rmdir: " + dir + ": Not a directory");
- }
- if (file.listFiles().length != 0) {
- throw new IOException("rmdir: " + dir + ": Directory not empty");
- }
- return file.delete();
+ @Override
+ public boolean mkdir(final String dir) {
+ return new File(dir).mkdirs();
+ }
+
+ @Override
+ public boolean rm(final String dir, final String fileName) {
+ final File file = new File(dir, fileName);
+ return file.delete();
+ }
+
+ @Override
+ public boolean rmdir(final String dir) throws IOException {
+ final File file = new File(dir);
+ if (!file.isDirectory()) {
+ throw new IOException("rmdir: " + dir + ": Not a directory");
}
+ if (file.listFiles().length != 0) {
+ throw new IOException("rmdir: " + dir + ": Directory not empty");
+ }
+ return file.delete();
+ }
}
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/FileUploadManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/FileUploadManager.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/FileUploadManager.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -20,14 +20,11 @@
package cc.kune.core.server.manager.file;
import java.io.File;
-import java.io.FileNotFoundException;
-import magick.MagickException;
import net.sf.json.JSONObject;
import org.apache.commons.fileupload.FileItem;
-import cc.kune.core.client.services.ImageSize;
import cc.kune.core.server.UserSession;
import cc.kune.core.server.access.AccessService;
import cc.kune.core.server.auth.ActionLevel;
@@ -53,129 +50,109 @@
@RequestScoped
public class FileUploadManager extends FileJsonUploadManagerAbstract {
- private static final long serialVersionUID = -7209922761735338754L;
- @Inject
- AccessService accessService;
- @Inject
- ContentManager contentManager;
- @Inject
- FileManager fileManager;
- @Inject
- I18nTranslationService i18n;
- @Inject
- UserSession userSession;
+ private static final long serialVersionUID = -7209922761735338754L;
+ @Inject
+ AccessService accessService;
+ @Inject
+ ContentManager contentManager;
+ @Inject
+ FileManager fileManager;
+ @Inject
+ I18nTranslationService i18n;
+ @Inject
+ UserSession userSession;
- @Override
- protected void beforePostStart() {
- }
+ @Override
+ protected void beforePostStart() {
+ }
- @Override
- protected JSONObject createJsonResponse(final boolean success, final String message) {
- /**
- *
- * http://max-bazhenov.com/dev/upload-dialog-2.0/index.php
- *
- * Server side handler.
- *
- * The files in the queue are posted one at a time, the file field name
- * is 'file'. The handler should return json encoded object with
- * following properties: { success: true|false, // required error:
- * 'Error or success message' // optional, also can be named 'message' }
- */
+ @Override
+ protected JSONObject createJsonResponse(final boolean success, final String message) {
+ /**
+ *
+ * http://max-bazhenov.com/dev/upload-dialog-2.0/index.php
+ *
+ * Server side handler.
+ *
+ * The files in the queue are posted one at a time, the file field name is
+ * 'file'. The handler should return json encoded object with following
+ * properties: { success: true|false, // required error: 'Error or success
+ * message' // optional, also can be named 'message' }
+ */
- JSONObject response = null;
- try {
- response = new JSONObject();
- response.put("success", success);
- response.put("error", message);
- response.put("code", "232");
- } catch (final Exception e) {
- LOG.error("Error building response");
- }
- return response;
+ JSONObject response = null;
+ try {
+ response = new JSONObject();
+ response.put("success", success);
+ response.put("error", message);
+ response.put("code", "232");
+ } catch (final Exception e) {
+ LOG.error("Error building response");
}
+ return response;
+ }
- @Override
- protected void createUploadedFile(final String userHash, final StateToken stateToken, final String fileName,
- final FileItem file, final String typeId) throws Exception {
- createUploadedFileWrapped(userHash, stateToken, fileName, file, typeId);
- }
+ @Override
+ protected void createUploadedFile(final String userHash, final StateToken stateToken,
+ final String fileName, final FileItem file, final String typeId) throws Exception {
+ createUploadedFileWrapped(userHash, stateToken, fileName, file, typeId);
+ }
- @Authenticated
- @Authorizated(accessRolRequired = AccessRol.Editor, actionLevel = ActionLevel.container, mustCheckMembership = false)
- @Transactional
- Content createUploadedFileWrapped(final String userHash, final StateToken stateToken, final String fileName,
- final FileItem fileUploadItem, final String typeId) throws Exception {
- final String relDir = FileUtils.toDir(stateToken);
- final String absDir = kuneProperties.get(KuneProperties.UPLOAD_LOCATION) + relDir;
- fileManager.mkdir(absDir);
+ @Authenticated
+ @Authorizated(accessRolRequired = AccessRol.Editor, actionLevel = ActionLevel.container, mustCheckMembership = false)
+ @Transactional
+ Content createUploadedFileWrapped(final String userHash, final StateToken stateToken,
+ final String fileName, final FileItem fileUploadItem, final String typeId) throws Exception {
+ final String relDir = FileUtils.toDir(stateToken);
+ final String absDir = kuneProperties.get(KuneProperties.UPLOAD_LOCATION) + relDir;
+ fileManager.mkdir(absDir);
- File file = null;
- try {
- final String filenameUTF8 = new String(fileName.getBytes(), UTF8);
- file = fileManager.createFileWithSequentialName(absDir, filenameUTF8);
- fileUploadItem.write(file);
+ File file = null;
+ try {
+ final String filenameUTF8 = new String(fileName.getBytes(), UTF8);
+ file = fileManager.createFileWithSequentialName(absDir, filenameUTF8);
+ fileUploadItem.write(file);
- final String mimetype = fileUploadItem.getContentType();
- final BasicMimeType basicMimeType = new BasicMimeType(mimetype);
- LOG.info("Mimetype: " + basicMimeType);
- final String extension = FileUtils.getFileNameExtension(file.getName(), false);
+ final String mimetype = fileUploadItem.getContentType();
+ final BasicMimeType basicMimeType = new BasicMimeType(mimetype);
+ LOG.info("Mimetype: " + basicMimeType);
+ final String extension = FileUtils.getFileNameExtension(file.getName(), false);
- String preview = "";
+ String preview = "";
- if (basicMimeType.isImage()) {
- generateThumbs(absDir, file.getName(), extension, false);
- } else if (basicMimeType.isPdf()) {
- generateThumbs(absDir, file.getName(), "png", true);
- } else if (basicMimeType.isText()) {
- final String textPreview = new String(FileUtils.getBytesFromFile(file));
- preview = "<pre>" + StringW.wordWrap(textPreview) + "</pre>";
- }
+ if (basicMimeType.isImage()) {
+ generateThumbs(absDir, file.getName(), extension, false);
+ } else if (basicMimeType.isPdf()) {
+ generateThumbs(absDir, file.getName(), "png", true);
+ } else if (basicMimeType.isText()) {
+ final String textPreview = new String(FileUtils.getBytesFromFile(file));
+ preview = "<pre>" + StringW.wordWrap(textPreview) + "</pre>";
+ }
- // Persist
- final User user = userSession.getUser();
- final Container container = accessService.accessToContainer(ContentUtils.parseId(stateToken.getFolder()),
- user, AccessRol.Editor);
- final Content content = contentManager.createContent(
- FileUtils.getFileNameWithoutExtension(file.getName(), extension), preview, user, container, typeId);
- content.setMimeType(basicMimeType);
- content.setFilename(file.getName());
- return content;
- } catch (final Exception e) {
- if (file != null && file.exists()) {
- logFileDel(file.delete());
- }
- throw e;
- }
+ // Persist
+ final User user = userSession.getUser();
+ final Container container = accessService.accessToContainer(
+ ContentUtils.parseId(stateToken.getFolder()), user, AccessRol.Editor);
+ final Content content = contentManager.createContent(
+ FileUtils.getFileNameWithoutExtension(file.getName(), extension), preview, user, container,
+ typeId);
+ content.setMimeType(basicMimeType);
+ content.setFilename(file.getName());
+ return content;
+ } catch (final Exception e) {
+ if (file != null && file.exists()) {
+ logFileDel(file.delete());
+ }
+ throw e;
}
+ }
- private void generateThumbs(final String absDir, final String filename, final String extension, final boolean isPdf) {
- try {
- final String fileOrig = absDir + filename;
- final String withoutExtension = FileUtils.getFileNameWithoutExtension(filename, extension);
-
- final String resizeName = absDir + withoutExtension + "." + ImageSize.sized + "." + extension;
- final String thumbName = absDir + withoutExtension + "." + ImageSize.thumb + "." + extension;
- final String iconName = absDir + withoutExtension + "." + ImageSize.ico + "." + extension;
- final String previewName = absDir + withoutExtension + "." + extension;
-
- final int resizeWidth = Integer.parseInt(kuneProperties.get(KuneProperties.IMAGES_RESIZEWIDTH));
- final int thumbSize = Integer.parseInt(kuneProperties.get(KuneProperties.IMAGES_THUMBSIZE));
- final int cropSize = Integer.parseInt(kuneProperties.get(KuneProperties.IMAGES_CROPSIZE));
- final int iconSize = Integer.parseInt(kuneProperties.get(KuneProperties.IMAGES_ICONSIZE));
-
- ImageUtilsDefault.scaleImageToMax(fileOrig, resizeName, resizeWidth);
- ImageUtilsDefault.createThumb(fileOrig, thumbName, thumbSize, cropSize);
- ImageUtilsDefault.createThumb(fileOrig, iconName, iconSize);
- if (isPdf) {
- ImageUtilsDefault.createThumbFromPdf(fileOrig, previewName);
- }
- } catch (final NumberFormatException e) {
- LOG.error("Image sizes in kune.properties are not integers", e);
- } catch (final MagickException e) {
- LOG.info("Problem generating image thumb for " + filename, e);
- } catch (final FileNotFoundException e) {
- LOG.info("Original image not found generating image thumb for " + filename, e);
- }
- }
+ private void generateThumbs(final String absDir, final String filename, final String extension,
+ final boolean isPdf) {
+ ImageUtilsDefault.generateThumbs(absDir, filename, extension, isPdf,
+ Integer.parseInt(kuneProperties.get(KuneProperties.IMAGES_RESIZEWIDTH)),
+ Integer.parseInt(kuneProperties.get(KuneProperties.IMAGES_THUMBSIZE)),
+ Integer.parseInt(kuneProperties.get(KuneProperties.IMAGES_CROPSIZE)),
+ Integer.parseInt(kuneProperties.get(KuneProperties.IMAGES_ICONSIZE)));
+ }
}
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/FileUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/FileUtils.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/FileUtils.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -28,109 +28,113 @@
public class FileUtils {
- public static final String SLASH = File.separator;
+ public static final String SLASH = File.separator;
- /**
- * Snippet from:
- * http://www.java-tips.org/java-se-tips/java.io/reading-a-file
- * -into-a-byte-array.html
- */
- public static byte[] getBytesFromFile(final File file) throws IOException {
- final InputStream iStream = new FileInputStream(file);
+ /**
+ * Snippet from: http://www.java-tips.org/java-se-tips/java.io/reading-a-file
+ * -into-a-byte-array.html
+ */
+ public static byte[] getBytesFromFile(final File file) throws IOException {
+ final InputStream iStream = new FileInputStream(file);
- // Get the size of the file
- final long length = file.length();
+ // Get the size of the file
+ final long length = file.length();
- if (length > Integer.MAX_VALUE) {
- // File is too large
- }
+ if (length > Integer.MAX_VALUE) {
+ // File is too large
+ }
- // Create the byte array to hold the data
- final byte[] bytes = new byte[(int) length];
+ // Create the byte array to hold the data
+ final byte[] bytes = new byte[(int) length];
- // Read in the bytes
- int offset = 0;
- int numRead = 0;
- while (offset < bytes.length && (numRead = iStream.read(bytes, offset, bytes.length - offset)) >= 0) {
- offset += numRead;
- }
-
- // Ensure all the bytes have been read in
- if (offset < bytes.length) {
- throw new IOException("Could not completely read file " + file.getName());
- }
-
- // Close the input stream and return bytes
- iStream.close();
- return bytes;
+ // Read in the bytes
+ int offset = 0;
+ int numRead = 0;
+ while (offset < bytes.length && (numRead = iStream.read(bytes, offset, bytes.length - offset)) >= 0) {
+ offset += numRead;
}
- /**
- * For filename extension info see:
- * http://en.wikipedia.org/wiki/File_name_extension
- *
- * @param filename
- * @return
- */
- public static String getFileNameExtension(final String filename, final boolean withDot) {
- // also we can use FilenameUtils
- if (filename == null) {
- return "";
- }
- final int dotIndex = filename.lastIndexOf('.');
- if (dotIndex == -1 || dotIndex == 0) {
- return "";
- } else {
- if (withDot) {
- final String ext = filename.substring(dotIndex);
- return ext.length() == 1 ? "" : ext;
- } else {
- return filename.substring(dotIndex + 1);
- }
- }
+ // Ensure all the bytes have been read in
+ if (offset < bytes.length) {
+ throw new IOException("Could not completely read file " + file.getName());
}
- public static String getFileNameWithoutExtension(final String fileName, final String extension) {
- final int extlength = extension.length();
- if (extlength > 0) {
- final boolean withDot = extension.charAt(0) == '.';
- return fileName.substring(0, fileName.length() - extlength - (withDot ? 0 : 1));
- } else {
- return fileName;
- }
+ // Close the input stream and return bytes
+ iStream.close();
+ return bytes;
+ }
+
+ /**
+ * For filename extension info see:
+ * http://en.wikipedia.org/wiki/File_name_extension
+ *
+ * @param filename
+ * @return
+ */
+ public static String getFileNameExtension(final String filename, final boolean withDot) {
+ // also we can use FilenameUtils
+ if (filename == null) {
+ return "";
}
+ final int dotIndex = filename.lastIndexOf('.');
+ if (dotIndex == -1 || dotIndex == 0) {
+ return "";
+ } else {
+ if (withDot) {
+ final String ext = filename.substring(dotIndex);
+ return ext.length() == 1 ? "" : ext;
+ } else {
+ return filename.substring(dotIndex + 1);
+ }
+ }
+ }
- public static String getNextSequentialFileName(final String fileName) {
- final int lastSpace = fileName.lastIndexOf(" ");
- if (lastSpace != -1) {
- final String suffix = fileName.substring(lastSpace + 1);
- try {
- final Integer i = Integer.valueOf(suffix);
- return fileName.substring(0, lastSpace + 1) + (i + 1);
- } catch (final NumberFormatException e) {
- }
- }
- return fileName + " 1";
+ public static String getFileNameWithoutExtension(final String fileName, final String extension) {
+ final int extlength = extension.length();
+ if (extlength > 0) {
+ final boolean withDot = extension.charAt(0) == '.';
+ return fileName.substring(0, fileName.length() - extlength - (withDot ? 0 : 1));
+ } else {
+ return fileName;
}
+ }
- public static String getNextSequentialFileName(final String fileName, final boolean preserveExtension) {
- if (!preserveExtension) {
- return getNextSequentialFileName(fileName);
- }
- final int dotIndex = fileName.lastIndexOf(".");
- if (dotIndex == -1 || dotIndex == 0) {
- return getNextSequentialFileName(fileName);
- } else {
- final String ext = fileName.substring(dotIndex);
- return getNextSequentialFileName(fileName.substring(0, dotIndex)) + ext;
- }
+ public static String getNextSequentialFileName(final String fileName) {
+ final int lastSpace = fileName.lastIndexOf(" ");
+ if (lastSpace != -1) {
+ final String suffix = fileName.substring(lastSpace + 1);
+ try {
+ final Integer i = Integer.valueOf(suffix);
+ return fileName.substring(0, lastSpace + 1) + (i + 1);
+ } catch (final NumberFormatException e) {
+ }
}
+ return fileName + " 1";
+ }
- public static String toDir(final StateToken stateToken) {
- return SLASH + stateToken.getGroup() + SLASH + stateToken.getTool() + SLASH + stateToken.getFolder() + SLASH;
+ public static String getNextSequentialFileName(final String fileName, final boolean preserveExtension) {
+ if (!preserveExtension) {
+ return getNextSequentialFileName(fileName);
}
+ final int dotIndex = fileName.lastIndexOf(".");
+ if (dotIndex == -1 || dotIndex == 0) {
+ return getNextSequentialFileName(fileName);
+ } else {
+ final String ext = fileName.substring(dotIndex);
+ return getNextSequentialFileName(fileName.substring(0, dotIndex)) + ext;
+ }
+ }
- public boolean exist(final String file) {
- return new File(file).exists();
- }
+ public static String groupToDir(final String groupName) {
+ return SLASH + groupName + SLASH;
+ }
+
+ public static String toDir(final StateToken stateToken) {
+ return SLASH + stateToken.getGroup() + SLASH + stateToken.getTool() + SLASH + stateToken.getFolder()
+ + SLASH;
+ }
+
+ public boolean exist(final String file) {
+ return new File(file).exists();
+ }
}
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/ImageUtilsDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/ImageUtilsDefault.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/ImageUtilsDefault.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -28,173 +28,212 @@
import magick.MagickException;
import magick.MagickImage;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import cc.kune.core.client.services.ImageSize;
+
public class ImageUtilsDefault {
- /**
- * http://en.wikipedia.org/wiki/Thumbnail
- *
- * @throws FileNotFoundException
- *
- */
- public static void createThumb(String fileOrig, String fileDest, int cropDimension) throws MagickException,
- FileNotFoundException {
- createThumb(fileOrig, fileDest, cropDimension, cropDimension);
- }
+ public static final Log LOG = LogFactory.getLog(ImageUtilsDefault.class);
- public static void createThumb(String fileOrig, String fileDest, int thumbDimension, int cropDimension)
- throws MagickException, FileNotFoundException {
- checkExist(fileOrig);
- if (thumbDimension < cropDimension) {
- throw new IndexOutOfBoundsException("Thumb dimension must be bigger than crop dimension");
- }
- MagickImage imageOrig = readImage(fileOrig);
- Dimension origDimension = imageOrig.getDimension();
- int origHeight = origDimension.height;
- int origWidth = origDimension.width;
- Dimension proportionalDim = calculatePropDim(origWidth, origHeight, thumbDimension, true);
- MagickImage scaled = scaleImage(imageOrig, proportionalDim.width, proportionalDim.height);
- int x = calculateCenteredCoordinate(proportionalDim.width, cropDimension);
- int y = calculateCenteredCoordinate(proportionalDim.height, cropDimension);
- cropImage(scaled, fileDest, x, y, cropDimension, cropDimension);
- }
+ static int calculateCenteredCoordinate(final int size, final int crop) {
+ final int i = (size - crop) / 2;
+ return i < 0 ? 0 : i;
+ }
- /**
- * convert -density 300 -quality 100 -resize 720x file.pdf result.png
- *
- * @param pdfFile
- * @param newPngFile
- * @return
- * @throws MagickException
- */
- static public boolean createThumbFromPdf(String pdfFile, String newPngFile) throws MagickException {
- MagickImage pdf = readImage(pdfFile);
- MagickImage pdf1 = pdf.breakFrames()[0];
- return writeImage(pdf1, newPngFile);
- }
+ static Dimension calculatePropDim(final int origWidth, final int origHeight, final int maxSize) {
+ return calculatePropDim(origWidth, origHeight, maxSize, true);
+ }
- public static boolean cropImage(String fileOrig, String fileDest, int x, int y, int width, int height)
- throws MagickException, FileNotFoundException {
- Rectangle rectangle = new Rectangle(x, y, width, height);
- return cropImage(fileOrig, fileDest, rectangle);
+ static Dimension calculatePropDim(final int origWidth, final int origHeight, final int maxSize,
+ final boolean toShortest) {
+ final boolean higher = origHeight > origWidth;
+ final int propHeight = origHeight * maxSize / origWidth;
+ final int propWidth = origWidth * maxSize / origHeight;
+ final double height = toShortest ? (higher ? propHeight : maxSize) : (higher ? maxSize : propHeight);
+ final double width = toShortest ? (!higher ? propWidth : maxSize) : (!higher ? maxSize : propWidth);
+ if ((higher && origHeight <= maxSize) || (!higher && origWidth <= maxSize)) {
+ return new Dimension(origWidth, origHeight);
}
+ return new Dimension((int) width, (int) height);
+ }
- public static boolean cropImage(String fileOrig, String fileDest, Rectangle rectangle) throws MagickException,
- FileNotFoundException {
- checkExist(fileOrig);
- return cropImage(readImage(fileOrig), fileDest, rectangle);
+ private static void checkExist(final String fileOrig) throws FileNotFoundException {
+ final File file = new File(fileOrig);
+ if (!file.exists()) {
+ throw new FileNotFoundException();
}
+ }
- public static Dimension getDimension(String file) throws MagickException {
- MagickImage imageOrig = readImage(file);
- return imageOrig.getDimension();
- }
+ private static ImageInfo createEmptyImageInfo() throws MagickException {
+ final ImageInfo imageInfo = new ImageInfo();
+ return imageInfo;
+ }
- /**
- * FIXME: Not working, returns null always (bug)
- *
- */
- public static String getPage(String file) throws MagickException {
- ImageInfo imageInfo = new ImageInfo(file);
- new MagickImage(imageInfo);
- return imageInfo.getPage();
- }
+ private static ImageInfo createEmptyImageInfoWithNoPage() throws MagickException {
+ final ImageInfo imageInfo = createEmptyImageInfo();
+ imageInfo.setPage("0x0+0+0");
+ return imageInfo;
+ }
- public static boolean scaleImage(String fileOrig, String fileDest, Dimension dimension) throws MagickException,
- FileNotFoundException {
- checkExist(fileOrig);
- MagickImage imageOrig = readImage(fileOrig);
- return scaleImage(imageOrig, fileDest, (int) dimension.getWidth(), (int) dimension.getHeight());
- }
+ /**
+ * http://en.wikipedia.org/wiki/Thumbnail
+ *
+ * @throws FileNotFoundException
+ *
+ */
+ public static void createThumb(final String fileOrig, final String fileDest, final int cropDimension)
+ throws MagickException, FileNotFoundException {
+ createThumb(fileOrig, fileDest, cropDimension, cropDimension);
+ }
- public static boolean scaleImage(String fileOrig, String fileDest, int width, int height) throws MagickException,
- FileNotFoundException {
- checkExist(fileOrig);
- MagickImage imageOrig = readImage(fileOrig);
- return scaleImage(imageOrig, fileDest, width, height);
+ public static void createThumb(final String fileOrig, final String fileDest, final int thumbDimension,
+ final int cropDimension) throws MagickException, FileNotFoundException {
+ checkExist(fileOrig);
+ if (thumbDimension < cropDimension) {
+ throw new IndexOutOfBoundsException("Thumb dimension must be bigger than crop dimension");
}
+ final MagickImage imageOrig = readImage(fileOrig);
+ final Dimension origDimension = imageOrig.getDimension();
+ final int origHeight = origDimension.height;
+ final int origWidth = origDimension.width;
+ final Dimension proportionalDim = calculatePropDim(origWidth, origHeight, thumbDimension, true);
+ final MagickImage scaled = scaleImage(imageOrig, proportionalDim.width, proportionalDim.height);
+ final int x = calculateCenteredCoordinate(proportionalDim.width, cropDimension);
+ final int y = calculateCenteredCoordinate(proportionalDim.height, cropDimension);
+ cropImage(scaled, fileDest, x, y, cropDimension, cropDimension);
+ }
- public static boolean scaleImageToMax(String fileOrig, String fileDest, int maxSize) throws MagickException,
- FileNotFoundException {
- checkExist(fileOrig);
- MagickImage imageOrig = readImage(fileOrig);
- Dimension origDimension = imageOrig.getDimension();
- int origHeight = origDimension.height;
- int origWidth = origDimension.width;
- Dimension proportionalDim = calculatePropDim(origWidth, origHeight, maxSize, false);
- MagickImage scaled = scaleImage(imageOrig, proportionalDim.width, proportionalDim.height);
+ /**
+ * convert -density 300 -quality 100 -resize 720x file.pdf result.png
+ *
+ * @param pdfFile
+ * @param newPngFile
+ * @return
+ * @throws MagickException
+ */
+ static public boolean createThumbFromPdf(final String pdfFile, final String newPngFile)
+ throws MagickException {
+ final MagickImage pdf = readImage(pdfFile);
+ final MagickImage pdf1 = pdf.breakFrames()[0];
+ return writeImage(pdf1, newPngFile);
+ }
- return writeImage(scaled, fileDest);
- }
+ private static boolean cropImage(final MagickImage fileOrig, final String fileDest, final int x,
+ final int y, final int width, final int height) throws MagickException {
+ final Rectangle rectangle = new Rectangle(x, y, width, height);
+ return cropImage(fileOrig, fileDest, rectangle);
+ }
- static int calculateCenteredCoordinate(int size, int crop) {
- int i = (size - crop) / 2;
- return i < 0 ? 0 : i;
- }
+ private static boolean cropImage(final MagickImage fileOrig, final String fileDest,
+ final Rectangle rectangle) throws MagickException {
+ final MagickImage cropped = fileOrig.cropImage(rectangle);
+ cropped.setFileName(fileDest);
+ final ImageInfo imageInfo = createEmptyImageInfoWithNoPage();
+ return cropped.writeImage(imageInfo);
+ }
- static Dimension calculatePropDim(int origWidth, int origHeight, int maxSize) {
- return calculatePropDim(origWidth, origHeight, maxSize, true);
- }
+ public static boolean cropImage(final String fileOrig, final String fileDest, final int x,
+ final int y, final int width, final int height) throws MagickException, FileNotFoundException {
+ final Rectangle rectangle = new Rectangle(x, y, width, height);
+ return cropImage(fileOrig, fileDest, rectangle);
+ }
- static Dimension calculatePropDim(int origWidth, int origHeight, int maxSize, boolean toShortest) {
- boolean higher = origHeight > origWidth;
- int propHeight = origHeight * maxSize / origWidth;
- int propWidth = origWidth * maxSize / origHeight;
- double height = toShortest ? (higher ? propHeight : maxSize) : (higher ? maxSize : propHeight);
- double width = toShortest ? (!higher ? propWidth : maxSize) : (!higher ? maxSize : propWidth);
- if ((higher && origHeight <= maxSize) || (!higher && origWidth <= maxSize)) {
- return new Dimension(origWidth, origHeight);
- }
- return new Dimension((int) width, (int) height);
- }
+ public static boolean cropImage(final String fileOrig, final String fileDest, final Rectangle rectangle)
+ throws MagickException, FileNotFoundException {
+ checkExist(fileOrig);
+ return cropImage(readImage(fileOrig), fileDest, rectangle);
+ }
- private static void checkExist(String fileOrig) throws FileNotFoundException {
- File file = new File(fileOrig);
- if (!file.exists()) {
- throw new FileNotFoundException();
- }
- }
+ public static void generateThumbs(final String absDir, final String filename, final String extension,
+ final boolean isPdf, final int resizeWidth, final int thumbSize, final int cropSize,
+ final int iconSize) {
+ try {
+ final String fileOrig = absDir + filename;
+ final String withoutExtension = FileUtils.getFileNameWithoutExtension(filename, extension);
- private static ImageInfo createEmptyImageInfo() throws MagickException {
- ImageInfo imageInfo = new ImageInfo();
- return imageInfo;
- }
+ final String resizeName = absDir + withoutExtension + "." + ImageSize.sized + "." + extension;
+ final String thumbName = absDir + withoutExtension + "." + ImageSize.thumb + "." + extension;
+ final String iconName = absDir + withoutExtension + "." + ImageSize.ico + "." + extension;
+ final String previewName = absDir + withoutExtension + "." + extension;
- private static ImageInfo createEmptyImageInfoWithNoPage() throws MagickException {
- ImageInfo imageInfo = createEmptyImageInfo();
- imageInfo.setPage("0x0+0+0");
- return imageInfo;
+ scaleImageToMax(fileOrig, resizeName, resizeWidth);
+ createThumb(fileOrig, thumbName, thumbSize, cropSize);
+ createThumb(fileOrig, iconName, iconSize);
+ if (isPdf) {
+ createThumbFromPdf(fileOrig, previewName);
+ }
+ } catch (final NumberFormatException e) {
+ LOG.error("Image sizes in kune.properties are not integers", e);
+ } catch (final MagickException e) {
+ LOG.info("Problem generating image thumb for " + filename, e);
+ } catch (final FileNotFoundException e) {
+ LOG.info("Original image not found generating image thumb for " + filename, e);
}
+ }
- private static boolean cropImage(MagickImage fileOrig, String fileDest, int x, int y, int width, int height)
- throws MagickException {
- Rectangle rectangle = new Rectangle(x, y, width, height);
- return cropImage(fileOrig, fileDest, rectangle);
- }
+ public static Dimension getDimension(final String file) throws MagickException {
+ final MagickImage imageOrig = readImage(file);
+ return imageOrig.getDimension();
+ }
- private static boolean cropImage(MagickImage fileOrig, String fileDest, Rectangle rectangle) throws MagickException {
- MagickImage cropped = fileOrig.cropImage(rectangle);
- cropped.setFileName(fileDest);
- ImageInfo imageInfo = createEmptyImageInfoWithNoPage();
- return cropped.writeImage(imageInfo);
- }
+ /**
+ * FIXME: Not working, returns null always (bug)
+ *
+ */
+ public static String getPage(final String file) throws MagickException {
+ final ImageInfo imageInfo = new ImageInfo(file);
+ new MagickImage(imageInfo);
+ return imageInfo.getPage();
+ }
- private static MagickImage readImage(String file) throws MagickException {
- ImageInfo imageInfo = new ImageInfo(file);
- return new MagickImage(imageInfo);
- }
+ private static MagickImage readImage(final String file) throws MagickException {
+ final ImageInfo imageInfo = new ImageInfo(file);
+ return new MagickImage(imageInfo);
+ }
- private static MagickImage scaleImage(MagickImage imageOrig, int width, int height) throws MagickException {
- return imageOrig.scaleImage(width, height);
- }
+ private static MagickImage scaleImage(final MagickImage imageOrig, final int width, final int height)
+ throws MagickException {
+ return imageOrig.scaleImage(width, height);
+ }
- private static boolean scaleImage(MagickImage imageOrig, String fileDest, int width, int height)
- throws MagickException {
- MagickImage imageDest = scaleImage(imageOrig, width, height);
- return writeImage(imageDest, fileDest);
- }
+ private static boolean scaleImage(final MagickImage imageOrig, final String fileDest, final int width,
+ final int height) throws MagickException {
+ final MagickImage imageDest = scaleImage(imageOrig, width, height);
+ return writeImage(imageDest, fileDest);
+ }
- private static boolean writeImage(MagickImage imageDest, String fileDest) throws MagickException {
- imageDest.setFileName(fileDest);
- return imageDest.writeImage(createEmptyImageInfo());
- }
+ public static boolean scaleImage(final String fileOrig, final String fileDest,
+ final Dimension dimension) throws MagickException, FileNotFoundException {
+ checkExist(fileOrig);
+ final MagickImage imageOrig = readImage(fileOrig);
+ return scaleImage(imageOrig, fileDest, (int) dimension.getWidth(), (int) dimension.getHeight());
+ }
+
+ public static boolean scaleImage(final String fileOrig, final String fileDest, final int width,
+ final int height) throws MagickException, FileNotFoundException {
+ checkExist(fileOrig);
+ final MagickImage imageOrig = readImage(fileOrig);
+ return scaleImage(imageOrig, fileDest, width, height);
+ }
+
+ public static boolean scaleImageToMax(final String fileOrig, final String fileDest, final int maxSize)
+ throws MagickException, FileNotFoundException {
+ checkExist(fileOrig);
+ final MagickImage imageOrig = readImage(fileOrig);
+ final Dimension origDimension = imageOrig.getDimension();
+ final int origHeight = origDimension.height;
+ final int origWidth = origDimension.width;
+ final Dimension proportionalDim = calculatePropDim(origWidth, origHeight, maxSize, false);
+ final MagickImage scaled = scaleImage(imageOrig, proportionalDim.width, proportionalDim.height);
+
+ return writeImage(scaled, fileDest);
+ }
+
+ private static boolean writeImage(final MagickImage imageDest, final String fileDest)
+ throws MagickException {
+ imageDest.setFileName(fileDest);
+ return imageDest.writeImage(createEmptyImageInfo());
+ }
}
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/GroupManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/GroupManagerDefault.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/GroupManagerDefault.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -33,12 +33,13 @@
import org.hibernate.exception.ConstraintViolationException;
import cc.kune.core.client.errors.AccessViolationException;
-import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.client.errors.EmailAddressInUseException;
import cc.kune.core.client.errors.GroupNameInUseException;
import cc.kune.core.client.errors.UserMustBeLoggedException;
+import cc.kune.core.server.manager.FileManager;
import cc.kune.core.server.manager.GroupManager;
import cc.kune.core.server.manager.LicenseManager;
+import cc.kune.core.server.manager.file.FileUtils;
import cc.kune.core.server.properties.DatabaseProperties;
import cc.kune.core.server.properties.KuneProperties;
import cc.kune.core.server.tool.ServerTool;
@@ -66,6 +67,7 @@
@Singleton
public class GroupManagerDefault extends DefaultManager<Group, Long> implements GroupManager {
+ private final FileManager fileManager;
private final GroupFinder finder;
private final I18nTranslationService i18n;
private final KuneProperties kuneProperties;
@@ -81,7 +83,8 @@
final UserFinder userFinder, final KuneProperties kuneProperties,
final DatabaseProperties properties, final ServerToolRegistry registry,
final LicenseManager licenseManager, final LicenseFinder licenseFinder,
- final ServerToolRegistry serverToolRegistry, final I18nTranslationService i18n) {
+ final FileManager fileManager, final ServerToolRegistry serverToolRegistry,
+ final I18nTranslationService i18n) {
super(provider, Group.class);
this.finder = finder;
this.userFinder = userFinder;
@@ -90,6 +93,7 @@
this.registry = registry;
this.licenseManager = licenseManager;
this.licenseFinder = licenseFinder;
+ this.fileManager = fileManager;
this.serverToolRegistry = serverToolRegistry;
this.i18n = i18n;
}
@@ -112,7 +116,12 @@
@Override
public void clearGroupBackImage(final Group group) {
- group.setGroupBackImage(null);
+ final String file = group.getBackgroundImage();
+ if (file != null) {
+ fileManager.rm(FileUtils.groupToDir(group.getShortName()), file);
+ }
+ group.setBackgroundImage(null);
+ group.setBackgroundMime(null);
}
@Override
@@ -271,12 +280,11 @@
}
@Override
- public void setGroupBackImage(final Group group, final Content content) {
- if (content.getMimeType().isImage()) {
- group.setGroupBackImage(content);
- } else {
- throw new DefaultException("Trying to set not a image as group logo");
- }
+ public void setGroupBackgroundImage(final Group group, final String backgroundFileName,
+ final String mime) {
+ clearGroupBackImage(group);
+ group.setBackgroundImage(backgroundFileName);
+ group.setBackgroundMime(mime);
}
@Override
Modified: trunk/src/main/java/cc/kune/core/server/rpc/GroupRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/GroupRPC.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/core/server/rpc/GroupRPC.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -26,7 +26,6 @@
import cc.kune.core.server.auth.Authenticated;
import cc.kune.core.server.auth.Authorizated;
import cc.kune.core.server.content.ContentManager;
-import cc.kune.core.server.content.ContentUtils;
import cc.kune.core.server.manager.GroupManager;
import cc.kune.core.server.mapper.Mapper;
import cc.kune.core.shared.domain.AccessRol;
@@ -36,7 +35,6 @@
import cc.kune.core.shared.dto.GroupDTO;
import cc.kune.core.shared.dto.LicenseDTO;
import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.domain.Content;
import cc.kune.domain.Group;
import cc.kune.domain.User;
import cc.kune.wave.server.KuneWaveManagerDefault;
@@ -130,17 +128,6 @@
}
@Override
- @Authenticated
- @Authorizated(actionLevel = ActionLevel.group, accessRolRequired = AccessRol.Administrator)
- @Transactional
- public GroupDTO setGroupBackImage(final String userHash, final StateToken token) {
- final Group group = groupManager.findByShortName(token.getGroup());
- final Content content = contentManager.find(ContentUtils.parseId(token.getDocument()));
- groupManager.setGroupBackImage(group, content);
- return mapper.map(group, GroupDTO.class);
- }
-
- @Override
@Authenticated(mandatory = true)
@Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.group)
@Transactional
Modified: trunk/src/main/java/cc/kune/core/shared/dto/GroupDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/GroupDTO.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/core/shared/dto/GroupDTO.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -26,163 +26,163 @@
public class GroupDTO implements IsSerializable {
- AdmissionType admissionType;
- private ContentSimpleDTO defaultContent;
- private LicenseDTO defaultLicense;
- private ContentSimpleDTO groupBackImage;
- private GroupType groupType;
- private boolean hasLogo;
- private Long id;
- private String longName;
- private String shortName;
- private StateToken stateToken;
- private String workspaceTheme;
+ AdmissionType admissionType;
+ private String backgroundImage;
+ private ContentSimpleDTO defaultContent;
+ private LicenseDTO defaultLicense;
+ private GroupType groupType;
+ private boolean hasLogo;
+ private Long id;
+ private String longName;
+ private String shortName;
+ private StateToken stateToken;
+ private String workspaceTheme;
- public GroupDTO() {
- this(null, null, GroupType.ORGANIZATION);
- }
+ public GroupDTO() {
+ this(null, null, GroupType.ORGANIZATION);
+ }
- public GroupDTO(final String shortName, final String longName, final GroupType type) {
- this.shortName = shortName;
- this.longName = longName;
- this.groupType = type;
- }
+ public GroupDTO(final String shortName, final String longName, final GroupType type) {
+ this.shortName = shortName;
+ this.longName = longName;
+ this.groupType = type;
+ }
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final GroupDTO other = (GroupDTO) obj;
- if (shortName == null) {
- if (other.shortName != null) {
- return false;
- }
- } else if (!shortName.equals(other.shortName)) {
- return false;
- }
- return true;
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
}
-
- public AdmissionType getAdmissionType() {
- return admissionType;
+ if (obj == null) {
+ return false;
}
-
- public ContentSimpleDTO getDefaultContent() {
- return defaultContent;
+ if (getClass() != obj.getClass()) {
+ return false;
}
-
- public LicenseDTO getDefaultLicense() {
- return defaultLicense;
+ final GroupDTO other = (GroupDTO) obj;
+ if (shortName == null) {
+ if (other.shortName != null) {
+ return false;
+ }
+ } else if (!shortName.equals(other.shortName)) {
+ return false;
}
+ return true;
+ }
- public ContentSimpleDTO getGroupBackImage() {
- return groupBackImage;
- }
+ public AdmissionType getAdmissionType() {
+ return admissionType;
+ }
- public GroupType getGroupType() {
- return groupType;
- }
+ public String getBackgroundImage() {
+ return backgroundImage;
+ }
- public boolean getHasLogo() {
- return hasLogo;
- }
+ public ContentSimpleDTO getDefaultContent() {
+ return defaultContent;
+ }
- public Long getId() {
- return id;
- }
+ public LicenseDTO getDefaultLicense() {
+ return defaultLicense;
+ }
- public String getLongName() {
- return longName;
- }
+ public GroupType getGroupType() {
+ return groupType;
+ }
- public String getShortName() {
- return shortName;
- }
+ public boolean getHasLogo() {
+ return hasLogo;
+ }
- public StateToken getStateToken() {
- if (stateToken == null) {
- stateToken = new StateToken(shortName);
- }
- return stateToken;
- }
+ public Long getId() {
+ return id;
+ }
- public String getWorkspaceTheme() {
- return workspaceTheme;
- }
+ public String getLongName() {
+ return longName;
+ }
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + (defaultLicense == null ? 0 : defaultLicense.hashCode());
- result = prime * result + (id == null ? 0 : id.hashCode());
- result = prime * result + (longName == null ? 0 : longName.hashCode());
- result = prime * result + (shortName == null ? 0 : shortName.hashCode());
- result = prime * result + (groupType == null ? 0 : groupType.hashCode());
- return result;
- }
+ public String getShortName() {
+ return shortName;
+ }
- public boolean hasLogo() {
- return getHasLogo();
+ public StateToken getStateToken() {
+ if (stateToken == null) {
+ stateToken = new StateToken(shortName);
}
+ return stateToken;
+ }
- public boolean isNotPersonal() {
- return !isPersonal();
- }
+ public String getWorkspaceTheme() {
+ return workspaceTheme;
+ }
- public boolean isPersonal() {
- return groupType.equals(GroupType.PERSONAL);
- }
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (defaultLicense == null ? 0 : defaultLicense.hashCode());
+ result = prime * result + (id == null ? 0 : id.hashCode());
+ result = prime * result + (longName == null ? 0 : longName.hashCode());
+ result = prime * result + (shortName == null ? 0 : shortName.hashCode());
+ result = prime * result + (groupType == null ? 0 : groupType.hashCode());
+ return result;
+ }
- public void setAdmissionType(final AdmissionType admissionType) {
- this.admissionType = admissionType;
- }
+ public boolean hasLogo() {
+ return getHasLogo();
+ }
- public void setDefaultContent(final ContentSimpleDTO defaultContent) {
- this.defaultContent = defaultContent;
- }
+ public boolean isNotPersonal() {
+ return !isPersonal();
+ }
- public void setDefaultLicense(final LicenseDTO defaultLicense) {
- this.defaultLicense = defaultLicense;
- }
+ public boolean isPersonal() {
+ return groupType.equals(GroupType.PERSONAL);
+ }
- public void setGroupBackImage(final ContentSimpleDTO groupBackImage) {
- this.groupBackImage = groupBackImage;
- }
+ public void setAdmissionType(final AdmissionType admissionType) {
+ this.admissionType = admissionType;
+ }
- public void setGroupType(final GroupType groupType) {
- this.groupType = groupType;
- }
+ public void setBackgroundImage(final String backgroundImage) {
+ this.backgroundImage = backgroundImage;
+ }
- public void setHasLogo(final boolean hasLogo) {
- this.hasLogo = hasLogo;
- }
+ public void setDefaultContent(final ContentSimpleDTO defaultContent) {
+ this.defaultContent = defaultContent;
+ }
- public void setId(final Long id) {
- this.id = id;
- }
+ public void setDefaultLicense(final LicenseDTO defaultLicense) {
+ this.defaultLicense = defaultLicense;
+ }
- public void setLongName(final String name) {
- this.longName = name;
- }
+ public void setGroupType(final GroupType groupType) {
+ this.groupType = groupType;
+ }
- public void setShortName(final String shortName) {
- this.shortName = shortName;
- }
+ public void setHasLogo(final boolean hasLogo) {
+ this.hasLogo = hasLogo;
+ }
- public void setWorkspaceTheme(final String workspaceTheme) {
- this.workspaceTheme = workspaceTheme;
- }
+ public void setId(final Long id) {
+ this.id = id;
+ }
- @Override
- public String toString() {
- return "GroupDTO[" + shortName + "]";
- }
+ public void setLongName(final String name) {
+ this.longName = name;
+ }
+
+ public void setShortName(final String shortName) {
+ this.shortName = shortName;
+ }
+
+ public void setWorkspaceTheme(final String workspaceTheme) {
+ this.workspaceTheme = workspaceTheme;
+ }
+
+ @Override
+ public String toString() {
+ return "GroupDTO[" + shortName + "]";
+ }
}
Modified: trunk/src/main/java/cc/kune/domain/Group.java
===================================================================
--- trunk/src/main/java/cc/kune/domain/Group.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/domain/Group.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -55,258 +55,268 @@
@Table(name = "groups")
public class Group implements HasId {
- // see: http://docs.codehaus.org/display/PICO/Good+Citizen:
- // Never expect or return null
- public static final Group NO_GROUP = null;
- // public static final String PROPS_ID = "groupprops";
+ // see: http://docs.codehaus.org/display/PICO/Good+Citizen:
+ // Never expect or return null
+ public static final Group NO_GROUP = null;
+ // public static final String PROPS_ID = "groupprops";
- @Enumerated(EnumType.STRING)
- @Column(nullable = false)
- AdmissionType admissionType;
+ @Enumerated(EnumType.STRING)
+ @Column(nullable = false)
+ AdmissionType admissionType;
- @Basic(optional = false)
- private final Long createdOn;
+ private String backgroundImage;
- @OneToOne
- private Content defaultContent;
+ private String backgroundMime;
- @OneToOne
- private License defaultLicense;
+ @Basic(optional = false)
+ private final Long createdOn;
- @OneToOne
- private Content groupBackImage;
+ @OneToOne
+ private Content defaultContent;
- @Enumerated(EnumType.STRING)
- @Column(nullable = false)
- GroupType groupType;
+ @OneToOne
+ private License defaultLicense;
- @Id
- @DocumentId
- @GeneratedValue
- private Long id;
+ @Enumerated(EnumType.STRING)
+ @Column(nullable = false)
+ GroupType groupType;
- @Lob
- private byte[] logo;
+ @Id
+ @DocumentId
+ @GeneratedValue
+ private Long id;
- @Embedded
- private BasicMimeType logoMime;
+ @Lob
+ private byte[] logo;
- @Field(index = Index.TOKENIZED, store = Store.NO)
- @Column(unique = true)
- @Length(min = 3, max = 50, message = "The longName must be between 3 and 50 characters of length")
- private String longName;
+ @Embedded
+ private BasicMimeType logoMime;
- @Field(index = Index.UN_TOKENIZED, store = Store.NO)
- @Column(unique = true)
- @Length(min = 3, max = 15, message = "The shortname must be between 3 and 15 characters of length")
- @Pattern(regex = "^[a-z0-9]+$", message = "The name must be between 3 and 15 lowercase characters. It can only contain Western characters, numbers, and dashes")
- private String shortName;
+ @Field(index = Index.TOKENIZED, store = Store.NO)
+ @Column(unique = true)
+ @Length(min = 3, max = 50, message = "The longName must be between 3 and 50 characters of length")
+ private String longName;
- @OneToOne(cascade = CascadeType.ALL)
- private SocialNetwork socialNetwork;
+ @Field(index = Index.UN_TOKENIZED, store = Store.NO)
+ @Column(unique = true)
+ @Length(min = 3, max = 15, message = "The shortname must be between 3 and 15 characters of length")
+ @Pattern(regex = "^[a-z0-9]+$", message = "The name must be between 3 and 15 lowercase characters. It can only contain Western characters, numbers, and dashes")
+ private String shortName;
- @OneToMany
- private final Map<String, ToolConfiguration> toolsConfig;
+ @OneToOne(cascade = CascadeType.ALL)
+ private SocialNetwork socialNetwork;
- private String workspaceTheme;
+ @OneToMany
+ private final Map<String, ToolConfiguration> toolsConfig;
- public Group() {
- this(null, null, null, null);
- }
+ private String workspaceTheme;
- public Group(final String shortName, final String longName) {
- this(shortName, longName, null, GroupType.PROJECT);
- }
+ public Group() {
+ this(null, null, null, null);
+ }
- public Group(final String shortName, final String longName, final License defaultLicense, final GroupType type) {
- this.shortName = shortName;
- this.longName = longName;
- this.toolsConfig = new HashMap<String, ToolConfiguration>();
- this.socialNetwork = new SocialNetwork();
- this.defaultLicense = defaultLicense;
- this.groupType = type;
- this.admissionType = AdmissionType.Moderated;
- this.createdOn = System.currentTimeMillis();
- }
+ public Group(final String shortName, final String longName) {
+ this(shortName, longName, null, GroupType.PROJECT);
+ }
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final Group other = (Group) obj;
- if (shortName == null) {
- if (other.shortName != null) {
- return false;
- }
- } else if (!shortName.equals(other.shortName)) {
- return false;
- }
- return true;
- }
+ public Group(final String shortName, final String longName, final License defaultLicense,
+ final GroupType type) {
+ this.shortName = shortName;
+ this.longName = longName;
+ this.toolsConfig = new HashMap<String, ToolConfiguration>();
+ this.socialNetwork = new SocialNetwork();
+ this.defaultLicense = defaultLicense;
+ this.groupType = type;
+ this.admissionType = AdmissionType.Moderated;
+ this.createdOn = System.currentTimeMillis();
+ }
- public boolean existToolConfig(final String toolName) {
- return toolsConfig.get(toolName) != null;
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
}
-
- @Transient
- public AccessLists getAccessLists() {
- return getSocialNetwork().getAccessLists();
+ if (obj == null) {
+ return false;
}
-
- public AdmissionType getAdmissionType() {
- return admissionType;
+ if (getClass() != obj.getClass()) {
+ return false;
}
-
- public Long getCreatedOn() {
- return createdOn;
+ final Group other = (Group) obj;
+ if (shortName == null) {
+ if (other.shortName != null) {
+ return false;
+ }
+ } else if (!shortName.equals(other.shortName)) {
+ return false;
}
+ return true;
+ }
- public Content getDefaultContent() {
- return defaultContent;
- }
+ public boolean existToolConfig(final String toolName) {
+ return toolsConfig.get(toolName) != null;
+ }
- public License getDefaultLicense() {
- return defaultLicense;
- }
+ @Transient
+ public AccessLists getAccessLists() {
+ return getSocialNetwork().getAccessLists();
+ }
- public Content getGroupBackImage() {
- return groupBackImage;
- }
+ public AdmissionType getAdmissionType() {
+ return admissionType;
+ }
- public GroupType getGroupType() {
- return groupType;
- }
+ public String getBackgroundImage() {
+ return backgroundImage;
+ }
- public boolean getHasLogo() {
- return hasLogo();
- }
+ public String getBackgroundMime() {
+ return backgroundMime;
+ }
- @Override
- public Long getId() {
- return id;
- }
+ public Long getCreatedOn() {
+ return createdOn;
+ }
- public byte[] getLogo() {
- return logo;
- }
+ public Content getDefaultContent() {
+ return defaultContent;
+ }
- public BasicMimeType getLogoMime() {
- return logoMime;
- }
+ public License getDefaultLicense() {
+ return defaultLicense;
+ }
- public String getLongName() {
- return longName;
- }
+ public GroupType getGroupType() {
+ return groupType;
+ }
- public Container getRoot(final String toolName) {
- return toolsConfig.get(toolName).getRoot();
- }
+ public boolean getHasLogo() {
+ return hasLogo();
+ }
- public String getShortName() {
- return shortName;
- }
+ @Override
+ public Long getId() {
+ return id;
+ }
- public SocialNetwork getSocialNetwork() {
- return socialNetwork;
- }
+ public byte[] getLogo() {
+ return logo;
+ }
- @Transient
- public StateToken getStateToken() {
- return new StateToken(shortName);
- }
+ public BasicMimeType getLogoMime() {
+ return logoMime;
+ }
- public ToolConfiguration getToolConfiguration(final String name) {
- return toolsConfig.get(name);
- }
+ public String getLongName() {
+ return longName;
+ }
- public Map<String, ToolConfiguration> getToolsConfig() {
- return toolsConfig;
- }
+ public Container getRoot(final String toolName) {
+ return toolsConfig.get(toolName).getRoot();
+ }
- public String getWorkspaceTheme() {
- return workspaceTheme;
- }
+ public String getShortName() {
+ return shortName;
+ }
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + (shortName == null ? 0 : shortName.hashCode());
- return result;
- }
+ public SocialNetwork getSocialNetwork() {
+ return socialNetwork;
+ }
- @Transient
- public boolean hasLogo() {
- return (logo != null && logo.length > 0 && logoMime != null);
- }
+ @Transient
+ public StateToken getStateToken() {
+ return new StateToken(shortName);
+ }
- public boolean isPersonal() {
- return getGroupType().equals(GroupType.PERSONAL);
- }
+ public ToolConfiguration getToolConfiguration(final String name) {
+ return toolsConfig.get(name);
+ }
- public void setAdmissionType(final AdmissionType admissionType) {
- this.admissionType = admissionType;
- }
+ public Map<String, ToolConfiguration> getToolsConfig() {
+ return toolsConfig;
+ }
- public void setDefaultContent(final Content defaultContent) {
- this.defaultContent = defaultContent;
- }
+ public String getWorkspaceTheme() {
+ return workspaceTheme;
+ }
- public void setDefaultLicense(final License defaultLicense) {
- this.defaultLicense = defaultLicense;
- }
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (shortName == null ? 0 : shortName.hashCode());
+ return result;
+ }
- public void setGroupBackImage(final Content groupBackImage) {
- this.groupBackImage = groupBackImage;
- }
+ @Transient
+ public boolean hasLogo() {
+ return (logo != null && logo.length > 0 && logoMime != null);
+ }
- public void setGroupType(final GroupType groupType) {
- this.groupType = groupType;
- }
+ public boolean isPersonal() {
+ return getGroupType().equals(GroupType.PERSONAL);
+ }
- @Override
- public void setId(final Long id) {
- this.id = id;
- }
+ public void setAdmissionType(final AdmissionType admissionType) {
+ this.admissionType = admissionType;
+ }
- public void setLogo(final byte[] logo) {
- this.logo = logo;
- }
+ public void setBackgroundImage(final String backgroundImage) {
+ this.backgroundImage = backgroundImage;
+ }
- public void setLogoMime(final BasicMimeType logoMime) {
- this.logoMime = logoMime;
- }
+ public void setBackgroundMime(final String backgroundMime) {
+ this.backgroundMime = backgroundMime;
+ }
- public void setLongName(final String longName) {
- this.longName = longName;
- }
+ public void setDefaultContent(final Content defaultContent) {
+ this.defaultContent = defaultContent;
+ }
- public void setShortName(final String shortName) {
- this.shortName = shortName;
- }
+ public void setDefaultLicense(final License defaultLicense) {
+ this.defaultLicense = defaultLicense;
+ }
- public void setSocialNetwork(final SocialNetwork socialNetwork) {
- this.socialNetwork = socialNetwork;
- }
+ public void setGroupType(final GroupType groupType) {
+ this.groupType = groupType;
+ }
- public ToolConfiguration setToolConfig(final String name, final ToolConfiguration config) {
- toolsConfig.put(name, config);
- return config;
- }
+ @Override
+ public void setId(final Long id) {
+ this.id = id;
+ }
- public void setWorkspaceTheme(final String workspaceTheme) {
- this.workspaceTheme = workspaceTheme;
- }
+ public void setLogo(final byte[] logo) {
+ this.logo = logo;
+ }
- @Override
- public String toString() {
- return "Group[" + shortName + "]";
- }
+ public void setLogoMime(final BasicMimeType logoMime) {
+ this.logoMime = logoMime;
+ }
+
+ public void setLongName(final String longName) {
+ this.longName = longName;
+ }
+
+ public void setShortName(final String shortName) {
+ this.shortName = shortName;
+ }
+
+ public void setSocialNetwork(final SocialNetwork socialNetwork) {
+ this.socialNetwork = socialNetwork;
+ }
+
+ public ToolConfiguration setToolConfig(final String name, final ToolConfiguration config) {
+ toolsConfig.put(name, config);
+ return config;
+ }
+
+ public void setWorkspaceTheme(final String workspaceTheme) {
+ this.workspaceTheme = workspaceTheme;
+ }
+
+ @Override
+ public String toString() {
+ return "Group[" + shortName + "]";
+ }
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -26,6 +26,8 @@
public interface GSpaceArmor {
+ void clearBackImage();
+
ForIsWidget getDocContainer();
ForIsWidget getDocFooter();
@@ -64,5 +66,7 @@
void selectUserSpace();
+ void setBackImage(String url);
+
void setContentVisible(boolean visible);
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -19,6 +19,8 @@
*/
package cc.kune.gspace.client;
+import org.cobogw.gwt.user.client.CSS;
+
import cc.kune.common.client.actions.ui.ActionFlowPanel;
import cc.kune.common.client.actions.ui.IsActionExtensible;
@@ -96,7 +98,6 @@
public GSpaceArmorImpl(final Provider<ActionFlowPanel> toolbarProv) {
initWidget(uiBinder.createAndBindUi(this));
groupSpace.setWidgetMinSize(splitEast, 150);
- tabs.setStyleName("k-spaces");
homeSpace.add(RootPanel.get("k-home-wrapper"));
DOM.setStyleAttribute((Element) groupSpace.getWidgetContainerElement(splitEast), "overflow",
"visible");
@@ -110,9 +111,15 @@
getDocFooter().add(footerToolbar);
entityToolsNorth.getElement().getStyle().setPosition(Position.RELATIVE);
// entityToolsSouth.setVisible(false);
+ mainpanel.getWidgetContainerElement(tabs).addClassName("k-spaces");
}
@Override
+ public void clearBackImage() {
+ DOM.setStyleAttribute(mainpanel.getElement(), CSS.A.BACKGROUND, "transparent");
+ }
+
+ @Override
public ForIsWidget getDocContainer() {
return docContainer;
}
@@ -208,6 +215,12 @@
}
@Override
+ public void setBackImage(final String url) {
+ final String bodyProp = "#FFFFFF url('" + url + "') fixed no-repeat top left";
+ DOM.setStyleAttribute(mainpanel.getElement(), CSS.A.BACKGROUND, bodyProp);
+ }
+
+ @Override
public void setContentVisible(final boolean visible) {
// NotifyUser.info("Visible: " + visible);
// docContainer.getElement().getStyle().setOpacity(visible ? 1d : .0d);
Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml 2011-06-21 20:03:39 UTC (rev 1412)
@@ -22,12 +22,12 @@
barUnit='PX' barHeight='0' ui:field="tabs">
<g:tab>
<g:header size='0' />
- <g:SimplePanel ui:field="homeSpace" width="100%"
+ <g:SimplePanel styleName="k-space" ui:field="homeSpace" width="100%"
height="100%"></g:SimplePanel>
</g:tab>
<g:tab>
<g:header size='0' />
- <g:FlowPanel ui:field="userSpace" width="100%"
+ <g:FlowPanel ui:field="userSpace" styleName="k-space" width="100%"
height="100%">
<!-- <g:Frame url="/" styleName="{style.frame}" -->
<!-- ui:field="frame" width="100%" height="100%" /> -->
@@ -35,7 +35,7 @@
</g:tab>
<g:tab>
<g:header size='0' />
- <g:SplitLayoutPanel width="100%" height="100%"
+ <g:SplitLayoutPanel width="100%" height="100%" styleName="k-space"
ui:field="groupSpace">
<g:center size="1.0">
<g:DockLayoutPanel unit="PX" ui:field="splitCenter">
@@ -109,7 +109,7 @@
</g:tab>
<g:tab>
<g:header size='0' />
- <g:SimplePanel ui:field="publicSpace" width="100%"
+ <g:SimplePanel ui:field="publicSpace" width="100%" styleName="k-space"
height="100%"></g:SimplePanel>
</g:tab>
</g:TabLayoutPanel>
Modified: trunk/src/main/java/cc/kune/gspace/client/options/logo/CurrentLogoChangedEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/CurrentLogoChangedEvent.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/CurrentLogoChangedEvent.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -26,49 +26,49 @@
public class CurrentLogoChangedEvent extends GwtEvent<CurrentLogoChangedEvent.CurrentLogoChangedHandler> {
- public interface CurrentLogoChangedHandler extends EventHandler {
- public void onCurrentLogoChanged(CurrentLogoChangedEvent event);
- }
+ public interface CurrentLogoChangedHandler extends EventHandler {
+ public void onCurrentLogoChanged(CurrentLogoChangedEvent event);
+ }
- public interface HasCurrentLogoChangedHandlers extends HasHandlers {
- HandlerRegistration addCurrentLogoChangedHandler(CurrentLogoChangedHandler handler);
- }
+ public interface HasCurrentLogoChangedHandlers extends HasHandlers {
+ HandlerRegistration addCurrentLogoChangedHandler(CurrentLogoChangedHandler handler);
+ }
- private static final Type<CurrentLogoChangedHandler> TYPE = new Type<CurrentLogoChangedHandler>();
+ private static final Type<CurrentLogoChangedHandler> TYPE = new Type<CurrentLogoChangedHandler>();
- public static void fire(final HasHandlers source) {
- source.fireEvent(new CurrentLogoChangedEvent());
- }
+ public static void fire(final HasHandlers source) {
+ source.fireEvent(new CurrentLogoChangedEvent());
+ }
- public static Type<CurrentLogoChangedHandler> getType() {
- return TYPE;
- }
+ public static Type<CurrentLogoChangedHandler> getType() {
+ return TYPE;
+ }
- public CurrentLogoChangedEvent() {
- }
+ public CurrentLogoChangedEvent() {
+ }
- @Override
- protected void dispatch(final CurrentLogoChangedHandler handler) {
- handler.onCurrentLogoChanged(this);
- }
+ @Override
+ protected void dispatch(final CurrentLogoChangedHandler handler) {
+ handler.onCurrentLogoChanged(this);
+ }
- @Override
- public boolean equals(final Object obj) {
- return super.equals(obj);
- }
+ @Override
+ public boolean equals(final Object obj) {
+ return super.equals(obj);
+ }
- @Override
- public Type<CurrentLogoChangedHandler> getAssociatedType() {
- return TYPE;
- }
+ @Override
+ public Type<CurrentLogoChangedHandler> getAssociatedType() {
+ return TYPE;
+ }
- @Override
- public int hashCode() {
- return super.hashCode();
- }
+ @Override
+ public int hashCode() {
+ return super.hashCode();
+ }
- @Override
- public String toString() {
- return "CurrentLogoChangedEvent[" + "]";
- }
+ @Override
+ public String toString() {
+ return "CurrentLogoChangedEvent[" + "]";
+ }
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPanel.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPanel.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -19,12 +19,10 @@
\*/
package cc.kune.gspace.client.options.logo;
-import gwtupload.client.IFileInput.FileInputType;
import gwtupload.client.IUploader.OnCancelUploaderHandler;
import gwtupload.client.IUploader.OnChangeUploaderHandler;
import gwtupload.client.IUploader.OnFinishUploaderHandler;
import gwtupload.client.IUploader.OnStartUploaderHandler;
-import gwtupload.client.MultiUploader;
import cc.kune.common.client.ui.IconLabel;
import cc.kune.common.client.utils.OnAcceptCallback;
import cc.kune.core.client.resources.CoreMessages;
@@ -33,46 +31,17 @@
import cc.kune.core.shared.i18n.I18nTranslationService;
import cc.kune.gspace.client.options.EntityOptionsView;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.DecoratorPanel;
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.user.client.ui.Hidden;
import com.google.gwt.user.client.ui.IsWidget;
-import com.google.gwt.user.client.ui.Label;
public class EntityOptionsLogoPanel extends Composite implements EntityOptionsLogoView {
- public class UploadButton extends Composite implements HasClickHandlers {
- DecoratorPanel widget = new DecoratorPanel();
-
- public UploadButton() {
- final DecoratorPanel widget = new DecoratorPanel();
- final Button btn = new Button(i18n.t("Choose"));
- btn.addStyleName("k-button");
- initWidget(widget);
- widget.setWidget(btn);
- widget.setHeight("50px");
- }
-
- @Override
- public HandlerRegistration addClickHandler(final ClickHandler handler) {
- return addDomHandler(handler, ClickEvent.getType());
- }
- }
-
public static final String ICON_UPLD_SERVLET = "servlets/EntityLogoUploadManager";
- private final Label dialogInfoLabel;
+ private final EntityUploaderForm uploader;
private final I18nTranslationService i18n;
private final IconLabel tabTitle;
- private final Hidden tokenField;
- private final MultiUploader uploader;
- private final Hidden userhashField;
public EntityOptionsLogoPanel(final EventBus eventBus, final I18nTranslationService i18n,
final String panelId, final String buttonId, final String inputId, final NavResources res) {
@@ -80,29 +49,11 @@
this.i18n = i18n;
tabTitle = new IconLabel(res.picture(), "");
- final UploadButton btn = new UploadButton();
- uploader = new MultiUploader(FileInputType.CUSTOM.with(btn));
- uploader.setServletPath(ICON_UPLD_SERVLET);
- uploader.setMaximumFiles(1);
- dialogInfoLabel = new Label();
- dialogInfoLabel.setWordWrap(true);
- dialogInfoLabel.addStyleName("kune-Margin-20-tb");
- uploader.setValidExtensions("png", "jpg", "gif", "jpeg", "bmp");
+ uploader = new EntityUploaderForm(ICON_UPLD_SERVLET, i18n.t("Choose"));
- userhashField = new Hidden(FileConstants.HASH, FileConstants.HASH);
- tokenField = new Hidden(FileConstants.TOKEN, FileConstants.TOKEN);
-
- final FlowPanel holder = new FlowPanel();
-
- uploader.add(userhashField);
- uploader.add(tokenField);
- holder.add(dialogInfoLabel);
- holder.add(uploader);
-
- initWidget(holder);
+ initWidget(uploader);
setHeight(String.valueOf(EntityOptionsView.HEIGHT) + "px");
setWidth(String.valueOf(EntityOptionsView.WIDTH) + "px");
- // uploader.setHeight("100px");
addStyleName("k-overflow-y-auto");
addStyleName("k-tab-panel");
@@ -144,7 +95,7 @@
@Override
public void setNormalGroupsLabels() {
- dialogInfoLabel.setText(i18n.t("Select an image in your computer as the logo for this group. "
+ uploader.setLabelText(i18n.t("Select an image in your computer as the logo for this group. "
+ "For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.",
FileConstants.LOGO_DEF_HEIGHT, FileConstants.LOGO_DEF_HEIGHT));
tabTitle.setText(CoreMessages.ENT_LOGO_SELECTOR_NORMAL_TITLE);
@@ -152,7 +103,7 @@
@Override
public void setPersonalGroupsLabels() {
- dialogInfoLabel.setText(i18n.t("Select an image in your computer as your avatar. "
+ uploader.setLabelText(i18n.t("Select an image in your computer as your avatar. "
+ "For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.",
FileConstants.LOGO_DEF_HEIGHT, FileConstants.LOGO_DEF_HEIGHT));
tabTitle.setText(CoreMessages.ENT_LOGO_SELECTOR_PERSON_TITLE);
@@ -160,8 +111,7 @@
@Override
public void setUploadParams(final String userHash, final String token) {
- userhashField.setValue(userHash);
- tokenField.setValue(token);
+ uploader.setUploadParams(userHash, token);
}
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPresenter.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsLogoPresenter.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -26,7 +26,7 @@
import cc.kune.common.client.notify.NotifyUser;
import cc.kune.core.client.rpcservices.UserServiceAsync;
import cc.kune.core.client.state.Session;
-import cc.kune.core.client.ws.entheader.EntityHeader;
+import cc.kune.core.shared.i18n.I18nTranslationService;
import cc.kune.gspace.client.options.EntityOptions;
import com.google.gwt.event.shared.EventBus;
@@ -34,21 +34,21 @@
import com.google.inject.Provider;
public abstract class EntityOptionsLogoPresenter implements GroupOptionsLogo, UserOptionsLogo {
- private final EntityHeader entityLogo;
private final EntityOptions entityOptions;
protected final EventBus eventBus;
+ private final I18nTranslationService i18n;
protected final Session session;
protected final Provider<UserServiceAsync> userService;
protected EntityOptionsLogoView view;
public EntityOptionsLogoPresenter(final EventBus eventBus, final Session session,
- final EntityHeader entityLogo, final EntityOptions entityOptions,
- final Provider<UserServiceAsync> userService) {
+ final EntityOptions entityOptions, final Provider<UserServiceAsync> userService,
+ final I18nTranslationService i18n) {
this.eventBus = eventBus;
this.session = session;
- this.entityLogo = entityLogo;
this.entityOptions = entityOptions;
this.userService = userService;
+ this.i18n = i18n;
}
public IsWidget getView() {
@@ -66,7 +66,6 @@
}
});
view.addOnFinishUploadHandler(new OnFinishUploaderHandler() {
-
@Override
public void onFinish(final IUploader uploader) {
onSubmitComplete(uploader);
@@ -87,7 +86,7 @@
}
public void onSubmitFailed(final String responseText) {
- NotifyUser.error("Error setting the logo: " + responseText);
+ NotifyUser.error(i18n.t("Error setting the logo", responseText));
}
protected abstract void setState();
Added: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsUploadButton.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsUploadButton.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsUploadButton.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -0,0 +1,27 @@
+package cc.kune.gspace.client.options.logo;
+
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.HasClickHandlers;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.DecoratorPanel;
+
+public class EntityOptionsUploadButton extends Composite implements HasClickHandlers {
+ DecoratorPanel widget = new DecoratorPanel();
+
+ public EntityOptionsUploadButton(final String text) {
+ final DecoratorPanel widget = new DecoratorPanel();
+ final Button btn = new Button(text);
+ btn.addStyleName("k-button");
+ initWidget(widget);
+ widget.setWidget(btn);
+ widget.setHeight("50px");
+ }
+
+ @Override
+ public HandlerRegistration addClickHandler(final ClickHandler handler) {
+ return addDomHandler(handler, ClickEvent.getType());
+ }
+}
\ No newline at end of file
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptionsUploadButton.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityUploaderForm.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityUploaderForm.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityUploaderForm.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -0,0 +1,75 @@
+package cc.kune.gspace.client.options.logo;
+
+import gwtupload.client.IFileInput.FileInputType;
+import gwtupload.client.IUploader.OnCancelUploaderHandler;
+import gwtupload.client.IUploader.OnChangeUploaderHandler;
+import gwtupload.client.IUploader.OnFinishUploaderHandler;
+import gwtupload.client.IUploader.OnStartUploaderHandler;
+import gwtupload.client.MultiUploader;
+import cc.kune.core.client.services.FileConstants;
+
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.Hidden;
+import com.google.gwt.user.client.ui.Label;
+
+public class EntityUploaderForm extends Composite {
+
+ private final Label dialogInfoLabel;
+ private final Hidden tokenField;
+ private final MultiUploader uploader;
+ private final Hidden userhashField;
+
+ public EntityUploaderForm(final String servlet, final String btnText) {
+ final EntityOptionsUploadButton btn = new EntityOptionsUploadButton(btnText);
+ uploader = new MultiUploader(FileInputType.CUSTOM.with(btn));
+ uploader.setServletPath(servlet);
+ uploader.setMaximumFiles(1);
+ dialogInfoLabel = new Label();
+ dialogInfoLabel.setWordWrap(true);
+ dialogInfoLabel.addStyleName("kune-Margin-20-tb");
+ uploader.setValidExtensions("png", "jpg", "gif", "jpeg", "bmp");
+
+ userhashField = new Hidden(FileConstants.HASH, FileConstants.HASH);
+ tokenField = new Hidden(FileConstants.TOKEN, FileConstants.TOKEN);
+
+ final FlowPanel holder = new FlowPanel();
+
+ uploader.add(userhashField);
+ uploader.add(tokenField);
+ holder.add(dialogInfoLabel);
+ holder.add(uploader);
+ initWidget(holder);
+ }
+
+ public HandlerRegistration addOnCancelUploadHandler(final OnCancelUploaderHandler handler) {
+ return uploader.addOnCancelUploadHandler(handler);
+ }
+
+ public HandlerRegistration addOnChangeUploadHandler(final OnChangeUploaderHandler handler) {
+ return uploader.addOnChangeUploadHandler(handler);
+ }
+
+ public HandlerRegistration addOnFinishUploadHandler(final OnFinishUploaderHandler handler) {
+ return uploader.addOnFinishUploadHandler(handler);
+ }
+
+ public HandlerRegistration addOnStartUploadHandler(final OnStartUploaderHandler handler) {
+ return uploader.addOnStartUploadHandler(handler);
+ }
+
+ public void reset() {
+ uploader.reset();
+ }
+
+ public void setLabelText(final String text) {
+ dialogInfoLabel.setText(text);
+ }
+
+ public void setUploadParams(final String userHash, final String token) {
+ userhashField.setValue(userHash);
+ tokenField.setValue(token);
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityUploaderForm.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogoPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogoPresenter.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptionsLogoPresenter.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -24,7 +24,7 @@
import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
-import cc.kune.core.client.ws.entheader.EntityHeader;
+import cc.kune.core.shared.i18n.I18nTranslationService;
import cc.kune.gspace.client.options.GroupOptions;
import com.google.gwt.event.shared.EventBus;
@@ -35,9 +35,10 @@
@Inject
public GroupOptionsLogoPresenter(final EventBus eventBus, final Session session,
- final EntityHeader entityLogo, final GroupOptions entityOptions, final StateManager stateManager,
- final Provider<UserServiceAsync> userService, final GroupOptionsLogoView view) {
- super(eventBus, session, entityLogo, entityOptions, userService);
+ final GroupOptions entityOptions, final StateManager stateManager,
+ final Provider<UserServiceAsync> userService, final GroupOptionsLogoView view,
+ final I18nTranslationService i18n) {
+ super(eventBus, session, entityOptions, userService, i18n);
init(view);
stateManager.onGroupChanged(true, new GroupChangedHandler() {
@Override
Modified: trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoPresenter.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptionsLogoPresenter.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -27,8 +27,8 @@
import cc.kune.core.client.state.StateManager;
import cc.kune.core.client.state.UserSignInEvent;
import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
-import cc.kune.core.client.ws.entheader.EntityHeader;
import cc.kune.core.shared.dto.GroupDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
import cc.kune.gspace.client.options.UserOptions;
import com.google.gwt.event.shared.EventBus;
@@ -39,9 +39,10 @@
@Inject
public UserOptionsLogoPresenter(final EventBus eventBus, final Session session,
- final EntityHeader entityLogo, final UserOptions entityOptions, final StateManager stateManager,
- final Provider<UserServiceAsync> userService, final UserOptionsLogoView view) {
- super(eventBus, session, entityLogo, entityOptions, userService);
+ final UserOptions entityOptions, final StateManager stateManager,
+ final Provider<UserServiceAsync> userService, final UserOptionsLogoView view,
+ final I18nTranslationService i18n) {
+ super(eventBus, session, entityOptions, userService, i18n);
init(view);
session.onUserSignIn(true, new UserSignInHandler() {
@Override
Modified: trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfPanel.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfPanel.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -19,22 +19,25 @@
*/
package cc.kune.gspace.client.options.style;
+import gwtupload.client.IUploader.OnCancelUploaderHandler;
+import gwtupload.client.IUploader.OnChangeUploaderHandler;
+import gwtupload.client.IUploader.OnFinishUploaderHandler;
+import gwtupload.client.IUploader.OnStartUploaderHandler;
import cc.kune.common.client.notify.NotifyUser;
import cc.kune.common.client.tooltip.Tooltip;
import cc.kune.common.client.ui.BasicThumb;
import cc.kune.common.client.ui.IconLabel;
import cc.kune.common.client.utils.TextUtils;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.client.services.FileDownloadUtils;
-import cc.kune.core.client.services.ImageSize;
-import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.i18n.I18nTranslationService;
import cc.kune.gspace.client.options.EntityOptionsView;
+import cc.kune.gspace.client.options.logo.EntityUploaderForm;
import cc.kune.gspace.client.themes.GSpaceThemeSelectorPanel;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
+import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Image;
@@ -44,42 +47,50 @@
public class EntityOptionsStyleConfPanel extends FlowPanel implements EntityOptionsStyleConfView {
+ public static final String ICON_UPLD_SERVLET = "servlets/EntityBackgroundUploadManager";
private final Image backImage;
private final Button clearBtn;
private final Label currentBackLabel;
- private final FileDownloadUtils downUtils;
private final Label noBackLabel;
private final IconLabel tabTitle;
+ private final EntityUploaderForm uploader;
- public EntityOptionsStyleConfPanel(final I18nTranslationService i18n,
- final FileDownloadUtils downUtils, final CoreResources res,
+ public EntityOptionsStyleConfPanel(final I18nTranslationService i18n, final CoreResources res,
final GSpaceThemeSelectorPanel styleSelector) {
- this.downUtils = downUtils;
+ ;
tabTitle = new IconLabel(res.themeChoose(), i18n.t("Style"));
super.setHeight(String.valueOf(EntityOptionsView.HEIGHT) + "px");
super.setWidth(String.valueOf(EntityOptionsView.WIDTH) + "px");
- final FlowPanel wsHP = new FlowPanel();
+ final FlowPanel flow = new FlowPanel();
final Label wsThemeInfo = new Label(i18n.t("Change this workspace theme:"));
- wsThemeInfo.addStyleName("kune-Margin-20-tb");
+ flow.addStyleName("kune-Margin-20-tb");
+ wsThemeInfo.addStyleName("k-fl");
styleSelector.addStyleName("k-fl");
- wsHP.add(wsThemeInfo);
- wsHP.add(styleSelector);
- add(wsHP);
- final VerticalPanel backPanel = new VerticalPanel();
+ styleSelector.addStyleName("kune-Margin-10-trbl");
+ flow.add(wsThemeInfo);
+ flow.add(styleSelector);
currentBackLabel = new Label(i18n.t("Current background image: "));
- noBackLabel = new Label(i18n.t("Also you can upload any image and select it later as background."));
+ noBackLabel = new Label(i18n.t("Also you can upload a background:"));
+ currentBackLabel.addStyleName("k-clear");
+ noBackLabel.addStyleName("k-clear");
+ uploader = new EntityUploaderForm(ICON_UPLD_SERVLET, i18n.t("Choose"));
+ uploader.addStyleName("k-fl");
backImage = new Image();
backImage.addStyleName("kune-Margin-Medium-trbl");
noBackLabel.addStyleName("kune-Margin-Medium-tb");
clearBtn = new Button(i18n.t("Clear"));
+ clearBtn.setStyleName("k-button");
+ clearBtn.addStyleName("k-fl");
Tooltip.to(clearBtn, i18n.t("Remove current background image"));
- // backPanel.add(noBackLabel);
- backPanel.add(currentBackLabel);
- backPanel.add(backImage);
- backPanel.add(clearBtn);
- backPanel.addStyleName("oc-clean");
- // add(backPanel);
+ flow.add(noBackLabel);
+ flow.add(currentBackLabel);
+ flow.add(backImage);
+ flow.add(uploader);
+ flow.add(clearBtn);
+ flow.addStyleName("oc-clean");
+ backImage.addStyleName("k-fr");
+ add(flow);
final Label wsInfo = new Label(i18n.t("Select and configure the public space theme of this group:"));
wsInfo.addStyleName("kune-Margin-Medium-tb");
// add(wsInfo);
@@ -106,6 +117,26 @@
}
@Override
+ public HandlerRegistration addOnCancelUploadHandler(final OnCancelUploaderHandler handler) {
+ return uploader.addOnCancelUploadHandler(handler);
+ }
+
+ @Override
+ public HandlerRegistration addOnChangeUploadHandler(final OnChangeUploaderHandler handler) {
+ return uploader.addOnChangeUploadHandler(handler);
+ }
+
+ @Override
+ public HandlerRegistration addOnFinishUploadHandler(final OnFinishUploaderHandler handler) {
+ return uploader.addOnFinishUploadHandler(handler);
+ }
+
+ @Override
+ public HandlerRegistration addOnStartUploadHandler(final OnStartUploaderHandler handler) {
+ return uploader.addOnStartUploadHandler(handler);
+ }
+
+ @Override
public void clearBackImage() {
setBackImageVisibleImpl(false);
}
@@ -121,8 +152,14 @@
}
@Override
- public void setBackImage(final StateToken token) {
- backImage.setUrl(downUtils.getImageResizedUrl(token, ImageSize.thumb));
+ public void reset() {
+ uploader.reset();
+ }
+
+ @Override
+ public void setBackImage(final String url) {
+ // backImage.setUrl(downUtils.getImageResizedUrl(token, ImageSize.thumb));
+ backImage.setUrl(url);
setBackImageVisibleImpl(true);
}
@@ -132,4 +169,9 @@
clearBtn.setVisible(visible);
noBackLabel.setVisible(!visible);
}
+
+ @Override
+ public void setUploadParams(final String userHash, final String token) {
+ uploader.setUploadParams(userHash, token);
+ }
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfPresenter.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfPresenter.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -19,15 +19,24 @@
*/
package cc.kune.gspace.client.options.style;
+import gwtupload.client.IUploadStatus.Status;
+import gwtupload.client.IUploader;
+import gwtupload.client.IUploader.OnFinishUploaderHandler;
+import gwtupload.client.IUploader.OnStartUploaderHandler;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.client.utils.TextUtils;
import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
import cc.kune.core.client.rpcservices.GroupServiceAsync;
+import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.services.ImageSize;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateChangedEvent;
import cc.kune.core.client.state.StateChangedEvent.StateChangedHandler;
import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.dto.ContentSimpleDTO;
+import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.GroupDTO;
import cc.kune.core.shared.dto.StateAbstractDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
import cc.kune.gspace.client.options.EntityOptions;
import cc.kune.gspace.client.style.ClearBackImageEvent;
import cc.kune.gspace.client.style.GSpaceBackManager;
@@ -44,7 +53,9 @@
private final GSpaceBackManager backManager;
private final EntityOptions entityOptions;
private final EventBus eventBus;
+ private final FileDownloadUtils fileDownloadUtils;
private final Provider<GroupServiceAsync> groupService;
+ private final I18nTranslationService i18n;
private final Session session;
private final StateManager stateManager;
private EntityOptionsStyleConfView view;
@@ -52,22 +63,26 @@
protected EntityOptionsStyleConfPresenter(final EventBus eventBus, final Session session,
final StateManager stateManager, final EntityOptions entityOptions,
final Provider<GroupServiceAsync> groupService, final GSpaceBackManager backManager,
- final GSpaceThemeSelectorPresenter styleSelector) {
+ final GSpaceThemeSelectorPresenter styleSelector, final I18nTranslationService i18n,
+ final FileDownloadUtils fileDownloadUtils) {
this.eventBus = eventBus;
this.session = session;
this.stateManager = stateManager;
this.entityOptions = entityOptions;
this.groupService = groupService;
this.backManager = backManager;
+ this.i18n = i18n;
+ this.fileDownloadUtils = fileDownloadUtils;
}
- public void clearBackImage() {
+ private void clearBackImage() {
groupService.get().clearGroupBackImage(session.getUserHash(), session.getCurrentStateToken(),
new AsyncCallbackSimple<GroupDTO>() {
@Override
public void onSuccess(final GroupDTO result) {
view.clearBackImage();
backManager.clearBackImage();
+ ClearBackImageEvent.fire(eventBus);
}
});
}
@@ -79,7 +94,7 @@
public void init(final EntityOptionsStyleConfView view) {
this.view = view;
entityOptions.addTab(view, view.getTabTitle());
- setBackImage(session.getCurrentState().getGroup().getGroupBackImage());
+ setState();
view.getClearBtn().addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
@@ -89,15 +104,15 @@
stateManager.onStateChanged(true, new StateChangedHandler() {
@Override
public void onStateChanged(final StateChangedEvent event) {
- final StateAbstractDTO state = event.getState();
- final ContentSimpleDTO backImage = state.getGroup().getGroupBackImage();
- setBackImage(backImage);
+ setState();
}
});
eventBus.addHandler(SetBackImageEvent.getType(), new SetBackImageEvent.SetBackImageHandler() {
@Override
public void onSetBackImage(final SetBackImageEvent event) {
- view.setBackImage(event.getToken());
+ final StateToken token = event.getToken();
+ backManager.setBackImage(token);
+ setBackImage(event.getToken());
}
});
eventBus.addHandler(ClearBackImageEvent.getType(), new ClearBackImageEvent.ClearBackImageHandler() {
@@ -106,13 +121,49 @@
view.clearBackImage();
}
});
+ view.addOnStartUploadHandler(new OnStartUploaderHandler() {
+ @Override
+ public void onStart(final IUploader uploader) {
+ setState();
+ }
+ });
+ view.addOnFinishUploadHandler(new OnFinishUploaderHandler() {
+ @Override
+ public void onFinish(final IUploader uploader) {
+ onSubmitComplete(uploader);
+ }
+ });
}
- private void setBackImage(final ContentSimpleDTO backImage) {
- if (backImage == null) {
+ private void onSubmitComplete(final IUploader uploader) {
+ final String response = uploader.getServerInfo().message;
+ if (uploader.getStatus() == Status.SUCCESS) {
+ if (!TextUtils.empty(response)) {
+ NotifyUser.info(response);
+ }
+ SetBackImageEvent.fire(eventBus, session.getCurrentState().getGroup().getStateToken());
+ } else {
+ onSubmitFailed(response);
+ }
+ }
+
+ private void onSubmitFailed(final String responseText) {
+ NotifyUser.error(i18n.t("Error setting the background"), responseText);
+ }
+
+ private void setBackImage(final StateToken token) {
+ view.setBackImage(fileDownloadUtils.getBackgroundResizedUrl(token, ImageSize.thumb));
+ }
+
+ private void setState() {
+ final StateAbstractDTO state = session.getCurrentState();
+ final GroupDTO group = state.getGroup();
+ if (group.getBackgroundImage() == null) {
view.clearBackImage();
} else {
- view.setBackImage(backImage.getStateToken());
+ setBackImage(group.getStateToken());
}
+ view.setUploadParams(session.getUserHash(), session.getCurrentStateToken().toString());
}
+
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfView.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptionsStyleConfView.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -19,17 +19,31 @@
*/
package cc.kune.gspace.client.options.style;
-import cc.kune.core.shared.domain.utils.StateToken;
+import gwtupload.client.IUploader;
+import gwtupload.client.IUploader.OnCancelUploaderHandler;
import cc.kune.gspace.client.options.EntityOptionsTabView;
import com.google.gwt.event.dom.client.HasClickHandlers;
+import com.google.gwt.event.shared.HandlerRegistration;
public interface EntityOptionsStyleConfView extends EntityOptionsTabView {
- public void clearBackImage();
+ HandlerRegistration addOnCancelUploadHandler(OnCancelUploaderHandler handler);
- HasClickHandlers getClearBtn();
+ HandlerRegistration addOnChangeUploadHandler(IUploader.OnChangeUploaderHandler handler);
- public void setBackImage(final StateToken token);
+ HandlerRegistration addOnFinishUploadHandler(IUploader.OnFinishUploaderHandler handler);
+ HandlerRegistration addOnStartUploadHandler(IUploader.OnStartUploaderHandler handler);
+
+ public void clearBackImage();
+
+ HasClickHandlers getClearBtn();
+
+ void reset();
+
+ public void setBackImage(final String url);
+
+ void setUploadParams(String userHash, String token);
+
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfPanel.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfPanel.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -20,7 +20,6 @@
package cc.kune.gspace.client.options.style;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.client.services.FileDownloadUtils;
import cc.kune.core.shared.i18n.I18nTranslationService;
import cc.kune.gspace.client.themes.GSpaceThemeSelectorPanel;
@@ -30,10 +29,9 @@
GroupOptionsStyleConfView {
@Inject
- public GroupOptionsStyleConfPanel(final I18nTranslationService i18n,
- final FileDownloadUtils downUtils, final CoreResources res,
+ public GroupOptionsStyleConfPanel(final I18nTranslationService i18n, final CoreResources res,
final GSpaceThemeSelectorPanel styleSelector) {
- super(i18n, downUtils, res, styleSelector);
+ super(i18n, res, styleSelector);
}
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfPresenter.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptionsStyleConfPresenter.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -20,10 +20,10 @@
package cc.kune.gspace.client.options.style;
import cc.kune.core.client.rpcservices.GroupServiceAsync;
+import cc.kune.core.client.services.FileDownloadUtils;
import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateChangedEvent;
-import cc.kune.core.client.state.StateChangedEvent.StateChangedHandler;
import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.i18n.I18nTranslationService;
import cc.kune.gspace.client.options.GroupOptions;
import cc.kune.gspace.client.style.GSpaceBackManager;
import cc.kune.gspace.client.themes.GSpaceThemeSelectorPresenter;
@@ -39,17 +39,11 @@
public GroupOptionsStyleConfPresenter(final EventBus eventBus, final Session session,
final StateManager stateManager, final GroupOptions entityOptions,
final Provider<GroupServiceAsync> groupService, final GSpaceBackManager backManager,
- final GroupOptionsStyleConfView view, final GSpaceThemeSelectorPresenter styleSelector) {
- super(eventBus, session, stateManager, entityOptions, groupService, backManager, styleSelector);
+ final GroupOptionsStyleConfView view, final GSpaceThemeSelectorPresenter styleSelector,
+ final I18nTranslationService i18n, final FileDownloadUtils fileDownUtils) {
+ super(eventBus, session, stateManager, entityOptions, groupService, backManager, styleSelector,
+ i18n, fileDownUtils);
init(view);
- stateManager.onStateChanged(true, new StateChangedHandler() {
-
- @Override
- public void onStateChanged(final StateChangedEvent event) {
- // final String theme = state.getGroup().getWorkspaceTheme();
- // themeSelector.select(theme);
- }
- });
}
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfPanel.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfPanel.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -20,7 +20,6 @@
package cc.kune.gspace.client.options.style;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.client.services.FileDownloadUtils;
import cc.kune.core.shared.i18n.I18nTranslationService;
import cc.kune.gspace.client.themes.GSpaceThemeSelectorPanel;
@@ -30,9 +29,9 @@
UserOptionsStyleConfView {
@Inject
- public UserOptionsStyleConfPanel(final I18nTranslationService i18n, final FileDownloadUtils downUtils,
- final CoreResources res, final GSpaceThemeSelectorPanel styleSelector) {
- super(i18n, downUtils, res, styleSelector);
+ public UserOptionsStyleConfPanel(final I18nTranslationService i18n, final CoreResources res,
+ final GSpaceThemeSelectorPanel styleSelector) {
+ super(i18n, res, styleSelector);
}
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfPresenter.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptionsStyleConfPresenter.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -20,11 +20,10 @@
package cc.kune.gspace.client.options.style;
import cc.kune.core.client.rpcservices.GroupServiceAsync;
+import cc.kune.core.client.services.FileDownloadUtils;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
-import cc.kune.core.client.state.UserSignInEvent;
-import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
-import cc.kune.core.shared.dto.UserInfoDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
import cc.kune.gspace.client.options.UserOptions;
import cc.kune.gspace.client.style.GSpaceBackManager;
import cc.kune.gspace.client.themes.GSpaceThemeSelectorPresenter;
@@ -42,30 +41,10 @@
public UserOptionsStyleConfPresenter(final EventBus eventBus, final Session session,
final StateManager stateManager, final UserOptions entityOptions,
final Provider<GroupServiceAsync> groupService, final GSpaceBackManager backManager,
- final UserOptionsStyleConfView view, final GSpaceThemeSelectorPresenter styleSelector) {
- super(eventBus, session, stateManager, entityOptions, groupService, backManager, styleSelector);
- // this.themeSelector = themeSelector;
- // themeSelector.addThemeSelected(new Listener<WsTheme>() {
- // public void onEvent(final WsTheme theme) {
- // themeManager.changeTheme(session.getCurrentUser().getStateToken(),
- // theme);
- // }
- // });
- final UserInfoDTO userInfo = session.getCurrentUserInfo();
- if (userInfo != null) {
- setSelector(userInfo);
- }
+ final UserOptionsStyleConfView view, final GSpaceThemeSelectorPresenter styleSelector,
+ final I18nTranslationService i18n, final FileDownloadUtils fileDownUtils) {
+ super(eventBus, session, stateManager, entityOptions, groupService, backManager, styleSelector,
+ i18n, fileDownUtils);
init(view);
- session.onUserSignIn(true, new UserSignInHandler() {
- @Override
- public void onUserSignIn(final UserSignInEvent event) {
- // setSelector(userInfo);
- }
- });
}
-
- private void setSelector(final UserInfoDTO userInfo) {
- // themeSelector.select(userInfo.getUserGroup().getWorkspaceTheme());
- }
-
}
Modified: trunk/src/main/java/cc/kune/gspace/client/resources/gSpaceArmor.css
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/resources/gSpaceArmor.css 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/gspace/client/resources/gSpaceArmor.css 2011-06-21 20:03:39 UTC (rev 1412)
@@ -7,17 +7,31 @@
.mainPanel {
border-top: 2px solid white;
- border-bottom: 7px solid white;
- border-right: 7px solid white;
- border-left: 7px solid white;
+/* border-bottom: 7px solid transparent;
+ border-right: 17px solid transparent;
+ border-left: 17px solid transparent; */
}
+.k-spaces {
+ margin: 5px 17px 7px 17px;
+ border-collapse: separate;
+}
+
+.k-space {
+}
+
.floatRight {
float: right;
}
.siteBar {
overflow: hidden;
+ background-color: #fff !important;
+ padding: 0px 5px;
+ /*kfilter: alpha(opacity = 38) !important;
+ -moz-opacity: 0.38 !important;
+ -khtml-opacity: 0.38 !important;
+ opacity: 0.38 !important; */
}
.entityHeader {
Modified: trunk/src/main/java/cc/kune/gspace/client/style/GSpaceBackManager.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/style/GSpaceBackManager.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/gspace/client/style/GSpaceBackManager.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -23,8 +23,9 @@
public interface GSpaceBackManager {
- void clearBackImage();
+ void clearBackImage();
- void setBackImage(StateToken token);
+ void restoreBackImage();
+ void setBackImage(StateToken token);
}
Modified: trunk/src/main/java/cc/kune/gspace/client/style/GSpaceBackManagerImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/style/GSpaceBackManagerImpl.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/gspace/client/style/GSpaceBackManagerImpl.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -19,46 +19,50 @@
*/
package cc.kune.gspace.client.style;
-import org.cobogw.gwt.user.client.CSS;
+import javax.annotation.Nonnull;
import cc.kune.core.client.services.FileDownloadUtils;
import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.gspace.client.GSpaceArmor;
-import com.google.gwt.event.shared.EventBus;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.ui.RootPanel;
import com.google.inject.Inject;
public class GSpaceBackManagerImpl implements GSpaceBackManager {
- private static final StateToken NO_TOKEN = new StateToken("none.none.0.0");
- private final FileDownloadUtils downloadUtils;
- private final EventBus eventBus;
- private StateToken lastToken;
+ private static final StateToken NO_TOKEN = new StateToken("none.none.0.0");
+ private final FileDownloadUtils downloadUtils;
+ private final GSpaceArmor gSpaceArmor;
+ private StateToken lastToken;
- @Inject
- public GSpaceBackManagerImpl(final EventBus eventBus, final FileDownloadUtils downloadUtils) {
- this.eventBus = eventBus;
- this.downloadUtils = downloadUtils;
- lastToken = NO_TOKEN;
+ @Inject
+ public GSpaceBackManagerImpl(final FileDownloadUtils downloadUtils, final GSpaceArmor gSpaceArmor) {
+ this.downloadUtils = downloadUtils;
+ this.gSpaceArmor = gSpaceArmor;
+ lastToken = NO_TOKEN;
+ }
+
+ @Override
+ public void clearBackImage() {
+ if (!lastToken.equals(NO_TOKEN)) {
+ gSpaceArmor.clearBackImage();
+ lastToken = NO_TOKEN;
}
+ }
- @Override
- public void clearBackImage() {
- if (!lastToken.equals(NO_TOKEN)) {
- DOM.setStyleAttribute(RootPanel.getBodyElement(), CSS.A.BACKGROUND, "transparent");
- lastToken = NO_TOKEN;
- }
- ClearBackImageEvent.fire(eventBus);
+ @Override
+ public void restoreBackImage() {
+ if (!lastToken.equals(NO_TOKEN)) {
+ gSpaceArmor.setBackImage(downloadUtils.getBackgroundImageUrl(lastToken));
}
+ }
- @Override
- public void setBackImage(final StateToken token) {
- if (!token.equals(lastToken)) {
- final String bodyProp = "#FFFFFF url('" + downloadUtils.getImageUrl(token) + "') fixed no-repeat top left";
- DOM.setStyleAttribute(RootPanel.getBodyElement(), CSS.A.BACKGROUND, bodyProp);
- lastToken = token;
- }
- SetBackImageEvent.fire(eventBus, token);
+ @Override
+ public void setBackImage(final @Nonnull StateToken token) {
+ final StateToken tokenNoGroup = token.clearDocument().clearDocument();
+ if (!tokenNoGroup.equals(lastToken)) {
+ gSpaceArmor.setBackImage(downloadUtils.getBackgroundImageUrl(tokenNoGroup));
+ lastToken = tokenNoGroup;
}
+
+ }
}
Modified: trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeManager.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeManager.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeManager.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -27,13 +27,13 @@
import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
import cc.kune.core.client.rpcservices.GroupServiceAsync;
+import cc.kune.core.client.state.GroupChangedEvent;
+import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateChangedEvent;
-import cc.kune.core.client.state.StateChangedEvent.StateChangedHandler;
import cc.kune.core.client.state.StateManager;
import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.ContentSimpleDTO;
import cc.kune.core.shared.dto.GSpaceTheme;
+import cc.kune.core.shared.dto.GroupDTO;
import cc.kune.core.shared.dto.InitDataDTO;
import cc.kune.core.shared.dto.StateAbstractDTO;
import cc.kune.gspace.client.resources.GSpaceArmorResources;
@@ -69,10 +69,10 @@
public void onAppStart(final AppStartEvent event) {
final InitDataDTO initdata = session.getInitData();
themes = initdata.getgSpaceThemes();
- stateManager.onStateChanged(true, new StateChangedHandler() {
+ stateManager.onGroupChanged(true, new GroupChangedHandler() {
@Override
- public void onStateChanged(final StateChangedEvent event) {
- setState(event.getState());
+ public void onGroupChanged(final GroupChangedEvent event) {
+ setState(session.getCurrentState());
}
});
}
@@ -117,11 +117,12 @@
private void setState(final StateAbstractDTO state) {
setTheme(themes.get(state.getGroup().getWorkspaceTheme()));
- final ContentSimpleDTO groupBackImage = state.getGroup().getGroupBackImage();
+ final GroupDTO group = state.getGroup();
+ final String groupBackImage = group.getBackgroundImage();
if (groupBackImage == null) {
wsBackManager.clearBackImage();
} else {
- wsBackManager.setBackImage(groupBackImage.getStateToken());
+ wsBackManager.setBackImage(state.getGroup().getStateToken());
}
}
Modified: trunk/src/main/java/cc/kune/pspace/client/PSpaceInDevelopment.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/pspace/client/PSpaceInDevelopment.ui.xml 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/cc/kune/pspace/client/PSpaceInDevelopment.ui.xml 2011-06-21 20:03:39 UTC (rev 1412)
@@ -5,7 +5,7 @@
.container {
margin: 10px;
font-family: 'Ubuntu', Arial;
- background-color: white;
+ background-color: transparent;
}
.entityLogo {
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -46,68 +46,71 @@
import com.calclab.suco.client.ioc.Provider;
public class GalleryClientActions extends OldAbstractFoldableContentActions {
- public GalleryClientActions(final I18nUITranslationService i18n, final ContextNavigator contextNavigator,
- final Session session, final StateManager stateManager, final SchedulerManager deferredCommandWrapper,
- final Provider<ContentServiceAsync> contentServiceProvider,
- final Provider<GroupServiceAsync> groupServiceProvider, final Provider<FileUploader> fileUploaderProvider,
- final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
- final Provider<FileDownloadUtils> fileDownloadProvider, final EntityHeader entityLogo,
- final Provider<ContentEditor> textEditorProvider, final ErrorHandler errorHandler,
- final GalleryViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider,
- final GSpaceBackManager wsBackManager) {
- super(session, stateManager, i18n, errorHandler, deferredCommandWrapper, groupServiceProvider,
- contentServiceProvider, fileUploaderProvider, contextNavigator, contentActionRegistry,
- contextActionRegistry, fileDownloadProvider, textEditorProvider, contextProvEditorProvider,
- documentViewer, entityLogo, wsBackManager);
- }
+ public GalleryClientActions(final I18nUITranslationService i18n,
+ final ContextNavigator contextNavigator, final Session session, final StateManager stateManager,
+ final SchedulerManager deferredCommandWrapper,
+ final Provider<ContentServiceAsync> contentServiceProvider,
+ final Provider<GroupServiceAsync> groupServiceProvider,
+ final Provider<FileUploader> fileUploaderProvider,
+ final ContentActionRegistry contentActionRegistry,
+ final ContextActionRegistry contextActionRegistry,
+ final Provider<FileDownloadUtils> fileDownloadProvider, final EntityHeader entityLogo,
+ final Provider<ContentEditor> textEditorProvider, final ErrorHandler errorHandler,
+ final GalleryViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider,
+ final GSpaceBackManager wsBackManager) {
+ super(session, stateManager, i18n, errorHandler, deferredCommandWrapper, groupServiceProvider,
+ contentServiceProvider, fileUploaderProvider, contextNavigator, contentActionRegistry,
+ contextActionRegistry, fileDownloadProvider, textEditorProvider, contextProvEditorProvider,
+ documentViewer, entityLogo, wsBackManager);
+ }
- @Override
- protected void createActions() {
- final String[] all = { TYPE_ROOT, TYPE_ALBUM, TYPE_UPLOADEDFILE };
- final String[] containers = { TYPE_ROOT, TYPE_ALBUM };
- final String[] contentsModerated = { TYPE_UPLOADEDFILE };
- final String[] containersNoRoot = { TYPE_ALBUM };
- final String[] contents = { TYPE_UPLOADEDFILE };
+ @Override
+ protected void createActions() {
+ final String[] all = { TYPE_ROOT, TYPE_ALBUM, TYPE_UPLOADEDFILE };
+ final String[] containers = { TYPE_ROOT, TYPE_ALBUM };
+ final String[] contentsModerated = { TYPE_UPLOADEDFILE };
+ final String[] containersNoRoot = { TYPE_ALBUM };
+ final String[] contents = { TYPE_UPLOADEDFILE };
- final String parentMenuTitle = i18n.t("File");
- final String parentMenuTitleCtx = i18n.t("Album");
+ final String parentMenuTitle = i18n.t("File");
+ final String parentMenuTitleCtx = i18n.t("Album");
- createNewContainerAction(TYPE_ALBUM, "images/nav/gallery_add.png", i18n.t("New sub-album"), parentMenuTitleCtx,
- i18n.t("New"), i18n.t("New sub-album"), Position.ctx, TYPE_ALBUM);
- createNewContainerAction(TYPE_ALBUM, "images/nav/gallery_add.png", i18n.t("New album"), parentMenuTitleCtx,
- i18n.t("New"), i18n.t("New album"), Position.ctx, TYPE_ROOT);
+ createNewContainerAction(TYPE_ALBUM, "images/nav/gallery_add.png", i18n.t("New sub-album"),
+ parentMenuTitleCtx, i18n.t("New"), i18n.t("New sub-album"), Position.ctx, TYPE_ALBUM);
+ createNewContainerAction(TYPE_ALBUM, "images/nav/gallery_add.png", i18n.t("New album"),
+ parentMenuTitleCtx, i18n.t("New"), i18n.t("New album"), Position.ctx, TYPE_ROOT);
- createContentRenameAction(parentMenuTitle, i18n.t("Rename"), contents);
- createContentModeratedActions(parentMenuTitle, contentsModerated);
- createRenameContentInCtxAction(parentMenuTitleCtx, i18n.t("Rename"), containersNoRoot);
+ createContentRenameAction(parentMenuTitle, i18n.t("Rename"), contents);
+ createContentModeratedActions(parentMenuTitle, contentsModerated);
+ createRenameContentInCtxAction(parentMenuTitleCtx, i18n.t("Rename"), containersNoRoot);
- // final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupCxt =
- // createSetAsDefContent(parentMenuTitleCtx);
+ // final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupCxt =
+ // createSetAsDefContent(parentMenuTitleCtx);
- createRefreshCntAction(parentMenuTitle, contents);
- createRefreshCxtAction(parentMenuTitleCtx, containers);
+ createRefreshCntAction(parentMenuTitle, contents);
+ createRefreshCxtAction(parentMenuTitleCtx, containers);
- createSetAsDefContent(parentMenuTitle, contents);
- createSetGroupBackImageAction(parentMenuTitle, TYPE_UPLOADEDFILE);
+ createSetAsDefContent(parentMenuTitle, contents);
+ // createSetGroupBackImageAction(parentMenuTitle, TYPE_UPLOADEDFILE);
- // createUploadAction(i18n.t("Upload file"), "images/nav/upload.png",
- // i18n.t("Upload some files (images, PDFs, ...)"), null, containers);
+ // createUploadAction(i18n.t("Upload file"), "images/nav/upload.png",
+ // i18n.t("Upload some files (images, PDFs, ...)"), null, containers);
- createDownloadActions(TYPE_UPLOADEDFILE);
+ createDownloadActions(TYPE_UPLOADEDFILE);
- createGoAction(all);
+ createGoAction(all);
- createGoHomeAction(containers);
+ createGoHomeAction(containers);
- // createTranslateAction(TYPE_ALBUM, TYPE_UPLOADEDFILE);
+ // createTranslateAction(TYPE_ALBUM, TYPE_UPLOADEDFILE);
- createDelContainerAction("Delete folder", parentMenuTitleCtx, containersNoRoot);
- createDelContentAction(parentMenuTitle, i18n.t("Delete"), contents);
- createShowDeletedItems(parentMenuTitleCtx, all);
- }
+ createDelContainerAction("Delete folder", parentMenuTitleCtx, containersNoRoot);
+ createDelContentAction(parentMenuTitle, i18n.t("Delete"), contents);
+ createShowDeletedItems(parentMenuTitleCtx, all);
+ }
- @Override
- protected void createPostSessionInitActions() {
- super.createUploadMediaAction(TYPE_ALBUM);
- }
+ @Override
+ protected void createPostSessionInitActions() {
+ super.createUploadMediaAction(TYPE_ALBUM);
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -47,69 +47,72 @@
import com.calclab.suco.client.ioc.Provider;
public class WikiClientActions extends OldAbstractFoldableContentActions {
- public WikiClientActions(final I18nUITranslationService i18n, final ContextNavigator contextNavigator,
- final Session session, final StateManager stateManager, final SchedulerManager deferredCommandWrapper,
- final Provider<ContentServiceAsync> contentServiceProvider,
- final Provider<GroupServiceAsync> groupServiceProvider, final Provider<FileUploader> fileUploaderProvider,
- final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
- final Provider<FileDownloadUtils> fileDownloadProvider, final EntityHeader entityLogo,
- final Provider<ContentEditor> textEditorProvider, final ErrorHandler errorHandler,
- final WikiViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider,
- final GSpaceBackManager wsBackManager) {
- super(session, stateManager, i18n, errorHandler, deferredCommandWrapper, groupServiceProvider,
- contentServiceProvider, fileUploaderProvider, contextNavigator, contentActionRegistry,
- contextActionRegistry, fileDownloadProvider, textEditorProvider, contextProvEditorProvider,
- documentViewer, entityLogo, wsBackManager);
- }
+ public WikiClientActions(final I18nUITranslationService i18n, final ContextNavigator contextNavigator,
+ final Session session, final StateManager stateManager,
+ final SchedulerManager deferredCommandWrapper,
+ final Provider<ContentServiceAsync> contentServiceProvider,
+ final Provider<GroupServiceAsync> groupServiceProvider,
+ final Provider<FileUploader> fileUploaderProvider,
+ final ContentActionRegistry contentActionRegistry,
+ final ContextActionRegistry contextActionRegistry,
+ final Provider<FileDownloadUtils> fileDownloadProvider, final EntityHeader entityLogo,
+ final Provider<ContentEditor> textEditorProvider, final ErrorHandler errorHandler,
+ final WikiViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider,
+ final GSpaceBackManager wsBackManager) {
+ super(session, stateManager, i18n, errorHandler, deferredCommandWrapper, groupServiceProvider,
+ contentServiceProvider, fileUploaderProvider, contextNavigator, contentActionRegistry,
+ contextActionRegistry, fileDownloadProvider, textEditorProvider, contextProvEditorProvider,
+ documentViewer, entityLogo, wsBackManager);
+ }
- @Override
- protected void createActions() {
- final String[] all = { TYPE_ROOT, TYPE_FOLDER, TYPE_WIKIPAGE, TYPE_UPLOADEDFILE };
- final String[] containers = { TYPE_ROOT, TYPE_FOLDER };
- // final String[] contentsModerated = { };
- final String[] containersNoRoot = { TYPE_FOLDER };
- final String[] contents = { TYPE_WIKIPAGE, TYPE_UPLOADEDFILE };
+ @Override
+ protected void createActions() {
+ final String[] all = { TYPE_ROOT, TYPE_FOLDER, TYPE_WIKIPAGE, TYPE_UPLOADEDFILE };
+ final String[] containers = { TYPE_ROOT, TYPE_FOLDER };
+ // final String[] contentsModerated = { };
+ final String[] containersNoRoot = { TYPE_FOLDER };
+ final String[] contents = { TYPE_WIKIPAGE, TYPE_UPLOADEDFILE };
- final String parentMenuTitle = i18n.t("Wikipage");
- final String parentMenuTitleCtx = i18n.t("Wiki");
+ final String parentMenuTitle = i18n.t("Wikipage");
+ final String parentMenuTitleCtx = i18n.t("Wiki");
- createNewContainerAction(TYPE_FOLDER, "images/nav/folder_add.png", i18n.t("New folder"), parentMenuTitleCtx,
- i18n.t("New"), i18n.t("New folder"), Position.ctx, TYPE_ROOT, TYPE_FOLDER);
+ createNewContainerAction(TYPE_FOLDER, "images/nav/folder_add.png", i18n.t("New folder"),
+ parentMenuTitleCtx, i18n.t("New"), i18n.t("New folder"), Position.ctx, TYPE_ROOT, TYPE_FOLDER);
- createNewContentAction(TYPE_WIKIPAGE, "images/nav/wikipage_add.png", i18n.t("New wikipage"),
- parentMenuTitleCtx, Position.ctx, TYPE_ROOT, TYPE_FOLDER);
+ createNewContentAction(TYPE_WIKIPAGE, "images/nav/wikipage_add.png", i18n.t("New wikipage"),
+ parentMenuTitleCtx, Position.ctx, TYPE_ROOT, TYPE_FOLDER);
- // createContentModeratedActions(parentMenuTitle, contentsModerated);
- createTranslateAction(parentMenuTitle, TYPE_FOLDER, TYPE_WIKIPAGE);
- createContentRenameAction(parentMenuTitle, i18n.t("Rename"), contents);
- createRenameContentInCtxAction(parentMenuTitleCtx, i18n.t("Rename"), containersNoRoot);
- createEditAction(parentMenuTitle, TYPE_WIKIPAGE);
+ // createContentModeratedActions(parentMenuTitle, contentsModerated);
+ createTranslateAction(parentMenuTitle, TYPE_FOLDER, TYPE_WIKIPAGE);
+ createContentRenameAction(parentMenuTitle, i18n.t("Rename"), contents);
+ createRenameContentInCtxAction(parentMenuTitleCtx, i18n.t("Rename"), containersNoRoot);
+ createEditAction(parentMenuTitle, TYPE_WIKIPAGE);
- // final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupCxt =
- // createSetAsDefContent(parentMenuTitleCtx);
+ // final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupCxt =
+ // createSetAsDefContent(parentMenuTitleCtx);
- createRefreshCntAction(parentMenuTitle, contents);
- createRefreshCxtAction(parentMenuTitleCtx, containers);
+ createRefreshCntAction(parentMenuTitle, contents);
+ createRefreshCxtAction(parentMenuTitleCtx, containers);
- createSetAsDefContent(parentMenuTitle, contents);
- createSetGroupBackImageAction(parentMenuTitle, TYPE_UPLOADEDFILE);
+ createSetAsDefContent(parentMenuTitle, contents);
+ // createSetGroupBackImageAction(parentMenuTitle, TYPE_UPLOADEDFILE);
- createUploadAction(i18n.t("Upload file"), "images/nav/upload.png",
- i18n.t("Upload some files (images, PDFs, ...)"), null, containers);
+ createUploadAction(i18n.t("Upload file"), "images/nav/upload.png",
+ i18n.t("Upload some files (images, PDFs, ...)"), null, containers);
- createDownloadActions(TYPE_UPLOADEDFILE);
+ createDownloadActions(TYPE_UPLOADEDFILE);
- createGoAction(all);
+ createGoAction(all);
- createGoHomeAction(containers);
+ createGoHomeAction(containers);
- createDelContainerAction("Delete folder", parentMenuTitleCtx, containersNoRoot);
- createDelContentAction(parentMenuTitle, i18n.t("Delete"), contents);
- createShowDeletedItems(parentMenuTitleCtx, all);
- }
+ createDelContainerAction("Delete folder", parentMenuTitleCtx, containersNoRoot);
+ createDelContentAction(parentMenuTitle, i18n.t("Delete"), contents);
+ createShowDeletedItems(parentMenuTitleCtx, all);
+ }
- @Override
- protected void createPostSessionInitActions() {
- // super.createUploadMediaAction();
- }
+ @Override
+ protected void createPostSessionInitActions() {
+ // super.createUploadMediaAction();
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/OldAbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/OldAbstractFoldableContentActions.java 2011-06-18 21:57:55 UTC (rev 1411)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/OldAbstractFoldableContentActions.java 2011-06-21 20:03:39 UTC (rev 1412)
@@ -55,7 +55,6 @@
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.core.shared.dto.ContentSimpleDTO;
-import cc.kune.core.shared.dto.GroupDTO;
import cc.kune.core.shared.dto.InitDataDTO;
import cc.kune.core.shared.dto.StateAbstractDTO;
import cc.kune.core.shared.dto.StateContainerDTO;
@@ -70,603 +69,616 @@
public abstract class OldAbstractFoldableContentActions {
- protected enum Position {
- cnt, ctx
- }
+ protected enum Position {
+ cnt, ctx
+ }
- public static final ActionToolbarPosition CONTENT_BOTTOMBAR = new ActionToolbarPosition("afca-ctn-bottom");
+ public static final ActionToolbarPosition CONTENT_BOTTOMBAR = new ActionToolbarPosition(
+ "afca-ctn-bottom");
- public static final ActionToolbarPosition CONTENT_TOPBAR = new ActionToolbarPosition("afca-ctn-top");
- public static final ActionToolbarPosition CONTEXT_BOTTOMBAR = new ActionToolbarPosition("afca-ctx-bottom");
- public static final ActionToolbarPosition CONTEXT_TOPBAR = new ActionToolbarPosition("afca-ctx-top");
- private static final String PUBLICATION_MENU = "Publication";
+ public static final ActionToolbarPosition CONTENT_TOPBAR = new ActionToolbarPosition("afca-ctn-top");
+ public static final ActionToolbarPosition CONTEXT_BOTTOMBAR = new ActionToolbarPosition(
+ "afca-ctx-bottom");
+ public static final ActionToolbarPosition CONTEXT_TOPBAR = new ActionToolbarPosition("afca-ctx-top");
+ private static final String PUBLICATION_MENU = "Publication";
- protected final ContentActionRegistry contentActionRegistry;
- protected final Provider<ContentServiceAsync> contentServiceProvider;
- protected final ContextActionRegistry contextActionRegistry;
- protected final ContextNavigator contextNavigator;
- protected final Provider<ContextPropEditor> contextPropEditorProvider;
- protected final SchedulerManager deferredCommandWrapper;
- protected final EntityHeader entityLogo;
- protected final ErrorHandler errorHandler;
- protected final Provider<FileDownloadUtils> fileDownloadProvider;
- protected final Provider<FileUploader> fileUploaderProvider;
- protected final FoldableContent foldableContent;
- protected final Provider<GroupServiceAsync> groupServiceProvider;
- protected final I18nUITranslationService i18n;
+ protected final ContentActionRegistry contentActionRegistry;
+ protected final Provider<ContentServiceAsync> contentServiceProvider;
+ protected final ContextActionRegistry contextActionRegistry;
+ protected final ContextNavigator contextNavigator;
+ protected final Provider<ContextPropEditor> contextPropEditorProvider;
+ protected final SchedulerManager deferredCommandWrapper;
+ protected final EntityHeader entityLogo;
+ protected final ErrorHandler errorHandler;
+ protected final Provider<FileDownloadUtils> fileDownloadProvider;
+ protected final Provider<FileUploader> fileUploaderProvider;
+ protected final FoldableContent foldableContent;
+ protected final Provider<GroupServiceAsync> groupServiceProvider;
+ protected final I18nUITranslationService i18n;
- protected final Session session;
- protected final StateManager stateManager;
- protected final Provider<ContentEditor> textEditorProvider;
+ protected final Session session;
+ protected final StateManager stateManager;
+ protected final Provider<ContentEditor> textEditorProvider;
- private final GSpaceBackManager wsBackManager;
+ private final GSpaceBackManager wsBackManager;
- public OldAbstractFoldableContentActions(final Session session, final StateManager stateManager,
- final I18nUITranslationService i18n, final ErrorHandler errorHandler,
- final SchedulerManager deferredCommandWrapper, final Provider<GroupServiceAsync> groupServiceProvider,
- final Provider<ContentServiceAsync> contentServiceProvider,
- final Provider<FileUploader> fileUploaderProvider, final ContextNavigator contextNavigator,
- final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
- final Provider<FileDownloadUtils> fileDownloadProvider, final Provider<ContentEditor> textEditorProvider,
- final Provider<ContextPropEditor> contextPropEditorProvider, final FoldableContent foldableContent,
- final EntityHeader entityLogo, final GSpaceBackManager wsBackManager) {
- this.session = session;
- this.stateManager = stateManager;
- this.i18n = i18n;
- this.errorHandler = errorHandler;
- this.deferredCommandWrapper = deferredCommandWrapper;
- this.groupServiceProvider = groupServiceProvider;
- this.contentServiceProvider = contentServiceProvider;
- this.fileUploaderProvider = fileUploaderProvider;
- this.contextNavigator = contextNavigator;
- this.contentActionRegistry = contentActionRegistry;
- this.contextActionRegistry = contextActionRegistry;
- this.fileDownloadProvider = fileDownloadProvider;
- this.textEditorProvider = textEditorProvider;
- this.contextPropEditorProvider = contextPropEditorProvider;
- this.foldableContent = foldableContent;
- this.entityLogo = entityLogo;
- this.wsBackManager = wsBackManager;
- createActions();
- session.onInitDataReceived(new Listener<InitDataDTO>() {
- @Override
- public void onEvent(final InitDataDTO parameter) {
- createPostSessionInitActions();
- }
- });
- }
+ public OldAbstractFoldableContentActions(final Session session, final StateManager stateManager,
+ final I18nUITranslationService i18n, final ErrorHandler errorHandler,
+ final SchedulerManager deferredCommandWrapper,
+ final Provider<GroupServiceAsync> groupServiceProvider,
+ final Provider<ContentServiceAsync> contentServiceProvider,
+ final Provider<FileUploader> fileUploaderProvider, final ContextNavigator contextNavigator,
+ final ContentActionRegistry contentActionRegistry,
+ final ContextActionRegistry contextActionRegistry,
+ final Provider<FileDownloadUtils> fileDownloadProvider,
+ final Provider<ContentEditor> textEditorProvider,
+ final Provider<ContextPropEditor> contextPropEditorProvider,
+ final FoldableContent foldableContent, final EntityHeader entityLogo,
+ final GSpaceBackManager wsBackManager) {
+ this.session = session;
+ this.stateManager = stateManager;
+ this.i18n = i18n;
+ this.errorHandler = errorHandler;
+ this.deferredCommandWrapper = deferredCommandWrapper;
+ this.groupServiceProvider = groupServiceProvider;
+ this.contentServiceProvider = contentServiceProvider;
+ this.fileUploaderProvider = fileUploaderProvider;
+ this.contextNavigator = contextNavigator;
+ this.contentActionRegistry = contentActionRegistry;
+ this.contextActionRegistry = contextActionRegistry;
+ this.fileDownloadProvider = fileDownloadProvider;
+ this.textEditorProvider = textEditorProvider;
+ this.contextPropEditorProvider = contextPropEditorProvider;
+ this.foldableContent = foldableContent;
+ this.entityLogo = entityLogo;
+ this.wsBackManager = wsBackManager;
+ createActions();
+ session.onInitDataReceived(new Listener<InitDataDTO>() {
+ @Override
+ public void onEvent(final InitDataDTO parameter) {
+ createPostSessionInitActions();
+ }
+ });
+ }
- protected abstract void createActions();
+ protected abstract void createActions();
- protected void createContentModeratedActions(final String parentMenuTitle, final String... contentsModerated) {
- createSetStatusAction(AccessRolDTO.Administrator, i18n.t("Published online"), ContentStatus.publishedOnline,
- contentsModerated);
- createSetStatusAction(AccessRolDTO.Editor, i18n.t("Editing in progress"), ContentStatus.editingInProgress,
- contentsModerated);
- createSetStatusAction(AccessRolDTO.Administrator, i18n.t("Rejected"), ContentStatus.rejected, contentsModerated);
- createSetStatusAction(AccessRolDTO.Editor, i18n.t("Submitted for publish"),
- ContentStatus.submittedForEvaluation, contentsModerated);
- createSetStatusAction(AccessRolDTO.Administrator, i18n.t("In the rubbish bin"), ContentStatus.inTheDustbin,
- contentsModerated);
- }
+ protected void createContentModeratedActions(final String parentMenuTitle,
+ final String... contentsModerated) {
+ createSetStatusAction(AccessRolDTO.Administrator, i18n.t("Published online"),
+ ContentStatus.publishedOnline, contentsModerated);
+ createSetStatusAction(AccessRolDTO.Editor, i18n.t("Editing in progress"),
+ ContentStatus.editingInProgress, contentsModerated);
+ createSetStatusAction(AccessRolDTO.Administrator, i18n.t("Rejected"), ContentStatus.rejected,
+ contentsModerated);
+ createSetStatusAction(AccessRolDTO.Editor, i18n.t("Submitted for publish"),
+ ContentStatus.submittedForEvaluation, contentsModerated);
+ createSetStatusAction(AccessRolDTO.Administrator, i18n.t("In the rubbish bin"),
+ ContentStatus.inTheDustbin, contentsModerated);
+ }
- protected void createContentRenameAction(final String parentMenuTitle, final String textDescription,
- final String... registerInTypes) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> renameCtn = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- contextNavigator.editItem(stateToken);
- }
- });
- renameCtn.setTextDescription(textDescription);
- renameCtn.setParentMenuTitle(parentMenuTitle);
- renameCtn.setEnableCondition(notDeleted());
+ protected void createContentRenameAction(final String parentMenuTitle, final String textDescription,
+ final String... registerInTypes) {
+ final ActionToolbarMenuAndItemDescriptor<StateToken> renameCtn = new ActionToolbarMenuAndItemDescriptor<StateToken>(
+ AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
+ @Override
+ public void onEvent(final StateToken stateToken) {
+ contextNavigator.editItem(stateToken);
+ }
+ });
+ renameCtn.setTextDescription(textDescription);
+ renameCtn.setParentMenuTitle(parentMenuTitle);
+ renameCtn.setEnableCondition(notDeleted());
- // contentActionRegistry.addAction(renameCtn, registerInTypes);
- }
+ // contentActionRegistry.addAction(renameCtn, registerInTypes);
+ }
- protected void createDelContainerAction(final String text, final String parentMenuTitle,
- final String... registerInTypes) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> delContainer = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- OldNotifyUser.info("Sorry, in development");
- }
- });
- delContainer.setParentMenuTitle(parentMenuTitle);
- delContainer.setTextDescription(i18n.t(text));
- delContainer.setMustBeConfirmed(true);
- delContainer.setConfirmationTitle(i18n.t("Please confirm"));
- delContainer.setConfirmationText(i18n.t("You will delete it with all its contents. Are you sure?"));
- contextActionRegistry.addAction(delContainer, registerInTypes);
- }
+ protected void createDelContainerAction(final String text, final String parentMenuTitle,
+ final String... registerInTypes) {
+ final ActionToolbarMenuAndItemDescriptor<StateToken> delContainer = new ActionToolbarMenuAndItemDescriptor<StateToken>(
+ AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
+ @Override
+ public void onEvent(final StateToken token) {
+ OldNotifyUser.info("Sorry, in development");
+ }
+ });
+ delContainer.setParentMenuTitle(parentMenuTitle);
+ delContainer.setTextDescription(i18n.t(text));
+ delContainer.setMustBeConfirmed(true);
+ delContainer.setConfirmationTitle(i18n.t("Please confirm"));
+ delContainer.setConfirmationText(i18n.t("You will delete it with all its contents. Are you sure?"));
+ contextActionRegistry.addAction(delContainer, registerInTypes);
+ }
- protected void createDelContentAction(final String parentMenuTitle, final String textDescription,
- final String... registerInTypes) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> delContent = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- contentServiceProvider.get().delContent(session.getUserHash(), token,
- new AsyncCallbackSimple<StateContentDTO>() {
- @Override
- public void onSuccess(final StateContentDTO state) {
- session.setCurrentState(state);
- final StateToken parent = token.copy().clearDocument();
- stateManager.gotoStateToken(parent);
- contextNavigator.clear();
- contextNavigator.refreshState();
- }
- });
- }
+ protected void createDelContentAction(final String parentMenuTitle, final String textDescription,
+ final String... registerInTypes) {
+ final ActionToolbarMenuAndItemDescriptor<StateToken> delContent = new ActionToolbarMenuAndItemDescriptor<StateToken>(
+ AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
+ @Override
+ public void onEvent(final StateToken token) {
+ contentServiceProvider.get().delContent(session.getUserHash(), token,
+ new AsyncCallbackSimple<StateContentDTO>() {
+ @Override
+ public void onSuccess(final StateContentDTO state) {
+ session.setCurrentState(state);
+ final StateToken parent = token.copy().clearDocument();
+ stateManager.gotoStateToken(parent);
+ contextNavigator.clear();
+ contextNavigator.refreshState();
+ }
});
- delContent.setParentMenuTitle(parentMenuTitle);
- delContent.setTextDescription(textDescription);
- delContent.setMustBeConfirmed(true);
- delContent.setConfirmationTitle(i18n.t("Please confirm"));
- delContent.setConfirmationText(i18n.t("Are you sure?"));
- delContent.setEnableCondition(notDefAndNotDeleted());
- // contentActionRegistry.addAction(delContent, registerInTypes);
- }
+ }
+ });
+ delContent.setParentMenuTitle(parentMenuTitle);
+ delContent.setTextDescription(textDescription);
+ delContent.setMustBeConfirmed(true);
+ delContent.setConfirmationTitle(i18n.t("Please confirm"));
+ delContent.setConfirmationText(i18n.t("Are you sure?"));
+ delContent.setEnableCondition(notDefAndNotDeleted());
+ // contentActionRegistry.addAction(delContent, registerInTypes);
+ }
- protected void createDownloadActions(final String typeUploadedfile) {
- final ActionToolbarButtonDescriptor<StateToken> download = new ActionToolbarButtonDescriptor<StateToken>(
- AccessRolDTO.Viewer, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- downloadContent(token);
- }
- });
- download.setMustBeAuthenticated(false);
- download.setTextDescription(i18n.t("Download"));
- download.setToolTip(i18n.t("Download this file"));
- download.setIconUrl("images/nav/download.png");
+ protected void createDownloadActions(final String typeUploadedfile) {
+ final ActionToolbarButtonDescriptor<StateToken> download = new ActionToolbarButtonDescriptor<StateToken>(
+ AccessRolDTO.Viewer, CONTENT_TOPBAR, new Listener<StateToken>() {
+ @Override
+ public void onEvent(final StateToken token) {
+ downloadContent(token);
+ }
+ });
+ download.setMustBeAuthenticated(false);
+ download.setTextDescription(i18n.t("Download"));
+ download.setToolTip(i18n.t("Download this file"));
+ download.setIconUrl("images/nav/download.png");
- final ActionMenuItemDescriptor<StateToken> downloadCtx = new ActionMenuItemDescriptor<StateToken>(
- AccessRolDTO.Viewer, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- downloadContent(token);
- }
- });
- downloadCtx.setMustBeAuthenticated(false);
- downloadCtx.setTextDescription(i18n.t("Download"));
- downloadCtx.setIconUrl("images/nav/download.png");
+ final ActionMenuItemDescriptor<StateToken> downloadCtx = new ActionMenuItemDescriptor<StateToken>(
+ AccessRolDTO.Viewer, new Listener<StateToken>() {
+ @Override
+ public void onEvent(final StateToken token) {
+ downloadContent(token);
+ }
+ });
+ downloadCtx.setMustBeAuthenticated(false);
+ downloadCtx.setTextDescription(i18n.t("Download"));
+ downloadCtx.setIconUrl("images/nav/download.png");
- // contentActionRegistry.addAction(download, typeUploadedfile);
- contextActionRegistry.addAction(downloadCtx, typeUploadedfile);
- }
+ // contentActionRegistry.addAction(download, typeUploadedfile);
+ contextActionRegistry.addAction(downloadCtx, typeUploadedfile);
+ }
- protected ActionToolbarButtonDescriptor<StateToken> createEditAction(final String fileMenuTitle,
- final String... registerInTypes) {
- final ActionToolbarButtonDescriptor<StateToken> editContent = new ActionToolbarButtonDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- OldNotifyUser.showProgressProcessing();
- session.check(new AsyncCallbackSimple<Void>() {
- @Override
- public void onSuccess(final Void result) {
- final ContentEditor editor = textEditorProvider.get();
- foldableContent.detach();
- contextNavigator.detach();
- contextPropEditorProvider.get().attach();
- editor.edit(session.getContentState().getContent(), new Listener<String>() {
- @Override
- public void onEvent(final String html) {
- OldNotifyUser.showProgressSaving();
- contentServiceProvider.get().save(session.getUserHash(), stateToken, html,
- new AsyncCallback<Void>() {
- @Override
- public void onFailure(final Throwable caught) {
- OldNotifyUser.hideProgress();
- if (caught instanceof SessionExpiredException) {
- errorHandler.doSessionExpired();
- } else {
- OldNotifyUser.error(i18n.t("Error saving document. Retrying..."));
- errorHandler.process(caught);
- editor.onSaveFailed();
- }
- }
+ protected ActionToolbarButtonDescriptor<StateToken> createEditAction(final String fileMenuTitle,
+ final String... registerInTypes) {
+ final ActionToolbarButtonDescriptor<StateToken> editContent = new ActionToolbarButtonDescriptor<StateToken>(
+ AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
+ @Override
+ public void onEvent(final StateToken stateToken) {
+ OldNotifyUser.showProgressProcessing();
+ session.check(new AsyncCallbackSimple<Void>() {
+ @Override
+ public void onSuccess(final Void result) {
+ final ContentEditor editor = textEditorProvider.get();
+ foldableContent.detach();
+ contextNavigator.detach();
+ contextPropEditorProvider.get().attach();
+ editor.edit(session.getContentState().getContent(), new Listener<String>() {
+ @Override
+ public void onEvent(final String html) {
+ OldNotifyUser.showProgressSaving();
+ contentServiceProvider.get().save(session.getUserHash(), stateToken, html,
+ new AsyncCallback<Void>() {
+ @Override
+ public void onFailure(final Throwable caught) {
+ OldNotifyUser.hideProgress();
+ if (caught instanceof SessionExpiredException) {
+ errorHandler.doSessionExpired();
+ } else {
+ OldNotifyUser.error(i18n.t("Error saving document. Retrying..."));
+ errorHandler.process(caught);
+ editor.onSaveFailed();
+ }
+ }
- @Override
- public void onSuccess(final Void param) {
- OldNotifyUser.hideProgress();
- session.getContentState().setContent(html);
- editor.onSavedSuccessful();
- }
- });
- }
- }, new Listener0() {
- @Override
- public void onEvent() {
- // onClose
- deferredCommandWrapper.addCommand(new ScheduledCommand() {
- @Override
- public void execute() {
- foldableContent.attach();
- contextPropEditorProvider.get().detach();
- contextNavigator.attach();
- if (session.inSameToken(stateToken)) {
- contextNavigator.refreshState();
- foldableContent.refreshState();
- }
- }
- });
- }
- });
- editor.setFileMenuTitle(fileMenuTitle);
- OldNotifyUser.hideProgress();
- }
+ @Override
+ public void onSuccess(final Void param) {
+ OldNotifyUser.hideProgress();
+ session.getContentState().setContent(html);
+ editor.onSavedSuccessful();
+ }
});
- }
+ }
+ }, new Listener0() {
+ @Override
+ public void onEvent() {
+ // onClose
+ deferredCommandWrapper.addCommand(new ScheduledCommand() {
+ @Override
+ public void execute() {
+ foldableContent.attach();
+ contextPropEditorProvider.get().detach();
+ contextNavigator.attach();
+ if (session.inSameToken(stateToken)) {
+ contextNavigator.refreshState();
+ foldableContent.refreshState();
+ }
+ }
+ });
+ }
});
- editContent.setTextDescription(i18n.tWithNT("Edit", "used in button"));
- editContent.setIconUrl("images/content_edit.png");
- editContent.setLeftSeparator(ActionToolbarButtonSeparator.spacer);
- editContent.setEnableCondition(notDeleted());
- // contentActionRegistry.addAction(editContent, registerInTypes);
- return editContent;
- }
+ editor.setFileMenuTitle(fileMenuTitle);
+ OldNotifyUser.hideProgress();
+ }
+ });
+ }
+ });
+ editContent.setTextDescription(i18n.tWithNT("Edit", "used in button"));
+ editContent.setIconUrl("images/content_edit.png");
+ editContent.setLeftSeparator(ActionToolbarButtonSeparator.spacer);
+ editContent.setEnableCondition(notDeleted());
+ // contentActionRegistry.addAction(editContent, registerInTypes);
+ return editContent;
+ }
- protected ActionMenuItemDescriptor<StateToken> createGoAction(final String... registerInTypes) {
- final ActionMenuItemDescriptor<StateToken> go = new ActionMenuItemDescriptor<StateToken>(AccessRolDTO.Viewer,
- new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- stateManager.gotoStateToken(token);
- }
- });
- go.setMustBeAuthenticated(false);
- go.setTextDescription(i18n.t("Open"));
- go.setIconUrl("images/nav/go.png");
- contextActionRegistry.addAction(go, registerInTypes);
- return go;
- }
+ protected ActionMenuItemDescriptor<StateToken> createGoAction(final String... registerInTypes) {
+ final ActionMenuItemDescriptor<StateToken> go = new ActionMenuItemDescriptor<StateToken>(
+ AccessRolDTO.Viewer, new Listener<StateToken>() {
+ @Override
+ public void onEvent(final StateToken token) {
+ stateManager.gotoStateToken(token);
+ }
+ });
+ go.setMustBeAuthenticated(false);
+ go.setTextDescription(i18n.t("Open"));
+ go.setIconUrl("images/nav/go.png");
+ contextActionRegistry.addAction(go, registerInTypes);
+ return go;
+ }
- protected ActionToolbarButtonDescriptor<StateToken> createGoHomeAction(final String... registerInTypes) {
- final ActionToolbarButtonDescriptor<StateToken> goGroupHome = new ActionToolbarButtonDescriptor<StateToken>(
- AccessRolDTO.Viewer, CONTEXT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- stateManager.gotoHistoryToken(token.getGroup());
- }
- });
- goGroupHome.setMustBeAuthenticated(false);
- goGroupHome.setIconUrl("images/group-home.png");
- goGroupHome.setEnableCondition(new ActionEnableCondition<StateToken>() {
- @Override
- public boolean mustBeEnabled(final StateToken token) {
- final StateToken defContentToken = session.getCurrentState().getGroup().getDefaultContent().getStateToken();
- return !session.getCurrentStateToken().equals(defContentToken);
- }
+ protected ActionToolbarButtonDescriptor<StateToken> createGoHomeAction(final String... registerInTypes) {
+ final ActionToolbarButtonDescriptor<StateToken> goGroupHome = new ActionToolbarButtonDescriptor<StateToken>(
+ AccessRolDTO.Viewer, CONTEXT_TOPBAR, new Listener<StateToken>() {
+ @Override
+ public void onEvent(final StateToken token) {
+ stateManager.gotoHistoryToken(token.getGroup());
+ }
});
- goGroupHome.setLeftSeparator(ActionToolbarButtonSeparator.fill);
- contextActionRegistry.addAction(goGroupHome, registerInTypes);
- return goGroupHome;
- }
+ goGroupHome.setMustBeAuthenticated(false);
+ goGroupHome.setIconUrl("images/group-home.png");
+ goGroupHome.setEnableCondition(new ActionEnableCondition<StateToken>() {
+ @Override
+ public boolean mustBeEnabled(final StateToken token) {
+ final StateToken defContentToken = session.getCurrentState().getGroup().getDefaultContent().getStateToken();
+ return !session.getCurrentStateToken().equals(defContentToken);
+ }
+ });
+ goGroupHome.setLeftSeparator(ActionToolbarButtonSeparator.fill);
+ contextActionRegistry.addAction(goGroupHome, registerInTypes);
+ return goGroupHome;
+ }
- protected void createNewContainerAction(final String contentTypeId, final String iconUrl,
- final String textDescription, final String parentMenuTitle, final String parentMenuSubtitle,
- final String defaultName, final Position position, final String... registerInTypes) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> addFolder;
- addFolder = new ActionToolbarMenuAndItemDescriptor<StateToken>(AccessRolDTO.Editor, CONTEXT_TOPBAR,
- new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- OldNotifyUser.showProgressProcessing();
- contentServiceProvider.get().addFolder(session.getUserHash(), stateToken, defaultName,
- contentTypeId, new AsyncCallbackSimple<StateContainerDTO>() {
- @Override
- public void onSuccess(final StateContainerDTO state) {
- contextNavigator.setEditOnNextStateChange(true);
- stateManager.setRetrievedStateAndGo(state);
- }
- });
- }
+ protected void createNewContainerAction(final String contentTypeId, final String iconUrl,
+ final String textDescription, final String parentMenuTitle, final String parentMenuSubtitle,
+ final String defaultName, final Position position, final String... registerInTypes) {
+ final ActionToolbarMenuAndItemDescriptor<StateToken> addFolder;
+ addFolder = new ActionToolbarMenuAndItemDescriptor<StateToken>(AccessRolDTO.Editor, CONTEXT_TOPBAR,
+ new Listener<StateToken>() {
+ @Override
+ public void onEvent(final StateToken stateToken) {
+ OldNotifyUser.showProgressProcessing();
+ contentServiceProvider.get().addFolder(session.getUserHash(), stateToken, defaultName,
+ contentTypeId, new AsyncCallbackSimple<StateContainerDTO>() {
+ @Override
+ public void onSuccess(final StateContainerDTO state) {
+ contextNavigator.setEditOnNextStateChange(true);
+ stateManager.setRetrievedStateAndGo(state);
+ }
});
- addFolder.setTextDescription(textDescription);
- addFolder.setParentMenuTitle(parentMenuTitle);
- addFolder.setParentSubMenuTitle(parentMenuSubtitle);
- addFolder.setIconUrl(iconUrl);
- register(addFolder, position, registerInTypes);
- }
+ }
+ });
+ addFolder.setTextDescription(textDescription);
+ addFolder.setParentMenuTitle(parentMenuTitle);
+ addFolder.setParentSubMenuTitle(parentMenuSubtitle);
+ addFolder.setIconUrl(iconUrl);
+ register(addFolder, position, registerInTypes);
+ }
- protected ActionToolbarMenuAndItemDescriptor<StateToken> createNewContentAction(final String typeId,
- final String iconUrl, final String description, final String parentMenuTitle, final Position position,
- final String... registerInTypes) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> addContent = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener0() {
- @Override
- public void onEvent() {
- OldNotifyUser.showProgressProcessing();
- contentServiceProvider.get().addContent(session.getUserHash(),
- session.getCurrentState().getStateToken(), description, typeId,
- new AsyncCallbackSimple<StateContentDTO>() {
- @Override
- public void onSuccess(final StateContentDTO state) {
- contextNavigator.setEditOnNextStateChange(true);
- stateManager.setRetrievedStateAndGo(state);
- }
- });
- }
+ protected ActionToolbarMenuAndItemDescriptor<StateToken> createNewContentAction(final String typeId,
+ final String iconUrl, final String description, final String parentMenuTitle,
+ final Position position, final String... registerInTypes) {
+ final ActionToolbarMenuAndItemDescriptor<StateToken> addContent = new ActionToolbarMenuAndItemDescriptor<StateToken>(
+ AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener0() {
+ @Override
+ public void onEvent() {
+ OldNotifyUser.showProgressProcessing();
+ contentServiceProvider.get().addContent(session.getUserHash(),
+ session.getCurrentState().getStateToken(), description, typeId,
+ new AsyncCallbackSimple<StateContentDTO>() {
+ @Override
+ public void onSuccess(final StateContentDTO state) {
+ contextNavigator.setEditOnNextStateChange(true);
+ stateManager.setRetrievedStateAndGo(state);
+ }
});
- addContent.setTextDescription(description);
- addContent.setParentMenuTitle(parentMenuTitle);
- addContent.setParentSubMenuTitle(i18n.t("New"));
- addContent.setIconUrl(iconUrl);
- register(addContent, position, registerInTypes);
- return addContent;
- }
+ }
+ });
+ addContent.setTextDescription(description);
+ addContent.setParentMenuTitle(parentMenuTitle);
+ addContent.setParentSubMenuTitle(i18n.t("New"));
+ addContent.setIconUrl(iconUrl);
+ register(addContent, position, registerInTypes);
+ return addContent;
+ }
- protected abstract void createPostSessionInitActions();
+ protected abstract void createPostSessionInitActions();
- protected ActionToolbarMenuDescriptor<StateToken> createRefreshCntAction(final String parentMenuTitle,
- final String... registerInTypes) {
- final ActionToolbarMenuDescriptor<StateToken> refreshCnt = new ActionToolbarMenuDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- stateManager.reload();
- contextNavigator.selectItem(stateToken);
- }
- });
- refreshCnt.setMustBeAuthenticated(false);
- refreshCnt.setParentMenuTitle(parentMenuTitle);
- refreshCnt.setTextDescription(i18n.t("Refresh"));
- refreshCnt.setIconUrl("images/nav/refresh.png");
- // contentActionRegistry.addAction(refreshCnt, registerInTypes);
- return refreshCnt;
- }
+ protected ActionToolbarMenuDescriptor<StateToken> createRefreshCntAction(final String parentMenuTitle,
+ final String... registerInTypes) {
+ final ActionToolbarMenuDescriptor<StateToken> refreshCnt = new ActionToolbarMenuDescriptor<StateToken>(
+ AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
+ @Override
+ public void onEvent(final StateToken stateToken) {
+ stateManager.reload();
+ contextNavigator.selectItem(stateToken);
+ }
+ });
+ refreshCnt.setMustBeAuthenticated(false);
+ refreshCnt.setParentMenuTitle(parentMenuTitle);
+ refreshCnt.setTextDescription(i18n.t("Refresh"));
+ refreshCnt.setIconUrl("images/nav/refresh.png");
+ // contentActionRegistry.addAction(refreshCnt, registerInTypes);
+ return refreshCnt;
+ }
- protected ActionToolbarMenuDescriptor<StateToken> createRefreshCxtAction(final String parentMenuTitleCtx,
- final String... registerInTypes) {
- final ActionToolbarMenuDescriptor<StateToken> refreshCtx = new ActionToolbarMenuDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- stateManager.reload();
- contextNavigator.selectItem(stateToken);
- }
- });
- refreshCtx.setMustBeAuthenticated(false);
- refreshCtx.setParentMenuTitle(parentMenuTitleCtx);
- refreshCtx.setTextDescription(i18n.t("Refresh"));
- refreshCtx.setIconUrl("images/nav/refresh.png");
- contextActionRegistry.addAction(refreshCtx, registerInTypes);
- return refreshCtx;
- }
+ protected ActionToolbarMenuDescriptor<StateToken> createRefreshCxtAction(
+ final String parentMenuTitleCtx, final String... registerInTypes) {
+ final ActionToolbarMenuDescriptor<StateToken> refreshCtx = new ActionToolbarMenuDescriptor<StateToken>(
+ AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener<StateToken>() {
+ @Override
+ public void onEvent(final StateToken stateToken) {
+ stateManager.reload();
+ contextNavigator.selectItem(stateToken);
+ }
+ });
+ refreshCtx.setMustBeAuthenticated(false);
+ refreshCtx.setParentMenuTitle(parentMenuTitleCtx);
+ refreshCtx.setTextDescription(i18n.t("Refresh"));
+ refreshCtx.setIconUrl("images/nav/refresh.png");
+ contextActionRegistry.addAction(refreshCtx, registerInTypes);
+ return refreshCtx;
+ }
- protected ActionToolbarMenuAndItemDescriptor<StateToken> createRenameContentInCtxAction(
- final String parentMenuTitleCtx, final String textDescription, final String... registerInTypes) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> renameCtx = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- contextNavigator.editItem(stateToken);
- }
- });
- renameCtx.setTextDescription(textDescription);
- renameCtx.setParentMenuTitle(parentMenuTitleCtx);
- contextActionRegistry.addAction(renameCtx, registerInTypes);
- return renameCtx;
- }
+ protected ActionToolbarMenuAndItemDescriptor<StateToken> createRenameContentInCtxAction(
+ final String parentMenuTitleCtx, final String textDescription, final String... registerInTypes) {
+ final ActionToolbarMenuAndItemDescriptor<StateToken> renameCtx = new ActionToolbarMenuAndItemDescriptor<StateToken>(
+ AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener<StateToken>() {
+ @Override
+ public void onEvent(final StateToken stateToken) {
+ contextNavigator.editItem(stateToken);
+ }
+ });
+ renameCtx.setTextDescription(textDescription);
+ renameCtx.setParentMenuTitle(parentMenuTitleCtx);
+ contextActionRegistry.addAction(renameCtx, registerInTypes);
+ return renameCtx;
+ }
- protected ActionToolbarMenuDescriptor<StateToken> createSetAsDefContent(final String parentMenuTitle,
- final String... registerInTypes) {
- final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupContent;
- setAsDefGroupContent = new ActionToolbarMenuDescriptor<StateToken>(AccessRolDTO.Administrator, CONTENT_TOPBAR,
- new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- OldNotifyUser.showProgressProcessing();
- contentServiceProvider.get().setAsDefaultContent(session.getUserHash(), token,
- new AsyncCallbackSimple<ContentSimpleDTO>() {
- @Override
- public void onSuccess(final ContentSimpleDTO defContent) {
- session.getCurrentState().getGroup().setDefaultContent(defContent);
- OldNotifyUser.hideProgress();
- OldNotifyUser.info(i18n.t("Content selected as the group homepage"));
- }
- });
- }
+ protected ActionToolbarMenuDescriptor<StateToken> createSetAsDefContent(final String parentMenuTitle,
+ final String... registerInTypes) {
+ final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupContent;
+ setAsDefGroupContent = new ActionToolbarMenuDescriptor<StateToken>(AccessRolDTO.Administrator,
+ CONTENT_TOPBAR, new Listener<StateToken>() {
+ @Override
+ public void onEvent(final StateToken token) {
+ OldNotifyUser.showProgressProcessing();
+ contentServiceProvider.get().setAsDefaultContent(session.getUserHash(), token,
+ new AsyncCallbackSimple<ContentSimpleDTO>() {
+ @Override
+ public void onSuccess(final ContentSimpleDTO defContent) {
+ session.getCurrentState().getGroup().setDefaultContent(defContent);
+ OldNotifyUser.hideProgress();
+ OldNotifyUser.info(i18n.t("Content selected as the group homepage"));
+ }
});
- setAsDefGroupContent.setTextDescription(i18n.t("Set this as the default group page"));
- setAsDefGroupContent.setIconUrl("images/group-home.png");
- setAsDefGroupContent.setEnableCondition(notDefAndNotDeleted());
- setAsDefGroupContent.setParentMenuTitle(parentMenuTitle);
- // contentActionRegistry.addAction(setAsDefGroupContent,
- // registerInTypes);
- return setAsDefGroupContent;
- }
+ }
+ });
+ setAsDefGroupContent.setTextDescription(i18n.t("Set this as the default group page"));
+ setAsDefGroupContent.setIconUrl("images/group-home.png");
+ setAsDefGroupContent.setEnableCondition(notDefAndNotDeleted());
+ setAsDefGroupContent.setParentMenuTitle(parentMenuTitle);
+ // contentActionRegistry.addAction(setAsDefGroupContent,
+ // registerInTypes);
+ return setAsDefGroupContent;
+ }
- protected void createSetGroupBackImageAction(final String parentMenuTitle, final String... registerInTypes) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> setGroupBackImage = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- groupServiceProvider.get().setGroupBackImage(session.getUserHash(), token,
- new AsyncCallbackSimple<GroupDTO>() {
- @Override
- public void onSuccess(final GroupDTO newGroup) {
- if (session.getCurrentState().getGroup().getShortName().equals(
- newGroup.getShortName())) {
- session.getCurrentState().setGroup(newGroup);
- wsBackManager.clearBackImage();
- wsBackManager.setBackImage(newGroup.getGroupBackImage().getStateToken());
- }
- }
- });
- }
- });
- setGroupBackImage.setParentMenuTitle(parentMenuTitle);
- setGroupBackImage.setTextDescription(i18n.t("Set this as the group background image"));
- setGroupBackImage.setIconUrl("images/nav/picture.png");
- setGroupBackImage.setEnableCondition(new ActionEnableCondition<StateToken>() {
- @Override
- public boolean mustBeEnabled(final StateToken token) {
- return session.getContentState().getMimeType().isImage();
+ //
+ // protected void createSetGroupBackImageAction(final String parentMenuTitle,
+ // final String... registerInTypes) {
+ // final ActionToolbarMenuAndItemDescriptor<StateToken> setGroupBackImage =
+ // new ActionToolbarMenuAndItemDescriptor<StateToken>(
+ // AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
+ // @Override
+ // public void onEvent(final StateToken token) {
+ // groupServiceProvider.get().setGroupBackImage(session.getUserHash(), token,
+ // new AsyncCallbackSimple<GroupDTO>() {
+ // @Override
+ // public void onSuccess(final GroupDTO newGroup) {
+ // if (session.getCurrentState().getGroup().getShortName().equals(
+ // newGroup.getShortName())) {
+ // session.getCurrentState().setGroup(newGroup);
+ // wsBackManager.clearBackImage();
+ // wsBackManager.setBackImage(newGroup.getGroupBackImage().getStateToken());
+ // }
+ // }
+ // });
+ // }
+ // });
+ // setGroupBackImage.setParentMenuTitle(parentMenuTitle);
+ // setGroupBackImage.setTextDescription(i18n.t("Set this as the group background image"));
+ // setGroupBackImage.setIconUrl("images/nav/picture.png");
+ // setGroupBackImage.setEnableCondition(new
+ // ActionEnableCondition<StateToken>() {
+ // @Override
+ // public boolean mustBeEnabled(final StateToken token) {
+ // return session.getContentState().getMimeType().isImage();
+ // }
+ // });
+ // // contentActionRegistry.addAction(setGroupBackImage, registerInTypes);
+ // }
+
+ protected void createSetStatusAction(final AccessRolDTO rol, final String textDescription,
+ final ContentStatus status, final String[] contentsModerated) {
+ final ActionToolbarMenuRadioDescriptor<StateToken> action = new ActionToolbarMenuRadioDescriptor<StateToken>(
+ rol, CONTENT_TOPBAR, new Listener<StateToken>() {
+ @Override
+ public void onEvent(final StateToken stateToken) {
+ setContentStatus(status, stateToken);
+ }
+ }, "ContentRadioStatus", new RadioMustBeChecked() {
+ @Override
+ public boolean mustBeChecked() {
+ if (session.getContainerState() instanceof StateContentDTO) {
+ final ContentStatus currentStatus = session.getContentState().getStatus();
+ return status.equals(currentStatus);
}
+ return false;
+ }
});
- // contentActionRegistry.addAction(setGroupBackImage, registerInTypes);
- }
+ action.setTextDescription(textDescription);
+ action.setParentMenuTitle(PUBLICATION_MENU);
+ action.setParentMenuIconUrl("images/anybody.png");
+ // contentActionRegistry.addAction(action, contentsModerated);
+ }
- protected void createSetStatusAction(final AccessRolDTO rol, final String textDescription,
- final ContentStatus status, final String[] contentsModerated) {
- final ActionToolbarMenuRadioDescriptor<StateToken> action = new ActionToolbarMenuRadioDescriptor<StateToken>(
- rol, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- setContentStatus(status, stateToken);
- }
- }, "ContentRadioStatus", new RadioMustBeChecked() {
- @Override
- public boolean mustBeChecked() {
- if (session.getContainerState() instanceof StateContentDTO) {
- final ContentStatus currentStatus = session.getContentState().getStatus();
- return status.equals(currentStatus);
- }
- return false;
- }
- });
- action.setTextDescription(textDescription);
- action.setParentMenuTitle(PUBLICATION_MENU);
- action.setParentMenuIconUrl("images/anybody.png");
- // contentActionRegistry.addAction(action, contentsModerated);
- }
+ protected void createShowDeletedItems(final String parentMenuTitle, final String... registerInTypes) {
+ final ActionToolbarMenuCheckItemDescriptor<StateToken> showDeletedItems = new ActionToolbarMenuCheckItemDescriptor<StateToken>(
+ AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener0() {
+ @Override
+ public void onEvent() {
+ final boolean mustShow = !session.getCurrentUserInfo().getShowDeletedContent();
+ session.getCurrentUserInfo().setShowDeletedContent(mustShow);
+ if (!mustShow && session.isCurrentStateAContent()
+ && session.getContentState().getStatus().equals(ContentStatus.inTheDustbin)) {
+ stateManager.gotoHistoryToken(session.getCurrentStateToken().getGroup());
+ }
+ contextNavigator.clear();
+ contextNavigator.refreshState();
+ }
+ }, new ActionCheckedCondition() {
+ @Override
+ public boolean mustBeChecked() {
+ return session.getShowDeletedContent();
+ }
+ });
+ showDeletedItems.setParentMenuTitle(parentMenuTitle);
+ showDeletedItems.setTextDescription("Show deleted items");
+ showDeletedItems.setMustBeAuthenticated(true);
+ contextActionRegistry.addAction(showDeletedItems, registerInTypes);
+ }
- protected void createShowDeletedItems(final String parentMenuTitle, final String... registerInTypes) {
- final ActionToolbarMenuCheckItemDescriptor<StateToken> showDeletedItems = new ActionToolbarMenuCheckItemDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener0() {
- @Override
- public void onEvent() {
- final boolean mustShow = !session.getCurrentUserInfo().getShowDeletedContent();
- session.getCurrentUserInfo().setShowDeletedContent(mustShow);
- if (!mustShow && session.isCurrentStateAContent()
- && session.getContentState().getStatus().equals(ContentStatus.inTheDustbin)) {
- stateManager.gotoHistoryToken(session.getCurrentStateToken().getGroup());
- }
- contextNavigator.clear();
- contextNavigator.refreshState();
- }
- }, new ActionCheckedCondition() {
- @Override
- public boolean mustBeChecked() {
- return session.getShowDeletedContent();
- }
- });
- showDeletedItems.setParentMenuTitle(parentMenuTitle);
- showDeletedItems.setTextDescription("Show deleted items");
- showDeletedItems.setMustBeAuthenticated(true);
- contextActionRegistry.addAction(showDeletedItems, registerInTypes);
- }
+ protected ActionToolbarMenuDescriptor<StateToken> createTranslateAction(final String fileMenuTitle,
+ final String... registerInTypes) {
+ final ActionToolbarMenuDescriptor<StateToken> translateContent = new ActionToolbarMenuDescriptor<StateToken>(
+ AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
+ @Override
+ public void onEvent(final StateToken stateToken) {
+ OldNotifyUser.important(i18n.t("Sorry, this functionality is currently in development"));
+ }
+ });
+ translateContent.setParentMenuTitle(fileMenuTitle);
+ translateContent.setTextDescription(i18n.tWithNT("Translate", "used in button"));
+ translateContent.setToolTip(i18n.t("Translate this document to other languages"));
+ translateContent.setIconUrl("images/language.gif");
+ translateContent.setEnableCondition(notDeleted());
+ // contentActionRegistry.addAction(translateContent, registerInTypes);
+ return translateContent;
+ }
- protected ActionToolbarMenuDescriptor<StateToken> createTranslateAction(final String fileMenuTitle,
- final String... registerInTypes) {
- final ActionToolbarMenuDescriptor<StateToken> translateContent = new ActionToolbarMenuDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- OldNotifyUser.important(i18n.t("Sorry, this functionality is currently in development"));
- }
- });
- translateContent.setParentMenuTitle(fileMenuTitle);
- translateContent.setTextDescription(i18n.tWithNT("Translate", "used in button"));
- translateContent.setToolTip(i18n.t("Translate this document to other languages"));
- translateContent.setIconUrl("images/language.gif");
- translateContent.setEnableCondition(notDeleted());
- // contentActionRegistry.addAction(translateContent, registerInTypes);
- return translateContent;
- }
+ protected ActionToolbarButtonAndItemDescriptor<StateToken> createUploadAction(
+ final String textDescription, final String iconUrl, final String toolTip,
+ final String permitedExtensions, final String... registerInTypes) {
+ final ActionToolbarButtonAndItemDescriptor<StateToken> uploadFile;
+ uploadFile = new ActionToolbarButtonAndItemDescriptor<StateToken>(AccessRolDTO.Editor,
+ CONTEXT_BOTTOMBAR, new Listener0() {
+ @Override
+ public void onEvent() {
+ if (permitedExtensions != null) {
+ // FIXME: can't be reset ...
+ // fileUploaderProvider.get().setPermittedExtensions(permitedExtensions);
+ } else {
+ // FIXME: can't be reset ...
+ // fileUploaderProvider.get().resetPermittedExtensions();
+ }
+ fileUploaderProvider.get().show();
+ }
+ });
+ uploadFile.setTextDescription(textDescription);
+ uploadFile.setIconUrl(iconUrl);
+ uploadFile.setToolTip(toolTip);
+ contextActionRegistry.addAction(uploadFile, registerInTypes);
+ return uploadFile;
+ }
- protected ActionToolbarButtonAndItemDescriptor<StateToken> createUploadAction(final String textDescription,
- final String iconUrl, final String toolTip, final String permitedExtensions,
- final String... registerInTypes) {
- final ActionToolbarButtonAndItemDescriptor<StateToken> uploadFile;
- uploadFile = new ActionToolbarButtonAndItemDescriptor<StateToken>(AccessRolDTO.Editor, CONTEXT_BOTTOMBAR,
- new Listener0() {
- @Override
- public void onEvent() {
- if (permitedExtensions != null) {
- // FIXME: can't be reset ...
- // fileUploaderProvider.get().setPermittedExtensions(permitedExtensions);
- } else {
- // FIXME: can't be reset ...
- // fileUploaderProvider.get().resetPermittedExtensions();
- }
- fileUploaderProvider.get().show();
- }
- });
- uploadFile.setTextDescription(textDescription);
- uploadFile.setIconUrl(iconUrl);
- uploadFile.setToolTip(toolTip);
- contextActionRegistry.addAction(uploadFile, registerInTypes);
- return uploadFile;
- }
+ protected ActionToolbarButtonAndItemDescriptor<StateToken> createUploadMediaAction(
+ final String... registerInTypes) {
+ final ActionToolbarButtonAndItemDescriptor<StateToken> uploadMedia = createUploadAction(
+ i18n.t("Upload media"), "images/nav/upload.png",
+ i18n.t("Upload some media (images, videos...)"), session.getGalleryPermittedExtensions());
+ contextActionRegistry.addAction(uploadMedia, registerInTypes);
+ return uploadMedia;
+ }
- protected ActionToolbarButtonAndItemDescriptor<StateToken> createUploadMediaAction(final String... registerInTypes) {
- final ActionToolbarButtonAndItemDescriptor<StateToken> uploadMedia = createUploadAction(i18n.t("Upload media"),
- "images/nav/upload.png", i18n.t("Upload some media (images, videos...)"),
- session.getGalleryPermittedExtensions());
- contextActionRegistry.addAction(uploadMedia, registerInTypes);
- return uploadMedia;
- }
+ protected void downloadContent(final StateToken token) {
+ fileDownloadProvider.get().downloadFile(token);
+ }
- protected void downloadContent(final StateToken token) {
- fileDownloadProvider.get().downloadFile(token);
- }
+ private ActionEnableCondition<StateToken> notDefAndNotDeleted() {
+ return new ActionEnableCondition<StateToken>() {
+ @Override
+ public boolean mustBeEnabled(final StateToken token) {
+ final boolean isNotDefContentToken = !session.getCurrentState().getGroup().getDefaultContent().getStateToken().equals(
+ session.getCurrentStateToken());
+ return isNotDefContentToken && notDeleted().mustBeEnabled(token);
+ }
+ };
+ }
- private ActionEnableCondition<StateToken> notDefAndNotDeleted() {
- return new ActionEnableCondition<StateToken>() {
- @Override
- public boolean mustBeEnabled(final StateToken token) {
- final boolean isNotDefContentToken = !session.getCurrentState().getGroup().getDefaultContent().getStateToken().equals(
- session.getCurrentStateToken());
- return isNotDefContentToken && notDeleted().mustBeEnabled(token);
- }
- };
- }
+ private ActionEnableCondition<StateToken> notDeleted() {
+ return new ActionEnableCondition<StateToken>() {
+ @Override
+ public boolean mustBeEnabled(final StateToken token) {
+ final boolean isNotDeleted = !(session.isCurrentStateAContent() && session.getContentState().getStatus().equals(
+ ContentStatus.inTheDustbin));
+ return isNotDeleted;
+ }
+ };
+ }
- private ActionEnableCondition<StateToken> notDeleted() {
- return new ActionEnableCondition<StateToken>() {
- @Override
- public boolean mustBeEnabled(final StateToken token) {
- final boolean isNotDeleted = !(session.isCurrentStateAContent() && session.getContentState().getStatus().equals(
- ContentStatus.inTheDustbin));
- return isNotDeleted;
- }
- };
+ private void register(final ActionToolbarMenuAndItemDescriptor<StateToken> action,
+ final Position position, final String... registerInTypes) {
+ if (position.equals(Position.ctx)) {
+ contextActionRegistry.addAction(action, registerInTypes);
+ } else if (position.equals(Position.cnt)) {
+ // contentActionRegistry.addAction(action, registerInTypes);
}
+ }
- private void register(final ActionToolbarMenuAndItemDescriptor<StateToken> action, final Position position,
- final String... registerInTypes) {
- if (position.equals(Position.ctx)) {
- contextActionRegistry.addAction(action, registerInTypes);
- } else if (position.equals(Position.cnt)) {
- // contentActionRegistry.addAction(action, registerInTypes);
+ private void setContentStatus(final ContentStatus status, final StateToken stateToken) {
+ final AsyncCallbackSimple<StateAbstractDTO> callback = new AsyncCallbackSimple<StateAbstractDTO>() {
+ @Override
+ public void onSuccess(final StateAbstractDTO state) {
+ if (session.inSameToken(stateToken)) {
+ session.setCurrentState(state);
+ // publicLink.setState(state);
+ foldableContent.refreshState();
}
+ contextNavigator.setItemStatus(stateToken, status);
+ }
+ };
+ if (status.equals(ContentStatus.publishedOnline) || status.equals(ContentStatus.rejected)
+ || status.equals(ContentStatus.inTheDustbin)) {
+ contentServiceProvider.get().setStatusAsAdmin(session.getUserHash(), stateToken, status, callback);
+ } else {
+ contentServiceProvider.get().setStatus(session.getUserHash(), stateToken, status, callback);
}
+ }
- private void setContentStatus(final ContentStatus status, final StateToken stateToken) {
- final AsyncCallbackSimple<StateAbstractDTO> callback = new AsyncCallbackSimple<StateAbstractDTO>() {
- @Override
- public void onSuccess(final StateAbstractDTO state) {
- if (session.inSameToken(stateToken)) {
- session.setCurrentState(state);
- // publicLink.setState(state);
- foldableContent.refreshState();
- }
- contextNavigator.setItemStatus(stateToken, status);
- }
- };
- if (status.equals(ContentStatus.publishedOnline) || status.equals(ContentStatus.rejected)
- || status.equals(ContentStatus.inTheDustbin)) {
- contentServiceProvider.get().setStatusAsAdmin(session.getUserHash(), stateToken, status, callback);
- } else {
- contentServiceProvider.get().setStatus(session.getUserHash(), stateToken, status, callback);
- }
- }
-
}
1
0