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
September 2008
- 2 participants
- 54 discussions
Author: vjrj
Date: 2008-09-12 10:06:29 +0200 (Fri, 12 Sep 2008)
New Revision: 867
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContainerSimpleDTO.java
Removed:
trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContainerSimpleDTO.java
Modified:
trunk/img/nav-icons/upload.gif
trunk/img/nav-icons/upload.png
trunk/pom.xml
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContainerDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContentDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContentStatusDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateToken.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/public/images/nav/upload.gif
trunk/src/main/java/org/ourproject/kune/platf/public/images/nav/upload.png
trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java
trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManager.java
trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/domain/Container.java
trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java
trunk/src/main/java/org/ourproject/kune/platf/server/domain/HasStateToken.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java
trunk/src/main/java/org/ourproject/kune/platf/server/state/State.java
trunk/src/main/java/org/ourproject/kune/platf/server/state/StateServiceDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfoServiceDefault.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/resources/dozerBeanMapping.xml
trunk/src/test/java/org/ourproject/kune/platf/client/state/StateTokenTest.java
trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceAddTest.java
trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceGetTest.java
trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceVariousTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java
Log:
More context adjusts
Modified: trunk/img/nav-icons/upload.gif
===================================================================
(Binary files differ)
Modified: trunk/img/nav-icons/upload.png
===================================================================
(Binary files differ)
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/pom.xml 2008-09-12 08:06:29 UTC (rev 867)
@@ -54,7 +54,7 @@
<dependency>
<groupId>com.gwtextux</groupId>
<artifactId>gwtextux</artifactId>
- <version>0.3.0</version>
+ <version>0.3.0b</version>
</dependency>
<dependency>
<groupId>com.allen_sauer.gwt.log.gwt-log</groupId>
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -153,7 +153,7 @@
session.getCurrentState().getGroup().getShortName(), token.getDocument(),
new AsyncCallbackSimple<String>() {
public void onSuccess(final String result) {
- final StateToken parent = token.clone().setDocument(null);
+ final StateToken parent = token.clone().clearDocument();
stateManager.gotoToken(parent);
}
});
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContainerDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContainerDTO.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContainerDTO.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -25,71 +25,80 @@
import com.google.gwt.user.client.rpc.IsSerializable;
public class ContainerDTO implements IsSerializable {
- private Long parentFolderId;
private Long id;
private String name;
+ private String typeId;
+ private StateToken stateToken;
+ private Long parentFolderId;
private ContainerSimpleDTO[] absolutePath;
- private String typeId;
- private List<ContainerDTO> childs;
+ private List<ContainerSimpleDTO> childs;
private List<ContentDTO> contents;
public ContainerDTO() {
}
- public Long getParentFolderId() {
- return parentFolderId;
+ public ContainerSimpleDTO[] getAbsolutePath() {
+ return absolutePath;
}
- public void setParentFolderId(final Long parentFolderId) {
- this.parentFolderId = parentFolderId;
+ public List<ContainerSimpleDTO> getChilds() {
+ return childs;
}
+ public List<ContentDTO> getContents() {
+ return contents;
+ }
+
public Long getId() {
- return id;
+ return id;
}
public String getName() {
- return name;
+ return name;
}
- public void setName(final String name) {
- this.name = name;
+ public Long getParentFolderId() {
+ return parentFolderId;
}
- public ContainerSimpleDTO[] getAbsolutePath() {
- return absolutePath;
+ public StateToken getStateToken() {
+ return stateToken;
}
+ public String getTypeId() {
+ return typeId;
+ }
+
public void setAbsolutePath(final ContainerSimpleDTO[] absolutePath) {
- this.absolutePath = absolutePath;
+ this.absolutePath = absolutePath;
}
- public void setId(final Long id) {
- this.id = id;
+ public void setChilds(final List<ContainerSimpleDTO> childs) {
+ this.childs = childs;
}
- public List<ContainerDTO> getChilds() {
- return childs;
+ public void setContents(final List<ContentDTO> contents) {
+ this.contents = contents;
}
- public void setChilds(final List<ContainerDTO> childs) {
- this.childs = childs;
+ public void setId(final Long id) {
+ this.id = id;
}
- public List<ContentDTO> getContents() {
- return contents;
+ public void setName(final String name) {
+ this.name = name;
}
- public void setContents(final List<ContentDTO> contents) {
- this.contents = contents;
+ public void setParentFolderId(final Long parentFolderId) {
+ this.parentFolderId = parentFolderId;
}
- public String getTypeId() {
- return typeId;
+ public void setStateToken(final StateToken stateToken) {
+ this.stateToken = stateToken;
}
public void setTypeId(final String typeId) {
- this.typeId = typeId;
+ this.typeId = typeId;
}
}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContainerSimpleDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContainerSimpleDTO.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContainerSimpleDTO.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -1,66 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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 org.ourproject.kune.platf.client.dto;
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-public class ContainerSimpleDTO implements IsSerializable {
- private Long parentFolderId;
- private Long id;
- private String name;
- private String typeId;
-
- public ContainerSimpleDTO() {
- }
-
- public Long getParentFolderId() {
- return parentFolderId;
- }
-
- public void setParentFolderId(final Long parentFolderId) {
- this.parentFolderId = parentFolderId;
- }
-
- public Long getId() {
- return id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- public void setId(final Long id) {
- this.id = id;
- }
-
- public String getTypeId() {
- return typeId;
- }
-
- public void setTypeId(final String typeId) {
- this.typeId = typeId;
- }
-
-}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContainerSimpleDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContainerSimpleDTO.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContainerSimpleDTO.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -0,0 +1,79 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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 org.ourproject.kune.platf.client.dto;
+
+import com.google.gwt.user.client.rpc.IsSerializable;
+
+/**
+ * A item can be both a container or a content
+ *
+ */
+public class ContainerSimpleDTO implements IsSerializable {
+ private Long id;
+ private String name;
+ private String typeId;
+ private StateToken stateToken;
+ private Long parentFolderId;
+
+ public ContainerSimpleDTO() {
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public Long getParentFolderId() {
+ return parentFolderId;
+ }
+
+ public StateToken getStateToken() {
+ return stateToken;
+ }
+
+ public String getTypeId() {
+ return typeId;
+ }
+
+ public void setId(final Long id) {
+ this.id = id;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ public void setParentFolderId(final Long parentFolderId) {
+ this.parentFolderId = parentFolderId;
+ }
+
+ public void setStateToken(final StateToken stateToken) {
+ this.stateToken = stateToken;
+ }
+
+ public void setTypeId(final String typeId) {
+ this.typeId = typeId;
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContentDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContentDTO.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContentDTO.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -27,29 +27,56 @@
private Long id;
private String title;
private String typeId;
+ private StateToken stateToken;
+ private ContentStatusDTO status;
+ private AccessRightsDTO rights;
public Long getId() {
- return id;
+ return id;
}
- public void setId(final Long id) {
- this.id = id;
+ public AccessRightsDTO getRights() {
+ return rights;
}
- public String getTitle() {
- return title;
+ public StateToken getStateToken() {
+ return stateToken;
}
- public void setTitle(final String title) {
- this.title = title;
+ public ContentStatusDTO getStatus() {
+ return status;
}
+ public String getTitle() {
+ return title;
+ }
+
public String getTypeId() {
- return typeId;
+ return typeId;
}
+ public void setId(final Long id) {
+ this.id = id;
+ }
+
+ public void setRights(final AccessRightsDTO rights) {
+ this.rights = rights;
+ }
+
+ public void setStateToken(final StateToken stateToken) {
+ this.stateToken = stateToken;
+ }
+
+ public void setStatus(final ContentStatusDTO status) {
+ this.status = status;
+ }
+
+ public void setTitle(final String title) {
+ this.title = title;
+ }
+
public void setTypeId(final String typeId) {
- this.typeId = typeId;
+ this.typeId = typeId;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContentStatusDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContentStatusDTO.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContentStatusDTO.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -1,5 +1,7 @@
package org.ourproject.kune.platf.client.dto;
-public enum ContentStatusDTO {
- publicVisible, nonPublicVisible, markForDelection
+import com.google.gwt.user.client.rpc.IsSerializable;
+
+public enum ContentStatusDTO implements IsSerializable {
+ editingInProgress, submittedForEvaluation, publishedOnline, rejected, inTheDustbin
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateDTO.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateDTO.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -38,6 +38,7 @@
private AccessRightsDTO contentRights;
private AccessRightsDTO folderRights;
private AccessRightsDTO groupRights;
+ private ContentStatusDTO status;
private boolean isRateable;
private Double rate;
private Integer rateByUsers;
@@ -51,224 +52,237 @@
private List<TagResultDTO> groupTags;
private SocialNetworkDTO groupMembers;
private ParticipationDataDTO participation;
+ private StateToken stateToken;
public StateDTO() {
- this(null, null, null);
+ this(null, null, null);
}
public StateDTO(final String docRef, final String title, final String content) {
- this.documentId = docRef;
- this.title = title;
- this.content = content;
+ this.documentId = docRef;
+ this.title = title;
+ this.content = content;
}
- public int getVersion() {
- return version;
+ public AccessListsDTO getAccessLists() {
+ return accessLists;
}
- public void setVersion(final int version) {
- this.version = version;
+ public List<UserSimpleDTO> getAuthors() {
+ return authors;
}
- public void setDocumentId(final String docRef) {
- this.documentId = docRef;
+ public String getContent() {
+ return content;
}
- public void setContent(final String content) {
- this.content = content;
+ public AccessRightsDTO getContentRights() {
+ return this.contentRights;
}
+ public Double getCurrentUserRate() {
+ return currentUserRate;
+ }
+
public String getDocumentId() {
- return documentId;
+ return documentId;
}
- public String getContent() {
- return content;
+ public ContainerDTO getFolder() {
+ return folder;
}
- public String getTitle() {
- return title;
+ public AccessRightsDTO getFolderRights() {
+ return folderRights;
}
- public void setTitle(final String title) {
- this.title = title;
+ public GroupDTO getGroup() {
+ return this.group;
}
- public String getToolName() {
- return toolName;
+ public SocialNetworkDTO getGroupMembers() {
+ return groupMembers;
}
- public void setToolName(final String toolName) {
- this.toolName = toolName;
+ public AccessRightsDTO getGroupRights() {
+ return groupRights;
}
- public GroupDTO getGroup() {
- return this.group;
+ public List<TagResultDTO> getGroupTags() {
+ return groupTags;
}
- public void setGroup(final GroupDTO group) {
- this.group = group;
+ public I18nLanguageDTO getLanguage() {
+ return language;
}
- public AccessRightsDTO getContentRights() {
- return this.contentRights;
+ public LicenseDTO getLicense() {
+ return license;
}
- public void setContentRights(final AccessRightsDTO accessRights) {
- this.contentRights = accessRights;
+ public ParticipationDataDTO getParticipation() {
+ return participation;
}
- public ContainerDTO getFolder() {
- return folder;
+ public Date getPublishedOn() {
+ return publishedOn;
}
- public void setFolder(final ContainerDTO folder) {
- this.folder = folder;
+ public Double getRate() {
+ return rate;
}
- public StateToken getStateToken() {
- return new StateToken(group.getShortName(), toolName, folder.getId().toString(), getDocumentId());
+ public Integer getRateByUsers() {
+ return rateByUsers;
}
- // FIXME: maybe a tag in the content showing the type, think about this
- public boolean hasDocument() {
- return documentId != null;
+ public SocialNetworkDTO getSocialNetwork() {
+ return socialNetwork;
}
- public AccessListsDTO getAccessLists() {
- return accessLists;
+ public StateToken getStateToken() {
+ return stateToken;
}
- public void setAccessLists(final AccessListsDTO accessLists) {
- this.accessLists = accessLists;
+ public ContentStatusDTO getStatus() {
+ return status;
}
- public Double getRate() {
- return rate;
+ public String getTags() {
+ return tags;
}
- public void setRate(final Double rate) {
- this.rate = rate;
+ public String getTitle() {
+ return title;
}
- public Integer getRateByUsers() {
- return rateByUsers;
+ public String getToolName() {
+ return toolName;
}
- public void setRateByUsers(final Integer rateByUsers) {
- this.rateByUsers = rateByUsers;
+ public String getTypeId() {
+ return typeId;
}
- public AccessRightsDTO getFolderRights() {
- return folderRights;
+ public int getVersion() {
+ return version;
}
- public void setFolderRights(final AccessRightsDTO folderRights) {
- this.folderRights = folderRights;
+ // FIXME: maybe a tag in the content showing the type, think about this
+ public boolean hasDocument() {
+ return documentId != null;
}
- public String getTypeId() {
- return typeId;
+ public boolean isRateable() {
+ return isRateable;
}
- public void setTypeId(final String typeId) {
- this.typeId = typeId;
+ public void setAccessLists(final AccessListsDTO accessLists) {
+ this.accessLists = accessLists;
}
- public LicenseDTO getLicense() {
- return license;
+ public void setAuthors(final List<UserSimpleDTO> authors) {
+ this.authors = authors;
}
- public void setLicense(final LicenseDTO license) {
- this.license = license;
+ public void setContent(final String content) {
+ this.content = content;
}
- public SocialNetworkDTO getSocialNetwork() {
- return socialNetwork;
+ public void setContentRights(final AccessRightsDTO accessRights) {
+ this.contentRights = accessRights;
}
- public void setSocialNetwork(final SocialNetworkDTO socialNetwork) {
- this.socialNetwork = socialNetwork;
+ public void setCurrentUserRate(final Double currentUserRate) {
+ this.currentUserRate = currentUserRate;
}
- public AccessRightsDTO getGroupRights() {
- return groupRights;
+ public void setDocumentId(final String docRef) {
+ this.documentId = docRef;
}
- public void setGroupRights(final AccessRightsDTO groupRights) {
- this.groupRights = groupRights;
+ public void setFolder(final ContainerDTO folder) {
+ this.folder = folder;
}
- public Double getCurrentUserRate() {
- return currentUserRate;
+ public void setFolderRights(final AccessRightsDTO folderRights) {
+ this.folderRights = folderRights;
}
- public void setCurrentUserRate(final Double currentUserRate) {
- this.currentUserRate = currentUserRate;
+ public void setGroup(final GroupDTO group) {
+ this.group = group;
}
- public boolean isRateable() {
- return isRateable;
+ public void setGroupMembers(final SocialNetworkDTO groupMembers) {
+ this.groupMembers = groupMembers;
}
- public void setRateable(final boolean isRateable) {
- this.isRateable = isRateable;
+ public void setGroupRights(final AccessRightsDTO groupRights) {
+ this.groupRights = groupRights;
}
- public I18nLanguageDTO getLanguage() {
- return language;
+ public void setGroupTags(final List<TagResultDTO> groupTags) {
+ this.groupTags = groupTags;
}
public void setLanguage(final I18nLanguageDTO language) {
- this.language = language;
+ this.language = language;
}
- public Date getPublishedOn() {
- return publishedOn;
+ public void setLicense(final LicenseDTO license) {
+ this.license = license;
}
+ public void setParticipation(final ParticipationDataDTO participation) {
+ this.participation = participation;
+ }
+
public void setPublishedOn(final Date publishedOn) {
- this.publishedOn = publishedOn;
+ this.publishedOn = publishedOn;
}
- public List<UserSimpleDTO> getAuthors() {
- return authors;
+ public void setRate(final Double rate) {
+ this.rate = rate;
}
- public void setAuthors(final List<UserSimpleDTO> authors) {
- this.authors = authors;
+ public void setRateable(final boolean isRateable) {
+ this.isRateable = isRateable;
}
- public String getTags() {
- return tags;
+ public void setRateByUsers(final Integer rateByUsers) {
+ this.rateByUsers = rateByUsers;
}
- public void setTags(final String tags) {
- this.tags = tags;
+ public void setSocialNetwork(final SocialNetworkDTO socialNetwork) {
+ this.socialNetwork = socialNetwork;
}
- public List<TagResultDTO> getGroupTags() {
- return groupTags;
+ public void setStateToken(final StateToken stateToken) {
+ this.stateToken = stateToken;
}
- public void setGroupTags(final List<TagResultDTO> groupTags) {
- this.groupTags = groupTags;
+ public void setStatus(final ContentStatusDTO status) {
+ this.status = status;
}
- public SocialNetworkDTO getGroupMembers() {
- return groupMembers;
+ public void setTags(final String tags) {
+ this.tags = tags;
}
- public void setGroupMembers(final SocialNetworkDTO groupMembers) {
- this.groupMembers = groupMembers;
+ public void setTitle(final String title) {
+ this.title = title;
}
- public ParticipationDataDTO getParticipation() {
- return participation;
+ public void setToolName(final String toolName) {
+ this.toolName = toolName;
}
- public void setParticipation(final ParticipationDataDTO participation) {
- this.participation = participation;
+ public void setTypeId(final String typeId) {
+ this.typeId = typeId;
}
+ public void setVersion(final int version) {
+ this.version = version;
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateToken.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateToken.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateToken.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -56,22 +56,17 @@
}
public StateToken(final String encoded) {
- String[] splitted;
- if (encoded != null && encoded.length() > 0) {
- splitted = encoded.split("\\.");
- } else {
- splitted = EMPTY;
- }
- setGroup(conditionalAssign(0, splitted));
- setTool(conditionalAssign(1, splitted));
- setFolder(conditionalAssign(2, splitted));
- setDocument(conditionalAssign(3, splitted));
+ parse(encoded);
}
public StateToken(final String group, final String tool) {
this(group, tool, null, null);
}
+ public StateToken(final String group, final String tool, final Long folder) {
+ this(group, tool, folder == null ? null : folder.toString(), null);
+ }
+
public StateToken(final String group, final String tool, final String folder, final String document) {
this.setGroup(group);
this.setTool(tool);
@@ -80,10 +75,41 @@
encoded = null;
}
+ public StateToken clearDocument() {
+ this.document = null;
+ encoded = null;
+ return this;
+ }
+
+ public StateToken clearFolder() {
+ this.folder = null;
+ encoded = null;
+ return this;
+ }
+
public StateToken clone() {
return new StateToken(this.getEncoded());
}
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ final StateToken other = (StateToken) obj;
+ if (getEncoded() == null) {
+ if (other.getEncoded() != null) {
+ return false;
+ }
+ } else if (!getEncoded().equals(other.getEncoded())) {
+ return false;
+ }
+ return true;
+ }
+
public String getDocument() {
return document;
}
@@ -159,12 +185,28 @@
return getDocument() != null;
}
+ public StateToken setDocument(final Long document) {
+ this.document = document == null ? null : document.toString();
+ encoded = null;
+ return this;
+ }
+
public StateToken setDocument(final String document) {
this.document = document;
encoded = null;
return this;
}
+ public void setEncoded(final String encoded) {
+ parse(encoded);
+ }
+
+ public StateToken setFolder(final Long folder) {
+ this.folder = folder == null ? null : folder.toString();
+ encoded = null;
+ return this;
+ }
+
public StateToken setFolder(final String folder) {
this.folder = folder;
encoded = null;
@@ -194,4 +236,18 @@
return null;
}
}
+
+ private void parse(final String encoded) {
+ String[] splitted;
+ if (encoded != null && encoded.length() > 0) {
+ splitted = encoded.split("\\.");
+ } else {
+ splitted = EMPTY;
+ }
+ setGroup(conditionalAssign(0, splitted));
+ setTool(conditionalAssign(1, splitted));
+ setFolder(conditionalAssign(2, splitted));
+ setDocument(conditionalAssign(3, splitted));
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -78,8 +78,8 @@
}
public void gotoContainer(final Long containerId) {
- final StateToken newStateToken = session.getCurrentState().getStateToken();
- newStateToken.setDocument(null);
+ final StateToken newStateToken = session.getCurrentState().getStateToken().clone();
+ newStateToken.clearDocument();
newStateToken.setFolder(containerId.toString());
gotoToken(newStateToken);
}
@@ -203,9 +203,9 @@
private void onHistoryChanged(final StateToken newState) {
contentProvider.getContent(session.getUserHash(), newState, new AsyncCallbackSimple<StateDTO>() {
public void onSuccess(final StateDTO newState) {
+ loadContent(newState);
session.setCurrent(newState);
checkGroupAndToolChange(oldState, newState);
- loadContent(newState);
oldState = newState;
}
});
Modified: trunk/src/main/java/org/ourproject/kune/platf/public/images/nav/upload.gif
===================================================================
(Binary files differ)
Modified: trunk/src/main/java/org/ourproject/kune/platf/public/images/nav/upload.png
===================================================================
(Binary files differ)
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-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/PlatformServerModule.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -54,6 +54,7 @@
import org.ourproject.kune.platf.server.content.CreationService;
import org.ourproject.kune.platf.server.content.CreationServiceDefault;
import org.ourproject.kune.platf.server.i18n.I18nTranslationServiceDefault;
+import org.ourproject.kune.platf.server.manager.FileManager;
import org.ourproject.kune.platf.server.manager.GroupManager;
import org.ourproject.kune.platf.server.manager.I18nCountryManager;
import org.ourproject.kune.platf.server.manager.I18nLanguageManager;
@@ -64,6 +65,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.FileManagerDefault;
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;
@@ -133,6 +135,7 @@
bind(I18nTranslationManager.class).to(I18nTranslationManagerDefault.class);
bind(TagManager.class).to(TagManagerDefault.class);
bind(CommentManager.class).to(CommentManagerDefault.class);
+ bind(FileManager.class).to(FileManagerDefault.class);
}
private void bindRPC() {
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManager.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManager.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -34,7 +34,7 @@
public void addAuthor(User user, Long contentId, String authorShortName) throws DefaultException;
- public Content createContent(String title, String body, User user, Container container);
+ public Content createContent(String title, String body, User author, Container container);
public void delContent(User user, Long contentId) throws DefaultException;
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/content/ContentManagerDefault.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -38,6 +38,7 @@
import org.ourproject.kune.platf.server.access.FinderService;
import org.ourproject.kune.platf.server.domain.Container;
import org.ourproject.kune.platf.server.domain.Content;
+import org.ourproject.kune.platf.server.domain.ContentStatus;
import org.ourproject.kune.platf.server.domain.I18nLanguage;
import org.ourproject.kune.platf.server.domain.Rate;
import org.ourproject.kune.platf.server.domain.Revision;
@@ -78,14 +79,14 @@
content.addAuthor(author);
}
- public Content createContent(final String title, final String body, final User user, final Container container) {
+ public Content createContent(final String title, final String body, final User author, final Container container) {
final Content descriptor = new Content();
- descriptor.addAuthor(user);
- descriptor.setLanguage(user.getLanguage());
+ descriptor.addAuthor(author);
+ descriptor.setLanguage(author.getLanguage());
// FIXME: remove this when UI take publishing into account
descriptor.setPublishedOn(new Date());
+ container.addContent(descriptor);
descriptor.setContainer(container);
- container.addContent(descriptor);
final Revision revision = new Revision(descriptor);
revision.setTitle(title);
revision.setBody(body);
@@ -95,9 +96,8 @@
public void delContent(final User user, final Long contentId) throws DefaultException {
final Content content = finder.getContent(contentId);
- content.setMarkForDeletion(true);
+ content.setStatus(ContentStatus.inTheDustbin);
content.setDeletedOn(new Date());
- // FIXME: Maybe set only visible for admins
}
public Double getRateAvg(final Content content) {
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/Container.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/Container.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/Container.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -45,11 +45,12 @@
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.IndexedEmbedded;
import org.hibernate.search.annotations.Store;
+import org.ourproject.kune.platf.client.dto.StateToken;
@Entity
@Indexed
@Table(name = "containers")
-public class Container implements HasId {
+public class Container implements HasId, HasStateToken {
@Id
@GeneratedValue
@DocumentId
@@ -89,140 +90,150 @@
@OneToMany(cascade = CascadeType.ALL)
private List<ContainerTranslation> containerTranslations;
- public Container(final String title, final Group group, final String toolName) {
- this.name = title;
- owner = group;
- this.toolName = toolName;
- this.contents = new HashSet<Content>();
- this.childs = new HashSet<Container>();
- this.absolutePath = new ArrayList<Container>();
- }
-
public Container() {
- this(null, null, null);
+ this(null, null, null);
}
- public String getName() {
- return name;
+ public Container(final String title, final Group group, final String toolName) {
+ this.name = title;
+ owner = group;
+ this.toolName = toolName;
+ this.contents = new HashSet<Content>();
+ this.childs = new HashSet<Container>();
+ this.absolutePath = new ArrayList<Container>();
}
- public void setName(final String name) {
- this.name = name;
+ public void addChild(final Container child) {
+ // childs.size();
+ // childs.add(container);
+ child.setParent(this);
+ childs.add(child);
}
- public Long getParentFolderId() {
- return parent != null ? parent.getId() : null;
+ public void addContent(final Content descriptor) {
+ // FIXME: something related with lazy initialization (workaround using
+ // size())
+ contents.size();
+ contents.add(descriptor);
}
- public Container getParent() {
- return parent;
+ public List<Container> getAbsolutePath() {
+ return absolutePath;
}
- public Long getId() {
- return id;
+ public List<ContainerTranslation> getAliases() {
+ return containerTranslations;
}
- public void setId(final Long id) {
- this.id = id;
+ public Set<Container> getChilds() {
+ return childs;
}
- public void setParent(final Container parent) {
- this.parent = parent;
+ public List<ContainerTranslation> getContainerTranslations() {
+ return containerTranslations;
}
- public Set<Container> getChilds() {
- return childs;
+ public Set<Content> getContents() {
+ return contents;
}
- public void setChilds(final Set<Container> childs) {
- this.childs = childs;
+ public Long getId() {
+ return id;
}
- public List<ContainerTranslation> getAliases() {
- return containerTranslations;
+ public I18nLanguage getLanguage() {
+ return language;
}
- public void setAliases(final List<ContainerTranslation> containerTranslations) {
- this.containerTranslations = containerTranslations;
+ public String getName() {
+ return name;
}
public Group getOwner() {
- return owner;
+ return owner;
}
- public void setOwner(final Group owner) {
- this.owner = owner;
+ public Container getParent() {
+ return parent;
}
- public String getToolName() {
- return toolName;
+ public Long getParentFolderId() {
+ return parent != null ? parent.getId() : null;
}
- public void setToolName(final String toolName) {
- this.toolName = toolName;
+ @Transient
+ public StateToken getStateToken() {
+ return new StateToken(getOwner().getShortName(), getToolName(), getId());
}
- public void addContent(final Content descriptor) {
- // FIXME: something related with lazy initialization (workaround using
- // size())
- contents.size();
- contents.add(descriptor);
+ @Transient
+ public String getStateTokenEncoded() {
+ return getStateToken().getEncoded();
}
- public String getTypeId() {
- return typeId;
+ public String getToolName() {
+ return toolName;
}
- public void setTypeId(final String typeId) {
- this.typeId = typeId;
+ public String getTypeId() {
+ return typeId;
}
- public Set<Content> getContents() {
- return contents;
+ @Transient
+ public boolean isLeaf() {
+ return childs.size() == 0 && contents.size() == 0;
}
- public void addChild(final Container child) {
- // childs.size();
- // childs.add(container);
- child.setParent(this);
- childs.add(child);
+ @Transient
+ public boolean isRoot() {
+ return parent == null;
}
- public I18nLanguage getLanguage() {
- return language;
+ public void setAbsolutePath(final List<Container> absolutePath) {
+ this.absolutePath = absolutePath;
}
- public void setLanguage(final I18nLanguage language) {
- this.language = language;
+ public void setAliases(final List<ContainerTranslation> containerTranslations) {
+ this.containerTranslations = containerTranslations;
}
- public List<ContainerTranslation> getContainerTranslations() {
- return containerTranslations;
+ public void setChilds(final Set<Container> childs) {
+ this.childs = childs;
}
public void setContainerTranslations(final List<ContainerTranslation> containerTranslations) {
- this.containerTranslations = containerTranslations;
+ this.containerTranslations = containerTranslations;
}
public void setContents(final HashSet<Content> contents) {
- this.contents = contents;
+ this.contents = contents;
}
- public List<Container> getAbsolutePath() {
- return absolutePath;
+ public void setId(final Long id) {
+ this.id = id;
}
- public void setAbsolutePath(final List<Container> absolutePath) {
- this.absolutePath = absolutePath;
+ public void setLanguage(final I18nLanguage language) {
+ this.language = language;
}
- @Transient
- public boolean isLeaf() {
- return childs.size() == 0 && contents.size() == 0;
+ public void setName(final String name) {
+ this.name = name;
}
- @Transient
- public boolean isRoot() {
- return parent == null;
+ public void setOwner(final Group owner) {
+ this.owner = owner;
}
+
+ public void setParent(final Container parent) {
+ this.parent = parent;
+ }
+
+ public void setToolName(final String toolName) {
+ this.toolName = toolName;
+ }
+
+ public void setTypeId(final String typeId) {
+ this.typeId = typeId;
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -29,7 +29,10 @@
import javax.persistence.Basic;
import javax.persistence.CascadeType;
+import javax.persistence.Column;
import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@@ -49,13 +52,13 @@
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.IndexedEmbedded;
import org.hibernate.validator.NotNull;
+import org.ourproject.kune.platf.client.dto.StateToken;
@Entity
@Table(name = "contents")
@Indexed
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class Content implements HasStateToken {
- private static final String TOKEN_SEPARATOR = ".";
@Id
@DocumentId
@@ -82,8 +85,6 @@
@Basic(optional = true)
private Date deletedOn;
- private boolean markForDeletion;
-
@Basic(optional = false)
private Date publishedOn;
@@ -113,199 +114,207 @@
@OneToMany(mappedBy = "content", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private Set<Comment> comments;
+ @Enumerated(EnumType.STRING)
+ @Column(nullable = false)
+ private ContentStatus status;
+
public Content() {
- translations = new ArrayList<ContentTranslation>();
- authors = new ArrayList<User>();
- tags = new ArrayList<Tag>();
- comments = new HashSet<Comment>();
- this.createdOn = System.currentTimeMillis();
- this.lastRevision = new Revision(this);
- accessLists = null;
- markForDeletion = false;
+ translations = new ArrayList<ContentTranslation>();
+ authors = new ArrayList<User>();
+ tags = new ArrayList<Tag>();
+ comments = new HashSet<Comment>();
+ this.createdOn = System.currentTimeMillis();
+ this.lastRevision = new Revision(this);
+ accessLists = null;
+ status = ContentStatus.publishedOnline;
}
- public Set<Comment> getComments() {
- return comments;
+ public void addAuthor(final User user) {
+ if (!this.authors.contains(user)) {
+ this.authors.add(user);
+ }
}
- public void setComments(final Set<Comment> comments) {
- this.comments = comments;
+ public void addComment(final Comment comment) {
+ // FIXME: something related with lazy initialization (workaround using
+ // size())
+ comments.size();
+ comments.add(comment);
}
- public void addComment(final Comment comment) {
- // FIXME: something related with lazy initialization (workaround using
- // size())
- comments.size();
- comments.add(comment);
+ public void addRevision(final Revision revision) {
+ if (lastRevision == null) {
+ lastRevision = revision;
+ } else {
+ revision.setPrevious(lastRevision);
+ lastRevision = revision;
+ }
}
- public Long getId() {
- return id;
+ public AccessLists getAccessLists() {
+ return accessLists;
}
- public void setId(final Long id) {
- this.id = id;
+ public List<User> getAuthors() {
+ return authors;
}
- public int getVersion() {
- return version;
+ public Set<Comment> getComments() {
+ return comments;
}
- public void setVersion(final int version) {
- this.version = version;
+ public Container getContainer() {
+ return container;
}
- public AccessLists getAccessLists() {
- return accessLists;
+ public Long getCreatedOn() {
+ return createdOn;
}
- public void setAccessLists(final AccessLists accessLists) {
- this.accessLists = accessLists;
+ public Date getDeletedOn() {
+ return deletedOn;
}
- public List<Tag> getTags() {
- return tags;
+ public Long getId() {
+ return id;
}
- public void setTags(final List<Tag> tags) {
- this.tags = tags;
+ public I18nLanguage getLanguage() {
+ return language;
}
+ public Revision getLastRevision() {
+ return lastRevision;
+ }
+
public License getLicense() {
- return license;
+ return license;
}
- public void setLicense(final License license) {
- this.license = license;
+ public Group getOwner(final Group group) {
+ return container.getOwner();
}
- public Revision getLastRevision() {
- return lastRevision;
+ public Date getPublishedOn() {
+ return publishedOn;
}
- public void setLastRevision(final Revision revision) {
- this.lastRevision = revision;
+ @Transient
+ public StateToken getStateToken() {
+ return getContainer().getStateToken().clone().setDocument(getId());
}
- public List<ContentTranslation> getTranslations() {
- return translations;
+ @Transient
+ public String getStateTokenEncoded() {
+ return getStateToken().getEncoded();
}
- public void setTranslations(final List<ContentTranslation> translations) {
- this.translations = translations;
+ public ContentStatus getStatus() {
+ return status;
}
- public Long getCreatedOn() {
- return createdOn;
+ public List<Tag> getTags() {
+ return tags;
}
- public void setCreatedOn(final Long createdOn) {
- this.createdOn = createdOn;
+ public String getTagsAsString() {
+ String tagConcatenated = "";
+ for (final Iterator<Tag> iterator = tags.iterator(); iterator.hasNext();) {
+ final Tag tag = iterator.next();
+ tagConcatenated = tagConcatenated + tag.getName();
+ if (iterator.hasNext()) {
+ tagConcatenated = tagConcatenated + " ";
+ }
+ }
+ return tagConcatenated;
}
- public Date getPublishedOn() {
- return publishedOn;
+ public String getTitle() {
+ return lastRevision.getTitle();
}
- public void setPublishedOn(final Date publishedOn) {
- this.publishedOn = publishedOn;
+ public List<ContentTranslation> getTranslations() {
+ return translations;
}
- public Container getContainer() {
- return container;
+ public String getTypeId() {
+ return typeId;
}
- public void setContainer(final Container container) {
- this.container = container;
+ public int getVersion() {
+ return version;
}
- public void addRevision(final Revision revision) {
- if (lastRevision == null) {
- lastRevision = revision;
- } else {
- revision.setPrevious(lastRevision);
- lastRevision = revision;
- }
+ public boolean hasAccessList() {
+ return accessLists != null;
}
- public String getTitle() {
- return lastRevision.getTitle();
+ public void removeAuthor(final User user) {
+ this.authors.remove(user);
}
- public String getTypeId() {
- return typeId;
+ public void setAccessLists(final AccessLists accessLists) {
+ this.accessLists = accessLists;
}
- public void setTypeId(final String typeId) {
- this.typeId = typeId;
+ public void setAuthors(final List<User> authors) {
+ this.authors = authors;
}
- public boolean hasAccessList() {
- return accessLists != null;
+ public void setComments(final Set<Comment> comments) {
+ this.comments = comments;
}
- public I18nLanguage getLanguage() {
- return language;
+ public void setContainer(final Container container) {
+ this.container = container;
}
- public void setLanguage(final I18nLanguage language) {
- this.language = language;
+ public void setCreatedOn(final Long createdOn) {
+ this.createdOn = createdOn;
}
- @Transient
- public String getStateToken() {
- return getContainer().getOwner().getShortName() + TOKEN_SEPARATOR + getContainer().getToolName()
- + TOKEN_SEPARATOR + getContainer().getId() + TOKEN_SEPARATOR + getId();
+ public void setDeletedOn(final Date date) {
+ this.deletedOn = date;
}
- public List<User> getAuthors() {
- return authors;
+ public void setId(final Long id) {
+ this.id = id;
}
- public void setAuthors(final List<User> authors) {
- this.authors = authors;
+ public void setLanguage(final I18nLanguage language) {
+ this.language = language;
}
- public void addAuthor(final User user) {
- if (!this.authors.contains(user)) {
- this.authors.add(user);
- }
+ public void setLastRevision(final Revision revision) {
+ this.lastRevision = revision;
}
- public void removeAuthor(final User user) {
- this.authors.remove(user);
+ public void setLicense(final License license) {
+ this.license = license;
}
- public String getTagsAsString() {
- String tagConcatenated = "";
- for (Iterator<Tag> iterator = tags.iterator(); iterator.hasNext();) {
- Tag tag = iterator.next();
- tagConcatenated = tagConcatenated + tag.getName();
- if (iterator.hasNext()) {
- tagConcatenated = tagConcatenated + " ";
- }
- }
- return tagConcatenated;
+ public void setPublishedOn(final Date publishedOn) {
+ this.publishedOn = publishedOn;
}
- public Date getDeletedOn() {
- return deletedOn;
+ public void setStatus(final ContentStatus status) {
+ this.status = status;
}
- public void setDeletedOn(final Date date) {
- this.deletedOn = date;
+ public void setTags(final List<Tag> tags) {
+ this.tags = tags;
}
- public boolean isMarkForDeletion() {
- return markForDeletion;
+ public void setTranslations(final List<ContentTranslation> translations) {
+ this.translations = translations;
}
- public void setMarkForDeletion(final boolean markForDeletion) {
- this.markForDeletion = markForDeletion;
+ public void setTypeId(final String typeId) {
+ this.typeId = typeId;
}
- public Group getOwner(final Group group) {
- return container.getOwner();
+ public void setVersion(final int version) {
+ this.version = version;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/HasStateToken.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/HasStateToken.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/HasStateToken.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -19,9 +19,10 @@
*/
package org.ourproject.kune.platf.server.domain;
+import org.ourproject.kune.platf.client.dto.StateToken;
public interface HasStateToken {
- String getStateToken();
+ StateToken getStateToken();
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -27,7 +27,9 @@
import org.ourproject.kune.chat.server.managers.ChatConnection;
import org.ourproject.kune.chat.server.managers.XmppManager;
+import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.CommentDTO;
+import org.ourproject.kune.platf.client.dto.ContentDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
@@ -40,6 +42,7 @@
import org.ourproject.kune.platf.client.rpc.ContentService;
import org.ourproject.kune.platf.server.UserSession;
import org.ourproject.kune.platf.server.access.Access;
+import org.ourproject.kune.platf.server.access.AccessRightsService;
import org.ourproject.kune.platf.server.access.AccessService;
import org.ourproject.kune.platf.server.access.AccessType;
import org.ourproject.kune.platf.server.auth.Authenticated;
@@ -48,6 +51,7 @@
import org.ourproject.kune.platf.server.content.ContainerManager;
import org.ourproject.kune.platf.server.content.ContentManager;
import org.ourproject.kune.platf.server.content.CreationService;
+import org.ourproject.kune.platf.server.domain.AccessLists;
import org.ourproject.kune.platf.server.domain.Comment;
import org.ourproject.kune.platf.server.domain.Container;
import org.ourproject.kune.platf.server.domain.Content;
@@ -80,118 +84,125 @@
private final TagManager tagManager;
private final SocialNetworkManager socialNetworkManager;
private final CommentManager commentManager;
+ private final AccessRightsService rightsService;
@Inject
public ContentRPC(final Provider<UserSession> userSessionProvider, final AccessService accessService,
- final StateService stateService, final CreationService creationService, final GroupManager groupManager,
- final XmppManager xmppManager, final ContentManager contentManager,
- final ContainerManager containerManager, final TagManager tagManager,
- final SocialNetworkManager socialNetworkManager, final CommentManager commentManager, final Mapper mapper) {
- this.userSessionProvider = userSessionProvider;
- this.accessService = accessService;
- this.stateService = stateService;
- this.creationService = creationService;
- this.groupManager = groupManager;
- this.xmppManager = xmppManager;
- this.contentManager = contentManager;
- this.containerManager = containerManager;
- this.tagManager = tagManager;
- this.socialNetworkManager = socialNetworkManager;
- this.commentManager = commentManager;
- this.mapper = mapper;
+ final AccessRightsService rightsService, final StateService stateService,
+ final CreationService creationService, final GroupManager groupManager, final XmppManager xmppManager,
+ final ContentManager contentManager, final ContainerManager containerManager, final TagManager tagManager,
+ final SocialNetworkManager socialNetworkManager, final CommentManager commentManager, final Mapper mapper) {
+ this.userSessionProvider = userSessionProvider;
+ this.accessService = accessService;
+ this.rightsService = rightsService;
+ this.stateService = stateService;
+ this.creationService = creationService;
+ this.groupManager = groupManager;
+ this.xmppManager = xmppManager;
+ this.contentManager = contentManager;
+ this.containerManager = containerManager;
+ this.tagManager = tagManager;
+ this.socialNetworkManager = socialNetworkManager;
+ this.commentManager = commentManager;
+ this.mapper = mapper;
}
@Authenticated
@Authorizated(accessTypeRequired = AccessType.EDIT, checkContent = true)
@Transactional(type = TransactionType.READ_WRITE)
public void addAuthor(final String userHash, final String groupShortName, final String documentId,
- final String authorShortName) throws DefaultException {
- final Long contentId = parseId(documentId);
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
- contentManager.addAuthor(user, contentId, authorShortName);
+ final String authorShortName) throws DefaultException {
+ final Long contentId = parseId(documentId);
+ final UserSession userSession = getUserSession();
+ final User user = userSession.getUser();
+ contentManager.addAuthor(user, contentId, authorShortName);
}
@Authenticated
@Authorizated(accessTypeRequired = AccessType.READ)
@Transactional(type = TransactionType.READ_WRITE)
public CommentDTO addComment(final String userHash, final String groupShortName, final String documentId,
- final Long parentCommentId, final String commentText) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User author = userSession.getUser();
- final Long contentId = parseId(documentId);
- Comment comment = commentManager.addComment(author, contentId, commentText, parentCommentId);
- return mapper.map(comment, CommentDTO.class);
+ final Long parentCommentId, final String commentText) throws DefaultException {
+ final UserSession userSession = getUserSession();
+ final User author = userSession.getUser();
+ final Long contentId = parseId(documentId);
+ final Comment comment = commentManager.addComment(author, contentId, commentText, parentCommentId);
+ return mapper.map(comment, CommentDTO.class);
}
@Authenticated
@Authorizated(accessTypeRequired = AccessType.READ)
@Transactional(type = TransactionType.READ_WRITE)
public CommentDTO addComment(final String userHash, final String groupShortName, final String documentId,
- final String commentText) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User author = userSession.getUser();
- final Long contentId = parseId(documentId);
- Comment comment = commentManager.addComment(author, contentId, commentText);
- return mapper.map(comment, CommentDTO.class);
+ final String commentText) throws DefaultException {
+ final UserSession userSession = getUserSession();
+ final User author = userSession.getUser();
+ final Long contentId = parseId(documentId);
+ final Comment comment = commentManager.addComment(author, contentId, commentText);
+ return mapper.map(comment, CommentDTO.class);
}
@Authenticated
@Authorizated(accessTypeRequired = AccessType.EDIT)
@Transactional(type = TransactionType.READ_WRITE)
public StateDTO addContent(final String userHash, final String groupShortName, final Long parentFolderId,
- final String title) throws DefaultException {
- final Group group = groupManager.findByShortName(groupShortName);
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
- final Access access = accessService.getFolderAccess(group, parentFolderId, user, AccessType.EDIT);
- access.setContentWidthFolderRights(creationService.createContent(title, "", user, access.getFolder()));
- final State state = stateService.create(access);
- return mapper.map(state, StateDTO.class);
+ final String title) throws DefaultException {
+ final Group group = groupManager.findByShortName(groupShortName);
+ final UserSession userSession = getUserSession();
+ final User user = userSession.getUser();
+ final Access access = accessService.getFolderAccess(group, parentFolderId, user, AccessType.EDIT);
+ access.setContentWidthFolderRights(creationService.createContent(title, "", user, access.getFolder()));
+ final State state = stateService.create(access);
+ return mapState(state, user, group);
}
@Authenticated
@Authorizated(accessTypeRequired = AccessType.EDIT)
@Transactional(type = TransactionType.READ_WRITE)
public StateDTO addFolder(final String userHash, final String groupShortName, final Long parentFolderId,
- final String title) throws DefaultException {
- return createFolder(groupShortName, parentFolderId, title);
+ final String title) throws DefaultException {
+ final Group group = groupManager.findByShortName(groupShortName);
+ final UserSession userSession = getUserSession();
+ final User user = userSession.getUser();
+ return mapState(createFolder(groupShortName, parentFolderId, title), user, group);
}
@Authenticated
@Authorizated(accessTypeRequired = AccessType.EDIT)
@Transactional(type = TransactionType.READ_WRITE)
public StateDTO addRoom(final String userHash, final String groupShortName, final Long parentFolderId,
- final String roomName) throws DefaultException {
- final UserSession userSession = getUserSession();
- final String userShortName = userSession.getUser().getShortName();
- final ChatConnection connection = xmppManager.login(userShortName, userSession.getUser().getPassword(),
- userHash);
- xmppManager.createRoom(connection, roomName, userShortName + userHash);
- xmppManager.disconnect(connection);
- try {
- return createFolder(groupShortName, parentFolderId, roomName);
- } catch (final ContentNotFoundException e) {
- xmppManager.destroyRoom(connection, roomName);
- throw new ContentNotFoundException();
- } catch (final AccessViolationException e) {
- xmppManager.destroyRoom(connection, roomName);
- throw new AccessViolationException();
- } catch (final GroupNotFoundException e) {
- xmppManager.destroyRoom(connection, roomName);
- throw new GroupNotFoundException();
- }
+ final String roomName) throws DefaultException {
+ final Group group = groupManager.findByShortName(groupShortName);
+ final UserSession userSession = getUserSession();
+ final User user = userSession.getUser();
+ final String userShortName = user.getShortName();
+ final ChatConnection connection = xmppManager.login(userShortName, userSession.getUser().getPassword(),
+ userHash);
+ xmppManager.createRoom(connection, roomName, userShortName + userHash);
+ xmppManager.disconnect(connection);
+ try {
+ return mapState(createFolder(groupShortName, parentFolderId, roomName), user, group);
+ } catch (final ContentNotFoundException e) {
+ xmppManager.destroyRoom(connection, roomName);
+ throw new ContentNotFoundException();
+ } catch (final AccessViolationException e) {
+ xmppManager.destroyRoom(connection, roomName);
+ throw new AccessViolationException();
+ } catch (final GroupNotFoundException e) {
+ xmppManager.destroyRoom(connection, roomName);
+ throw new GroupNotFoundException();
+ }
}
@Authenticated
@Authorizated(accessTypeRequired = AccessType.ADMIN, checkContent = true)
@Transactional(type = TransactionType.READ_WRITE)
public void delContent(final String userHash, final String groupShortName, final String documentId)
- throws DefaultException {
- final Long contentId = parseId(documentId);
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
- contentManager.delContent(user, contentId);
+ throws DefaultException {
+ final Long contentId = parseId(documentId);
+ final UserSession userSession = getUserSession();
+ final User user = userSession.getUser();
+ contentManager.delContent(user, contentId);
}
// Not using @Authorizated because accessService is doing this job and is
@@ -200,225 +211,236 @@
@Authenticated(mandatory = false)
@Transactional(type = TransactionType.READ_ONLY)
public StateDTO getContent(final String userHash, final String groupShortName, final StateToken token)
- throws DefaultException {
- Group defaultGroup;
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
- final boolean userIsLoggedIn = userSession.isUserLoggedIn();
- if (userIsLoggedIn) {
- defaultGroup = groupManager.getGroupOfUserWithId(user.getId());
- } else {
- defaultGroup = groupManager.getDefaultGroup();
- }
- Access access;
- try {
- access = accessService.getAccess(user, token, defaultGroup, AccessType.READ);
- } catch (final NoResultException e) {
- throw new ContentNotFoundException();
- } catch (final ToolNotFoundException e) {
- throw new ContentNotFoundException();
- }
- final State state = stateService.create(access);
- if (state.isRateable()) {
- final Long contentId = parseId(state.getDocumentId());
- final Content content = contentManager.find(contentId);
- if (userIsLoggedIn) {
- state.setCurrentUserRate(contentManager.getRateContent(user, content));
- }
- state.setRate(contentManager.getRateAvg(content));
- state.setRateByUsers(contentManager.getRateByUsers(content));
- }
- final Group group = state.getGroup();
- state.setGroupTags(tagManager.getSummaryByGroup(group));
- state.setGroupMembers(socialNetworkManager.find(user, group));
- state.setParticipation(socialNetworkManager.findParticipation(user, group));
- return mapper.map(state, StateDTO.class);
+ throws DefaultException {
+ Group defaultGroup;
+ final UserSession userSession = getUserSession();
+ final User user = userSession.getUser();
+ final boolean userIsLoggedIn = userSession.isUserLoggedIn();
+ if (userIsLoggedIn) {
+ defaultGroup = groupManager.getGroupOfUserWithId(user.getId());
+ } else {
+ defaultGroup = groupManager.getDefaultGroup();
+ }
+ Access access;
+ try {
+ access = accessService.getAccess(user, token, defaultGroup, AccessType.READ);
+ } catch (final NoResultException e) {
+ throw new ContentNotFoundException();
+ } catch (final ToolNotFoundException e) {
+ throw new ContentNotFoundException();
+ }
+ final State state = stateService.create(access);
+ if (state.isRateable()) {
+ final Long contentId = parseId(state.getDocumentId());
+ final Content content = contentManager.find(contentId);
+ if (userIsLoggedIn) {
+ state.setCurrentUserRate(contentManager.getRateContent(user, content));
+ }
+ state.setRate(contentManager.getRateAvg(content));
+ state.setRateByUsers(contentManager.getRateByUsers(content));
+ }
+ final Group group = state.getGroup();
+ state.setGroupTags(tagManager.getSummaryByGroup(group));
+ state.setGroupMembers(socialNetworkManager.find(user, group));
+ state.setParticipation(socialNetworkManager.findParticipation(user, group));
+ return mapState(state, user, group);
}
@Authenticated(mandatory = false)
@Authorizated(accessTypeRequired = AccessType.READ)
@Transactional(type = TransactionType.READ_ONLY)
public List<TagResultDTO> getSummaryTags(final String userHash, final String groupShortName) {
- final Group group = groupManager.findByShortName(groupShortName);
- return getSummaryTags(group);
+ final Group group = groupManager.findByShortName(groupShortName);
+ return getSummaryTags(group);
}
@Authenticated
@Authorizated(accessTypeRequired = AccessType.READ)
@Transactional(type = TransactionType.READ_WRITE)
public CommentDTO markCommentAsAbuse(final String userHash, final String groupShortName, final String documentId,
- final Long commentId) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User informer = userSession.getUser();
- final Long contentId = parseId(documentId);
- Comment comment = commentManager.markAsAbuse(informer, contentId, commentId);
- return mapper.map(comment, CommentDTO.class);
+ final Long commentId) throws DefaultException {
+ final UserSession userSession = getUserSession();
+ final User informer = userSession.getUser();
+ final Long contentId = parseId(documentId);
+ final Comment comment = commentManager.markAsAbuse(informer, contentId, commentId);
+ return mapper.map(comment, CommentDTO.class);
}
@Authenticated
@Authorizated(accessTypeRequired = AccessType.READ, checkContent = true)
@Transactional(type = TransactionType.READ_WRITE)
public void rateContent(final String userHash, final String groupShortName, final String documentId,
- final Double value) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User rater = userSession.getUser();
- final Long contentId = parseId(documentId);
+ final Double value) throws DefaultException {
+ final UserSession userSession = getUserSession();
+ final User rater = userSession.getUser();
+ final Long contentId = parseId(documentId);
- if (userSession.isUserLoggedIn()) {
- contentManager.rateContent(rater, contentId, value);
- } else {
- throw new AccessViolationException();
- }
+ if (userSession.isUserLoggedIn()) {
+ contentManager.rateContent(rater, contentId, value);
+ } else {
+ throw new AccessViolationException();
+ }
}
@Authenticated
@Authorizated(accessTypeRequired = AccessType.EDIT, checkContent = true)
@Transactional(type = TransactionType.READ_WRITE)
public void removeAuthor(final String userHash, final String groupShortName, final String documentId,
- final String authorShortName) throws DefaultException {
- final Long contentId = parseId(documentId);
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
- contentManager.removeAuthor(user, contentId, authorShortName);
+ final String authorShortName) throws DefaultException {
+ final Long contentId = parseId(documentId);
+ final UserSession userSession = getUserSession();
+ final User user = userSession.getUser();
+ contentManager.removeAuthor(user, contentId, authorShortName);
}
@Authenticated
@Authorizated(accessTypeRequired = AccessType.EDIT)
@Transactional(type = TransactionType.READ_WRITE)
public String rename(final String userHash, final String groupShortName, final String token, final String newName)
- throws DefaultException {
- String result;
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
- final StateToken stateToken = new StateToken(token);
- final Group group = groupManager.findByShortName(groupShortName);
- if (stateToken.isComplete()) {
- try {
- final Content content = accessService.accessToContent(parseId(stateToken.getDocument()), user,
- AccessType.EDIT);
- if (!content.getContainer().getOwner().equals(group)) {
- throw new AccessViolationException();
- }
- } catch (final NoResultException e) {
- throw new AccessViolationException();
- }
- result = renameContent(stateToken.getDocument(), newName);
- } else {
- result = renameFolder(groupShortName, parseId(stateToken.getFolder()), newName);
- }
- return result;
+ throws DefaultException {
+ String result;
+ final UserSession userSession = getUserSession();
+ final User user = userSession.getUser();
+ final StateToken stateToken = new StateToken(token);
+ final Group group = groupManager.findByShortName(groupShortName);
+ if (stateToken.isComplete()) {
+ try {
+ final Content content = accessService.accessToContent(parseId(stateToken.getDocument()), user,
+ AccessType.EDIT);
+ if (!content.getContainer().getOwner().equals(group)) {
+ throw new AccessViolationException();
+ }
+ } catch (final NoResultException e) {
+ throw new AccessViolationException();
+ }
+ result = renameContent(stateToken.getDocument(), newName);
+ } else {
+ result = renameFolder(groupShortName, parseId(stateToken.getFolder()), newName);
+ }
+ return result;
}
@Authenticated
@Authorizated(accessTypeRequired = AccessType.EDIT, checkContent = true)
@Transactional(type = TransactionType.READ_WRITE)
public Integer save(final String userHash, final String groupShortName, final String documentId,
- final String textContent) throws DefaultException {
+ final String textContent) throws DefaultException {
- final Long contentId = parseId(documentId);
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
- final Content content = accessService.accessToContent(contentId, user, AccessType.EDIT);
- final Content descriptor = creationService.saveContent(user, content, textContent);
- return descriptor.getVersion();
+ final Long contentId = parseId(documentId);
+ final UserSession userSession = getUserSession();
+ final User user = userSession.getUser();
+ final Content content = accessService.accessToContent(contentId, user, AccessType.EDIT);
+ final Content descriptor = creationService.saveContent(user, content, textContent);
+ return descriptor.getVersion();
}
@Authenticated
@Authorizated(accessTypeRequired = AccessType.EDIT, checkContent = true)
@Transactional(type = TransactionType.READ_WRITE)
public I18nLanguageDTO setLanguage(final String userHash, final String groupShortName, final String documentId,
- final String languageCode) throws DefaultException {
- final Long contentId = parseId(documentId);
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
- return mapper.map(contentManager.setLanguage(user, contentId, languageCode), I18nLanguageDTO.class);
+ final String languageCode) throws DefaultException {
+ final Long contentId = parseId(documentId);
+ final UserSession userSession = getUserSession();
+ final User user = userSession.getUser();
+ return mapper.map(contentManager.setLanguage(user, contentId, languageCode), I18nLanguageDTO.class);
}
@Authenticated
@Authorizated(accessTypeRequired = AccessType.EDIT, checkContent = true)
@Transactional(type = TransactionType.READ_WRITE)
public void setPublishedOn(final String userHash, final String groupShortName, final String documentId,
- final Date publishedOn) throws DefaultException {
- final Long contentId = parseId(documentId);
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
- contentManager.setPublishedOn(user, contentId, publishedOn);
+ final Date publishedOn) throws DefaultException {
+ final Long contentId = parseId(documentId);
+ final UserSession userSession = getUserSession();
+ final User user = userSession.getUser();
+ contentManager.setPublishedOn(user, contentId, publishedOn);
}
@Authenticated
@Authorizated(accessTypeRequired = AccessType.EDIT, checkContent = true)
@Transactional(type = TransactionType.READ_WRITE)
public List<TagResultDTO> setTags(final String userHash, final String groupShortName, final String documentId,
- final String tags) throws DefaultException {
- final Long contentId = parseId(documentId);
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
- final Group group = groupManager.findByShortName(groupShortName);
- contentManager.setTags(user, contentId, tags);
- return getSummaryTags(group);
+ final String tags) throws DefaultException {
+ final Long contentId = parseId(documentId);
+ final UserSession userSession = getUserSession();
+ final User user = userSession.getUser();
+ final Group group = groupManager.findByShortName(groupShortName);
+ contentManager.setTags(user, contentId, tags);
+ return getSummaryTags(group);
}
@Authenticated
@Authorizated(accessTypeRequired = AccessType.READ)
@Transactional(type = TransactionType.READ_WRITE)
public CommentDTO voteComment(final String userHash, final String groupShortName, final String documentId,
- final Long commentId, final boolean votePositive) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User voter = userSession.getUser();
- final Long contentId = parseId(documentId);
- Comment comment = commentManager.vote(voter, contentId, commentId, votePositive);
- return mapper.map(comment, CommentDTO.class);
+ final Long commentId, final boolean votePositive) throws DefaultException {
+ final UserSession userSession = getUserSession();
+ final User voter = userSession.getUser();
+ final Long contentId = parseId(documentId);
+ final Comment comment = commentManager.vote(voter, contentId, commentId, votePositive);
+ return mapper.map(comment, CommentDTO.class);
}
- private StateDTO createFolder(final String groupShortName, final Long parentFolderId, final String title)
- throws DefaultException {
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
- final Group group = groupManager.findByShortName(groupShortName);
+ private State createFolder(final String groupShortName, final Long parentFolderId, final String title)
+ throws DefaultException {
+ final UserSession userSession = getUserSession();
+ final User user = userSession.getUser();
+ final Group group = groupManager.findByShortName(groupShortName);
- Access access = accessService.getFolderAccess(group, parentFolderId, user, AccessType.EDIT);
+ Access access = accessService.getFolderAccess(group, parentFolderId, user, AccessType.EDIT);
- final Container container = creationService.createFolder(group, parentFolderId, title, user.getLanguage());
- final String toolName = container.getToolName();
- // Trying not to enter in new folder:
- // final StateToken token = new StateToken(group.getShortName(),
- // toolName, container.getId().toString(), null);
- final StateToken token = new StateToken(group.getShortName(), toolName, parentFolderId.toString(), null);
- access = accessService.getAccess(user, token, group, AccessType.READ);
- final State state = stateService.create(access);
- return mapper.map(state, StateDTO.class);
+ final Container container = creationService.createFolder(group, parentFolderId, title, user.getLanguage());
+ final String toolName = container.getToolName();
+ // Trying not to enter in new folder:
+ // final StateToken token = new StateToken(group.getShortName(),
+ // toolName, container.getId().toString(), null);
+ final StateToken token = new StateToken(group.getShortName(), toolName, parentFolderId.toString(), null);
+ access = accessService.getAccess(user, token, group, AccessType.READ);
+ final State state = stateService.create(access);
+ return state;
}
private List<TagResultDTO> getSummaryTags(final Group group) {
- return mapper.mapList(tagManager.getSummaryByGroup(group), TagResultDTO.class);
+ return mapper.mapList(tagManager.getSummaryByGroup(group), TagResultDTO.class);
}
private UserSession getUserSession() {
- return userSessionProvider.get();
+ return userSessionProvider.get();
}
+ private StateDTO mapState(final State state, final User user, final Group group) {
+ final StateDTO stateDTO = mapper.map(state, StateDTO.class);
+ final AccessLists groupAccesList = group.getSocialNetwork().getAccessLists();
+ for (final ContentDTO siblingDTO : stateDTO.getFolder().getContents()) {
+ final Content sibling = contentManager.find(siblingDTO.getId());
+ final AccessLists lists = sibling.hasAccessList() ? sibling.getAccessLists() : groupAccesList;
+ siblingDTO.setRights(mapper.map(rightsService.get(user, lists), AccessRightsDTO.class));
+ }
+ return stateDTO;
+ }
+
private Long parseId(final String documentId) throws ContentNotFoundException {
- try {
- return new Long(documentId);
- } catch (final NumberFormatException e) {
- throw new ContentNotFoundException();
- }
+ try {
+ return new Long(documentId);
+ } catch (final NumberFormatException e) {
+ throw new ContentNotFoundException();
+ }
}
private String renameContent(final String documentId, final String newName) throws ContentNotFoundException,
- DefaultException {
- final Long contentId = parseId(documentId);
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
- return contentManager.renameContent(user, contentId, newName);
+ DefaultException {
+ final Long contentId = parseId(documentId);
+ final UserSession userSession = getUserSession();
+ final User user = userSession.getUser();
+ return contentManager.renameContent(user, contentId, newName);
}
private String renameFolder(final String groupShortName, final Long folderId, final String newName)
- throws DefaultException {
- final Group group = groupManager.findByShortName(groupShortName);
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
- final Access folderAccess = accessService.getFolderAccess(group, folderId, user, AccessType.EDIT);
- return containerManager.renameFolder(group, folderAccess.getFolder(), newName);
+ throws DefaultException {
+ final Group group = groupManager.findByShortName(groupShortName);
+ final UserSession userSession = getUserSession();
+ final User user = userSession.getUser();
+ final Access folderAccess = accessService.getFolderAccess(group, folderId, user, AccessType.EDIT);
+ return containerManager.renameFolder(group, folderAccess.getFolder(), newName);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -81,7 +81,7 @@
final Group newGroup = groupManager.createGroup(group, user);
final Long defContentId = newGroup.getDefaultContent().getId();
contentManager.setTags(user, defContentId, groupDTO.getTags());
- return new StateToken(newGroup.getDefaultContent().getStateToken());
+ return newGroup.getDefaultContent().getStateToken();
}
private UserSession getUserSession() {
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/state/State.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/state/State.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/state/State.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -23,10 +23,12 @@
import java.util.Date;
import java.util.List;
+import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.server.ParticipationData;
import org.ourproject.kune.platf.server.access.AccessRights;
import org.ourproject.kune.platf.server.domain.AccessLists;
import org.ourproject.kune.platf.server.domain.Container;
+import org.ourproject.kune.platf.server.domain.ContentStatus;
import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.domain.I18nLanguage;
import org.ourproject.kune.platf.server.domain.License;
@@ -45,6 +47,7 @@
private AccessRights contentRights;
private AccessRights folderRights;
private AccessRights groupRights;
+ private ContentStatus status;
private boolean isRateable;
private Double rate;
private Integer rateByUsers;
@@ -58,200 +61,217 @@
private List<TagResult> groupTags;
private SocialNetwork groupMembers;
private ParticipationData participation;
+ private StateToken stateToken;
- public SocialNetwork getGroupMembers() {
- return groupMembers;
+ public State() {
}
- public void setGroupMembers(final SocialNetwork groupMembers) {
- this.groupMembers = groupMembers;
+ public AccessLists getAccessLists() {
+ return accessLists;
}
- public ParticipationData getParticipation() {
- return participation;
+ public List<User> getAuthors() {
+ return authors;
}
- public void setParticipation(final ParticipationData participation) {
- this.participation = participation;
+ public String getContent() {
+ return content;
}
- public State() {
+ public AccessRights getContentRights() {
+ return contentRights;
}
- public AccessLists getAccessLists() {
- return accessLists;
+ public Double getCurrentUserRate() {
+ return currentUserRate;
}
- public void setAccessLists(final AccessLists accessLists) {
- this.accessLists = accessLists;
+ public String getDocumentId() {
+ return documentId;
}
- public AccessRights getContentRights() {
- return contentRights;
+ public Container getFolder() {
+ return container;
}
- public String getDocumentId() {
- return documentId;
+ public AccessRights getFolderRights() {
+ return folderRights;
}
- public void setDocumentId(final String docRef) {
- this.documentId = docRef;
+ public Group getGroup() {
+ return group;
}
- public AccessRights getFolderRights() {
- return folderRights;
+ public SocialNetwork getGroupMembers() {
+ return groupMembers;
}
- public void setFolderRights(final AccessRights folderRights) {
- this.folderRights = folderRights;
+ public AccessRights getGroupRights() {
+ return groupRights;
}
- public String getContent() {
- return content;
+ public List<TagResult> getGroupTags() {
+ return groupTags;
}
- public void setContent(final String content) {
- this.content = content;
+ public I18nLanguage getLanguage() {
+ return language;
}
- public String getTitle() {
- return title;
+ public License getLicense() {
+ return license;
}
- public void setTitle(final String title) {
- this.title = title;
+ public ParticipationData getParticipation() {
+ return participation;
}
- public String getToolName() {
- return toolName;
+ public Date getPublishedOn() {
+ return publishedOn;
}
- public void setToolName(final String toolName) {
- this.toolName = toolName;
+ public Double getRate() {
+ return rate;
}
- public Group getGroup() {
- return group;
+ public Integer getRateByUsers() {
+ return rateByUsers;
}
- public void setGroup(final Group group) {
- this.group = group;
+ public StateToken getStateToken() {
+ return stateToken;
}
- public void setContentRights(final AccessRights accessRights) {
- this.contentRights = accessRights;
+ public ContentStatus getStatus() {
+ return status;
}
- public Container getFolder() {
- return container;
+ public String getTags() {
+ return tags;
}
- public void setFolder(final Container container) {
- this.container = container;
+ public String getTitle() {
+ return title;
}
- public Double getRate() {
- return rate;
+ public String getToolName() {
+ return toolName;
}
- public void setRate(final Double rate) {
- if (rate != null) {
- this.rate = rate;
- } else {
- this.rate = 0d;
- }
+ public String getTypeId() {
+ return typeId;
}
- public Integer getRateByUsers() {
- return rateByUsers;
+ public boolean isRateable() {
+ return isRateable;
}
- public void setRateByUsers(final Long rateByUsers) {
- if (rateByUsers != null) {
- this.rateByUsers = rateByUsers.intValue();
- } else {
- this.rateByUsers = 0;
- }
+ public void setAccessLists(final AccessLists accessLists) {
+ this.accessLists = accessLists;
}
- public void setTypeId(final String typeId) {
- this.typeId = typeId;
+ public void setAuthors(final List<User> authors) {
+ this.authors = authors;
}
- public String getTypeId() {
- return typeId;
+ public void setContent(final String content) {
+ this.content = content;
}
- public License getLicense() {
- return license;
+ public void setContentRights(final AccessRights accessRights) {
+ this.contentRights = accessRights;
}
- public void setLicense(final License license) {
- this.license = license;
+ public void setCurrentUserRate(final Double currentUserRate) {
+ this.currentUserRate = currentUserRate;
}
- public AccessRights getGroupRights() {
- return groupRights;
+ public void setDocumentId(final String docRef) {
+ this.documentId = docRef;
}
- public void setGroupRights(final AccessRights groupRights) {
- this.groupRights = groupRights;
+ public void setFolder(final Container container) {
+ this.container = container;
}
- public Double getCurrentUserRate() {
- return currentUserRate;
+ public void setFolderRights(final AccessRights folderRights) {
+ this.folderRights = folderRights;
}
- public void setCurrentUserRate(final Double currentUserRate) {
- this.currentUserRate = currentUserRate;
+ public void setGroup(final Group group) {
+ this.group = group;
}
- public boolean isRateable() {
- return isRateable;
+ public void setGroupMembers(final SocialNetwork groupMembers) {
+ this.groupMembers = groupMembers;
}
- public void setIsRateable(final boolean isRateable) {
- this.isRateable = isRateable;
+ public void setGroupRights(final AccessRights groupRights) {
+ this.groupRights = groupRights;
}
- public I18nLanguage getLanguage() {
- return language;
+ public void setGroupTags(final List<TagResult> groupTags) {
+ this.groupTags = groupTags;
}
+ public void setIsRateable(final boolean isRateable) {
+ this.isRateable = isRateable;
+ }
+
public void setLanguage(final I18nLanguage language) {
- this.language = language;
+ this.language = language;
}
- public Date getPublishedOn() {
- return publishedOn;
+ public void setLicense(final License license) {
+ this.license = license;
}
+ public void setParticipation(final ParticipationData participation) {
+ this.participation = participation;
+ }
+
public void setPublishedOn(final Date publishedOn) {
- this.publishedOn = publishedOn;
+ this.publishedOn = publishedOn;
}
- public List<User> getAuthors() {
- return authors;
+ public void setRate(final Double rate) {
+ if (rate != null) {
+ this.rate = rate;
+ } else {
+ this.rate = 0d;
+ }
}
- public void setAuthors(final List<User> authors) {
- this.authors = authors;
+ public void setRateByUsers(final Long rateByUsers) {
+ if (rateByUsers != null) {
+ this.rateByUsers = rateByUsers.intValue();
+ } else {
+ this.rateByUsers = 0;
+ }
}
- public String getTags() {
- return tags;
+ public void setStateToken(final StateToken stateToken) {
+ this.stateToken = stateToken;
}
+ public void setStatus(final ContentStatus status) {
+ this.status = status;
+ }
+
public void setTags(final String tags) {
- this.tags = tags;
+ this.tags = tags;
}
- public List<TagResult> getGroupTags() {
- return groupTags;
+ public void setTitle(final String title) {
+ this.title = title;
}
- public void setGroupTags(final List<TagResult> groupTags) {
- this.groupTags = groupTags;
+ public void setToolName(final String toolName) {
+ this.toolName = toolName;
}
+ public void setTypeId(final String typeId) {
+ this.typeId = typeId;
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/state/StateServiceDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/state/StateServiceDefault.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/state/StateServiceDefault.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -31,45 +31,48 @@
@Singleton
public class StateServiceDefault implements StateService {
public State create(final Access access) {
- final Content content = access.getContent();
- final Container container = content.getContainer();
- final State state = new State();
+ final Content content = access.getContent();
+ final Container container = content.getContainer();
+ final State state = new State();
- final Long documentId = content.getId();
- if (documentId != null) {
- state.setTypeId(content.getTypeId());
- state.setDocumentId(documentId.toString());
- state.setIsRateable(true);
- state.setLanguage(content.getLanguage());
- state.setPublishedOn(content.getPublishedOn());
- state.setAuthors(content.getAuthors());
- state.setTags(content.getTagsAsString());
- } else {
- state.setTypeId(container.getTypeId());
- state.setDocumentId(null);
- state.setIsRateable(false);
- state.setLanguage(container.getLanguage());
- }
- final Revision revision = content.getLastRevision();
- final char[] text = revision.getBody();
- state.setContent(text == null ? null : new String(text));
- if (documentId != null) {
- state.setTitle(revision.getTitle());
- } else {
- state.setTitle(container.getName());
- }
- state.setToolName(container.getToolName());
- state.setGroup(container.getOwner());
- state.setFolder(container);
- state.setAccessLists(access.getContentAccessLists());
- state.setContentRights(access.getContentRights());
- state.setFolderRights(access.getFolderRights());
- state.setGroupRights(access.getGroupRights());
- License contentLicense = content.getLicense();
- if (contentLicense == null) {
- contentLicense = container.getOwner().getDefaultLicense();
- }
- state.setLicense(contentLicense);
- return state;
+ final Long documentId = content.getId();
+ if (documentId != null) {
+ state.setTypeId(content.getTypeId());
+ state.setDocumentId(documentId.toString());
+ state.setIsRateable(true);
+ state.setLanguage(content.getLanguage());
+ state.setPublishedOn(content.getPublishedOn());
+ state.setAuthors(content.getAuthors());
+ state.setTags(content.getTagsAsString());
+ state.setStatus(content.getStatus());
+ state.setStateToken(content.getStateToken());
+ } else {
+ state.setTypeId(container.getTypeId());
+ state.setDocumentId(null);
+ state.setIsRateable(false);
+ state.setLanguage(container.getLanguage());
+ state.setStateToken(container.getStateToken());
+ }
+ final Revision revision = content.getLastRevision();
+ final char[] text = revision.getBody();
+ state.setContent(text == null ? null : new String(text));
+ if (documentId != null) {
+ state.setTitle(revision.getTitle());
+ } else {
+ state.setTitle(container.getName());
+ }
+ state.setToolName(container.getToolName());
+ state.setGroup(container.getOwner());
+ state.setFolder(container);
+ state.setAccessLists(access.getContentAccessLists());
+ state.setContentRights(access.getContentRights());
+ state.setFolderRights(access.getFolderRights());
+ state.setGroupRights(access.getGroupRights());
+ License contentLicense = content.getLicense();
+ if (contentLicense == null) {
+ contentLicense = container.getOwner().getDefaultLicense();
+ }
+ state.setLicense(contentLicense);
+ return state;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfoServiceDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfoServiceDefault.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfoServiceDefault.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -62,7 +62,7 @@
final Content defaultContent = userGroup.getDefaultContent();
if (defaultContent != null) {
- info.setHomePage(defaultContent.getStateToken());
+ info.setHomePage(defaultContent.getStateToken().toString());
}
}
return info;
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-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -88,12 +88,14 @@
child.setAllowDrag(item.isDraggable());
child.setAllowDrop(item.isDroppable());
switch (item.getContentStatus()) {
- case publicVisible:
+ case publishedOnline:
child.enable();
break;
- case markForDelection:
+ case inTheDustbin:
+ case rejected:
child.setCls("k-linethrough");
- case nonPublicVisible:
+ case editingInProgress:
+ case submittedForEvaluation:
child.disable();
break;
}
@@ -125,9 +127,6 @@
}
} else {
// the node already created
- if (contextMenus.get(nodeId) == null && item.getActionCollection() != null) {
- createItemMenu(nodeId, item.getActionCollection(), item.getStateToken());
- }
}
}
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-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -163,39 +163,54 @@
}
public void setState(final StateDTO state) {
- final StateToken stateToken = state.getStateToken().clone();
- final String treeId = genId(stateToken);
-
final ContainerDTO container = state.getFolder();
- createTreePath(stateToken, container.getAbsolutePath());
- boolean visible = false;
- AccessRightsDTO rights = null;
+ createTreePath(state.getStateToken(), container.getAbsolutePath(), state.getFolderRights());
- String containerTreeId;
-
if (state.hasDocument()) {
- rights = state.getContentRights();
- visible = rights.isVisible();
- containerTreeId = genId(stateToken.clone().setDocument(null));
+ addItem(state.getTitle(), state.getTypeId(), state.getStatus(), state.getStateToken(), container
+ .getStateToken(), state.getContentRights());
} else {
- rights = state.getFolderRights();
- visible = rights.isVisible();
- final Long folderId = container.getParentFolderId();
- containerTreeId = genId(stateToken.clone().setDocument(null).setFolder(
- folderId == null ? null : folderId.toString()));
+ addItem(container.getName(), container.getTypeId(), ContentStatusDTO.publishedOnline, container
+ .getStateToken(), container.getStateToken().clone().setFolder(container.getParentFolderId()), state
+ .getFolderRights());
}
- // here check deletion mark
+ for (final ContentDTO content : container.getContents()) {
+ addItem(content.getTitle(), content.getTypeId(), content.getStatus(), content.getStateToken(), content
+ .getStateToken().clone().clearDocument(), content.getRights());
+ }
+ for (final ContainerSimpleDTO siblingFolder : container.getChilds()) {
+ addItem(siblingFolder.getName(), siblingFolder.getTypeId(), ContentStatusDTO.publishedOnline, siblingFolder
+ .getStateToken(), siblingFolder.getStateToken().clone()
+ .setFolder(siblingFolder.getParentFolderId()), state.getFolderRights());
+ }
+ view.selectItem(genId(state.getStateToken()));
+ }
+
+ private void addItem(final String title, final String contentTypeId, final ContentStatusDTO status,
+ final StateToken stateToken, final StateToken parentStateToken, final AccessRightsDTO rights) {
final ActionCollection<StateToken> topActions = new ActionCollection<StateToken>();
final ActionCollection<StateToken> itemActions = new ActionCollection<StateToken>();
final ActionCollection<StateToken> bottomActions = new ActionCollection<StateToken>();
+ createItemActions(rights, contentTypeId, topActions, itemActions, bottomActions);
+
+ view.setTopActions(stateToken, topActions);
+ view.setBottomActions(stateToken, bottomActions);
+ final ContextNavigatorItem item = new ContextNavigatorItem(genId(stateToken), genId(parentStateToken),
+ getContentTypeIcon(contentTypeId), title, status, stateToken, isDraggable(contentTypeId, rights
+ .isAdministrable()), isDroppable(contentTypeId, rights.isAdministrable()), itemActions);
+ view.addItem(item);
+ }
+
+ private void createItemActions(final AccessRightsDTO rights, final String contentTypeId,
+ final ActionCollection<StateToken> topActions, final ActionCollection<StateToken> itemActions,
+ final ActionCollection<StateToken> bottomActions) {
boolean add = false;
- final String contentId = state.getTypeId();
- for (final ActionDescriptor<StateToken> action : actions.get(contentId)) {
+ for (final ActionDescriptor<StateToken> action : actions.get(contentTypeId)) {
switch (action.getAccessRol()) {
case Administrator:
add = rights.isAdministrable();
@@ -225,64 +240,18 @@
}
}
}
-
- view.setTopActions(stateToken, topActions);
- view.setBottomActions(stateToken, bottomActions);
-
- final ContextNavigatorItem item = new ContextNavigatorItem(treeId, containerTreeId,
- getContentTypeIcon(contentId), state.getTitle(), visible ? ContentStatusDTO.publicVisible
- : ContentStatusDTO.nonPublicVisible, stateToken, isDraggable(contentId, rights
- .isAdministrable()), isDroppable(contentId, rights.isAdministrable()), itemActions);
- view.addItem(item);
-
- for (final ContentDTO content : container.getContents()) {
- final StateToken siblingToken = stateToken.clone().setDocument(content.getId().toString());
- final StateToken siblingParentToken = stateToken.clone().setDocument(null);
- // TODO: rights not correct
- final String contentTypeId = content.getTypeId();
- final ContextNavigatorItem sibling = new ContextNavigatorItem(genId(siblingToken),
- genId(siblingParentToken), getContentTypeIcon(contentTypeId), content.getTitle(),
- ContentStatusDTO.publicVisible, siblingToken, isDraggable(contentTypeId, rights.isAdministrable()),
- isDroppable(contentTypeId, rights.isAdministrable()), null);
- view.addItem(sibling);
-
- }
-
- for (final ContainerDTO siblingFolder : container.getChilds()) {
- final StateToken siblingToken = stateToken.clone().setDocument(null).setFolder(
- siblingFolder.getId().toString());
- final StateToken siblingParentToken = stateToken.clone().setDocument(null).setFolder(
- siblingFolder.getParentFolderId().toString());
- // TODO: rights not correct
- final String containerTypeId = container.getTypeId();
- final ContextNavigatorItem sibling = new ContextNavigatorItem(genId(siblingToken),
- genId(siblingParentToken), getContentTypeIcon(containerTypeId), siblingFolder.getName(),
- ContentStatusDTO.publicVisible, siblingToken,
- isDraggable(containerTypeId, rights.isAdministrable()), isDroppable(containerTypeId, rights
- .isAdministrable()), null);
- view.addItem(sibling);
- }
- view.selectItem(treeId);
}
- private void addItem(final String title, final String contentTypeId, final StateToken token,
+ private void createTreePath(final StateToken state, final ContainerSimpleDTO[] absolutePath,
final AccessRightsDTO rights) {
-
- }
-
- private void createTreePath(final StateToken state, final ContainerSimpleDTO[] absolutePath) {
for (int i = 0; i < absolutePath.length; i++) {
final ContainerSimpleDTO folder = absolutePath[i];
- final String parentFolderId = folder.getParentFolderId() == null ? null : folder.getParentFolderId()
- .toString();
- final StateToken folderStateToken = state.clone().setDocument(null).setFolder(folder.getId().toString());
- final StateToken parentStateToken = state.clone().setDocument(null).setFolder(parentFolderId);
+ final StateToken folderStateToken = folder.getStateToken();
+ final StateToken parentStateToken = state.clone().clearDocument().setFolder(folder.getParentFolderId());
+
if (folder.getParentFolderId() != null) {
- // Bad rights, draggable/droppable
- final ContextNavigatorItem parent = new ContextNavigatorItem(genId(folderStateToken),
- genId(parentStateToken), getContentTypeIcon(folder.getTypeId()), folder.getName(),
- ContentStatusDTO.publicVisible, folderStateToken, false, true, null);
- view.addItem(parent);
+ addItem(folder.getName(), folder.getTypeId(), ContentStatusDTO.publishedOnline, folderStateToken,
+ parentStateToken, rights);
} else {
// create root folder
view.setRootItem(genId(folderStateToken), i18n.t("contents"), folderStateToken);
Modified: trunk/src/main/resources/dozerBeanMapping.xml
===================================================================
--- trunk/src/main/resources/dozerBeanMapping.xml 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/main/resources/dozerBeanMapping.xml 2008-09-12 08:06:29 UTC (rev 867)
@@ -102,7 +102,6 @@
<field>
<a>authors</a>
<b>authors</b>
-
<a-hint>
org.ourproject.kune.platf.client.dto.UserSimpleDTO
</a-hint>
@@ -114,13 +113,30 @@
<a-hint>org.ourproject.kune.platf.client.dto.TagResultDTO</a-hint>
<b-hint>org.ourproject.kune.platf.server.domain.TagResult</b-hint>
</field>
-
</mapping>
+
+ <mapping>
+ <class-a>org.ourproject.kune.platf.client.dto.StateToken</class-a>
+ <class-b>org.ourproject.kune.platf.client.dto.StateToken</class-b>
+ <field>
+ <a>encoded</a>
+ <b>encoded</b>
+ </field>
+ </mapping>
<mapping>
<class-a>org.ourproject.kune.platf.client.dto.LicenseDTO</class-a>
<class-b>org.ourproject.kune.platf.server.domain.License</class-b>
</mapping>
+
+ <mapping>
+ <class-a>org.ourproject.kune.platf.client.dto.ContainerSimpleDTO</class-a>
+ <class-b>org.ourproject.kune.platf.server.domain.Container</class-b>
+ <field>
+ <a get-method="getStateToken">stateToken</a>
+ <b>stateToken</b>
+ </field>
+ </mapping>
<mapping>
<class-a>org.ourproject.kune.platf.client.dto.ContentDTO</class-a>
@@ -129,6 +145,10 @@
<a>title</a>
<b>lastRevision.title</b>
</field>
+ <field>
+ <a get-method="getStateToken">stateToken</a>
+ <b>stateToken</b>
+ </field>
</mapping>
<mapping type="one-way">
@@ -143,7 +163,7 @@
<b>shortName</b>
</field>
<field>
- <a get-method="getStateToken">link</a>
+ <a get-method="getStateTokenEncoded">link</a>
<b>link</b>
</field>
</mapping>
@@ -170,9 +190,14 @@
<field>
<a>childs</a>
<b>childs</b>
- <a-hint>org.ourproject.kune.platf.client.dto.ContainerDTO</a-hint>
+ <a-hint>org.ourproject.kune.platf.client.dto.ContainerSimpleDTO</a-hint>
<b-hint>org.ourproject.kune.platf.server.domain.Container</b-hint>
</field>
+
+ <field>
+ <a get-method="getStateToken">stateToken</a>
+ <b>stateToken</b>
+ </field>
</mapping>
<mapping>
@@ -292,5 +317,15 @@
<class-a>org.ourproject.kune.platf.client.dto.ChatUserParamsDTO</class-a>
<class-b>org.ourproject.kune.platf.server.domain.ChatUserParams</class-b>
</mapping>
-
+
+ <mapping>
+ <class-a>org.ourproject.kune.platf.client.dto.ContentStatusDTO</class-a>
+ <class-b>org.ourproject.kune.platf.server.domain.ContentStatus</class-b>
+ </mapping>
+
+ <mapping>
+ <class-a>org.ourproject.kune.platf.client.dto.AccessRolDTO</class-a>
+ <class-b>org.ourproject.kune.platf.server.access.AccessRol</class-b>
+ </mapping>
+
</mappings>
\ No newline at end of file
Modified: trunk/src/test/java/org/ourproject/kune/platf/client/state/StateTokenTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/state/StateTokenTest.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/state/StateTokenTest.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -1,5 +1,7 @@
package org.ourproject.kune.platf.client.state;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import org.junit.Test;
@@ -9,10 +11,31 @@
@Test
public void checkAllEmpty() {
- StateToken token = new StateToken("");
+ final StateToken token = new StateToken("");
assertNull(token.getGroup());
assertNull(token.getTool());
assertNull(token.getFolder());
assertNull(token.getDocument());
}
+
+ @Test
+ public void checkEquals() {
+ final StateToken token1 = new StateToken("abc", "da", "1", "1");
+ final StateToken token2 = new StateToken("abc", "da", "1", "1");
+ assertEquals(token1, token2);
+ }
+
+ @Test
+ public void checkEqualsEncoded() {
+ final StateToken token1 = new StateToken("abc.da.1.1");
+ final StateToken token2 = new StateToken("abc.da.1.1");
+ assertEquals(token1, token2);
+ }
+
+ @Test
+ public void checkNoEquals() {
+ final StateToken token1 = new StateToken("abc", "da", "1", "1");
+ final StateToken token2 = new StateToken("abc", "da", 1l);
+ assertFalse(token1.equals(token2));
+ }
}
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceAddTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceAddTest.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceAddTest.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -9,6 +9,7 @@
import org.junit.Test;
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.ContainerDTO;
+import org.ourproject.kune.platf.client.dto.ContainerSimpleDTO;
import org.ourproject.kune.platf.client.dto.ContentDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
@@ -68,8 +69,7 @@
assertNotNull(newState);
final ContainerDTO parentAgain = getDefaultContent().getFolder();
- final ContainerDTO child = parentAgain.getChilds().get(0);
- assertEquals(parent.getAbsolutePath().length + 1, child.getAbsolutePath().length);
+ final ContainerSimpleDTO child = parentAgain.getChilds().get(0);
assertEquals(parent.getId(), child.getParentFolderId());
assertEquals(parent.getId(), parentAgain.getId());
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceGetTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceGetTest.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceGetTest.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -67,8 +67,7 @@
@Test(expected = ContentNotFoundException.class)
public void nonExistentContent4() throws Exception {
final StateDTO stateDTO = getDefaultContent();
- stateDTO.setDocumentId("foofoo");
- contentService.getContent(null, groupName, stateDTO.getStateToken());
+ contentService.getContent(null, groupName, stateDTO.getStateToken().clone().setDocument("dadaas"));
}
@Test(expected = ContentNotFoundException.class)
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceVariousTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceVariousTest.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceVariousTest.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -7,6 +7,7 @@
import org.junit.Before;
import org.junit.Test;
import org.ourproject.kune.platf.client.dto.ContainerDTO;
+import org.ourproject.kune.platf.client.dto.ContainerSimpleDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.dto.TagResultDTO;
@@ -65,7 +66,7 @@
String newTitle = "folder new name";
final StateDTO newState = contentService.addFolder(session.getHash(), groupShortName, folder.getId(), oldTitle);
- final ContainerDTO newFolder = newState.getFolder().getChilds().get(0);
+ final ContainerSimpleDTO newFolder = newState.getFolder().getChilds().get(0);
assertEquals(oldTitle, newFolder.getName());
@@ -166,7 +167,7 @@
String newTitle = "folder new name";
final StateDTO newState = contentService.addFolder(session.getHash(), groupShortName, folder.getId(), oldTitle);
- final ContainerDTO newFolder = newState.getFolder().getChilds().get(0);
+ final ContainerSimpleDTO newFolder = newState.getFolder().getChilds().get(0);
assertEquals(oldTitle, newFolder.getName());
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java 2008-09-10 04:51:49 UTC (rev 866)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java 2008-09-12 08:06:29 UTC (rev 867)
@@ -19,6 +19,7 @@
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.dto.LinkDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.server.TestDomainHelper;
import org.ourproject.kune.platf.server.TestHelper;
import org.ourproject.kune.platf.server.access.AccessRights;
@@ -37,6 +38,8 @@
import com.google.inject.Inject;
public class MapperTest {
+ private static final String TESTTOOL = "docs";
+ private static final String TESTGROUPSHORTNAME = "grouptest";
@Inject
Mapper mapper;
@Inject
@@ -49,7 +52,7 @@
@Test
public void testCommentMapper() {
- final Content d = createTestContent();
+ final Content d = createDefContent();
final Comment comment = new Comment();
comment.setContent(d);
comment.setText("Some text");
@@ -84,24 +87,23 @@
@Test
public void testContentDescriptorMapping() {
- final Content d = new Content();
- d.setId(1l);
- final Revision revision = new Revision(d);
- revision.setTitle("title");
- d.addRevision(revision);
+ final Content d = createDefContent();
+ final StateToken expectedToken = new StateToken(TESTGROUPSHORTNAME, TESTTOOL, "1", "1");
+ assertEquals(expectedToken, d.getStateToken());
final ContentDTO dto = mapper.map(d, ContentDTO.class);
assertEquals(1, (long) dto.getId());
assertEquals("title", dto.getTitle());
+ assertEquals(expectedToken, dto.getStateToken());
}
@Test
public void testContentDescriptorToLinkMapping() {
- final Content d = createTestContent();
+ final Content d = createDefContent();
final LinkDTO dto = mapper.map(d, LinkDTO.class);
assertEquals("title", dto.getLongName());
- assertEquals("grouptest", dto.getShortName());
+ assertEquals(TESTGROUPSHORTNAME, dto.getShortName());
assertEquals("grouptest.docs.1.1", dto.getLink());
}
@@ -131,13 +133,15 @@
@Test
public void testFolderMapping() {
- final Container container = new Container();
- container.addChild(new Container());
- container.addChild(new Container());
- container.addContent(new Content());
- container.addContent(new Content());
- container.addContent(new Content());
- final Container containerChild = new Container();
+ final Container container = createDefContainer();
+ final StateToken expectedToken = new StateToken(TESTGROUPSHORTNAME, TESTTOOL, 1l);
+ assertEquals(expectedToken, container.getStateToken());
+ container.addChild(createDefContainer());
+ container.addChild(createDefContainer());
+ container.addContent(createDefContent());
+ container.addContent(createDefContent());
+ container.addContent(createDefContent());
+ final Container containerChild = createDefContainer();
container.addChild(containerChild);
final List<Container> absolutePathChild = new ArrayList<Container>();
absolutePathChild.add(container);
@@ -147,7 +151,11 @@
assertEquals(3, dto.getChilds().size());
assertEquals(3, dto.getContents().size());
assertTrue(dto.getContents().get(0) instanceof ContentDTO);
- assertTrue(dto.getChilds().get(0) instanceof ContainerDTO);
+ assertTrue(dto.getChilds().get(0) instanceof ContainerSimpleDTO);
+ assertEquals(new StateToken(TESTGROUPSHORTNAME, TESTTOOL), dto.getChilds().get(0).getStateToken().clone()
+ .clearFolder());
+ assertEquals(expectedToken, dto.getContents().get(0).getStateToken().clone().clearDocument());
+ assertEquals(expectedToken, dto.getStateToken());
final ContainerDTO dtoChild = mapper.map(containerChild, ContainerDTO.class);
assertTrue(dtoChild.getAbsolutePath()[0] instanceof ContainerSimpleDTO);
@@ -200,6 +208,17 @@
}
@Test
+ public void testStateTokenInStateMap() {
+ final StateToken stateToken = new StateToken(TESTGROUPSHORTNAME, TESTTOOL, "1", "2");
+ final StateToken stateTokenMapped = mapper.map(stateToken, StateToken.class);
+ assertEquals(stateToken, stateTokenMapped);
+ final State state = new State();
+ state.setStateToken(stateToken);
+ final StateDTO stateDTO = mapper.map(state, StateDTO.class);
+ assertEquals(stateToken, stateDTO.getStateToken());
+ }
+
+ @Test
public void testUserToLinkMappping() {
final User user = new User("shortName", "longName", "", "", null, null, null);
final LinkDTO dto = mapper.map(user, LinkDTO.class);
@@ -232,13 +251,21 @@
}
}
- private Content createTestContent() {
- final Group group = new Group("grouptest", "This is a group Test");
+ private Container createDefContainer() {
+ return createDefContainer(createDeGroup());
+ }
+
+ private Container createDefContainer(final Group group) {
final Container container = new Container();
container.setId(1l);
- container.setToolName("docs");
+ container.setToolName(TESTTOOL);
container.setOwner(group);
container.setName("folder");
+ return container;
+ }
+
+ private Content createDefContent() {
+ final Container container = createDefContainer(createDeGroup());
final Content d = new Content();
d.setId(1l);
final Revision revision = new Revision(d);
@@ -247,4 +274,9 @@
d.setContainer(container);
return d;
}
+
+ private Group createDeGroup() {
+ final Group group = new Group(TESTGROUPSHORTNAME, "This is a group Test");
+ return group;
+ }
}
1
0
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@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/4d38… -->
<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;
+
+@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>
1
0
Author: vjrj
Date: 2008-09-09 20:00:21 +0200 (Tue, 09 Sep 2008)
New Revision: 865
Added:
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/Ext.ux.UploadDialog.js
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/Ext.ux.UploadDialog.packed.js
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/css/
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/css/Ext.ux.UploadDialog.css
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/dox/
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/dox/automata-protocol.dia
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/dox/automata-protocol.jpeg
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/check.gif
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/done.gif
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/failed.gif
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/file-add.gif
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/file-remove.gif
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/file-uploading.gif
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/loading.gif
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/reset.gif
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/uncheck.gif
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/upload-start.gif
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/upload-stop.gif
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/locale/
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/locale/ru.utf-8.js
trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/readme.txt
trunk/src/main/java/org/ourproject/kune/app/public/js/ext-ux-all-min.js
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/FileUploader.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/FileUploaderDialog.java
Modified:
trunk/pom.xml
trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml
trunk/src/main/java/org/ourproject/kune/app/public/Kune.html
trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileUploadManagerDefault.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigator.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
Log:
new gwt-ext 2.0.5 (gwt 1.5.2 compatible), new UploadDialog, new gwtcomp file servlet, other bug/issues
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2008-09-08 01:52:25 UTC (rev 864)
+++ trunk/pom.xml 2008-09-09 18:00:21 UTC (rev 865)
@@ -31,16 +31,14 @@
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
- <version>1.5.0</version>
+ <version>1.5.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
- <version>1.5.0</version>
+ <version>1.5.2</version>
</dependency>
- <!-- Use new repo -->
- <!-- http://code.google.com/p/gwt-ext/issues/detail?id=180 -->
<!--
<dependency>
<groupId>com.extjs</groupId>
@@ -51,9 +49,14 @@
<dependency>
<groupId>com.gwtext</groupId>
<artifactId>gwtext</artifactId>
- <version>2.0.4</version>
+ <version>2.0.5</version>
</dependency>
<dependency>
+ <groupId>com.gwtextux</groupId>
+ <artifactId>gwtextux</artifactId>
+ <version>0.3.0</version>
+ </dependency>
+ <dependency>
<groupId>com.allen_sauer.gwt.log.gwt-log</groupId>
<artifactId>gwt-log</artifactId>
<version>2.5.2</version>
@@ -196,12 +199,12 @@
<dependency>
<groupId>org.cafesip.gwtcomp</groupId>
<artifactId>gwtcomp</artifactId>
- <version>0.0.2b</version>
+ <version>0.0.3b</version>
</dependency>
<dependency>
<groupId>org.cafesip.gwtcomp</groupId>
<artifactId>gwtcomp-servlet</artifactId>
- <version>0.0.2b</version>
+ <version>0.0.3b</version>
</dependency>
<!-- db upgrades -->
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-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml 2008-09-09 18:00:21 UTC (rev 865)
@@ -17,6 +17,12 @@
<inherits name='com.gwtext.GwtExt' />
<script src="js/ext/adapter/ext/ext-base.js" />
<script src="js/ext/ext-all.js" />
+
+ <inherits name="com.gwtextux.GwtExtUx" />
+ <inherits name="com.gwtextux.UploadDialog"/>
+ <script src="js/UploadDialog/Ext.ux.UploadDialog.packed.js" />
+ <stylesheet src="js/UploadDialog/css/Ext.ux.UploadDialog.css" />
+ <script src="js/ext-ux-all-min.js" />
<!-- kune css -->
<stylesheet src="css/all.css" />
Modified: trunk/src/main/java/org/ourproject/kune/app/public/Kune.html
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/Kune.html 2008-09-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/app/public/Kune.html 2008-09-09 18:00:21 UTC (rev 865)
@@ -25,7 +25,6 @@
top: 2px;
left: 2px;
z-index: 30000;
- font-family: arial,sans;
}
.kune-Progress {
@@ -34,6 +33,7 @@
white-space: nowrap;
height: 16px;
padding: 0 3px;
+ font-family: arial,sans;
}
</style>
@@ -57,7 +57,7 @@
src="images/spin-kune-thund-green.gif"
style="height: 16px; width: 16px;" /></td>
<td align="left" style="vertical-align: top;" class="kune-Progress">
- <div class="kune-SiteBarPanel gwt-Label" id="kuneprogresstext">Starting</div>
+ <div class="k-sitebar gwt-Label" id="kuneprogresstext">Starting</div>
</td>
<td width="100%" height="16" align="left"
style="vertical-align: top;"></td>
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-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-09-09 18:00:21 UTC (rev 865)
@@ -2897,7 +2897,7 @@
border-left-width: 5px;
}
-.k-EntityTextLogo {
+.k-entitytextlogo {
border: 2px solid #F2F2F2;
height: 60px;
margin: 0 0 4px -1px;
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-09-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-09-09 18:00:21 UTC (rev 865)
@@ -62,7 +62,7 @@
border-left-width: 5px;
}
-.k-EntityTextLogo {
+.k-entitytextlogo {
border: 2px solid #F2F2F2;
height: 60px;
margin: 0 0 4px -1px;
Added: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/Ext.ux.UploadDialog.js
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/Ext.ux.UploadDialog.js 2008-09-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/Ext.ux.UploadDialog.js 2008-09-09 18:00:21 UTC (rev 865)
@@ -0,0 +1,1540 @@
+/**
+ * This namespace should be in another file but I dicided to put it here for consistancy.
+ */
+Ext.namespace('Ext.ux.Utils');
+
+/**
+ * This class implements event queue behaviour.
+ *
+ * @class Ext.ux.Utils.EventQueue
+ * @param function handler Event handler.
+ * @param object scope Handler scope.
+ */
+Ext.ux.Utils.EventQueue = function(handler, scope)
+{
+ if (!handler) {
+ throw 'Handler is required.';
+ }
+ this.handler = handler;
+ this.scope = scope || window;
+ this.queue = [];
+ this.is_processing = false;
+
+ /**
+ * Posts event into the queue.
+ *
+ * @access public
+ * @param mixed event Event identificator.
+ * @param mixed data Event data.
+ */
+ this.postEvent = function(event, data)
+ {
+ data = data || null;
+ this.queue.push({event: event, data: data});
+ if (!this.is_processing) {
+ this.process();
+ }
+ }
+
+ this.flushEventQueue = function()
+ {
+ this.queue = [];
+ },
+
+ /**
+ * @access private
+ */
+ this.process = function()
+ {
+ while (this.queue.length > 0) {
+ this.is_processing = true;
+ var event_data = this.queue.shift();
+ this.handler.call(this.scope, event_data.event, event_data.data);
+ }
+ this.is_processing = false;
+ }
+}
+
+/**
+ * This class implements Mili's finite state automata behaviour.
+ *
+ * Transition / output table format:
+ * {
+ * 'state_1' : {
+ * 'event_1' : [
+ * {
+ * p|predicate: function, // Transition predicate, optional, default to true.
+ * // If array then conjunction will be applyed to the operands.
+ * // Predicate signature is (data, event, this).
+ * a|action: function|array, // Transition action, optional, default to Ext.emptyFn.
+ * // If array then methods will be called sequentially.
+ * // Action signature is (data, event, this).
+ * s|state: 'state_x', // New state - transition destination, optional, default to
+ * // current state.
+ * scope: object // Predicate and action scope, optional, default to
+ * // trans_table_scope or window.
+ * }
+ * ]
+ * },
+ *
+ * 'state_2' : {
+ * ...
+ * }
+ * ...
+ * }
+ *
+ * @param mixed initial_state Initial state.
+ * @param object trans_table Transition / output table.
+ * @param trans_table_scope Transition / output table's methods scope.
+ */
+Ext.ux.Utils.FSA = function(initial_state, trans_table, trans_table_scope)
+{
+ this.current_state = initial_state;
+ this.trans_table = trans_table || {};
+ this.trans_table_scope = trans_table_scope || window;
+ Ext.ux.Utils.FSA.superclass.constructor.call(this, this.processEvent, this);
+}
+
+Ext.extend(Ext.ux.Utils.FSA, Ext.ux.Utils.EventQueue, {
+
+ current_state : null,
+ trans_table : null,
+ trans_table_scope : null,
+
+ /**
+ * Returns current state
+ *
+ * @access public
+ * @return mixed Current state.
+ */
+ state : function()
+ {
+ return this.current_state;
+ },
+
+ /**
+ * @access public
+ */
+ processEvent : function(event, data)
+ {
+ var transitions = this.currentStateEventTransitions(event);
+ if (!transitions) {
+ throw "State '" + this.current_state + "' has no transition for event '" + event + "'.";
+ }
+ for (var i = 0, len = transitions.length; i < len; i++) {
+ var transition = transitions[i];
+
+ var predicate = transition.predicate || transition.p || true;
+ var action = transition.action || transition.a || Ext.emptyFn;
+ var new_state = transition.state || transition.s || this.current_state;
+ var scope = transition.scope || this.trans_table_scope;
+
+ if (this.computePredicate(predicate, scope, data, event)) {
+ this.callAction(action, scope, data, event);
+ this.current_state = new_state;
+ return;
+ }
+ }
+
+ throw "State '" + this.current_state + "' has no transition for event '" + event + "' in current context";
+ },
+
+ /**
+ * @access private
+ */
+ currentStateEventTransitions : function(event)
+ {
+ return this.trans_table[this.current_state] ?
+ this.trans_table[this.current_state][event] || false
+ :
+ false;
+ },
+
+ /**
+ * @access private
+ */
+ computePredicate : function(predicate, scope, data, event)
+ {
+ var result = false;
+
+ switch (Ext.type(predicate)) {
+ case 'function':
+ result = predicate.call(scope, data, event, this);
+ break;
+ case 'array':
+ result = true;
+ for (var i = 0, len = predicate.length; result && (i < len); i++) {
+ if (Ext.type(predicate[i]) == 'function') {
+ result = predicate[i].call(scope, data, event, this);
+ }
+ else {
+ throw [
+ 'Predicate: ',
+ predicate[i],
+ ' is not callable in "',
+ this.current_state,
+ '" state for event "',
+ event
+ ].join('');
+ }
+ }
+ break;
+ case 'boolean':
+ result = predicate;
+ break;
+ default:
+ throw [
+ 'Predicate: ',
+ predicate,
+ ' is not callable in "',
+ this.current_state,
+ '" state for event "',
+ event
+ ].join('');
+ }
+ return result;
+ },
+
+ /**
+ * @access private
+ */
+ callAction : function(action, scope, data, event)
+ {
+ switch (Ext.type(action)) {
+ case 'array':
+ for (var i = 0, len = action.length; i < len; i++) {
+ if (Ext.type(action[i]) == 'function') {
+ action[i].call(scope, data, event, this);
+ }
+ else {
+ throw [
+ 'Action: ',
+ action[i],
+ ' is not callable in "',
+ this.current_state,
+ '" state for event "',
+ event
+ ].join('');
+ }
+ }
+ break;
+ case 'function':
+ action.call(scope, data, event, this);
+ break;
+ default:
+ throw [
+ 'Action: ',
+ action,
+ ' is not callable in "',
+ this.current_state,
+ '" state for event "',
+ event
+ ].join('');
+ }
+ }
+});
+
+// ---------------------------------------------------------------------------------------------- //
+
+/**
+ * Ext.ux.UploadDialog namespace.
+ */
+Ext.namespace('Ext.ux.UploadDialog');
+
+/**
+ * File upload browse button.
+ *
+ * @class Ext.ux.UploadDialog.BrowseButton
+ */
+Ext.ux.UploadDialog.BrowseButton = Ext.extend(Ext.Button,
+{
+ input_name : 'file',
+
+ input_file : null,
+
+ original_handler : null,
+
+ original_scope : null,
+
+ /**
+ * @access private
+ */
+ initComponent : function()
+ {
+ Ext.ux.UploadDialog.BrowseButton.superclass.initComponent.call(this);
+ this.original_handler = this.handler || null;
+ this.original_scope = this.scope || window;
+ this.handler = null;
+ this.scope = null;
+ },
+
+ /**
+ * @access private
+ */
+ onRender : function(ct, position)
+ {
+ Ext.ux.UploadDialog.BrowseButton.superclass.onRender.call(this, ct, position);
+ this.createInputFile();
+ },
+
+ /**
+ * @access private
+ */
+ createInputFile : function()
+ {
+ var button_container = this.el.child('.x-btn-center');
+ button_container.position('relative');
+ this.input_file = Ext.DomHelper.append(
+ button_container,
+ {
+ tag: 'input',
+ type: 'file',
+ size: 1,
+ name: this.input_name || Ext.id(this.el),
+ style: 'position: absolute; display: block; border: none; cursor: pointer'
+ },
+ true
+ );
+
+ var button_box = button_container.getBox();
+ this.input_file.setStyle('font-size', (button_box.width * 0.5) + 'px');
+
+ var input_box = this.input_file.getBox();
+ var adj = {x: 3, y: 3}
+ if (Ext.isIE) {
+ adj = {x: 0, y: 3}
+ }
+
+ this.input_file.setLeft(button_box.width - input_box.width + adj.x + 'px');
+ this.input_file.setTop(button_box.height - input_box.height + adj.y + 'px');
+ this.input_file.setOpacity(0.0);
+
+ if (this.handleMouseEvents) {
+ this.input_file.on('mouseover', this.onMouseOver, this);
+ this.input_file.on('mousedown', this.onMouseDown, this);
+ }
+
+ if(this.tooltip){
+ if(typeof this.tooltip == 'object'){
+ Ext.QuickTips.register(Ext.apply({target: this.input_file}, this.tooltip));
+ }
+ else {
+ this.input_file.dom[this.tooltipType] = this.tooltip;
+ }
+ }
+
+ this.input_file.on('change', this.onInputFileChange, this);
+ this.input_file.on('click', function(e) { e.stopPropagation(); });
+ },
+
+ /**
+ * @access public
+ */
+ detachInputFile : function(no_create)
+ {
+ var result = this.input_file;
+
+ no_create = no_create || false;
+
+ if (typeof this.tooltip == 'object') {
+ Ext.QuickTips.unregister(this.input_file);
+ }
+ else {
+ this.input_file.dom[this.tooltipType] = null;
+ }
+ this.input_file.removeAllListeners();
+ this.input_file = null;
+
+ if (!no_create) {
+ this.createInputFile();
+ }
+ return result;
+ },
+
+ /**
+ * @access public
+ */
+ getInputFile : function()
+ {
+ return this.input_file;
+ },
+
+ /**
+ * @access public
+ */
+ disable : function()
+ {
+ Ext.ux.UploadDialog.BrowseButton.superclass.disable.call(this);
+ this.input_file.dom.disabled = true;
+ },
+
+ /**
+ * @access public
+ */
+ enable : function()
+ {
+ Ext.ux.UploadDialog.BrowseButton.superclass.enable.call(this);
+ this.input_file.dom.disabled = false;
+ },
+
+ /**
+ * @access public
+ */
+ destroy : function()
+ {
+ var input_file = this.detachInputFile(true);
+ input_file.remove();
+ input_file = null;
+ Ext.ux.UploadDialog.BrowseButton.superclass.destroy.call(this);
+ },
+
+ /**
+ * @access private
+ */
+ onInputFileChange : function()
+ {
+ if (this.original_handler) {
+ this.original_handler.call(this.original_scope, this);
+ }
+ }
+});
+
+/**
+ * Toolbar file upload browse button.
+ *
+ * @class Ext.ux.UploadDialog.TBBrowseButton
+ */
+Ext.ux.UploadDialog.TBBrowseButton = Ext.extend(Ext.ux.UploadDialog.BrowseButton,
+{
+ hideParent : true,
+
+ onDestroy : function()
+ {
+ Ext.ux.UploadDialog.TBBrowseButton.superclass.onDestroy.call(this);
+ if(this.container) {
+ this.container.remove();
+ }
+ }
+});
+
+/**
+ * Record type for dialogs grid.
+ *
+ * @class Ext.ux.UploadDialog.FileRecord
+ */
+Ext.ux.UploadDialog.FileRecord = Ext.data.Record.create([
+ {name: 'filename'},
+ {name: 'state', type: 'int'},
+ {name: 'note'},
+ {name: 'input_element'}
+]);
+
+Ext.ux.UploadDialog.FileRecord.STATE_QUEUE = 0;
+Ext.ux.UploadDialog.FileRecord.STATE_FINISHED = 1;
+Ext.ux.UploadDialog.FileRecord.STATE_FAILED = 2;
+Ext.ux.UploadDialog.FileRecord.STATE_PROCESSING = 3;
+
+/**
+ * Dialog class.
+ *
+ * @class Ext.ux.UploadDialog.Dialog
+ */
+Ext.ux.UploadDialog.Dialog = function(config)
+{
+ var default_config = {
+ border: false,
+ width: 450,
+ height: 300,
+ minWidth: 450,
+ minHeight: 300,
+ plain: true,
+ constrainHeader: true,
+ draggable: true,
+ closable: true,
+ maximizable: false,
+ minimizable: false,
+ resizable: true,
+ autoDestroy: true,
+ closeAction: 'hide',
+ title: this.i18n.title,
+ cls: 'ext-ux-uploaddialog-dialog',
+ // --------
+ url: '',
+ base_params: {},
+ permitted_extensions: [],
+ reset_on_hide: true,
+ allow_close_on_upload: false,
+ upload_autostart: false,
+ post_var_name: 'file'
+ }
+ config = Ext.applyIf(config || {}, default_config);
+ config.layout = 'absolute';
+
+ Ext.ux.UploadDialog.Dialog.superclass.constructor.call(this, config);
+}
+
+Ext.extend(Ext.ux.UploadDialog.Dialog, Ext.Window, {
+
+ fsa : null,
+
+ state_tpl : null,
+
+ form : null,
+
+ grid_panel : null,
+
+ progress_bar : null,
+
+ is_uploading : false,
+
+ initial_queued_count : 0,
+
+ upload_frame : null,
+
+ /**
+ * @access private
+ */
+ //--------------------------------------------------------------------------------------------- //
+ initComponent : function()
+ {
+ Ext.ux.UploadDialog.Dialog.superclass.initComponent.call(this);
+
+ // Setting automata protocol
+ var tt = {
+ // --------------
+ 'created' : {
+ // --------------
+ 'window-render' : [
+ {
+ action: [this.createForm, this.createProgressBar, this.createGrid],
+ state: 'rendering'
+ }
+ ],
+ 'destroy' : [
+ {
+ action: this.flushEventQueue,
+ state: 'destroyed'
+ }
+ ]
+ },
+ // --------------
+ 'rendering' : {
+ // --------------
+ 'grid-render' : [
+ {
+ action: [this.fillToolbar, this.updateToolbar],
+ state: 'ready'
+ }
+ ],
+ 'destroy' : [
+ {
+ action: this.flushEventQueue,
+ state: 'destroyed'
+ }
+ ]
+ },
+ // --------------
+ 'ready' : {
+ // --------------
+ 'file-selected' : [
+ {
+ predicate: [this.fireFileTestEvent, this.isPermittedFile],
+ action: this.addFileToUploadQueue,
+ state: 'adding-file'
+ },
+ {
+ // If file is not permitted then do nothing.
+ }
+ ],
+ 'grid-selection-change' : [
+ {
+ action: this.updateToolbar
+ }
+ ],
+ 'remove-files' : [
+ {
+ action: [this.removeFiles, this.fireFileRemoveEvent]
+ }
+ ],
+ 'reset-queue' : [
+ {
+ action: [this.resetQueue, this.fireResetQueueEvent]
+ }
+ ],
+ 'start-upload' : [
+ {
+ predicate: this.hasUnuploadedFiles,
+ action: [
+ this.setUploadingFlag, this.saveInitialQueuedCount, this.updateToolbar,
+ this.updateProgressBar, this.prepareNextUploadTask, this.fireUploadStartEvent
+ ],
+ state: 'uploading'
+ },
+ {
+ // Has nothing to upload, do nothing.
+ }
+ ],
+ 'stop-upload' : [
+ {
+ // We are not uploading, do nothing. Can be posted by user only at this state.
+ }
+ ],
+ 'hide' : [
+ {
+ predicate: [this.isNotEmptyQueue, this.getResetOnHide],
+ action: [this.resetQueue, this.fireResetQueueEvent]
+ },
+ {
+ // Do nothing
+ }
+ ],
+ 'destroy' : [
+ {
+ action: this.flushEventQueue,
+ state: 'destroyed'
+ }
+ ]
+ },
+ // --------------
+ 'adding-file' : {
+ // --------------
+ 'file-added' : [
+ {
+ predicate: this.isUploading,
+ action: [this.incInitialQueuedCount, this.updateProgressBar, this.fireFileAddEvent],
+ state: 'uploading'
+ },
+ {
+ predicate: this.getUploadAutostart,
+ action: [this.startUpload, this.fireFileAddEvent],
+ state: 'ready'
+ },
+ {
+ action: [this.updateToolbar, this.fireFileAddEvent],
+ state: 'ready'
+ }
+ ]
+ },
+ // --------------
+ 'uploading' : {
+ // --------------
+ 'file-selected' : [
+ {
+ predicate: [this.fireFileTestEvent, this.isPermittedFile],
+ action: this.addFileToUploadQueue,
+ state: 'adding-file'
+ },
+ {
+ // If file is not permitted then do nothing.
+ }
+ ],
+ 'grid-selection-change' : [
+ {
+ // Do nothing.
+ }
+ ],
+ 'start-upload' : [
+ {
+ // Can be posted only by user in this state.
+ }
+ ],
+ 'stop-upload' : [
+ {
+ predicate: this.hasUnuploadedFiles,
+ action: [
+ this.resetUploadingFlag, this.abortUpload, this.updateToolbar,
+ this.updateProgressBar, this.fireUploadStopEvent
+ ],
+ state: 'ready'
+ },
+ {
+ action: [
+ this.resetUploadingFlag, this.abortUpload, this.updateToolbar,
+ this.updateProgressBar, this.fireUploadStopEvent, this.fireUploadCompleteEvent
+ ],
+ state: 'ready'
+ }
+ ],
+ 'file-upload-start' : [
+ {
+ action: [this.uploadFile, this.findUploadFrame, this.fireFileUploadStartEvent]
+ }
+ ],
+ 'file-upload-success' : [
+ {
+ predicate: this.hasUnuploadedFiles,
+ action: [
+ this.resetUploadFrame, this.updateRecordState, this.updateProgressBar,
+ this.prepareNextUploadTask, this.fireUploadSuccessEvent
+ ]
+ },
+ {
+ action: [
+ this.resetUploadFrame, this.resetUploadingFlag, this.updateRecordState,
+ this.updateToolbar, this.updateProgressBar, this.fireUploadSuccessEvent,
+ this.fireUploadCompleteEvent
+ ],
+ state: 'ready'
+ }
+ ],
+ 'file-upload-error' : [
+ {
+ predicate: this.hasUnuploadedFiles,
+ action: [
+ this.resetUploadFrame, this.updateRecordState, this.updateProgressBar,
+ this.prepareNextUploadTask, this.fireUploadErrorEvent
+ ]
+ },
+ {
+ action: [
+ this.resetUploadFrame, this.resetUploadingFlag, this.updateRecordState,
+ this.updateToolbar, this.updateProgressBar, this.fireUploadErrorEvent,
+ this.fireUploadCompleteEvent
+ ],
+ state: 'ready'
+ }
+ ],
+ 'file-upload-failed' : [
+ {
+ predicate: this.hasUnuploadedFiles,
+ action: [
+ this.resetUploadFrame, this.updateRecordState, this.updateProgressBar,
+ this.prepareNextUploadTask, this.fireUploadFailedEvent
+ ]
+ },
+ {
+ action: [
+ this.resetUploadFrame, this.resetUploadingFlag, this.updateRecordState,
+ this.updateToolbar, this.updateProgressBar, this.fireUploadFailedEvent,
+ this.fireUploadCompleteEvent
+ ],
+ state: 'ready'
+ }
+ ],
+ 'hide' : [
+ {
+ predicate: this.getResetOnHide,
+ action: [this.stopUpload, this.repostHide]
+ },
+ {
+ // Do nothing.
+ }
+ ],
+ 'destroy' : [
+ {
+ predicate: this.hasUnuploadedFiles,
+ action: [
+ this.resetUploadingFlag, this.abortUpload,
+ this.fireUploadStopEvent, this.flushEventQueue
+ ],
+ state: 'destroyed'
+ },
+ {
+ action: [
+ this.resetUploadingFlag, this.abortUpload,
+ this.fireUploadStopEvent, this.fireUploadCompleteEvent, this.flushEventQueue
+ ],
+ state: 'destroyed'
+ }
+ ]
+ },
+ // --------------
+ 'destroyed' : {
+ // --------------
+ }
+ }
+ this.fsa = new Ext.ux.Utils.FSA('created', tt, this);
+
+ // Registering dialog events.
+ this.addEvents({
+ 'filetest': true,
+ 'fileadd' : true,
+ 'fileremove' : true,
+ 'resetqueue' : true,
+ 'uploadsuccess' : true,
+ 'uploaderror' : true,
+ 'uploadfailed' : true,
+ 'uploadstart' : true,
+ 'uploadstop' : true,
+ 'uploadcomplete' : true,
+ 'fileuploadstart' : true
+ });
+
+ // Attaching to window events.
+ this.on('render', this.onWindowRender, this);
+ this.on('beforehide', this.onWindowBeforeHide, this);
+ this.on('hide', this.onWindowHide, this);
+ this.on('destroy', this.onWindowDestroy, this);
+
+ // Compiling state template.
+ this.state_tpl = new Ext.Template(
+ "<div class='ext-ux-uploaddialog-state ext-ux-uploaddialog-state-{state}'> </div>"
+ ).compile();
+ },
+
+ createForm : function()
+ {
+ this.form = Ext.DomHelper.append(this.body, {
+ tag: 'form',
+ method: 'post',
+ action: this.url,
+ style: 'position: absolute; left: -100px; top: -100px; width: 100px; height: 100px'
+ });
+ },
+
+ createProgressBar : function()
+ {
+ this.progress_bar = this.add(
+ new Ext.ProgressBar({
+ x: 0,
+ y: 0,
+ anchor: '0',
+ value: 0.0,
+ text: this.i18n.progress_waiting_text
+ })
+ );
+ },
+
+ createGrid : function()
+ {
+ var store = new Ext.data.Store({
+ proxy: new Ext.data.MemoryProxy([]),
+ reader: new Ext.data.JsonReader({}, Ext.ux.UploadDialog.FileRecord),
+ sortInfo: {field: 'state', direction: 'DESC'},
+ pruneModifiedRecords: true
+ });
+
+ var cm = new Ext.grid.ColumnModel([
+ {
+ header: this.i18n.state_col_title,
+ width: this.i18n.state_col_width,
+ resizable: false,
+ dataIndex: 'state',
+ sortable: true,
+ renderer: this.renderStateCell.createDelegate(this)
+ },
+ {
+ header: this.i18n.filename_col_title,
+ width: this.i18n.filename_col_width,
+ dataIndex: 'filename',
+ sortable: true,
+ renderer: this.renderFilenameCell.createDelegate(this)
+ },
+ {
+ header: this.i18n.note_col_title,
+ width: this.i18n.note_col_width,
+ dataIndex: 'note',
+ sortable: true,
+ renderer: this.renderNoteCell.createDelegate(this)
+ }
+ ]);
+
+ this.grid_panel = new Ext.grid.GridPanel({
+ ds: store,
+ cm: cm,
+
+ x: 0,
+ y: 22,
+ anchor: '0 -22',
+ border: true,
+
+ viewConfig: {
+ autoFill: true,
+ forceFit: true
+ },
+
+ bbar : new Ext.Toolbar()
+ });
+ this.grid_panel.on('render', this.onGridRender, this);
+
+ this.add(this.grid_panel);
+
+ this.grid_panel.getSelectionModel().on('selectionchange', this.onGridSelectionChange, this);
+ },
+
+ fillToolbar : function()
+ {
+ var tb = this.grid_panel.getBottomToolbar();
+ tb.x_buttons = {}
+
+ tb.x_buttons.add = tb.addItem(new Ext.ux.UploadDialog.TBBrowseButton({
+ input_name: this.post_var_name,
+ text: this.i18n.add_btn_text,
+ tooltip: this.i18n.add_btn_tip,
+ iconCls: 'ext-ux-uploaddialog-addbtn',
+ handler: this.onAddButtonFileSelected,
+ scope: this
+ }));
+
+ tb.x_buttons.remove = tb.addButton({
+ text: this.i18n.remove_btn_text,
+ tooltip: this.i18n.remove_btn_tip,
+ iconCls: 'ext-ux-uploaddialog-removebtn',
+ handler: this.onRemoveButtonClick,
+ scope: this
+ });
+
+ tb.x_buttons.reset = tb.addButton({
+ text: this.i18n.reset_btn_text,
+ tooltip: this.i18n.reset_btn_tip,
+ iconCls: 'ext-ux-uploaddialog-resetbtn',
+ handler: this.onResetButtonClick,
+ scope: this
+ });
+
+ tb.add('-');
+
+ tb.x_buttons.upload = tb.addButton({
+ text: this.i18n.upload_btn_start_text,
+ tooltip: this.i18n.upload_btn_start_tip,
+ iconCls: 'ext-ux-uploaddialog-uploadstartbtn',
+ handler: this.onUploadButtonClick,
+ scope: this
+ });
+
+ tb.add('-');
+
+ tb.x_buttons.indicator = tb.addItem(
+ new Ext.Toolbar.Item(
+ Ext.DomHelper.append(tb.getEl(), {
+ tag: 'div',
+ cls: 'ext-ux-uploaddialog-indicator-stoped',
+ html: ' '
+ })
+ )
+ );
+
+ tb.add('->');
+
+ tb.x_buttons.close = tb.addButton({
+ text: this.i18n.close_btn_text,
+ tooltip: this.i18n.close_btn_tip,
+ handler: this.onCloseButtonClick,
+ scope: this
+ });
+ },
+
+ renderStateCell : function(data, cell, record, row_index, column_index, store)
+ {
+ return this.state_tpl.apply({state: data});
+ },
+
+ renderFilenameCell : function(data, cell, record, row_index, column_index, store)
+ {
+ var view = this.grid_panel.getView();
+ var f = function() {
+ try {
+ Ext.fly(
+ view.getCell(row_index, column_index)
+ ).child('.x-grid3-cell-inner').dom['qtip'] = data;
+ }
+ catch (e)
+ {}
+ }
+ f.defer(1000);
+ return data;
+ },
+
+ renderNoteCell : function(data, cell, record, row_index, column_index, store)
+ {
+ var view = this.grid_panel.getView();
+ var f = function() {
+ try {
+ Ext.fly(
+ view.getCell(row_index, column_index)
+ ).child('.x-grid3-cell-inner').dom['qtip'] = data;
+ }
+ catch (e)
+ {}
+ }
+ f.defer(1000);
+ return data;
+ },
+
+ getFileExtension : function(filename)
+ {
+ var result = null;
+ var parts = filename.split('.');
+ if (parts.length > 1) {
+ result = parts.pop();
+ }
+ return result;
+ },
+
+ isPermittedFileType : function(filename)
+ {
+ var result = true;
+ if (this.permitted_extensions.length > 0) {
+ result = this.permitted_extensions.indexOf(this.getFileExtension(filename)) != -1;
+ }
+ return result;
+ },
+
+ isPermittedFile : function(browse_btn)
+ {
+ var result = false;
+ var filename = browse_btn.getInputFile().dom.value;
+
+ if (this.isPermittedFileType(filename)) {
+ result = true;
+ }
+ else {
+ Ext.Msg.alert(
+ this.i18n.error_msgbox_title,
+ String.format(
+ this.i18n.err_file_type_not_permitted,
+ filename,
+ this.permitted_extensions.join(this.i18n.permitted_extensions_join_str)
+ )
+ );
+ result = false;
+ }
+
+ return result;
+ },
+
+ fireFileTestEvent : function(browse_btn)
+ {
+ return this.fireEvent('filetest', this, browse_btn.getInputFile().dom.value) !== false;
+ },
+
+ addFileToUploadQueue : function(browse_btn)
+ {
+ var input_file = browse_btn.detachInputFile();
+
+ input_file.appendTo(this.form);
+ input_file.setStyle('width', '100px');
+ input_file.dom.disabled = true;
+
+ var store = this.grid_panel.getStore();
+ store.add(
+ new Ext.ux.UploadDialog.FileRecord({
+ state: Ext.ux.UploadDialog.FileRecord.STATE_QUEUE,
+ filename: input_file.dom.value,
+ note: this.i18n.note_queued_to_upload,
+ input_element: input_file
+ })
+ );
+ this.fsa.postEvent('file-added', input_file.dom.value);
+ },
+
+ fireFileAddEvent : function(filename)
+ {
+ this.fireEvent('fileadd', this, filename);
+ },
+
+ updateProgressBar : function()
+ {
+ if (this.is_uploading) {
+ var queued = this.getQueuedCount(true);
+ var value = 1 - queued / this.initial_queued_count;
+ this.progress_bar.updateProgress(
+ value,
+ String.format(
+ this.i18n.progress_uploading_text,
+ this.initial_queued_count - queued,
+ this.initial_queued_count
+ )
+ );
+ }
+ else {
+ this.progress_bar.updateProgress(0, this.i18n.progress_waiting_text);
+ }
+ },
+
+ updateToolbar : function()
+ {
+ var tb = this.grid_panel.getBottomToolbar();
+ if (this.is_uploading) {
+ tb.x_buttons.remove.disable();
+ tb.x_buttons.reset.disable();
+ tb.x_buttons.upload.enable();
+ if (!this.getAllowCloseOnUpload()) {
+ tb.x_buttons.close.disable();
+ }
+ Ext.fly(tb.x_buttons.indicator.getEl()).replaceClass(
+ 'ext-ux-uploaddialog-indicator-stoped',
+ 'ext-ux-uploaddialog-indicator-processing'
+ );
+ tb.x_buttons.upload.setIconClass('ext-ux-uploaddialog-uploadstopbtn');
+ tb.x_buttons.upload.setText(this.i18n.upload_btn_stop_text);
+ tb.x_buttons.upload.getEl()
+ .child(tb.x_buttons.upload.buttonSelector)
+ .dom[tb.x_buttons.upload.tooltipType] = this.i18n.upload_btn_stop_tip;
+ }
+ else {
+ tb.x_buttons.remove.enable();
+ tb.x_buttons.reset.enable();
+ tb.x_buttons.close.enable();
+ Ext.fly(tb.x_buttons.indicator.getEl()).replaceClass(
+ 'ext-ux-uploaddialog-indicator-processing',
+ 'ext-ux-uploaddialog-indicator-stoped'
+ );
+ tb.x_buttons.upload.setIconClass('ext-ux-uploaddialog-uploadstartbtn');
+ tb.x_buttons.upload.setText(this.i18n.upload_btn_start_text);
+ tb.x_buttons.upload.getEl()
+ .child(tb.x_buttons.upload.buttonSelector)
+ .dom[tb.x_buttons.upload.tooltipType] = this.i18n.upload_btn_start_tip;
+
+ if (this.getQueuedCount() > 0) {
+ tb.x_buttons.upload.enable();
+ }
+ else {
+ tb.x_buttons.upload.disable();
+ }
+
+ if (this.grid_panel.getSelectionModel().hasSelection()) {
+ tb.x_buttons.remove.enable();
+ }
+ else {
+ tb.x_buttons.remove.disable();
+ }
+
+ if (this.grid_panel.getStore().getCount() > 0) {
+ tb.x_buttons.reset.enable();
+ }
+ else {
+ tb.x_buttons.reset.disable();
+ }
+ }
+ },
+
+ saveInitialQueuedCount : function()
+ {
+ this.initial_queued_count = this.getQueuedCount();
+ },
+
+ incInitialQueuedCount : function()
+ {
+ this.initial_queued_count++;
+ },
+
+ setUploadingFlag : function()
+ {
+ this.is_uploading = true;
+ },
+
+ resetUploadingFlag : function()
+ {
+ this.is_uploading = false;
+ },
+
+ prepareNextUploadTask : function()
+ {
+ // Searching for first unuploaded file.
+ var store = this.grid_panel.getStore();
+ var record = null;
+
+ store.each(function(r) {
+ if (!record && r.get('state') == Ext.ux.UploadDialog.FileRecord.STATE_QUEUE) {
+ record = r;
+ }
+ else {
+ r.get('input_element').dom.disabled = true;
+ }
+ });
+
+ record.get('input_element').dom.disabled = false;
+ record.set('state', Ext.ux.UploadDialog.FileRecord.STATE_PROCESSING);
+ record.set('note', this.i18n.note_processing);
+ record.commit();
+
+ this.fsa.postEvent('file-upload-start', record);
+ },
+
+ fireUploadStartEvent : function()
+ {
+ this.fireEvent('uploadstart', this);
+ },
+
+ removeFiles : function(file_records)
+ {
+ var store = this.grid_panel.getStore();
+ for (var i = 0, len = file_records.length; i < len; i++) {
+ var r = file_records[i];
+ r.get('input_element').remove();
+ store.remove(r);
+ }
+ },
+
+ fireFileRemoveEvent : function(file_records)
+ {
+ for (var i = 0, len = file_records.length; i < len; i++) {
+ this.fireEvent('fileremove', this, file_records[i].get('filename'));
+ }
+ },
+
+ resetQueue : function()
+ {
+ var store = this.grid_panel.getStore();
+ store.each(
+ function(r) {
+ r.get('input_element').remove();
+ }
+ );
+ store.removeAll();
+ },
+
+ fireResetQueueEvent : function()
+ {
+ this.fireEvent('resetqueue', this);
+ },
+
+ uploadFile : function(record)
+ {
+ Ext.Ajax.request({
+ url : this.url,
+ params : this.base_params || this.baseParams || this.params,
+ method : 'POST',
+ form : this.form,
+ isUpload : true,
+ success : this.onAjaxSuccess,
+ failure : this.onAjaxFailure,
+ scope : this,
+ record: record
+ });
+ },
+
+ fireFileUploadStartEvent : function(record)
+ {
+ this.fireEvent('fileuploadstart', this, record.get('filename'));
+ },
+
+ updateRecordState : function(data)
+ {
+ if ('success' in data.response && data.response.success) {
+ data.record.set('state', Ext.ux.UploadDialog.FileRecord.STATE_FINISHED);
+ data.record.set(
+ 'note', data.response.message || data.response.error || this.i18n.note_upload_success
+ );
+ }
+ else {
+ data.record.set('state', Ext.ux.UploadDialog.FileRecord.STATE_FAILED);
+ data.record.set(
+ 'note', data.response.message || data.response.error || this.i18n.note_upload_error
+ );
+ }
+
+ data.record.commit();
+ },
+
+ fireUploadSuccessEvent : function(data)
+ {
+ this.fireEvent('uploadsuccess', this, data.record.get('filename'), data.response);
+ },
+
+ fireUploadErrorEvent : function(data)
+ {
+ this.fireEvent('uploaderror', this, data.record.get('filename'), data.response);
+ },
+
+ fireUploadFailedEvent : function(data)
+ {
+ this.fireEvent('uploadfailed', this, data.record.get('filename'));
+ },
+
+ fireUploadCompleteEvent : function()
+ {
+ this.fireEvent('uploadcomplete', this);
+ },
+
+ findUploadFrame : function()
+ {
+ this.upload_frame = Ext.getBody().child('iframe.x-hidden:last');
+ },
+
+ resetUploadFrame : function()
+ {
+ this.upload_frame = null;
+ },
+
+ removeUploadFrame : function()
+ {
+ if (this.upload_frame) {
+ this.upload_frame.removeAllListeners();
+ this.upload_frame.dom.src = 'about:blank';
+ this.upload_frame.remove();
+ }
+ this.upload_frame = null;
+ },
+
+ abortUpload : function()
+ {
+ this.removeUploadFrame();
+
+ var store = this.grid_panel.getStore();
+ var record = null;
+ store.each(function(r) {
+ if (r.get('state') == Ext.ux.UploadDialog.FileRecord.STATE_PROCESSING) {
+ record = r;
+ return false;
+ }
+ });
+
+ record.set('state', Ext.ux.UploadDialog.FileRecord.STATE_FAILED);
+ record.set('note', this.i18n.note_aborted);
+ record.commit();
+ },
+
+ fireUploadStopEvent : function()
+ {
+ this.fireEvent('uploadstop', this);
+ },
+
+ repostHide : function()
+ {
+ this.fsa.postEvent('hide');
+ },
+
+ flushEventQueue : function()
+ {
+ this.fsa.flushEventQueue();
+ },
+
+ /**
+ * @access private
+ */
+ // -------------------------------------------------------------------------------------------- //
+ onWindowRender : function()
+ {
+ this.fsa.postEvent('window-render');
+ },
+
+ onWindowBeforeHide : function()
+ {
+ return this.isUploading() ? this.getAllowCloseOnUpload() : true;
+ },
+
+ onWindowHide : function()
+ {
+ this.fsa.postEvent('hide');
+ },
+
+ onWindowDestroy : function()
+ {
+ this.fsa.postEvent('destroy');
+ },
+
+ onGridRender : function()
+ {
+ this.fsa.postEvent('grid-render');
+ },
+
+ onGridSelectionChange : function()
+ {
+ this.fsa.postEvent('grid-selection-change');
+ },
+
+ onAddButtonFileSelected : function(btn)
+ {
+ this.fsa.postEvent('file-selected', btn);
+ },
+
+ onUploadButtonClick : function()
+ {
+ if (this.is_uploading) {
+ this.fsa.postEvent('stop-upload');
+ }
+ else {
+ this.fsa.postEvent('start-upload');
+ }
+ },
+
+ onRemoveButtonClick : function()
+ {
+ var selections = this.grid_panel.getSelectionModel().getSelections();
+ this.fsa.postEvent('remove-files', selections);
+ },
+
+ onResetButtonClick : function()
+ {
+ this.fsa.postEvent('reset-queue');
+ },
+
+ onCloseButtonClick : function()
+ {
+ this[this.closeAction].call(this);
+ },
+
+ onAjaxSuccess : function(response, options)
+ {
+ var json_response = {
+ 'success' : false,
+ 'error' : this.i18n.note_upload_error
+ }
+ try {
+ var rt = response.responseText;
+ var filter = rt.match(/^<[^>]+>((?:.|\n)*)<\/[^>]+>$/);
+ if (filter) {
+ rt = filter[1];
+ }
+ json_response = Ext.util.JSON.decode(rt);
+ }
+ catch (e) {}
+
+ var data = {
+ record: options.record,
+ response: json_response
+ }
+
+ if ('success' in json_response && json_response.success) {
+ this.fsa.postEvent('file-upload-success', data);
+ }
+ else {
+ this.fsa.postEvent('file-upload-error', data);
+ }
+ },
+
+ onAjaxFailure : function(response, options)
+ {
+ var data = {
+ record : options.record,
+ response : {
+ 'success' : false,
+ 'error' : this.i18n.note_upload_failed
+ }
+ }
+
+ this.fsa.postEvent('file-upload-failed', data);
+ },
+
+ /**
+ * @access public
+ */
+ // -------------------------------------------------------------------------------------------- //
+ startUpload : function()
+ {
+ this.fsa.postEvent('start-upload');
+ },
+
+ stopUpload : function()
+ {
+ this.fsa.postEvent('stop-upload');
+ },
+
+ getUrl : function()
+ {
+ return this.url;
+ },
+
+ setUrl : function(url)
+ {
+ this.url = url;
+ },
+
+ getBaseParams : function()
+ {
+ return this.base_params;
+ },
+
+ setBaseParams : function(params)
+ {
+ this.base_params = params;
+ },
+
+ getUploadAutostart : function()
+ {
+ return this.upload_autostart;
+ },
+
+ setUploadAutostart : function(value)
+ {
+ this.upload_autostart = value;
+ },
+
+ getAllowCloseOnUpload : function()
+ {
+ return this.allow_close_on_upload;
+ },
+
+ setAllowCloseOnUpload : function(value)
+ {
+ this.allow_close_on_upload;
+ },
+
+ getResetOnHide : function()
+ {
+ return this.reset_on_hide;
+ },
+
+ setResetOnHide : function(value)
+ {
+ this.reset_on_hide = value;
+ },
+
+ getPermittedExtensions : function()
+ {
+ return this.permitted_extensions;
+ },
+
+ setPermittedExtensions : function(value)
+ {
+ this.permitted_extensions = value;
+ },
+
+ isUploading : function()
+ {
+ return this.is_uploading;
+ },
+
+ isNotEmptyQueue : function()
+ {
+ return this.grid_panel.getStore().getCount() > 0;
+ },
+
+ getQueuedCount : function(count_processing)
+ {
+ var count = 0;
+ var store = this.grid_panel.getStore();
+ store.each(function(r) {
+ if (r.get('state') == Ext.ux.UploadDialog.FileRecord.STATE_QUEUE) {
+ count++;
+ }
+ if (count_processing && r.get('state') == Ext.ux.UploadDialog.FileRecord.STATE_PROCESSING) {
+ count++;
+ }
+ });
+ return count;
+ },
+
+ hasUnuploadedFiles : function()
+ {
+ return this.getQueuedCount() > 0;
+ }
+});
+
+// ---------------------------------------------------------------------------------------------- //
+
+var p = Ext.ux.UploadDialog.Dialog.prototype;
+p.i18n = {
+ title: 'File upload dialog',
+ state_col_title: 'State',
+ state_col_width: 70,
+ filename_col_title: 'Filename',
+ filename_col_width: 230,
+ note_col_title: 'Note',
+ note_col_width: 150,
+ add_btn_text: 'Add',
+ add_btn_tip: 'Add file into upload queue.',
+ remove_btn_text: 'Remove',
+ remove_btn_tip: 'Remove file from upload queue.',
+ reset_btn_text: 'Reset',
+ reset_btn_tip: 'Reset queue.',
+ upload_btn_start_text: 'Upload',
+ upload_btn_stop_text: 'Abort',
+ upload_btn_start_tip: 'Upload queued files to the server.',
+ upload_btn_stop_tip: 'Stop upload.',
+ close_btn_text: 'Close',
+ close_btn_tip: 'Close the dialog.',
+ progress_waiting_text: 'Waiting...',
+ progress_uploading_text: 'Uploading: {0} of {1} files complete.',
+ error_msgbox_title: 'Error',
+ permitted_extensions_join_str: ',',
+ err_file_type_not_permitted: 'Selected file extension isn\'t permitted.<br/>Please select files with following extensions: {1}',
+ note_queued_to_upload: 'Queued for upload.',
+ note_processing: 'Uploading...',
+ note_upload_failed: 'Server is unavailable or internal server error occured.',
+ note_upload_success: 'OK.',
+ note_upload_error: 'Upload error.',
+ note_aborted: 'Aborted by user.'
+}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/Ext.ux.UploadDialog.packed.js
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/Ext.ux.UploadDialog.packed.js 2008-09-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/Ext.ux.UploadDialog.packed.js 2008-09-09 18:00:21 UTC (rev 865)
@@ -0,0 +1 @@
+Ext.namespace("Ext.ux.Utils");Ext.ux.Utils.EventQueue=function(handler,scope){if(!handler){throw"Handler is required."}this.handler=handler;this.scope=scope||window;this.queue=[];this.is_processing=false;this.postEvent=function(event,data){data=data||null;this.queue.push({event:event,data:data});if(!this.is_processing){this.process()}};this.flushEventQueue=function(){this.queue=[]},this.process=function(){while(this.queue.length>0){this.is_processing=true;var event_data=this.queue.shift();this.handler.call(this.scope,event_data.event,event_data.data)}this.is_processing=false}};Ext.ux.Utils.FSA=function(initial_state,trans_table,trans_table_scope){this.current_state=initial_state;this.trans_table=trans_table||{};this.trans_table_scope=trans_table_scope||window;Ext.ux.Utils.FSA.superclass.constructor.call(this,this.processEvent,this)};Ext.extend(Ext.ux.Utils.FSA,Ext.ux.Utils.EventQueue,{current_state:null,trans_table:null,trans_table_scope:null,state:function(){return this.current_state},processEvent:function(event,data){var transitions=this.currentStateEventTransitions(event);if(!transitions){throw"State '"+this.current_state+"' has no transition for event '"+event+"'."}for(var i=0,len=transitions.length;i<len;i++){var transition=transitions[i];var predicate=transition.predicate||transition.p||true;var action=transition.action||transition.a||Ext.emptyFn;var new_state=transition.state||transition.s||this.current_state;var scope=transition.scope||this.trans_table_scope;if(this.computePredicate(predicate,scope,data,event)){this.callAction(action,scope,data,event);this.current_state=new_state;return }}throw"State '"+this.current_state+"' has no transition for event '"+event+"' in current context"},currentStateEventTransitions:function(event){return this.trans_table[this.current_state]?this.trans_table[this.current_state][event]||false:false},computePredicate:function(predicate,scope,data,event){var result=false;switch(Ext.type(predicate)){case"function":result=predicate.call(scope,data,event,this);break;case"array":result=true;for(var i=0,len=predicate.length;result&&(i<len);i++){if(Ext.type(predicate[i])=="function"){result=predicate[i].call(scope,data,event,this)}else{throw ["Predicate: ",predicate[i],' is not callable in "',this.current_state,'" state for event "',event].join("")}}break;case"boolean":result=predicate;break;default:throw ["Predicate: ",predicate,' is not callable in "',this.current_state,'" state for event "',event].join("")}return result},callAction:function(action,scope,data,event){switch(Ext.type(action)){case"array":for(var i=0,len=action.length;i<len;i++){if(Ext.type(action[i])=="function"){action[i].call(scope,data,event,this)}else{throw ["Action: ",action[i],' is not callable in "',this.current_state,'" state for event "',event].join("")}}break;case"function":action.call(scope,data,event,this);break;default:throw ["Action: ",action,' is not callable in "',this.current_state,'" state for event "',event].join("")}}});Ext.namespace("Ext.ux.UploadDialog");Ext.ux.UploadDialog.BrowseButton=Ext.extend(Ext.Button,{input_name:"file",input_file:null,original_handler:null,original_scope:null,initComponent:function(){Ext.ux.UploadDialog.BrowseButton.superclass.initComponent.call(this);this.original_handler=this.handler||null;this.original_scope=this.scope||window;this.handler=null;this.scope=null},onRender:function(ct,position){Ext.ux.UploadDialog.BrowseButton.superclass.onRender.call(this,ct,position);this.createInputFile()},createInputFile:function(){var button_container=this.el.child(".x-btn-center");button_container.position("relative");this.input_file=Ext.DomHelper.append(button_container,{tag:"input",type:"file",size:1,name:this.input_name||Ext.id(this.el),style:"position: absolute; display: block; border: none; cursor: pointer"},true);var button_box=button_container.getBox();this.input_file.setStyle("font-size",(button_box.width*0.5)+"px");var input_box=this.input_file.getBox();var adj={x:3,y:3};if(Ext.isIE){adj={x:0,y:3}}this.input_file.setLeft(button_box.width-input_box.width+adj.x+"px");this.input_file.setTop(button_box.height-input_box.height+adj.y+"px");this.input_file.setOpacity(0);if(this.handleMouseEvents){this.input_file.on("mouseover",this.onMouseOver,this);this.input_file.on("mousedown",this.onMouseDown,this)}if(this.tooltip){if(typeof this.tooltip=="object"){Ext.QuickTips.register(Ext.apply({target:this.input_file},this.tooltip))}else{this.input_file.dom[this.tooltipType]=this.tooltip}}this.input_file.on("change",this.onInputFileChange,this);this.input_file.on("click",function(e){e.stopPropagation()})},detachInputFile:function(no_create){var result=this.input_file;no_create=no_create||false;if(typeof this.tooltip=="object"){Ext.QuickTips.unregister(this.input_file)}else{this.input_file.dom[this.tooltipType]=null}this.input_file.removeAllListeners();this.input_file=null;if(!no_create){this.createInputFile()}return result},getInputFile:function(){return this.input_file},disable:function(){Ext.ux.UploadDialog.BrowseButton.superclass.disable.call(this);this.input_file.dom.disabled=true},enable:function(){Ext.ux.UploadDialog.BrowseButton.superclass.enable.call(this);this.input_file.dom.disabled=false},destroy:function(){var input_file=this.detachInputFile(true);input_file.remove();input_file=null;Ext.ux.UploadDialog.BrowseButton.superclass.destroy.call(this)},onInputFileChange:function(){if(this.original_handler){this.original_handler.call(this.original_scope,this)}}});Ext.ux.UploadDialog.TBBrowseButton=Ext.extend(Ext.ux.UploadDialog.BrowseButton,{hideParent:true,onDestroy:function(){Ext.ux.UploadDialog.TBBrowseButton.superclass.onDestroy.call(this);if(this.container){this.container.remove()}}});Ext.ux.UploadDialog.FileRecord=Ext.data.Record.create([{name:"filename"},{name:"state",type:"int"},{name:"note"},{name:"input_element"}]);Ext.ux.UploadDialog.FileRecord.STATE_QUEUE=0;Ext.ux.UploadDialog.FileRecord.STATE_FINISHED=1;Ext.ux.UploadDialog.FileRecord.STATE_FAILED=2;Ext.ux.UploadDialog.FileRecord.STATE_PROCESSING=3;Ext.ux.UploadDialog.Dialog=function(config){var default_config={border:false,width:450,height:300,minWidth:450,minHeight:300,plain:true,constrainHeader:true,draggable:true,closable:true,maximizable:false,minimizable:false,resizable:true,autoDestroy:true,closeAction:"hide",title:this.i18n.title,cls:"ext-ux-uploaddialog-dialog",url:"",base_params:{},permitted_extensions:[],reset_on_hide:true,allow_close_on_upload:false,upload_autostart:false,post_var_name:"file"};config=Ext.applyIf(config||{},default_config);config.layout="absolute";Ext.ux.UploadDialog.Dialog.superclass.constructor.call(this,config)};Ext.extend(Ext.ux.UploadDialog.Dialog,Ext.Window,{fsa:null,state_tpl:null,form:null,grid_panel:null,progress_bar:null,is_uploading:false,initial_queued_count:0,upload_frame:null,initComponent:function(){Ext.ux.UploadDialog.Dialog.superclass.initComponent.call(this);var tt={created:{"window-render":[{action:[this.createForm,this.createProgressBar,this.createGrid],state:"rendering"}],destroy:[{action:this.flushEventQueue,state:"destroyed"}]},rendering:{"grid-render":[{action:[this.fillToolbar,this.updateToolbar],state:"ready"}],destroy:[{action:this.flushEventQueue,state:"destroyed"}]},ready:{"file-selected":[{predicate:[this.fireFileTestEvent,this.isPermittedFile],action:this.addFileToUploadQueue,state:"adding-file"},{}],"grid-selection-change":[{action:this.updateToolbar}],"remove-files":[{action:[this.removeFiles,this.fireFileRemoveEvent]}],"reset-queue":[{action:[this.resetQueue,this.fireResetQueueEvent]}],"start-upload":[{predicate:this.hasUnuploadedFiles,action:[this.setUploadingFlag,this.saveInitialQueuedCount,this.updateToolbar,this.updateProgressBar,this.prepareNextUploadTask,this.fireUploadStartEvent],state:"uploading"},{}],"stop-upload":[{}],hide:[{predicate:[this.isNotEmptyQueue,this.getResetOnHide],action:[this.resetQueue,this.fireResetQueueEvent]},{}],destroy:[{action:this.flushEventQueue,state:"destroyed"}]},"adding-file":{"file-added":[{predicate:this.isUploading,action:[this.incInitialQueuedCount,this.updateProgressBar,this.fireFileAddEvent],state:"uploading"},{predicate:this.getUploadAutostart,action:[this.startUpload,this.fireFileAddEvent],state:"ready"},{action:[this.updateToolbar,this.fireFileAddEvent],state:"ready"}]},uploading:{"file-selected":[{predicate:[this.fireFileTestEvent,this.isPermittedFile],action:this.addFileToUploadQueue,state:"adding-file"},{}],"grid-selection-change":[{}],"start-upload":[{}],"stop-upload":[{predicate:this.hasUnuploadedFiles,action:[this.resetUploadingFlag,this.abortUpload,this.updateToolbar,this.updateProgressBar,this.fireUploadStopEvent],state:"ready"},{action:[this.resetUploadingFlag,this.abortUpload,this.updateToolbar,this.updateProgressBar,this.fireUploadStopEvent,this.fireUploadCompleteEvent],state:"ready"}],"file-upload-start":[{action:[this.uploadFile,this.findUploadFrame,this.fireFileUploadStartEvent]}],"file-upload-success":[{predicate:this.hasUnuploadedFiles,action:[this.resetUploadFrame,this.updateRecordState,this.updateProgressBar,this.prepareNextUploadTask,this.fireUploadSuccessEvent]},{action:[this.resetUploadFrame,this.resetUploadingFlag,this.updateRecordState,this.updateToolbar,this.updateProgressBar,this.fireUploadSuccessEvent,this.fireUploadCompleteEvent],state:"ready"}],"file-upload-error":[{predicate:this.hasUnuploadedFiles,action:[this.resetUploadFrame,this.updateRecordState,this.updateProgressBar,this.prepareNextUploadTask,this.fireUploadErrorEvent]},{action:[this.resetUploadFrame,this.resetUploadingFlag,this.updateRecordState,this.updateToolbar,this.updateProgressBar,this.fireUploadErrorEvent,this.fireUploadCompleteEvent],state:"ready"}],"file-upload-failed":[{predicate:this.hasUnuploadedFiles,action:[this.resetUploadFrame,this.updateRecordState,this.updateProgressBar,this.prepareNextUploadTask,this.fireUploadFailedEvent]},{action:[this.resetUploadFrame,this.resetUploadingFlag,this.updateRecordState,this.updateToolbar,this.updateProgressBar,this.fireUploadFailedEvent,this.fireUploadCompleteEvent],state:"ready"}],hide:[{predicate:this.getResetOnHide,action:[this.stopUpload,this.repostHide]},{}],destroy:[{predicate:this.hasUnuploadedFiles,action:[this.resetUploadingFlag,this.abortUpload,this.fireUploadStopEvent,this.flushEventQueue],state:"destroyed"},{action:[this.resetUploadingFlag,this.abortUpload,this.fireUploadStopEvent,this.fireUploadCompleteEvent,this.flushEventQueue],state:"destroyed"}]},destroyed:{}};this.fsa=new Ext.ux.Utils.FSA("created",tt,this);this.addEvents({filetest:true,fileadd:true,fileremove:true,resetqueue:true,uploadsuccess:true,uploaderror:true,uploadfailed:true,uploadstart:true,uploadstop:true,uploadcomplete:true,fileuploadstart:true});this.on("render",this.onWindowRender,this);this.on("beforehide",this.onWindowBeforeHide,this);this.on("hide",this.onWindowHide,this);this.on("destroy",this.onWindowDestroy,this);this.state_tpl=new Ext.Template("<div class='ext-ux-uploaddialog-state ext-ux-uploaddialog-state-{state}'> </div>").compile()},createForm:function(){this.form=Ext.DomHelper.append(this.body,{tag:"form",method:"post",action:this.url,style:"position: absolute; left: -100px; top: -100px; width: 100px; height: 100px"})},createProgressBar:function(){this.progress_bar=this.add(new Ext.ProgressBar({x:0,y:0,anchor:"0",value:0,text:this.i18n.progress_waiting_text}))},createGrid:function(){var store=new Ext.data.Store({proxy:new Ext.data.MemoryProxy([]),reader:new Ext.data.JsonReader({},Ext.ux.UploadDialog.FileRecord),sortInfo:{field:"state",direction:"DESC"},pruneModifiedRecords:true});var cm=new Ext.grid.ColumnModel([{header:this.i18n.state_col_title,width:this.i18n.state_col_width,resizable:false,dataIndex:"state",sortable:true,renderer:this.renderStateCell.createDelegate(this)},{header:this.i18n.filename_col_title,width:this.i18n.filename_col_width,dataIndex:"filename",sortable:true,renderer:this.renderFilenameCell.createDelegate(this)},{header:this.i18n.note_col_title,width:this.i18n.note_col_width,dataIndex:"note",sortable:true,renderer:this.renderNoteCell.createDelegate(this)}]);this.grid_panel=new Ext.grid.GridPanel({ds:store,cm:cm,x:0,y:22,anchor:"0 -22",border:true,viewConfig:{autoFill:true,forceFit:true},bbar:new Ext.Toolbar()});this.grid_panel.on("render",this.onGridRender,this);this.add(this.grid_panel);this.grid_panel.getSelectionModel().on("selectionchange",this.onGridSelectionChange,this)},fillToolbar:function(){var tb=this.grid_panel.getBottomToolbar();tb.x_buttons={};tb.x_buttons.add=tb.addItem(new Ext.ux.UploadDialog.TBBrowseButton({input_name:this.post_var_name,text:this.i18n.add_btn_text,tooltip:this.i18n.add_btn_tip,iconCls:"ext-ux-uploaddialog-addbtn",handler:this.onAddButtonFileSelected,scope:this}));tb.x_buttons.remove=tb.addButton({text:this.i18n.remove_btn_text,tooltip:this.i18n.remove_btn_tip,iconCls:"ext-ux-uploaddialog-removebtn",handler:this.onRemoveButtonClick,scope:this});tb.x_buttons.reset=tb.addButton({text:this.i18n.reset_btn_text,tooltip:this.i18n.reset_btn_tip,iconCls:"ext-ux-uploaddialog-resetbtn",handler:this.onResetButtonClick,scope:this});tb.add("-");tb.x_buttons.upload=tb.addButton({text:this.i18n.upload_btn_start_text,tooltip:this.i18n.upload_btn_start_tip,iconCls:"ext-ux-uploaddialog-uploadstartbtn",handler:this.onUploadButtonClick,scope:this});tb.add("-");tb.x_buttons.indicator=tb.addItem(new Ext.Toolbar.Item(Ext.DomHelper.append(tb.getEl(),{tag:"div",cls:"ext-ux-uploaddialog-indicator-stoped",html:" "})));tb.add("->");tb.x_buttons.close=tb.addButton({text:this.i18n.close_btn_text,tooltip:this.i18n.close_btn_tip,handler:this.onCloseButtonClick,scope:this})},renderStateCell:function(data,cell,record,row_index,column_index,store){return this.state_tpl.apply({state:data})},renderFilenameCell:function(data,cell,record,row_index,column_index,store){var view=this.grid_panel.getView();var f=function(){try{Ext.fly(view.getCell(row_index,column_index)).child(".x-grid3-cell-inner").dom.qtip=data}catch(e){}};f.defer(1000);return data},renderNoteCell:function(data,cell,record,row_index,column_index,store){var view=this.grid_panel.getView();var f=function(){try{Ext.fly(view.getCell(row_index,column_index)).child(".x-grid3-cell-inner").dom.qtip=data}catch(e){}};f.defer(1000);return data},getFileExtension:function(filename){var result=null;var parts=filename.split(".");if(parts.length>1){result=parts.pop()}return result},isPermittedFileType:function(filename){var result=true;if(this.permitted_extensions.length>0){result=this.permitted_extensions.indexOf(this.getFileExtension(filename))!=-1}return result},isPermittedFile:function(browse_btn){var result=false;var filename=browse_btn.getInputFile().dom.value;if(this.isPermittedFileType(filename)){result=true}else{Ext.Msg.alert(this.i18n.error_msgbox_title,String.format(this.i18n.err_file_type_not_permitted,filename,this.permitted_extensions.join(this.i18n.permitted_extensions_join_str)));result=false}return result},fireFileTestEvent:function(browse_btn){return this.fireEvent("filetest",this,browse_btn.getInputFile().dom.value)!==false},addFileToUploadQueue:function(browse_btn){var input_file=browse_btn.detachInputFile();input_file.appendTo(this.form);input_file.setStyle("width","100px");input_file.dom.disabled=true;var store=this.grid_panel.getStore();store.add(new Ext.ux.UploadDialog.FileRecord({state:Ext.ux.UploadDialog.FileRecord.STATE_QUEUE,filename:input_file.dom.value,note:this.i18n.note_queued_to_upload,input_element:input_file}));this.fsa.postEvent("file-added",input_file.dom.value)},fireFileAddEvent:function(filename){this.fireEvent("fileadd",this,filename)},updateProgressBar:function(){if(this.is_uploading){var queued=this.getQueuedCount(true);var value=1-queued/this.initial_queued_count;this.progress_bar.updateProgress(value,String.format(this.i18n.progress_uploading_text,this.initial_queued_count-queued,this.initial_queued_count))}else{this.progress_bar.updateProgress(0,this.i18n.progress_waiting_text)}},updateToolbar:function(){var tb=this.grid_panel.getBottomToolbar();if(this.is_uploading){tb.x_buttons.remove.disable();tb.x_buttons.reset.disable();tb.x_buttons.upload.enable();if(!this.getAllowCloseOnUpload()){tb.x_buttons.close.disable()}Ext.fly(tb.x_buttons.indicator.getEl()).replaceClass("ext-ux-uploaddialog-indicator-stoped","ext-ux-uploaddialog-indicator-processing");tb.x_buttons.upload.setIconClass("ext-ux-uploaddialog-uploadstopbtn");tb.x_buttons.upload.setText(this.i18n.upload_btn_stop_text);tb.x_buttons.upload.getEl().child(tb.x_buttons.upload.buttonSelector).dom[tb.x_buttons.upload.tooltipType]=this.i18n.upload_btn_stop_tip}else{tb.x_buttons.remove.enable();tb.x_buttons.reset.enable();tb.x_buttons.close.enable();Ext.fly(tb.x_buttons.indicator.getEl()).replaceClass("ext-ux-uploaddialog-indicator-processing","ext-ux-uploaddialog-indicator-stoped");tb.x_buttons.upload.setIconClass("ext-ux-uploaddialog-uploadstartbtn");tb.x_buttons.upload.setText(this.i18n.upload_btn_start_text);tb.x_buttons.upload.getEl().child(tb.x_buttons.upload.buttonSelector).dom[tb.x_buttons.upload.tooltipType]=this.i18n.upload_btn_start_tip;if(this.getQueuedCount()>0){tb.x_buttons.upload.enable()}else{tb.x_buttons.upload.disable()}if(this.grid_panel.getSelectionModel().hasSelection()){tb.x_buttons.remove.enable()}else{tb.x_buttons.remove.disable()}if(this.grid_panel.getStore().getCount()>0){tb.x_buttons.reset.enable()}else{tb.x_buttons.reset.disable()}}},saveInitialQueuedCount:function(){this.initial_queued_count=this.getQueuedCount()},incInitialQueuedCount:function(){this.initial_queued_count++},setUploadingFlag:function(){this.is_uploading=true},resetUploadingFlag:function(){this.is_uploading=false},prepareNextUploadTask:function(){var store=this.grid_panel.getStore();var record=null;store.each(function(r){if(!record&&r.get("state")==Ext.ux.UploadDialog.FileRecord.STATE_QUEUE){record=r}else{r.get("input_element").dom.disabled=true}});record.get("input_element").dom.disabled=false;record.set("state",Ext.ux.UploadDialog.FileRecord.STATE_PROCESSING);record.set("note",this.i18n.note_processing);record.commit();this.fsa.postEvent("file-upload-start",record)},fireUploadStartEvent:function(){this.fireEvent("uploadstart",this)},removeFiles:function(file_records){var store=this.grid_panel.getStore();for(var i=0,len=file_records.length;i<len;i++){var r=file_records[i];r.get("input_element").remove();store.remove(r)}},fireFileRemoveEvent:function(file_records){for(var i=0,len=file_records.length;i<len;i++){this.fireEvent("fileremove",this,file_records[i].get("filename"))}},resetQueue:function(){var store=this.grid_panel.getStore();store.each(function(r){r.get("input_element").remove()});store.removeAll()},fireResetQueueEvent:function(){this.fireEvent("resetqueue",this)},uploadFile:function(record){Ext.Ajax.request({url:this.url,params:this.base_params||this.baseParams||this.params,method:"POST",form:this.form,isUpload:true,success:this.onAjaxSuccess,failure:this.onAjaxFailure,scope:this,record:record})},fireFileUploadStartEvent:function(record){this.fireEvent("fileuploadstart",this,record.get("filename"))},updateRecordState:function(data){if("success" in data.response&&data.response.success){data.record.set("state",Ext.ux.UploadDialog.FileRecord.STATE_FINISHED);data.record.set("note",data.response.message||data.response.error||this.i18n.note_upload_success)}else{data.record.set("state",Ext.ux.UploadDialog.FileRecord.STATE_FAILED);data.record.set("note",data.response.message||data.response.error||this.i18n.note_upload_error)}data.record.commit()},fireUploadSuccessEvent:function(data){this.fireEvent("uploadsuccess",this,data.record.get("filename"),data.response)},fireUploadErrorEvent:function(data){this.fireEvent("uploaderror",this,data.record.get("filename"),data.response)},fireUploadFailedEvent:function(data){this.fireEvent("uploadfailed",this,data.record.get("filename"))},fireUploadCompleteEvent:function(){this.fireEvent("uploadcomplete",this)},findUploadFrame:function(){this.upload_frame=Ext.getBody().child("iframe.x-hidden:last")},resetUploadFrame:function(){this.upload_frame=null},removeUploadFrame:function(){if(this.upload_frame){this.upload_frame.removeAllListeners();this.upload_frame.dom.src="about:blank";this.upload_frame.remove()}this.upload_frame=null},abortUpload:function(){this.removeUploadFrame();var store=this.grid_panel.getStore();var record=null;store.each(function(r){if(r.get("state")==Ext.ux.UploadDialog.FileRecord.STATE_PROCESSING){record=r;return false}});record.set("state",Ext.ux.UploadDialog.FileRecord.STATE_FAILED);record.set("note",this.i18n.note_aborted);record.commit()},fireUploadStopEvent:function(){this.fireEvent("uploadstop",this)},repostHide:function(){this.fsa.postEvent("hide")},flushEventQueue:function(){this.fsa.flushEventQueue()},onWindowRender:function(){this.fsa.postEvent("window-render")},onWindowBeforeHide:function(){return this.isUploading()?this.getAllowCloseOnUpload():true},onWindowHide:function(){this.fsa.postEvent("hide")},onWindowDestroy:function(){this.fsa.postEvent("destroy")},onGridRender:function(){this.fsa.postEvent("grid-render")},onGridSelectionChange:function(){this.fsa.postEvent("grid-selection-change")},onAddButtonFileSelected:function(btn){this.fsa.postEvent("file-selected",btn)},onUploadButtonClick:function(){if(this.is_uploading){this.fsa.postEvent("stop-upload")}else{this.fsa.postEvent("start-upload")}},onRemoveButtonClick:function(){var selections=this.grid_panel.getSelectionModel().getSelections();this.fsa.postEvent("remove-files",selections)},onResetButtonClick:function(){this.fsa.postEvent("reset-queue")},onCloseButtonClick:function(){this[this.closeAction].call(this)},onAjaxSuccess:function(response,options){var json_response={success:false,error:this.i18n.note_upload_error};try{var rt=response.responseText;var filter=rt.match(/^<[^>]+>((?:.|\n)*)<\/[^>]+>$/);if(filter){rt=filter[1]}json_response=Ext.util.JSON.decode(rt)}catch(e){}var data={record:options.record,response:json_response};if("success" in json_response&&json_response.success){this.fsa.postEvent("file-upload-success",data)}else{this.fsa.postEvent("file-upload-error",data)}},onAjaxFailure:function(response,options){var data={record:options.record,response:{success:false,error:this.i18n.note_upload_failed}};this.fsa.postEvent("file-upload-failed",data)},startUpload:function(){this.fsa.postEvent("start-upload")},stopUpload:function(){this.fsa.postEvent("stop-upload")},getUrl:function(){return this.url},setUrl:function(url){this.url=url},getBaseParams:function(){return this.base_params},setBaseParams:function(params){this.base_params=params},getUploadAutostart:function(){return this.upload_autostart},setUploadAutostart:function(value){this.upload_autostart=value},getAllowCloseOnUpload:function(){return this.allow_close_on_upload},setAllowCloseOnUpload:function(value){this.allow_close_on_upload},getResetOnHide:function(){return this.reset_on_hide},setResetOnHide:function(value){this.reset_on_hide=value},getPermittedExtensions:function(){return this.permitted_extensions},setPermittedExtensions:function(value){this.permitted_extensions=value},isUploading:function(){return this.is_uploading},isNotEmptyQueue:function(){return this.grid_panel.getStore().getCount()>0},getQueuedCount:function(count_processing){var count=0;var store=this.grid_panel.getStore();store.each(function(r){if(r.get("state")==Ext.ux.UploadDialog.FileRecord.STATE_QUEUE){count++}if(count_processing&&r.get("state")==Ext.ux.UploadDialog.FileRecord.STATE_PROCESSING){count++}});return count},hasUnuploadedFiles:function(){return this.getQueuedCount()>0}});var p=Ext.ux.UploadDialog.Dialog.prototype;p.i18n={title:"File upload dialog",state_col_title:"State",state_col_width:70,filename_col_title:"Filename",filename_col_width:230,note_col_title:"Note",note_col_width:150,add_btn_text:"Add",add_btn_tip:"Add file into upload queue.",remove_btn_text:"Remove",remove_btn_tip:"Remove file from upload queue.",reset_btn_text:"Reset",reset_btn_tip:"Reset queue.",upload_btn_start_text:"Upload",upload_btn_stop_text:"Abort",upload_btn_start_tip:"Upload queued files to the server.",upload_btn_stop_tip:"Stop upload.",close_btn_text:"Close",close_btn_tip:"Close the dialog.",progress_waiting_text:"Waiting...",progress_uploading_text:"Uploading: {0} of {1} files complete.",error_msgbox_title:"Error",permitted_extensions_join_str:",",err_file_type_not_permitted:"Selected file extension isn't permitted.<br/>Please select files with following extensions: {1}",note_queued_to_upload:"Queued for upload.",note_processing:"Uploading...",note_upload_failed:"Server is unavailable or internal server error occured.",note_upload_success:"OK.",note_upload_error:"Upload error.",note_aborted:"Aborted by user."};
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/css/Ext.ux.UploadDialog.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/css/Ext.ux.UploadDialog.css 2008-09-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/css/Ext.ux.UploadDialog.css 2008-09-09 18:00:21 UTC (rev 865)
@@ -0,0 +1,90 @@
+@CHARSET "UTF-8";
+
+.ext-ux-uploaddialog-addbtn
+{
+ background: url('../images/file-add.gif') no-repeat left center !important;
+}
+
+.ext-ux-uploaddialog-removebtn
+{
+ background: url('../images/file-remove.gif') no-repeat left center !important;
+}
+
+.ext-ux-uploaddialog-resetbtn
+{
+ background: url('../images/reset.gif') no-repeat left center !important;
+}
+
+.ext-ux-uploaddialog-uploadstartbtn
+{
+ background: url('../images/upload-start.gif') no-repeat left center !important;
+}
+
+.ext-ux-uploaddialog-uploadstopbtn
+{
+ background: url('../images/upload-stop.gif') no-repeat left center !important;
+}
+
+.ext-ux-uploaddialog-indicator-stoped
+{
+ width: 16px;
+ height: 16px;
+ background: url('../images/done.gif') no-repeat center center;
+}
+
+.ext-ux-uploaddialog-indicator-processing
+{
+ width: 16px;
+ height: 16px;
+ background: url('../images/loading.gif') no-repeat center center;
+}
+
+.ext-ux-uploaddialog-state
+{
+ text-align: center;
+ background-position: center center;
+ background-repeat: no-repeat;
+}
+
+/* Queued */
+.ext-ux-uploaddialog-state-0
+{
+ background-image: url('../images/uncheck.gif');
+}
+
+/* Finished */
+.ext-ux-uploaddialog-state-1
+{
+ background-image: url('../images/check.gif');
+}
+
+/* Failed */
+.ext-ux-uploaddialog-state-2
+{
+ background-image: url('../images/failed.gif');
+}
+
+/* Processing */
+.ext-ux-uploaddialog-state-3
+{
+ background-image: url('../images/file-uploading.gif');
+}
+
+/* Progress bar fix */
+.ext-ie7 .ext-ux-uploaddialog-dialog .x-progress-bar .x-progress-text div
+{
+ display: none;
+}
+
+.ext-ie7 .ext-ux-uploaddialog-dialog .x-progress-text-back
+{
+ position: absolute;
+ left: 0px;
+ right: 0px;
+}
+
+.ext-ie7 .ext-ux-uploaddialog-dialog .x-progress-text-back div
+{
+ width: auto !important;
+ white-space: nowrap;
+}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/dox/automata-protocol.dia
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/dox/automata-protocol.dia
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/dox/automata-protocol.jpeg
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/dox/automata-protocol.jpeg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/check.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/check.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/done.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/done.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/failed.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/failed.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/file-add.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/file-add.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/file-remove.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/file-remove.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/file-uploading.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/file-uploading.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/loading.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/loading.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/reset.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/reset.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/uncheck.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/uncheck.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/upload-start.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/upload-start.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/upload-stop.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/images/upload-stop.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/locale/ru.utf-8.js
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/locale/ru.utf-8.js 2008-09-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/locale/ru.utf-8.js 2008-09-09 18:00:21 UTC (rev 865)
@@ -0,0 +1,35 @@
+Ext.apply(
+ Ext.ux.UploadDialog.Dialog.prototype.i18n,
+ {
+ title: 'Загрузка файлов на сервер.',
+ state_col_title: 'Статус',
+ state_col_width: 70,
+ filename_col_title: 'Имя файла',
+ filename_col_width: 230,
+ note_col_title: 'Пояснение',
+ note_col_width: 150,
+ add_btn_text: 'Добавить',
+ add_btn_tip: 'Добавить файл в очередь загрузки.',
+ remove_btn_text: 'Удалить',
+ remove_btn_tip: 'Удалить файл из очереди загрузки.',
+ reset_btn_text: 'Очистить',
+ reset_btn_tip: 'Очистить очередь загрузки.',
+ upload_btn_start_text: 'Загрузить',
+ upload_btn_stop_text: 'Отменить',
+ upload_btn_start_tip: 'Загрузить файлы на сервер.',
+ upload_btn_stop_tip: 'Отменить загрузку.',
+ close_btn_text: 'Закрыть',
+ close_btn_tip: 'Закрыть диалог загрузки.',
+ progress_waiting_text: 'Жду...',
+ progress_uploading_text: 'Загружаю: {0} из {1} файлов загружено.',
+ error_msgbox_title: 'Ошибка',
+ permitted_extensions_join_str: ',',
+ err_file_type_not_permitted: 'Файлы с таким расширением запрещено загружать.<br/>Пожалуйста выбирайте файлы с одним из следующий расширений: {1}',
+ note_queued_to_upload: 'Поставлен в очередь.',
+ note_processing: 'Загружается...',
+ note_upload_failed: 'Сервер недоступен, либо на сервере произошла ошибка.',
+ note_upload_success: 'Загружен.',
+ note_upload_error: 'Ошибка загрузки.',
+ note_aborted: 'Загрузка прервана пользователем.',
+ }
+);
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/readme.txt
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/readme.txt 2008-09-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/app/public/js/UploadDialog/readme.txt 2008-09-09 18:00:21 UTC (rev 865)
@@ -0,0 +1,4 @@
+Extension Page : http://max-bazhenov.com/dev/upload-dialog-2.0/index.php
+Author : Maxim Bazhenov (aka MaximGB)
+v 2.0 (12.04.2008)
+License : respectoware
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/app/public/js/ext-ux-all-min.js
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/js/ext-ux-all-min.js 2008-09-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/app/public/js/ext-ux-all-min.js 2008-09-09 18:00:21 UTC (rev 865)
@@ -0,0 +1 @@
+Ext.ux.FileTreeMenu=function(config){config=config||{};var uploadPanelConfig={contextmenu:this,buttonsAt:config.buttonsAt||"tbar",singleUpload:config.singleUpload||false,maxFileSize:config.maxFileSize,enableProgress:config.enableProgress};if(config.baseParams){config.baseParams.cmd=config.baseParams.cmd||"upload";config.baseParams.dir=config.baseParams.dir||".";uploadPanelConfig.baseParams=config.baseParams}Ext.apply(config,{items:[{text:" ",cls:"ux-ftm-nodename",disabledClass:"",disabled:true,cmd:"nodename"},{text:this.openText+" (Enter)",iconCls:this.openIconCls,cmd:"open",menu:{items:[{text:this.openSelfText,iconCls:this.openSelfIconCls,cmd:"open-self"},{text:this.openPopupText,iconCls:this.openPopupIconCls,cmd:"open-popup"},{text:this.openBlankText,iconCls:this.openBlankIconCls,cmd:"open-blank"},{text:this.openDwnldText,iconCls:this.openDwnldIconCls,cmd:"open-dwnld"}]}},new Ext.menu.Separator({cmd:"sep-open"}),{text:this.reloadText+" (Ctrl+E)",iconCls:this.reloadIconCls,cmd:"reload"},{text:this.expandText+" (Ctrl+ →)",iconCls:this.expandIconCls,cmd:"expand"},{text:this.collapseText+" (Ctrl+ ←)",iconCls:this.collapseIconCls,cmd:"collapse"},new Ext.menu.Separator({cmd:"sep-collapse"}),{text:this.renameText+" (F2)",iconCls:this.renameIconCls,cmd:"rename"},{text:this.deleteText+" ("+this.deleteKeyName+")",iconCls:this.deleteIconCls,cmd:"delete"},{text:this.newdirText+"... (Ctrl+N)",iconCls:this.newdirIconCls,cmd:"newdir"},new Ext.menu.Separator({cmd:"sep-upload"}),{text:this.uploadFileText+" (Ctrl+U)",iconCls:this.uploadIconCls,hideOnClick:false,cmd:"upload"},new Ext.menu.Adapter(new Ext.ux.UploadPanel(uploadPanelConfig),{hideOnClick:false,cmd:"upload-panel"})]});Ext.ux.FileTreeMenu.superclass.constructor.call(this,config);this.relayEvents(this.getItemByCmd("open").menu,["click","itemclick"])};Ext.extend(Ext.ux.FileTreeMenu,Ext.menu.Menu,{collapseIconCls:"icon-collapse-all",collapseText:"Collapse all",deleteIconCls:"icon-cross",deleteKeyName:"Delete Key",deleteText:"Delete",expandIconCls:"icon-expand-all",expandText:"Expand all",newdirIconCls:"icon-folder-add",newdirText:"New folder",openBlankIconCls:"icon-open-blank",openBlankText:"Open in new window",openDwnldIconCls:"icon-open-download",openDwnldText:"Download",openIconCls:"icon-open",openPopupIconCls:"icon-open-popup",openPopupText:"Open in popup",openSelfIconCls:"icon-open-self",openSelfText:"Open in this window",openText:"Open",reloadIconCls:"icon-refresh",reloadText:'R<span style="text-decoration:underline">e</span>load',renameIconCls:"icon-pencil",renameText:"Rename",uploadFileText:'<span style="text-decoration:underline">U</span>pload file',uploadIconCls:"icon-upload",uploadText:"Upload",width:190,getItemByCmd:function(cmd){var open;var item=this.items.find(function(i){return cmd===i.cmd});if(!item){open=this.items.find(function(i){return"open"===i.cmd});if(!open){return null}item=open.menu.items.find(function(i){return cmd===i.cmd})}return item},setItemDisabled:function(cmd,disabled){var item=this.getItemByCmd(cmd);if(item){item.setDisabled(disabled)}},beforeDestroy:function(){var uploadPanel=this.getItemByCmd("upload-panel");if(uploadPanel&&uploadPanel.component){uploadPanel.component.purgeListeners();uploadPanel.component.destroy();uploadPanel.component=null}}});Ext.reg("filetreemenu",Ext.ux.FileTreeMenu);Ext.ux.FileTreePanel=Ext.extend(Ext.tree.TreePanel,{confirmText:"Confirm",containerScroll:true,deleteText:"Delete",enableDD:true,enableDelete:true,enableNewDir:true,enableOpen:true,enableProgress:true,enableRename:true,enableSort:true,enableUpload:true,errorText:"Error",existsText:"File <b>{0}</b> already exists",expandOnRender:true,fileCls:"file",fileText:"File",focusPopup:true,folderSort:true,hrefPrefix:"",hrefSuffix:"",layout:"fit",loadingText:"Loading",loadMask:false,maxFileSize:524288,maxMsgLen:2000,method:"post",newdirText:"New Folder",openMode:"popup",overwriteText:"Do you want to overwrite it?",popupFeatures:"width=800,height=600,dependent=1,scrollbars=1,resizable=1,toolbar=1",readOnly:false,reallyWantText:"Do you really want to",rootPath:"root",rootText:"Tree Root",selectOnEdit:true,singleUpload:false,topMenu:false,url:"filetree.php",initComponent:function(){Ext.apply(this,{root:new Ext.tree.AsyncTreeNode({text:this.rootText,path:this.rootPath,allowDrag:false}),treeEditor:!this.readOnly?new Ext.tree.TreeEditor(this,{allowBlank:false,cancelOnEsc:true,completeOnEnter:true,ignoreNoChange:true,selectOnFocus:this.selectOnEdit}):undefined,dropConfig:this.dropConfig?this.dropConfig:{ddGroup:this.ddGroup||"TreeDD",appendOnly:this.enableSort,expandDelay:3600000},treeSorter:this.enableSort?new Ext.tree.TreeSorter(this,{folderSort:this.folderSort}):undefined,keys:[{key:Ext.EventObject.ENTER,scope:this,fn:function(key,e){var sm=this.getSelectionModel();var node=sm.getSelectedNode();if(node&&0!==node.getDepth()&&node.isLeaf()){this.openNode(node)}}},{key:113,scope:this,fn:function(key,e){var sm=this.getSelectionModel();var node=sm.getSelectedNode();if(node&&0!==node.getDepth()&&this.enableRename&&this.readOnly!==true){this.treeEditor.triggerEdit(node)}}},{key:46,stopEvent:true,scope:this,fn:function(key,e){var sm=this.getSelectionModel();var node=sm.getSelectedNode();if(node&&0!==node.getDepth()&&this.enableDelete&&this.readOnly!==true){this.deleteNode(node)}}},{key:69,ctrl:true,stopEvent:true,scope:this,fn:function(key,e){var sm=this.getSelectionModel();var node=sm.getSelectedNode();if(node){node=node.isLeaf()?node.parentNode:node;sm.select(node);node.reload()}}},{key:39,ctrl:true,stopEvent:true,scope:this,fn:function(key,e){var sm=this.getSelectionModel();var node=sm.getSelectedNode();if(node&&!node.isLeaf()){sm.select(node);node.expand.defer(1,node,[true])}}},{key:37,ctrl:true,scope:this,stopEvent:true,fn:function(key,e){var sm=this.getSelectionModel();var node=sm.getSelectedNode();if(node&&!node.isLeaf()){sm.select(node);node.collapse.defer(1,node,[true])}}},{key:78,ctrl:true,scope:this,stopEvent:true,fn:function(key,e){var sm,node;sm=this.getSelectionModel();node=sm.getSelectedNode();if(node&&this.enableNewDir&&this.readOnly!==true){node=node.isLeaf()?node.parentNode:node;this.createNewDir(node)}}}]});if(!this.loader){this.loader=new Ext.tree.TreeLoader({url:this.url,baseParams:{cmd:"get"},listeners:{beforeload:{scope:this,fn:function(loader,node){loader.baseParams.path=this.getPath(node);loader.baseParams.cmd="get"}}}})}if(true===this.topMenu){this.tbar=[{text:this.fileText,disabled:true,scope:this,menu:this.getContextMenu()}]}Ext.ux.FileTreePanel.superclass.initComponent.apply(this,arguments);if(this.treeEditor){this.treeEditor.beforeNodeClick=function(node,e){return true};this.treeEditor.on({complete:{scope:this,fn:this.onEditComplete},beforecomplete:{scope:this,fn:this.onBeforeEditComplete}})}this.on({contextmenu:{scope:this,fn:this.onContextMenu,stopEvent:true},dblclick:{scope:this,fn:this.onDblClick},beforenodedrop:{scope:this,fn:this.onBeforeNodeDrop},nodedrop:{scope:this,fn:this.onNodeDrop},nodedragover:{scope:this,fn:this.onNodeDragOver}});this.addEvents("beforeopen","open","beforerename","rename","renamefailure","beforedelete","delete","deletefailure","beforenewdir","newdir","newdirfailure")},onRender:function(){Ext.ux.FileTreePanel.superclass.onRender.apply(this,arguments);if(true===this.topMenu){this.topMenu=Ext.getCmp(this.getTopToolbar().items.itemAt(0).id);this.getSelectionModel().on({scope:this,selectionchange:function(sm,node){var disable=node?false:true;disable=disable||this.readOnly;this.topMenu.setDisabled(disable)}});Ext.apply(this.topMenu,{showMenu:function(){this.showContextMenu(false)}.createDelegate(this)})}if(this.expandOnRender){this.root.expand()}this.el.on({contextmenu:{fn:function(){return false},stopEvent:true}});if(true===this.loadMask){this.loader.on({scope:this.el,beforeload:this.el.mask.createDelegate(this.el,[this.loadingText+"..."]),load:this.el.unmask,loadexception:this.el.unmask})}},cmdCallback:function(options,success,response){var i,o,node;var showMsg=true;if(true===success){try{o=Ext.decode(response.responseText)}catch(ex){this.showError(response.responseText)}if(true===o.success){switch(options.params.cmd){case"delete":if(true!==this.eventsSuspended){this.fireEvent("delete",this,this.getPath(options.node))}options.node.parentNode.removeChild(options.node);break;case"newdir":if(true!==this.eventsSuspended){this.fireEvent("newdir",this,options.node)}break;case"rename":this.updateCls(options.node,options.params.oldname);if(true!==this.eventsSuspended){this.fireEvent("rename",this,options.node,options.params.newname,options.params.oldname)}break}}else{switch(options.params.cmd){case"rename":if(options.oldParent){options.oldParent.appendChild(options.node)}else{options.node.setText(options.oldName)}if(options.e){options.e.failure=true}if(true!==this.eventsSuspended){this.fireEvent("renamefailure",this,options.node,options.params.newname,options.params.oldname)}break;case"newdir":if(false!==this.eventsSuspended){this.fireEvent("newdirfailure",this,options.params.dir)}options.node.parentNode.removeChild(options.node);break;case"delete":if(true!==this.eventsSuspended){this.fireEvent("deletefailure",this,options.node)}options.node.parentNode.reload.defer(1,options.node.parentNode);break;default:this.root.reload();break}this.showError(o.error||response.responseText)}}else{this.showError(response.responseText)}},confirmOverwrite:function(filename,callback,scope){Ext.Msg.show({title:this.confirmText,msg:String.format(this.existsText,filename)+". "+this.overwriteText,icon:Ext.Msg.QUESTION,buttons:Ext.Msg.YESNO,fn:callback.createDelegate(scope||this)})},createNewDir:function(node){if(true!==this.eventsSuspended&&false===this.fireEvent("beforenewdir",this,node)){return }var treeEditor=this.treeEditor;var newNode;var appendNode=node.isLeaf()?node.parentNode:node;appendNode.expand(false,false,function(n){newNode=n.appendChild(new Ext.tree.AsyncTreeNode({text:this.newdirText,iconCls:"folder"}));treeEditor.on({complete:{scope:this,single:true,fn:this.onNewDir}});treeEditor.creatingNewDir=true;(function(){treeEditor.triggerEdit(newNode)}.defer(10))}.createDelegate(this))},deleteNode:function(node){if(true!==this.eventsSuspended&&false===this.fireEvent("beforedelete",this,node)){return }Ext.Msg.show({title:this.deleteText,msg:this.reallyWantText+" "+this.deleteText.toLowerCase()+" <b>"+node.text+"</b>?",icon:Ext.Msg.WARNING,buttons:Ext.Msg.YESNO,scope:this,fn:function(response){if("yes"!==response){this.getEl().dom.focus();return }var options={url:this.deleteUrl||this.url,method:this.method,scope:this,callback:this.cmdCallback,node:node,params:{cmd:"delete",file:this.getPath(node)}};Ext.Ajax.request(options)}})},downloadFile:function(path){var id=Ext.id();var frame=document.createElement("iframe");frame.id=id;frame.name=id;frame.className="x-hidden";if(Ext.isIE){frame.src=Ext.SSL_SECURE_URL}document.body.appendChild(frame);if(Ext.isIE){document.frames[id].name=id}var form=Ext.DomHelper.append(document.body,{tag:"form",method:"post",action:this.downloadUrl||this.url,target:id});document.body.appendChild(form);var hidden;hidden=document.createElement("input");hidden.type="hidden";hidden.name="cmd";hidden.value="download";form.appendChild(hidden);hidden=document.createElement("input");hidden.type="hidden";hidden.name="path";hidden.value=path;form.appendChild(hidden);var callback=function(){Ext.EventManager.removeListener(frame,"load",callback,this);setTimeout(function(){document.body.removeChild(form)},100);setTimeout(function(){document.body.removeChild(frame)},110)};Ext.EventManager.on(frame,"load",callback,this);form.submit()},getContextMenu:function(){if(!this.contextmenu){var config={singleUpload:this.singleUpload,maxFileSize:this.maxFileSize,enableProgress:this.enableProgress};if(this.baseParams){config.baseParams=this.baseParams}this.contextmenu=new Ext.ux.FileTreeMenu(config);this.contextmenu.on({click:{scope:this,fn:this.onContextClick}});this.uploadPanel=this.contextmenu.getItemByCmd("upload-panel").component;this.uploadPanel.on({beforeupload:{scope:this,fn:this.onBeforeUpload},allfinished:{scope:this,fn:this.onAllFinished}});this.uploadPanel.setUrl(this.uploadUrl||this.url);this.relayEvents(this.uploadPanel,["beforefileadd","fileadd","beforefileremove","fileremove","beforequeueclear","queueclear","beforeupload","beforeallstart","allfinished","progress"])}return this.contextmenu},getFileCls:function(name){var atmp=name.split(".");if(1===atmp.length){return this.fileCls}else{return this.fileCls+"-"+atmp.pop().toLowerCase()}},getPath:function(node){var path,p,a;if(node!==this.root){p=node.parentNode;a=[node.text];while(p&&p!==this.root){a.unshift(p.text);p=p.parentNode}a.unshift(this.root.attributes.path||"");path=a.join(this.pathSeparator)}else{path=node.attributes.path||""}path=path.replace(/^[\/\.]*/,"");return path},hasChild:function(node,childName){return(node.isLeaf()?node.parentNode:node).findChild("text",childName)!==null},hideContextMenu:function(){if(this.contextmenu&&this.contextmenu.isVisible()){this.contextmenu.hide()}return this},onBeforeEditComplete:function(editor,newName,oldName){if(editor.cancellingEdit){editor.cancellingEdit=false;return }var oldPath=this.getPath(editor.editNode);var newPath=oldPath.replace(/\/[^\\]+$/,"/"+newName);if(false===this.fireEvent("beforerename",this,editor.editNode,newPath,oldPath)){editor.cancellingEdit=true;editor.cancelEdit();return false}},onBeforeNodeDrop:function(e){var s=e.dropNode;var d=e.target.leaf?e.target.parentNode:e.target;if(s.parentNode===d){return false}if(this.hasChild(d,s.text)&&undefined===e.confirmed){this.confirmOverwrite(s.text,function(response){e.confirmed="yes"===response;this.onBeforeNodeDrop(e)});return false}if(false===e.confirmed){return false}e.confirmed=undefined;e.oldParent=s.parentNode;var oldName=this.getPath(s);var newName=this.getPath(d)+"/"+s.text;if(true!==this.eventsSuspended&&false===this.fireEvent("beforerename",this,s,newName,oldName)){return false}var options={url:this.renameUrl||this.url,method:this.method,scope:this,callback:this.cmdCallback,node:s,oldParent:s.parentNode,e:e,params:{cmd:"rename",oldname:oldName,newname:newName}};Ext.Ajax.request(options);return true},onBeforeUpload:function(uploadPanel){var menu=this.getContextMenu();var path=this.getPath(menu.node);if(menu.node.isLeaf()){path=path.replace(/\/[^\/]+$/,"",path)}uploadPanel.setPath(path)},onAllFinished:function(uploader){var menu=this.getContextMenu();(menu.node.isLeaf()?menu.node.parentNode:menu.node).reload()},onContextClick:function(menu,item,e){if(item.disabled){return }var node=menu.node;if(!node){node=menu.parentMenu.node}switch(item.cmd){case"reload":node.reload();break;case"expand":node.expand(true);break;case"collapse":node.collapse(true);break;case"open":this.openNode(node);break;case"open-self":this.openNode(node,"_self");break;case"open-popup":this.openNode(node,"popup");break;case"open-blank":this.openNode(node,"_blank");break;case"open-dwnld":this.openNode(node,"download");break;case"rename":this.treeEditor.triggerEdit(node);break;case"delete":this.deleteNode(node);break;case"newdir":this.createNewDir(node);break;default:break}},onContextMenu:function(node,e){if(this.readOnly){return false}this.showContextMenu(node);return false},onDblClick:function(node,e){this.openNode(node)},onDestroy:function(){if(this.contextmenu){this.contextmenu.purgeListeners();this.contextmenu.destroy();this.contextmenu=null}if(this.treeEditor){this.treeEditor.purgeListeners();this.treeEditor.destroy();this.treeEditor=null}if(this.treeSorter){this.treeSorter=null}Ext.ux.FileTreePanel.superclass.onDestroy.call(this)},onEditComplete:function(editor,newName,oldName){var node=editor.editNode;if(newName===oldName||editor.creatingNewDir){editor.creatingNewDir=false;return }var path=this.getPath(node.parentNode);var options={url:this.renameUrl||this.url,method:this.method,scope:this,callback:this.cmdCallback,node:node,oldName:oldName,params:{cmd:"rename",oldname:path+"/"+oldName,newname:path+"/"+newName}};Ext.Ajax.request(options)},onNewDir:function(editor){var path=this.getPath(editor.editNode);var options={url:this.newdirUrl||this.url,method:this.method,scope:this,node:editor.editNode,callback:this.cmdCallback,params:{cmd:"newdir",dir:path}};Ext.Ajax.request(options)},onNodeDragOver:function(e){e.cancel=e.target.disabled||e.dropNode.parentNode===e.target.parentNode&&e.target.isLeaf()},onNodeDrop:function(e){if(true===e.failure){e.oldParent.appendChild(e.dropNode);return }var sameNode=e.dropNode.parentNode.findChild("text",e.dropNode.text);if(sameNode&&sameNode!==e.dropNode){sameNode.parentNode.removeChild(sameNode)}},openNode:function(node,mode){if(!this.enableOpen){return }mode=mode||this.openMode;var url;var path;var newpath;if(node.isLeaf()){path=this.getPath(node);newpath=this.opennodepath(this,node,path,mode);if(newpath!==undefined&&newpath!=null&&newpath.length>0){path=newpath}url=this.hrefPrefix+path+this.hrefSuffix;if(true!==this.eventsSuspended&&false===this.fireEvent("beforeopen",this,node.text,url,mode)){return }switch(mode){case"popup":if(!this.popup||this.popup.closed){this.popup=window.open(url,this.hrefTarget,this.popupFeatures)}this.popup.location=url;if(this.focusPopup){this.popup.focus()}break;case"_self":window.location=url;break;case"_blank":window.open(url);break;case"download":this.downloadFile(path);break}if(true!==this.eventsSuspended){this.fireEvent("open",this,node.text,url,mode)}}},setDeleteDisabled:function(disabled){disabled=!(!disabled);if(!this.enableDelete===disabled){return this}this.hideContextMenu();this.enableDelete=!disabled},setNewdirDisabled:function(disabled){disabled=!(!disabled);if(!this.enableNewDir===disabled){return this}this.hideContextMenu();this.enableNewDir=!disabled},setOpenDisabled:function(disabled){disabled=!(!disabled);if(!this.enableOpen===disabled){return this}this.hideContextMenu();this.enableOpen=!disabled;return this},setReadOnly:function(readOnly){readOnly=!(!readOnly);if(this.readOnly===readOnly){return this}this.hideContextMenu();if(this.dragZone){this.dragZone.locked=readOnly}this.readOnly=readOnly;return this},setRenameDisabled:function(disabled){disabled=!(!disabled);if(!this.enableRename===disabled){return this}this.hideContextMenu();if(this.dragZone){this.dragZone.locked=disabled}this.enableRename=!disabled;return this},setUploadDisabled:function(disabled){disabled=!(!disabled);if(!this.enableUpload===disabled){return this}this.hideContextMenu();this.enableUpload=!disabled;return this},showContextMenu:function(node){var topAlign=false;var alignEl=this.topMenu?this.topMenu.getEl():this.body;if(!node){node=this.getSelectionModel().getSelectedNode();topAlign=true}else{alignEl=node.getUI().getEl()}if(!node){return }var menu=this.getContextMenu();menu.node=node;menu.getItemByCmd("nodename").setText(Ext.util.Format.ellipsis(node.text,22));menu.setItemDisabled("open",!node.isLeaf());menu.setItemDisabled("reload",node.isLeaf());menu.setItemDisabled("expand",node.isLeaf());menu.setItemDisabled("collapse",node.isLeaf());menu.setItemDisabled("delete",node===this.root||node.disabled);menu.setItemDisabled("rename",this.readOnly||node===this.root||node.disabled);menu.setItemDisabled("newdir",this.readOnly||(node.isLeaf()?node.parentNode.disabled:node.disabled));menu.setItemDisabled("upload",node.isLeaf()?node.parentNode.disabled:node.disabled);menu.setItemDisabled("upload-panel",node.isLeaf()?node.parentNode.disabled:node.disabled);menu.getItemByCmd("open").setVisible(this.enableOpen);menu.getItemByCmd("delete").setVisible(this.enableDelete);menu.getItemByCmd("newdir").setVisible(this.enableNewDir);menu.getItemByCmd("rename").setVisible(this.enableRename);menu.getItemByCmd("upload").setVisible(this.enableUpload);menu.getItemByCmd("upload-panel").setVisible(this.enableUpload);menu.getItemByCmd("sep-upload").setVisible(this.enableUpload);menu.getItemByCmd("sep-collapse").setVisible(this.enableNewDir||this.enableDelete||this.enableRename);node.select();if(topAlign){menu.showAt(menu.getEl().getAlignToXY(alignEl,"tl-bl?"))}else{menu.showAt(menu.getEl().getAlignToXY(alignEl,"tl-tl?",[0,18]))}},showError:function(msg,title){Ext.Msg.show({title:title||this.errorText,msg:Ext.util.Format.ellipsis(msg,this.maxMsgLen),fixCursor:true,icon:Ext.Msg.ERROR,buttons:Ext.Msg.OK,minWidth:1200>String(msg).length?360:600})},updateCls:function(node,oldName){if(node.isLeaf()){Ext.fly(node.getUI().iconNode).removeClass(this.getFileCls(oldName));Ext.fly(node.getUI().iconNode).addClass(this.getFileCls(node.text))}}});Ext.reg("filetreepanel",Ext.ux.FileTreePanel);Ext.ux.FileUploader=function(config){Ext.apply(this,config);Ext.ux.FileUploader.superclass.constructor.apply(this,arguments);this.addEvents("beforeallstart","allfinished","beforefilestart","filefinished","progress")};Ext.extend(Ext.ux.FileUploader,Ext.util.Observable,{baseParams:{cmd:"upload",dir:"."},concurrent:true,enableProgress:true,jsonErrorText:"Cannot decode JSON object",maxFileSize:524288,progressIdName:"UPLOAD_IDENTIFIER",progressInterval:2000,progressUrl:"progress.php",progressMap:{bytes_total:"bytesTotal",bytes_uploaded:"bytesUploaded",est_sec:"estSec",files_uploaded:"filesUploaded",speed_average:"speedAverage",speed_last:"speedLast",time_last:"timeLast",time_start:"timeStart"},singleUpload:false,unknownErrorText:"Unknown error",upCount:0,createForm:function(record){var progressId=parseInt(Math.random()*10000000000,10);var form=Ext.getBody().createChild({tag:"form",action:this.url,method:"post",cls:"x-hidden",id:Ext.id(),cn:[{tag:"input",type:"hidden",name:"APC_UPLOAD_PROGRESS",value:progressId},{tag:"input",type:"hidden",name:this.progressIdName,value:progressId},{tag:"input",type:"hidden",name:"MAX_FILE_SIZE",value:this.maxFileSize}]});if(record){record.set("form",form);record.set("progressId",progressId)}else{this.progressId=progressId}return form},deleteForm:function(form,record){form.remove();if(record){record.set("form",null)}},fireFinishEvents:function(options){if(true!==this.eventsSuspended&&!this.singleUpload){this.fireEvent("filefinished",this,options&&options.record)}if(true!==this.eventsSuspended&&0===this.upCount){this.stopProgress();this.fireEvent("allfinished",this)}},getIframe:function(record){var iframe=null;var form=record.get("form");if(form&&form.dom&&form.dom.target){iframe=Ext.get(form.dom.target)}return iframe},getOptions:function(record,params){var o={url:this.url,method:"post",isUpload:true,scope:this,callback:this.uploadCallback,record:record,params:this.getParams(record,params)};return o},getParams:function(record,params){var p={path:this.path};Ext.apply(p,this.baseParams||{},params||{});return p},processSuccess:function(options,response,o){var record=false;if(this.singleUpload){this.store.each(function(r){r.set("state","done");r.set("error","");r.commit()})}else{record=options.record;record.set("state","done");record.set("error","");record.commit()}this.deleteForm(options.form,record)},processFailure:function(options,response,error){var record=options.record;var records;if(this.singleUpload){records=this.store.queryBy(function(r){return"done"!==r.get("state")});records.each(function(record){var e=error.errors?error.errors[record.id]:this.unknownErrorText;if(e){record.set("state","failed");record.set("error",e);Ext.getBody().appendChild(record.get("input"))}else{record.set("state","done");record.set("error","")}record.commit()},this);this.deleteForm(options.form)}else{if(error&&"object"===Ext.type(error)){record.set("error",error.errors&&error.errors[record.id]?error.errors[record.id]:this.unknownErrorText)}else{if(error){record.set("error",error)}else{if(response&&response.responseText){record.set("error",response.responseText)}else{record.set("error",this.unknownErrorText)}}}record.set("state","failed");record.commit()}},requestProgress:function(){var records,p;var o={url:this.progressUrl,method:"post",params:{},scope:this,callback:function(options,success,response){var o;if(true!==success){return }try{o=Ext.decode(response.responseText)}catch(e){return }if("object"!==Ext.type(o)||true!==o.success){return }if(this.singleUpload){this.progress={};for(p in o){if(this.progressMap[p]){this.progress[this.progressMap[p]]=parseInt(o[p],10)}}if(true!==this.eventsSuspended){this.fireEvent("progress",this,this.progress)}}else{for(p in o){if(this.progressMap[p]&&options.record){options.record.set(this.progressMap[p],parseInt(o[p],10))}}if(options.record){options.record.commit();if(true!==this.eventsSuspended){this.fireEvent("progress",this,options.record.data,options.record)}}}this.progressTask.delay(this.progressInterval)}};if(this.singleUpload){o.params[this.progressIdName]=this.progressId;o.params.APC_UPLOAD_PROGRESS=this.progressId;Ext.Ajax.request(o)}else{records=this.store.query("state","uploading");records.each(function(r){o.params[this.progressIdName]=r.get("progressId");o.params.APC_UPLOAD_PROGRESS=o.params[this.progressIdName];o.record=r;(function(){Ext.Ajax.request(o)}).defer(250)},this)}},setPath:function(path){this.path=path},setUrl:function(url){this.url=url},startProgress:function(){if(!this.progressTask){this.progressTask=new Ext.util.DelayedTask(this.requestProgress,this)}this.progressTask.delay.defer(this.progressInterval/2,this.progressTask,[this.progressInterval])},stopProgress:function(){if(this.progressTask){this.progressTask.cancel()}},stopAll:function(){var records=this.store.query("state","uploading");records.each(this.stopUpload,this)},stopUpload:function(record){var iframe=false;if(record){iframe=this.getIframe(record);this.stopIframe(iframe);this.upCount--;this.upCount=0>this.upCount?0:this.upCount;record.set("state","stopped");this.fireFinishEvents({record:record})}else{if(this.form){iframe=Ext.fly(this.form.dom.target);this.stopIframe(iframe);this.upCount=0;this.fireFinishEvents()}}},stopIframe:function(iframe){if(iframe){try{iframe.dom.contentWindow.stop();iframe.remove.defer(250,iframe)}catch(e){}}},upload:function(){var records=this.store.queryBy(function(r){return"done"!==r.get("state")});if(!records.getCount()){return }if(true!==this.eventsSuspended&&false===this.fireEvent("beforeallstart",this)){return }if(this.singleUpload){this.uploadSingle()}else{records.each(this.uploadFile,this)}if(true===this.enableProgress){this.startProgress()}},uploadCallback:function(options,success,response){var o;this.upCount--;this.form=false;if(true===success){try{o=Ext.decode(response.responseText)}catch(e){this.processFailure(options,response,this.jsonErrorText);this.fireFinishEvents(options);return }if(true===o.success){this.processSuccess(options,response,o)}else{this.processFailure(options,response,o)}}else{this.processFailure(options,response)}this.fireFinishEvents(options)},uploadFile:function(record,params){if(true!==this.eventsSuspended&&false===this.fireEvent("beforefilestart",this,record)){return }var form=this.createForm(record);var inp=record.get("input");inp.set({name:inp.id});form.appendChild(inp);var o=this.getOptions(record,params);o.form=form;record.set("state","uploading");record.set("pctComplete",0);this.upCount++;Ext.Ajax.request(o);this.getIframe.defer(100,this,[record])},uploadSingle:function(){var records=this.store.queryBy(function(r){return"done"!==r.get("state")});if(!records.getCount()){return }var form=this.createForm();records.each(function(record){var inp=record.get("input");inp.set({name:inp.id});form.appendChild(inp);record.set("state","uploading")},this);var o=this.getOptions();o.form=form;this.form=form;this.upCount++;Ext.Ajax.request(o)}});Ext.reg("fileuploader",Ext.ux.FileUploader);Ext.namespace("Ext.ux.form");Ext.ux.form.BrowseButton=Ext.extend(Ext.Button,{inputFileName:"file",debug:false,FLOAT_EL_WIDTH:60,FLOAT_EL_HEIGHT:18,buttonCt:null,clipEl:null,floatEl:null,inputFileEl:null,originalHandler:null,originalScope:null,initComponent:function(){Ext.ux.form.BrowseButton.superclass.initComponent.call(this);this.originalHandler=this.handler||null;this.originalScope=this.scope||window;this.handler=null;this.scope=null},onRender:function(ct,position){Ext.ux.form.BrowseButton.superclass.onRender.call(this,ct,position);this.buttonCt=this.el.child(".x-btn-center em");this.buttonCt.position("relative");var styleCfg={position:"absolute",overflow:"hidden",top:"0px",left:"0px"};if(Ext.isIE){Ext.apply(styleCfg,{left:"-3px",top:"-3px"})}else{if(Ext.isGecko){Ext.apply(styleCfg,{left:"-3px",top:"-3px"})}else{if(Ext.isSafari){Ext.apply(styleCfg,{left:"-4px",top:"-2px"})}}}this.clipEl=this.buttonCt.createChild({tag:"div",style:styleCfg});this.setClipSize();this.clipEl.on({mousemove:this.onButtonMouseMove,mouseover:this.onButtonMouseMove,scope:this});this.floatEl=this.clipEl.createChild({tag:"div",style:{position:"absolute",width:this.FLOAT_EL_WIDTH+"px",height:this.FLOAT_EL_HEIGHT+"px",overflow:"hidden"}});if(this.debug){this.clipEl.applyStyles({"background-color":"green"});this.floatEl.applyStyles({"background-color":"red"})}else{this.clipEl.setOpacity(0)}this.createInputFile()},setClipSize:function(){if(this.clipEl){var width=this.buttonCt.getWidth();var height=this.buttonCt.getHeight();if(Ext.isIE){width=width+5;height=height+5}else{if(Ext.isGecko){width=width+6;height=height+6}else{if(Ext.isSafari){width=width+6;height=height+6}}}this.clipEl.setSize(width,height)}},createInputFile:function(){this.inputFileEl=this.floatEl.createChild({tag:"input",type:"file",size:1,name:this.inputFileName||Ext.id(this.el),style:{position:"absolute",cursor:"pointer",right:"0px",top:"0px"}});this.inputFileEl=this.inputFileEl.child("input")||this.inputFileEl;this.inputFileEl.on({click:this.onInputFileClick,change:this.onInputFileChange,scope:this});if(this.tooltip){if(typeof this.tooltip=="object"){Ext.QuickTips.register(Ext.apply({target:this.inputFileEl},this.tooltip))}else{this.inputFileEl.dom[this.tooltipType]=this.tooltip}}},onButtonMouseMove:function(e){var xy=e.getXY();xy[0]-=this.FLOAT_EL_WIDTH/2;xy[1]-=this.FLOAT_EL_HEIGHT/2;this.floatEl.setXY(xy)},onInputFileClick:function(e){e.stopPropagation()},onInputFileChange:function(){if(this.originalHandler){this.originalHandler.call(this.originalScope,this)}},detachInputFile:function(noCreate){var result=this.inputFileEl;if(typeof this.tooltip=="object"){Ext.QuickTips.unregister(this.inputFileEl)}else{this.inputFileEl.dom[this.tooltipType]=null}this.inputFileEl.removeAllListeners();this.inputFileEl=null;if(!noCreate){this.createInputFile()}return result},getInputFile:function(){return this.inputFileEl},disable:function(){Ext.ux.form.BrowseButton.superclass.disable.call(this);this.inputFileEl.dom.disabled=true},enable:function(){Ext.ux.form.BrowseButton.superclass.enable.call(this);this.inputFileEl.dom.disabled=false}});Ext.reg("browsebutton",Ext.ux.form.BrowseButton);Ext.ux.IconCombo=Ext.extend(Ext.form.ComboBox,{initComponent:function(){Ext.apply(this,{tpl:'<tpl for="."><div class="x-combo-list-item ux-icon-combo-item {'+this.iconClsField+'}">{'+this.displayField+"}</div></tpl>"});Ext.ux.IconCombo.superclass.initComponent.apply(this,arguments)},onRender:function(ct,position){Ext.ux.IconCombo.superclass.onRender.apply(this,arguments);this.wrap.applyStyles({position:"relative"});this.el.addClass("ux-icon-combo-input");this.icon=Ext.DomHelper.append(this.el.up("div.x-form-field-wrap"),{tag:"div",style:"position:absolute"})},afterRender:function(){Ext.ux.IconCombo.superclass.afterRender.apply(this,arguments);if(undefined!==this.value){this.setValue(this.value)}},setIconCls:function(){var rec=this.store.query(this.valueField,this.getValue()).itemAt(0);if(rec&&this.icon){this.icon.className="ux-icon-combo-icon "+rec.get(this.iconClsField)}},setValue:function(value){Ext.ux.IconCombo.superclass.setValue.call(this,value);this.setIconCls()},clearValue:function(){Ext.ux.IconCombo.superclass.clearValue.call(this);if(this.icon){this.icon.className=""}}});Ext.reg("iconcombo",Ext.ux.IconCombo);Ext.ux.LangSelectCombo=Ext.extend(Ext.ux.IconCombo,{selectLangText:"Select Language",lazyRender:true,lazyInit:true,langVariable:"locale",typeAhead:true,initComponent:function(){var langCode=Ext.state.Manager.getProvider()?Ext.state.Manager.get(this.langVariable):"en_US";langCode=langCode?langCode:"en_US";Ext.apply(this,{store:new Ext.data.SimpleStore({id:0,fields:[{name:"langCode",type:"string"},{name:"langName",type:"string"},{name:"langCls",type:"string"}],data:[["cs_CZ","Český","ux-flag-cz"],["de_DE","Deutsch","ux-flag-de"],["en_US","English","ux-flag-us"],["ru_RU","Russian","ux-flag-ru"],["sk_SK","Slovenský","ux-flag-sk"],["es_ES","Spanish","ux-flag-es"],["tr_TR","Turkish","ux-flag-tr"]]}),valueField:"langCode",displayField:"langName",iconClsField:"langCls",triggerAction:"all",mode:"local",forceSelection:true,value:langCode});Ext.ux.LangSelectCombo.superclass.initComponent.apply(this,arguments)},onSelect:function(record){Ext.ux.LangSelectCombo.superclass.onSelect.apply(this,arguments);var langCode=record.get("langCode");if(Ext.state.Manager.getProvider()){Ext.state.Manager.set(this.langVariable,langCode)}window.location.search=this.langVariable+"="+langCode}});Ext.ux.ThemeCombo=Ext.extend(Ext.form.ComboBox,{themeBlueText:"Ext Blue Theme",themeGrayText:"Gray Theme",themeBlackText:"Black Theme",themeOliveText:"Olive Theme",themePurpleText:"Purple Theme",themeDarkGrayText:"Dark Gray Theme",themeSlateText:"Slate Theme",themeVistaText:"Vista Theme",themePeppermintText:"Peppermint Theme",themeChocolateText:"Chocolate Theme",themeGreenText:"Green Theme",themeIndigoText:"Indigo Theme",themeMidnightText:"Midnight Theme",themeSilverCherryText:"Silver Cherry Theme",themeSlicknessText:"Slickness Theme",themeVar:"theme",selectThemeText:"Select Theme",themeGrayExtndText:"Gray-Extended Theme",lazyRender:true,lazyInit:true,cssPath:"../ext/resources/css/",initComponent:function(){Ext.apply(this,{store:new Ext.data.SimpleStore({fields:["themeFile",{name:"themeName",type:"string"}],data:[["xtheme-default.css",this.themeBlueText],["xtheme-gray.css",this.themeGrayText],["xtheme-darkgray.css",this.themeDarkGrayText],["xtheme-black.css",this.themeBlackText],["xtheme-olive.css",this.themeOliveText],["xtheme-purple.css",this.themePurpleText],["xtheme-slate.css",this.themeSlateText],["xtheme-peppermint.css",this.themePeppermintText],["xtheme-chocolate.css",this.themeChocolateText],["xtheme-green.css",this.themeGreenText],["xtheme-indigo.css",this.themeIndigoText],["xtheme-midnight.css",this.themeMidnightText],["xtheme-silverCherry.css",this.themeSilverCherryText],["xtheme-slickness.css",this.themeSlicknessText],["xtheme-gray-extend.css",this.themeGrayExtndText]]}),valueField:"themeFile",displayField:"themeName",triggerAction:"all",mode:"local",forceSelection:true,editable:false,fieldLabel:this.selectThemeText});this.store.sort("themeName");Ext.ux.ThemeCombo.superclass.initComponent.apply(this,arguments);this.setValue(Ext.state.Manager.get(this.themeVar)||"xtheme-default.css")},setValue:function(val){Ext.ux.ThemeCombo.superclass.setValue.apply(this,arguments);Ext.util.CSS.swapStyleSheet(this.themeVar,this.cssPath+val);if(Ext.state.Manager.getProvider()){Ext.state.Manager.set(this.themeVar,val)}}});Ext.reg("themecombo",Ext.ux.ThemeCombo);Ext.ux.UploadPanel=Ext.extend(Ext.Panel,{addIconCls:"icon-plus",addText:"Add",bodyStyle:"padding:2px",buttonsAt:"tbar",clickRemoveText:"Click to remove",clickStopText:"Click to stop",emptyText:"No files",enableProgress:true,errorText:"Error",fileCls:"file",fileQueuedText:"File <b>{0}</b> is queued for upload",fileDoneText:"File <b>{0}</b> has been successfully uploaded",fileFailedText:"File <b>{0}</b> failed to upload",fileStoppedText:"File <b>{0}</b> stopped by user",fileUploadingText:"Uploading file <b>{0}</b>",maxFileSize:524288,maxLength:18,removeAllIconCls:"icon-cross",removeAllText:"Remove All",removeIconCls:"icon-minus",removeText:"Remove",selectedClass:"ux-up-item-selected",singleUpload:false,stopAllText:"Stop All",stopIconCls:"icon-stop",uploadText:"Upload",uploadIconCls:"icon-upload",workingIconCls:"icon-working",initComponent:function(){var addCfg={xtype:"browsebutton",text:this.addText+"...",iconCls:this.addIconCls,scope:this,handler:this.onAddFile};var upCfg={xtype:"button",iconCls:this.uploadIconCls,text:this.uploadText,scope:this,handler:this.onUpload,disabled:true};var removeAllCfg={xtype:"button",iconCls:this.removeAllIconCls,tooltip:this.removeAllText,scope:this,handler:this.onRemoveAllClick,disabled:true};if("body"!==this.buttonsAt){this[this.buttonsAt]=[addCfg,upCfg,"->",removeAllCfg]}var fields=[{name:"id",type:"text",system:true},{name:"shortName",type:"text",system:true},{name:"fileName",type:"text",system:true},{name:"filePath",type:"text",system:true},{name:"fileCls",type:"text",system:true},{name:"input",system:true},{name:"form",system:true},{name:"state",type:"text",system:true},{name:"error",type:"text",system:true},{name:"progressId",type:"int",system:true},{name:"bytesTotal",type:"int",system:true},{name:"bytesUploaded",type:"int",system:true},{name:"estSec",type:"int",system:true},{name:"filesUploaded",type:"int",system:true},{name:"speedAverage",type:"int",system:true},{name:"speedLast",type:"int",system:true},{name:"timeLast",type:"int",system:true},{name:"timeStart",type:"int",system:true},{name:"pctComplete",type:"int",system:true}];if(Ext.isArray(this.customFields)){fields.push(this.customFields)}this.store=new Ext.data.SimpleStore({id:0,fields:fields,data:[]});Ext.apply(this,{items:[{xtype:"dataview",itemSelector:"div.ux-up-item",store:this.store,selectedClass:this.selectedClass,singleSelect:true,emptyText:this.emptyText,tpl:this.tpl||new Ext.XTemplate('<tpl for="."><div class="ux-up-item"><div class="ux-up-icon-file {fileCls}"> </div><div class="ux-up-text x-unselectable" qtip="{fileName}">{shortName}</div><div id="remove-{[values.input.id]}" class="ux-up-icon-state ux-up-icon-{state}"qtip="{[this.scope.getQtip(values)]}"> </div></div></tpl>',{scope:this}),listeners:{click:{scope:this,fn:this.onViewClick}}}]});Ext.ux.UploadPanel.superclass.initComponent.apply(this,arguments);this.view=this.items.itemAt(0);this.addEvents("beforefileadd","fileadd","beforefileremove","fileremove","beforequeueclear","queueclear","beforeupload");this.relayEvents(this.view,["beforeclick","beforeselect","click","containerclick","contextmenu","dblclick","selectionchange"]);var config={store:this.store,singleUpload:this.singleUpload,maxFileSize:this.maxFileSize,enableProgress:this.enableProgress,url:this.url,path:this.path};if(this.baseParams){config.baseParams=this.baseParams}this.uploader=new Ext.ux.FileUploader(config);this.relayEvents(this.uploader,["beforeallstart","allfinished","progress"]);this.on({beforeallstart:{scope:this,fn:function(){this.uploading=true;this.updateButtons()}},allfinished:{scope:this,fn:function(){this.uploading=false;this.updateButtons()}},progress:{fn:this.onProgress.createDelegate(this)}})},onRender:function(){Ext.ux.UploadPanel.superclass.onRender.apply(this,arguments);var tb="tbar"===this.buttonsAt?this.getTopToolbar():this.getBottomToolbar();this.addBtn=Ext.getCmp(tb.items.first().id);this.uploadBtn=Ext.getCmp(tb.items.itemAt(1).id);this.removeAllBtn=Ext.getCmp(tb.items.last().id)},getQtip:function(values){var qtip="";switch(values.state){case"queued":qtip=String.format(this.fileQueuedText,values.fileName);qtip+="<br>"+this.clickRemoveText;break;case"uploading":qtip=String.format(this.fileUploadingText,values.fileName);qtip+="<br>"+values.pctComplete+"% done";qtip+="<br>"+this.clickStopText;break;case"done":qtip=String.format(this.fileDoneText,values.fileName);qtip+="<br>"+this.clickRemoveText;break;case"failed":qtip=String.format(this.fileFailedText,values.fileName);qtip+="<br>"+this.errorText+":"+values.error;qtip+="<br>"+this.clickRemoveText;break;case"stopped":qtip=String.format(this.fileStoppedText,values.fileName);qtip+="<br>"+this.clickRemoveText;break}return qtip},getFileName:function(inp){return inp.getValue().split(/[\/\\]/).pop()},getFilePath:function(inp){return inp.getValue().replace(/[^\/\\]+$/,"")},getFileCls:function(name){var atmp=name.split(".");if(1===atmp.length){return this.fileCls}else{return this.fileCls+"-"+atmp.pop().toLowerCase()}},onAddFile:function(bb){if(true!==this.eventsSuspended&&false===this.fireEvent("beforefileadd",this,bb.getInputFile())){return }var inp=bb.detachInputFile();inp.addClass("x-hidden");var fileName=this.getFileName(inp);var rec=new this.store.recordType({input:inp,fileName:fileName,filePath:this.getFilePath(inp),shortName:Ext.util.Format.ellipsis(fileName,this.maxLength),fileCls:this.getFileCls(fileName),state:"queued"},inp.id);rec.commit();this.store.add(rec);this.syncShadow();this.uploadBtn.enable();this.removeAllBtn.enable();if(true!==this.eventsSuspended){this.fireEvent("fileadd",this,this.store,rec)}},onDestroy:function(){if(this.uploader){this.uploader.stopAll();this.uploader.purgeListeners();this.uploader=null}if(this.view){this.view.purgeListeners();this.view.destroy();this.view=null}if(this.store){this.store.purgeListeners();this.store.destroy();this.store=null}},onProgress:function(uploader,data,record){var bytesTotal,bytesUploaded,pctComplete,state,idx,item,width,pgWidth;if(record){state=record.get("state");bytesTotal=record.get("bytesTotal")||1;bytesUploaded=record.get("bytesUploaded")||0;if("uploading"===state){pctComplete=Math.round(1000*bytesUploaded/bytesTotal)/10}else{if("done"==="state"){pctComplete=100}else{pctComplete=0}}record.set("pctComplete",pctComplete);idx=this.store.indexOf(record);item=Ext.get(this.view.getNode(idx));if(item){width=item.getWidth();item.applyStyles({"background-position":width*pctComplete/100+"px"})}}},onRemoveFile:function(record){if(true!==this.eventsSuspended&&false===this.fireEvent("beforefileremove",this,this.store,record)){return }var inp=record.get("input");var wrap=inp.up("em");inp.remove();if(wrap){wrap.remove()}this.store.remove(record);var count=this.store.getCount();this.uploadBtn.setDisabled(!count);this.removeAllBtn.setDisabled(!count);if(true!==this.eventsSuspended){this.fireEvent("fileremove",this,this.store);this.syncShadow()}},onRemoveAllClick:function(btn){if(true===this.uploading){this.stopAll()}else{this.removeAll()}},stopAll:function(){this.uploader.stopAll()},onViewClick:function(view,index,node,e){var t=e.getTarget("div:any(.ux-up-icon-queued|.ux-up-icon-failed|.ux-up-icon-done|.ux-up-icon-stopped)");if(t){this.onRemoveFile(this.store.getAt(index))}t=e.getTarget("div.ux-up-icon-uploading");if(t){this.uploader.stopUpload(this.store.getAt(index))}},onUpload:function(){if(true!==this.eventsSuspended&&false===this.fireEvent("beforeupload",this)){return false}this.uploader.upload()},setUrl:function(url){this.url=url;this.uploader.setUrl(url)},setPath:function(path){this.uploader.setPath(path)},updateButtons:function(){if(true===this.uploading){this.addBtn.disable();this.uploadBtn.disable();this.removeAllBtn.setIconClass(this.stopIconCls);this.removeAllBtn.getEl().child(this.removeAllBtn.buttonSelector).dom[this.removeAllBtn.tooltipType]=this.stopAllText}else{this.addBtn.enable();this.uploadBtn.enable();this.removeAllBtn.setIconClass(this.removeAllIconCls);this.removeAllBtn.getEl().child(this.removeAllBtn.buttonSelector).dom[this.removeAllBtn.tooltipType]=this.removeAllText}},removeAll:function(){var suspendState=this.eventsSuspended;if(false!==this.eventsSuspended&&false===this.fireEvent("beforequeueclear",this,this.store)){return false}this.suspendEvents();this.store.each(this.onRemoveFile,this);this.eventsSuspended=suspendState;if(true!==this.eventsSuspended){this.fireEvent("queueclear",this,this.store)}this.syncShadow()},syncShadow:function(){if(this.contextmenu&&this.contextmenu.shadow){this.contextmenu.getEl().shadow.show(this.contextmenu.getEl())}}});Ext.reg("uploadpanel",Ext.ux.UploadPanel);Ext.ns("Ext.ux.grid");Ext.ux.grid.CellActions=function(config){Ext.apply(this,config);this.addEvents("action","beforeaction");Ext.ux.grid.CellActions.superclass.constructor.call(this)};Ext.extend(Ext.ux.grid.CellActions,Ext.util.Observable,{actionEvent:"click",actionWidth:20,tpl:'<div class="ux-cell-value" style="padding-left:{padding}px"><tpl if="\'left\'!==align">{value}</tpl><div class="ux-cell-actions<tpl if="\'left\'===align"> ux-cell-actions-left</tpl>" style="width:{width}px"><tpl for="actions"><div class="ux-cell-action {cls}" qtip="{qtip}" style="{style}"> </div></tpl></div><tpl if="\'left\'===align">{value}</tpl><div>',userProcessing:Ext.emptyFn,init:function(grid){this.grid=grid;grid.afterRender=grid.afterRender.createSequence(this.onRenderGrid,this);var cm=this.grid.getColumnModel();Ext.each(cm.config,function(c,idx){if("object"===typeof c.cellActions){c.origRenderer=cm.getRenderer(idx);c.renderer=this.renderActions.createDelegate(this)}},this)},onRenderGrid:function(){this.view=this.grid.getView();var cfg={scope:this};cfg[this.actionEvent]=this.onClick;this.view.mainBody.on(cfg)},getData:function(value,cell,record,row,col,store){return record.data||{}},renderActions:function(value,cell,record,row,col,store){var c=this.grid.getColumnModel().config[col];var val=c.origRenderer(value,cell,record,row,col,store);if(c.cellActions&&!c.actionsTpl){c.actionsTpl=this.processActions(c);c.actionsTpl.compile()}else{if(!c.cellActions){return val}}var data=this.getData.apply(this,arguments);data.value=val;return c.actionsTpl.apply(data)},processActions:function(c){this.callbacks=this.callbacks||{};var data={align:this.align||"right",width:this.actionWidth*c.cellActions.length,padding:"left"===this.align?this.actionWidth*c.cellActions.length:0,value:"{value}",actions:[]};Ext.each(c.cellActions,function(a,i){if(a.iconCls&&"function"===typeof (a.callback||a.cb)){this.callbacks[a.iconCls]=a.callback||a.cb}var o={cls:a.iconIndex?"{"+a.iconIndex+"}":(a.iconCls?a.iconCls:""),qtip:a.qtipIndex?"{"+a.qtipIndex+"}":(a.tooltip||a.qtip?a.tooltip||a.qtip:""),style:a.style?a.style:""};data.actions.push(o)},this);this.userProcessing(c,data);var xt=new Ext.XTemplate(this.tpl);return new Ext.Template(xt.apply(data))},onClick:function(e,target){var t=e.getTarget("div.ux-cell-action");var row=e.getTarget(".x-grid3-row");var col=this.view.findCellIndex(target.parentNode.parentNode);var c=this.grid.getColumnModel().config[col];var record,dataIndex,value,action;if(t){record=this.grid.store.getAt(row.rowIndex);dataIndex=c.dataIndex;value=record.get(dataIndex);action=t.className.replace(/ux-cell-action /,"")}if(false!==row&&false!==col&&record&&dataIndex&&action){if(this.callbacks&&"function"===typeof this.callbacks[action]){this.callbacks[action](this.grid,record,action,value,row.rowIndex,col)}if(true!==this.eventsSuspended&&false===this.fireEvent("beforeaction",this.grid,record,action,value,dataIndex,row.rowIndex,col)){return }else{if(true!==this.eventsSuspended){this.fireEvent("action",this.grid,record,action,value,dataIndex,row.rowIndex,col)}}}}});Ext.reg("cellactions",Ext.ux.grid.CellActions);Ext.namespace("Ext.ux","Ext.ux.grid");Ext.ux.grid.Search=function(config){Ext.apply(this,config);Ext.ux.grid.Search.superclass.constructor.call(this)};Ext.extend(Ext.ux.grid.Search,Ext.util.Observable,{searchText:"Search",searchTipText:"Type a text to search and press Enter",position:"bottom",iconCls:false,checkIndexes:"all",disableIndexes:[],dateFormat:undefined,mode:"remote",xtype:"gridsearch",paramNames:{fields:"fields",query:"query"},init:function(grid){this.grid=grid;grid.onRender=grid.onRender.createSequence(this.onRender,this);grid.reconfigure=grid.reconfigure.createSequence(this.reconfigure,this)},onRender:function(){var grid=this.grid;var tb="bottom"==this.position?grid.bottomToolbar:grid.topToolbar;this.menu=new Ext.menu.Menu();tb.add({text:this.searchText,menu:this.menu,iconCls:this.iconCls});this.field=new Ext.form.TwinTriggerField({width:this.width,selectOnFocus:undefined===this.selectOnFocus?true:this.selectOnFocus,trigger1Class:"x-form-clear-trigger",trigger2Class:"x-form-search-trigger",onTrigger1Click:this.onTriggerClear.createDelegate(this),onTrigger2Click:this.onTriggerSearch.createDelegate(this)});this.field.on("render",function(){this.field.el.dom.qtip=this.searchTipText;var map=new Ext.KeyMap(this.field.el,[{key:Ext.EventObject.ENTER,scope:this,fn:this.onTriggerSearch},{key:Ext.EventObject.ESC,scope:this,fn:this.onTriggerClear}]);map.stopEvent=true},this,{single:true});tb.add(this.field);this.reconfigure()},onTriggerClear:function(){this.field.setValue("");this.field.focus();this.onTriggerSearch()},onTriggerSearch:function(){var val=this.field.getValue();var store=this.grid.store;if("local"===this.mode){store.clearFilter();if(val){store.filterBy(function(r){var retval=false;this.menu.items.each(function(item){if(!item.checked||retval){return }var rv=r.get(item.dataIndex);if(!(rv instanceof Date)||(this.dateFormat||r.fields.get(item.dataIndex).dateFormat)){rv=rv instanceof Date?rv.format(this.dateFormat||r.fields.get(item.dataIndex).dateFormat):rv;var re=new RegExp(val,"gi");retval=re.test(rv)}},this);if(retval){return true}return retval},this)}else{}}else{if(store.lastOptions&&store.lastOptions.params){store.lastOptions.params[store.paramNames.start]=0}var fields=[];this.menu.items.each(function(item){if(item.checked){fields.push(item.dataIndex)}});delete (store.baseParams[this.paramNames.fields]);delete (store.baseParams[this.paramNames.query]);if(store.lastOptions&&store.lastOptions.params){delete (store.lastOptions.params[this.paramNames.fields]);delete (store.lastOptions.params[this.paramNames.query])}if(fields.length){store.baseParams[this.paramNames.fields]=Ext.encode(fields);store.baseParams[this.paramNames.query]=val}store.reload()}},setDisabled:function(){this.field.setDisabled.apply(this.field,arguments)},enable:function(){this.setDisabled(false)},disable:function(){this.setDisabled(true)},reconfigure:function(){var menu=this.menu;menu.removeAll();var cm=this.grid.colModel;Ext.each(cm.config,function(config){var disable=false;if(config.header&&config.dataIndex){Ext.each(this.disableIndexes,function(item){disable=disable?disable:item===config.dataIndex});if(!disable){menu.add(new Ext.menu.CheckItem({text:config.header,hideOnClick:false,checked:"all"===this.checkIndexes,dataIndex:config.dataIndex}))}}},this);if(this.checkIndexes instanceof Array){Ext.each(this.checkIndexes,function(di){var item=menu.items.find(function(itm){return itm.dataIndex===di});if(item){item.setChecked(true,true)}},this)}}});Ext.ns("Ext.ux.grid.GridSummary");Ext.ux.grid.GridSummary=function(config){Ext.apply(this,config)};Ext.extend(Ext.ux.grid.GridSummary,Ext.util.Observable,{init:function(grid){this.grid=grid;this.cm=grid.getColumnModel();this.view=grid.getView();var v=this.view;v.onLayout=this.onLayout;v.afterMethod("render",this.refreshSummary,this);v.afterMethod("refresh",this.refreshSummary,this);v.afterMethod("syncScroll",this.syncSummaryScroll,this);v.afterMethod("onColumnWidthUpdated",this.doWidth,this);v.afterMethod("onAllColumnWidthsUpdated",this.doAllWidths,this);v.afterMethod("onColumnHiddenUpdated",this.doHidden,this);v.afterMethod("onUpdate",this.refreshSummary,this);v.afterMethod("onRemove",this.refreshSummary,this);grid.store.on("add",this.refreshSummary,this);grid.store.on("remove",this.refreshSummary,this);grid.store.on("clear",this.refreshSummary,this);if(!this.rowTpl){this.rowTpl=new Ext.Template('<div class="x-grid3-summary-row x-grid3-gridsummary-row-offset">','<table class="x-grid3-summary-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',"<tbody><tr>{cells}</tr></tbody>","</table>","</div>");this.rowTpl.disableFormats=true}this.rowTpl.compile();if(!this.cellTpl){this.cellTpl=new Ext.Template('<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} {css}" style="{style}">','<div class="x-grid3-cell-inner x-grid3-col-{id}" unselectable="on">{value}</div>',"</td>");this.cellTpl.disableFormats=true}this.cellTpl.compile()},calculate:function(rs,cs){var data={},r,c,cfg=this.cm.config,cf;for(var j=0,jlen=rs.length;j<jlen;j++){r=rs[j];for(var i=0,len=cs.length;i<len;i++){c=cs[i];cf=cfg[i];if(cf&&cf.summaryType){data[c.name]=Ext.ux.grid.GridSummary.Calculations[cf.summaryType](data[c.name]||0,r,c.name,data)}}}return data},onLayout:function(vw,vh){if(!this.grid.getGridEl().hasClass("x-grid-hide-gridsummary")){this.scroller.setHeight(vh-this.summary.getHeight())}},syncSummaryScroll:function(){var mb=this.view.scroller.dom;this.view.summaryWrap.dom.scrollLeft=mb.scrollLeft;this.view.summaryWrap.dom.scrollLeft=mb.scrollLeft},doWidth:function(col,w,tw){var s=this.view.summary.dom;s.firstChild.style.width=tw;s.firstChild.rows[0].childNodes[col].style.width=w},doAllWidths:function(ws,tw){var s=this.view.summary.dom,wlen=ws.length;s.firstChild.style.width=tw;cells=s.firstChild.rows[0].childNodes;for(var j=0;j<wlen;j++){cells[j].style.width=ws[j]}},doHidden:function(col,hidden,tw){var s=this.view.summary.dom;var display=hidden?"none":"";s.firstChild.style.width=tw;s.firstChild.rows[0].childNodes[col].style.display=display},renderSummary:function(o,cs){cs=cs||this.view.getColumnData();var cfg=this.cm.config;var buf=[],c,p={},cf,last=cs.length-1;for(var i=0,len=cs.length;i<len;i++){c=cs[i];cf=cfg[i];p.id=c.id;p.style=c.style;p.css=i==0?"x-grid3-cell-first ":(i==last?"x-grid3-cell-last ":"");if(cf.summaryType||cf.summaryRenderer){p.value=(cf.summaryRenderer||c.renderer)(o.data[c.name],p,new Ext.data.Record(o.data),-1,i,this.grid.store)}else{p.value=""}if(p.value==undefined||p.value===""){p.value=" "}buf[buf.length]=this.cellTpl.apply(p)}return this.rowTpl.apply({tstyle:"width:"+this.view.getTotalWidth()+";",cells:buf.join("")})},refreshSummary:function(){if(!this.grid.rendered){return }var g=this.grid,ds=g.store;var cs=this.view.getColumnData();var rs=ds.getRange();var data=this.calculate(rs,cs);var buf=this.renderSummary({data:data},cs);if(!this.view.summaryWrap){this.view.summaryWrap=Ext.DomHelper.insertAfter(this.view.scroller,{tag:"div",cls:"x-grid3-gridsummary-row-inner"},true)}else{this.view.summary.remove()}this.view.summary=this.view.summaryWrap.insertHtml("afterbegin",buf,true)},toggleSummary:function(visible){var el=this.grid.getGridEl();if(el){if(visible===undefined){visible=el.hasClass("x-grid-hide-gridsummary")}el[visible?"removeClass":"addClass"]("x-grid-hide-gridsummary");this.view.layout()}},getSummaryNode:function(){return this.view.summary}});Ext.ux.grid.GridSummary.Calculations={sum:function(v,record,field){return v+Ext.num(record.data[field],0)},count:function(v,record,field,data){return data[field+"count"]?++data[field+"count"]:(data[field+"count"]=1)},max:function(v,record,field,data){var v=record.data[field];var max=data[field+"max"]===undefined?(data[field+"max"]=v):data[field+"max"];return v>max?(data[field+"max"]=v):max},min:function(v,record,field,data){var v=record.data[field];var min=data[field+"min"]===undefined?(data[field+"min"]=v):data[field+"min"];return v<min?(data[field+"min"]=v):min},average:function(v,record,field,data){var c=data[field+"count"]?++data[field+"count"]:(data[field+"count"]=1);var t=(data[field+"total"]=((data[field+"total"]||0)+(record.data[field]||0)));return t===0?0:t/c}};Ext.namespace("Ext.ux.grid");Ext.ux.grid.BufferedGridDragZone=function(grid,config){this.view=grid.getView();Ext.ux.grid.BufferedGridDragZone.superclass.constructor.call(this,this.view.mainBody.dom,config);if(this.view.lockedBody){this.setHandleElId(Ext.id(this.view.mainBody.dom));this.setOuterHandleElId(Ext.id(this.view.lockedBody.dom))}this.scroll=false;this.grid=grid;this.ddel=document.createElement("div");this.ddel.className="x-grid-dd-wrap";this.view.ds.on("beforeselectionsload",this.onBeforeSelectionsLoad,this);this.view.ds.on("selectionsload",this.onSelectionsLoad,this)};Ext.extend(Ext.ux.grid.BufferedGridDragZone,Ext.dd.DragZone,{ddGroup:"GridDD",isDropValid:true,getDragData:function(e){var t=Ext.lib.Event.getTarget(e);var rowIndex=this.view.findRowIndex(t);if(rowIndex!==false){var sm=this.grid.selModel;if(!sm.isSelected(rowIndex)||e.hasModifier()){sm.handleMouseDown(this.grid,rowIndex,e)}return{grid:this.grid,ddel:this.ddel,rowIndex:rowIndex,selections:sm.getSelections()}}return false},onInitDrag:function(e){this.view.ds.loadSelections(this.grid.selModel.getPendingSelections(true));var data=this.dragData;this.ddel.innerHTML=this.grid.getDragDropText();this.proxy.update(this.ddel)},onBeforeSelectionsLoad:function(){this.isDropValid=false;Ext.fly(this.proxy.el.dom.firstChild).addClass("x-dd-drop-waiting")},onSelectionsLoad:function(){this.isDropValid=true;this.ddel.innerHTML=this.grid.getDragDropText();Ext.fly(this.proxy.el.dom.firstChild).removeClass("x-dd-drop-waiting")},afterRepair:function(){this.dragging=false},getRepairXY:function(e,data){return false},onStartDrag:function(){},onEndDrag:function(data,e){},onValidDrop:function(dd,e,id){this.hideProxy()},beforeInvalidDrop:function(e,id){}});Ext.namespace("Ext.ux");Ext.ux.BufferedGridToolbar=Ext.extend(Ext.Toolbar,{displayMsg:"Displaying {0} - {1} of {2}",emptyMsg:"No data to display",refreshText:"Refresh",initComponent:function(){Ext.ux.BufferedGridToolbar.superclass.initComponent.call(this);this.bind(this.view)},updateInfo:function(rowIndex,visibleRows,totalCount){if(this.displayEl){var msg=totalCount==0?this.emptyMsg:String.format(this.displayMsg,rowIndex+1,rowIndex+visibleRows,totalCount);this.displayEl.update(msg)}},unbind:function(view){view.un("rowremoved",this.onRowRemoved,this);view.un("rowsinserted",this.onRowsInserted,this);view.un("beforebuffer",this.beforeBuffer,this);view.un("cursormove",this.onCursorMove,this);view.un("buffer",this.onBuffer,this);this.view=undefined},bind:function(view){view.on("rowremoved",this.onRowRemoved,this);view.on("rowsinserted",this.onRowsInserted,this);view.on("beforebuffer",this.beforeBuffer,this);view.on("cursormove",this.onCursorMove,this);view.on("buffer",this.onBuffer,this);this.view=view},onCursorMove:function(view,rowIndex,visibleRows,totalCount){this.updateInfo(rowIndex,visibleRows,totalCount)},onRowsInserted:function(view,start,end){this.updateInfo(view.rowIndex,Math.min(view.ds.totalLength,view.visibleRows),view.ds.totalLength)},onRowRemoved:function(view,index,record){this.updateInfo(view.rowIndex,Math.min(view.ds.totalLength,view.visibleRows),view.ds.totalLength)},beforeBuffer:function(view,store,rowIndex,visibleRows,totalCount){this.loading.disable();this.updateInfo(rowIndex,visibleRows,totalCount)},onBuffer:function(view,store,rowIndex,visibleRows,totalCount){this.loading.enable();this.updateInfo(rowIndex,visibleRows,totalCount)},onClick:function(type){switch(type){case"refresh":this.view.reset(true);break}},onRender:function(ct,position){Ext.PagingToolbar.superclass.onRender.call(this,ct,position);this.loading=this.addButton({tooltip:this.refreshText,iconCls:"x-tbar-loading",handler:this.onClick.createDelegate(this,["refresh"])});this.addSeparator();if(this.displayInfo){this.displayEl=Ext.fly(this.el.dom).createChild({cls:"x-paging-info"})}}});Ext.namespace("Ext.ux.grid");Ext.ux.grid.BufferedGridView=function(config){this.addEvents({beforebuffer:true,buffer:true,cursormove:true});this.horizontalScrollOffset=16;this.loadMask=false;Ext.apply(this,config);this.bufferRange=[0,-1];this.templates={};this.templates.master=new Ext.Template('<div class="x-grid3" hidefocus="true"><div style="z-index:2000;background:none;position:relative;height:321px; float:right; width: 18px;overflow: scroll;"><div style="background:none;width:1px;overflow:hidden;font-size:1px;height:0px;"></div></div>','<div class="x-grid3-viewport" style="float:left">','<div class="x-grid3-header"><div class="x-grid3-header-inner"><div class="x-grid3-header-offset">{header}</div></div><div class="x-clear"></div></div>','<div class="x-grid3-scroller" style="overflow-y:hidden !important;"><div class="x-grid3-body" style="position:relative;">{body}</div><a href="#" class="x-grid3-focus" tabIndex="-1"></a></div>',"</div>",'<div class="x-grid3-resize-marker"> </div>','<div class="x-grid3-resize-proxy"> </div>',"</div>");Ext.ux.grid.BufferedGridView.superclass.constructor.call(this)};Ext.extend(Ext.ux.grid.BufferedGridView,Ext.grid.GridView,{liveScroller:null,liveScrollerInset:null,rowHeight:-1,visibleRows:1,lastIndex:-1,lastRowIndex:0,lastScrollPos:0,rowIndex:0,isBuffering:false,requestQueue:-1,loadMask:null,isPrebuffering:false,reset:function(forceReload){if(forceReload===false){this.ds.modified=[];this.grid.selModel.clearSelections(true);this.rowIndex=0;this.lastScrollPos=0;this.lastRowIndex=0;this.lastIndex=0;this.bufferRange=[0,this.ds.bufferSize];this.adjustScrollerPos(-this.liveScroller.dom.scrollTop,true);this.showLoadMask(false);this.refresh(true);this.fireEvent("cursormove",this,0,Math.min(this.ds.totalLength,this.visibleRows),this.ds.totalLength)}else{var params={start:0,limit:this.ds.bufferSize};var sInfo=this.ds.sortInfo;if(sInfo){params.dir=sInfo.direction;params.sort=sInfo.field}this.ds.load({callback:function(){this.reset(false)},scope:this,params:params})}},renderUI:function(){var g=this.grid;var dEnabled=g.enableDragDrop||g.enableDrag;g.enableDragDrop=false;g.enableDrag=false;Ext.ux.grid.BufferedGridView.superclass.renderUI.call(this);var g=this.grid;g.enableDragDrop=dEnabled;g.enableDrag=dEnabled;if(dEnabled){var dd=new Ext.ux.grid.BufferedGridDragZone(g,{ddGroup:g.ddGroup||"GridDD"})}if(this.loadMask){this.loadMask=new Ext.LoadMask(this.mainBody.dom.parentNode.parentNode,this.loadMask)}},init:function(grid){Ext.ux.grid.BufferedGridView.superclass.init.call(this,grid);this.bufferRange=[0,this.ds.bufferSize];this.ds.on("beforeload",this.onBeforeLoad,this)},renderBody:function(){var markup=this.renderRows(0,this.visibleRows-1);return this.templates.body.apply({rows:markup})},initElements:function(){var E=Ext.Element;var el=this.grid.getGridEl().dom.firstChild;var cs=el.childNodes;this.el=new E(el);this.mainWrap=new E(cs[1]);this.liveScroller=new E(cs[0]);this.liveScrollerInset=this.liveScroller.dom.firstChild;this.liveScroller.on("scroll",this.onLiveScroll,this);this.mainHd=new E(this.mainWrap.dom.firstChild);this.innerHd=this.mainHd.dom.firstChild;this.scroller=new E(this.mainWrap.dom.childNodes[1]);if(this.forceFit){this.scroller.setStyle("overflow-x","hidden")}this.mainBody=new E(this.scroller.dom.firstChild);this.mainBody.on("mousewheel",this.handleWheel,this);this.focusEl=new E(this.scroller.dom.childNodes[1]);this.focusEl.swallowEvent("click",true);this.resizeMarker=new E(cs[2]);this.resizeProxy=new E(cs[3])},layout:function(){if(!this.mainBody){return }var g=this.grid;var c=g.getGridEl(),cm=this.cm,expandCol=g.autoExpandColumn,gv=this;var csize=c.getSize(true);var vw=csize.width-this.scrollOffset;if(vw<20||csize.height<20){return }if(g.autoHeight){this.scroller.dom.style.overflow="visible"}else{this.el.setSize(csize.width,csize.height);var hdHeight=this.mainHd.getHeight();var vh=csize.height-(hdHeight);this.scroller.setSize(vw,vh);if(this.innerHd){this.innerHd.style.width=(vw)+"px"}}if(this.forceFit){if(this.lastViewWidth!=vw){this.fitColumns(false,false);this.lastViewWidth=vw}}else{this.autoExpand()}this.adjustVisibleRows();this.adjustBufferInset();this.onLayout(vw,vh)},onColumnWidthUpdated:function(col,w,tw){this.adjustVisibleRows();this.adjustBufferInset()},onAllColumnWidthsUpdated:function(ws,tw){this.adjustVisibleRows();this.adjustBufferInset()},onRowSelect:function(row){if(row<this.rowIndex||row>this.rowIndex+this.visibleRows){return }var viewIndex=row-this.rowIndex;this.addRowClass(viewIndex,"x-grid3-row-selected")},onRowDeselect:function(row){if(row<this.rowIndex||row>this.rowIndex+this.visibleRows){return }var viewIndex=row-this.rowIndex;this.removeRowClass(viewIndex,"x-grid3-row-selected")},onCellSelect:function(row,col){if(row<this.rowIndex||row>this.rowIndex+this.visibleRows){return }var viewIndex=row-this.rowIndex;var cell=this.getCell(viewIndex,col);if(cell){this.fly(cell).addClass("x-grid3-cell-selected")}},onCellDeselect:function(row,col){if(row<this.rowIndex||row>this.rowIndex+this.visibleRows){return }var viewIndex=row-this.rowIndex;var cell=this.getCell(viewIndex,col);if(cell){this.fly(cell).removeClass("x-grid3-cell-selected")}},onRowOver:function(e,t){var row;if((row=this.findRowIndex(t))!==false){var viewIndex=row-this.rowIndex;this.addRowClass(viewIndex,"x-grid3-row-over")}},onRowOut:function(e,t){var row;if((row=this.findRowIndex(t))!==false&&row!==this.findRowIndex(e.getRelatedTarget())){var viewIndex=row-this.rowIndex;this.removeRowClass(viewIndex,"x-grid3-row-over")}},onClear:function(){this.reset(false)},onRemove:function(ds,record,index,isUpdate){if(index==Number.MIN_VALUE||index==Number.MAX_VALUE){this.fireEvent("beforerowremoved",this,index,record);this.fireEvent("rowremoved",this,index,record);this.adjustBufferInset();return }var viewIndex=index+this.bufferRange[0];if(isUpdate!==true){this.fireEvent("beforerowremoved",this,viewIndex,record)}var domLength=this.getRows().length;if(viewIndex<this.rowIndex){this.rowIndex--;this.lastRowIndex=this.rowIndex;this.adjustScrollerPos(-this.rowHeight,true);this.fireEvent("cursormove",this,this.rowIndex,Math.min(this.ds.totalLength,this.visibleRows),this.ds.totalLength)}else{if(viewIndex>=this.rowIndex&&viewIndex<this.rowIndex+domLength){var lastPossibleRIndex=this.rowIndex-this.bufferRange[0]+this.visibleRows;var cInd=viewIndex-this.rowIndex;var rec=this.ds.getAt(lastPossibleRIndex);if(rec==null){if(this.ds.totalLength>this.rowIndex+this.visibleRows){if(isUpdate!==true){this.fireEvent("rowremoved",this,viewIndex,record)}this.updateLiveRows(this.rowIndex,true,true);return }else{if(this.rowIndex==0){this.removeRows(cInd,cInd)}else{this.rowIndex--;if(this.rowIndex<this.bufferRange[0]){if(isUpdate!==true){this.fireEvent("rowremoved",this,viewIndex,record)}this.updateLiveRows(this.rowIndex);return }else{this.replaceLiveRows(this.rowIndex)}}}}else{this.removeRows(cInd,cInd);var html=this.renderRows(lastPossibleRIndex,lastPossibleRIndex);Ext.DomHelper.insertHtml("beforeEnd",this.mainBody.dom,html)}}}this.bufferRange[1]--;this.adjustBufferInset();if(isUpdate!==true){this.fireEvent("rowremoved",this,viewIndex,record)}this.processRows(0,undefined,true)},onAdd:function(ds,records,index){var recordLen=records.length;if(index==Number.MAX_VALUE||index==Number.MIN_VALUE){this.fireEvent("beforerowsinserted",this,index,index);if(index==Number.MIN_VALUE){this.rowIndex=this.rowIndex+recordLen;this.lastRowIndex=this.rowIndex;this.bufferRange[0]+=recordLen;this.bufferRange[1]+=recordLen;this.adjustBufferInset();this.adjustScrollerPos(this.rowHeight*recordLen,true);this.fireEvent("rowsinserted",this,index,index);this.processRows();this.fireEvent("cursormove",this,this.rowIndex,Math.min(this.ds.totalLength,this.visibleRows),this.ds.totalLength);return }this.adjustBufferInset();this.fireEvent("rowsinserted",this,index,index);return }var start=index+this.bufferRange[0];var end=start+(recordLen-1);var len=this.getRows().length;var firstRow=0;var lastRow=0;if(index>=(this.rowIndex-this.bufferRange[0])+len&&len==this.visibleRows){this.fireEvent("beforerowsinserted",this,start,end);this.fireEvent("rowsinserted",this,start,end);this.adjustVisibleRows();this.adjustBufferInset()}else{if(len==this.visibleRows&&index<=this.rowIndex-this.bufferRange[0]){this.fireEvent("beforerowsinserted",this,start,end);this.liveScroller.un("scroll",this.onLiveScroll,this);this.rowIndex+=recordLen;this.lastRowIndex=this.rowIndex;this.adjustVisibleRows();this.adjustBufferInset();this.adjustScrollerPos(this.rowHeight*recordLen,true);this.fireEvent("rowsinserted",this,start,end);this.processRows();this.fireEvent("cursormove",this,this.rowIndex,Math.min(this.ds.totalLength,this.visibleRows),this.ds.totalLength)}else{if((len<this.visibleRows)||index>this.rowIndex-this.bufferRange[0]){firstRow=index;lastRow=Math.min(end,this.rowIndex+this.visibleRows-1)-this.bufferRange[0];this.insertRows(ds,firstRow,lastRow);this.adjustVisibleRows();this.adjustBufferInset()}}}},onBeforeLoad:function(store,options){if(!options.params){options.params={start:0,limit:this.ds.bufferSize}}else{options.params.start=0;options.params.limit=this.ds.bufferSize}options.scope=this;options.callback=function(){this.reset(false)};return true},onLoad:function(o1,o2,options){this.adjustBufferInset()},onDataChange:function(store){this.updateHeaderSortState()},liveBufferUpdate:function(o1,options,o2){this.fireEvent("buffer",this,this.ds,this.rowIndex,Math.max(this.visibleRows,this.getRows().length),this.ds.getTotalCount());this.isBuffering=false;this.isPrebuffering=false;this.showLoadMask(false);this.bufferRange=[options.params.start,options.params.start+options.params.limit];var pendingSelections=this.grid.selModel.getPendingSelections(false);for(var i=0,max_i=pendingSelections.length;i<max_i;i++){this.grid.selModel.clearPendingSelection(pendingSelections[i])}if(this.isInRange(this.rowIndex)){this.replaceLiveRows(this.rowIndex)}else{this.updateLiveRows(this.rowIndex)}if(this.requestQueue>=0){var offset=this.requestQueue;this.requestQueue=-1;this.updateLiveRows(offset)}},handleWheel:function(e){if(this.rowHeight==-1){e.stopEvent();return }var d=e.getWheelDelta();this.adjustScrollerPos(-(d*this.rowHeight));e.stopEvent()},onLiveScroll:function(){var scrollTop=this.liveScroller.dom.scrollTop;var pixelsSkipped=scrollTop-this.lastScrollPos;var rowsSkipped=Math.floor(pixelsSkipped/this.rowHeight);if(pixelsSkipped==0){return }var cursor=Math.floor((scrollTop)/this.rowHeight);this.rowIndex=cursor;if(cursor==this.lastRowIndex){return }this.updateLiveRows(cursor,rowsSkipped);this.lastScrollPos=this.liveScroller.dom.scrollTop},refreshRow:function(record){var ds=this.ds,index;if(typeof record=="number"){index=record;record=ds.getAt(index)}else{index=ds.indexOf(record)}var viewIndex=index+this.bufferRange[0];if(viewIndex<this.rowIndex||viewIndex>=this.rowIndex+this.visibleRows){this.fireEvent("rowupdated",this,viewIndex,record);return }this.insertRows(ds,index,index,true);this.fireEvent("rowupdated",this,viewIndex,record)},processRows:function(startRow,skipStripe,paintSelections){skipStripe=skipStripe||!this.grid.stripeRows;startRow=0;var rows=this.getRows();var cls=" x-grid3-row-alt ";var cursor=this.rowIndex;var index=0;var selections=this.grid.selModel.selections;var ds=this.ds;for(var i=startRow,len=rows.length;i<len;i++){index=i+cursor;var row=rows[i];row.rowIndex=index;if(paintSelections==true){if(this.grid.selModel.bufferedSelections[index]===true){this.addRowClass(i,"x-grid3-row-selected");selections.add(ds.getAt(index-this.bufferRange[0]))}this.fly(row).removeClass("x-grid3-row-over")}if(!skipStripe){var isAlt=((i+1)%2==0);var hasAlt=(" "+row.className+" ").indexOf(cls)!=-1;if(isAlt==hasAlt){continue}if(isAlt){row.className+=" x-grid3-row-alt"}else{row.className=row.className.replace("x-grid3-row-alt","")}}}},insertRows:function(dm,firstRow,lastRow,isUpdate){var viewIndexFirst=firstRow+this.bufferRange[0];var viewIndexLast=lastRow+this.bufferRange[0];if(!isUpdate){this.fireEvent("beforerowsinserted",this,viewIndexFirst,viewIndexLast)}if(isUpdate!==true&&this.getRows().length==this.visibleRows){this.removeRows((this.visibleRows-1)-(lastRow-firstRow),this.visibleRows-1)}if(isUpdate){this.removeRows(viewIndexFirst-this.rowIndex,viewIndexLast-this.rowIndex)}var html=this.renderRows(firstRow,lastRow);var before=this.getRow(firstRow-(this.rowIndex-this.bufferRange[0]));if(before){Ext.DomHelper.insertHtml("beforeBegin",before,html)}else{Ext.DomHelper.insertHtml("beforeEnd",this.mainBody.dom,html)}if(isUpdate===true){var rows=this.getRows();var cursor=this.rowIndex;for(var i=0,max_i=rows.length;i<max_i;i++){rows[i].rowIndex=cursor+i}}if(!isUpdate){this.fireEvent("rowsinserted",this,viewIndexFirst,viewIndexLast);this.processRows(firstRow)}},focusCell:function(row,col,hscroll){var xy=this.ensureVisible(row,col,hscroll);if(!xy){return }this.focusEl.setXY(xy);if(Ext.isGecko){this.focusEl.focus()}else{this.focusEl.focus.defer(1,this.focusEl)}},ensureVisible:function(row,col,hscroll){if(typeof row!="number"){row=row.rowIndex}if(row<0||row>=this.ds.totalLength){return }col=(col!==undefined?col:0);var rowInd=row-this.rowIndex;if(row>=this.rowIndex+this.visibleRows){this.adjustScrollerPos(((row-(this.rowIndex+this.visibleRows))+1)*this.rowHeight)}else{if(row<this.rowIndex){this.adjustScrollerPos((rowInd)*this.rowHeight)}}var rowInd=rowInd<0?row:rowInd;var rowEl=this.getRow(rowInd),cellEl;if(!(hscroll===false&&col===0)){while(this.cm.isHidden(col)){col++}cellEl=this.getCell(row-this.rowIndex,col)}if(!rowEl){return }var c=this.scroller.dom;return cellEl?Ext.fly(cellEl).getXY():[c.scrollLeft,Ext.fly(rowEl).getY()]},isInRange:function(rowIndex){var lastRowIndex=Math.min(this.ds.totalLength-1,rowIndex+this.visibleRows);return(rowIndex>=this.bufferRange[0])&&(lastRowIndex<=this.bufferRange[1])},getPredictedBufferIndex:function(index,inRange,down){if(!inRange){return Math.max(0,index-(2*this.nearLimit))}if(!down){return Math.max(0,(index-this.ds.bufferSize)+this.visibleRows)}if(down){return Math.max(0,Math.min(index,this.ds.totalLength-this.ds.bufferSize))}},updateLiveRows:function(index,forceRepaint,forceReload){this.fireEvent("cursormove",this,index,Math.min(this.ds.totalLength,this.visibleRows),this.ds.totalLength);var inRange=this.isInRange(index);if(this.isBuffering&&this.isPrebuffering){if(inRange){this.replaceLiveRows(index)}else{this.showLoadMask(true)}}if(this.isBuffering){this.requestQueue=index;return }var lastIndex=this.lastIndex;this.lastIndex=index;var inRange=this.isInRange(index);var down=false;if(inRange&&forceReload!==true){this.replaceLiveRows(index,forceRepaint);if(index>lastIndex){down=true;var totalCount=this.ds.totalLength;if(index+this.visibleRows+this.nearLimit<this.bufferRange[1]){return }if(this.bufferRange[1]>=totalCount){return }}else{if(index<lastIndex){down=false;if(this.bufferRange[0]<=0){return }if(index-this.nearLimit>this.bufferRange[0]){return }}else{return }}this.isPrebuffering=true}this.isBuffering=true;var bufferOffset=this.getPredictedBufferIndex(index,inRange,down);var fetchSize=this.ds.bufferSize;if(!inRange){this.showLoadMask(true)}this.fireEvent("beforebuffer",this,this.ds,index,this.visibleRows,this.ds.totalLength);this.ds.suspendEvents();var sInfo=this.ds.sortInfo;var params={};Ext.apply(params,this.ds.lastOptions);params.start=bufferOffset;params.limit=this.ds.bufferSize;if(sInfo){params.dir=sInfo.direction;params.sort=sInfo.field}this.ds.load({callback:this.liveBufferUpdate,scope:this,params:params});this.ds.resumeEvents()},showLoadMask:function(show){if(this.loadMask==null){if(show){this.loadMask=new Ext.LoadMask(this.mainBody.dom.parentNode.parentNode,this.loadMaskConfig)}else{return }}if(show){this.loadMask.show()}else{this.loadMask.hide()}},replaceLiveRows:function(cursor,forceReplace){var spill=cursor-this.lastRowIndex;if(spill==0&&forceReplace!==true){return }var append=spill>0;spill=Math.abs(spill);var cursorBuffer=cursor-this.bufferRange[0];if(spill>=this.visibleRows||spill==0){this.mainBody.update(this.renderRows(cursorBuffer,cursorBuffer+this.visibleRows-1))}else{if(append){this.removeRows(0,spill-1);var html=this.renderRows(cursorBuffer+this.visibleRows-spill,cursorBuffer+this.visibleRows-1);Ext.DomHelper.insertHtml("beforeEnd",this.mainBody.dom,html)}else{this.removeRows(this.visibleRows-spill,this.visibleRows-1);var html=this.renderRows(cursorBuffer,cursorBuffer+spill-1);Ext.DomHelper.insertHtml("beforeBegin",this.mainBody.dom.firstChild,html)}}this.processRows(0,undefined,true);this.lastRowIndex=cursor},adjustBufferInset:function(){var g=this.grid,ds=g.store;var c=g.getGridEl();var scrollbar=this.cm.getTotalWidth()+this.scrollOffset>c.getSize().width;this.liveScroller.dom.style.height=this.liveScroller.dom.parentNode.offsetHeight+(Ext.isGecko?((ds.totalLength>0&&scrollbar)?-this.horizontalScrollOffset:0):(((ds.totalLength>0&&scrollbar)?0:this.horizontalScrollOffset)))+"px";if(this.rowHeight==-1){return }if(ds.totalLength<=this.visibleRows){this.liveScrollerInset.style.height="0px";return }var height=this.rowHeight*ds.totalLength;height+=(c.getSize().height-(this.visibleRows*this.rowHeight));if(scrollbar){height-=this.horizontalScrollOffset}this.liveScrollerInset.style.height=(height)+"px"},adjustVisibleRows:function(){if(this.rowHeight==-1){if(this.getRows()[0]){this.rowHeight=this.getRows()[0].offsetHeight}else{return }}var g=this.grid,ds=g.store;var c=g.getGridEl();var cm=this.cm;var size=c.getSize(true);var vh=size.height;var vw=size.width-this.scrollOffset;if(cm.getTotalWidth()>vw){vh-=this.horizontalScrollOffset}vh-=this.mainHd.getHeight();var visibleRows=Math.max(1,Math.floor(vh/this.rowHeight));if(this.visibleRows==visibleRows){return }this.visibleRows=visibleRows;var totalLength=ds.totalLength;if(this.rowIndex+visibleRows>totalLength){this.rowIndex=Math.max(0,ds.totalLength-this.visibleRows);this.lastRowIndex=this.rowIndex;this.updateLiveRows(this.rowIndex,true)}else{this.updateLiveRows(this.rowIndex,true)}},adjustScrollerPos:function(pixels,suspendEvent){var liveScroller=this.liveScroller;if(suspendEvent===true){liveScroller.un("scroll",this.onLiveScroll,this)}liveScroller.dom.scrollTop+=pixels;if(suspendEvent===true){liveScroller.dom.scrollTop=liveScroller.dom.scrollTop;liveScroller.on("scroll",this.onLiveScroll,this)}}});Ext.namespace("Ext.ux.data");Ext.ux.data.BufferedJsonReader=function(meta,recordType){Ext.ux.data.BufferedJsonReader.superclass.constructor.call(this,meta,recordType)};Ext.extend(Ext.ux.data.BufferedJsonReader,Ext.data.JsonReader,{readRecords:function(o){var s=this.meta;if(!this.ef&&s.versionProperty){this.getVersion=this.getJsonAccessor(s.versionProperty)}if(!this.__readRecords){this.__readRecords=Ext.ux.data.BufferedJsonReader.superclass.readRecords}var intercept=this.__readRecords.call(this,o);if(s.versionProperty){var v=this.getVersion(o);intercept.version=(v===undefined||v==="")?null:v}return intercept}});Ext.namespace("Ext.ux.grid");Ext.ux.grid.BufferedRowSelectionModel=function(config){this.addEvents({selectiondirty:true});Ext.apply(this,config);this.bufferedSelections={};this.pendingSelections={};Ext.ux.grid.BufferedRowSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.ux.grid.BufferedRowSelectionModel,Ext.grid.RowSelectionModel,{initEvents:function(){Ext.ux.grid.BufferedRowSelectionModel.superclass.initEvents.call(this);this.grid.store.on("add",this.onAdd,this);this.grid.store.on("selectionsload",this.onSelectionsLoad,this)},onRefresh:function(){this.clearSelections(true)},onRemove:function(v,index,r){if((index==Number.MIN_VALUE||index==Number.MAX_VALUE)){this.selections.remove(r);this.fireEvent("selectiondirty",this,index,r);return }var viewIndex=index;var fire=this.bufferedSelections[viewIndex]===true;var ranges=this.getPendingSelections();var rangesLength=ranges.length;delete this.bufferedSelections[viewIndex];delete this.pendingSelections[viewIndex];if(r){this.selections.remove(r)}if(rangesLength==0){this.shiftSelections(viewIndex,-1);return }var s=ranges[0];var e=ranges[rangesLength-1];if(viewIndex<=e||viewIndex<=s){if(this.fireEvent("selectiondirty",this,viewIndex,-1)!==false){this.shiftSelections(viewIndex,-1)}}if(fire){this.fireEvent("selectionchange",this)}},onAdd:function(store,records,index){var ranges=this.getPendingSelections();var rangesLength=ranges.length;if((index==Number.MIN_VALUE||index==Number.MAX_VALUE)){if(rangesLength==0&&index==Number.MIN_VALUE){this.shiftSelections(this.grid.view.bufferRange[0],records.length)}this.fireEvent("selectiondirty",this,index,records.length);return }if(rangesLength==0){this.shiftSelections(this.grid.view.bufferRange[0]+index,records.length);return }var s=ranges[0];var e=ranges[rangesLength-1];var viewIndex=this.grid.view.bufferRange[0]+index;if(viewIndex<=e||viewIndex<=s){if(this.fireEvent("selectiondirty",this,viewIndex,records.length)!==false){this.shiftSelections(viewIndex,records.length)}}},shiftSelections:function(startRow,length){var index=0;var newSelections={};var newIndex=0;var newRequests={};var totalLength=this.grid.store.totalLength;for(var i in this.bufferedSelections){index=parseInt(i);newIndex=index+length;if(newIndex>=totalLength){break}if(index>=startRow){newSelections[newIndex]=true;if(this.pendingSelections[i]){newRequests[newIndex]=true}}else{newSelections[i]=true;if(this.pendingSelections[i]){newRequests[i]=true}}}this.bufferedSelections=newSelections;this.pendingSelections=newRequests},onSelectionsLoad:function(store,records,ranges){this.pendingSelections={};this.selections.addAll(records)},hasNext:function(){return this.last!==false&&(this.last+1)<this.grid.store.getTotalCount()},getCount:function(){var sels=this.bufferedSelections;var c=0;for(var i in sels){c++}return c},isSelected:function(index){if(typeof index=="number"){return this.bufferedSelections[index]===true}var r=index;return(r&&this.selections.key(r.id)?true:false)},deselectRow:function(index,preventViewNotify){if(this.locked){return }if(this.last==index){this.last=false}if(this.lastActive==index){this.lastActive=false}var r=this.grid.store.getAt(index-this.grid.getView().bufferRange[0]);delete this.pendingSelections[index];delete this.bufferedSelections[index];if(r){this.selections.remove(r)}if(!preventViewNotify){this.grid.getView().onRowDeselect(index)}this.fireEvent("rowdeselect",this,index,r);this.fireEvent("selectionchange",this)},selectRow:function(index,keepExisting,preventViewNotify){if(this.locked||index<0){return }var r=this.grid.store.getAt(index-this.grid.getView().bufferRange[0]);if(this.fireEvent("beforerowselect",this,index,keepExisting,r)!==false){if(!keepExisting||this.singleSelect){this.clearSelections()}if(r){this.selections.add(r);delete this.pendingSelections[index]}else{this.pendingSelections[index]=true}this.bufferedSelections[index]=true;this.last=this.lastActive=index;if(!preventViewNotify){this.grid.getView().onRowSelect(index)}this.fireEvent("rowselect",this,index,r);this.fireEvent("selectionchange",this)}},clearPendingSelection:function(index){var r=this.grid.store.getAt(index-this.grid.getView().bufferRange[0]);if(!r){return }this.selections.add(r);delete this.pendingSelections[index]},getPendingSelections:function(asRange){var index=1;var ranges=[];var currentRange=0;var tmpArray=[];for(var i in this.pendingSelections){tmpArray.push(parseInt(i))}tmpArray.sort(function(o1,o2){if(o1>o2){return 1}else{if(o1<o2){return -1}else{return 0}}});if(asRange===false){return tmpArray}var max_i=tmpArray.length;if(max_i==0){return[]}ranges[currentRange]=[tmpArray[0],tmpArray[0]];for(var i=0,max_i=max_i-1;i<max_i;i++){if(tmpArray[i+1]-tmpArray[i]==1){ranges[currentRange][1]=tmpArray[i+1]}else{currentRange++;ranges[currentRange]=[tmpArray[i+1],tmpArray[i+1]]}}return ranges},clearSelections:function(fast){if(this.locked){return }if(fast!==true){var s=this.selections;s.clear();for(var i in this.bufferedSelections){this.deselectRow(i)}}else{this.selections.clear();this.bufferedSelections={};this.pendingSelections={}}this.last=false},selectRange:function(startRow,endRow,keepExisting){if(this.locked){return }if(!keepExisting){this.clearSelections()}if(startRow<=endRow){for(var i=startRow;i<=endRow;i++){this.selectRow(i,true)}}else{for(var i=startRow;i>=endRow;i--){this.selectRow(i,true)}}}});Ext.namespace("Ext.ux.grid");Ext.ux.grid.BufferedStore=function(config){config=config||{};config.remoteSort=true;Ext.apply(this,config);this.addEvents({versionchange:true,beforeselectionsload:true,selectionsload:true});Ext.ux.grid.BufferedStore.superclass.constructor.call(this,config);if(this.url&&!this.selectionsProxy){this.selectionsProxy=new Ext.data.HttpProxy({url:this.url})}};Ext.extend(Ext.ux.grid.BufferedStore,Ext.data.Store,{version:null,insert:function(index,records){records=[].concat(records);var cRecords=[];var cCount=this.bufferSize-1;var pIndex=(index==Number.MIN_VALUE||index==Number.MAX_VALUE)?0:index;this.totalLength+=records.length;if(index==Number.MIN_VALUE||index==Number.MAX_VALUE||index==this.bufferSize||(index==0&&this.getCount()==this.bufferSize)){var tIndex=(index==this.bufferSize)?Number.MAX_VALUE:((index==Number.MIN_VALUE||index==0)?Number.MIN_VALUE:Number.MAX_VALUE);this.fireEvent("add",this,records,tIndex);return }for(var i=0,max_i=records.length;i<max_i;i++){if(i+pIndex>cCount){break}cRecords.push(records[i])}for(var i=0,len=cRecords.length;i<len;i++){this.data.insert(index+i,cRecords[i]);cRecords[i].join(this)}while(this.getCount()>this.bufferSize){this.data.remove(this.data.last())}this.fireEvent("add",this,cRecords,index)},remove:function(record){var index=this.data.indexOf(record);if(index<0){var ind=this.findInsertIndex(record);this.totalLength-=1;if(this.pruneModifiedRecords){this.modified.remove(record)}this.fireEvent("remove",this,record,ind);return false}this.data.removeAt(index);if(this.pruneModifiedRecords){this.modified.remove(record)}this.totalLength-=1;this.fireEvent("remove",this,record,index);return true},removeAll:function(){this.totalLength=0;this.data.clear();if(this.pruneModifiedRecords){this.modified=[]}this.fireEvent("clear",this)},loadRanges:function(ranges){var max_i=ranges.length;if(max_i>0&&!this.selectionsProxy.activeRequest&&this.fireEvent("beforeselectionsload",this,ranges)!==false){var lParams=this.lastOptions.params;var params={};params.ranges=Ext.encode(ranges);if(lParams){if(lParams.sort){params.sort=lParams.sort}if(lParams.dir){params.dir=lParams.dir}}var options={};for(var i in this.lastOptions){options.i=this.lastOptions.i}options.ranges=params.ranges;this.selectionsProxy.load(params,this.reader,this.selectionsLoaded,this,options)}},loadSelections:function(ranges){this.loadRanges(ranges)},selectionsLoaded:function(o,options,success){if(this.checkVersionChange(o,options,success)!==false){this.fireEvent("selectionsload",this,o.records,Ext.decode(options.ranges))}else{this.fireEvent("selectionsload",this,[],Ext.decode(options.ranges))}},checkVersionChange:function(o,options,success){if(o&&success!==false){if(o.version!==undefined){var old=this.version;this.version=o.version;if(this.version!==old){return this.fireEvent("versionchange",this,old,this.version)}}}},findInsertIndex:function(record){this.suspendEvents();var data=this.data.clone();if(data.getCount()>=this.bufferSize){var first=this.data.first();var last=this.data.last();this.data.clear();this.data.add(record);this.data.add(first);this.data.add(last);this.applySort(true);var index=this.data.indexOf(record);if(index==0||index==2){this.data=data;this.resumeEvents();return index==0?Number.MIN_VALUE:Number.MAX_VALUE}}this.data=data.clone();this.data.add(record);this.applySort(true);var index=this.data.indexOf(record);this.data=data;this.resumeEvents();return index},sortData:function(f,direction){direction=direction||"ASC";var st=this.fields.get(f).sortType;var fn=function(r1,r2){var v1=st(r1.data[f]),v2=st(r2.data[f]);return v1>v2?1:(v1<v2?-1:0)};this.data.sort(direction,fn)},applySort:function(bufferedSort){if(bufferedSort===true&&this.sortInfo){var s=this.sortInfo,f=s.field;this.sortData(f,s.direction)}},onMetaChange:function(meta,rtype,o){this.version=null;Ext.ux.grid.BufferedStore.superclass.onMetaChange.call(this,meta,rtype,o)},loadRecords:function(o,options,success){this.checkVersionChange(o,options,success);Ext.ux.grid.BufferedStore.superclass.loadRecords.call(this,o,options,success)},clearFilter:function(){},isFiltered:function(){},collect:function(){},createFilterFn:function(){},sum:function(){},filter:function(){},filterBy:function(){},query:function(){},queryBy:function(){},find:function(){},findBy:function(){}});Ext.ux.ManagedIFrame=function(){var args=Array.prototype.slice.call(arguments,0),el=Ext.get(args[0]),config=args[0];if(el&&el.dom&&el.dom.tagName=="IFRAME"){config=args[1]||{}}else{config=args[0]||args[1]||{};el=config.autoCreate?Ext.get(Ext.DomHelper.append(document.body,Ext.apply({tag:"iframe",src:(Ext.isIE&&Ext.isSecure)?Ext.SSL_SECURE_URL:""},config.autoCreate))):null}if(!el||el.dom.tagName!="IFRAME"){return el}!!el.dom.name.length||(el.dom.name=el.dom.id);this.addEvents({domready:true,documentloaded:true});if(config.listeners){this.listeners=config.listeners;Ext.ux.ManagedIFrame.superclass.constructor.call(this)}Ext.apply(el,this);el.addClass("x-managed-iframe");el.loadMask=Ext.apply({msg:"Loading..",msgCls:"x-mask-loading",maskEl:null,enabled:!!config.loadMask},config.loadMask);var h=Ext.isIE?"onreadystatechange":"onload";el.dom[h]=el.dom[h]?el.dom[h].createSequence(el.loadHandler,el):el.loadHandler.createDelegate(el);if(config.src){el.setSrc(config.src)}else{el.src=el.dom.src||null;var content=config.html||config.content||false;if(content){el.update(content)}}return el};Ext.extend(Ext.ux.ManagedIFrame,Ext.util.Observable,{setSrc:function(url,discardUrl){var src=url||this.src||(Ext.isIE&&Ext.isSecure?Ext.SSL_SECURE_URL:"");this.showMask();this._windowContext=null;(function(){var s=typeof src=="function"?src()||"":src;if(Ext.isOpera){this.dom.src=""}this.dom.src=s}).defer(100,this);if(discardUrl!==true){this.src=src}},scriptRE:/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/gi,update:function(content,loadScripts,callback){loadScripts=loadScripts||this.getUpdateManager().loadScripts||false;this._windowContext=false;content=Ext.DomHelper.markup(content||"");var doc=this.getDocument();if(doc){this._inUpdate=true;this.showMask();doc.open();doc.write(loadScripts===true?content:content.replace(this.scriptRE,""));doc.write('<script type="text/javascript">(function(){var MSIE/*@cc_on =1(a)*/;parent.Ext.get(\''+this.dom.id+"')._windowContext=MSIE?this:{eval:function(s){return eval(s);}}})();<\/script>");doc.close();if(!!content.length){this.checkDOM(false,callback)}else{if(callback){callback()}}}return this},_windowContext:null,getDocument:function(){return this.getWindow().document},getWindow:function(){var dom=this.dom;return dom?dom.contentWindow||window.frames[dom.name]:window},print:function(){try{var win=this.getWindow();if(Ext.isIE){win.focus()}win.print()}catch(ex){throw"print exception: "+(ex.description||ex)}},destroy:function(){this.removeAllListeners();if(this.dom){this.dom.onreadystatechange=null;this.dom.onload=null;if(this.dom.src){this.dom.src="javascript:false"}Ext.removeNode(this.dom)}this._windowContext=null;Ext.apply(this.loadMask,{masker:null,maskEl:null})},execScript:function(block){if(this._windowContext){return this._windowContext.eval(block)}else{throw"execScript:no script context"}},loadMask:{msg:"Loading..",msgCls:"x-mask-loading",maskEl:null,enabled:false},showMask:function(msg,msgCls,forced){if(this.loadMask&&(this.loadMask.enabled||forced)){var lmask=this.loadMask;lmask.masker||(lmask.masker=Ext.get(lmask.maskEl||this.dom.parentNode||this.wrap({tag:"div",style:{position:"relative"}})));lmask.masker.mask.defer(lmask.defer||150,lmask.masker,[msg||lmask.msg,msgCls||lmask.msgCls])}},hideMask:function(forced){var tlm=this.loadMask;if(tlm&&tlm.masker&&(tlm.enabled||forced)&&(forced||!!this.dom.src.length||this._inUpdate)){tlm.masker.unmask.defer(tlm.defer||150,tlm.masker)}},loadHandler:function(e){var rstatus=this.dom.readyState||e.type;switch(rstatus){case"loading":this.showMask();break;case"load":case"complete":this.fireEvent("documentloaded",this);this.hideMask();this._inUpdate=false;break;default:}},checkDOM:function(win,callback){var n=0,win=win||this.getWindow(),manager=this;var t=function(){var domReady=false;domReady=(win.document&&typeof win.document.getElementsByTagName!="undefined"&&(win.document.getElementsByTagName("body")[0]!=null||win.document.body!=null));if(n++<70&&!domReady){t.defer(50);return }if(callback){callback()}manager.fireEvent("domready",manager)};t()}});Ext.ux.ManagedIframePanel=Ext.extend(Ext.Panel,{defaultSrc:null,bodyStyle:{width:"100%",height:"100%"},iframeStyle:{overflow:"auto"},loadMask:false,animCollapse:false,autoScroll:false,closable:true,ctype:"Ext.ux.ManagedIframePanel",unsupportedText:{tag:"span",cls:"x-error-noframes",html:"Inline frames are NOT enabled/supported by your browser."},initComponent:function(){var unsup=false;if(this.unsupportedText){unsup=typeof this.unsupportedText=="object"?{children:[this.unsupportedText]}:{html:this.unsupportedText}}this.bodyCfg||(this.bodyCfg={tag:"div",cls:"x-panel-body",children:[Ext.apply({tag:"iframe",frameBorder:0,cls:"x-managed-iframe",style:{width:"100%",height:"100%"}},unsup)]});Ext.ux.ManagedIframePanel.superclass.initComponent.call(this);this.addEvents({documentloaded:true,domready:true});if(this.defaultSrc){this.on("render",this.setSrc.createDelegate(this,[this.defaultSrc],0),this,{single:true})}},beforeDestroy:function(){if(this.rendered){if(this.tools){for(var k in this.tools){Ext.destroy(this.tools[k])}}if(this.header&&this.headerAsText){var s;if(s=this.header.child("span")){s.remove()}this.header.update("")}Ext.each(["iframe","header","topToolbar","bottomToolbar","footer","loadMask","body","bwrap"],function(elName){if(this[elName]){if(typeof this[elName].destroy=="function"){this[elName].destroy()}else{Ext.destroy(this[elName])}this[elName]=null;delete this[elName]}},this)}Ext.ux.ManagedIframePanel.superclass.beforeDestroy.call(this)},onDestroy:function(){Ext.Panel.superclass.onDestroy.call(this)},onRender:function(ct,position){Ext.ux.ManagedIframePanel.superclass.onRender.call(this,ct,position);if(this.iframe=this.body.child("iframe.x-managed-iframe")){Ext.each([this[this.collapseEl],this.el],function(el){el.setVisibilityMode(Ext.Element[this.hideMode.toUpperCase()]||1).originalDisplay=(this.hideMode!="display"?"visible":"block")},this);if(this.loadMask){this.loadMask=Ext.apply({enabled:true,maskEl:this.body},this.loadMask)}this.iframe=new Ext.ux.ManagedIFrame(this.iframe,{loadMask:this.loadMask});this.loadMask=this.iframe.loadMask;this.iframe.ownerCt=this;this.relayEvents(this.iframe,["documentloaded","domready"]);if(this.iframeStyle){this.iframe.applyStyles(this.iframeStyle)}this.getUpdater().showLoadIndicator=!this.loadMask.enabled}},afterRender:function(container){var html=this.html;delete this.html;Ext.ux.ManagedIframePanel.superclass.afterRender.call(this);if(html&&this.iframe){this.iframe.update(typeof html=="object"?Ext.DomHelper.markup(html):html)}},setSrc:function(url,discardUrl){var src=url||this.defaultSrc||(Ext.isIE&&Ext.isSecure?Ext.SSL_SECURE_URL:"");if(this.rendered&&this.iframe){this.iframe.setSrc(src,discardUrl)}if(discardUrl!==true){this.defaultSrc=src}this.saveState();return this},getState:function(){return Ext.apply(Ext.ux.ManagedIframePanel.superclass.getState.call(this)||{},{defaultSrc:(typeof this.defaultSrc=="function")?this.defaultSrc():this.defaultSrc})},getUpdater:function(){return this.rendered?(this.iframe||this.body).getUpdater():false},load:function(loadCfg){var um;if(um=this.getUpdater()){if(loadCfg&&loadCfg.renderer){um.setRenderer(loadCfg.renderer);delete loadCfg.renderer}um.update.apply(um,arguments)}return this},doAutoLoad:function(){this.load(typeof this.autoLoad=="object"?this.autoLoad:{url:this.autoLoad})},onShow:function(){this.body.setVisible(true);Ext.ux.ManagedIframePanel.superclass.onShow.call(this)},onHide:function(){this.body.setVisible(false);Ext.ux.ManagedIframePanel.superclass.onHide.call(this)}});Ext.reg("iframepanel",Ext.ux.ManagedIframePanel);Ext.ux.ManagedIframePortlet=Ext.extend(Ext.ux.ManagedIframePanel,{anchor:"100%",frame:true,collapseEl:"bwrap",collapsible:true,draggable:true,cls:"x-portlet"});Ext.reg("iframeportlet",Ext.ux.ManagedIframePortlet);Ext.ux.Multiselect=Ext.extend(Ext.form.Field,{store:null,dataFields:[],data:[],width:100,height:100,displayField:0,valueField:1,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,blankText:Ext.form.TextField.prototype.blankText,minLengthText:"Minimum {0} item(s) required",maxLengthText:"Maximum {0} item(s) allowed",copy:false,allowDup:false,allowTrash:false,legend:null,focusClass:undefined,delimiter:",",view:null,dragGroup:null,dropGroup:null,tbar:null,appendOnly:false,sortField:null,sortDir:"ASC",textDelimiter:"|",defaultAutoCreate:{tag:"div"},initComponent:function(){Ext.ux.Multiselect.superclass.initComponent.call(this);this.addEvents({dblclick:true,click:true,change:true,drop:true})},onRender:function(ct,position){var fs,cls,tpl;Ext.ux.Multiselect.superclass.onRender.call(this,ct,position);cls="ux-mselect";fs=new Ext.form.FieldSet({renderTo:this.el,title:this.legend,height:this.height,width:this.width,style:"padding:1px;",tbar:this.tbar});if(!this.legend){var e=fs.el.down("."+fs.headerCls);if(e){e.remove()}}fs.body.addClass(cls);tpl='<tpl for="."><div class="'+cls+"-item";if(Ext.isIE||Ext.isIE7){tpl+='" unselectable=on'}else{tpl+=' x-unselectable"'}tpl+=">{"+this.displayField+"}</div></tpl>";if(!this.store){this.store=new Ext.data.SimpleStore({fields:this.dataFields,data:this.data})}this.view=new Ext.ux.DDView({multiSelect:true,store:this.store,selectedClass:cls+"-selected",tpl:tpl,allowDup:this.allowDup,copy:this.copy,allowTrash:this.allowTrash,dragGroup:this.dragGroup,dropGroup:this.dropGroup,itemSelector:"."+cls+"-item",isFormField:false,applyTo:fs.body,appendOnly:this.appendOnly,sortField:this.sortField,sortDir:this.sortDir});fs.add(this.view);this.view.on("click",this.onViewClick,this);this.view.on("beforeClick",this.onViewBeforeClick,this);this.view.on("dblclick",this.onViewDblClick,this);this.view.on("drop",function(ddView,n,dd,e,data){return this.fireEvent("drop",ddView,n,dd,e,data)},this);this.hiddenName=this.name;var hiddenTag={tag:"input",type:"hidden",value:"",name:this.name};if(this.isFormField){this.hiddenField=this.el.createChild(hiddenTag)}else{this.hiddenField=Ext.get(document.body).createChild(hiddenTag)}fs.doLayout()},initValue:Ext.emptyFn,onViewClick:function(vw,index,node,e){var arrayIndex=this.preClickSelections.indexOf(index);if(arrayIndex!=-1){this.preClickSelections.splice(arrayIndex,1);this.view.clearSelections(true);this.view.select(this.preClickSelections)}this.fireEvent("change",this,this.getValue(),this.hiddenField.dom.value);this.hiddenField.dom.value=this.getValue();this.fireEvent("click",this,e);this.validate()},onViewBeforeClick:function(vw,index,node,e){this.preClickSelections=this.view.getSelectedIndexes();if(this.disabled){return false}},onViewDblClick:function(vw,index,node,e){return this.fireEvent("dblclick",vw,index,node,e)},getValue:function(valueField){if(this.view){var returnArray=[];var selectionsArray=this.view.getSelectedIndexes();if(selectionsArray.length==0){return""}for(var i=0;i<selectionsArray.length;i++){returnArray.push(this.store.getAt(selectionsArray[i]).get(((valueField!=null)?valueField:this.valueField)))}return returnArray.join(this.delimiter)}else{return""}},setValue:function(values){var index;var selections=[];this.view.clearSelections();this.hiddenField.dom.value="";if(!values||(values=="")){return }if(!(values instanceof Array)){values=values.split(this.delimiter)}for(var i=0;i<values.length;i++){index=this.view.store.indexOf(this.view.store.query(this.valueField,new RegExp("^"+values[i]+"$","i")).itemAt(0));selections.push(index)}this.view.select(selections);this.hiddenField.dom.value=this.getValue();this.validate()},reset:function(){this.setValue("")},getRawValue:function(valueField){var tmp=this.getValue(valueField);if(tmp.length){tmp=tmp.split(this.delimiter)}else{tmp=[]}return tmp},setRawValue:function(values){setValue(values)},selectAll:function(){var selections=[];for(var i=0;i<this.view.store.getTotalCount();i++){selections.push(i)}this.view.select(selections);this.hiddenField.dom.value=this.getValue();this.validate()},getSelectedTexts:function(){var selectedItems=this.view.getSelectedNodes();var selectedTexts=[];for(var i=0;i<selectedItems.length;i++){selectedTexts.push(selectedItems[i].innerHTML)}return selectedTexts.join(this.textDelimiter)},validateValue:function(value){if(value.length<1){if(this.allowBlank){this.clearInvalid();return true}else{this.markInvalid(this.blankText);return false}}if(value.length<this.minLength){this.markInvalid(String.format(this.minLengthText,this.minLength));return false}if(value.length>this.maxLength){this.markInvalid(String.format(this.maxLengthText,this.maxLength));return false}return true},onDestroy:function(){if(this.view){this.view.destroy()}Ext.ux.Multiselect.superclass.onDestroy.call(this)}});Ext.reg("multiselect",Ext.ux.Multiselect);Ext.ux.ItemSelector=Ext.extend(Ext.form.Field,{msWidth:200,msHeight:300,hideNavIcons:false,imagePath:"",iconUp:"up2.gif",iconDown:"down2.gif",iconLeft:"left2.gif",iconRight:"right2.gif",iconTop:"top2.gif",iconBottom:"bottom2.gif",drawUpIcon:true,drawDownIcon:true,drawLeftIcon:true,drawRightIcon:true,drawTopIcon:true,drawBotIcon:true,fromStore:null,toStore:null,fromData:null,toData:null,displayField:0,valueField:1,switchToFrom:false,allowDup:false,focusClass:undefined,delimiter:",",readOnly:false,toLegend:null,fromLegend:null,toSortField:null,fromSortField:null,toSortDir:"ASC",fromSortDir:"ASC",toTBar:null,fromTBar:null,bodyStyle:null,border:false,defaultAutoCreate:{tag:"div"},initComponent:function(){Ext.ux.ItemSelector.superclass.initComponent.call(this);this.addEvents({rowdblclick:true,change:true})},onRender:function(ct,position){Ext.ux.ItemSelector.superclass.onRender.call(this,ct,position);this.fromMultiselect=new Ext.ux.Multiselect({legend:this.fromLegend,delimiter:this.delimiter,allowDup:this.allowDup,copy:this.allowDup,allowTrash:this.allowDup,dragGroup:this.readOnly?null:"drop2-"+this.el.dom.id,dropGroup:this.readOnly?null:"drop2-"+this.el.dom.id+",drop1-"+this.el.dom.id,width:this.msWidth,height:this.msHeight,dataFields:this.dataFields,data:this.fromData,displayField:this.displayField,valueField:this.valueField,store:this.fromStore,isFormField:false,tbar:this.fromTBar,appendOnly:true,sortField:this.fromSortField,sortDir:this.fromSortDir});this.fromMultiselect.on("dblclick",this.onRowDblClick,this);if(!this.toStore){this.toStore=new Ext.data.SimpleStore({fields:this.dataFields,data:this.toData})}this.toStore.on("add",this.valueChanged,this);this.toStore.on("remove",this.valueChanged,this);this.toStore.on("load",this.valueChanged,this);this.toMultiselect=new Ext.ux.Multiselect({legend:this.toLegend,delimiter:this.delimiter,allowDup:this.allowDup,dragGroup:this.readOnly?null:"drop1-"+this.el.dom.id,dropGroup:this.readOnly?null:"drop2-"+this.el.dom.id+",drop1-"+this.el.dom.id,width:this.msWidth,height:this.msHeight,displayField:this.displayField,valueField:this.valueField,store:this.toStore,isFormField:false,tbar:this.toTBar,sortField:this.toSortField,sortDir:this.toSortDir});this.toMultiselect.on("dblclick",this.onRowDblClick,this);var p=new Ext.Panel({bodyStyle:this.bodyStyle,border:this.border,layout:"table",layoutConfig:{columns:3}});p.add(this.switchToFrom?this.toMultiselect:this.fromMultiselect);var icons=new Ext.Panel({header:false});p.add(icons);p.add(this.switchToFrom?this.fromMultiselect:this.toMultiselect);p.render(this.el);icons.el.down("."+icons.bwrapCls).remove();if(this.imagePath!=""&&this.imagePath.charAt(this.imagePath.length-1)!="/"){this.imagePath+="/"}this.iconUp=this.imagePath+(this.iconUp||"up2.gif");this.iconDown=this.imagePath+(this.iconDown||"down2.gif");this.iconLeft=this.imagePath+(this.iconLeft||"left2.gif");this.iconRight=this.imagePath+(this.iconRight||"right2.gif");this.iconTop=this.imagePath+(this.iconTop||"top2.gif");this.iconBottom=this.imagePath+(this.iconBottom||"bottom2.gif");var el=icons.getEl();if(!this.toSortField){this.toTopIcon=el.createChild({tag:"img",src:this.iconTop,style:{cursor:"pointer",margin:"2px"}});el.createChild({tag:"br"});this.upIcon=el.createChild({tag:"img",src:this.iconUp,style:{cursor:"pointer",margin:"2px"}});el.createChild({tag:"br"})}this.addIcon=el.createChild({tag:"img",src:this.switchToFrom?this.iconLeft:this.iconRight,style:{cursor:"pointer",margin:"2px"}});el.createChild({tag:"br"});this.removeIcon=el.createChild({tag:"img",src:this.switchToFrom?this.iconRight:this.iconLeft,style:{cursor:"pointer",margin:"2px"}});el.createChild({tag:"br"});if(!this.toSortField){this.downIcon=el.createChild({tag:"img",src:this.iconDown,style:{cursor:"pointer",margin:"2px"}});el.createChild({tag:"br"});this.toBottomIcon=el.createChild({tag:"img",src:this.iconBottom,style:{cursor:"pointer",margin:"2px"}})}if(!this.readOnly){if(!this.toSortField){this.toTopIcon.on("click",this.toTop,this);this.upIcon.on("click",this.up,this);this.downIcon.on("click",this.down,this);this.toBottomIcon.on("click",this.toBottom,this)}this.addIcon.on("click",this.fromTo,this);this.removeIcon.on("click",this.toFrom,this)}if(!this.drawUpIcon||this.hideNavIcons){this.upIcon.dom.style.display="none"}if(!this.drawDownIcon||this.hideNavIcons){this.downIcon.dom.style.display="none"}if(!this.drawLeftIcon||this.hideNavIcons){this.addIcon.dom.style.display="none"}if(!this.drawRightIcon||this.hideNavIcons){this.removeIcon.dom.style.display="none"}if(!this.drawTopIcon||this.hideNavIcons){this.toTopIcon.dom.style.display="none"}if(!this.drawBotIcon||this.hideNavIcons){this.toBottomIcon.dom.style.display="none"}var tb=p.body.first();this.el.setWidth(p.body.first().getWidth());p.body.removeClass();this.hiddenName=this.name;var hiddenTag={tag:"input",type:"hidden",value:"",name:this.name};this.hiddenField=this.el.createChild(hiddenTag);this.valueChanged(this.toStore)},initValue:Ext.emptyFn,toTop:function(){var selectionsArray=this.toMultiselect.view.getSelectedIndexes();var records=[];if(selectionsArray.length>0){selectionsArray.sort();for(var i=0;i<selectionsArray.length;i++){record=this.toMultiselect.view.store.getAt(selectionsArray[i]);records.push(record)}selectionsArray=[];for(var i=records.length-1;i>-1;i--){record=records[i];this.toMultiselect.view.store.remove(record);this.toMultiselect.view.store.insert(0,record);selectionsArray.push(((records.length-1)-i))}}this.toMultiselect.view.refresh();this.toMultiselect.view.select(selectionsArray)},toBottom:function(){var selectionsArray=this.toMultiselect.view.getSelectedIndexes();var records=[];if(selectionsArray.length>0){selectionsArray.sort();for(var i=0;i<selectionsArray.length;i++){record=this.toMultiselect.view.store.getAt(selectionsArray[i]);records.push(record)}selectionsArray=[];for(var i=0;i<records.length;i++){record=records[i];this.toMultiselect.view.store.remove(record);this.toMultiselect.view.store.add(record);selectionsArray.push((this.toMultiselect.view.store.getCount())-(records.length-i))}}this.toMultiselect.view.refresh();this.toMultiselect.view.select(selectionsArray)},up:function(){var record=null;var selectionsArray=this.toMultiselect.view.getSelectedIndexes();selectionsArray.sort();var newSelectionsArray=[];if(selectionsArray.length>0){for(var i=0;i<selectionsArray.length;i++){record=this.toMultiselect.view.store.getAt(selectionsArray[i]);if((selectionsArray[i]-1)>=0){this.toMultiselect.view.store.remove(record);this.toMultiselect.view.store.insert(selectionsArray[i]-1,record);newSelectionsArray.push(selectionsArray[i]-1)}}this.toMultiselect.view.refresh();this.toMultiselect.view.select(newSelectionsArray)}},down:function(){var record=null;var selectionsArray=this.toMultiselect.view.getSelectedIndexes();selectionsArray.sort();selectionsArray.reverse();var newSelectionsArray=[];if(selectionsArray.length>0){for(var i=0;i<selectionsArray.length;i++){record=this.toMultiselect.view.store.getAt(selectionsArray[i]);if((selectionsArray[i]+1)<this.toMultiselect.view.store.getCount()){this.toMultiselect.view.store.remove(record);this.toMultiselect.view.store.insert(selectionsArray[i]+1,record);newSelectionsArray.push(selectionsArray[i]+1)}}this.toMultiselect.view.refresh();this.toMultiselect.view.select(newSelectionsArray)}},fromTo:function(){var selectionsArray=this.fromMultiselect.view.getSelectedIndexes();var records=[];if(selectionsArray.length>0){for(var i=0;i<selectionsArray.length;i++){record=this.fromMultiselect.view.store.getAt(selectionsArray[i]);records.push(record)}if(!this.allowDup){selectionsArray=[]}for(var i=0;i<records.length;i++){record=records[i];if(this.allowDup){var x=new Ext.data.Record();record.id=x.id;delete x;this.toMultiselect.view.store.add(record)}else{this.fromMultiselect.view.store.remove(record);this.toMultiselect.view.store.add(record);selectionsArray.push((this.toMultiselect.view.store.getCount()-1))}}}this.toMultiselect.view.refresh();this.fromMultiselect.view.refresh();if(this.toSortField){this.toMultiselect.store.sort(this.toSortField,this.toSortDir)}if(this.allowDup){this.fromMultiselect.view.select(selectionsArray)}else{this.toMultiselect.view.select(selectionsArray)}},toFrom:function(){var selectionsArray=this.toMultiselect.view.getSelectedIndexes();var records=[];if(selectionsArray.length>0){for(var i=0;i<selectionsArray.length;i++){record=this.toMultiselect.view.store.getAt(selectionsArray[i]);records.push(record)}selectionsArray=[];for(var i=0;i<records.length;i++){record=records[i];this.toMultiselect.view.store.remove(record);if(!this.allowDup){this.fromMultiselect.view.store.add(record);selectionsArray.push((this.fromMultiselect.view.store.getCount()-1))}}}this.fromMultiselect.view.refresh();this.toMultiselect.view.refresh();if(this.fromSortField){this.fromMultiselect.store.sort(this.fromSortField,this.fromSortDir)}this.fromMultiselect.view.select(selectionsArray)},valueChanged:function(store){var record=null;var values=[];for(var i=0;i<store.getCount();i++){record=store.getAt(i);values.push(record.get(this.valueField));if(!this.allowDup){var index=this.fromMultiselect.view.store.find(this.valueField,record.get(this.valueField));var rdup=this.fromMultiselect.view.store.getAt(index);if(rdup){this.fromMultiselect.view.store.remove(rdup)}}}this.fromMultiselect.view.refresh();this.fromMultiselect.store.sort(this.displayField,"ASC");this.hiddenField.dom.value=values.join(this.delimiter);this.fireEvent("change",this,this.getValue(),this.hiddenField.dom.value)},getValue:function(){return this.hiddenField.dom.value},onRowDblClick:function(vw,index,node,e){return this.fireEvent("rowdblclick",vw,index,node,e)},reset:function(){range=this.toMultiselect.store.getRange();this.toMultiselect.store.removeAll();if(!this.allowDup){this.fromMultiselect.store.add(range);this.fromMultiselect.store.sort(this.displayField,"ASC")}this.valueChanged(this.toMultiselect.store)},selectAll:function(){var selections=[];for(var i=0;i<this.fromMultiselect.store.getCount();i++){selections.push(i)}this.fromMultiselect.view.select(selections);this.fromTo();this.toMultiselect.view.clearSelections(true)},setValue:function(val){if(!val){return }val=val instanceof Array?val:val.split(",");var rec,i,id;for(i=0;i<val.length;i++){id=val[i];if(this.toStore.find(valueField,id)){continue}index=this.fromStore.find(valueField,id);if(index){rec=this.fromStore.getAt(index);this.toStore.add(rec);this.fromStore.remove(rec)}}},onDestroy:function(){if(this.fromMultiselect){this.fromMultiselect.destroy()}if(this.toMultiselect){this.toMultiselect.destroy()}Ext.ux.ItemSelector.superclass.onDestroy.call(this)}});Ext.reg("itemselector",Ext.ux.ItemSelector);Array.prototype.contains=function(element){return this.indexOf(element)!==-1};Ext.namespace("Ext.ux");Ext.ux.DDView=function(config){if(!config.itemSelector){var tpl=config.tpl;if(this.classRe.test(tpl)){config.tpl=tpl.replace(this.classRe,"class=$1x-combo-list-item $2$1")}else{config.tpl=tpl.replace(this.tagRe,'$1 class="x-combo-list-item" $2')}config.itemSelector=".x-combo-list-item"}Ext.ux.DDView.superclass.constructor.call(this,Ext.apply(config,{border:false}))};Ext.extend(Ext.ux.DDView,Ext.DataView,{sortDir:"ASC",isFormField:true,classRe:/class=(['"])(.*)\1/,tagRe:/(<\w*)(.*?>)/,reset:Ext.emptyFn,clearInvalid:Ext.form.Field.prototype.clearInvalid,msgTarget:"qtip",afterRender:function(){Ext.ux.DDView.superclass.afterRender.call(this);if(this.dragGroup){this.setDraggable(this.dragGroup.split(","))}if(this.dropGroup){this.setDroppable(this.dropGroup.split(","))}if(this.deletable){this.setDeletable()}this.isDirtyFlag=false;this.addEvents("drop")},validate:function(){return true},destroy:function(){this.purgeListeners();this.getEl().removeAllListeners();this.getEl().remove();if(this.dragZone){Ext.dd.ScrollManager.unregister(this.dragZone.el);if(this.dragZone.destroy){this.dragZone.destroy()}}if(this.dropZone){Ext.dd.ScrollManager.unregister(this.dropZone.el);if(this.dropZone.destroy){this.dropZone.destroy()}}},getName:function(){return this.name},setValue:function(v){if(!this.store){throw"DDView.setValue(). DDView must be constructed with a valid Store"}var data={};data[this.store.reader.meta.root]=v?[].concat(v):[];this.store.proxy=new Ext.data.MemoryProxy(data);this.store.load()},getValue:function(){var result="(";this.store.each(function(rec){result+=rec.id+","});return result.substr(0,result.length-1)+")"},getIds:function(){var i=0,result=new Array(this.store.getCount());this.store.each(function(rec){result[i++]=rec.id});return result},isDirty:function(){return this.isDirtyFlag},getTargetFromEvent:function(e){var target=e.getTarget();while((target!==null)&&(target.parentNode!=this.el.dom)){target=target.parentNode}if(!target){target=this.el.dom.lastChild||this.el.dom}return target},getDragData:function(e){var target=this.findItemFromChild(e.getTarget());if(target){if(!this.isSelected(target)){delete this.ignoreNextClick;this.onItemClick(target,this.indexOf(target),e);this.ignoreNextClick=true}var dragData={sourceView:this,viewNodes:[],records:[],copy:this.copy||(this.allowCopy&&e.ctrlKey)};if(this.getSelectionCount()==1){var i=this.getSelectedIndexes()[0];var n=this.getNode(i);dragData.viewNodes.push(dragData.ddel=n);dragData.records.push(this.store.getAt(i));dragData.repairXY=Ext.fly(n).getXY()}else{dragData.ddel=document.createElement("div");dragData.ddel.className="multi-proxy";this.collectSelection(dragData)}return dragData}return false},getRepairXY:function(e){return this.dragData.repairXY},collectSelection:function(data){data.repairXY=Ext.fly(this.getSelectedNodes()[0]).getXY();if(this.preserveSelectionOrder===true){Ext.each(this.getSelectedIndexes(),function(i){var n=this.getNode(i);var dragNode=n.cloneNode(true);dragNode.id=Ext.id();data.ddel.appendChild(dragNode);data.records.push(this.store.getAt(i));data.viewNodes.push(n)},this)}else{var i=0;this.store.each(function(rec){if(this.isSelected(i)){var n=this.getNode(i);var dragNode=n.cloneNode(true);dragNode.id=Ext.id();data.ddel.appendChild(dragNode);data.records.push(this.store.getAt(i));data.viewNodes.push(n)}i++},this)}},setDraggable:function(ddGroup){if(ddGroup instanceof Array){Ext.each(ddGroup,this.setDraggable,this);return }if(this.dragZone){this.dragZone.addToGroup(ddGroup)}else{this.dragZone=new Ext.dd.DragZone(this.getEl(),{containerScroll:true,ddGroup:ddGroup});if(!this.multiSelect){this.singleSelect=true}this.dragZone.getDragData=this.getDragData.createDelegate(this);this.dragZone.getRepairXY=this.getRepairXY;this.dragZone.onEndDrag=this.onEndDrag}},setDroppable:function(ddGroup){if(ddGroup instanceof Array){Ext.each(ddGroup,this.setDroppable,this);return }if(this.dropZone){this.dropZone.addToGroup(ddGroup)}else{this.dropZone=new Ext.dd.DropZone(this.getEl(),{owningView:this,containerScroll:true,ddGroup:ddGroup});this.dropZone.getTargetFromEvent=this.getTargetFromEvent.createDelegate(this);this.dropZone.onNodeEnter=this.onNodeEnter.createDelegate(this);this.dropZone.onNodeOver=this.onNodeOver.createDelegate(this);this.dropZone.onNodeOut=this.onNodeOut.createDelegate(this);this.dropZone.onNodeDrop=this.onNodeDrop.createDelegate(this)}},getDropPoint:function(e,n,dd){if(n==this.el.dom){return"above"}var t=Ext.lib.Dom.getY(n),b=t+n.offsetHeight;var c=t+(b-t)/2;var y=Ext.lib.Event.getPageY(e);if(y<=c){return"above"}else{return"below"}},isValidDropPoint:function(pt,n,data){if(!data.viewNodes||(data.viewNodes.length!=1)){return true}var d=data.viewNodes[0];if(d==n){return false}if((pt=="below")&&(n.nextSibling==d)){return false}if((pt=="above")&&(n.previousSibling==d)){return false}return true},onNodeEnter:function(n,dd,e,data){if(this.highlightColor&&(data.sourceView!=this)){this.el.highlight(this.highlightColor)}return false},onNodeOver:function(n,dd,e,data){var dragElClass=this.dropNotAllowed;var pt=this.getDropPoint(e,n,dd);if(this.isValidDropPoint(pt,n,data)){if(this.appendOnly||this.sortField){return"x-tree-drop-ok-below"}if(pt){var targetElClass;if(pt=="above"){dragElClass=n.previousSibling?"x-tree-drop-ok-between":"x-tree-drop-ok-above";targetElClass="x-view-drag-insert-above"}else{dragElClass=n.nextSibling?"x-tree-drop-ok-between":"x-tree-drop-ok-below";targetElClass="x-view-drag-insert-below"}if(this.lastInsertClass!=targetElClass){Ext.fly(n).replaceClass(this.lastInsertClass,targetElClass);this.lastInsertClass=targetElClass}}}return dragElClass},onNodeOut:function(n,dd,e,data){this.removeDropIndicators(n)},onNodeDrop:function(n,dd,e,data){if(this.fireEvent("drop",this,n,dd,e,data)===false){return false}var pt=this.getDropPoint(e,n,dd);var insertAt=(this.appendOnly||(n==this.el.dom))?this.store.getCount():n.viewIndex;if(pt=="below"){insertAt++}if(data.sourceView==this){if(pt=="below"){if(data.viewNodes[0]==n){data.viewNodes.shift()}}else{if(data.viewNodes[data.viewNodes.length-1]==n){data.viewNodes.pop()}}if(!data.viewNodes.length){return false}if(insertAt>this.store.indexOf(data.records[0])){insertAt--}}if(data.node instanceof Ext.tree.TreeNode){var r=data.node.getOwnerTree().recordFromNode(data.node);if(r){data.records=[r]}}if(!data.records){alert("Programming problem. Drag data contained no Records");return false}for(var i=0;i<data.records.length;i++){var r=data.records[i];var dup=this.store.getById(r.id);if(dup&&(dd!=this.dragZone)){if(!this.allowDup&&!this.allowTrash){Ext.fly(this.getNode(this.store.indexOf(dup))).frame("red",1);return true}var x=new Ext.data.Record();r.id=x.id;delete x}if(data.copy){this.store.insert(insertAt++,r.copy())}else{if(data.sourceView){data.sourceView.isDirtyFlag=true;data.sourceView.store.remove(r)}if(!this.allowTrash){this.store.insert(insertAt++,r)}}if(this.sortField){this.store.sort(this.sortField,this.sortDir)}this.isDirtyFlag=true}this.dragZone.cachedTarget=null;return true},onEndDrag:function(data,e){var d=Ext.get(this.dragData.ddel);if(d&&d.hasClass("multi-proxy")){d.remove()}},removeDropIndicators:function(n){if(n){Ext.fly(n).removeClass(["x-view-drag-insert-above","x-view-drag-insert-left","x-view-drag-insert-right","x-view-drag-insert-below"]);this.lastInsertClass="_noclass"}},setDeletable:function(imageUrl){if(!this.singleSelect&&!this.multiSelect){this.singleSelect=true}var c=this.getContextMenu();this.contextMenu.on("itemclick",function(item){switch(item.id){case"delete":this.remove(this.getSelectedIndexes());break}},this);this.contextMenu.add({icon:imageUrl||AU.resolveUrl("/images/delete.gif"),id:"delete",text:AU.getMessage("deleteItem")})},getContextMenu:function(){if(!this.contextMenu){this.contextMenu=new Ext.menu.Menu({id:this.id+"-contextmenu"});this.el.on("contextmenu",this.showContextMenu,this)}return this.contextMenu},disableContextMenu:function(){if(this.contextMenu){this.el.un("contextmenu",this.showContextMenu,this)}},showContextMenu:function(e,item){item=this.findItemFromChild(e.getTarget());if(item){e.stopEvent();this.select(this.getNode(item),this.multiSelect&&e.ctrlKey,true);this.contextMenu.showAt(e.getXY())}},remove:function(selectedIndices){selectedIndices=[].concat(selectedIndices);for(var i=0;i<selectedIndices.length;i++){var rec=this.store.getAt(selectedIndices[i]);this.store.remove(rec)}},onDblClick:function(e){var item=this.findItemFromChild(e.getTarget());if(item){if(this.fireEvent("dblclick",this,this.indexOf(item),item,e)===false){return false}if(this.dragGroup){var targets=Ext.dd.DragDropMgr.getRelated(this.dragZone,true);while(targets.contains(this.dropZone)){targets.remove(this.dropZone)}if((targets.length==1)&&(targets[0].owningView)){this.dragZone.cachedTarget=null;var el=Ext.get(targets[0].getEl());var box=el.getBox(true);targets[0].onNodeDrop(el.dom,{target:el.dom,xy:[box.x,box.y+box.height-1]},null,this.getDragData(e))}}}},onItemClick:function(item,index,e){if(this.ignoreNextClick){delete this.ignoreNextClick;return }if(this.fireEvent("beforeclick",this,index,item,e)===false){return false}if(this.multiSelect||this.singleSelect){if(this.multiSelect&&e.shiftKey&&this.lastSelection){this.select(this.getNodes(this.indexOf(this.lastSelection),index),false)}else{if(this.isSelected(item)&&e.ctrlKey){this.deselect(item)}else{this.deselect(item);this.select(item,this.multiSelect&&e.ctrlKey);this.lastSelection=item}}e.preventDefault()}return true}});Ext.ux.MultiMonthCalendar=Ext.extend(Ext.Component,{minDate:null,maxDate:null,minText:"This date is before the minimum date",maxText:"This date is after the maximum date",format:"m/d/y",disabledDays:null,disabledDaysText:"",disabledDatesRE:null,disabledDatesText:"",constrainToViewport:true,monthNames:Date.monthNames,dayNames:Date.dayNames,nextText:"Next Month (Control+Right)",prevText:"Previous Month (Control+Left)",startDay:0,noOfMonth:2,eventDates:null,noOfMonthPerRow:3,initComponent:function(){Ext.ux.MultiMonthCalendar.superclass.initComponent.call(this);this.value=this.value?this.value.clearTime():new Date().clearTime();this.initDisabledDays();this.noOfMonthPerRow=this.noOfMonthPerRow>this.noOfMonth?this.noOfMonth:this.noOfMonthPerRow},initDisabledDays:function(){if(!this.disabledDatesRE&&this.disabledDates){var dd=this.disabledDates;var re="(?:";for(var i=0;i<dd.length;i++){re+=dd[i];if(i!=dd.length-1){re+="|"}}this.disabledDatesRE=new RegExp(re+")")}},setValue:function(value){var old=this.value;this.value=value.clearTime(true);if(this.el){this.update(this.value)}},getValue:function(){return this.value},focus:function(){if(this.el){this.update(this.activeDate)}},onRender:function(container,position){var m=["<table cellspacing='0'>"];if(this.noOfMonthPerRow>1){m.push("<tr><td class='x-date-left'><a href='#' title='",this.prevText,"'> </a></td>");m.push("<td class='x-date-left' colspan='"+eval(this.noOfMonthPerRow*2-3)+"'></td>");m.push("<td class='x-date-right'><a href='#' title='",this.nextText,"'> </a></td></tr><tr>")}else{m.push("<tr><td><table cellspacing='0' width='100%'><tr><td class='x-date-left'><a href='#' title='",this.prevText,"'> </a></td>");m.push("<td class='x-date-right'><a href='#' title='",this.nextText,"'> </a></td></tr></table></td></tr><tr>")}for(var x=0;x<this.noOfMonth;x++){m.push("<td><table border='1' cellspacing='0'><tr>");m.push("<td class='x-date-middle' align='center'><span id='monthLabel"+x+"'></span></td>");m.push("</tr><tr><td><table class='x-date-inner' id='inner-date"+x+"' cellspacing='0'><thead><tr>");var dn=this.dayNames;for(var i=0;i<7;i++){var d=this.startDay+i;if(d>6){d=d-7}m.push("<th><span>",dn[d].substr(0,1),"</span></th>")}m[m.length]="</tr></thead><tbody><tr>";for(var i=0;i<42;i++){if(i%7==0&&i!=0){m[m.length]="</tr><tr>"}m[m.length]='<td><a href="#" hidefocus="on" class="x-date-date" tabIndex="1"><em><span></span></em></a></td>'}m[m.length]="</tr></tbody></table></td></tr></table></td>";if(x!=this.noOfMonth-1){m[m.length]="<td width='3'></td>"}if((x+1)%this.noOfMonthPerRow==0&&x!=0){m[m.length]="</tr><tr>"}}m[m.length]="</tr></table>";var el=document.createElement("div");el.className="x-date-picker";el.innerHTML=m.join("");container.dom.insertBefore(el,position);this.el=Ext.get(el);this.eventEl=Ext.get(el.firstChild);new Ext.util.ClickRepeater(this.el.child("td.x-date-left a"),{handler:this.showPrevMonth,scope:this,preventDefault:true,stopDefault:true});new Ext.util.ClickRepeater(this.el.child("td.x-date-right a"),{handler:this.showNextMonth,scope:this,preventDefault:true,stopDefault:true});var kn=new Ext.KeyNav(this.eventEl,{left:function(e){e.ctrlKey?this.showPrevMonth():this.update(this.activeDate.add("d",-1))},right:function(e){e.ctrlKey?this.showNextMonth():this.update(this.activeDate.add("d",1))},pageUp:function(e){this.showNextMonth()},pageDown:function(e){this.showPrevMonth()},enter:function(e){e.stopPropagation();return true},scope:this});this.cellsArray=new Array();this.textNodesArray=new Array();for(var x=0;x<this.noOfMonth;x++){var cells=Ext.get("inner-date"+x).select("tbody td");var textNodes=Ext.get("inner-date"+x).query("tbody span");this.cellsArray[x]=cells;this.textNodesArray[x]=textNodes}if(Ext.isIE){this.el.repaint()}this.update(this.value)},showPrevMonth:function(e){this.update(this.activeDate.add("mo",-1))},showNextMonth:function(e){this.update(this.activeDate.add("mo",1))},update:function(date){this.activeDate=date;for(var x=0;x<this.noOfMonth;x++){var days=date.getDaysInMonth();var firstOfMonth=date.getFirstDateOfMonth();var startingPos=firstOfMonth.getDay()-this.startDay;if(startingPos<=this.startDay){startingPos+=7}var pm=date.add("mo",-1);var prevStart=pm.getDaysInMonth()-startingPos;var cells=this.cellsArray[x].elements;var textEls=this.textNodesArray[x];days+=startingPos;var day=86400000;var d=(new Date(pm.getFullYear(),pm.getMonth(),prevStart)).clearTime();var min=this.minDate?this.minDate.clearTime():Number.NEGATIVE_INFINITY;var max=this.maxDate?this.maxDate.clearTime():Number.POSITIVE_INFINITY;var ddMatch=this.disabledDatesRE;var ddText=this.disabledDatesText;var ddays=this.disabledDays?this.disabledDays.join(""):false;var ddaysText=this.disabledDaysText;var format=this.format;var setCellClass=function(cal,cell){cell.title="";var t=d.getTime();cell.firstChild.dateValue=t;if(t<min){cell.className=" x-date-disabled";cell.title=cal.minText;return }if(t>max){cell.className=" x-date-disabled";cell.title=cal.maxText;return }if(ddays){if(ddays.indexOf(d.getDay())!=-1){cell.title=ddaysText;cell.className=" x-date-disabled"}}if(ddMatch&&format){var fvalue=d.dateFormat(format);if(ddMatch.test(fvalue)){cell.title=ddText.replace("%0",fvalue);cell.className=" x-date-disabled"}}if(cal.eventDates&&(cell.className.indexOf("x-date-active")!=-1)){for(var y=0;y<cal.eventDates.length;y++){var evtDate=cal.eventDates[y].clearTime().getTime();if(t==evtDate){cell.className+=" x-date-selected";break}}}};var i=0;for(;i<startingPos;i++){textEls[i].innerHTML=(++prevStart);d.setDate(d.getDate()+1);cells[i].className="x-date-prevday";setCellClass(this,cells[i])}for(;i<days;i++){intDay=i-startingPos+1;textEls[i].innerHTML=(intDay);d.setDate(d.getDate()+1);cells[i].className="x-date-active";setCellClass(this,cells[i])}var extraDays=0;for(;i<42;i++){textEls[i].innerHTML=(++extraDays);d.setDate(d.getDate()+1);cells[i].className="x-date-nextday";setCellClass(this,cells[i])}var monthLabel=Ext.get("monthLabel"+x);monthLabel.update(this.monthNames[date.getMonth()]+" "+date.getFullYear());if(!this.internalRender){var main=this.el.dom.firstChild;var w=main.offsetWidth;this.el.setWidth(w+this.el.getBorderWidth("lr"));Ext.fly(main).setWidth(w);this.internalRender=true;if(Ext.isOpera&&!this.secondPass){main.rows[0].cells[1].style.width=(w-(main.rows[0].cells[0].offsetWidth+main.rows[0].cells[2].offsetWidth))+"px";this.secondPass=true;this.update.defer(10,this,[date])}}date=date.add("mo",1)}}});Ext.reg("mmcalendar",Ext.ux.MultiMonthCalendar);var SWFUpload=function(init_settings){this.initSWFUpload(init_settings)};SWFUpload.prototype.initSWFUpload=function(init_settings){try{document.execCommand("BackgroundImageCache",false,true)}catch(ex1){}try{this.customSettings={};this.settings={};this.eventQueue=[];this.movieName="SWFUpload_"+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings(init_settings);this.loadFlash();this.displayDebugInfo()}catch(ex2){this.debug(ex2)}};SWFUpload.instances={};SWFUpload.movieCount=0;SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130};SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290};SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5};SWFUpload.prototype.initSettings=function(init_settings){this.addSetting("upload_url",init_settings.upload_url,"");this.addSetting("file_post_name",init_settings.file_post_name,"Filedata");this.addSetting("post_params",init_settings.post_params,{});this.addSetting("file_types",init_settings.file_types,"*.*");this.addSetting("file_types_description",init_settings.file_types_description,"All Files");this.addSetting("file_size_limit",init_settings.file_size_limit,"1024");this.addSetting("file_upload_limit",init_settings.file_upload_limit,"0");this.addSetting("file_queue_limit",init_settings.file_queue_limit,"0");this.addSetting("flash_url",init_settings.flash_url,"swfupload.swf");this.addSetting("flash_width",init_settings.flash_width,"1px");this.addSetting("flash_height",init_settings.flash_height,"1px");this.addSetting("flash_color",init_settings.flash_color,"#FFFFFF");this.addSetting("debug_enabled",init_settings.debug,false);this.flashReady_handler=SWFUpload.flashReady;this.swfUploadLoaded_handler=this.retrieveSetting(init_settings.swfupload_loaded_handler,SWFUpload.swfUploadLoaded);this.fileDialogStart_handler=this.retrieveSetting(init_settings.file_dialog_start_handler,SWFUpload.fileDialogStart);this.fileQueued_handler=this.retrieveSetting(init_settings.file_queued_handler,SWFUpload.fileQueued);this.fileQueueError_handler=this.retrieveSetting(init_settings.file_queue_error_handler,SWFUpload.fileQueueError);this.fileDialogComplete_handler=this.retrieveSetting(init_settings.file_dialog_complete_handler,SWFUpload.fileDialogComplete);this.uploadStart_handler=this.retrieveSetting(init_settings.upload_start_handler,SWFUpload.uploadStart);this.uploadProgress_handler=this.retrieveSetting(init_settings.upload_progress_handler,SWFUpload.uploadProgress);this.uploadError_handler=this.retrieveSetting(init_settings.upload_error_handler,SWFUpload.uploadError);this.uploadSuccess_handler=this.retrieveSetting(init_settings.upload_success_handler,SWFUpload.uploadSuccess);this.uploadComplete_handler=this.retrieveSetting(init_settings.upload_complete_handler,SWFUpload.uploadComplete);this.debug_handler=this.retrieveSetting(init_settings.debug_handler,SWFUpload.debug);this.customSettings=this.retrieveSetting(init_settings.custom_settings,{})};SWFUpload.prototype.loadFlash=function(){var html,target_element,container;if(document.getElementById(this.movieName)!==null){return false}try{target_element=document.getElementsByTagName("body")[0];if(typeof (target_element)==="undefined"||target_element===null){this.debug("Could not find the BODY element. SWFUpload failed to load.");return false}}catch(ex){return false}container=document.createElement("div");container.style.width=this.getSetting("flash_width");container.style.height=this.getSetting("flash_height");target_element.appendChild(container);container.innerHTML=this.getFlashHTML()};SWFUpload.prototype.getFlashHTML=function(){var html="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){html='<embed type="application/x-shockwave-flash" src="'+this.getSetting("flash_url")+'" width="'+this.getSetting("flash_width")+'" height="'+this.getSetting("flash_height")+'"';html+=' id="'+this.movieName+'" name="'+this.movieName+'" ';html+='bgcolor="'+this.getSetting("flash_color")+'" quality="high" menu="false" flashvars="';html+=this.getFlashVars();html+='" />'}else{html='<object id="'+this.movieName+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getSetting("flash_width")+'" height="'+this.getSetting("flash_height")+'">';html+='<param name="movie" value="'+this.getSetting("flash_url")+'">';html+='<param name="bgcolor" value="'+this.getSetting("flash_color")+'" />';html+='<param name="quality" value="high" />';html+='<param name="menu" value="false" />';html+='<param name="flashvars" value="'+this.getFlashVars()+'" />';html+="</object>"}return html};SWFUpload.prototype.getFlashVars=function(){var param_string=this.buildParamString();var html="";html+="movieName="+encodeURIComponent(this.movieName);html+="&uploadURL="+encodeURIComponent(this.getSetting("upload_url"));html+="¶ms="+encodeURIComponent(param_string);html+="&filePostName="+encodeURIComponent(this.getSetting("file_post_name"));html+="&fileTypes="+encodeURIComponent(this.getSetting("file_types"));html+="&fileTypesDescription="+encodeURIComponent(this.getSetting("file_types_description"));html+="&fileSizeLimit="+encodeURIComponent(this.getSetting("file_size_limit"));html+="&fileUploadLimit="+encodeURIComponent(this.getSetting("file_upload_limit"));html+="&fileQueueLimit="+encodeURIComponent(this.getSetting("file_queue_limit"));html+="&debugEnabled="+encodeURIComponent(this.getSetting("debug_enabled"));return html};SWFUpload.prototype.getMovieElement=function(){if(typeof (this.movieElement)==="undefined"||this.movieElement===null){this.movieElement=document.getElementById(this.movieName)}return this.movieElement};SWFUpload.prototype.buildParamString=function(){var post_params=this.getSetting("post_params");var param_string_pairs=[];var i,value,name;if(typeof (post_params)==="object"){for(name in post_params){if(post_params.hasOwnProperty(name)){if(typeof (post_params[name])==="string"){param_string_pairs.push(encodeURIComponent(name)+"="+encodeURIComponent(post_params[name]))}}}}return param_string_pairs.join("&")};SWFUpload.prototype.addSetting=function(name,value,default_value){if(typeof (value)==="undefined"||value===null){this.settings[name]=default_value}else{this.settings[name]=value}return this.settings[name]};SWFUpload.prototype.getSetting=function(name){if(typeof (this.settings[name])==="undefined"){return""}else{return this.settings[name]}};SWFUpload.prototype.retrieveSetting=function(value,default_value){if(typeof (value)==="undefined"||value===null){return default_value}else{return value}};SWFUpload.prototype.displayDebugInfo=function(){var key,debug_message="";debug_message+="----- SWFUPLOAD SETTINGS ----\nID: "+this.moveName+"\n";debug_message+=this.outputObject(this.settings);debug_message+="----- SWFUPLOAD SETTINGS END ----\n";debug_message+="\n";this.debug(debug_message)};SWFUpload.prototype.outputObject=function(object,prefix){var output="",key;if(typeof (prefix)!=="string"){prefix=""}if(typeof (object)!=="object"){return""}for(key in object){if(object.hasOwnProperty(key)){if(typeof (object[key])==="object"){output+=(prefix+key+": { \n"+this.outputObject(object[key],"\t"+prefix)+prefix+"}\n")}else{output+=(prefix+key+": "+object[key]+"\n")}}}return output};SWFUpload.prototype.selectFile=function(){var movie_element=this.getMovieElement();if(movie_element!==null&&typeof (movie_element.SelectFile)==="function"){try{movie_element.SelectFile()}catch(ex){this.debug("Could not call SelectFile: "+ex)}}else{this.debug("Could not find Flash element")}};SWFUpload.prototype.selectFiles=function(){var movie_element=this.getMovieElement();if(movie_element!==null&&typeof (movie_element.SelectFiles)==="function"){try{movie_element.SelectFiles()}catch(ex){this.debug("Could not call SelectFiles: "+ex)}}else{this.debug("Could not find Flash element")}};SWFUpload.prototype.startUpload=function(file_id){var self=this;var movie_element=this.getMovieElement();if(movie_element!==null&&typeof (movie_element.StartUpload)==="function"){setTimeout(function(){try{movie_element.StartUpload(file_id)}catch(ex){self.debug("Could not call StartUpload: "+ex)}},0)}else{this.debug("Could not find Flash element")}};SWFUpload.prototype.cancelUpload=function(file_id){var movie_element=this.getMovieElement();if(movie_element!==null&&typeof (movie_element.CancelUpload)==="function"){try{movie_element.CancelUpload(file_id)}catch(ex){this.debug("Could not call CancelUpload: "+ex)}}else{this.debug("Could not find Flash element")}};SWFUpload.prototype.stopUpload=function(){var movie_element=this.getMovieElement();if(movie_element!==null&&typeof (movie_element.StopUpload)==="function"){try{movie_element.StopUpload()}catch(ex){this.debug("Could not call StopUpload: "+ex)}}else{this.debug("Could not find Flash element")}};SWFUpload.prototype.getStats=function(){var movie_element=this.getMovieElement();if(movie_element!==null&&typeof (movie_element.GetStats)==="function"){try{return movie_element.GetStats()}catch(ex){this.debug("Could not call GetStats")}}else{this.debug("Could not find Flash element")}};SWFUpload.prototype.setStats=function(stats_object){var movie_element=this.getMovieElement();if(movie_element!==null&&typeof (movie_element.SetStats)==="function"){try{movie_element.SetStats(stats_object)}catch(ex){this.debug("Could not call SetStats")}}else{this.debug("Could not find Flash element")}};SWFUpload.prototype.setCredentials=function(name,password){var movie_element=this.getMovieElement();if(movie_element!==null&&typeof (movie_element.SetCredentials)==="function"){try{return movie_element.SetCredentials(name,password)}catch(ex){this.debug("Could not call SetCredentials")}}else{this.debug("Could not find Flash element")}};SWFUpload.prototype.getFile=function(file_id){var movie_element=this.getMovieElement();if(typeof (file_id)==="number"){if(movie_element!==null&&typeof (movie_element.GetFileByIndex)==="function"){try{return movie_element.GetFileByIndex(file_id)}catch(ex){this.debug("Could not call GetFileByIndex")}}else{this.debug("Could not find Flash element")}}else{if(movie_element!==null&&typeof (movie_element.GetFile)==="function"){try{return movie_element.GetFile(file_id)}catch(ex){this.debug("Could not call GetFile")}}else{this.debug("Could not find Flash element")}}};SWFUpload.prototype.addFileParam=function(file_id,name,value){var movie_element=this.getMovieElement();if(movie_element!==null&&typeof (movie_element.AddFileParam)==="function"){try{return movie_element.AddFileParam(file_id,name,value)}catch(ex){this.debug("Could not call AddFileParam")}}else{this.debug("Could not find Flash element")}};SWFUpload.prototype.removeFileParam=function(file_id,name){var movie_element=this.getMovieElement();if(movie_element!==null&&typeof (movie_element.RemoveFileParam)==="function"){try{return movie_element.RemoveFileParam(file_id,name)}catch(ex){this.debug("Could not call AddFileParam")}}else{this.debug("Could not find Flash element")}};SWFUpload.prototype.setUploadURL=function(url){var movie_element=this.getMovieElement();if(movie_element!==null&&typeof (movie_element.SetUploadURL)==="function"){try{this.addSetting("upload_url",url);movie_element.SetUploadURL(this.getSetting("upload_url"))}catch(ex){this.debug("Could not call SetUploadURL")}}else{this.debug("Could not find Flash element in setUploadURL")}};SWFUpload.prototype.setPostParams=function(param_object){var movie_element=this.getMovieElement();if(movie_element!==null&&typeof (movie_element.SetPostParams)==="function"){try{this.addSetting("post_params",param_object);movie_element.SetPostParams(this.getSetting("post_params"))}catch(ex){this.debug("Could not call SetPostParams")}}else{this.debug("Could not find Flash element in SetPostParams")}};SWFUpload.prototype.setFileTypes=function(types,description){var movie_element=this.getMovieElement();if(movie_element!==null&&typeof (movie_element.SetFileTypes)==="function"){try{this.addSetting("file_types",types);this.addSetting("file_types_description",description);movie_element.SetFileTypes(this.getSetting("file_types"),this.getSetting("file_types_description"))}catch(ex){this.debug("Could not call SetFileTypes")}}else{this.debug("Could not find Flash element in SetFileTypes")}};SWFUpload.prototype.setFileSizeLimit=function(file_size_limit){var movie_element=this.getMovieElement();if(movie_element!==null&&typeof (movie_element.SetFileSizeLimit)==="function"){try{this.addSetting("file_size_limit",file_size_limit);movie_element.SetFileSizeLimit(this.getSetting("file_size_limit"))}catch(ex){this.debug("Could not call SetFileSizeLimit")}}else{this.debug("Could not find Flash element in SetFileSizeLimit")}};SWFUpload.prototype.setFileUploadLimit=function(file_upload_limit){var movie_element=this.getMovieElement();if(movie_element!==null&&typeof (movie_element.SetFileUploadLimit)==="function"){try{this.addSetting("file_upload_limit",file_upload_limit);movie_element.SetFileUploadLimit(this.getSetting("file_upload_limit"))}catch(ex){this.debug("Could not call SetFileUploadLimit")}}else{this.debug("Could not find Flash element in SetFileUploadLimit")}};SWFUpload.prototype.setFileQueueLimit=function(file_queue_limit){var movie_element=this.getMovieElement();if(movie_element!==null&&typeof (movie_element.SetFileQueueLimit)==="function"){try{this.addSetting("file_queue_limit",file_queue_limit);movie_element.SetFileQueueLimit(this.getSetting("file_queue_limit"))}catch(ex){this.debug("Could not call SetFileQueueLimit")}}else{this.debug("Could not find Flash element in SetFileQueueLimit")}};SWFUpload.prototype.setFilePostName=function(file_post_name){var movie_element=this.getMovieElement();if(movie_element!==null&&typeof (movie_element.SetFilePostName)==="function"){try{this.addSetting("file_post_name",file_post_name);movie_element.SetFilePostName(this.getSetting("file_post_name"))}catch(ex){this.debug("Could not call SetFilePostName")}}else{this.debug("Could not find Flash element in SetFilePostName")}};SWFUpload.prototype.setDebugEnabled=function(debug_enabled){var movie_element=this.getMovieElement();if(movie_element!==null&&typeof (movie_element.SetDebugEnabled)==="function"){try{this.addSetting("debug_enabled",debug_enabled);movie_element.SetDebugEnabled(this.getSetting("debug_enabled"))}catch(ex){this.debug("Could not call SetDebugEnabled")}}else{this.debug("Could not find Flash element in SetDebugEnabled")}};SWFUpload.prototype.flashReady=function(){var movie_element=this.getMovieElement();if(movie_element===null||typeof (movie_element.StartUpload)!=="function"){this.debug("ExternalInterface methods failed to initialize.");return }var self=this;if(typeof (self.flashReady_handler)==="function"){this.eventQueue[this.eventQueue.length]=function(){self.flashReady_handler()};setTimeout(function(){self.executeNextEvent()},0)}else{this.debug("flashReady_handler event not defined")}};SWFUpload.prototype.executeNextEvent=function(){var f=this.eventQueue.shift();if(typeof (f)==="function"){f()}};SWFUpload.prototype.fileDialogStart=function(){var self=this;if(typeof (self.fileDialogStart_handler)==="function"){this.eventQueue[this.eventQueue.length]=function(){self.fileDialogStart_handler()};setTimeout(function(){self.executeNextEvent()},0)}else{this.debug("fileDialogStart event not defined")}};SWFUpload.prototype.fileQueued=function(file){var self=this;if(typeof (self.fileQueued_handler)==="function"){this.eventQueue[this.eventQueue.length]=function(){self.fileQueued_handler(file)};setTimeout(function(){self.executeNextEvent()},0)}else{this.debug("fileQueued event not defined")}};SWFUpload.prototype.fileQueueError=function(file,error_code,message){var self=this;if(typeof (self.fileQueueError_handler)==="function"){this.eventQueue[this.eventQueue.length]=function(){self.fileQueueError_handler(file,error_code,message)};setTimeout(function(){self.executeNextEvent()},0)}else{this.debug("fileQueueError event not defined")}};SWFUpload.prototype.fileDialogComplete=function(num_files_selected){var self=this;if(typeof (self.fileDialogComplete_handler)==="function"){this.eventQueue[this.eventQueue.length]=function(){self.fileDialogComplete_handler(num_files_selected)};setTimeout(function(){self.executeNextEvent()},0)}else{this.debug("fileDialogComplete event not defined")}};SWFUpload.prototype.uploadStart=function(file){var self=this;if(typeof (self.fileDialogComplete_handler)==="function"){this.eventQueue[this.eventQueue.length]=function(){self.returnUploadStart(self.uploadStart_handler(file))};setTimeout(function(){self.executeNextEvent()},0)}else{this.debug("uploadStart event not defined")}};SWFUpload.prototype.returnUploadStart=function(return_value){var movie_element=this.getMovieElement();if(movie_element!==null&&typeof (movie_element.ReturnUploadStart)==="function"){try{movie_element.ReturnUploadStart(return_value)}catch(ex){this.debug("Could not call ReturnUploadStart")}}else{this.debug("Could not find Flash element in returnUploadStart")}};SWFUpload.prototype.uploadProgress=function(file,bytes_complete,bytes_total){var self=this;if(typeof (self.uploadProgress_handler)==="function"){this.eventQueue[this.eventQueue.length]=function(){self.uploadProgress_handler(file,bytes_complete,bytes_total)};setTimeout(function(){self.executeNextEvent()},0)}else{this.debug("uploadProgress event not defined")}};SWFUpload.prototype.uploadError=function(file,error_code,message){var self=this;if(typeof (this.uploadError_handler)==="function"){this.eventQueue[this.eventQueue.length]=function(){self.uploadError_handler(file,error_code,message)};setTimeout(function(){self.executeNextEvent()},0)}else{this.debug("uploadError event not defined")}};SWFUpload.prototype.uploadSuccess=function(file,server_data){var self=this;if(typeof (self.uploadSuccess_handler)==="function"){this.eventQueue[this.eventQueue.length]=function(){self.uploadSuccess_handler(file,server_data)};setTimeout(function(){self.executeNextEvent()},0)}else{this.debug("uploadSuccess event not defined")}};SWFUpload.prototype.uploadComplete=function(file){var self=this;if(typeof (self.uploadComplete_handler)==="function"){this.eventQueue[this.eventQueue.length]=function(){self.uploadComplete_handler(file)};setTimeout(function(){self.executeNextEvent()},0)}else{this.debug("uploadComplete event not defined")}};SWFUpload.prototype.debug=function(message){var self=this;if(typeof (self.debug_handler)==="function"){this.eventQueue[this.eventQueue.length]=function(){self.debug_handler(message)};setTimeout(function(){self.executeNextEvent()},0)}else{this.eventQueue[this.eventQueue.length]=function(){self.debugMessage(message)};setTimeout(function(){self.executeNextEvent()},0)}};SWFUpload.flashReady=function(){try{this.debug("Flash called back and is ready.");if(typeof (this.swfUploadLoaded_handler)==="function"){this.swfUploadLoaded_handler()}}catch(ex){this.debug(ex)}};SWFUpload.swfUploadLoaded=function(){};SWFUpload.fileDialogStart=function(){};SWFUpload.fileQueued=function(file){};SWFUpload.fileQueueError=function(file,error_code,message){try{switch(error_code){case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:this.debug("Error Code: File too big, File name: "+file.name+", File size: "+file.size+", Message: "+message);break;case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:this.debug("Error Code: Zero Byte File, File name: "+file.name+", File size: "+file.size+", Message: "+message);break;case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:this.debug("Error Code: Upload limit reached, File name: "+file.name+", File size: "+file.size+", Message: "+message);break;case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:this.debug("Error Code: File extension is not allowed, Message: "+message);break;default:this.debug("Error Code: Unhandled error occured. Errorcode: "+error_code)}}catch(ex){this.debug(ex)}};SWFUpload.fileDialogComplete=function(num_files_selected){};SWFUpload.uploadStart=function(file){return true};SWFUpload.uploadProgress=function(file,bytes_complete,bytes_total){this.debug("File Progress: "+file.id+", Bytes: "+bytes_complete+". Total: "+bytes_total)};SWFUpload.uploadSuccess=function(file,server_data){};SWFUpload.uploadComplete=function(file){};SWFUpload.debug=function(message){if(this.getSetting("debug_enabled")){this.debugMessage(message)}};SWFUpload.uploadError=function(file,error_code,message){try{switch(errcode){case SWFUpload.UPLOAD_ERROR.SPECIFIED_FILE_ID_NOT_FOUND:this.debug("Error Code: File ID specified for upload was not found, Message: "+msg);break;case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:this.debug("Error Code: HTTP Error, File name: "+file.name+", Message: "+msg);break;case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL:this.debug("Error Code: No backend file, File name: "+file.name+", Message: "+msg);break;case SWFUpload.UPLOAD_ERROR.IO_ERROR:this.debug("Error Code: IO Error, File name: "+file.name+", Message: "+msg);break;case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:this.debug("Error Code: Security Error, File name: "+file.name+", Message: "+msg);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:this.debug("Error Code: Upload limit reached, File name: "+file.name+", File size: "+file.size+", Message: "+msg);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:this.debug("Error Code: Upload Initialization exception, File name: "+file.name+", File size: "+file.size+", Message: "+msg);break;case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:this.debug("Error Code: uploadStart callback returned false, File name: "+file.name+", File size: "+file.size+", Message: "+msg);break;case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:this.debug("Error Code: The file upload was cancelled, File name: "+file.name+", File size: "+file.size+", Message: "+msg);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:this.debug("Error Code: The file upload was stopped, File name: "+file.name+", File size: "+file.size+", Message: "+msg);break;default:this.debug("Error Code: Unhandled error occured. Errorcode: "+errcode)}}catch(ex){this.debug(ex)}};SWFUpload.prototype.debugMessage=function(message){var exception_message,exception_values;if(typeof (message)==="object"&&typeof (message.name)==="string"&&typeof (message.message)==="string"){exception_message="";exception_values=[];for(var key in message){exception_values.push(key+": "+message[key])}exception_message=exception_values.join("\n");exception_values=exception_message.split("\n");exception_message="EXCEPTION: "+exception_values.join("\nEXCEPTION: ");SWFUpload.Console.writeLine(exception_message)}else{SWFUpload.Console.writeLine(message)}};SWFUpload.Console={};SWFUpload.Console.writeLine=function(message){console.log(message)};Ext.namespace("Ext.ux");Ext.ux.SwfUploadPanel=function(config){if(!config.single_select){config.single_select=false}if(!config.file_types){config.file_types="*.*"}if(!config.file_types_description){config.file_types_description="All Files"}if(!config.file_size_limit){config.file_size_limit="102400"}if(!config.file_upload_limit){config.file_upload_limit="0"}if(!config.file_post_name){config.file_post_name="Filedata"}if(!config.flash_url){config.flash_url="swfupload_f9.swf"}if(!config.debug){config.debug=false}this.rec=Ext.data.Record.create([{name:"name"},{name:"size"},{name:"id"},{name:"type"},{name:"creationdate",type:"date",dateFormat:"m/d/Y"},{name:"status"},{name:"note"}]);var store=new Ext.data.Store({reader:new Ext.data.JsonReader({id:"id"},this.rec)});this.suo=new SWFUpload({upload_url:config.upload_url,post_params:config.post_params,file_post_name:config.file_post_name,file_size_limit:config.file_size_limit,file_types:config.file_types,file_types_description:config.file_types_description,file_upload_limit:config.file_upload_limit,flash_url:config.flash_url,file_queued_handler:this.fileQueue.createDelegate(this),file_queue_error_handler:this.fileQueueError.createDelegate(this),file_dialog_complete_handler:this.fileDialogComplete.createDelegate(this),upload_error_handler:this.uploadError.createDelegate(this),upload_progress_handler:this.uploadProgress.createDelegate(this),upload_complete_handler:this.uploadComplete.createDelegate(this),upload_success_handler:this.fileComplete.createDelegate(this),upload_error_handler:this.fileCancelled.createDelegate(this),swfupload_loaded_handler:this.swfUploadLoaded.createDelegate(this),debug:config.debug});this.progress_bar=new Ext.ProgressBar({text:"Progress Bar"});var cm=new Ext.grid.ColumnModel([{id:"name",header:"Filename",width:150,dataIndex:"name"},{id:"size",header:"Size",width:80,dataIndex:"size",renderer:this.formatBytes},{id:"status",header:"Status",width:80,dataIndex:"status",renderer:this.formatStatus},{id:"note",header:"Note",dataIndex:"note"}]);config=config||{};config=Ext.apply(config||{},{store:store,cm:cm,autoExpandColumn:"note",enableColumnResize:true,enableColumnMove:false,sm:new Ext.grid.RowSelectionModel({singleSelect:config.single_select}),tbar:[{text:"Add File(s)",iconCls:"SwfUploadPanel_iconAdd",scope:this,handler:function(){if(config.single_file_select){this.suo.selectFile()}else{this.suo.selectFiles()}}},"->",{text:"Cancel Upload",id:"cancel",iconCls:"SwfUploadPanel_iconCancel",handler:this.stopUpload.createDelegate(this),hidden:true},{text:"Upload File(s)",iconCls:"SwfUploadPanel_iconUpload",handler:this.uploadFiles.createDelegate(this),hidden:true}],bbar:[this.progress_bar],listeners:{keydown:function(e){function removeRows(grid){var selRecords=grid.getSelections();for(var i=0;i<selRecords.length;i++){if(selRecords[i].data.status!=1){grid.suo.cancelUpload(selRecords[i].id);grid.store.remove(selRecords[i])}}if(grid.suo.getStats().files_queued==0){grid.getTopToolbar().items.get(3).setVisible(false)}}if(config.confirm_delete){if(e.getKey()==e.DELETE){Ext.MessageBox.confirm("Remove File","Are you sure you wish to remove this file from queue?",function(e){if(e=="yes"){removeRows(this)}})}}else{if(e.getKey()==e.DELETE){removeRows(this)}}},contextmenu:function(e){e.stopEvent()}}});cm.defaultSortable=false;Ext.ux.SwfUploadPanel.superclass.constructor.apply(this,arguments);try{this.progress_bar.setWidth(this.bbar.getWidth()-5);Ext.fly(this.progress_bar.el.dom.firstChild.firstChild).applyStyles("height: 16px")}catch(ex1){}this.on("resize",function(){this.progress_bar.setWidth(this.bbar.getWidth()-5);Ext.fly(this.progress_bar.el.dom.firstChild.firstChild).applyStyles("height: 16px")})};Ext.extend(Ext.ux.SwfUploadPanel,Ext.grid.GridPanel,{formatStatus:function(status){switch(status){case 0:return("Ready");case 1:return("Uploading...");case 2:return("Completed");case 3:return("Error");case 4:return("Cancelled")}},formatBytes:function(bytes){if(isNaN(bytes)){return("")}var unit,val;if(bytes<999){unit="B";val=(!bytes&&this.progressRequestCount>=1)?"~":bytes}else{if(bytes<999999){unit="kB";val=Math.round(bytes/1000)}else{if(bytes<999999999){unit="MB";val=Math.round(bytes/100000)/10}else{if(bytes<999999999999){unit="GB";val=Math.round(bytes/100000000)/10}else{unit="TB";val=Math.round(bytes/100000000000)/10}}}}return(val+" "+unit)},uploadError:function(file,error,code){switch(error){case -200:Ext.MessageBox.alert("Error","File not found 404.");break;case -230:Ext.MessageBox.alert("Error","Security Error. Not allowed to post to different url.");break}},fileQueue:function(file){file.status=0;r=new this.rec(file);r.id=file.id;this.store.add(r);this.fireEvent("fileQueued",this,file)},fileQueueError:function(a,code,queue_remaining){switch(code){case -100:Ext.MessageBox.alert("Error","The selected files you wish to add exceedes the remaining allowed files in the queue. There are "+queue_remaining+" remaining slots.");break}},fileComplete:function(file,result){var o=Ext.decode(result);this.fireEvent("fileUploadComplete",this,file,o);if("success" in o&&o.success){this.store.getById(file.id).set("status",2);this.store.getById(file.id).set("note",o.message||o.error);this.store.getById(file.id).commit()}else{this.store.getById(file.id).set("status",3);this.store.getById(file.id).set("note",o.message||o.error);this.store.getById(file.id).commit()}if(this.suo.getStats().files_queued>0){this.uploadFiles()}else{this.getTopToolbar().items.get(2).setVisible(false);this.getTopToolbar().items.get(3).setVisible(false);this.fireEvent("queueUploadComplete",this)}},fileDialogComplete:function(file_count){if(file_count>0){this.getTopToolbar().items.get(3).setVisible(true)}},uploadProgress:function(file,current_size,total_size){this.store.getById(file.id).set("status",1);this.store.getById(file.id).commit();this.progress_bar.updateProgress(current_size/total_size,"Uploading file: "+file.name+" ("+this.formatBytes(current_size)+" of "+this.formatBytes(total_size)+")")},uploadComplete:function(file,result){if(this.cancelled){this.cancelled=false}else{this.progress_bar.reset();this.progress_bar.updateText("Progress Bar");if(this.remove_completed){this.store.remove(this.store.getById(file.id))}}},uploadFiles:function(){this.getTopToolbar().items.get(2).setVisible(true);this.suo.startUpload()},addPostParam:function(name,value){this.suo.settings.post_params[name]=value;this.suo.setPostParams(this.suo.settings.post_params)},stopUpload:function(cancel_btn){this.suo.stopUpload();this.getStore().each(function(){if(this.data.status==1){this.set("status",0);this.commit()}});this.getTopToolbar().items.get(2).setVisible(false);this.progress_bar.reset();this.progress_bar.updateText("Progress Bar")},fileCancelled:function(file,code,b,c,d){if(code==-280){return }this.store.getById(file.id).set("status",4);this.store.getById(file.id).commit();this.progress_bar.reset();this.progress_bar.updateText("Progress Bar");if(this.suo.getStats().files_queued>0){this.getTopToolbar().items.get(2).setVisible(false)}else{this.getTopToolbar().items.get(2).setVisible(false);this.getTopToolbar().items.get(3).setVisible(false)}this.cancelled=true},swfUploadLoaded:function(){this.fireEvent("swfUploadLoaded",this)}});Ext.namespace("Ext.ux.Utils");Ext.ux.Utils.EventQueue=function(handler,scope){if(!handler){throw"Handler is required."}this.handler=handler;this.scope=scope||window;this.queue=[];this.is_processing=false;this.postEvent=function(event,data){data=data||null;this.queue.push({event:event,data:data});if(!this.is_processing){this.process()}};this.flushEventQueue=function(){this.queue=[]},this.process=function(){while(this.queue.length>0){this.is_processing=true;var event_data=this.queue.shift();this.handler.call(this.scope,event_data.event,event_data.data)}this.is_processing=false}};Ext.ux.Utils.FSA=function(initial_state,trans_table,trans_table_scope){this.current_state=initial_state;this.trans_table=trans_table||{};this.trans_table_scope=trans_table_scope||window;Ext.ux.Utils.FSA.superclass.constructor.call(this,this.processEvent,this)};Ext.extend(Ext.ux.Utils.FSA,Ext.ux.Utils.EventQueue,{current_state:null,trans_table:null,trans_table_scope:null,state:function(){return this.current_state},processEvent:function(event,data){var transitions=this.currentStateEventTransitions(event);if(!transitions){throw"State '"+this.current_state+"' has no transition for event '"+event+"'."}for(var i=0,len=transitions.length;i<len;i++){var transition=transitions[i];var predicate=transition.predicate||transition.p||true;var action=transition.action||transition.a||Ext.emptyFn;var new_state=transition.state||transition.s||this.current_state;var scope=transition.scope||this.trans_table_scope;if(this.computePredicate(predicate,scope,data,event)){this.callAction(action,scope,data,event);this.current_state=new_state;return }}throw"State '"+this.current_state+"' has no transition for event '"+event+"' in current context"},currentStateEventTransitions:function(event){return this.trans_table[this.current_state]?this.trans_table[this.current_state][event]||false:false},computePredicate:function(predicate,scope,data,event){var result=false;switch(Ext.type(predicate)){case"function":result=predicate.call(scope,data,event,this);break;case"array":result=true;for(var i=0,len=predicate.length;result&&(i<len);i++){if(Ext.type(predicate[i])=="function"){result=predicate[i].call(scope,data,event,this)}else{throw ["Predicate: ",predicate[i],' is not callable in "',this.current_state,'" state for event "',event].join("")}}break;case"boolean":result=predicate;break;default:throw ["Predicate: ",predicate,' is not callable in "',this.current_state,'" state for event "',event].join("")}return result},callAction:function(action,scope,data,event){switch(Ext.type(action)){case"array":for(var i=0,len=action.length;i<len;i++){if(Ext.type(action[i])=="function"){action[i].call(scope,data,event,this)}else{throw ["Action: ",action[i],' is not callable in "',this.current_state,'" state for event "',event].join("")}}break;case"function":action.call(scope,data,event,this);break;default:throw ["Action: ",action,' is not callable in "',this.current_state,'" state for event "',event].join("")}}});Ext.namespace("Ext.ux.UploadDialog");Ext.ux.UploadDialog.BrowseButton=Ext.extend(Ext.Button,{input_name:"file",input_file:null,original_handler:null,original_scope:null,initComponent:function(){Ext.ux.UploadDialog.BrowseButton.superclass.initComponent.call(this);this.original_handler=this.handler||null;this.original_scope=this.scope||window;this.handler=null;this.scope=null},onRender:function(ct,position){Ext.ux.UploadDialog.BrowseButton.superclass.onRender.call(this,ct,position);this.createInputFile()},createInputFile:function(){var button_container=this.el.child(".x-btn-center");button_container.position("relative");this.input_file=Ext.DomHelper.append(button_container,{tag:"input",type:"file",size:1,name:this.input_name||Ext.id(this.el),style:"position: absolute; display: block; border: none; cursor: pointer"},true);var button_box=button_container.getBox();this.input_file.setStyle("font-size",(button_box.width*0.5)+"px");var input_box=this.input_file.getBox();var adj={x:3,y:3};if(Ext.isIE){adj={x:0,y:3}}this.input_file.setLeft(button_box.width-input_box.width+adj.x+"px");this.input_file.setTop(button_box.height-input_box.height+adj.y+"px");this.input_file.setOpacity(0);if(this.handleMouseEvents){this.input_file.on("mouseover",this.onMouseOver,this);this.input_file.on("mousedown",this.onMouseDown,this)}if(this.tooltip){if(typeof this.tooltip=="object"){Ext.QuickTips.register(Ext.apply({target:this.input_file},this.tooltip))}else{this.input_file.dom[this.tooltipType]=this.tooltip}}this.input_file.on("change",this.onInputFileChange,this);this.input_file.on("click",function(e){e.stopPropagation()})},detachInputFile:function(no_create){var result=this.input_file;no_create=no_create||false;if(typeof this.tooltip=="object"){Ext.QuickTips.unregister(this.input_file)}else{this.input_file.dom[this.tooltipType]=null}this.input_file.removeAllListeners();this.input_file=null;if(!no_create){this.createInputFile()}return result},getInputFile:function(){return this.input_file},disable:function(){Ext.ux.UploadDialog.BrowseButton.superclass.disable.call(this);this.input_file.dom.disabled=true},enable:function(){Ext.ux.UploadDialog.BrowseButton.superclass.enable.call(this);this.input_file.dom.disabled=false},destroy:function(){var input_file=this.detachInputFile(true);input_file.remove();input_file=null;Ext.ux.UploadDialog.BrowseButton.superclass.destroy.call(this)},onInputFileChange:function(){if(this.original_handler){this.original_handler.call(this.original_scope,this)}}});Ext.ux.UploadDialog.TBBrowseButton=Ext.extend(Ext.ux.UploadDialog.BrowseButton,{hideParent:true,onDestroy:function(){Ext.ux.UploadDialog.TBBrowseButton.superclass.onDestroy.call(this);if(this.container){this.container.remove()}}});Ext.ux.UploadDialog.FileRecord=Ext.data.Record.create([{name:"filename"},{name:"state",type:"int"},{name:"note"},{name:"input_element"}]);Ext.ux.UploadDialog.FileRecord.STATE_QUEUE=0;Ext.ux.UploadDialog.FileRecord.STATE_FINISHED=1;Ext.ux.UploadDialog.FileRecord.STATE_FAILED=2;Ext.ux.UploadDialog.FileRecord.STATE_PROCESSING=3;Ext.ux.UploadDialog.Dialog=function(config){var default_config={border:false,width:450,height:300,minWidth:450,minHeight:300,plain:true,constrainHeader:true,draggable:true,closable:true,maximizable:false,minimizable:false,resizable:true,autoDestroy:true,closeAction:"hide",title:this.i18n.title,cls:"ext-ux-uploaddialog-dialog",url:"",base_params:{},permitted_extensions:[],reset_on_hide:true,allow_close_on_upload:false,upload_autostart:false,post_var_name:"file"};config=Ext.applyIf(config||{},default_config);config.layout="absolute";Ext.ux.UploadDialog.Dialog.superclass.constructor.call(this,config)};Ext.extend(Ext.ux.UploadDialog.Dialog,Ext.Window,{fsa:null,state_tpl:null,form:null,grid_panel:null,progress_bar:null,is_uploading:false,initial_queued_count:0,upload_frame:null,initComponent:function(){Ext.ux.UploadDialog.Dialog.superclass.initComponent.call(this);var tt={created:{"window-render":[{action:[this.createForm,this.createProgressBar,this.createGrid],state:"rendering"}],destroy:[{action:this.flushEventQueue,state:"destroyed"}]},rendering:{"grid-render":[{action:[this.fillToolbar,this.updateToolbar],state:"ready"}],destroy:[{action:this.flushEventQueue,state:"destroyed"}]},ready:{"file-selected":[{predicate:[this.fireFileTestEvent,this.isPermittedFile],action:this.addFileToUploadQueue,state:"adding-file"},{}],"grid-selection-change":[{action:this.updateToolbar}],"remove-files":[{action:[this.removeFiles,this.fireFileRemoveEvent]}],"reset-queue":[{action:[this.resetQueue,this.fireResetQueueEvent]}],"start-upload":[{predicate:this.hasUnuploadedFiles,action:[this.setUploadingFlag,this.saveInitialQueuedCount,this.updateToolbar,this.updateProgressBar,this.prepareNextUploadTask,this.fireUploadStartEvent],state:"uploading"},{}],"stop-upload":[{}],hide:[{predicate:[this.isNotEmptyQueue,this.getResetOnHide],action:[this.resetQueue,this.fireResetQueueEvent]},{}],destroy:[{action:this.flushEventQueue,state:"destroyed"}]},"adding-file":{"file-added":[{predicate:this.isUploading,action:[this.incInitialQueuedCount,this.updateProgressBar,this.fireFileAddEvent],state:"uploading"},{predicate:this.getUploadAutostart,action:[this.startUpload,this.fireFileAddEvent],state:"ready"},{action:[this.updateToolbar,this.fireFileAddEvent],state:"ready"}]},uploading:{"file-selected":[{predicate:[this.fireFileTestEvent,this.isPermittedFile],action:this.addFileToUploadQueue,state:"adding-file"},{}],"grid-selection-change":[{}],"start-upload":[{}],"stop-upload":[{predicate:this.hasUnuploadedFiles,action:[this.resetUploadingFlag,this.abortUpload,this.updateToolbar,this.updateProgressBar,this.fireUploadStopEvent],state:"ready"},{action:[this.resetUploadingFlag,this.abortUpload,this.updateToolbar,this.updateProgressBar,this.fireUploadStopEvent,this.fireUploadCompleteEvent],state:"ready"}],"file-upload-start":[{action:[this.uploadFile,this.findUploadFrame,this.fireFileUploadStartEvent]}],"file-upload-success":[{predicate:this.hasUnuploadedFiles,action:[this.resetUploadFrame,this.updateRecordState,this.updateProgressBar,this.prepareNextUploadTask,this.fireUploadSuccessEvent]},{action:[this.resetUploadFrame,this.resetUploadingFlag,this.updateRecordState,this.updateToolbar,this.updateProgressBar,this.fireUploadSuccessEvent,this.fireUploadCompleteEvent],state:"ready"}],"file-upload-error":[{predicate:this.hasUnuploadedFiles,action:[this.resetUploadFrame,this.updateRecordState,this.updateProgressBar,this.prepareNextUploadTask,this.fireUploadErrorEvent]},{action:[this.resetUploadFrame,this.resetUploadingFlag,this.updateRecordState,this.updateToolbar,this.updateProgressBar,this.fireUploadErrorEvent,this.fireUploadCompleteEvent],state:"ready"}],"file-upload-failed":[{predicate:this.hasUnuploadedFiles,action:[this.resetUploadFrame,this.updateRecordState,this.updateProgressBar,this.prepareNextUploadTask,this.fireUploadFailedEvent]},{action:[this.resetUploadFrame,this.resetUploadingFlag,this.updateRecordState,this.updateToolbar,this.updateProgressBar,this.fireUploadFailedEvent,this.fireUploadCompleteEvent],state:"ready"}],hide:[{predicate:this.getResetOnHide,action:[this.stopUpload,this.repostHide]},{}],destroy:[{predicate:this.hasUnuploadedFiles,action:[this.resetUploadingFlag,this.abortUpload,this.fireUploadStopEvent,this.flushEventQueue],state:"destroyed"},{action:[this.resetUploadingFlag,this.abortUpload,this.fireUploadStopEvent,this.fireUploadCompleteEvent,this.flushEventQueue],state:"destroyed"}]},destroyed:{}};this.fsa=new Ext.ux.Utils.FSA("created",tt,this);this.addEvents({filetest:true,fileadd:true,fileremove:true,resetqueue:true,uploadsuccess:true,uploaderror:true,uploadfailed:true,uploadstart:true,uploadstop:true,uploadcomplete:true,fileuploadstart:true});this.on("render",this.onWindowRender,this);this.on("beforehide",this.onWindowBeforeHide,this);this.on("hide",this.onWindowHide,this);this.on("destroy",this.onWindowDestroy,this);this.state_tpl=new Ext.Template("<div class='ext-ux-uploaddialog-state ext-ux-uploaddialog-state-{state}'> </div>").compile()},createForm:function(){this.form=Ext.DomHelper.append(this.body,{tag:"form",method:"post",action:this.url,style:"position: absolute; left: -100px; top: -100px; width: 100px; height: 100px"})},createProgressBar:function(){this.progress_bar=this.add(new Ext.ProgressBar({x:0,y:0,anchor:"0",value:0,text:this.i18n.progress_waiting_text}))},createGrid:function(){var store=new Ext.data.Store({proxy:new Ext.data.MemoryProxy([]),reader:new Ext.data.JsonReader({},Ext.ux.UploadDialog.FileRecord),sortInfo:{field:"state",direction:"DESC"},pruneModifiedRecords:true});var cm=new Ext.grid.ColumnModel([{header:this.i18n.state_col_title,width:this.i18n.state_col_width,resizable:false,dataIndex:"state",sortable:true,renderer:this.renderStateCell.createDelegate(this)},{header:this.i18n.filename_col_title,width:this.i18n.filename_col_width,dataIndex:"filename",sortable:true,renderer:this.renderFilenameCell.createDelegate(this)},{header:this.i18n.note_col_title,width:this.i18n.note_col_width,dataIndex:"note",sortable:true,renderer:this.renderNoteCell.createDelegate(this)}]);this.grid_panel=new Ext.grid.GridPanel({ds:store,cm:cm,x:0,y:22,anchor:"0 -22",border:true,viewConfig:{autoFill:true,forceFit:true},bbar:new Ext.Toolbar()});this.grid_panel.on("render",this.onGridRender,this);this.add(this.grid_panel);this.grid_panel.getSelectionModel().on("selectionchange",this.onGridSelectionChange,this)},fillToolbar:function(){var tb=this.grid_panel.getBottomToolbar();tb.x_buttons={};tb.x_buttons.add=tb.addItem(new Ext.ux.UploadDialog.TBBrowseButton({input_name:this.post_var_name,text:this.i18n.add_btn_text,tooltip:this.i18n.add_btn_tip,iconCls:"ext-ux-uploaddialog-addbtn",handler:this.onAddButtonFileSelected,scope:this}));tb.x_buttons.remove=tb.addButton({text:this.i18n.remove_btn_text,tooltip:this.i18n.remove_btn_tip,iconCls:"ext-ux-uploaddialog-removebtn",handler:this.onRemoveButtonClick,scope:this});tb.x_buttons.reset=tb.addButton({text:this.i18n.reset_btn_text,tooltip:this.i18n.reset_btn_tip,iconCls:"ext-ux-uploaddialog-resetbtn",handler:this.onResetButtonClick,scope:this});tb.add("-");tb.x_buttons.upload=tb.addButton({text:this.i18n.upload_btn_start_text,tooltip:this.i18n.upload_btn_start_tip,iconCls:"ext-ux-uploaddialog-uploadstartbtn",handler:this.onUploadButtonClick,scope:this});tb.add("-");tb.x_buttons.indicator=tb.addItem(new Ext.Toolbar.Item(Ext.DomHelper.append(tb.getEl(),{tag:"div",cls:"ext-ux-uploaddialog-indicator-stoped",html:" "})));tb.add("->");tb.x_buttons.close=tb.addButton({text:this.i18n.close_btn_text,tooltip:this.i18n.close_btn_tip,handler:this.onCloseButtonClick,scope:this})},renderStateCell:function(data,cell,record,row_index,column_index,store){return this.state_tpl.apply({state:data})},renderFilenameCell:function(data,cell,record,row_index,column_index,store){var view=this.grid_panel.getView();var f=function(){try{Ext.fly(view.getCell(row_index,column_index)).child(".x-grid3-cell-inner").dom.qtip=data}catch(e){}};f.defer(1000);return data},renderNoteCell:function(data,cell,record,row_index,column_index,store){var view=this.grid_panel.getView();var f=function(){try{Ext.fly(view.getCell(row_index,column_index)).child(".x-grid3-cell-inner").dom.qtip=data}catch(e){}};f.defer(1000);return data},getFileExtension:function(filename){var result=null;var parts=filename.split(".");if(parts.length>1){result=parts.pop()}return result},isPermittedFileType:function(filename){var result=true;if(this.permitted_extensions.length>0){result=this.permitted_extensions.indexOf(this.getFileExtension(filename))!=-1}return result},isPermittedFile:function(browse_btn){var result=false;var filename=browse_btn.getInputFile().dom.value;if(this.isPermittedFileType(filename)){result=true}else{Ext.Msg.alert(this.i18n.error_msgbox_title,String.format(this.i18n.err_file_type_not_permitted,filename,this.permitted_extensions.join(this.i18n.permitted_extensions_join_str)));result=false}return result},fireFileTestEvent:function(browse_btn){return this.fireEvent("filetest",this,browse_btn.getInputFile().dom.value)!==false},addFileToUploadQueue:function(browse_btn){var input_file=browse_btn.detachInputFile();input_file.appendTo(this.form);input_file.setStyle("width","100px");input_file.dom.disabled=true;var store=this.grid_panel.getStore();store.add(new Ext.ux.UploadDialog.FileRecord({state:Ext.ux.UploadDialog.FileRecord.STATE_QUEUE,filename:input_file.dom.value,note:this.i18n.note_queued_to_upload,input_element:input_file}));this.fsa.postEvent("file-added",input_file.dom.value)},fireFileAddEvent:function(filename){this.fireEvent("fileadd",this,filename)},updateProgressBar:function(){if(this.is_uploading){var queued=this.getQueuedCount(true);var value=1-queued/this.initial_queued_count;this.progress_bar.updateProgress(value,String.format(this.i18n.progress_uploading_text,this.initial_queued_count-queued,this.initial_queued_count))}else{this.progress_bar.updateProgress(0,this.i18n.progress_waiting_text)}},updateToolbar:function(){var tb=this.grid_panel.getBottomToolbar();if(this.is_uploading){tb.x_buttons.remove.disable();tb.x_buttons.reset.disable();tb.x_buttons.upload.enable();if(!this.getAllowCloseOnUpload()){tb.x_buttons.close.disable()}Ext.fly(tb.x_buttons.indicator.getEl()).replaceClass("ext-ux-uploaddialog-indicator-stoped","ext-ux-uploaddialog-indicator-processing");tb.x_buttons.upload.setIconClass("ext-ux-uploaddialog-uploadstopbtn");tb.x_buttons.upload.setText(this.i18n.upload_btn_stop_text);tb.x_buttons.upload.getEl().child(tb.x_buttons.upload.buttonSelector).dom[tb.x_buttons.upload.tooltipType]=this.i18n.upload_btn_stop_tip}else{tb.x_buttons.remove.enable();tb.x_buttons.reset.enable();tb.x_buttons.close.enable();Ext.fly(tb.x_buttons.indicator.getEl()).replaceClass("ext-ux-uploaddialog-indicator-processing","ext-ux-uploaddialog-indicator-stoped");tb.x_buttons.upload.setIconClass("ext-ux-uploaddialog-uploadstartbtn");tb.x_buttons.upload.setText(this.i18n.upload_btn_start_text);tb.x_buttons.upload.getEl().child(tb.x_buttons.upload.buttonSelector).dom[tb.x_buttons.upload.tooltipType]=this.i18n.upload_btn_start_tip;if(this.getQueuedCount()>0){tb.x_buttons.upload.enable()}else{tb.x_buttons.upload.disable()}if(this.grid_panel.getSelectionModel().hasSelection()){tb.x_buttons.remove.enable()}else{tb.x_buttons.remove.disable()}if(this.grid_panel.getStore().getCount()>0){tb.x_buttons.reset.enable()}else{tb.x_buttons.reset.disable()}}},saveInitialQueuedCount:function(){this.initial_queued_count=this.getQueuedCount()},incInitialQueuedCount:function(){this.initial_queued_count++},setUploadingFlag:function(){this.is_uploading=true},resetUploadingFlag:function(){this.is_uploading=false},prepareNextUploadTask:function(){var store=this.grid_panel.getStore();var record=null;store.each(function(r){if(!record&&r.get("state")==Ext.ux.UploadDialog.FileRecord.STATE_QUEUE){record=r}else{r.get("input_element").dom.disabled=true}});record.get("input_element").dom.disabled=false;record.set("state",Ext.ux.UploadDialog.FileRecord.STATE_PROCESSING);record.set("note",this.i18n.note_processing);record.commit();this.fsa.postEvent("file-upload-start",record)},fireUploadStartEvent:function(){this.fireEvent("uploadstart",this)},removeFiles:function(file_records){var store=this.grid_panel.getStore();for(var i=0,len=file_records.length;i<len;i++){var r=file_records[i];r.get("input_element").remove();store.remove(r)}},fireFileRemoveEvent:function(file_records){for(var i=0,len=file_records.length;i<len;i++){this.fireEvent("fileremove",this,file_records[i].get("filename"))}},resetQueue:function(){var store=this.grid_panel.getStore();store.each(function(r){r.get("input_element").remove()});store.removeAll()},fireResetQueueEvent:function(){this.fireEvent("resetqueue",this)},uploadFile:function(record){Ext.Ajax.request({url:this.url,params:this.base_params||this.baseParams||this.params,method:"POST",form:this.form,isUpload:true,success:this.onAjaxSuccess,failure:this.onAjaxFailure,scope:this,record:record})},fireFileUploadStartEvent:function(record){this.fireEvent("fileuploadstart",this,record.get("filename"))},updateRecordState:function(data){if("success" in data.response&&data.response.success){data.record.set("state",Ext.ux.UploadDialog.FileRecord.STATE_FINISHED);data.record.set("note",data.response.message||data.response.error||this.i18n.note_upload_success)}else{data.record.set("state",Ext.ux.UploadDialog.FileRecord.STATE_FAILED);data.record.set("note",data.response.message||data.response.error||this.i18n.note_upload_error)}data.record.commit()},fireUploadSuccessEvent:function(data){this.fireEvent("uploadsuccess",this,data.record.get("filename"),data.response)},fireUploadErrorEvent:function(data){this.fireEvent("uploaderror",this,data.record.get("filename"),data.response)},fireUploadFailedEvent:function(data){this.fireEvent("uploadfailed",this,data.record.get("filename"))},fireUploadCompleteEvent:function(){this.fireEvent("uploadcomplete",this)},findUploadFrame:function(){this.upload_frame=Ext.getBody().child("iframe.x-hidden:last")},resetUploadFrame:function(){this.upload_frame=null},removeUploadFrame:function(){if(this.upload_frame){this.upload_frame.removeAllListeners();this.upload_frame.dom.src="about:blank";this.upload_frame.remove()}this.upload_frame=null},abortUpload:function(){this.removeUploadFrame();var store=this.grid_panel.getStore();var record=null;store.each(function(r){if(r.get("state")==Ext.ux.UploadDialog.FileRecord.STATE_PROCESSING){record=r;return false}});record.set("state",Ext.ux.UploadDialog.FileRecord.STATE_FAILED);record.set("note",this.i18n.note_aborted);record.commit()},fireUploadStopEvent:function(){this.fireEvent("uploadstop",this)},repostHide:function(){this.fsa.postEvent("hide")},flushEventQueue:function(){this.fsa.flushEventQueue()},onWindowRender:function(){this.fsa.postEvent("window-render")},onWindowBeforeHide:function(){return this.isUploading()?this.getAllowCloseOnUpload():true},onWindowHide:function(){this.fsa.postEvent("hide")},onWindowDestroy:function(){this.fsa.postEvent("destroy")},onGridRender:function(){this.fsa.postEvent("grid-render")},onGridSelectionChange:function(){this.fsa.postEvent("grid-selection-change")},onAddButtonFileSelected:function(btn){this.fsa.postEvent("file-selected",btn)},onUploadButtonClick:function(){if(this.is_uploading){this.fsa.postEvent("stop-upload")}else{this.fsa.postEvent("start-upload")}},onRemoveButtonClick:function(){var selections=this.grid_panel.getSelectionModel().getSelections();this.fsa.postEvent("remove-files",selections)},onResetButtonClick:function(){this.fsa.postEvent("reset-queue")},onCloseButtonClick:function(){this[this.closeAction].call(this)},onAjaxSuccess:function(response,options){var json_response={success:false,error:this.i18n.note_upload_error};try{var rt=response.responseText;var filter=rt.match(/^<[^>]+>((?:.|\n)*)<\/[^>]+>$/);if(filter){rt=filter[1]}json_response=Ext.util.JSON.decode(rt)}catch(e){}var data={record:options.record,response:json_response};if("success" in json_response&&json_response.success){this.fsa.postEvent("file-upload-success",data)}else{this.fsa.postEvent("file-upload-error",data)}},onAjaxFailure:function(response,options){var data={record:options.record,response:{success:false,error:this.i18n.note_upload_failed}};this.fsa.postEvent("file-upload-failed",data)},startUpload:function(){this.fsa.postEvent("start-upload")},stopUpload:function(){this.fsa.postEvent("stop-upload")},getUrl:function(){return this.url},setUrl:function(url){this.url=url},getBaseParams:function(){return this.base_params},setBaseParams:function(params){this.base_params=params},getUploadAutostart:function(){return this.upload_autostart},setUploadAutostart:function(value){this.upload_autostart=value},getAllowCloseOnUpload:function(){return this.allow_close_on_upload},setAllowCloseOnUpload:function(value){this.allow_close_on_upload},getResetOnHide:function(){return this.reset_on_hide},setResetOnHide:function(value){this.reset_on_hide=value},getPermittedExtensions:function(){return this.permitted_extensions},setPermittedExtensions:function(value){this.permitted_extensions=value},isUploading:function(){return this.is_uploading},isNotEmptyQueue:function(){return this.grid_panel.getStore().getCount()>0},getQueuedCount:function(count_processing){var count=0;var store=this.grid_panel.getStore();store.each(function(r){if(r.get("state")==Ext.ux.UploadDialog.FileRecord.STATE_QUEUE){count++}if(count_processing&&r.get("state")==Ext.ux.UploadDialog.FileRecord.STATE_PROCESSING){count++}});return count},hasUnuploadedFiles:function(){return this.getQueuedCount()>0}});var p=Ext.ux.UploadDialog.Dialog.prototype;p.i18n={title:"File upload dialog",state_col_title:"State",state_col_width:70,filename_col_title:"Filename",filename_col_width:230,note_col_title:"Note",note_col_width:150,add_btn_text:"Add",add_btn_tip:"Add file into upload queue.",remove_btn_text:"Remove",remove_btn_tip:"Remove file from upload queue.",reset_btn_text:"Reset",reset_btn_tip:"Reset queue.",upload_btn_start_text:"Upload",upload_btn_stop_text:"Abort",upload_btn_start_tip:"Upload queued files to the server.",upload_btn_stop_tip:"Stop upload.",close_btn_text:"Close",close_btn_tip:"Close the dialog.",progress_waiting_text:"Waiting...",progress_uploading_text:"Uploading: {0} of {1} files complete.",error_msgbox_title:"Error",permitted_extensions_join_str:",",err_file_type_not_permitted:"Selected file extension isn't permitted.<br/>Please select files with following extensions: {1}",note_queued_to_upload:"Queued for upload.",note_processing:"Uploading...",note_upload_failed:"Server is unavailable or internal server error occured.",note_upload_success:"OK.",note_upload_error:"Upload error.",note_aborted:"Aborted by user."};
\ No newline at end of file
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-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-09-09 18:00:21 UTC (rev 865)
@@ -30,6 +30,7 @@
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.ToolSelector;
+import org.ourproject.kune.platf.client.ui.dialogs.FileUploader;
import org.ourproject.kune.platf.client.ui.rate.RateIt;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
import org.ourproject.kune.workspace.client.editor.TextEditor;
@@ -58,7 +59,7 @@
public DocumentClientTool create() {
return new DocumentClientTool(i18n, $(ToolSelector.class), $(WsThemePresenter.class),
$(WorkspaceSkeleton.class), $$(DocumentContext.class), $(ContextNavigator.class),
- $(Session.class), $(StateManager.class), $$(ContentServiceAsync.class));
+ $(Session.class), $(StateManager.class), $$(ContentServiceAsync.class), $$(FileUploader.class));
}
});
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-09-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-09-09 18:00:21 UTC (rev 865)
@@ -32,6 +32,7 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.AbstractClientTool;
import org.ourproject.kune.platf.client.tool.ToolSelector;
+import org.ourproject.kune.platf.client.ui.dialogs.FileUploader;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.site.Site;
@@ -44,20 +45,28 @@
public class DocumentClientTool extends AbstractClientTool {
public static final String TYPE_ROOT = "docs.root";
public static final String TYPE_FOLDER = "docs.folder";
+ public static final String TYPE_GALLERY = "docs.gallery";
+ public static final String TYPE_BLOG = "docs.blog";
public static final String TYPE_DOCUMENT = "docs.doc";
+ public static final String TYPE_POST = "docs.post";
+ public static final String TYPE_UPLOADEDFILE = "docs.uploaded";
+
public static final String NAME = "docs";
+
private final Provider<DocumentContext> documentContextProvider;
private final ContextNavigator contextNavigator;
private final StateManager stateManager;
private final I18nUITranslationService i18n;
private final Session session;
private final Provider<ContentServiceAsync> contentServiceProvider;
+ private final Provider<FileUploader> fileUploaderProvider;
public DocumentClientTool(final I18nUITranslationService i18n, final ToolSelector toolSelector,
final WsThemePresenter wsThemePresenter, final WorkspaceSkeleton ws,
final Provider<DocumentContext> documentContextProvider, final ContextNavigator contextNavigator,
final Session session, final StateManager stateManager,
- final Provider<ContentServiceAsync> contentServiceProvider) {
+ final Provider<ContentServiceAsync> contentServiceProvider,
+ final Provider<FileUploader> fileUploaderProvider) {
super(NAME, i18n.t("documents"), toolSelector, wsThemePresenter, ws);
this.i18n = i18n;
this.documentContextProvider = documentContextProvider;
@@ -65,8 +74,10 @@
this.session = session;
this.stateManager = stateManager;
this.contentServiceProvider = contentServiceProvider;
+ this.fileUploaderProvider = fileUploaderProvider;
createActions();
registerDragDropTypes();
+ registerImageTypes();
}
public String getName() {
@@ -142,8 +153,7 @@
session.getCurrentState().getGroup().getShortName(), token.getDocument(),
new AsyncCallbackSimple<String>() {
public void onSuccess(final String result) {
- final StateToken parent = token.clone();
- parent.setDocument(null);
+ final StateToken parent = token.clone().setDocument(null);
stateManager.gotoToken(parent);
}
});
@@ -182,16 +192,31 @@
refresh.setIconUrl("images/nav/refresh.png");
refresh.setToolTip(i18n.t("Refresh"));
+ final ActionDescriptor<StateToken> uploadFile = new ActionDescriptor<StateToken>(AccessRolDTO.Editor,
+ ActionPosition.bootombarAndItemMenu, new Slot<StateToken>() {
+ public void onEvent(final StateToken token) {
+ fileUploaderProvider.get().show();
+ }
+ });
+ uploadFile.setTextDescription(i18n.t("Upload file"));
+ uploadFile.setIconUrl("images/nav/upload.png");
+ uploadFile.setToolTip(i18n.t("Upload some files (images, PDFs, etc)"));
+
contextNavigator.addAction(TYPE_FOLDER, go);
contextNavigator.addAction(TYPE_FOLDER, addDoc);
contextNavigator.addAction(TYPE_FOLDER, addFolder);
contextNavigator.addAction(TYPE_FOLDER, delContainer);
contextNavigator.addAction(TYPE_FOLDER, rename);
contextNavigator.addAction(TYPE_FOLDER, refresh);
+ contextNavigator.addAction(TYPE_FOLDER, uploadFile);
+ contextNavigator.addAction(TYPE_BLOG, uploadFile);
+ contextNavigator.addAction(TYPE_GALLERY, uploadFile);
+
contextNavigator.addAction(TYPE_ROOT, addDoc);
contextNavigator.addAction(TYPE_ROOT, addFolder);
contextNavigator.addAction(TYPE_ROOT, refresh);
+ contextNavigator.addAction(TYPE_ROOT, uploadFile);
contextNavigator.addAction(TYPE_DOCUMENT, go);
contextNavigator.addAction(TYPE_DOCUMENT, delContent);
@@ -202,9 +227,18 @@
private void registerDragDropTypes() {
contextNavigator.registerDraggableType(TYPE_DOCUMENT);
contextNavigator.registerDraggableType(TYPE_FOLDER);
+ contextNavigator.registerDraggableType(TYPE_UPLOADEDFILE);
+
contextNavigator.registerDroppableType(TYPE_ROOT);
contextNavigator.registerDroppableType(TYPE_FOLDER);
- contextNavigator.registerDroppableType(TYPE_DOCUMENT);
+ contextNavigator.registerDroppableType(TYPE_GALLERY);
}
+ private void registerImageTypes() {
+ contextNavigator.registerContentTypeIcon(TYPE_BLOG, "images/nav/blog.png");
+ contextNavigator.registerContentTypeIcon(TYPE_GALLERY, "images/nav/gallery.png");
+ contextNavigator.registerContentTypeIcon(TYPE_DOCUMENT, "images/nav/page.png");
+ contextNavigator.registerContentTypeIcon(TYPE_POST, "images/nav/post.png");
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java 2008-09-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java 2008-09-09 18:00:21 UTC (rev 865)
@@ -37,7 +37,12 @@
public class DocumentServerTool implements ServerTool {
public static final String TYPE_ROOT = "docs.root";
public static final String TYPE_FOLDER = "docs.folder";
+ public static final String TYPE_GALLERY = "docs.gallery";
+ public static final String TYPE_BLOG = "docs.blog";
public static final String TYPE_DOCUMENT = "docs.doc";
+ public static final String TYPE_POST = "docs.post";
+ public static final String TYPE_UPLOADEDFILE = "docs.uploaded";
+
public static final String NAME = "docs";
public static final String ROOT_NAME = "documents";
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-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-09-09 18:00:21 UTC (rev 865)
@@ -26,6 +26,8 @@
import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.platf.client.tool.ToolSelectorPresenter;
import org.ourproject.kune.platf.client.ui.QuickTipsHelper;
+import org.ourproject.kune.platf.client.ui.dialogs.FileUploader;
+import org.ourproject.kune.platf.client.ui.dialogs.FileUploaderDialog;
import org.ourproject.kune.platf.client.ui.rate.RateIt;
import org.ourproject.kune.platf.client.ui.rate.RateItPanel;
import org.ourproject.kune.platf.client.ui.rate.RateItPresenter;
@@ -593,6 +595,13 @@
}
});
+ register(SingletonScope.class, new Factory<FileUploader>(FileUploader.class) {
+ public FileUploader create() {
+ final FileUploaderDialog panel = new FileUploaderDialog(i18n, ws);
+ return panel;
+ }
+ });
+
install(ProviderRegisterStrategy.registerOnlyIfNotRegistered, new EmiteUIModule(), new DocumentClientModule(),
new ChatClientModule());
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/FileUploader.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/FileUploader.java 2008-09-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/FileUploader.java 2008-09-09 18:00:21 UTC (rev 865)
@@ -0,0 +1,11 @@
+package org.ourproject.kune.platf.client.ui.dialogs;
+
+public interface FileUploader {
+
+ void hide();
+
+ void setPermittedExtensions(String[] extensions);
+
+ void show();
+
+}
Added: 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-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/FileUploaderDialog.java 2008-09-09 18:00:21 UTC (rev 865)
@@ -0,0 +1,71 @@
+package org.ourproject.kune.platf.client.ui.dialogs;
+
+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.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.ToolbarButton;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+import com.gwtextux.client.widgets.upload.UploadDialog;
+import com.gwtextux.client.widgets.upload.UploadDialogListenerAdapter;
+
+public class FileUploaderDialog implements FileUploader {
+
+ private static final String URL = "/services/fileupload";
+
+ private final UploadDialog dialog;
+ private ToolbarButton traybarButton;
+ private final I18nUITranslationService i18n;
+ private final WorkspaceSkeleton ws;
+
+ public FileUploaderDialog(final I18nUITranslationService i18n, final WorkspaceSkeleton ws) {
+ this.i18n = i18n;
+ this.ws = ws;
+ dialog = new UploadDialog(i18n.t("File uploader"), false, true);
+ dialog.addListener(new UploadDialogListenerAdapter() {
+ @Override
+ public void onUploadComplete(final UploadDialog source) {
+ Site.info(i18n.t("Upload completed"));
+ // traybarButton.destroy();
+ // traybarButton = null;
+ }
+ });
+ 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() {
+ dialog.hide();
+ }
+
+ public void setPermittedExtensions(final String[] extensions) {
+ dialog.setPermittedExtensions(extensions);
+ }
+
+ public void show() {
+ if (traybarButton == null) {
+ traybarButton = new ToolbarButton();
+ traybarButton.setTooltip(i18n.t("Show/hide uploader window"));
+ traybarButton.setIcon("images/nav/upload.png");
+ traybarButton.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(final Button button, final EventObject e) {
+ if (dialog.isVisible()) {
+ dialog.hide();
+ } else {
+ dialog.show();
+ }
+ }
+ });
+ ws.getSiteTraybar().addButton(traybarButton);
+ }
+ dialog.show();
+ }
+}
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-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileUploadManagerDefault.java 2008-09-09 18:00:21 UTC (rev 865)
@@ -1,21 +1,41 @@
package org.ourproject.kune.platf.server.manager.impl;
+import java.io.File;
import java.util.HashMap;
+import java.util.Map;
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 org.cafesip.gwtcomp.server.FileUploadAction;
import org.cafesip.gwtcomp.server.FormResponse;
public class FileUploadManagerDefault implements FileUploadAction {
+ public static final Log log = LogFactory.getLog(FileUploadManagerDefault.class);
+ private HashMap<String, File> files;
+
public FormResponse onSubmit(final HttpServlet servlet, final HttpServletRequest request) {
- return new FormResponse(200, "", false);
+ for (final Map.Entry<String, File> entry : files.entrySet()) {
+ log.info("file uploaded: " + entry.getKey());
+ }
+ /**
+ * 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' }
+ */
+ return new FormResponse(HttpServletResponse.SC_OK, "{success: true, error: ''}", false);
}
- @SuppressWarnings("unchecked")
- public void setFileList(final HashMap files) {
+ public void setFileList(final HashMap<String, File> files) {
+ log.info("Setting files");
+ this.files = files;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigator.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigator.java 2008-09-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigator.java 2008-09-09 18:00:21 UTC (rev 865)
@@ -33,6 +33,8 @@
View getView();
+ void registerContentTypeIcon(String contentTypeId, String iconUrl);
+
void registerDraggableType(String typeId);
void registerDroppableType(String typeId);
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-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java 2008-09-09 18:00:21 UTC (rev 865)
@@ -56,6 +56,7 @@
private final HashMap<String, ActionCollection<StateToken>> actions;
private final ArrayList<String> draggables;
private final ArrayList<String> droppables;
+ private final HashMap<String, String> contentTypesIcons;
public ContextNavigatorPresenter(final StateManager stateManager, final Session session,
final Provider<ContentServiceAsync> contentServiceProvider, final I18nUITranslationService i18n) {
@@ -66,6 +67,7 @@
actions = new HashMap<String, ActionCollection<StateToken>>();
draggables = new ArrayList<String>();
droppables = new ArrayList<String>();
+ contentTypesIcons = new HashMap<String, String>();
}
public void addAction(final String contentTypeId, final ActionDescriptor<StateToken> action) {
@@ -125,6 +127,10 @@
});
}
+ public void registerContentTypeIcon(final String contentTypeId, final String iconUrl) {
+ contentTypesIcons.put(contentTypeId, iconUrl);
+ }
+
public void registerDraggableType(final String type) {
draggables.add(type);
}
@@ -172,7 +178,9 @@
final ActionCollection<StateToken> bottomActions = new ActionCollection<StateToken>();
boolean add = false;
- for (final ActionDescriptor<StateToken> action : actions.get(state.getTypeId())) {
+ final String contentId = state.getTypeId();
+
+ for (final ActionDescriptor<StateToken> action : actions.get(contentId)) {
switch (action.getAccessRol()) {
case Administrator:
add = rights.isAdministrable();
@@ -206,20 +214,21 @@
view.setTopActions(stateToken, topActions);
view.setBottomActions(stateToken, bottomActions);
- final ContextNavigatorItem item = new ContextNavigatorItem(treeId, containerTreeId, "images/nav/page.png",
- state.getTitle(), visible ? ContentStatusDTO.publicVisible : ContentStatusDTO.nonPublicVisible,
- stateToken, isDraggable(state.getTypeId(), rights.isAdministrable()), isDroppable(state.getTypeId(),
- rights.isAdministrable()), itemActions);
+ final ContextNavigatorItem item = new ContextNavigatorItem(treeId, containerTreeId,
+ getContentTypeIcon(contentId), state.getTitle(), visible ? ContentStatusDTO.publicVisible
+ : ContentStatusDTO.nonPublicVisible, stateToken, isDraggable(contentId, rights
+ .isAdministrable()), isDroppable(contentId, rights.isAdministrable()), itemActions);
view.addItem(item);
for (final ContentDTO content : container.getContents()) {
final StateToken siblingToken = stateToken.clone().setDocument(content.getId().toString());
final StateToken siblingParentToken = stateToken.clone().setDocument(null);
// TODO: rights not correct
+ final String contentTypeId = content.getTypeId();
final ContextNavigatorItem sibling = new ContextNavigatorItem(genId(siblingToken),
- genId(siblingParentToken), "images/nav/page.png", content.getTitle(),
- ContentStatusDTO.publicVisible, siblingToken, isDraggable(content.getTypeId(), rights
- .isAdministrable()), isDroppable(content.getTypeId(), rights.isAdministrable()), null);
+ genId(siblingParentToken), getContentTypeIcon(contentTypeId), content.getTitle(),
+ ContentStatusDTO.publicVisible, siblingToken, isDraggable(contentTypeId, rights.isAdministrable()),
+ isDroppable(contentTypeId, rights.isAdministrable()), null);
view.addItem(sibling);
}
@@ -230,15 +239,22 @@
final StateToken siblingParentToken = stateToken.clone().setDocument(null).setFolder(
siblingFolder.getParentFolderId().toString());
// TODO: rights not correct
+ final String containerTypeId = container.getTypeId();
final ContextNavigatorItem sibling = new ContextNavigatorItem(genId(siblingToken),
- genId(siblingParentToken), "", siblingFolder.getName(), ContentStatusDTO.publicVisible,
- siblingToken, isDraggable(container.getTypeId(), rights.isAdministrable()), isDroppable(container
- .getTypeId(), rights.isAdministrable()), null);
+ genId(siblingParentToken), getContentTypeIcon(containerTypeId), siblingFolder.getName(),
+ ContentStatusDTO.publicVisible, siblingToken,
+ isDraggable(containerTypeId, rights.isAdministrable()), isDroppable(containerTypeId, rights
+ .isAdministrable()), null);
view.addItem(sibling);
}
view.selectItem(treeId);
}
+ private void addItem(final String title, final String contentTypeId, final StateToken token,
+ final AccessRightsDTO rights) {
+
+ }
+
private void createTreePath(final StateToken state, final ContainerSimpleDTO[] absolutePath) {
for (int i = 0; i < absolutePath.length; i++) {
final ContainerSimpleDTO folder = absolutePath[i];
@@ -249,8 +265,8 @@
if (folder.getParentFolderId() != null) {
// Bad rights, draggable/droppable
final ContextNavigatorItem parent = new ContextNavigatorItem(genId(folderStateToken),
- genId(parentStateToken), "", folder.getName(), ContentStatusDTO.publicVisible,
- folderStateToken, false, true, null);
+ genId(parentStateToken), getContentTypeIcon(folder.getTypeId()), folder.getName(),
+ ContentStatusDTO.publicVisible, folderStateToken, false, true, null);
view.addItem(parent);
} else {
// create root folder
@@ -263,6 +279,12 @@
return "k-" + token.toString().replace(StateToken.SEPARATOR, "-");
}
+ private String getContentTypeIcon(final String typeId) {
+ final String icon = contentTypesIcons.get(typeId);
+ // TODO Auto-generated method stub
+ return icon == null ? "" : icon;
+ }
+
private boolean isDraggable(final String typeId, final boolean administrable) {
return administrable && draggables.contains(typeId);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPresenter.java 2008-09-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPresenter.java 2008-09-09 18:00:21 UTC (rev 865)
@@ -35,6 +35,7 @@
import org.ourproject.kune.workspace.client.site.Site;
import org.ourproject.kune.workspace.client.site.rpc.UserServiceAsync;
+import com.allen_sauer.gwt.log.client.Log;
import com.calclab.emite.client.im.roster.RosterManager.SubscriptionMode;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -171,8 +172,7 @@
view.setSignInMessage(i18n.t("Incorrect nickname/email or password"), SiteErrorType.error);
} catch (final Throwable e) {
view.setSignInMessage("Error in login", SiteErrorType.error);
- GWT.log("Other kind of exception in LoginFormPresenter/doLogin", null);
- throw new RuntimeException();
+ Log.error("Other kind of exception in LoginFormPresenter/doLogin");
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2008-09-08 01:52:25 UTC (rev 864)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2008-09-09 18:00:21 UTC (rev 865)
@@ -126,7 +126,7 @@
});
unJoinButton = new GridButton("images/del.gif", i18n.t("Unjoin"), i18n
- .t("Don't participate more as a member in this group"), new Slot<String>() {
+ .t("Don't participate more in this group"), new Slot<String>() {
public void onEvent(final String parameter) {
removeMemberAction();
}
1
0
Author: vjrj
Date: 2008-09-08 03:52:25 +0200 (Mon, 08 Sep 2008)
New Revision: 864
Removed:
trunk/libs/gwt-jsjac-0.1.10.jar
trunk/libs/gwtext-0.9.2.jar
trunk/libs/install-ext.cmd
trunk/src/main/java/org/ourproject/kune/app/public/dev/
trunk/src/main/java/org/ourproject/kune/app/public/firebug/
trunk/src/main/java/org/ourproject/kune/app/public/js/colorthemes.js
trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ParamCallback.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/ColorTheme.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/
trunk/src/test/java/org/ourproject/kune/sitebar/
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/rpc/SiteService.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipsHelper.java
Log:
refactorization
Deleted: trunk/libs/gwt-jsjac-0.1.10.jar
===================================================================
(Binary files differ)
Deleted: trunk/libs/gwtext-0.9.2.jar
===================================================================
(Binary files differ)
Deleted: trunk/libs/install-ext.cmd
===================================================================
--- trunk/libs/install-ext.cmd 2008-09-08 01:25:13 UTC (rev 863)
+++ trunk/libs/install-ext.cmd 2008-09-08 01:52:25 UTC (rev 864)
@@ -1 +0,0 @@
-call mvn install:install-file -DgroupId=com.gwtext -DartifactId=gwt-ext -Dversion=0.9.2-SNAPSHOT -Dpackaging=jar -Dfile=gwtext-0.9.2-SNAPSHOT.jar
Deleted: trunk/src/main/java/org/ourproject/kune/app/public/js/colorthemes.js
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/js/colorthemes.js 2008-09-08 01:25:13 UTC (rev 863)
+++ trunk/src/main/java/org/ourproject/kune/app/public/js/colorthemes.js 2008-09-08 01:52:25 UTC (rev 864)
@@ -1,103 +0,0 @@
-
-var defaultKuneTheme = {
- themeName: "Default",
- toolSelected: "#DD8A3D",
- toolUnselected: "#FFE9A5",
- contentMainBorder: "#DD8A3D",
- contentTitle: "#F1BB59",
- contentTitleText: "#69312F",
- contentSubTitleText: "#FFF",
- contentBottomText: "#FFF",
- context: "#FFD09D",
- splitter: "#DEAA87",
- groupMembersDD: "#DF5244",
- participationDD: "#CA5842",
- summaryDD: "#9F734B",
- tagsDD: "#87501E"
-};
-
-var greenKuneTheme = {
- themeName: "Green",
- toolSelected: "#5FD35F",
- toolUnselected: "#D6F4D6",
- contentMainBorder: "#5FD35F",
- contentTitle: "#AFA",
- contentTitleText: "#250",
- contentSubTitleText: "#FFF",
- contentBottomText: "#FFF",
- context: "#CFA",
- splitter: "#DCE8AB",
- groupMembersDD: "#008000",
- participationDD: "#00AA00",
- summaryDD: "#4CE14C",
- tagsDD: "#00D400"
-};
-
-var blueKuneTheme = {
- themeName: "Blue",
- toolSelected: "#0066FF",
- toolUnselected: "#D7D7F4",
- contentMainBorder: "#0066FF",
- contentTitle: "#AFDDE9",
- contentTitleText: "#000080",
- contentSubTitleText: "#FFF",
- contentBottomText: "#FFF",
- context: "#AACCFF",
- splitter: "#D5D5FF",
- groupMembersDD: "#5500D4",
- participationDD: "#6600FF",
- summaryDD: "#69A5FF",
- tagsDD: "#9955FF"
-};
-
-var greyKuneTheme = {
- themeName: "Grey",
- toolSelected: "#4D4D4D",
- toolUnselected: "#E6E6E6",
- contentMainBorder: "#4D4D4D",
- contentTitle: "#CCCCCC",
- contentTitleText: "#1A1A1A",
- contentSubTitleText: "#FFF",
- contentBottomText: "#FFF",
- context: "#B3B3B3",
- splitter: "#999999",
- groupMembersDD: "#4D4D4D",
- participationDD: "#666666",
- summaryDD: "#A6A6A6",
- tagsDD: "#808080"
-};
-
-var purpleKuneTheme = {
- themeName: "Purple",
- toolSelected: "#660080",
- toolUnselected: "#EED7F4",
- contentMainBorder: "#660080",
- contentTitle: "#DDAFE9",
- contentTitleText: "#440055",
- contentSubTitleText: "#FFF",
- contentBottomText: "#FFF",
- context: "#DDAFE9",
- splitter: "#A793AC",
- groupMembersDD: "#672178",
- participationDD: "#892CA0",
- summaryDD: "#C473D8",
- tagsDD: "#AB37C8"
-};
-
-var redKuneTheme = {
- themeName: "Red",
- toolSelected: "#D40000",
- toolUnselected: "#FFD5D5",
- contentMainBorder: "#D40000",
- contentTitle: "#FF8080",
- contentTitleText: "#800000",
- contentSubTitleText: "#FFF",
- contentBottomText: "#FFF",
- context: "#FFAAAA",
- splitter: "#FF5555",
- groupMembersDD: "#A02C2C",
- participationDD: "#C83737",
- summaryDD: "#E08F8F",
- tagsDD: "#D35F5F"
-};
-
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ParamCallback.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ParamCallback.java 2008-09-08 01:25:13 UTC (rev 863)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ParamCallback.java 2008-09-08 01:52:25 UTC (rev 864)
@@ -1,42 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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 org.ourproject.kune.platf.client.rpc;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-public class ParamCallback<K, T> {
-
- K param;
- AsyncCallback<T> callback;
-
- public ParamCallback(final K param, final AsyncCallback<T> callback) {
- this.param = param;
- this.callback = callback;
- }
-
- public K getParam() {
- return param;
- }
-
- public AsyncCallback<T> getCallback() {
- return callback;
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/SiteService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/SiteService.java 2008-09-08 01:25:13 UTC (rev 863)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/SiteService.java 2008-09-08 01:52:25 UTC (rev 864)
@@ -40,9 +40,6 @@
return ourInstance;
}
- public static void setMock(final SiteServiceAsync mocked) {
- ourInstance = mocked;
- }
}
InitDataDTO getInitData(String userHash) throws DefaultException;
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/services/ColorTheme.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/ColorTheme.java 2008-09-08 01:25:13 UTC (rev 863)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/ColorTheme.java 2008-09-08 01:52:25 UTC (rev 864)
@@ -1,99 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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 org.ourproject.kune.platf.client.services;
-
-import com.google.gwt.i18n.client.Dictionary;
-
-@Deprecated
-public class ColorTheme {
-
- private static final String DEFAULT_KUNE_THEME = "defaultKuneTheme";
-
- private Dictionary theme;
-
- public ColorTheme() {
- this(DEFAULT_KUNE_THEME);
- }
-
- public ColorTheme(final String theme) {
- this.theme = Dictionary.getDictionary(theme);
- }
-
- public String getContentBottomText() {
- return theme.get("contentBottomText");
- }
-
- public String getContentMainBorder() {
- return theme.get("contentMainBorder");
- }
-
- public String getContentSubTitleText() {
- return theme.get("contentSubTitleText");
- }
-
- public String getContentTitle() {
- return theme.get("contentTitle");
- }
-
- public String getContentTitleText() {
- return theme.get("contentTitleText");
- }
-
- public String getContext() {
- return theme.get("context");
- }
-
- public String getGroupMembersDD() {
- return theme.get("groupMembersDD");
- }
-
- public String getParticipationDD() {
- return theme.get("participationDD");
- }
-
- public String getSplitter() {
- return theme.get("splitter");
- }
-
- public String getSummaryDD() {
- return theme.get("summaryDD");
- }
-
- public String getTagsDD() {
- return theme.get("tagsDD");
- }
-
- public String getThemeName() {
- return theme.get("themeName");
- }
-
- public String getToolSelected() {
- return theme.get("toolSelected");
- }
-
- public String getToolUnselected() {
- return theme.get("toolUnselected");
- }
-
- public void setTheme(final String theme) {
- this.theme = Dictionary.getDictionary(theme);
- }
-
-}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipsHelper.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipsHelper.java 2008-09-08 01:25:13 UTC (rev 863)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipsHelper.java 2008-09-08 01:52:25 UTC (rev 864)
@@ -1,25 +1,16 @@
package org.ourproject.kune.platf.client.ui;
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.DeferredCommand;
import com.gwtext.client.widgets.QuickTip;
import com.gwtext.client.widgets.QuickTips;
public class QuickTipsHelper {
public QuickTipsHelper() {
- DeferredCommand.addCommand(new Command() {
- public void execute() {
- if (!QuickTips.isEnabled()) {
- // If not enabled before by another UI component
- QuickTips.init();
- final QuickTip quickTipInstance = QuickTips.getQuickTip();
- quickTipInstance.setInterceptTitles(true);
- quickTipInstance.setDismissDelay(7000);
- quickTipInstance.setHideDelay(400);
- quickTipInstance.setMinWidth(100);
- }
- }
- });
+ QuickTips.init();
+ final QuickTip quickTipInstance = QuickTips.getQuickTip();
+ quickTipInstance.setInterceptTitles(true);
+ quickTipInstance.setDismissDelay(7000);
+ quickTipInstance.setHideDelay(400);
+ quickTipInstance.setMinWidth(100);
}
}
\ No newline at end of file
1
0
Author: vjrj
Date: 2008-09-08 03:25:13 +0200 (Mon, 08 Sep 2008)
New Revision: 863
Added:
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitelogo/
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteprogress/
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/
Removed:
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/
Modified:
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/site/Site.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitelogo/SiteLogo.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitelogo/SiteLogoPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitelogo/SiteLogoPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitelogo/SiteLogoView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/SiteNewGroupLink.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/SiteNewGroupLinkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/SiteNewGroupLinkView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptions.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteprogress/SiteProgress.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteprogress/SiteProgressPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteprogress/SiteProgressPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteprogress/SiteProgressView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLink.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearch.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignInLink.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignInLinkPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignInLinkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignInLinkView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLink.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenu.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuView.java
Log:
refactorization
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-09-08 01:20:31 UTC (rev 862)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -20,11 +20,11 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.workspace.client.component.WorkspaceDeckPanel;
+import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummary;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.ui.ctx.nav.ContextNavigator;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
import com.calclab.suco.client.module.AbstractModule;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java 2008-09-08 01:20:31 UTC (rev 862)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -28,7 +28,7 @@
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.ui.ctx.nav.ContextNavigator;
+import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
import com.calclab.suco.client.provider.Provider;
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-08 01:20:31 UTC (rev 862)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -31,6 +31,7 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.platf.client.ui.rate.RateIt;
+import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
@@ -38,7 +39,6 @@
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.ui.ctx.nav.ContextNavigator;
import com.calclab.suco.client.module.AbstractModule;
import com.calclab.suco.client.provider.Factory;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-09-08 01:20:31 UTC (rev 862)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -32,11 +32,11 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.AbstractClientTool;
import org.ourproject.kune.platf.client.tool.ToolSelector;
+import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
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 org.ourproject.kune.workspace.client.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.ui.ctx.nav.ContextNavigator;
import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Slot;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java 2008-09-08 01:20:31 UTC (rev 862)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -24,7 +24,7 @@
import org.ourproject.kune.docs.client.ctx.admin.AdminContext;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.ui.ctx.nav.ContextNavigator;
+import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Slot;
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-08 01:20:31 UTC (rev 862)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -31,6 +31,9 @@
import org.ourproject.kune.platf.client.ui.rate.RateItPresenter;
import org.ourproject.kune.platf.client.ui.rate.RatePanel;
import org.ourproject.kune.platf.client.ui.rate.RatePresenter;
+import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
+import org.ourproject.kune.workspace.client.ctxnav.ContextNavigatorPanel;
+import org.ourproject.kune.workspace.client.ctxnav.ContextNavigatorPresenter;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.editor.TextEditorPanel;
import org.ourproject.kune.workspace.client.editor.TextEditorPresenter;
@@ -76,6 +79,33 @@
import org.ourproject.kune.workspace.client.site.msg.SiteMessageView;
import org.ourproject.kune.workspace.client.site.rpc.UserService;
import org.ourproject.kune.workspace.client.site.rpc.UserServiceAsync;
+import org.ourproject.kune.workspace.client.sitebar.sitelogo.SiteLogo;
+import org.ourproject.kune.workspace.client.sitebar.sitelogo.SiteLogoPanel;
+import org.ourproject.kune.workspace.client.sitebar.sitelogo.SiteLogoPresenter;
+import org.ourproject.kune.workspace.client.sitebar.sitenewgroup.SiteNewGroupLink;
+import org.ourproject.kune.workspace.client.sitebar.sitenewgroup.SiteNewGroupLinkPanel;
+import org.ourproject.kune.workspace.client.sitebar.sitenewgroup.SiteNewGroupLinkPresenter;
+import org.ourproject.kune.workspace.client.sitebar.siteoptions.SiteOptions;
+import org.ourproject.kune.workspace.client.sitebar.siteoptions.SiteOptionsPanel;
+import org.ourproject.kune.workspace.client.sitebar.siteoptions.SiteOptionsPresenter;
+import org.ourproject.kune.workspace.client.sitebar.siteprogress.SiteProgress;
+import org.ourproject.kune.workspace.client.sitebar.siteprogress.SiteProgressPanel;
+import org.ourproject.kune.workspace.client.sitebar.siteprogress.SiteProgressPresenter;
+import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
+import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLinkPanel;
+import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLinkPresenter;
+import org.ourproject.kune.workspace.client.sitebar.sitesearch.SiteSearch;
+import org.ourproject.kune.workspace.client.sitebar.sitesearch.SiteSearchPanel;
+import org.ourproject.kune.workspace.client.sitebar.sitesearch.SiteSearchPresenter;
+import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignInLink;
+import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignInLinkPanel;
+import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignInLinkPresenter;
+import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
+import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLinkPanel;
+import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLinkPresenter;
+import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserMenu;
+import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserMenuPanel;
+import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserMenuPresenter;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummary;
import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPanel;
@@ -98,36 +128,6 @@
import org.ourproject.kune.workspace.client.title.EntitySubTitlePresenter;
import org.ourproject.kune.workspace.client.title.EntityTitlePanel;
import org.ourproject.kune.workspace.client.title.EntityTitlePresenter;
-import org.ourproject.kune.workspace.client.ui.ctx.nav.ContextNavigator;
-import org.ourproject.kune.workspace.client.ui.ctx.nav.ContextNavigatorPanel;
-import org.ourproject.kune.workspace.client.ui.ctx.nav.ContextNavigatorPresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogo;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogoPanel;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogoPresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitenewgroup.SiteNewGroupLink;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitenewgroup.SiteNewGroupLinkPanel;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitenewgroup.SiteNewGroupLinkPresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteoptions.SiteOptions;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteoptions.SiteOptionsPanel;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteoptions.SiteOptionsPresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteprogress.SiteProgress;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteprogress.SiteProgressPanel;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteprogress.SiteProgressPresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitepublic.SitePublicSpaceLink;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitepublic.SitePublicSpaceLinkPanel;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitepublic.SitePublicSpaceLinkPresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch.SiteSearch;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch.SiteSearchPanel;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch.SiteSearchPresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesign.SiteSignInLink;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesign.SiteSignInLinkPanel;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesign.SiteSignInLinkPresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesign.SiteSignOutLink;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesign.SiteSignOutLinkPanel;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesign.SiteSignOutLinkPresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteusermenu.SiteUserMenu;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteusermenu.SiteUserMenuPanel;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteusermenu.SiteUserMenuPresenter;
import com.calclab.emiteuimodule.client.EmiteUIModule;
import com.calclab.suco.client.container.Container;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/site/Site.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/site/Site.java 2008-09-08 01:20:31 UTC (rev 862)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/Site.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -23,7 +23,7 @@
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
import org.ourproject.kune.workspace.client.site.msg.SiteMessage;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteprogress.SiteProgress;
+import org.ourproject.kune.workspace.client.sitebar.siteprogress.SiteProgress;
import com.calclab.suco.client.provider.Provider;
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitelogo (from rev 861, trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo)
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitelogo/SiteLogo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogo.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitelogo/SiteLogo.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo;
+package org.ourproject.kune.workspace.client.sitebar.sitelogo;
public interface SiteLogo {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitelogo/SiteLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitelogo/SiteLogoPanel.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo;
+package org.ourproject.kune.workspace.client.sitebar.sitelogo;
import org.ourproject.kune.workspace.client.skel.SiteBar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitelogo/SiteLogoPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPresenter.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitelogo/SiteLogoPresenter.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo;
+package org.ourproject.kune.workspace.client.sitebar.sitelogo;
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.InitDataDTO;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitelogo/SiteLogoView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoView.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitelogo/SiteLogoView.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo;
+package org.ourproject.kune.workspace.client.sitebar.sitelogo;
import org.ourproject.kune.platf.client.View;
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup (from rev 861, trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup)
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/SiteNewGroupLink.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup/SiteNewGroupLink.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/SiteNewGroupLink.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitenewgroup;
+package org.ourproject.kune.workspace.client.sitebar.sitenewgroup;
public interface SiteNewGroupLink {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitenewgroup;
+package org.ourproject.kune.workspace.client.sitebar.sitenewgroup;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.site.SiteToken;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/SiteNewGroupLinkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup/SiteNewGroupLinkPresenter.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/SiteNewGroupLinkPresenter.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitenewgroup;
+package org.ourproject.kune.workspace.client.sitebar.sitenewgroup;
import org.ourproject.kune.platf.client.View;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/SiteNewGroupLinkView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup/SiteNewGroupLinkView.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitenewgroup/SiteNewGroupLinkView.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitenewgroup;
+package org.ourproject.kune.workspace.client.sitebar.sitenewgroup;
import org.ourproject.kune.platf.client.View;
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions (from rev 861, trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions)
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions/SiteOptions.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptions.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteoptions;
+package org.ourproject.kune.workspace.client.sitebar.siteoptions;
public interface SiteOptions {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions/SiteOptionsPanel.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteoptions;
+package org.ourproject.kune.workspace.client.sitebar.siteoptions;
import org.ourproject.kune.workspace.client.i18n.I18nTranslator;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions/SiteOptionsPresenter.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPresenter.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteoptions;
+package org.ourproject.kune.workspace.client.sitebar.siteoptions;
import org.ourproject.kune.platf.client.View;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteoptions/SiteOptionsView.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsView.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteoptions;
+package org.ourproject.kune.workspace.client.sitebar.siteoptions;
import org.ourproject.kune.platf.client.View;
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteprogress (from rev 861, trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress)
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteprogress/SiteProgress.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgress.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteprogress/SiteProgress.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteprogress;
+package org.ourproject.kune.workspace.client.sitebar.siteprogress;
public interface SiteProgress {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteprogress/SiteProgressPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgressPanel.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteprogress/SiteProgressPanel.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,6 +1,6 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteprogress;
+package org.ourproject.kune.workspace.client.sitebar.siteprogress;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitepublic.SitePublicSpaceLink;
+import org.ourproject.kune.workspace.client.sitebar.sitepublic.SitePublicSpaceLink;
import com.calclab.suco.client.provider.Provider;
import com.google.gwt.user.client.DOM;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteprogress/SiteProgressPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgressPresenter.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteprogress/SiteProgressPresenter.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteprogress;
+package org.ourproject.kune.workspace.client.sitebar.siteprogress;
import org.ourproject.kune.platf.client.View;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteprogress/SiteProgressView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgressView.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteprogress/SiteProgressView.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteprogress;
+package org.ourproject.kune.workspace.client.sitebar.siteprogress;
import org.ourproject.kune.platf.client.View;
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic (from rev 861, trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitepublic)
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLink.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitepublic/SitePublicSpaceLink.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLink.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitepublic;
+package org.ourproject.kune.workspace.client.sitebar.sitepublic;
public interface SitePublicSpaceLink {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitepublic/SitePublicSpaceLinkPanel.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPanel.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitepublic;
+package org.ourproject.kune.workspace.client.sitebar.sitepublic;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.IconLabel;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitepublic/SitePublicSpaceLinkPresenter.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkPresenter.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitepublic;
+package org.ourproject.kune.workspace.client.sitebar.sitepublic;
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.GroupListDTO;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitepublic/SitePublicSpaceLinkView.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitepublic/SitePublicSpaceLinkView.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitepublic;
+package org.ourproject.kune.workspace.client.sitebar.sitepublic;
import org.ourproject.kune.platf.client.View;
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch (from rev 861, trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch)
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearch.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearch.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearch.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch;
+package org.ourproject.kune.workspace.client.sitebar.sitesearch;
public interface SiteSearch {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPanel.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPanel.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch;
+package org.ourproject.kune.workspace.client.sitebar.sitesearch;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPresenter.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch;
+package org.ourproject.kune.workspace.client.sitebar.sitesearch;
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.workspace.client.search.SiteSearcher;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchView.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchView.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch;
+package org.ourproject.kune.workspace.client.sitebar.sitesearch;
import org.ourproject.kune.platf.client.View;
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign (from rev 861, trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign)
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignInLink.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLink.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignInLink.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesign;
+package org.ourproject.kune.workspace.client.sitebar.sitesign;
public interface SiteSignInLink {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignInLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPanel.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignInLinkPanel.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesign;
+package org.ourproject.kune.workspace.client.sitebar.sitesign;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.site.SiteToken;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignInLinkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPresenter.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignInLinkPresenter.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesign;
+package org.ourproject.kune.workspace.client.sitebar.sitesign;
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignInLinkView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkView.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignInLinkView.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesign;
+package org.ourproject.kune.workspace.client.sitebar.sitesign;
import org.ourproject.kune.platf.client.View;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLink.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLink.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLink.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesign;
+package org.ourproject.kune.workspace.client.sitebar.sitesign;
public interface SiteSignOutLink {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPanel.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPanel.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesign;
+package org.ourproject.kune.workspace.client.sitebar.sitesign;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.site.Site;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPresenter.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesign;
+package org.ourproject.kune.workspace.client.sitebar.sitesign;
import java.util.Date;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkView.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkView.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesign;
+package org.ourproject.kune.workspace.client.sitebar.sitesign;
import org.ourproject.kune.platf.client.View;
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu (from rev 861, trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu)
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenu.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenu.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenu.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteusermenu;
+package org.ourproject.kune.workspace.client.sitebar.siteusermenu;
public interface SiteUserMenu {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPanel.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteusermenu;
+package org.ourproject.kune.workspace.client.sitebar.siteusermenu;
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.ui.MenuItemCollection;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPresenter.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteusermenu;
+package org.ourproject.kune.workspace.client.sitebar.siteusermenu;
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.GroupDTO;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuView.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuView.java 2008-09-08 01:25:13 UTC (rev 863)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteusermenu;
+package org.ourproject.kune.workspace.client.sitebar.siteusermenu;
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.GroupDTO;
1
0
r862 - in trunk/src/main/java/org/ourproject/kune/workspace/client: . ctxadmin ctxnav site ui/ctx
by vjrj 08 Sep '08
by vjrj 08 Sep '08
08 Sep '08
Author: vjrj
Date: 2008-09-08 03:20:31 +0200 (Mon, 08 Sep 2008)
New Revision: 862
Added:
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxadmin/
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/
Removed:
trunk/src/main/java/org/ourproject/kune/workspace/client/site/bar/
trunk/src/main/java/org/ourproject/kune/workspace/client/site/login/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/admin/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/nav/
Modified:
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxadmin/AccessListsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigator.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorItem.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
Log:
refactorization
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxadmin (from rev 861, trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/admin)
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxadmin/AccessListsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/admin/AccessListsPanel.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxadmin/AccessListsPanel.java 2008-09-08 01:20:31 UTC (rev 862)
@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-package org.ourproject.kune.workspace.client.ui.ctx.admin;
+package org.ourproject.kune.workspace.client.ctxadmin;
import java.util.Iterator;
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav (from rev 861, trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/nav)
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigator.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/nav/ContextNavigator.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigator.java 2008-09-08 01:20:31 UTC (rev 862)
@@ -18,7 +18,7 @@
*
*/
-package org.ourproject.kune.workspace.client.ui.ctx.nav;
+package org.ourproject.kune.workspace.client.ctxnav;
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.actions.ActionDescriptor;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorItem.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/nav/ContextNavigatorItem.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorItem.java 2008-09-08 01:20:31 UTC (rev 862)
@@ -1,4 +1,4 @@
-package org.ourproject.kune.workspace.client.ui.ctx.nav;
+package org.ourproject.kune.workspace.client.ctxnav;
import org.ourproject.kune.platf.client.actions.ActionCollection;
import org.ourproject.kune.platf.client.dto.ContentStatusDTO;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/nav/ContextNavigatorPanel.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java 2008-09-08 01:20:31 UTC (rev 862)
@@ -18,7 +18,7 @@
*
*/
-package org.ourproject.kune.workspace.client.ui.ctx.nav;
+package org.ourproject.kune.workspace.client.ctxnav;
import java.util.HashMap;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/nav/ContextNavigatorPresenter.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java 2008-09-08 01:20:31 UTC (rev 862)
@@ -18,7 +18,7 @@
*
*/
-package org.ourproject.kune.workspace.client.ui.ctx.nav;
+package org.ourproject.kune.workspace.client.ctxnav;
import java.util.ArrayList;
import java.util.HashMap;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/nav/ContextNavigatorView.java 2008-09-08 01:13:19 UTC (rev 861)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorView.java 2008-09-08 01:20:31 UTC (rev 862)
@@ -18,7 +18,7 @@
*
*/
-package org.ourproject.kune.workspace.client.ui.ctx.nav;
+package org.ourproject.kune.workspace.client.ctxnav;
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.actions.ActionCollection;
1
0
r861 - in trunk/src/main/java/org/ourproject/kune/workspace/client: . entitylogo signin skel themes title
by vjrj 08 Sep '08
by vjrj 08 Sep '08
08 Sep '08
Author: vjrj
Date: 2008-09-08 03:13:19 +0200 (Mon, 08 Sep 2008)
New Revision: 861
Added:
trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/
trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogo.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterForm.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignIn.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInForm.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/AbstractBar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/Entity.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntitySummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SiteBar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/TitleBar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/Toolbar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/WorkspaceSkeleton.java
trunk/src/main/java/org/ourproject/kune/workspace/client/themes/
trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsTheme.java
trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemeView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitleView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitleView.java
Log:
Refactorization
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogo.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogo.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,6 @@
+package org.ourproject.kune.workspace.client.entitylogo;
+
+
+public interface EntityLogo {
+
+}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,123 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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 org.ourproject.kune.workspace.client.entitylogo;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.themes.WsTheme;
+
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Hyperlink;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+public class EntityLogoPanel extends SimplePanel implements EntityLogoView {
+ class EntityTextLogo extends VerticalPanel {
+
+ private static final int GROUP_NAME_LIMIT_SIZE = 90;
+ private static final String LOGO_SMALL_FONT_SIZE = "108%";
+ private static final String LOGO_DEFAULT_FONT_SIZE = "167%";
+ private final Label defTextLogoLabel;
+ private final Hyperlink defTextPutYourLogoHL;
+ private final HorizontalPanel putYourLogoHP;
+
+ public EntityTextLogo() {
+ // Initialize
+ super();
+ defTextLogoLabel = new Label();
+ final HTML expandCell = new HTML("<b></b>");
+ putYourLogoHP = new HorizontalPanel();
+ defTextPutYourLogoHL = new Hyperlink();
+
+ // Layout
+ add(defTextLogoLabel);
+ add(putYourLogoHP);
+ putYourLogoHP.add(expandCell);
+ putYourLogoHP.add(defTextPutYourLogoHL);
+
+ // Set properties
+ // TODO: Put your logo here functionality
+ defTextPutYourLogoHL.setText(i18n.t("Put Your Logo Here"));
+ expandCell.setWidth("100%");
+ putYourLogoHP.setCellWidth(expandCell, "100%");
+ // TODO: link to configure the logo
+ setStylePrimaryName("k-entitytextlogo");
+ setDefaultText("");
+ }
+
+ public void setDefaultText(final String text) {
+ if (text.length() > GROUP_NAME_LIMIT_SIZE) {
+ DOM.setStyleAttribute(defTextLogoLabel.getElement(), "fontSize", LOGO_SMALL_FONT_SIZE);
+ } else {
+ DOM.setStyleAttribute(defTextLogoLabel.getElement(), "fontSize", LOGO_DEFAULT_FONT_SIZE);
+ }
+ defTextLogoLabel.setText(text);
+
+ }
+
+ public void setPutYourLogoVisible(final boolean visible) {
+ putYourLogoHP.setVisible(visible);
+ }
+
+ }
+
+ private EntityTextLogo entityTextLogo;
+ private final I18nTranslationService i18n;
+
+ public EntityLogoPanel(final I18nTranslationService i18n, final WorkspaceSkeleton ws) {
+ this.i18n = i18n;
+ ws.addToEntityMainHeader(this);
+ }
+
+ public void setLogo(final Image image) {
+ clear();
+ add(image);
+ }
+
+ public void setLogo(final String groupName) {
+ clear();
+ add(getEntityTextLogo());
+ entityTextLogo.setDefaultText(groupName);
+ }
+
+ public void setPutYourLogoVisible(final boolean visible) {
+ getEntityTextLogo().setPutYourLogoVisible(visible);
+ }
+
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ if (oldTheme != null) {
+ getEntityTextLogo().removeStyleDependentName(oldTheme.toString());
+ }
+ getEntityTextLogo().addStyleDependentName(newTheme.toString());
+ }
+
+ private EntityTextLogo getEntityTextLogo() {
+ if (entityTextLogo == null) {
+ this.entityTextLogo = new EntityTextLogo();
+ }
+ return entityTextLogo;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenter.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenter.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,37 @@
+package org.ourproject.kune.workspace.client.entitylogo;
+
+import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.themes.WsTheme;
+import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+
+import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot2;
+
+public class EntityLogoPresenter implements EntityLogo {
+ private EntityLogoView view;
+
+ public EntityLogoPresenter(final StateManager stateManager, final WsThemePresenter theme) {
+ stateManager.onStateChanged(new Slot<StateDTO>() {
+ public void onEvent(final StateDTO state) {
+ final GroupDTO group = state.getGroup();
+ final boolean isAdmin = state.getGroupRights().isAdministrable();
+
+ view.setLogo(group.getLongName());
+ view.setPutYourLogoVisible(isAdmin);
+ }
+ });
+ theme.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ view.setTheme(oldTheme, newTheme);
+ }
+ });
+ }
+
+ public void init(final EntityLogoView view) {
+ this.view = view;
+
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoView.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoView.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,17 @@
+package org.ourproject.kune.workspace.client.entitylogo;
+
+import org.ourproject.kune.workspace.client.themes.WsTheme;
+
+import com.google.gwt.user.client.ui.Image;
+
+public interface EntityLogoView {
+
+ // FIXME: Don' use Image
+ public abstract void setLogo(final Image image);
+
+ public abstract void setLogo(final String groupName);
+
+ public abstract void setPutYourLogoVisible(final boolean visible);
+
+ public abstract void setTheme(final WsTheme oldTheme, WsTheme newTheme);
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterForm.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/RegisterForm.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,206 @@
+package org.ourproject.kune.workspace.client.signin;
+
+import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+
+import com.gwtext.client.data.SimpleStore;
+import com.gwtext.client.data.Store;
+import com.gwtext.client.widgets.form.ComboBox;
+import com.gwtext.client.widgets.form.TextField;
+import com.gwtext.client.widgets.form.VType;
+import com.gwtext.client.widgets.form.ValidationException;
+import com.gwtext.client.widgets.form.Validator;
+
+public class RegisterForm extends DefaultForm {
+
+ private static final String MUST_BE_BETWEEN_3_AND_15 = "Must be between 3 and 15 lowercase characters. Can only contain characters, numbers, and dashes";
+
+ private static final String NICK_FIELD = "nick";
+ private static final String EMAIL_FIELD = "email";
+ private static final String LONGNAME_FIELD = "long_name";
+ private static final String PASSWORD_FIELD = "password";
+ private static final String PASSWORD_FIELD_DUP = "passwordDup";
+ private static final String LANG_FIELD = "lang";
+ private static final String COUNTRY_FIELD = "country";
+ private static final String TIMEZONE_FIELD = "timezone";
+
+ private final TextField shortNameRegField;
+ private final TextField longNameRegField;
+ private final TextField passwdRegField;
+ private final TextField passwdRegFieldDup;
+ private final TextField emailRegField;
+ private final ComboBox languageCombo;
+ private final ComboBox countryCombo;
+ private final ComboBox timezoneCombo;
+
+ public RegisterForm(final SignInPresenter presenter, final I18nUITranslationService i18n) {
+ super.addStyleName("kune-Margin-Large-l");
+
+ shortNameRegField = new TextField();
+ shortNameRegField.setFieldLabel(i18n.t("Nickname"));
+ shortNameRegField.setName(NICK_FIELD);
+ shortNameRegField.setWidth(DEF_FIELD_WIDTH);
+ shortNameRegField.setAllowBlank(false);
+ shortNameRegField.setMinLength(3);
+ shortNameRegField.setMaxLength(15);
+ shortNameRegField.setRegex("^[a-z0-9_\\-]+$");
+ shortNameRegField.setMinLengthText(i18n.t(MUST_BE_BETWEEN_3_AND_15));
+ shortNameRegField.setMaxLengthText(i18n.t(MUST_BE_BETWEEN_3_AND_15));
+ shortNameRegField.setRegexText(i18n.t(MUST_BE_BETWEEN_3_AND_15));
+ shortNameRegField.setValidationEvent(false);
+ add(shortNameRegField);
+
+ longNameRegField = new TextField();
+ longNameRegField.setFieldLabel(i18n.t("Full Name"));
+ longNameRegField.setName(LONGNAME_FIELD);
+ longNameRegField.setWidth(DEF_FIELD_WIDTH);
+ longNameRegField.setAllowBlank(false);
+ longNameRegField.setMinLength(3);
+ longNameRegField.setMaxLength(50);
+ longNameRegField.setValidationEvent(false);
+ add(longNameRegField);
+
+ passwdRegField = new TextField();
+ passwdRegField.setFieldLabel(i18n.t("Password"));
+ passwdRegField.setName(PASSWORD_FIELD);
+ passwdRegField.setPassword(true);
+ passwdRegField.setAllowBlank(false);
+ passwdRegField.setMaxLength(40);
+ passwdRegField.setWidth(DEF_FIELD_WIDTH);
+ passwdRegField.setValidationEvent(false);
+ add(passwdRegField);
+
+ passwdRegFieldDup = new TextField();
+ passwdRegFieldDup.setFieldLabel(i18n.t("Retype password"));
+ passwdRegFieldDup.setName(PASSWORD_FIELD_DUP);
+ passwdRegFieldDup.setPassword(true);
+ passwdRegFieldDup.setAllowBlank(false);
+ passwdRegFieldDup.setMinLength(6);
+ passwdRegFieldDup.setMaxLength(40);
+ passwdRegFieldDup.setWidth(DEF_FIELD_WIDTH);
+ passwdRegFieldDup.setInvalidText(i18n.t("Passwords do not match"));
+ passwdRegFieldDup.setValidator(new Validator() {
+ public boolean validate(final String value) throws ValidationException {
+ return passwdRegField.getValueAsString().equals(passwdRegFieldDup.getValueAsString());
+ }
+ });
+ passwdRegFieldDup.setValidationEvent(false);
+ add(passwdRegFieldDup);
+
+ emailRegField = new TextField();
+ emailRegField.setFieldLabel(i18n.t("Email"));
+ emailRegField.setName(EMAIL_FIELD);
+ emailRegField.setVtype(VType.EMAIL);
+ emailRegField.setWidth(DEF_FIELD_WIDTH);
+ emailRegField.setAllowBlank(false);
+ emailRegField.setValidationEvent(false);
+
+ add(emailRegField);
+
+ final Store langStore = new SimpleStore(new String[] { "abbr", "language" }, presenter.getLanguages());
+ langStore.load();
+
+ languageCombo = new ComboBox();
+ languageCombo.setName(LANG_FIELD);
+ languageCombo.setMinChars(1);
+ languageCombo.setFieldLabel(i18n.t("Language"));
+ languageCombo.setStore(langStore);
+ languageCombo.setDisplayField("language");
+ languageCombo.setMode(ComboBox.LOCAL);
+ languageCombo.setTriggerAction(ComboBox.ALL);
+ languageCombo.setEmptyText(i18n.t("Enter language"));
+ languageCombo.setLoadingText(i18n.t("Searching..."));
+ languageCombo.setTypeAhead(true);
+ languageCombo.setTypeAheadDelay(1000);
+ languageCombo.setSelectOnFocus(false);
+ languageCombo.setWidth(186);
+ languageCombo.setAllowBlank(false);
+ languageCombo.setValueField("abbr");
+ languageCombo.setValue(presenter.getCurrentLanguage().getCode());
+ languageCombo.setPageSize(7);
+ languageCombo.setForceSelection(true);
+ languageCombo.setValidationEvent(false);
+ add(languageCombo);
+
+ final Store countryStore = new SimpleStore(new String[] { "abbr", "country" }, presenter.getCountries());
+ countryStore.load();
+
+ countryCombo = new ComboBox();
+ countryCombo.setName(COUNTRY_FIELD);
+ countryCombo.setMinChars(1);
+ countryCombo.setFieldLabel(i18n.t("Country"));
+ countryCombo.setStore(countryStore);
+ countryCombo.setDisplayField("country");
+ countryCombo.setMode(ComboBox.LOCAL);
+ countryCombo.setTriggerAction(ComboBox.ALL);
+ countryCombo.setEmptyText(i18n.t("Enter your country"));
+ countryCombo.setLoadingText(i18n.t("Searching..."));
+ countryCombo.setTypeAhead(true);
+ countryCombo.setTypeAheadDelay(1000);
+ countryCombo.setSelectOnFocus(false);
+ countryCombo.setWidth(186);
+ countryCombo.setAllowBlank(false);
+ countryCombo.setValueField("abbr");
+ countryCombo.setPageSize(7);
+ countryCombo.setForceSelection(true);
+ countryCombo.setValidationEvent(false);
+ add(countryCombo);
+
+ final Store timezoneStore = new SimpleStore(new String[] { "id" }, presenter.getTimezones());
+ timezoneStore.load();
+
+ timezoneCombo = new ComboBox();
+ timezoneCombo.setName(TIMEZONE_FIELD);
+ timezoneCombo.setMinChars(1);
+ timezoneCombo.setFieldLabel(i18n.t("Timezone"));
+ timezoneCombo.setStore(timezoneStore);
+ timezoneCombo.setDisplayField("id");
+ timezoneCombo.setMode(ComboBox.LOCAL);
+ timezoneCombo.setTriggerAction(ComboBox.ALL);
+ timezoneCombo.setEmptyText(i18n.t("Enter your timezone"));
+ timezoneCombo.setLoadingText(i18n.t("Searching..."));
+ timezoneCombo.setTypeAhead(true);
+ timezoneCombo.setTypeAheadDelay(1000);
+ timezoneCombo.setSelectOnFocus(false);
+ timezoneCombo.setWidth(186);
+ timezoneCombo.setAllowBlank(false);
+ timezoneCombo.setValueField("id");
+ timezoneCombo.setPageSize(7);
+ timezoneCombo.setForceSelection(true);
+ timezoneCombo.setValidationEvent(false);
+ add(timezoneCombo);
+ }
+
+ public String getCountry() {
+ return countryCombo.getValueAsString();
+ }
+
+ public String getEmail() {
+ return emailRegField.getValueAsString();
+ }
+
+ public String getLanguage() {
+ return languageCombo.getValueAsString();
+ }
+
+ public String getLongName() {
+ return longNameRegField.getValueAsString();
+ }
+
+ public String getRegisterPassword() {
+ return passwdRegField.getValueAsString();
+ }
+
+ public String getRegisterPasswordDup() {
+ return passwdRegFieldDup.getValueAsString();
+ }
+
+ public String getShortName() {
+ return shortNameRegField.getValueAsString();
+ }
+
+ public String getTimezone() {
+ return timezoneCombo.getValueAsString();
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignIn.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignIn.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignIn.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,28 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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 org.ourproject.kune.workspace.client.signin;
+
+import org.ourproject.kune.platf.client.dto.StateToken;
+
+public interface SignIn {
+
+ void doSignIn(StateToken previousStateToken);
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInForm.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInForm.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,48 @@
+package org.ourproject.kune.workspace.client.signin;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
+
+import com.gwtext.client.widgets.form.TextField;
+
+public class SignInForm extends DefaultForm {
+ private static final String NICKOREMAIL_FIELD = "nickOrEmail";
+ private static final String PASSWORD_FIELD = "password";
+
+ private final TextField loginNickOrEmailField;
+ private final TextField loginPassField;
+
+ public SignInForm(final I18nTranslationService i18n) {
+ super.addStyleName("kune-Margin-Large-trbl");
+
+ loginNickOrEmailField = new TextField();
+ loginNickOrEmailField.setFieldLabel(i18n.t("Nickname or email"));
+ loginNickOrEmailField.setName(NICKOREMAIL_FIELD);
+ loginNickOrEmailField.setWidth(DEF_FIELD_WIDTH);
+ loginNickOrEmailField.setAllowBlank(false);
+ loginNickOrEmailField.setValidationEvent(false);
+ super.add(loginNickOrEmailField);
+
+ loginPassField = new TextField();
+ loginPassField.setFieldLabel(i18n.t("Password"));
+ loginPassField.setName(PASSWORD_FIELD);
+ loginPassField.setWidth(DEF_FIELD_WIDTH);
+ loginPassField.setPassword(true);
+ loginPassField.setAllowBlank(false);
+ loginPassField.setValidationEvent(false);
+ super.add(loginPassField);
+ }
+
+ public void focusLogin() {
+ loginNickOrEmailField.focus();
+ }
+
+ public String getLoginPassword() {
+ return loginPassField.getValueAsString();
+ }
+
+ public String getNickOrEmail() {
+ return loginNickOrEmailField.getValueAsString();
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPanel.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPanel.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,357 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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 org.ourproject.kune.workspace.client.signin;
+
+import java.util.Date;
+
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
+import org.ourproject.kune.platf.client.ui.dialogs.InfoDialog;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.workspace.client.site.msg.SimpleMessagePanel;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.Cookies;
+import com.google.gwt.user.client.DeferredCommand;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.core.RegionPosition;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.Component;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.TabPanel;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+import com.gwtext.client.widgets.event.PanelListenerAdapter;
+import com.gwtext.client.widgets.event.WindowListenerAdapter;
+import com.gwtext.client.widgets.form.Field;
+import com.gwtext.client.widgets.layout.BorderLayout;
+import com.gwtext.client.widgets.layout.BorderLayoutData;
+import com.gwtext.client.widgets.layout.FitLayout;
+
+public class SignInPanel implements SignInView {
+ private class MessagePanel extends Panel {
+ private final SimpleMessagePanel messagesPanel;
+
+ public MessagePanel() {
+ setPaddings(10);
+ setBorder(false);
+ setHeight(60);
+ messagesPanel = new SimpleMessagePanel();
+ messagesPanel.setMessage("", SiteErrorType.info, SiteErrorType.error);
+ add(messagesPanel);
+ }
+
+ public void hide() {
+ messagesPanel.hide();
+ super.hide();
+ }
+
+ public void setMessage(final String message, final SiteErrorType lastMessageType, final SiteErrorType type) {
+ messagesPanel.setMessage(message, lastMessageType, type);
+ }
+
+ public void show() {
+ messagesPanel.show();
+ super.show();
+ }
+ }
+
+ private BasicDialog dialog;
+ private final SignInPresenter presenter;
+ private SignInForm signInForm;
+ private RegisterForm registerForm;
+ private MessagePanel messagesSignInPanel;
+ private InfoDialog welcomeDialog;
+ private TabPanel centerPanel;
+ private MessagePanel messagesRegisterPanel;
+ private final I18nUITranslationService i18n;
+
+ public SignInPanel(final SignInPresenter presenter, final I18nUITranslationService i18n, final WorkspaceSkeleton ws) {
+ this.i18n = i18n;
+ Field.setMsgTarget("side");
+ this.presenter = presenter;
+ createPanel();
+ }
+
+ public void center() {
+ dialog.center();
+ }
+
+ public String getCountry() {
+ return registerForm.getCountry();
+ }
+
+ public String getEmail() {
+ return registerForm.getEmail();
+ }
+
+ public String getLanguage() {
+ return registerForm.getLanguage();
+ }
+
+ public String getLoginPassword() {
+ return signInForm.getLoginPassword();
+ }
+
+ public String getLongName() {
+ return registerForm.getLongName();
+ }
+
+ public String getNickOrEmail() {
+ return signInForm.getNickOrEmail();
+ }
+
+ public String getRegisterPassword() {
+ return registerForm.getRegisterPassword();
+ }
+
+ public String getRegisterPasswordDup() {
+ return registerForm.getRegisterPasswordDup();
+ }
+
+ public String getShortName() {
+ return registerForm.getShortName();
+ }
+
+ public String getTimezone() {
+ return registerForm.getTimezone();
+ }
+
+ public void hide() {
+ dialog.hide();
+ }
+
+ public void hideMessages() {
+ messagesSignInPanel.hide();
+ if (messagesRegisterPanel != null) {
+ messagesRegisterPanel.hide();
+ }
+ renderDialogIfNeeded();
+ }
+
+ public boolean isRegisterFormValid() {
+ return registerForm.isValid();
+ }
+
+ public boolean isSignInFormValid() {
+ return signInForm.isValid();
+ }
+
+ public void mask(final String message) {
+ dialog.getEl().mask(message, "x-mask-loading");
+ }
+
+ public void maskProcessing() {
+ mask(i18n.t("Processing"));
+ }
+
+ public void reset() {
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ signInForm.reset();
+ if (registerForm != null) {
+ registerForm.reset();
+ }
+ }
+ });
+ }
+
+ public void setCookie(final String userHash) {
+ // http://code.google.com/p/google-web-toolkit-incubator/wiki/LoginSecurityFAQ
+ final long duration = Session.SESSION_DURATION;
+ final Date expires = new Date(System.currentTimeMillis() + duration);
+ Cookies.setCookie(Site.USERHASH, userHash, expires, null, "/", false);
+ GWT.log("Received hash: " + userHash, null);
+ }
+
+ public void setRegisterMessage(final String message, final SiteErrorType type) {
+ messagesRegisterPanel.setMessage(message, type, type);
+ messagesRegisterPanel.show();
+ renderDialogIfNeeded();
+ }
+
+ public void setSignInMessage(final String message, final SiteErrorType type) {
+ messagesSignInPanel.setMessage(message, type, type);
+ messagesSignInPanel.show();
+ renderDialogIfNeeded();
+ }
+
+ public void show() {
+ centerPanel.activate(0);
+ dialog.setVisible(true);
+ dialog.show();
+ Site.hideProgress();
+ dialog.focus();
+ signInForm.focusLogin();
+ }
+
+ public void showWelcolmeDialog() {
+ if (welcomeDialog == null) {
+ welcomeDialog = new InfoDialog(i18n.t("Welcome"), i18n.t("Thanks for registering"), i18n
+ .t("Now you can participate more actively in this site with other people and groups. "
+ + "You can also use your personal space to publish contents. "
+ + "Your email is not verified, please follow the instructions you will receive by email."),
+ i18n.t("Ok"), true, true, 400, 270);
+ }
+ welcomeDialog.show();
+ }
+
+ public void unMask() {
+ dialog.getEl().unmask();
+ }
+
+ private void confPanel(final Panel panel) {
+ // panel.setLayout(new FormLayout());
+ // panel.setAutoWidth(true);
+ // anel.setAutoHeight(true);
+ }
+
+ private Panel createNoAccountRegister() {
+ final Panel noAccRegisterPanel = new Panel();
+ noAccRegisterPanel.setBorder(false);
+ noAccRegisterPanel.setMargins(0, 90, 0, 0);
+ final Label dontHaveAccountLabel = new Label(i18n.t("Don't have an account?"));
+ final Label registerLabel = new Label(i18n.t("Create one."));
+ registerLabel.addClickListener(new ClickListener() {
+ public void onClick(final Widget arg0) {
+ centerPanel.activate(1);
+ }
+ });
+ registerLabel.addStyleName("kune-Margin-Medium-l");
+ registerLabel.addStyleName("kune-link");
+ noAccRegisterPanel.add(dontHaveAccountLabel);
+ noAccRegisterPanel.add(registerLabel);
+ return noAccRegisterPanel;
+ }
+
+ private void createPanel() {
+ dialog = new BasicDialog(i18n.t("Sign in"), true, false, 370, 400);
+ dialog.setLayout(new FitLayout());
+ final Panel dialogPanel = new Panel();
+ dialogPanel.setLayout(new BorderLayout());
+ // dialog.setAutoHeight(false);
+ // dialog.setAutoWidth(false);
+ // dialog.setAutoHeight(true);
+ // dialog.setAutoWidth(true);
+ dialogPanel.setHeight("100%");
+ dialogPanel.setWidth("auto");
+ // dialog.setCollapsible(false);
+
+ centerPanel = new TabPanel();
+ centerPanel.setActiveTab(0);
+ // centerPanel.setAutoWidth(true);
+ // centerPanel.setAutoHeight(true);
+ centerPanel.setClosable(false);
+
+ final Panel signInPanel = new Panel(i18n.t("Sign in"));
+ confPanel(signInPanel);
+ signInForm = new SignInForm(i18n);
+ signInPanel.add(signInForm.getForm());
+ signInPanel.add(createNoAccountRegister());
+ messagesSignInPanel = new MessagePanel();
+ signInPanel.add(messagesSignInPanel);
+
+ final Panel registerPanel = new Panel(i18n.t("Register"));
+ confPanel(registerPanel);
+
+ centerPanel.add(signInPanel);
+ centerPanel.add(registerPanel);
+ dialogPanel.add(centerPanel, new BorderLayoutData(RegionPosition.CENTER));
+ dialog.add(dialogPanel);
+
+ final Button signInBtn = new Button(i18n.t("Sign in"));
+ signInBtn.addListener(new ButtonListenerAdapter() {
+ public void onClick(final Button button, final EventObject e) {
+ signInForm.validate();
+ if (signInForm.isValid()) {
+ presenter.onFormSignIn();
+ }
+ }
+ });
+ dialog.addButton(signInBtn);
+
+ final Button registerBtn = new Button(i18n.t("Register"));
+ registerBtn.addListener(new ButtonListenerAdapter() {
+ public void onClick(final Button button, final EventObject e) {
+ registerForm.validate();
+ if (registerForm.isValid()) {
+ presenter.onFormRegister();
+ }
+ }
+ });
+ dialog.addButton(registerBtn);
+ registerBtn.hide();
+
+ final Button cancel = new Button();
+ dialog.addButton(cancel);
+ cancel.setText(i18n.tWithNT("Cancel", "used in button"));
+ cancel.addListener(new ButtonListenerAdapter() {
+ public void onClick(final Button button, final EventObject e) {
+ presenter.onCancel();
+ }
+ });
+
+ signInPanel.addListener(new PanelListenerAdapter() {
+ public void onActivate(final Panel panel) {
+ dialog.setTitle(i18n.t("Sign in"));
+ registerBtn.hide();
+ signInBtn.show();
+ }
+ });
+
+ registerPanel.addListener(new PanelListenerAdapter() {
+ public void onActivate(final Panel panel) {
+ if (registerForm == null) {
+ maskProcessing();
+ registerForm = new RegisterForm(presenter, i18n);
+ registerPanel.add(registerForm.getForm());
+ messagesRegisterPanel = new MessagePanel();
+ registerPanel.add(messagesRegisterPanel);
+ messagesRegisterPanel.hide();
+ renderDialogIfNeeded();
+ unMask();
+ }
+ dialog.setTitle(i18n.t("Register"));
+ signInBtn.hide();
+ registerBtn.show();
+ }
+ });
+
+ dialog.addListener(new WindowListenerAdapter() {
+ public void onHide(final Component component) {
+ presenter.onClose();
+ }
+ });
+ hideMessages();
+ renderDialogIfNeeded();
+ }
+
+ private void renderDialogIfNeeded() {
+ if (dialog.isRendered()) {
+ dialog.doLayout();
+ }
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPresenter.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInPresenter.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,208 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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 org.ourproject.kune.workspace.client.signin;
+
+import org.ourproject.kune.platf.client.dto.I18nCountryDTO;
+import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.dto.TimeZoneDTO;
+import org.ourproject.kune.platf.client.dto.UserDTO;
+import org.ourproject.kune.platf.client.dto.UserInfoDTO;
+import org.ourproject.kune.platf.client.errors.EmailAddressInUseException;
+import org.ourproject.kune.platf.client.errors.GroupNameInUseException;
+import org.ourproject.kune.platf.client.errors.UserAuthException;
+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.newgroup.SiteErrorType;
+import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.workspace.client.site.rpc.UserServiceAsync;
+
+import com.calclab.emite.client.im.roster.RosterManager.SubscriptionMode;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+public class SignInPresenter implements SignIn {
+
+ SignInView view;
+ private final Session session;
+ private final I18nUITranslationService i18n;
+ private final UserServiceAsync userService;
+ private final StateManager stateManager;
+ private StateToken previousStateToken;
+
+ public SignInPresenter(final Session session, final StateManager stateManager, final I18nUITranslationService i18n,
+ final UserServiceAsync userService) {
+ this.session = session;
+ this.stateManager = stateManager;
+ this.userService = userService;
+ this.i18n = i18n;
+ }
+
+ public void doSignIn(final StateToken previousStateToken) {
+ this.previousStateToken = previousStateToken;
+ if (!session.isLogged()) {
+ Site.showProgressProcessing();
+ view.show();
+ view.center();
+ Site.hideProgress();
+ } else {
+ stateManager.gotoToken(previousStateToken);
+ }
+ }
+
+ public Object[][] getCountries() {
+ return session.getCountriesArray();
+ }
+
+ public I18nLanguageDTO getCurrentLanguage() {
+ return session.getCurrentLanguage();
+ }
+
+ public Object[][] getLanguages() {
+ return session.getLanguagesArray();
+ }
+
+ public Object[][] getTimezones() {
+ return session.getTimezones();
+ }
+
+ public void init(final SignInView loginview) {
+ this.view = loginview;
+ }
+
+ public void onCancel() {
+ resetMessages();
+ reset();
+ view.hide();
+ stateManager.gotoToken(previousStateToken);
+ }
+
+ public void onClose() {
+ reset();
+ view.hideMessages();
+ if (!session.isLogged()) {
+ stateManager.gotoToken(previousStateToken);
+ }
+ }
+
+ public void onFormRegister() {
+ if (view.isRegisterFormValid()) {
+ view.maskProcessing();
+
+ final I18nLanguageDTO language = new I18nLanguageDTO();
+ language.setCode(view.getLanguage());
+
+ final I18nCountryDTO country = new I18nCountryDTO();
+ country.setCode(view.getCountry());
+
+ final TimeZoneDTO timezone = new TimeZoneDTO();
+ timezone.setId(view.getTimezone());
+
+ final UserDTO user = new UserDTO(view.getLongName(), view.getShortName(), view.getRegisterPassword(), view
+ .getEmail(), language, country, timezone, null, true, SubscriptionMode.manual, "blue");
+ final AsyncCallback<UserInfoDTO> callback = new AsyncCallback<UserInfoDTO>() {
+ public void onFailure(final Throwable caught) {
+ view.unMask();
+ try {
+ throw caught;
+ } catch (final EmailAddressInUseException e) {
+ view.setRegisterMessage(i18n.t("This email in in use by other person, try with another."),
+ SiteErrorType.error);
+ } catch (final GroupNameInUseException e) {
+ view.setRegisterMessage(i18n.t("This name in already in use, try with a different name."),
+ SiteErrorType.error);
+ } catch (final Throwable e) {
+ view.setRegisterMessage(i18n.t("Error during registration."), SiteErrorType.error);
+ GWT.log("Other kind of exception in user registration" + e.getMessage() + ", "
+ + e.getLocalizedMessage(), null);
+ e.printStackTrace();
+ throw new RuntimeException();
+ }
+ }
+
+ public void onSuccess(final UserInfoDTO userInfoDTO) {
+ stateManager.gotoToken(userInfoDTO.getHomePage());
+ onSignIn(userInfoDTO);
+ view.hide();
+ view.unMask();
+ view.showWelcolmeDialog();
+ }
+ };
+ userService.createUser(user, callback);
+ }
+ }
+
+ protected void onFormSignIn() {
+ if (view.isSignInFormValid()) {
+ view.maskProcessing();
+
+ final String nickOrEmail = view.getNickOrEmail();
+ final String passwd = view.getLoginPassword();
+
+ final UserDTO user = new UserDTO();
+ user.setShortName(nickOrEmail);
+ user.setPassword(passwd);
+
+ final AsyncCallback<UserInfoDTO> callback = new AsyncCallback<UserInfoDTO>() {
+ public void onFailure(final Throwable caught) {
+ view.unMask();
+ Site.hideProgress();
+ try {
+ throw caught;
+ } catch (final UserAuthException e) {
+ view.setSignInMessage(i18n.t("Incorrect nickname/email or password"), SiteErrorType.error);
+ } catch (final Throwable e) {
+ view.setSignInMessage("Error in login", SiteErrorType.error);
+ GWT.log("Other kind of exception in LoginFormPresenter/doLogin", null);
+ throw new RuntimeException();
+ }
+ }
+
+ public void onSuccess(final UserInfoDTO userInfoDTO) {
+ onSignIn(userInfoDTO);
+ stateManager.gotoToken(previousStateToken);
+ view.hide();
+ view.unMask();
+ }
+ };
+ userService.login(user.getShortName(), user.getPassword(), callback);
+ }
+ }
+
+ private void onSignIn(final UserInfoDTO userInfoDTO) {
+ final String userHash = userInfoDTO.getUserHash();
+ view.setCookie(userHash);
+ session.setUserHash(userHash);
+ session.setCurrentUserInfo(userInfoDTO);
+ final I18nLanguageDTO language = userInfoDTO.getLanguage();
+ i18n.changeCurrentLanguage(language.getCode());
+ session.setCurrentLanguage(language);
+ }
+
+ private void reset() {
+ view.reset();
+ }
+
+ private void resetMessages() {
+ view.hideMessages();
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInView.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/signin/SignInView.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,73 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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 org.ourproject.kune.workspace.client.signin;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+
+public interface SignInView extends View {
+
+ public void center();
+
+ public String getCountry();
+
+ public String getEmail();
+
+ public String getLanguage();
+
+ public String getLoginPassword();
+
+ public String getLongName();
+
+ public String getNickOrEmail();
+
+ public String getRegisterPassword();
+
+ public String getRegisterPasswordDup();
+
+ public String getShortName();
+
+ public String getTimezone();
+
+ public void hide();
+
+ public void hideMessages();
+
+ public boolean isRegisterFormValid();
+
+ public boolean isSignInFormValid();
+
+ public void maskProcessing();
+
+ public void reset();
+
+ public void show();
+
+ public void showWelcolmeDialog();
+
+ public void unMask();
+
+ void setCookie(String userHash);
+
+ void setRegisterMessage(String message, SiteErrorType type);
+
+ void setSignInMessage(String message, SiteErrorType type);
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/AbstractBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/AbstractBar.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/AbstractBar.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,45 @@
+package org.ourproject.kune.workspace.client.skel;
+
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class AbstractBar extends Composite {
+ private final HorizontalPanel childPanel;
+ private final HorizontalPanel mainPanel;
+
+ public AbstractBar() {
+ mainPanel = new HorizontalPanel();
+ childPanel = new HorizontalPanel();
+ mainPanel.add(childPanel);
+ initWidget(mainPanel);
+ mainPanel.setWidth("100%");
+ }
+
+ public void add(final Widget widget) {
+ childPanel.add(widget);
+ childPanel.setCellVerticalAlignment(widget, VerticalPanel.ALIGN_MIDDLE);
+ }
+
+ public void addFill() {
+ final Label emptyLabel = new Label("");
+ this.add(emptyLabel);
+ childPanel.setCellWidth(emptyLabel, "100%");
+ }
+
+ public void addSeparator() {
+ final Label emptyLabel = new Label("");
+ emptyLabel.setStyleName("ytb-sep");
+ emptyLabel.addStyleName("k-toolbar-sep");
+ this.add(emptyLabel);
+ }
+
+ public void addSpacer() {
+ final Label emptyLabel = new Label("");
+ emptyLabel.setStyleName("ytb-spacer");
+ this.add(emptyLabel);
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/Entity.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/Entity.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/Entity.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,47 @@
+package org.ourproject.kune.workspace.client.skel;
+
+import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
+import org.ourproject.kune.workspace.client.themes.WsTheme;
+
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.layout.FitLayout;
+
+public class Entity extends DefaultBorderLayout {
+
+ private final EntityWorkspace entityWorkspace;
+ private final EntitySummary entitySummary;
+ private final Panel entityMainHeader;
+
+ public Entity() {
+ entityMainHeader = new Panel();
+ entityMainHeader.setBorder(false);
+ entityMainHeader.setLayout(new FitLayout());
+ entitySummary = new EntitySummary();
+ entityWorkspace = new EntityWorkspace();
+ add(entityMainHeader, DefaultBorderLayout.Position.NORTH, 65);
+ add(entityWorkspace.getPanel(), DefaultBorderLayout.Position.CENTER);
+ add(entitySummary.getPanel(), DefaultBorderLayout.Position.EAST, true, 150);
+ }
+
+ public void addToEntityMainHeader(final Widget widget) {
+ entityMainHeader.add(widget);
+ doLayoutIfNeeded();
+ }
+
+ public EntitySummary getEntitySummary() {
+ return entitySummary;
+ }
+
+ public EntityWorkspace getEntityWorkspace() {
+ return entityWorkspace;
+ }
+
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ if (oldTheme != null) {
+ super.removeStyle("k-entity-" + oldTheme);
+ }
+ super.addStyle("k-entity-" + newTheme);
+ entityWorkspace.setTheme(oldTheme, newTheme);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntitySummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntitySummary.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntitySummary.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,66 @@
+package org.ourproject.kune.workspace.client.skel;
+
+import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
+
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.Toolbar;
+import com.gwtext.client.widgets.event.ContainerListener;
+import com.gwtext.client.widgets.layout.FitLayout;
+
+public class EntitySummary {
+ private final Panel entityTools;
+ private final Panel entitySummary;
+ private final DefaultBorderLayout mainPanel;
+ private final Toolbar trayBar;
+ private final VerticalPanel vpTools;
+
+ public EntitySummary() {
+ mainPanel = new DefaultBorderLayout();
+ entityTools = new Panel();
+ entityTools.setLayout(new FitLayout());
+ entityTools.setAutoHeight(true);
+ vpTools = new VerticalPanel();
+ entityTools.add(vpTools);
+ entitySummary = new Panel();
+ entityTools.setBorder(false);
+ entitySummary.setBorder(false);
+ entityTools.setAutoScroll(false);
+ entitySummary.setAutoScroll(true);
+ entitySummary.setCls("k-entity-summary");
+ trayBar = mainPanel.createBottomBar(entitySummary, "k-site-traybar");
+ mainPanel.add(entityTools, DefaultBorderLayout.Position.NORTH);
+ mainPanel.add(entitySummary, DefaultBorderLayout.Position.CENTER);
+ trayBar.addFill();
+ }
+
+ public void addInSummary(final Widget widget) {
+ entitySummary.add(widget);
+ entitySummary.syncSize();
+ mainPanel.doLayoutIfNeeded();
+ }
+
+ public void addInTools(final Widget widget) {
+ vpTools.add(widget);
+ // entityTools.render(widget.getElement());
+ if (entityTools.isRendered()) {
+ entityTools.syncSize();
+ entityTools.doLayout(false);
+ mainPanel.doLayoutIfNeeded();
+ }
+ }
+
+ public void addListener(final ContainerListener listener) {
+ entitySummary.addListener(listener);
+ }
+
+ public Panel getPanel() {
+ return mainPanel.getPanel();
+ }
+
+ public Toolbar getSiteTraybar() {
+ return trayBar;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,138 @@
+package org.ourproject.kune.workspace.client.skel;
+
+import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
+import org.ourproject.kune.platf.client.ui.RoundedPanel;
+import org.ourproject.kune.workspace.client.themes.WsTheme;
+
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.layout.AnchorLayout;
+import com.gwtext.client.widgets.layout.AnchorLayoutData;
+
+public class EntityWorkspace extends DefaultBorderLayout {
+ private final Panel content;
+ private final Panel context;
+ private final TitleBar title;
+ private final TitleBar subTitle;
+ private final TitleBar bottom;
+ private final Toolbar contentTopBar;
+ private final Toolbar contentBottomBar;
+ private final Toolbar contextTopBar;
+ private final Toolbar contextBottomBar;
+ private final RoundedPanel roundedTitle;
+ private final RoundedPanel roundedBottom;
+ private final DefaultBorderLayout contextWrap;
+
+ public EntityWorkspace() {
+ final Panel titles = new Panel();
+ titles.setBorder(false);
+ titles.setLayout(new AnchorLayout());
+ final Panel bottomPanel = new Panel();
+ bottomPanel.setBorder(false);
+ bottomPanel.setLayout(new AnchorLayout());
+
+ title = new TitleBar();
+ title.setHeight("" + (DEF_TOOLBAR_HEIGHT - 2));
+ title.setStylePrimaryName("k-entity-title");
+ subTitle = new TitleBar();
+ subTitle.setStylePrimaryName("k-entity-subtitle");
+ bottom = new TitleBar();
+ bottom.setHeight("" + (DEF_TOOLBAR_HEIGHT - 2));
+ bottom.setStylePrimaryName("k-entity-bottom");
+
+ roundedTitle = new RoundedPanel(title, RoundedPanel.TOPLEFT, 2);
+ roundedBottom = new RoundedPanel(bottom, RoundedPanel.BOTTOMLEFT, 2);
+
+ titles.add(roundedTitle, new AnchorLayoutData("100% -" + DEF_TOOLBAR_HEIGHT));
+ titles.add(subTitle, new AnchorLayoutData("100% -" + DEF_TOOLBAR_HEIGHT));
+ bottomPanel.add(roundedBottom, new AnchorLayoutData("100% -" + DEF_TOOLBAR_HEIGHT));
+
+ final DefaultBorderLayout contentWrap = new DefaultBorderLayout();
+ contextWrap = new DefaultBorderLayout();
+ contentWrap.setBorder(true);
+ contextWrap.setBorder(true);
+ content = new Panel();
+ context = new Panel();
+ content.setBorder(false);
+ context.setBorder(false);
+ context.setCollapsible(true);
+ content.setPaddings(7);
+ content.setAutoScroll(true);
+ context.setAutoScroll(true);
+
+ contentTopBar = new Toolbar();
+ contentBottomBar = new Toolbar();
+ contextTopBar = new Toolbar();
+ contextBottomBar = new Toolbar();
+ contentTopBar.addStyleName("k-toolbar-bottom-line");
+ contentBottomBar.addStyleName("k-toolbar-top-line");
+ contextTopBar.addStyleName("k-toolbar-bottom-line");
+ contextBottomBar.addStyleName("k-toolbar-top-line");
+ contentWrap.add(contentTopBar.getPanel(), Position.NORTH, false, DEF_TOOLBAR_HEIGHT);
+ contextWrap.add(contextTopBar.getPanel(), Position.NORTH, false, DEF_TOOLBAR_HEIGHT);
+ contentWrap.add(content, Position.CENTER);
+ contextWrap.add(context, Position.CENTER);
+ contentWrap.add(contentBottomBar.getPanel(), Position.SOUTH, false, DEF_TOOLBAR_HEIGHT);
+ contextWrap.add(contextBottomBar.getPanel(), Position.SOUTH, false, DEF_TOOLBAR_HEIGHT);
+
+ add(titles, DefaultBorderLayout.Position.NORTH, DEF_TOOLBAR_HEIGHT * 2);
+ add(contentWrap.getPanel(), DefaultBorderLayout.Position.CENTER);
+ add(contextWrap.getPanel(), DefaultBorderLayout.Position.EAST, true, 175);
+ add(bottomPanel, DefaultBorderLayout.Position.SOUTH, DEF_TOOLBAR_HEIGHT + 2);
+ }
+
+ public TitleBar getBottomTitle() {
+ return bottom;
+ }
+
+ public Toolbar getContentBottomBar() {
+ return contentBottomBar;
+ }
+
+ public Toolbar getContentTopBar() {
+ return contentTopBar;
+ }
+
+ public Toolbar getContextBottomBar() {
+ return contextBottomBar;
+ }
+
+ public Toolbar getContextTopBar() {
+ return contextTopBar;
+ }
+
+ public TitleBar getSubTitle() {
+ return subTitle;
+ }
+
+ public TitleBar getTitle() {
+ return title;
+ }
+
+ public void setContent(final Widget widget) {
+ setPanel(content, widget);
+ }
+
+ public void setContext(final Widget widget) {
+ setPanel(context, widget);
+ }
+
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ final String themeS = newTheme.toString();
+ if (oldTheme != null) {
+ final String previousThemeS = oldTheme.toString();
+ title.removeStyleDependentName(previousThemeS);
+ subTitle.removeStyleDependentName(previousThemeS);
+ bottom.removeStyleDependentName(previousThemeS);
+ super.removeStyle("k-entityworkspace-" + previousThemeS);
+ context.removeStyleName("k-entity-context-" + previousThemeS);
+ }
+ super.addStyle("k-entityworkspace-" + newTheme);
+ roundedTitle.setCornerStyleName("k-entity-title-rd-" + newTheme);
+ roundedBottom.setCornerStyleName("k-entity-bottom-rd-" + newTheme);
+ title.addStyleDependentName(themeS);
+ subTitle.addStyleDependentName(themeS);
+ bottom.addStyleDependentName(themeS);
+ context.addStyleName("k-entity-context-" + newTheme);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SiteBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SiteBar.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SiteBar.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,33 @@
+package org.ourproject.kune.workspace.client.skel;
+
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.widgets.Panel;
+
+public class SiteBar extends Panel {
+
+ private final TitleBar titleBar;
+
+ public SiteBar() {
+ super.setBorder(false);
+ titleBar = new TitleBar();
+ titleBar.setStyleName("k-sitebar");
+ super.add(titleBar);
+ }
+
+ public void add(final Widget widget) {
+ titleBar.add(widget);
+ }
+
+ public Widget addFill() {
+ return titleBar.addFill();
+ }
+
+ public Widget addSeparator() {
+ return titleBar.addSeparator();
+ }
+
+ public Widget addSpacer() {
+ return titleBar.addSpacer();
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/TitleBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/TitleBar.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/TitleBar.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,48 @@
+package org.ourproject.kune.workspace.client.skel;
+
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class TitleBar extends Composite {
+
+ private final HorizontalPanel childPanel;
+ private final HorizontalPanel mainPanel;
+
+ public TitleBar() {
+ mainPanel = new HorizontalPanel();
+ childPanel = new HorizontalPanel();
+ mainPanel.add(childPanel);
+ initWidget(mainPanel);
+ mainPanel.setWidth("100%");
+ }
+
+ public void add(final Widget widget) {
+ childPanel.add(widget);
+ childPanel.setCellVerticalAlignment(widget, VerticalPanel.ALIGN_MIDDLE);
+ }
+
+ public Widget addFill() {
+ final Label emptyLabel = new Label("");
+ this.add(emptyLabel);
+ childPanel.setCellWidth(emptyLabel, "100%");
+ return emptyLabel;
+ }
+
+ public Widget addSeparator() {
+ final Label emptyLabel = new Label("");
+ emptyLabel.setStyleName("ytb-sep");
+ emptyLabel.addStyleName("k-toolbar-sep");
+ this.add(emptyLabel);
+ return emptyLabel;
+ }
+
+ public Widget addSpacer() {
+ final Label emptyLabel = new Label("");
+ emptyLabel.setStyleName("ytb-spacer");
+ this.add(emptyLabel);
+ return emptyLabel;
+ }
+}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/Toolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/Toolbar.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/Toolbar.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,78 @@
+package org.ourproject.kune.workspace.client.skel;
+
+import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
+
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.widgets.Panel;
+
+public class Toolbar {
+ private final Panel container;
+ private final HorizontalPanel childPanel;
+
+ public Toolbar() {
+ container = new Panel();
+ container.setBorder(false);
+ container.setBodyBorder(false);
+ container.setHeight(DefaultBorderLayout.DEF_TOOLBAR_HEIGHT);
+ container.setWidth("100%");
+ container.setHeader(false);
+ container.setBaseCls("x-toolbar");
+ container.addClass("x-panel");
+ childPanel = new HorizontalPanel();
+ container.add(childPanel);
+ }
+
+ public void add(final Widget widget) {
+ childPanel.add(widget);
+ doLayoutIfNeeded();
+ }
+
+ public Widget addFill() {
+ final Label emptyLabel = new Label("");
+ this.add(emptyLabel);
+ childPanel.setCellWidth(emptyLabel, "100%");
+ return emptyLabel;
+ }
+
+ public Widget addSeparator() {
+ final Label emptyLabel = new Label("");
+ emptyLabel.setStyleName("ytb-sep");
+ emptyLabel.addStyleName("k-toolbar-sep");
+ this.add(emptyLabel);
+ return emptyLabel;
+ }
+
+ public Widget addSpacer() {
+ final Label emptyLabel = new Label("");
+ emptyLabel.setStyleName("ytb-spacer");
+ this.add(emptyLabel);
+ return emptyLabel;
+ }
+
+ public void addStyleName(final String cls) {
+ container.addClass(cls);
+ }
+
+ public void doLayoutIfNeeded() {
+ if (container.isRendered()) {
+ container.doLayout(false);
+ }
+ }
+
+ public Panel getPanel() {
+ return container;
+ }
+
+ public void remove(final Widget widget) {
+ childPanel.remove(widget);
+ doLayoutIfNeeded();
+ }
+
+ public void removeAll() {
+ childPanel.clear();
+ doLayoutIfNeeded();
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/WorkspaceSkeleton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/WorkspaceSkeleton.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/WorkspaceSkeleton.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,108 @@
+package org.ourproject.kune.workspace.client.skel;
+
+import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
+import org.ourproject.kune.workspace.client.themes.WsTheme;
+
+import com.calclab.suco.client.signal.Slot0;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import com.google.gwt.user.client.ui.RootPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.core.ExtElement;
+import com.gwtext.client.widgets.MessageBox;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.Toolbar;
+import com.gwtext.client.widgets.Viewport;
+import com.gwtext.client.widgets.layout.FitLayout;
+
+public class WorkspaceSkeleton {
+ private final Entity entity;
+ private final SiteBar sitebar;
+ private final DefaultBorderLayout mainPanel;
+ private final Panel container;
+ private final ExtElement extRootBody;
+
+ public WorkspaceSkeleton() {
+ extRootBody = new ExtElement(RootPanel.getBodyElement());
+ container = new Panel();
+ container.setLayout(new FitLayout());
+ container.setBorder(false);
+ container.setPaddings(5);
+ mainPanel = new DefaultBorderLayout();
+ sitebar = new SiteBar();
+ entity = new Entity();
+ mainPanel.add(sitebar, DefaultBorderLayout.Position.NORTH, DefaultBorderLayout.DEF_TOOLBAR_HEIGHT);
+ mainPanel.add(entity.getPanel(), DefaultBorderLayout.Position.CENTER);
+ container.add(mainPanel.getPanel());
+ new Viewport(container);
+ }
+
+ public void addToEntityMainHeader(final Widget widget) {
+ entity.addToEntityMainHeader(widget);
+ }
+
+ public void askConfirmation(final String title, final String message, final Slot0 onConfirmed, final Slot0 onCancel) {
+ MessageBox.confirm(title, message, new MessageBox.ConfirmCallback() {
+ public void execute(final String btnID) {
+ if (btnID.equals("yes")) {
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ onConfirmed.onEvent();
+ }
+ });
+ } else {
+ onCancel.onEvent();
+ }
+ }
+ });
+ }
+
+ public EntitySummary getEntitySummary() {
+ return entity.getEntitySummary();
+ }
+
+ public EntityWorkspace getEntityWorkspace() {
+ return entity.getEntityWorkspace();
+ }
+
+ public SiteBar getSiteBar() {
+ return sitebar;
+ }
+
+ public Toolbar getSiteTraybar() {
+ return entity.getEntitySummary().getSiteTraybar();
+ }
+
+ public void mask() {
+ extRootBody.mask();
+ }
+
+ public void mask(final String message) {
+ extRootBody.mask(message, "x-mask-loading");
+ }
+
+ public void promptMessage(final String title, final String message, final Slot0 onEnter) {
+ MessageBox.prompt(title, message, new MessageBox.PromptCallback() {
+ public void execute(final String btnID, final String text) {
+ // FIXME: use btnID
+ onEnter.onEvent();
+ }
+ });
+ }
+
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ entity.setTheme(oldTheme, newTheme);
+ }
+
+ public void showAlertMessage(final String title, final String message) {
+ MessageBox.alert(title, message, new MessageBox.AlertCallback() {
+ public void execute() {
+ }
+ });
+ }
+
+ public void unMask() {
+ extRootBody.unmask();
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsTheme.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsTheme.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsTheme.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,48 @@
+package org.ourproject.kune.workspace.client.themes;
+
+public class WsTheme {
+ private final String name;
+
+ public WsTheme(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final WsTheme other = (WsTheme) obj;
+ if (name == null) {
+ if (other.name != null) {
+ return false;
+ }
+ } else if (!name.equals(other.name)) {
+ return false;
+ }
+ return true;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (name == null ? 0 : name.hashCode());
+ return result;
+ }
+
+ public String toString() {
+ return name;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemePanel.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemePanel.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,59 @@
+package org.ourproject.kune.workspace.client.themes;
+
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.calclab.suco.client.signal.Slot2;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.ToolbarButton;
+import com.gwtext.client.widgets.menu.BaseItem;
+import com.gwtext.client.widgets.menu.Menu;
+import com.gwtext.client.widgets.menu.MenuItem;
+import com.gwtext.client.widgets.menu.event.BaseItemListenerAdapter;
+
+public class WsThemePanel extends ToolbarButton implements WsThemeView {
+
+ private final Menu menu;
+ private final WsThemePresenter presenter;
+ private final I18nUITranslationService i18n;
+
+ public WsThemePanel(final WorkspaceSkeleton ws, final WsThemePresenter presenter,
+ final I18nUITranslationService i18n) {
+ this.presenter = presenter;
+ this.i18n = i18n;
+ menu = new Menu();
+
+ menu.setDefaultAlign("br-tr");
+ super.setMenu(menu);
+ super.setIcon("images/colors.gif");
+ super.setTooltip(i18n.t("Select Workspace theme for this group"));
+ ws.getSiteTraybar().addButton(this);
+ presenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ ws.setTheme(oldTheme, newTheme);
+ }
+ });
+ }
+
+ public void setThemes(final String[] themes) {
+ for (int i = 0; i < themes.length; i++) {
+ final WsTheme theme = new WsTheme(themes[i]);
+ final MenuItem item = new MenuItem();
+ final String name = theme.getName();
+ item.setIconCls("k-wstheme-icon-" + name);
+ item.setText(i18n.t(name));
+ menu.addItem(item);
+ item.addListener(new BaseItemListenerAdapter() {
+ @Override
+ public void onClick(final BaseItem item, final EventObject e) {
+ presenter.onChangeGroupWsTheme(theme);
+ }
+ });
+ }
+ }
+
+ public void setVisible(final boolean visible) {
+ super.setVisible(visible);
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemePresenter.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemePresenter.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,78 @@
+package org.ourproject.kune.workspace.client.themes;
+
+import org.ourproject.kune.platf.client.dto.InitDataDTO;
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
+import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.site.Site;
+
+import com.calclab.suco.client.provider.Provider;
+import com.calclab.suco.client.signal.Signal2;
+import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot2;
+
+public class WsThemePresenter {
+
+ private WsThemeView view;
+ private WsTheme previousTheme;
+ private final Signal2<WsTheme, WsTheme> onThemeChanged;
+ private final Provider<GroupServiceAsync> groupServiceProvider;
+ private final Session session;
+
+ public WsThemePresenter(final Session session, final Provider<GroupServiceAsync> groupServiceProvider,
+ final StateManager stateManager) {
+ this.session = session;
+ this.groupServiceProvider = groupServiceProvider;
+ this.onThemeChanged = new Signal2<WsTheme, WsTheme>("onThemeChanged");
+ session.onInitDataReceived(new Slot<InitDataDTO>() {
+ public void onEvent(final InitDataDTO initData) {
+ view.setThemes(initData.getWsThemes());
+ setTheme(new WsTheme(initData.getWsThemes()[0]));
+ }
+ });
+ stateManager.onStateChanged(new Slot<StateDTO>() {
+ public void onEvent(final StateDTO state) {
+ setState(state);
+ }
+ });
+ }
+
+ public void init(final WsThemeView view) {
+ this.view = view;
+ }
+
+ public void onThemeChanged(final Slot2<WsTheme, WsTheme> slot) {
+ onThemeChanged.add(slot);
+ }
+
+ protected void onChangeGroupWsTheme(final WsTheme newTheme) {
+ Site.showProgressProcessing();
+ groupServiceProvider.get().changeGroupWsTheme(session.getUserHash(),
+ session.getCurrentState().getGroup().getShortName(), newTheme.getName(),
+ new AsyncCallbackSimple<Object>() {
+ public void onSuccess(final Object result) {
+ setTheme(newTheme);
+ Site.hideProgress();
+ }
+ });
+ }
+
+ private void setState(final StateDTO state) {
+ setTheme(new WsTheme(state.getGroup().getWorkspaceTheme()));
+ if (state.getGroupRights().isAdministrable()) {
+ view.setVisible(true);
+ } else {
+ view.setVisible(false);
+ }
+ }
+
+ private void setTheme(final WsTheme newTheme) {
+ if (previousTheme == null || !previousTheme.equals(newTheme)) {
+ onThemeChanged.fire(previousTheme, newTheme);
+ }
+ previousTheme = newTheme;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemeView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemeView.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemeView.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,9 @@
+package org.ourproject.kune.workspace.client.themes;
+
+public interface WsThemeView {
+
+ void setThemes(String[] themes);
+
+ void setVisible(boolean visible);
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePanel.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePanel.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,68 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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 org.ourproject.kune.workspace.client.title;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.skel.TitleBar;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.Label;
+
+public class EntitySubTitlePanel implements EntitySubTitleView {
+ private final Label subTitleLeftLabel;
+ private final Label subTitleRightLabel;
+
+ public EntitySubTitlePanel(final EntitySubTitlePresenter presenter, final I18nTranslationService i18n,
+ final WorkspaceSkeleton ws) {
+ subTitleLeftLabel = new Label();
+ subTitleRightLabel = new Label();
+
+ final TitleBar wsSubTitle = ws.getEntityWorkspace().getSubTitle();
+ wsSubTitle.add(subTitleLeftLabel);
+ wsSubTitle.addFill();
+ wsSubTitle.add(subTitleRightLabel);
+
+ subTitleRightLabel.setText(i18n.t("Language:"));
+
+ subTitleLeftLabel.addStyleName("kune-Margin-Large-l");
+ subTitleLeftLabel.addStyleName("kune-ft15px");
+ subTitleRightLabel.addStyleName("kune-Margin-Large-r");
+ subTitleRightLabel.addStyleName("kune-ft12px");
+ }
+
+ public void setContentSubTitleLeft(final String subTitle) {
+ subTitleLeftLabel.setText(subTitle);
+ }
+
+ public void setContentSubTitleLeftVisible(final boolean visible) {
+ subTitleLeftLabel.setVisible(visible);
+ }
+
+ public void setContentSubTitleRight(final String subTitle) {
+ subTitleRightLabel.setText(subTitle);
+
+ }
+
+ public void setContentSubTitleRightVisible(final boolean visible) {
+ subTitleRightLabel.setVisible(visible);
+ }
+
+}
Added: 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-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePresenter.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,73 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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 org.ourproject.kune.workspace.client.title;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.StateManager;
+
+import com.calclab.suco.client.signal.Slot;
+
+public class EntitySubTitlePresenter {
+
+ private EntitySubTitleView view;
+ private final I18nTranslationService i18n;
+
+ public EntitySubTitlePresenter(final I18nTranslationService i18n, final StateManager stateManager) {
+ this.i18n = i18n;
+ stateManager.onStateChanged(new Slot<StateDTO>() {
+ public void onEvent(final StateDTO state) {
+ setState(state);
+ }
+ });
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final EntitySubTitleView view) {
+ this.view = view;
+ }
+
+ public void setContentLanguage(final String langName) {
+ view.setContentSubTitleRight(i18n.t("Language: [%s]", langName));
+ }
+
+ private void setState(final StateDTO state) {
+ if (state.hasDocument()) {
+ view.setContentSubTitleLeft(i18n.tWithNT("by: [%s]", "used in a list of authors", state.getAuthors().get(0)
+ .getName()));
+ view.setContentSubTitleLeftVisible(true);
+ } else {
+ view.setContentSubTitleLeftVisible(false);
+ }
+ if (state.getLanguage() != null) {
+ final String langName = state.getLanguage().getEnglishName();
+ setContentLanguage(langName);
+ view.setContentSubTitleRightVisible(true);
+ } else {
+ view.setContentSubTitleRightVisible(false);
+ }
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitleView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitleView.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitleView.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,34 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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 org.ourproject.kune.workspace.client.title;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface EntitySubTitleView extends View {
+
+ void setContentSubTitleLeft(String subTitle);
+
+ void setContentSubTitleRight(String subTitle);
+
+ void setContentSubTitleLeftVisible(boolean visible);
+
+ void setContentSubTitleRightVisible(boolean visible);
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,72 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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 org.ourproject.kune.workspace.client.title;
+
+import org.ourproject.kune.platf.client.ui.EditableClickListener;
+import org.ourproject.kune.platf.client.ui.EditableIconLabel;
+import org.ourproject.kune.workspace.client.skel.TitleBar;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.Label;
+
+public class EntityTitlePanel implements EntityTitleView {
+ private final EditableIconLabel titleLabel;
+ private final Label dateLabel;
+
+ public EntityTitlePanel(final WorkspaceSkeleton ws, final EntityTitlePresenter presenter) {
+ titleLabel = new EditableIconLabel(new EditableClickListener() {
+ public void onEdited(final String text) {
+ presenter.onTitleRename(text);
+ }
+ });
+ dateLabel = new Label();
+
+ final TitleBar wsTitle = ws.getEntityWorkspace().getTitle();
+ wsTitle.add(titleLabel);
+ wsTitle.addFill();
+ wsTitle.add(dateLabel);
+ titleLabel.addStyleName("kune-Margin-Large-l");
+ titleLabel.addStyleName("kune-ft17px");
+ dateLabel.addStyleName("kune-Margin-Large-r");
+ dateLabel.addStyleName("kune-ft12px");
+ }
+
+ public void restoreOldTitle() {
+ titleLabel.restoreOldText();
+ }
+
+ public void setContentDate(final String date) {
+ dateLabel.setText(date);
+ }
+
+ public void setContentTitle(final String title) {
+ titleLabel.setText(title);
+ }
+
+ public void setContentTitleEditable(final boolean editable) {
+ titleLabel.setEditable(editable);
+ }
+
+ public void setDateVisible(final boolean visible) {
+ dateLabel.setVisible(visible);
+ }
+
+}
Added: 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-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,121 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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 org.ourproject.kune.workspace.client.title;
+
+import java.util.Date;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.KuneErrorHandler;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.site.Site;
+
+import com.calclab.suco.client.provider.Provider;
+import com.calclab.suco.client.signal.Slot;
+import com.google.gwt.i18n.client.DateTimeFormat;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+public class EntityTitlePresenter {
+
+ private EntityTitleView view;
+ private final I18nTranslationService i18n;
+ private final KuneErrorHandler errorHandler;
+ private final StateManager stateManager;
+ private final Provider<ContentServiceAsync> contentServiceProvider;
+ private final Session session;
+
+ public EntityTitlePresenter(final I18nTranslationService i18n, final KuneErrorHandler errorHandler,
+ final StateManager stateManager, final Session session,
+ final Provider<ContentServiceAsync> contentServiceProvider) {
+ this.i18n = i18n;
+ this.errorHandler = errorHandler;
+ this.stateManager = stateManager;
+ this.session = session;
+ this.contentServiceProvider = contentServiceProvider;
+ stateManager.onStateChanged(new Slot<StateDTO>() {
+ public void onEvent(final StateDTO state) {
+ setState(state);
+ }
+ });
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final EntityTitleView view) {
+ this.view = view;
+ }
+
+ public void onTitleRename(final String newName) {
+ Site.showProgressSaving();
+ final StateDTO currentState = session.getCurrentState();
+ contentServiceProvider.get().rename(session.getUserHash(), currentState.getGroup().getShortName(),
+ currentState.getStateToken().getEncoded(), newName, new AsyncCallback<String>() {
+ public void onFailure(final Throwable caught) {
+ view.restoreOldTitle();
+ errorHandler.process(caught);
+ }
+
+ public void onSuccess(final String result) {
+ Site.hideProgress();
+ view.setContentTitle(result);
+ stateManager.reloadContextAndTitles();
+ }
+ });
+ 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());
+ setContentDateVisible(true);
+ setContentDate(state.getPublishedOn());
+ } else {
+ if (state.getFolder().getParentFolderId() == null) {
+ // We translate root folder names (documents, chat room,
+ // etcetera)
+ setContentTitle(i18n.t(state.getTitle()), false);
+ } else {
+ setContentTitle(state.getTitle(), state.getContentRights().isEditable());
+ }
+ setContentDateVisible(false);
+ }
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitleView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitleView.java 2008-09-08 01:05:36 UTC (rev 860)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitleView.java 2008-09-08 01:13:19 UTC (rev 861)
@@ -0,0 +1,37 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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 org.ourproject.kune.workspace.client.title;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface EntityTitleView extends View {
+
+ void restoreOldTitle();
+
+ void setContentDate(String date);
+
+ void setContentTitle(String title);
+
+ void setContentTitleEditable(boolean editable);
+
+ void setDateVisible(boolean visible);
+
+}
1
0
r860 - in trunk/src/test/java/org/ourproject/kune/workspace/client: sitebar/msg tags
by vjrj 08 Sep '08
by vjrj 08 Sep '08
08 Sep '08
Author: vjrj
Date: 2008-09-08 03:05:36 +0200 (Mon, 08 Sep 2008)
New Revision: 860
Modified:
trunk/src/test/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenterTest.java
trunk/src/test/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenterTest.java
Log:
Refactorization
Modified: trunk/src/test/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenterTest.java 2008-09-08 01:05:19 UTC (rev 859)
+++ trunk/src/test/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenterTest.java 2008-09-08 01:05:36 UTC (rev 860)
@@ -4,6 +4,8 @@
import org.junit.Before;
import org.junit.Test;
import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+import org.ourproject.kune.workspace.client.site.msg.SiteMessagePresenter;
+import org.ourproject.kune.workspace.client.site.msg.SiteMessageView;
public class SiteMessagePresenterTest {
Modified: trunk/src/test/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenterTest.java 2008-09-08 01:05:19 UTC (rev 859)
+++ trunk/src/test/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenterTest.java 2008-09-08 01:05:36 UTC (rev 860)
@@ -7,7 +7,7 @@
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.search.SiteSearcher;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
import com.calclab.suco.client.provider.Provider;
1
0
r859 - in trunk/src/main/java/org/ourproject/kune/chat/client: . cnt/room/ui ctx/rooms
by vjrj 08 Sep '08
by vjrj 08 Sep '08
08 Sep '08
Author: vjrj
Date: 2008-09-08 03:05:19 +0200 (Mon, 08 Sep 2008)
New Revision: 859
Modified:
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomPanel.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java
Log:
Refactorization
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-09-08 01:05:04 UTC (rev 858)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-09-08 01:05:19 UTC (rev 859)
@@ -21,10 +21,10 @@
import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.workspace.client.component.WorkspaceDeckPanel;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummary;
-import org.ourproject.kune.workspace.client.ui.ctx.items.ContextNavigator;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.ui.ctx.nav.ContextNavigator;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
import com.calclab.suco.client.module.AbstractModule;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-09-08 01:05:04 UTC (rev 858)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-09-08 01:05:19 UTC (rev 859)
@@ -33,9 +33,9 @@
import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.platf.client.ui.MenuItem;
import org.ourproject.kune.platf.client.ui.WindowUtils;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummary;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.emite.client.xmpp.stanzas.XmppURI;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java 2008-09-08 01:05:04 UTC (rev 858)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java 2008-09-08 01:05:19 UTC (rev 859)
@@ -22,7 +22,7 @@
import java.util.Date;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.calclab.emite.client.im.roster.RosterManager.SubscriptionMode;
import com.calclab.emite.client.xmpp.stanzas.XmppURI;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomPanel.java 2008-09-08 01:05:04 UTC (rev 858)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomPanel.java 2008-09-08 01:05:19 UTC (rev 859)
@@ -21,8 +21,8 @@
package org.ourproject.kune.chat.client.cnt.room.ui;
import org.ourproject.kune.chat.client.cnt.room.ChatRoomView;
-import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.Label;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java 2008-09-08 01:05:04 UTC (rev 858)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java 2008-09-08 01:05:19 UTC (rev 859)
@@ -28,7 +28,7 @@
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.ui.ctx.items.ContextNavigator;
+import org.ourproject.kune.workspace.client.ui.ctx.nav.ContextNavigator;
import com.calclab.suco.client.provider.Provider;
1
0
r858 - in trunk/src/main/java/org/ourproject/kune/docs/client: . cnt cnt/folder/viewer/ui cnt/reader/ui ctx ctx/admin
by vjrj 08 Sep '08
by vjrj 08 Sep '08
08 Sep '08
Author: vjrj
Date: 2008-09-08 03:05:04 +0200 (Mon, 08 Sep 2008)
New Revision: 858
Removed:
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/folder/
Modified:
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/ui/FolderViewerPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderControlPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
Log:
Refactorization
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-08 01:03:41 UTC (rev 857)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-09-08 01:05:04 UTC (rev 858)
@@ -33,12 +33,12 @@
import org.ourproject.kune.platf.client.ui.rate.RateIt;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.tags.TagsSummary;
-import org.ourproject.kune.workspace.client.ui.ctx.items.ContextNavigator;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
+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.ui.ctx.nav.ContextNavigator;
import com.calclab.suco.client.module.AbstractModule;
import com.calclab.suco.client.provider.Factory;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-09-08 01:03:41 UTC (rev 857)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-09-08 01:05:04 UTC (rev 858)
@@ -33,10 +33,10 @@
import org.ourproject.kune.platf.client.tool.AbstractClientTool;
import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.ui.ctx.items.ContextNavigator;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.ui.ctx.nav.ContextNavigator;
import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Slot;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPanel.java 2008-09-08 01:03:41 UTC (rev 857)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPanel.java 2008-09-08 01:05:04 UTC (rev 858)
@@ -1,7 +1,7 @@
package org.ourproject.kune.docs.client.cnt;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.Widget;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-09-08 01:03:41 UTC (rev 857)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-09-08 01:05:04 UTC (rev 858)
@@ -36,7 +36,7 @@
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.editor.TextEditorListener;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.site.Site;
import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Signal0;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/ui/FolderViewerPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/ui/FolderViewerPanel.java 2008-09-08 01:03:41 UTC (rev 857)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/ui/FolderViewerPanel.java 2008-09-08 01:05:04 UTC (rev 858)
@@ -21,7 +21,7 @@
package org.ourproject.kune.docs.client.cnt.folder.viewer.ui;
import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerView;
-import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.site.Site;
import com.google.gwt.user.client.ui.Label;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderControlPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderControlPanel.java 2008-09-08 01:03:41 UTC (rev 857)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderControlPanel.java 2008-09-08 01:05:04 UTC (rev 858)
@@ -23,8 +23,8 @@
import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControlPresenter;
import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControlView;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.Toolbar;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.skel.Toolbar;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.Widget;
import com.gwtext.client.core.EventObject;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderPanel.java 2008-09-08 01:03:41 UTC (rev 857)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderPanel.java 2008-09-08 01:05:04 UTC (rev 858)
@@ -21,7 +21,7 @@
package org.ourproject.kune.docs.client.cnt.reader.ui;
import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderView;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.HTML;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPanel.java 2008-09-08 01:03:41 UTC (rev 857)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPanel.java 2008-09-08 01:05:04 UTC (rev 858)
@@ -1,7 +1,7 @@
package org.ourproject.kune.docs.client.ctx;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
public class DocumentContextPanel implements DocumentContextView {
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java 2008-09-08 01:03:41 UTC (rev 857)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java 2008-09-08 01:05:04 UTC (rev 858)
@@ -24,7 +24,7 @@
import org.ourproject.kune.docs.client.ctx.admin.AdminContext;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.ui.ctx.items.ContextNavigator;
+import org.ourproject.kune.workspace.client.ui.ctx.nav.ContextNavigator;
import com.calclab.suco.client.provider.Provider;
import com.calclab.suco.client.signal.Slot;
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-08 01:03:41 UTC (rev 857)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-09-08 01:05:04 UTC (rev 858)
@@ -33,10 +33,10 @@
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.sitebar.Site;
+import org.ourproject.kune.workspace.client.site.Site;
import org.ourproject.kune.workspace.client.tags.TagsSummary;
-import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
+import org.ourproject.kune.workspace.client.title.EntitySubTitlePresenter;
+import org.ourproject.kune.workspace.client.title.EntityTitlePresenter;
import com.calclab.suco.client.provider.Provider;
1
0