"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/main/java/com/openkm/extension/frontend/client/widget/extraworkspace/TabWorkspace.java" between
OpenKM-document-management-system-6.3.10.tar.gz and OpenKM-document-management-system-6.3.11.tar.gz

About: OpenKM (Knowledge Management) is a document management system that allows easy management of documents, users, roles and finding your enterprise documents and records. Community version (source code).

TabWorkspace.java  (OpenKM-document-management-system-6.3.10):TabWorkspace.java  (OpenKM-document-management-system-6.3.11)
skipping to change at line 25 skipping to change at line 25
* GNU General Public License for more details. * GNU General Public License for more details.
* <p> * <p>
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
package com.openkm.extension.frontend.client.widget.extraworkspace; package com.openkm.extension.frontend.client.widget.extraworkspace;
import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.ui.Frame; import com.google.gwt.user.client.ui.Frame;
import com.google.gwt.user.client.ui.HasAlignment; import com.google.gwt.user.client.ui.HasAlignment;
import com.google.gwt.user.client.ui.TabBar; import com.google.gwt.user.client.ui.TabBar;
import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.VerticalPanel;
import com.openkm.frontend.client.Main; import com.openkm.frontend.client.Main;
import com.openkm.frontend.client.bean.GWTDocument;
import com.openkm.frontend.client.bean.GWTFolder;
import com.openkm.frontend.client.bean.GWTMail;
import com.openkm.frontend.client.extension.comunicator.FileBrowserCommunicator;
import com.openkm.frontend.client.extension.comunicator.GeneralComunicator; import com.openkm.frontend.client.extension.comunicator.GeneralComunicator;
import com.openkm.frontend.client.extension.event.HasWorkspaceEvent;
import com.openkm.frontend.client.extension.event.handler.WorkspaceHandlerExtens
ion;
import com.openkm.frontend.client.extension.widget.tabworkspace.TabWorkspaceExte nsion; import com.openkm.frontend.client.extension.widget.tabworkspace.TabWorkspaceExte nsion;
import java.util.ArrayList;
import java.util.List;
/** /**
* TabWorkspace * TabWorkspace
* *
* @author jllort * @author jllort
*
*/ */
public class TabWorkspace extends TabWorkspaceExtension { public class TabWorkspace extends TabWorkspaceExtension implements WorkspaceHand lerExtension {
private VerticalPanel vPanel; private VerticalPanel vPanel;
private Frame iframe; private Frame iframe;
private String textLabel = ""; private String textLabel = "";
private Timer timer; private String url = "";
private TabBar tabBar; private TabBar tabBar;
private int tabIndex = 0; private int tabIndex = 0;
/** /**
* TabWorkspace * TabWorkspace
*/ */
public TabWorkspace() { public TabWorkspace() {
vPanel = new VerticalPanel(); vPanel = new VerticalPanel();
iframe = new Frame("about:blank"); iframe = new Frame("about:blank");
skipping to change at line 72 skipping to change at line 79
iframe.setUrl(Main.CONTEXT + "/extra/index.jsp"); iframe.setUrl(Main.CONTEXT + "/extra/index.jsp");
iframe.setStyleName("okm-Iframe"); iframe.setStyleName("okm-Iframe");
vPanel.add(iframe); vPanel.add(iframe);
vPanel.setCellHorizontalAlignment(iframe, HasAlignment.ALIGN_CENT ER); vPanel.setCellHorizontalAlignment(iframe, HasAlignment.ALIGN_CENT ER);
vPanel.setWidth("100%"); vPanel.setWidth("100%");
vPanel.setHeight("100%"); vPanel.setHeight("100%");
// User workspace values
if (GeneralComunicator.getWorkspace() == null) {
timer = new Timer() {
@Override
public void run() {
if (GeneralComunicator.getWorkspace() ==
null) {
firstTimeLoadingWorkspace();
} else {
init();
}
}
};
firstTimeLoadingWorkspace();
} else {
init();
}
initWidget(vPanel); initWidget(vPanel);
} }
/** /**
* firstTimeLoadingWorkspace
*/
private void firstTimeLoadingWorkspace() {
timer.schedule(200);
}
/**
* init
*/
private void init() {
if (!GeneralComunicator.getWorkspace().getExtraTabWorkspaceLabel(
).isEmpty()) {
textLabel = GeneralComunicator.getWorkspace().getExtraTab
WorkspaceLabel();
} else {
textLabel = "Extra";
}
if (tabBar != null) {
tabBar.setTabText(tabIndex, textLabel);
}
if (!GeneralComunicator.getWorkspace().getExtraTabWorkspaceUrl().
isEmpty()) {
String url = GeneralComunicator.getWorkspace().getExtraTa
bWorkspaceUrl();
if (url.startsWith("http")) {
iframe.setUrl(url);
} else {
iframe.setUrl(Main.CONTEXT + url);
}
}
}
/**
* Sets the size on initialization * Sets the size on initialization
* *
* @param width The max width of the widget * @param width The max width of the widget
* @param height The max height of the widget * @param height The max height of the widget
*/ */
public void setPixelSize(int width, int height) { public void setPixelSize(int width, int height) {
iframe.setPixelSize(width - 2, height - 2); iframe.setPixelSize(width - 2, height - 2);
} }
/** /**
* setTextLabel * setTextLabel
*/ */
public void setTextLabel(String textLabel) { public void setTextLabel(String textLabel) {
this.textLabel = textLabel; this.textLabel = textLabel;
} }
public void setUrl(String url) {
this.url = url;
}
@Override @Override
public String getTabText() { public String getTabText() {
return textLabel; return textLabel;
} }
@Override @Override
public void setTab(TabBar tabBar, int tabIndex) { public void setTab(TabBar tabBar, int tabIndex) {
this.tabBar = tabBar; this.tabBar = tabBar;
this.tabIndex = tabIndex; this.tabIndex = tabIndex;
} }
@Override
public void onChange(HasWorkspaceEvent.WorkspaceEventConstant event) {
if (event.equals(HasWorkspaceEvent.STACK_CHANGED)) {
StringBuilder finalUrl = new StringBuilder(this.url + (th
is.url.contains("?") ? "&" : "?") + "userId=" + GeneralComunicator.getUser());
List<String> uuidList = new ArrayList<>();
if (FileBrowserCommunicator.isPanelSelected()) {
if (FileBrowserCommunicator.isMassive()) {
uuidList.addAll(FileBrowserCommunicator.g
etAllSelectedUUIDs());
} else if (FileBrowserCommunicator.isDocumentSele
cted()) {
GWTDocument gwtDoc = FileBrowserCommunica
tor.getDocument();
uuidList.add(gwtDoc.getUuid());
} else if (FileBrowserCommunicator.isFolderSelect
ed()) {
GWTFolder gwtFld = FileBrowserCommunicato
r.getFolder();
uuidList.add(gwtFld.getUuid());
} else if (FileBrowserCommunicator.isMailSelected
()) {
GWTMail gwtMail = FileBrowserCommunicator
.getMail();
uuidList.add(gwtMail.getUuid());
}
}
for (String uuid : uuidList) {
finalUrl.append("&uuid=").append(uuid);
}
iframe.setUrl(finalUrl.toString());
}
}
} }
 End of changes. 12 change blocks. 
59 lines changed or deleted 54 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)