Remove trunk directory

This commit is contained in:
Paulo Gustavo Veiga
2009-11-06 23:30:29 -02:00
parent 2494133fed
commit 75470a91fd
715 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.view;
public class ChangePasswordBean {
private String password;
private String retryPassword;
public String getPassword() {
return password;
}
public void setPassword(String e) {
this.password = e;
}
public String getRetryPassword() {
return retryPassword;
}
public void setRetryPassword(String e) {
this.retryPassword = e;
}
}

View File

@@ -0,0 +1,70 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.view;
import com.wisemapping.model.UserRole;
import com.wisemapping.model.Colaborator;
import com.wisemapping.model.User;
public class ColaboratorBean
{
private UserRole userRole;
private boolean isUser;
private Colaborator colaborator;
public ColaboratorBean(Colaborator colaborator, UserRole role)
{
this.colaborator = colaborator;
this.userRole = role;
this.isUser = false;
}
public ColaboratorBean(User user, UserRole role)
{
this.colaborator = user;
this.userRole = role;
this.isUser = true;
}
public boolean isUser()
{
return isUser;
}
public String getRole()
{
return userRole.name();
}
public String getUsername()
{
return isUser ? ((User)colaborator).getUsername() : colaborator.getEmail();
}
public String getEmail()
{
return colaborator.getEmail();
}
public long getId()
{
return colaborator.getId();
}
}

View File

@@ -0,0 +1,33 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.view;
public class ForgotPasswordBean {
private String email;
public String getEmail() {
return email;
}
public void setEmail(String e) {
this.email = e;
}
}

View File

@@ -0,0 +1,73 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.view;
import java.util.Calendar;
import java.util.Locale;
import java.text.DateFormat;
public class HistoryBean
{
private Calendar historyTime;
private String author;
private int mindmapId;
private int historyId;
public HistoryBean() {}
public HistoryBean(int mindmapId,int historyId,String author, Calendar time)
{
this.mindmapId = mindmapId;
this.author = author;
this.historyTime = time;
this.historyId = historyId;
}
public Calendar getHistoryTime() {
return historyTime;
}
public String getCreation(Locale locale)
{
return DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.DEFAULT,locale).format(historyTime.getTime());
}
public void setHistoryTime(Calendar historyTime) {
this.historyTime = historyTime;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public int getMindMapId()
{
return mindmapId;
}
public int getHistoryId()
{
return historyId;
}
}

View File

@@ -0,0 +1,46 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.view;
import com.wisemapping.model.MindMap;
public class ImportMapBean extends MindMapInfoBean{
private String mapFile;
private MindMap importedMap;
public MindMap getImportedMap() {
return importedMap;
}
public void setMapFile(String mapFile) {
this.mapFile = mapFile;
}
public String getMapFile() {
return mapFile;
}
public void setImportedMap(MindMap map) {
this.importedMap = map;
}
}

View File

