[kune-commits] r866 - in trunk: . script
src/main/java/org/ourproject/kune/app
src/main/java/org/ourproject/kune/app/public/css
src/main/java/org/ourproject/kune/app/server
src/main/java/org/ourproject/kune/docs/client
src/main/java/org/ourproject/kune/docs/client/ctx/admin
src/main/java/org/ourproject/kune/platf/client/services
src/main/java/org/ourproject/kune/platf/client/ui/dialogs
src/main/java/org/ourproject/kune/platf/server
src/main/java/org/ourproject/kune/platf/server/manager/impl
src/main/java/org/ourproject/kune/platf/server/properties
src/main/java/org/ourproject/kune/platf/server/rpc
src/main/java/org/ourproject/kune/workspace/client/ctxnav
src/main/java/org/ourproject/kune/workspace/client/title
src/main/resources src/main/resources/META-INF
src/main/webapp/WEB-INF
vjrj
vjrj at ourproject.org
Wed Sep 10 06:52:09 CEST 2008
Author: vjrj
Date: 2008-09-10 06:51:49 +0200 (Wed, 10 Sep 2008)
New Revision: 866
Added:
trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileUploadManagerRevisited.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitle.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitle.java
Modified:
trunk/INSTALL
trunk/script/css-compact-and-tidy.css
trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml
trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
trunk/src/main/java/org/ourproject/kune/app/server/KuneRackModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/FileUploaderDialog.java
trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java
trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileUploadManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java
trunk/src/main/resources/META-INF/persistence.xml
trunk/src/main/resources/kune.properties
trunk/src/main/webapp/WEB-INF/web.xml
Log:
FileUpload (Server side and Client Side) rewrited. Renaming now works editing in place (in context tree).
Important! New location for indexes:
/var/lib/lucene ---> /var/lib/kune/lucene
Uploads will be stored in:
/var/lib/kune/uploads/<folder-token>/<filename>
/var/lib/kune/uploads/<folder-token>/<filename.1> ... for files with same name
see INSTALL for details
Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/INSTALL 2008-09-10 04:51:49 UTC (rev 866)
@@ -26,10 +26,17 @@
GRANT ALL PRIVILEGES ON kune_test.* TO kune at localhost IDENTIFIED BY 'db4kune';
FLUSH PRIVILEGES;
+- Configure upload directory:
+
+ sudo mkdir -p /var/lib/kune/uploads/
+ sudo chown yourUser:yourUser /var/lib/kune/uploads
+
+you can use other location (see kune.properties)
+
- Configurate hibernate-search (GNU/Linux instructions, look persistence.xml if you want to change indexes destination):
# yourUser is the user you are using to develop/run the application
- sudo mkdir -p /var/lib/lucene/kune_dev/indexes
- sudo mkdir -p /var/lib/lucene/kune_test/indexes
+ sudo mkdir -p /var/lib/kune/lucene/kune_dev/indexes
+ sudo mkdir -p /var/lib/kune/lucene/kune_test/indexes
sudo chown yourUser:yourUser /var/lib/lucene/kune_dev/indexes
sudo chown yourUser:yourUser /var/lib/lucene/kune_test/indexes
Modified: trunk/script/css-compact-and-tidy.css
===================================================================
--- trunk/script/css-compact-and-tidy.css 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/script/css-compact-and-tidy.css 2008-09-10 04:51:49 UTC (rev 866)
@@ -7,7 +7,8 @@
EXTTMPFILE=$ORIG/js/ext/resources/css/ext-all.css-tmp
-sed 's/normal 11px/normal 100\%/g' $ORIG/js/ext/resources/css/ext-all.css |\
+sed 's/x.btn button{border:0 none;background:transparent;font:normal 11px tahoma,verdana,helvetica;/x-btn button{border:0 none;background:transparent;/g' $ORIG/js/ext/resources/css/ext-all.css |\
+sed 's/normal 11px/normal 100\%/g' |\
sed 's/bold 11px/bold 100\%/g' |\
sed 's/normal 12px/normal 100\%/g' |\
sed 's/bold 12px/bold 100\%/g' |\
Modified: trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml 2008-09-10 04:51:49 UTC (rev 866)
@@ -4,8 +4,6 @@
<!-- http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/4d38cff6b1c217c6/8fae54c512bac373?lnk=gst&q=will+not+be+serialized+because+it+is+final+#8fae54c512bac373 -->
<set-property name="gwt.suppressNonStaticFinalFieldWarnings" value="true" />
-
- <inherits name="org.cafesip.gwtcomp.GWTComponents" />
<inherits name="com.calclab.suco.Suco" />
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-09-10 04:51:49 UTC (rev 866)
@@ -246,7 +246,7 @@
.x-fieldset-body{overflow:hidden;}
.x-btn{font:normal 100% arial,sans;cursor:pointer;white-space:nowrap;}
-.x-btn button{border:0 none;background:transparent;font:normal 100% arial,sans;padding-left:3px;padding-right:3px;cursor:pointer;margin:0;overflow:visible;width:auto;-moz-outline:0 none;outline:0 none;}
+.x-btn button{border:0 none;background:transparent;padding-left:3px;padding-right:3px;cursor:pointer;margin:0;overflow:visible;width:auto;-moz-outline:0 none;outline:0 none;}
* html .ext-ie .x-btn button{width:1px;}
.ext-gecko .x-btn button{padding-left:0;padding-right:0;}
.ext-ie .x-btn button{padding-top:2px;}
Modified: trunk/src/main/java/org/ourproject/kune/app/server/KuneRackModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/server/KuneRackModule.java 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/java/org/ourproject/kune/app/server/KuneRackModule.java 2008-09-10 04:51:49 UTC (rev 866)
@@ -57,54 +57,54 @@
private final Module configModule;
public KuneRackModule() {
- this("development", "kune.properties", null);
+ this("development", "kune.properties", null);
}
public KuneRackModule(final String jpaUnit, final String propertiesFileName, final Scope sessionScope) {
- configModule = new AbstractModule() {
- public void configure() {
- bindInterceptor(Matchers.any(), new NotInObject(), new LoggerMethodInterceptor());
- bindConstant().annotatedWith(JpaUnit.class).to(jpaUnit);
- bindConstant().annotatedWith(PropertiesFileName.class).to(propertiesFileName);
- if (sessionScope != null) {
- bindScope(SessionScoped.class, sessionScope);
- }
- }
- };
+ configModule = new AbstractModule() {
+ public void configure() {
+ bindInterceptor(Matchers.any(), new NotInObject(), new LoggerMethodInterceptor());
+ bindConstant().annotatedWith(JpaUnit.class).to(jpaUnit);
+ bindConstant().annotatedWith(PropertiesFileName.class).to(propertiesFileName);
+ if (sessionScope != null) {
+ bindScope(SessionScoped.class, sessionScope);
+ }
+ }
+ };
}
@SuppressWarnings("unchecked")
public void configure(final RackBuilder builder) {
- installGuiceModules(builder);
+ installGuiceModules(builder);
- builder.add(KuneContainerListener.class);
+ builder.add(KuneContainerListener.class);
- builder.exclude("/http-bind.*");
- builder.exclude("/services/fileupload.*");
- builder.at(".*").install(new LogFilter());
- builder.at(".*").install(new GuiceFilter());
+ builder.exclude("/http-bind.*");
+ builder.exclude("/services/fileupload.*");
+ builder.at(".*").install(new LogFilter());
+ builder.at(".*").install(new GuiceFilter());
- builder.at("^/$").install(new RedirectFilter("/kune/"));
- builder.at("^/kune$").install(new RedirectFilter("/kune/"));
+ builder.at("^/$").install(new RedirectFilter("/kune/"));
+ builder.at("^/kune$").install(new RedirectFilter("/kune/"));
- builder.at("^/kune/$").install(new ListenerFilter(KuneApplicationListener.class),
- new ForwardFilter("/gwt/org.ourproject.kune.app.Kune/Kune.html"));
+ builder.at("^/kune/$").install(new ListenerFilter(KuneApplicationListener.class),
+ new ForwardFilter("/gwt/org.ourproject.kune.app.Kune/Kune.html"));
- builder.installGWTServices("^/kune/", SiteService.class, GroupService.class, ContentService.class,
- UserService.class, SocialNetworkService.class, I18nService.class);
- builder.installRESTServices("^/kune/json/", TestJSONService.class, GroupJSONService.class,
- UserJSONService.class, I18nTranslationJSONService.class, ContentJSONService.class);
+ builder.installGWTServices("^/kune/", SiteService.class, GroupService.class, ContentService.class,
+ UserService.class, SocialNetworkService.class, I18nService.class);
+ builder.installRESTServices("^/kune/json/", TestJSONService.class, GroupJSONService.class,
+ UserJSONService.class, I18nTranslationJSONService.class, ContentJSONService.class);
- builder.at("^/kune/(.*)$").install(new ForwardFilter("^/kune/(.*)$", "/gwt/org.ourproject.kune.app.Kune/{0}"));
+ builder.at("^/kune/(.*)$").install(new ForwardFilter("^/kune/(.*)$", "/gwt/org.ourproject.kune.app.Kune/{0}"));
}
private void installGuiceModules(final RackBuilder builder) {
- builder.use(new ServletModule());
- builder.use(new PlatformServerModule());
- builder.use(new DocumentServerModule());
- builder.use(new ChatServerModule());
- builder.use(new RESTServicesModule());
- builder.use(configModule);
+ builder.use(new ServletModule());
+ builder.use(new PlatformServerModule());
+ builder.use(new DocumentServerModule());
+ builder.use(new ChatServerModule());
+ builder.use(new RESTServicesModule());
+ builder.use(configModule);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-09-10 04:51:49 UTC (rev 866)
@@ -38,8 +38,8 @@
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.tags.TagsSummary;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.title.EntitySubTitlePresenter;
-import org.ourproject.kune.workspace.client.title.EntityTitlePresenter;
+import org.ourproject.kune.workspace.client.title.EntitySubTitle;
+import org.ourproject.kune.workspace.client.title.EntityTitle;
import com.calclab.suco.client.module.AbstractModule;
import com.calclab.suco.client.provider.Factory;
@@ -67,7 +67,7 @@
public AdminContext create() {
final AdminContextPresenter presenter = new AdminContextPresenter($(Session.class),
$(StateManager.class), $$(TagsSummary.class), $$(ContentServiceAsync.class),
- $(EntityTitlePresenter.class), $(EntitySubTitlePresenter.class));
+ $(EntityTitle.class), $(EntitySubTitle.class));
final AdminContextView view = new AdminContextPanel(presenter, i18n);
presenter.init(view);
return presenter;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-09-10 04:51:49 UTC (rev 866)
@@ -35,8 +35,8 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.site.Site;
import org.ourproject.kune.workspace.client.tags.TagsSummary;
-import org.ourproject.kune.workspace.client.title.EntitySubTitlePresenter;
-import org.ourproject.kune.workspace.client.title.EntityTitlePresenter;
+import org.ourproject.kune.workspace.client.title.EntitySubTitle;
+import org.ourproject.kune.workspace.client.title.EntityTitle;
import com.calclab.suco.client.provider.Provider;
@@ -46,20 +46,20 @@
private final Session session;
private final Provider<TagsSummary> tagsSummaryProvider;
private final Provider<ContentServiceAsync> contentServiceProvider;
- private final EntitySubTitlePresenter entitySubTitlePresenter;
- private final EntityTitlePresenter entityTitlePresenter;
+ private final EntitySubTitle entitySubTitle;
+ private final EntityTitle entityTitle;
private final StateManager stateManager;
public AdminContextPresenter(final Session session, final StateManager stateManager,
final Provider<TagsSummary> tagsSummaryProvider,
- final Provider<ContentServiceAsync> contentServiceProvider,
- final EntityTitlePresenter entityTitlePresenter, final EntitySubTitlePresenter entitySubTitlePresenter) {
+ final Provider<ContentServiceAsync> contentServiceProvider, final EntityTitle entityTitle,
+ final EntitySubTitle entitySubTitle) {
this.session = session;
this.stateManager = stateManager;
this.tagsSummaryProvider = tagsSummaryProvider;
this.contentServiceProvider = contentServiceProvider;
- this.entityTitlePresenter = entityTitlePresenter;
- this.entitySubTitlePresenter = entitySubTitlePresenter;
+ this.entityTitle = entityTitle;
+ this.entitySubTitle = entitySubTitle;
}
public void addAuthor(final String authorShortName) {
@@ -93,7 +93,7 @@
currentState.getDocumentId(), langCode, new AsyncCallbackSimple<I18nLanguageDTO>() {
public void onSuccess(final I18nLanguageDTO lang) {
Site.hideProgress();
- entitySubTitlePresenter.setContentLanguage(lang.getEnglishName());
+ entitySubTitle.setContentLanguage(lang.getEnglishName());
}
});
}
@@ -113,7 +113,7 @@
currentState.getDocumentId(), publishedOn, new AsyncCallbackSimple<Object>() {
public void onSuccess(final Object result) {
Site.hideProgress();
- entityTitlePresenter.setContentDate(publishedOn);
+ entityTitle.setContentDate(publishedOn);
}
});
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-09-10 04:51:49 UTC (rev 866)
@@ -126,8 +126,10 @@
import org.ourproject.kune.workspace.client.tags.TagsSummaryPresenter;
import org.ourproject.kune.workspace.client.themes.WsThemePanel;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.title.EntitySubTitle;
import org.ourproject.kune.workspace.client.title.EntitySubTitlePanel;
import org.ourproject.kune.workspace.client.title.EntitySubTitlePresenter;
+import org.ourproject.kune.workspace.client.title.EntityTitle;
import org.ourproject.kune.workspace.client.title.EntityTitlePanel;
import org.ourproject.kune.workspace.client.title.EntityTitlePresenter;
@@ -445,8 +447,8 @@
}
});
- register(SingletonScope.class, new Factory<EntityTitlePresenter>(EntityTitlePresenter.class) {
- public EntityTitlePresenter create() {
+ register(SingletonScope.class, new Factory<EntityTitle>(EntityTitle.class) {
+ public EntityTitle create() {
final EntityTitlePresenter presenter = new EntityTitlePresenter(i18n, $(KuneErrorHandler.class),
$(StateManager.class), $(Session.class), $$(ContentServiceAsync.class));
final EntityTitlePanel panel = new EntityTitlePanel(ws, presenter);
@@ -455,8 +457,8 @@
}
});
- register(SingletonScope.class, new Factory<EntitySubTitlePresenter>(EntitySubTitlePresenter.class) {
- public EntitySubTitlePresenter create() {
+ register(SingletonScope.class, new Factory<EntitySubTitle>(EntitySubTitle.class) {
+ public EntitySubTitle create() {
final EntitySubTitlePresenter presenter = new EntitySubTitlePresenter(i18n, $(StateManager.class));
final EntitySubTitlePanel panel = new EntitySubTitlePanel(presenter, i18n, ws);
presenter.init(panel);
@@ -587,7 +589,7 @@
register(SingletonScope.class, new Factory<ContextNavigator>(ContextNavigator.class) {
public ContextNavigator create() {
final ContextNavigatorPresenter presenter = new ContextNavigatorPresenter($(StateManager.class),
- $(Session.class), $$(ContentServiceAsync.class), i18n);
+ $(Session.class), $$(ContentServiceAsync.class), i18n, $(EntityTitle.class));
final ContextNavigatorPanel panel = new ContextNavigatorPanel(presenter, i18n, $(StateManager.class),
ws, $$(ActionManager.class));
presenter.init(panel);
@@ -597,7 +599,7 @@
register(SingletonScope.class, new Factory<FileUploader>(FileUploader.class) {
public FileUploader create() {
- final FileUploaderDialog panel = new FileUploaderDialog(i18n, ws);
+ final FileUploaderDialog panel = new FileUploaderDialog(i18n, ws, $(Session.class));
return panel;
}
});
@@ -621,8 +623,8 @@
$(GroupSummary.class);
$(EntityLogo.class);
- $(EntityTitlePresenter.class);
- $(EntitySubTitlePresenter.class);
+ $(EntityTitle.class);
+ $(EntitySubTitle.class);
$(WsThemePresenter.class);
$(EntityLicensePresenter.class);
$(RateIt.class);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/FileUploaderDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/FileUploaderDialog.java 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/FileUploaderDialog.java 2008-09-10 04:51:49 UTC (rev 866)
@@ -1,10 +1,14 @@
package org.ourproject.kune.platf.client.ui.dialogs;
+import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.site.Site;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+import com.allen_sauer.gwt.log.client.Log;
+import com.google.gwt.core.client.JavaScriptObject;
import com.gwtext.client.core.EventObject;
+import com.gwtext.client.core.UrlParam;
import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.ToolbarButton;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
@@ -20,25 +24,57 @@
private final I18nUITranslationService i18n;
private final WorkspaceSkeleton ws;
- public FileUploaderDialog(final I18nUITranslationService i18n, final WorkspaceSkeleton ws) {
+ public FileUploaderDialog(final I18nUITranslationService i18n, final WorkspaceSkeleton ws, final Session session) {
this.i18n = i18n;
this.ws = ws;
dialog = new UploadDialog(i18n.t("File uploader"), false, true);
+ // dialog.setUploadAutostart(true);
+ dialog.setResetOnHide(false);
dialog.addListener(new UploadDialogListenerAdapter() {
+
@Override
+ public void onFileUploadStart(final UploadDialog source, final String filename) {
+ setUploadParams(session.getUserHash(), session.getCurrentState().getStateToken().toString(), filename);
+ }
+
+ @Override
public void onUploadComplete(final UploadDialog source) {
- Site.info(i18n.t("Upload completed"));
- // traybarButton.destroy();
- // traybarButton = null;
+ if (!dialog.isVisible()) {
+ Site.info(i18n.t("Upload completed"));
+ traybarButton.destroy();
+ traybarButton = null;
+ }
}
+
+ @Override
+ public void onUploadError(final UploadDialog source, final String filename, final JavaScriptObject data) {
+ showError();
+ }
+
+ @Override
+ public void onUploadFailed(final UploadDialog source, final String filename) {
+ showError();
+ }
+
+ private void setUploadParams(final String userhash, final String currentStateToken, final String filename) {
+ Log.info("Setting upload params");
+ final UrlParam param[] = new UrlParam[3];
+ param[0] = new UrlParam("userhash", userhash);
+ param[1] = new UrlParam("currentStateToken", currentStateToken);
+ param[2] = new UrlParam("filename", filename);
+ dialog.setBaseParams(param);
+ dialog.setPostVarName(filename);
+ }
+
+ private void showError() {
+ if (!dialog.isVisible()) {
+ Site.veryImportant(i18n.t("Error uploading"));
+ }
+ }
+
});
dialog.setUrl(URL);
- // final UrlParam param[] = new UrlParam[2];
- // param[0] = new UrlParam("name1", "value1");
- // param[1] = new UrlParam("name2", "value2");
- // dialog.setBaseParams(param);
- // dialog.setPostVarName("myvar");
}
public void hide() {
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java 2008-09-10 04:51:49 UTC (rev 866)
@@ -39,6 +39,8 @@
private String defaultWsTheme;
private String[] wsThemes;
private String siteLogoUrl;
+ private String galleryPermittedExtensions;
+ private String maxFileSizeInMb;
public String getChatDomain() {
return chatDomain;
@@ -60,6 +62,10 @@
return defaultWsTheme;
}
+ public String getGalleryPermittedExtensions() {
+ return galleryPermittedExtensions;
+ }
+
public List<I18nLanguage> getLanguages() {
return languages;
}
@@ -68,6 +74,10 @@
return licenses;
}
+ public String getMaxFileSizeInMb() {
+ return maxFileSizeInMb;
+ }
+
public String getSiteDomain() {
return siteDomain;
}
@@ -108,6 +118,10 @@
this.defaultWsTheme = defaultWsTheme;
}
+ public void setGalleryPermittedExtensions(final String galleryPermittedExtensions) {
+ this.galleryPermittedExtensions = galleryPermittedExtensions;
+ }
+
public void setLanguages(final List<I18nLanguage> languages) {
this.languages = languages;
}
@@ -116,6 +130,10 @@
this.licenses = licenses;
}
+ public void setMaxFileSizeInMb(final String maxFileSizeInMb) {
+ this.maxFileSizeInMb = maxFileSizeInMb;
+ }
+
public void setSiteDomain(final String siteDomain) {
this.siteDomain = siteDomain;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java 2008-09-10 04:51:49 UTC (rev 866)
@@ -64,6 +64,7 @@
import org.ourproject.kune.platf.server.manager.TagManager;
import org.ourproject.kune.platf.server.manager.ToolConfigurationManager;
import org.ourproject.kune.platf.server.manager.UserManager;
+import org.ourproject.kune.platf.server.manager.impl.FileUploadManagerRevisited;
import org.ourproject.kune.platf.server.manager.impl.GroupManagerDefault;
import org.ourproject.kune.platf.server.manager.impl.I18nCountryManagerDefault;
import org.ourproject.kune.platf.server.manager.impl.I18nLanguageManagerDefault;
@@ -107,6 +108,7 @@
bind(KuneProperties.class).to(KunePropertiesDefault.class);
bind(Mapper.class).to(DozerMapper.class);
bind(ToolRegistry.class);
+ bind(FileUploadManagerRevisited.class);
bindInterceptor(Matchers.any(), Matchers.annotatedWith(Authenticated.class),
outermostCall(new AuthenticatedMethodInterceptor()));
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileUploadManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileUploadManagerDefault.java 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileUploadManagerDefault.java 2008-09-10 04:51:49 UTC (rev 866)
@@ -18,11 +18,16 @@
public static final Log log = LogFactory.getLog(FileUploadManagerDefault.class);
private HashMap<String, File> files;
+ @SuppressWarnings("unchecked")
public FormResponse onSubmit(final HttpServlet servlet, final HttpServletRequest request) {
for (final Map.Entry<String, File> entry : files.entrySet()) {
log.info("file uploaded: " + entry.getKey());
}
+
/**
+ *
+ * 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
@@ -30,7 +35,7 @@
* following properties: { success: true|false, // required error:
* 'Error or success message' // optional, also can be named 'message' }
*/
- return new FormResponse(HttpServletResponse.SC_OK, "{success: true, error: ''}", false);
+ return new FormResponse(HttpServletResponse.SC_OK, "{'success':true,'message':'OK'}", false);
}
public void setFileList(final HashMap<String, File> files) {
Added: trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileUploadManagerRevisited.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileUploadManagerRevisited.java 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileUploadManagerRevisited.java 2008-09-10 04:51:49 UTC (rev 866)
@@ -0,0 +1,116 @@
+package org.ourproject.kune.platf.server.manager.impl;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import net.sf.json.JSONObject;
+
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.FileUploadException;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+import org.apache.commons.fileupload.servlet.ServletFileUpload;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.ourproject.kune.platf.server.properties.KuneProperties;
+
+import com.google.inject.Inject;
+import com.google.inject.servlet.RequestScoped;
+
+ at RequestScoped
+public class FileUploadManagerRevisited extends HttpServlet {
+
+ public static final Log log = LogFactory.getLog(FileUploadManagerRevisited.class);
+
+ private static final long serialVersionUID = 1L;
+
+ @Inject
+ KuneProperties kuneProperties;
+
+ @SuppressWarnings( { "unchecked", "deprecation" })
+ protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException,
+ IOException {
+
+ // i18n
+ String jsonResponse = createJsonResponse(true, "OK");
+
+ final DiskFileItemFactory factory = new DiskFileItemFactory();
+ // maximum size that will be stored in memory
+ factory.setSizeThreshold(4096);
+ // the location for saving data that is larger than getSizeThreshold()
+ factory.setRepository(new File("/tmp"));
+
+ if (!ServletFileUpload.isMultipartContent(req)) {
+ log.warn("Not a multipart upload");
+ }
+
+ final ServletFileUpload upload = new ServletFileUpload(factory);
+ // maximum size before a FileUploadException will be thrown
+ // upload.setSizeMax(new
+ // Integer(kuneProperties.get(KuneProperties.UPLOAD_MAX_FILE_SIZE)) *
+ // 1024 * 1024);
+ upload.setSizeMax(5 * 1024 * 1024);
+
+ try {
+ final List fileItems = upload.parseRequest(req);
+ for (final Iterator iterator = fileItems.iterator(); iterator.hasNext();) {
+ final FileItem item = (FileItem) iterator.next();
+ if (item.isFormField()) {
+ final String name = item.getFieldName();
+ final String value = item.getString();
+ log.info("name: " + name + " value: " + value);
+ } else {
+ final String fileName = item.getName();
+ log.info("file: " + fileName + " fieldName: " + item.getFieldName() + " size: " + item.getSize());
+ // item.write(new
+ // File(kuneProperties.get(KuneProperties.UPLOAD_LOCATION),
+ // fileName));
+ item.write(new File("/var/lib/kune/uploads", fileName));
+ }
+ }
+ } catch (final FileUploadException e) {
+ jsonResponse = createJsonResponse(false, "Error: File too large");
+ } catch (final Exception e) {
+ jsonResponse = createJsonResponse(false, "Error uploading file");
+ e.printStackTrace();
+ }
+
+ final Writer w = new OutputStreamWriter(resp.getOutputStream());
+ w.write(jsonResponse);
+ w.close();
+ resp.setStatus(HttpServletResponse.SC_OK);
+ }
+
+ private String 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.toString();
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java 2008-09-10 04:51:49 UTC (rev 866)
@@ -29,6 +29,9 @@
public String WS_THEMES_DEF = "kune.wsthemes.default";
public String WS_THEMES = "kune.wsthemes";
public String SITE_LOGO_URL = "kune.sitelogourl";
+ public String UPLOAD_GALLERY_PERMITTED_EXTS = "kune.upload.gallerypermittedextensions";
+ public String UPLOAD_MAX_FILE_SIZE = "kune.upload.maxfilesizeinmegas";
+ public String UPLOAD_LOCATION = "kune.upload.location";
public String get(String key);
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java 2008-09-10 04:51:49 UTC (rev 866)
@@ -89,6 +89,8 @@
data.setWsThemes(this.kuneProperties.get(KuneProperties.WS_THEMES).split(","));
data.setDefaultWsTheme(this.kuneProperties.get(KuneProperties.WS_THEMES_DEF));
data.setSiteLogoUrl(kuneProperties.get(KuneProperties.SITE_LOGO_URL));
+ data.setGalleryPermittedExtensions(kuneProperties.get(KuneProperties.UPLOAD_GALLERY_PERMITTED_EXTS));
+ data.setMaxFileSizeInMb(kuneProperties.get(KuneProperties.UPLOAD_MAX_FILE_SIZE));
return mapper.map(data, InitDataDTO.class);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java 2008-09-10 04:51:49 UTC (rev 866)
@@ -38,11 +38,8 @@
import com.gwtext.client.core.EventObject;
import com.gwtext.client.data.Node;
import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.Editor;
-import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.ToolbarButton;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-import com.gwtext.client.widgets.event.EditorListenerAdapter;
import com.gwtext.client.widgets.form.TextField;
import com.gwtext.client.widgets.menu.BaseItem;
import com.gwtext.client.widgets.menu.Item;
@@ -64,10 +61,12 @@
private final WorkspaceSkeleton ws;
private final Provider<ActionManager> actionManagerProvider;
private final StateManager stateManager;
+ private final ContextNavigatorPresenter presenter;
public ContextNavigatorPanel(final ContextNavigatorPresenter presenter, final I18nTranslationService i18n,
final StateManager stateManager, final WorkspaceSkeleton ws,
final Provider<ActionManager> actionManagerProvider) {
+ this.presenter = presenter;
this.stateManager = stateManager;
this.ws = ws;
this.actionManagerProvider = actionManagerProvider;
@@ -98,16 +97,23 @@
child.disable();
break;
}
- contextMenus.put(nodeId, createItemMenu(item.getActionCollection(), item.getStateToken()));
+ createItemMenu(nodeId, item.getActionCollection(), item.getStateToken());
final TreeNode parent = treePanel.getNodeById(item.getParentId());
if (parent != null) {
- Log.info("Adding child node: " + nodeId + " to folder: " + item.getParentId());
+ // Log.info("Adding child node: " + nodeId + " to folder: " +
+ // item.getParentId());
+ child.addListener(new TreeNodeListenerAdapter() {
+ @Override
+ public void onTextChange(final Node node, final String text, final String oldText) {
+ presenter.onItemRename(getToken(node), text, oldText);
+ }
+ });
if (!item.getStateToken().hasAll()) {
child.setExpandable(true);
child.addListener(new TreeNodeListenerAdapter() {
public void onExpand(final Node node) {
treePanel.getNodeById(node.getId()).select();
- stateManager.gotoToken(node.getAttribute("href").substring(1));
+ stateManager.gotoToken(getToken(node));
}
});
} else {
@@ -120,7 +126,7 @@
} else {
// the node already created
if (contextMenus.get(nodeId) == null && item.getActionCollection() != null) {
- contextMenus.put(nodeId, createItemMenu(item.getActionCollection(), item.getStateToken()));
+ createItemMenu(nodeId, item.getActionCollection(), item.getStateToken());
}
}
@@ -156,6 +162,11 @@
setToolbarActions(toolBar, stateToken, actions);
}
+ public void setItemText(final String genId, final String text) {
+ final TreeNode node = getNode(genId);
+ node.setText(text);
+ }
+
public void setRootItem(final String id, final String text, final StateToken stateToken) {
if (treePanel == null || treePanel.getNodeById(id) == null) {
createTreePanel(id);
@@ -167,27 +178,32 @@
setToolbarActions(toolBar, stateToken, actions);
}
- private Menu createItemMenu(final ActionCollection<StateToken> actionCollection, final StateToken stateToken) {
- if (actionCollection != null) {
- final Menu menu = new Menu();
- // Remove if when retrieved rights of siblings
- for (final ActionDescriptor<StateToken> action : actionCollection) {
- final Item item = new Item(action.getText());
- item.setIcon(action.getIconUrl());
- menu.addItem(item);
- item.addListener(new BaseItemListenerAdapter() {
- public void onClick(final BaseItem item, final EventObject e) {
- DeferredCommand.addCommand(new Command() {
- public void execute() {
- actionManagerProvider.get().doAction(action, stateToken);
+ private void createItemMenu(final String nodeId, final ActionCollection<StateToken> actionCollection,
+ final StateToken stateToken) {
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ Menu menu = null;
+ if (actionCollection != null) {
+ menu = new Menu();
+ // Remove if when retrieved rights of siblings
+ for (final ActionDescriptor<StateToken> action : actionCollection) {
+ final Item item = new Item(action.getText());
+ item.setIcon(action.getIconUrl());
+ menu.addItem(item);
+ item.addListener(new BaseItemListenerAdapter() {
+ public void onClick(final BaseItem item, final EventObject e) {
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ actionManagerProvider.get().doAction(action, stateToken);
+ }
+ });
}
});
}
- });
+ }
+ contextMenus.put(nodeId, menu);
}
- return menu;
- }
- return null;
+ });
}
private Menu createToolbarMenu(final Toolbar bar, final String iconUrl, final String menuTitle) {
@@ -236,20 +252,10 @@
treePanel.setRootNode(root);
final TextField field = new TextField();
treeEditor = new TreeEditor(treePanel, field);
- treeEditor.addListener(new EditorListenerAdapter() {
- // public boolean doBeforeComplete(final Editor source, final Object
- // value, final Object startValue) {
- // return false;
- // }
-
- public void onComplete(final Editor source, final Object value, final Object startValue) {
- // TODO Auto-generated method stub
- }
- });
- final Panel panel = new Panel();
- panel.setBorder(false);
- panel.add(treePanel);
- ws.getEntityWorkspace().setContext(panel);
+ // final Panel panel = new Panel();
+ // panel.setBorder(false);
+ // panel.add(treePanel);
+ ws.getEntityWorkspace().setContext(treePanel);
}
private void doAction(final ActionDescriptor<StateToken> action, final StateToken stateToken) {
@@ -264,6 +270,10 @@
return node;
}
+ private String getToken(final Node node) {
+ return node.getAttribute("href").substring(1);
+ }
+
private void setToolbarActions(final Toolbar toolBar, final StateToken stateToken,
final ActionCollection<StateToken> actions) {
toolBar.removeAll();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java 2008-09-10 04:51:49 UTC (rev 866)
@@ -34,17 +34,18 @@
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.workspace.client.title.EntityTitle;
import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Slot;
import com.calclab.suco.client.signal.Slot0;
import com.calclab.suco.client.signal.Slot2;
+import com.google.gwt.user.client.rpc.AsyncCallback;
public class ContextNavigatorPresenter implements ContextNavigator {
@@ -57,13 +58,16 @@
private final ArrayList<String> draggables;
private final ArrayList<String> droppables;
private final HashMap<String, String> contentTypesIcons;
+ private final EntityTitle entityTitle;
public ContextNavigatorPresenter(final StateManager stateManager, final Session session,
- final Provider<ContentServiceAsync> contentServiceProvider, final I18nUITranslationService i18n) {
+ final Provider<ContentServiceAsync> contentServiceProvider, final I18nUITranslationService i18n,
+ final EntityTitle entityTitle) {
this.stateManager = stateManager;
this.session = session;
this.contentServiceProvider = contentServiceProvider;
this.i18n = i18n;
+ this.entityTitle = entityTitle;
actions = new HashMap<String, ActionCollection<StateToken>>();
draggables = new ArrayList<String>();
droppables = new ArrayList<String>();
@@ -115,16 +119,27 @@
});
}
- public void onTitleRename(final String newName, final String token) {
- Site.showProgressSaving();
- final StateDTO currentState = session.getCurrentState();
- contentServiceProvider.get().rename(session.getUserHash(), currentState.getGroup().getShortName(), token,
- newName, new AsyncCallbackSimple<String>() {
- public void onSuccess(final String result) {
- stateManager.reloadContextAndTitles();
- Site.hideProgress();
- }
- });
+ public void onItemRename(final String token, final String newName, final String oldName) {
+ if (!newName.equals(oldName)) {
+ Site.showProgress(i18n.t("Renaming"));
+ final StateDTO currentState = session.getCurrentState();
+ contentServiceProvider.get().rename(session.getUserHash(), currentState.getGroup().getShortName(), token,
+ newName, new AsyncCallback<String>() {
+ public void onFailure(final Throwable caught) {
+ view.setItemText(genId(new StateToken(token)), oldName);
+ Site.error(i18n.t("Error renaming"));
+ Site.hideProgress();
+ }
+
+ public void onSuccess(final String result) {
+ Site.hideProgress();
+ if (session.getCurrentState().getStateToken().getEncoded().equals(token)) {
+ // I have to update EntityTitle
+ entityTitle.setContentTitle(newName);
+ }
+ }
+ });
+ }
}
public void registerContentTypeIcon(final String contentTypeId, final String iconUrl) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorView.java 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorView.java 2008-09-10 04:51:49 UTC (rev 866)
@@ -36,6 +36,8 @@
void setBottomActions(StateToken stateToken, ActionCollection<StateToken> actions);
+ void setItemText(String genId, String text);
+
void setRootItem(String id, String text, StateToken stateToken);
void setTopActions(StateToken stateToken, ActionCollection<StateToken> actions);
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitle.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitle.java 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitle.java 2008-09-10 04:51:49 UTC (rev 866)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.workspace.client.title;
+
+public interface EntitySubTitle {
+
+ void setContentLanguage(String langName);
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePresenter.java 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePresenter.java 2008-09-10 04:51:49 UTC (rev 866)
@@ -27,7 +27,7 @@
import com.calclab.suco.client.signal.Slot;
-public class EntitySubTitlePresenter {
+public class EntitySubTitlePresenter implements EntitySubTitle {
private EntitySubTitleView view;
private final I18nTranslationService i18n;
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitle.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitle.java 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitle.java 2008-09-10 04:51:49 UTC (rev 866)
@@ -0,0 +1,11 @@
+package org.ourproject.kune.workspace.client.title;
+
+import java.util.Date;
+
+public interface EntityTitle {
+
+ void setContentDate(Date publishedOn);
+
+ void setContentTitle(String title);
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java 2008-09-10 04:51:49 UTC (rev 866)
@@ -36,7 +36,7 @@
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.user.client.rpc.AsyncCallback;
-public class EntityTitlePresenter {
+public class EntityTitlePresenter implements EntityTitle {
private EntityTitleView view;
private final I18nTranslationService i18n;
@@ -68,7 +68,24 @@
this.view = view;
}
- public void onTitleRename(final String newName) {
+ public void setContentDate(final Date publishedOn) {
+ final DateTimeFormat fmt = DateTimeFormat.getFormat("MM/dd/yyyy, Z");
+ view.setContentDate(i18n.t("Published on: [%s]", fmt.format(publishedOn)));
+ }
+
+ /**
+ * Used renaming from context
+ */
+ public void setContentTitle(final String title) {
+ view.setContentTitle(title);
+ }
+
+ public void setContentTitle(final String title, final boolean editable) {
+ setContentTitle(title);
+ view.setContentTitleEditable(editable);
+ }
+
+ protected void onTitleRename(final String newName) {
Site.showProgressSaving();
final StateDTO currentState = session.getCurrentState();
contentServiceProvider.get().rename(session.getUserHash(), currentState.getGroup().getShortName(),
@@ -87,20 +104,10 @@
Site.hideProgress();
}
- public void setContentDate(final Date publishedOn) {
- final DateTimeFormat fmt = DateTimeFormat.getFormat("MM/dd/yyyy, Z");
- view.setContentDate(i18n.t("Published on: [%s]", fmt.format(publishedOn)));
- }
-
private void setContentDateVisible(final boolean visible) {
view.setDateVisible(visible);
}
- private void setContentTitle(final String title, final boolean editable) {
- view.setContentTitle(title);
- view.setContentTitleEditable(editable);
- }
-
private void setState(final StateDTO state) {
if (state.hasDocument()) {
setContentTitle(state.getTitle(), state.getContentRights().isEditable());
Modified: trunk/src/main/resources/META-INF/persistence.xml
===================================================================
--- trunk/src/main/resources/META-INF/persistence.xml 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/resources/META-INF/persistence.xml 2008-09-10 04:51:49 UTC (rev 866)
@@ -30,7 +30,7 @@
<property name="hibernate.search.default.directory_provider"
value="org.hibernate.search.store.FSDirectoryProvider" />
<property name="hibernate.search.default.indexBase"
- value="/var/lib/lucene/kune_dev/indexes" />
+ value="/var/lib/kune/lucene/kune_dev/indexes" />
</properties>
</persistence-unit>
@@ -59,7 +59,7 @@
<property name="hibernate.search.default.directory_provider"
value="org.hibernate.search.store.FSDirectoryProvider" />
<property name="hibernate.search.default.indexBase"
- value="/var/lib/lucene/kune_test/indexes" />
+ value="/var/lib/kune/lucene/kune_test/indexes" />
</properties>
</persistence-unit>
Modified: trunk/src/main/resources/kune.properties
===================================================================
--- trunk/src/main/resources/kune.properties 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/resources/kune.properties 2008-09-10 04:51:49 UTC (rev 866)
@@ -22,4 +22,8 @@
kune.wsthemes = default,green,blue,grey,purple,red
kune.wsthemes.default = default
-kune.sitelogourl = images/kune-logo-16px.png
\ No newline at end of file
+kune.sitelogourl = images/kune-logo-16px.png
+
+kune.upload.location = /var/lib/kune/upload/
+kune.upload.gallerypermittedextensions = jpg,jpeg,png,gif,bmp,svg,avi,mpg,mpeg,ogg,mov
+kune.upload.maxfilesizeinmegas = 10
Modified: trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/src/main/webapp/WEB-INF/web.xml 2008-09-09 18:00:21 UTC (rev 865)
+++ trunk/src/main/webapp/WEB-INF/web.xml 2008-09-10 04:51:49 UTC (rev 866)
@@ -46,10 +46,22 @@
<url-pattern>/http-bind/</url-pattern>
</servlet-mapping>
- <!-- Change the servlet name and mapping with appropriate name and URL pattern respectively -->
<servlet>
<servlet-name>FileUploadService</servlet-name>
<servlet-class>
+ org.ourproject.kune.platf.server.manager.impl.FileUploadManagerRevisited
+ </servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>FileUploadService</servlet-name>
+ <url-pattern>/services/fileupload</url-pattern>
+ </servlet-mapping>
+
+ <!-- Change the servlet name and mapping with appropriate name and URL pattern respectively -->
+ <servlet>
+ <servlet-name>FileUploadServiceOld</servlet-name>
+ <servlet-class>
org.cafesip.gwtcomp.server.FileUploadServlet
</servlet-class>
@@ -64,8 +76,8 @@
</servlet>
<servlet-mapping>
- <servlet-name>FileUploadService</servlet-name>
- <url-pattern>/services/fileupload</url-pattern>
+ <servlet-name>FileUploadServiceOld</servlet-name>
+ <url-pattern>/services/fileuploadold</url-pattern>
</servlet-mapping>
</web-app>
More information about the kune-commits
mailing list