mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-07 01:46:47 +08:00
提交调整
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
package com.xboe.module.scorm;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.xboe.module.scorm.cam.load.SCORMPackageManager;
|
||||
import com.xboe.module.scorm.cam.model.ContentPackage;
|
||||
import com.xboe.module.scorm.cam.model.Manifest;
|
||||
import com.xboe.module.scorm.cam.model.Resource;
|
||||
import com.xboe.module.scorm.data.ScoItem;
|
||||
|
||||
/**
|
||||
* 解析程序,转化为课程存储的json
|
||||
*/
|
||||
public class SCORMParser {
|
||||
|
||||
public String parserToJson(String path) throws Exception {
|
||||
System.out.println("test");
|
||||
Map<String,Object> jsonMap=new HashMap<String,Object>();
|
||||
ContentPackage cp=SCORMPackageManager.getInstance().loadSCORMContentPackageFromZipFile("1", "E:/Projects/BOEU/scorm/file/ContentPackagingOneFilePerSCO_SCORM12.zip");
|
||||
Manifest manifest= cp.getManifest();
|
||||
System.out.println(cp.getManifest().getIdentifier());
|
||||
System.out.println(cp.getContent());
|
||||
|
||||
List<ScoItem> items=new ArrayList<ScoItem>();
|
||||
|
||||
System.out.println("title="+cp.getManifest().getOrganizations().getOrganizationList().get(0).getTitle());
|
||||
for(Resource res : cp.getManifest().getResources().getResourceList()) {
|
||||
System.out.println(res.getHref());
|
||||
}
|
||||
//scorm的版本
|
||||
jsonMap.put("schema",manifest.getMetadata().getSchema());
|
||||
jsonMap.put("version",manifest.getMetadata().getSchemaVersion());
|
||||
jsonMap.put("items", items);//sco共有多少个
|
||||
jsonMap.put("index", "");//打开播放时进入的第一个sco
|
||||
|
||||
ObjectMapper om=new ObjectMapper();
|
||||
String json=om.writeValueAsString(jsonMap);
|
||||
return json;
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public class SCORMPackageManager {
|
||||
}
|
||||
}
|
||||
|
||||
private ContentPackage loadSCORMContentPackageFromZipFile(String lmsContentPackageID, String zipFilePath) {
|
||||
public ContentPackage loadSCORMContentPackageFromZipFile(String lmsContentPackageID, String zipFilePath) {
|
||||
if (!ZipUtils.isEndWithZip(zipFilePath)) {
|
||||
return null;
|
||||
}
|
||||
@@ -117,35 +117,35 @@ public class SCORMPackageManager {
|
||||
return contentPackageMap.size();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// System.out.println(SCORMPackageManager.getInstance()
|
||||
// .loadSCORMContentPackageFromZipFile("1", "learningserver-scorm/scorm-test-pkg.zip")
|
||||
// .getContent());
|
||||
System.out.println("test");
|
||||
ContentPackage cp=SCORMPackageManager.getInstance().loadSCORMContentPackageFromZipFile("1", "E:/Projects/BOEU/scorm/file/ContentPackagingOneFilePerSCO_SCORM12.zip");
|
||||
System.out.println(cp.getManifest().getIdentifier());
|
||||
System.out.println(cp.getContent());
|
||||
System.out.println("title="+cp.getManifest().getOrganizations().getOrganizationList().get(0).getTitle());
|
||||
for(Resource res : cp.getManifest().getResources().getResourceList()) {
|
||||
System.out.println(res.getHref());
|
||||
}
|
||||
|
||||
// System.out.println("ADL_Maritime_Navigation");
|
||||
// cp=SCORMPackageManager.getInstance().loadSCORMContentPackageFromZipFile("1", "E:/Projects/BOEU/scorm/file/ADL_Maritime_Navigation.zip");
|
||||
// public static void main(String[] args) {
|
||||
//// System.out.println(SCORMPackageManager.getInstance()
|
||||
//// .loadSCORMContentPackageFromZipFile("1", "learningserver-scorm/scorm-test-pkg.zip")
|
||||
//// .getContent());
|
||||
// System.out.println("test");
|
||||
// ContentPackage cp=SCORMPackageManager.getInstance().loadSCORMContentPackageFromZipFile("1", "E:/Projects/BOEU/scorm/file/ContentPackagingOneFilePerSCO_SCORM12.zip");
|
||||
// System.out.println(cp.getManifest().getIdentifier());
|
||||
// System.out.println(cp.getContent());
|
||||
// System.out.println("title="+cp.getManifest().getOrganizations().getOrganizationList().get(0).getTitle());
|
||||
// for(Resource res : cp.getManifest().getResources().getResourceList()) {
|
||||
// System.out.print(res.getHref());
|
||||
// System.out.println(res.getHref());
|
||||
// }
|
||||
//
|
||||
// System.out.println("7a462dbee222ba62810191d2f512576e");
|
||||
// ContentPackage cp3=SCORMPackageManager.getInstance().loadSCORMContentPackageFromZipFile("1", "E:/Projects/BOEU/scorm/file/7a462dbee222ba62810191d2f512576e.zip");
|
||||
// System.out.println(cp3.getManifest().getIdentifier());
|
||||
// System.out.println(cp3.getContent());
|
||||
// for(Resource res : cp3.getManifest().getResources().getResourceList()) {
|
||||
// System.out.print(res.getHref());
|
||||
// }
|
||||
//
|
||||
}
|
||||
//// System.out.println("ADL_Maritime_Navigation");
|
||||
//// cp=SCORMPackageManager.getInstance().loadSCORMContentPackageFromZipFile("1", "E:/Projects/BOEU/scorm/file/ADL_Maritime_Navigation.zip");
|
||||
//// System.out.println(cp.getManifest().getIdentifier());
|
||||
//// System.out.println(cp.getContent());
|
||||
//// for(Resource res : cp.getManifest().getResources().getResourceList()) {
|
||||
//// System.out.print(res.getHref());
|
||||
//// }
|
||||
////
|
||||
//// System.out.println("7a462dbee222ba62810191d2f512576e");
|
||||
//// ContentPackage cp3=SCORMPackageManager.getInstance().loadSCORMContentPackageFromZipFile("1", "E:/Projects/BOEU/scorm/file/7a462dbee222ba62810191d2f512576e.zip");
|
||||
//// System.out.println(cp3.getManifest().getIdentifier());
|
||||
//// System.out.println(cp3.getContent());
|
||||
//// for(Resource res : cp3.getManifest().getResources().getResourceList()) {
|
||||
//// System.out.print(res.getHref());
|
||||
//// }
|
||||
////
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.xboe.module.scorm.data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* sco的信息
|
||||
*
|
||||
*/
|
||||
public class ScoItem {
|
||||
|
||||
private String id;
|
||||
|
||||
private String title;
|
||||
|
||||
private String scoId;
|
||||
|
||||
private String scoType;
|
||||
|
||||
private String scoUrl;
|
||||
|
||||
private List<ScoItem> items;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getScoId() {
|
||||
return scoId;
|
||||
}
|
||||
|
||||
public void setScoId(String scoId) {
|
||||
this.scoId = scoId;
|
||||
}
|
||||
|
||||
public String getScoType() {
|
||||
return scoType;
|
||||
}
|
||||
|
||||
public void setScoType(String scoType) {
|
||||
this.scoType = scoType;
|
||||
}
|
||||
|
||||
public String getScoUrl() {
|
||||
return scoUrl;
|
||||
}
|
||||
|
||||
public void setScoUrl(String scoUrl) {
|
||||
this.scoUrl = scoUrl;
|
||||
}
|
||||
|
||||
public List<ScoItem> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(List<ScoItem> items) {
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,28 +1,25 @@
|
||||
package com.xboe.module.scorm.rte.model.result;
|
||||
|
||||
import com.sun.istack.internal.NotNull;
|
||||
|
||||
import com.xboe.module.scorm.rte.model.error.ScormError;
|
||||
|
||||
public class CollectionScormResult<Instance> extends ScormResult {
|
||||
|
||||
private Instance instance;
|
||||
|
||||
public CollectionScormResult(@NotNull String returnValue, @NotNull ScormError error) {
|
||||
public CollectionScormResult(String returnValue, ScormError error) {
|
||||
this(returnValue, error, (Instance) null);
|
||||
}
|
||||
|
||||
public CollectionScormResult(@NotNull String returnValue, @NotNull ScormError error, @NotNull String diagnostic) {
|
||||
public CollectionScormResult(String returnValue,ScormError error,String diagnostic) {
|
||||
this(returnValue, error, diagnostic, (Instance) null);
|
||||
}
|
||||
|
||||
public CollectionScormResult(@NotNull String returnValue, @NotNull ScormError error, Instance instance) {
|
||||
public CollectionScormResult(String returnValue,ScormError error, Instance instance) {
|
||||
super(returnValue, error);
|
||||
this.instance = instance;
|
||||
}
|
||||
|
||||
public CollectionScormResult(@NotNull String returnValue, @NotNull ScormError error,
|
||||
@NotNull String diagnostic, Instance instance) {
|
||||
public CollectionScormResult(String returnValue, ScormError error,String diagnostic, Instance instance) {
|
||||
super(returnValue, error, diagnostic);
|
||||
this.instance = instance;
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@ package com.xboe.module.scorm.rte.model.result;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
||||
import com.sun.istack.internal.NotNull;
|
||||
|
||||
import com.xboe.module.scorm.rte.model.error.ScormError;
|
||||
|
||||
public class ScormResult {
|
||||
@@ -14,11 +12,11 @@ public class ScormResult {
|
||||
|
||||
private String diagnostic;
|
||||
|
||||
public ScormResult(@NotNull String returnValue, @NotNull ScormError error) {
|
||||
public ScormResult(String returnValue, ScormError error) {
|
||||
this(returnValue, error, error.getMsg());
|
||||
}
|
||||
|
||||
public ScormResult(@NotNull String returnValue, @NotNull ScormError error, @NotNull String diagnostic) {
|
||||
public ScormResult(String returnValue, ScormError error, String diagnostic) {
|
||||
this.returnValue = returnValue;
|
||||
this.error = error;
|
||||
this.diagnostic = diagnostic;
|
||||
@@ -28,7 +26,7 @@ public class ScormResult {
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
public ScormResult setReturnValue(@NotNull String returnValue) {
|
||||
public ScormResult setReturnValue(String returnValue) {
|
||||
this.returnValue = returnValue;
|
||||
return this;
|
||||
}
|
||||
@@ -41,7 +39,7 @@ public class ScormResult {
|
||||
return diagnostic;
|
||||
}
|
||||
|
||||
public ScormResult setDiagnostic(@NotNull String diagnostic) {
|
||||
public ScormResult setDiagnostic(String diagnostic) {
|
||||
this.diagnostic = diagnostic;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ package com.xboe.module.scorm.sn.api.behavior;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import com.sun.istack.internal.NotNull;
|
||||
|
||||
import com.xboe.module.scorm.sn.api.behavior.result.NavigationBehaviorResult;
|
||||
import com.xboe.module.scorm.sn.api.behavior.result.SequencingException;
|
||||
import com.xboe.module.scorm.sn.api.request.NavigationRequest;
|
||||
@@ -31,7 +29,7 @@ public class NavigationBehavior {
|
||||
* Available Children AM.1.1
|
||||
* Suspended Activity AM.1.2
|
||||
*/
|
||||
public static NavigationBehaviorResult processNavigationRequest(@NotNull NavigationRequest navigationRequest) {
|
||||
public static NavigationBehaviorResult processNavigationRequest(NavigationRequest navigationRequest) {
|
||||
NavigationRequest.Type type = navigationRequest.getRequestType();
|
||||
ActivityTree activityTree = navigationRequest.getTargetActivityTree();
|
||||
Activity currentActivity = activityTree.getGlobalStateInformation().getCurrentActivity();
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.xboe.module.scorm.sn.api.behavior;
|
||||
|
||||
import com.sun.istack.internal.NotNull;
|
||||
|
||||
import com.xboe.module.scorm.sn.api.behavior.result.DeliveryBehaviorResult;
|
||||
import com.xboe.module.scorm.sn.api.behavior.result.NavigationBehaviorResult;
|
||||
import com.xboe.module.scorm.sn.api.behavior.result.OverallSequencingResult;
|
||||
@@ -30,7 +28,7 @@ public class OverallSequencingBehavior {
|
||||
* @see SequencingBehavior#processSequencingRequest(SequencingRequest) SB.2.12
|
||||
* @see TerminationBehavior#processTerminationRequest(TerminationRequest) TB.2.3
|
||||
*/
|
||||
public static OverallSequencingResult overallSequencing(@NotNull NavigationRequest navigationRequest) {
|
||||
public static OverallSequencingResult overallSequencing(NavigationRequest navigationRequest) {
|
||||
// 1.1
|
||||
NavigationBehaviorResult navigationBehaviorResult = NavigationBehavior.processNavigationRequest(navigationRequest);
|
||||
// 1.2
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.xboe.module.scorm.sn.api.event;
|
||||
|
||||
import com.sun.istack.internal.NotNull;
|
||||
|
||||
import com.xboe.module.scorm.sn.api.request.NavigationRequest;
|
||||
import com.xboe.module.scorm.sn.api.request.NavigationRequest.Type;
|
||||
import com.xboe.module.scorm.sn.model.tree.Activity;
|
||||
@@ -9,7 +7,7 @@ import com.xboe.module.scorm.sn.model.tree.ActivityTree;
|
||||
|
||||
public class EventTranslator {
|
||||
|
||||
public static NavigationRequest translateEventToRequestType(@NotNull NavigationEvent event,
|
||||
public static NavigationRequest translateEventToRequestType(NavigationEvent event,
|
||||
ActivityTree activityTree, Activity activity) {
|
||||
return new NavigationRequest(getRequestType(event), activityTree, activity);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.xboe.module.scorm.sn.api.request;
|
||||
|
||||
import com.sun.istack.internal.NotNull;
|
||||
|
||||
import com.xboe.module.scorm.sn.model.tree.Activity;
|
||||
import com.xboe.module.scorm.sn.model.tree.ActivityTree;
|
||||
|
||||
@@ -9,7 +7,7 @@ public class NavigationRequest extends Request {
|
||||
|
||||
private Type requestType;
|
||||
|
||||
public NavigationRequest(@NotNull Type requestType, ActivityTree targetActivityTree, Activity targetActivity) {
|
||||
public NavigationRequest(Type requestType, ActivityTree targetActivityTree, Activity targetActivity) {
|
||||
super(targetActivityTree, targetActivity);
|
||||
this.requestType = requestType;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.xboe.module.scorm.sn.api.request;
|
||||
|
||||
import com.sun.istack.internal.NotNull;
|
||||
|
||||
import com.xboe.module.scorm.sn.api.behavior.common.TraversalDirection;
|
||||
import com.xboe.module.scorm.sn.model.tree.Activity;
|
||||
import com.xboe.module.scorm.sn.model.tree.ActivityTree;
|
||||
@@ -16,7 +14,7 @@ public class SequencingRequest extends Request {
|
||||
|
||||
private boolean considerChildren;
|
||||
|
||||
public SequencingRequest(@NotNull Type requestType, ActivityTree targetActivityTree, Activity targetActivity) {
|
||||
public SequencingRequest(Type requestType, ActivityTree targetActivityTree, Activity targetActivity) {
|
||||
super(targetActivityTree, targetActivity);
|
||||
this.requestType = requestType;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.xboe.module.scorm.sn.api.request;
|
||||
|
||||
import com.sun.istack.internal.NotNull;
|
||||
|
||||
import com.xboe.module.scorm.sn.model.tree.Activity;
|
||||
import com.xboe.module.scorm.sn.model.tree.ActivityTree;
|
||||
|
||||
@@ -9,7 +7,7 @@ public class TerminationRequest extends Request {
|
||||
|
||||
private Type requestType;
|
||||
|
||||
public TerminationRequest(@NotNull Type requestType, ActivityTree targetActivityTree, Activity targetActivity) {
|
||||
public TerminationRequest(Type requestType, ActivityTree targetActivityTree, Activity targetActivity) {
|
||||
super(targetActivityTree, targetActivity);
|
||||
this.requestType = requestType;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.xboe.module.scorm.sn.model.definition;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.sun.istack.internal.NotNull;
|
||||
|
||||
import com.xboe.module.scorm.sn.model.datatype.Vocabulary;
|
||||
|
||||
@@ -18,7 +17,7 @@ public class SequencingRuleDescription implements DefinitionElementSet {
|
||||
private final List<RuleCondition> ruleConditions;
|
||||
private final Vocabulary ruleAction;
|
||||
|
||||
public SequencingRuleDescription(@NotNull ConditionType conditionType) {
|
||||
public SequencingRuleDescription(ConditionType conditionType) {
|
||||
this.conditionType = conditionType;
|
||||
conditionCombination = new Vocabulary("All", "All", "Any");
|
||||
ruleConditions = new ArrayList<>();
|
||||
|
||||
@@ -9,8 +9,6 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Stack;
|
||||
|
||||
import com.sun.istack.internal.NotNull;
|
||||
|
||||
import com.xboe.module.scorm.common.ID;
|
||||
import com.xboe.module.scorm.sn.model.global.GlobalObjectiveDescription;
|
||||
import com.xboe.module.scorm.sn.model.tracking.GlobalStateInformation;
|
||||
@@ -76,14 +74,14 @@ public class ActivityTree {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean existActivity(@NotNull Activity activity) {
|
||||
public boolean existActivity(Activity activity) {
|
||||
if (root == null) {
|
||||
return false;
|
||||
}
|
||||
return existActivity(root, activity);
|
||||
}
|
||||
|
||||
public boolean existActivity(@NotNull Activity activity, @NotNull Activity target) {
|
||||
public boolean existActivity(Activity activity, Activity target) {
|
||||
if (activity.equals(target)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.xboe.module.scorm.web;
|
||||
|
||||
/**
|
||||
* 全文检索查询实现
|
||||
*/
|
||||
public class ScormPlayer {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user