@@ -0,0 +1,168 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.view;
import com.wisemapping.model.MindMap;
import com.wisemapping.model.MindmapUser;
import com.wisemapping.model.UserRole;
import com.wisemapping.model.User;
import java.text.DateFormat;
import java.util.*;
public class MindMapBean {
private MindMap mindMap;
private List<ColaboratorBean> viewers;
private List<ColaboratorBean> colaborators;
public MindMapBean(final MindMap mindmap) {
this.mindMap = mindmap;
this.colaborators = getColaboratorBy(mindmap.getMindmapUsers(), UserRole.COLLABORATOR);
this.viewers = getColaboratorBy(mindmap.getMindmapUsers(), UserRole.VIEWER);
}
public MindMap getMindMap() {
return mindMap;
}
public boolean getPublic() {
return mindMap.isPublic();
}
public String getTitle() {
return mindMap.getTitle();
}
public String getDescription() {
return mindMap.getDescription();
}
public int getId() {
return mindMap.getId();
}
public List<ColaboratorBean> getViewers() {
return viewers;
}
public List<ColaboratorBean> getCollaborators() {
return colaborators;
}
public String getLastEditor() {
return mindMap.getLastModifierUser();
}
public String getLastEditDate() {
String result = "";
Calendar lastEditTime = Calendar.getInstance();
lastEditTime.setTime(mindMap.getLastModificationTime().getTime());
Calendar now = Calendar.getInstance();
int dayDiff = getDaysBetween(now, lastEditTime);
if (dayDiff > 0) {
result = dayDiff + " days ago";
} else if (dayDiff == 0) {
result = "today";
}
return result;
}
public Calendar getLastEditTime() {
return mindMap.getLastModificationTime();
}
public String getCreationTime() {
return DateFormat.getInstance().format(mindMap.getCreationTime().getTime());
}
public String getCreationUser() {
return mindMap.getCreator();
}
public String getTags() {
return mindMap.getTags();
}
private List<ColaboratorBean> getColaboratorBy(Set<MindmapUser> source, UserRole role) {
List<ColaboratorBean> col = new ArrayList<ColaboratorBean>();
if (source != null) {
for (MindmapUser mu : source) {
if (mu.getRole() == role) {
col.add(new ColaboratorBean(mu.getColaborator(), mu.getRole()));
}
}
}
return col;
}
private static int getDaysBetween(java.util.Calendar d1, java.util.Calendar d2) {
if (d1.after(d2)) { // swap dates so that d1 is start and d2 is end
java.util.Calendar swap = d1;
d1 = d2;
d2 = swap;
}
int days = d2.get(java.util.Calendar.DAY_OF_YEAR) -
d1.get(java.util.Calendar.DAY_OF_YEAR);
int y2 = d2.get(java.util.Calendar.YEAR);
if (d1.get(java.util.Calendar.YEAR) != y2) {
d1 = (java.util.Calendar) d1.clone();
do {
days += d1.getActualMaximum(java.util.Calendar.DAY_OF_YEAR);
d1.add(java.util.Calendar.YEAR, 1);
} while (d1.get(java.util.Calendar.YEAR) != y2);
}
return days;
}
public static class MindMapBeanComparator implements Comparator<MindMapBean> {
public int compare(MindMapBean o1, MindMapBean o2) {
return o1.getLastEditTime().compareTo(o2.getLastEditTime());
}
}
public int getCountColaborators() {
return colaborators != null ? colaborators.size() : 0;
}
public int getCountViewers() {
return viewers != null ? viewers.size() : 0;
}
public int getCountShared() {
return getCountColaborators() + getCountViewers();
}
public boolean isShared() {
return getCountShared() > 0;
}
public void setTitle(String t) {
mindMap.setTitle(t);
}
public void setDescription(String d) {
mindMap.setDescription(d);
}
public User getOwner() {
return mindMap.getOwner();
}
}

View File

@@ -0,0 +1,66 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.view;
import com.wisemapping.model.MindMap;
public class MindMapInfoBean {
private String title;
private String description;
private MindMap mindMap;
public MindMapInfoBean(MindMap map) {
this.title = map.getTitle();
this.description = map.getDescription();
this.mindMap = map;
}
public MindMapInfoBean() {
this.title = "";
this.description = "";
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public MindMap getMindMap() {
if (mindMap != null) {
mindMap.setTitle(title);
mindMap.setDescription(description);
}
return mindMap;
}
}

View File

@@ -0,0 +1,68 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.view;
import java.util.Set;
public class TagBean
{
private Set<String> userTags;
private String mindmapTitle;
private int mindmapId;
private String mindmapTags;
public TagBean(){}
public Set<String> getUserTags() {
return userTags;
}
public void setUserTags(Set<String> tags) {
this.userTags = tags;
}
public String getMindmapTags() {
return mindmapTags;
}
public void setMindmapTags(String tags) {
this.mindmapTags = tags;
}
public String getMindmapTitle()
{
return mindmapTitle;
}
public void setMindmapTitle(String title)
{
this.mindmapTitle = title;
}
public int getMindmapId()
{
return mindmapId;
}
public void setMindmapId(int id)
{
this.mindmapId = id;
}
}

View File

@@ -0,0 +1,56 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.view;
import com.wisemapping.model.User;
public class UserBean
extends User {
private String retypePassword;
private String captcha;
public UserBean() {
}
public UserBean(User model) {
this.setFirstname(model.getFirstname());
this.setLastname(model.getLastname());
this.setEmail(model.getEmail());
this.setId(model.getId());
this.setAllowSendEmail(model.isAllowSendEmail());
}
public String getRetypePassword() {
return retypePassword;
}
public void setRetypePassword(String retypePassword) {
this.retypePassword = retypePassword;
}
public String getCaptcha() {
return captcha;
}
public void setCaptcha(String captcha) {
this.captcha = captcha;
}
}