?? jivexml.java
字號:
MVNForumPermission.PERMISSION_ADD_THREAD};
} else if (jivePermission.equalsIgnoreCase("CREATE_THREAD")) {
return new int[] {MVNForumPermission.PERMISSION_ADD_THREAD};
} else if (jivePermission.equalsIgnoreCase("MODERATE_MESSAGES")) {
return new int[] {MVNForumPermission.PERMISSION_READ_POST,
MVNForumPermission.PERMISSION_ADD_POST,
MVNForumPermission.PERMISSION_EDIT_POST,
MVNForumPermission.PERMISSION_DELETE_POST};
} else if (jivePermission.equalsIgnoreCase("CREATE_MESSAGE")) {
return new int[] {MVNForumPermission.PERMISSION_ADD_POST};
} else if (jivePermission.equalsIgnoreCase("CREATE_ATTACHMENT")) {
return new int[] {MVNForumPermission.PERMISSION_ADD_ATTACHMENT};
} else if (jivePermission.equalsIgnoreCase("READ_FORUM")) {
return new int[] {MVNForumPermission.PERMISSION_READ_POST};
} else if (jivePermission.equalsIgnoreCase("READ")) {
return new int[] {MVNForumPermission.PERMISSION_READ_POST};
} else {
return new int[] {MVNForumPermission.PERMISSION_NO_PERMISSIONS};
}
}
// ================================================================================
// ==================== METHODS TO BE CALLED FROM THE DIGESTER ====================
// ================================================================================
public void setJiveXmlVersion(String value) {
ImportJive.addMessage("Jive XML version = \""+value+"\"");
}
public void setJiveExportDate(String value) {
ImportJive.addMessage("Jive XML export date = \""+value+"\"");
}
public void addJiveUserPermission(String usertype, String username, String jivePermission)
throws CreateException, DatabaseException, ObjectNotFoundException,
ForeignKeyNotFoundException {
if (usertype==null) {
throw new CreateException("Not enough data to create a member global permission.");
} else if (usertype.equalsIgnoreCase("ANONYMOUS")) {
int[] perms = JiveXML.convertMemberPermission(jivePermission);
for (int j=0; j<perms.length; j++) {
try {
JiveXML.addGuestMemberPermission(Integer.toString(perms[j]));
} catch (DuplicateKeyException e) {
/* Ignore if we doubled some permissions.
* Because we convert each Jive permission into the list of
* MVN Forum permissions (can be more than one), some permissions
* could be generated twice, or more times.
*/
}
}
} else if (usertype.equalsIgnoreCase("REGISTERED_USERS")) {
int[] perms = JiveXML.convertGroupPermission(jivePermission);
for (int j=0; j<perms.length; j++) {
try {
JiveXML.addRegisteredMembersGroupPermission(Integer.toString(perms[j]));
} catch (DuplicateKeyException e) {
/* Ignore if we doubled some permissions.
* Because we convert each Jive permission into the list of
* MVN Forum permissions (can be more than one), some permissions
* could be generated twice, or more times.
*/
}
}
} else if (usertype.equalsIgnoreCase("USER")) {
int[] perms = JiveXML.convertMemberPermission(jivePermission);
for (int j=0; j<perms.length; j++) {
try {
JiveXML.addMemberPermission(username, Integer.toString(perms[j]));
} catch (DuplicateKeyException e) {
/* Ignore if we doubled some permissions.
* Because we convert each Jive permission into the list of
* MVN Forum permissions (can be more than one), some permissions
* could be generated twice, or more times.
*/
}
}
} else {
throw new CreateException("Invalid usertype. This Jive user global permission is ignored.");
}
}
public void addJiveGroupPermission(String groupname, String jivePermission)
throws CreateException, DatabaseException, ObjectNotFoundException,
ForeignKeyNotFoundException {
if ( (groupname==null) || (groupname.equals("")) ) {
throw new CreateException("Not enough data to create a group global permission.");
} else {
int[] perms = JiveXML.convertGroupPermission(jivePermission);
for (int j=0; j<perms.length; j++) {
try {
JiveXML.addGroupPermission(groupname, Integer.toString(perms[j]));
} catch (DuplicateKeyException e) {
/* Ignore if we doubled some permissions.
* Because we convert each Jive permission into the list of
* MVN Forum permissions (can be more than one), some permissions
* could be generated twice, or more times.
*/
}
}
}
}
// ================================================================================
// ====================== UTILITY METHODS ABOUT PERMISSIONS =======================
// ================================================================================
public static int[] addDefaultPermissionsToGuests = new int[]{
//MVNForumPermission.PERMISSION_SEND_MAIL,
//MVNForumPermission.PERMISSION_USE_MESSAGE,
//MVNForumPermission.PERMISSION_USE_AVATAR,
//MVNForumPermission.PERMISSION_ADD_POLL,
//MVNForumPermission.PERMISSION_EDIT_POLL,
//MVNForumPermission.PERMISSION_DELETE_POLL,
//MVNForumPermission.PERMISSION_GET_ATTACHMENT
};
public static int[] addDefaultPermissionsToMembers = new int[]{
//MVNForumPermission.PERMISSION_SEND_MAIL,
MVNForumPermission.PERMISSION_USE_MESSAGE,
MVNForumPermission.PERMISSION_USE_AVATAR,
//MVNForumPermission.PERMISSION_ADD_POLL,
//MVNForumPermission.PERMISSION_EDIT_POLL,
//MVNForumPermission.PERMISSION_DELETE_POLL,
MVNForumPermission.PERMISSION_GET_ATTACHMENT
};
/**
* TODO Igor: enter description
*
* @param username
* @param permission
*/
public static void addMemberPermission(String username, String permission)
throws ObjectNotFoundException, CreateException, DatabaseException,
ForeignKeyNotFoundException, DuplicateKeyException {
MemberXML.addMemberPermission(username, permission);
}
/**
* TODO Igor: enter description
*
* @param permission
*/
public static void addRegisteredMembersGroupPermission(String permission)
throws CreateException, DatabaseException, DuplicateKeyException,
ForeignKeyNotFoundException {
GroupXML.addRegisteredMembersGroupPermission(permission);
}
/**
* TODO Igor: enter description
*
* @param permission
*/
public static void addGuestMemberPermission(String permission)
throws CreateException, DatabaseException, DuplicateKeyException,
ForeignKeyNotFoundException {
MemberXML.addGuestMemberPermission(permission);
}
/**
* TODO Igor: enter description
*
* @param groupname
* @param permission
*/
public static void addGroupPermission(String groupname, String permission)
throws CreateException, DatabaseException, DuplicateKeyException,
ForeignKeyNotFoundException, ObjectNotFoundException {
GroupXML.addGroupPermission(groupname, permission);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -