Revision 1534
Added by Jing Tao almost 22 years ago
src/edu/ucsb/nceas/metacat/EmlSAXHandler.java | ||
---|---|---|
60 | 60 |
private Vector subDocumentIdList = new Vector(); |
61 | 61 |
private boolean processTopLeverAccess = false; |
62 | 62 |
private boolean processAdditionalAccess = false; |
63 |
private boolean processOtherAccess = false; |
|
63 | 64 |
private AccessSection accessObject= null; |
64 | 65 |
private AccessRule accessRule = null; |
65 | 66 |
private Vector accessObjectList = new Vector(); // store every access rule |
... | ... | |
74 | 75 |
private Stack subTreeInfoStack = new Stack(); |
75 | 76 |
private Vector subTreeList = new Vector();// store the final subtree |
76 | 77 |
private int inLineDataIndex = 1; |
77 |
private Hashtable unChangableSubTreeHash; |
|
78 |
private Hashtable unChangableSubTreeHash = new Hashtable();
|
|
78 | 79 |
private Stack currentUnChangedableSubtreeNodeStack; |
79 | 80 |
private boolean startCriticalSubTree = false; |
80 | 81 |
private boolean firstElementForCriticalSubTree = false; |
... | ... | |
82 | 83 |
|
83 | 84 |
|
84 | 85 |
// Constant |
86 |
private static final String EML ="eml"; |
|
85 | 87 |
private static final String DESCRIBES = "describes"; |
86 | 88 |
private static final String ADDITIONALMETADATA = "additionalMetadata"; |
87 | 89 |
private static final String ORDER = "order"; |
... | ... | |
114 | 116 |
try |
115 | 117 |
{ |
116 | 118 |
PermissionController control = new PermissionController(docid); |
117 |
unChangableSubTreeHash = getUnchangableSubTree(control, user, groups); |
|
119 |
//unChangableSubTreeHash = getUnchangableSubTree(control, user, groups);
|
|
118 | 120 |
} |
119 | 121 |
catch (Exception e) |
120 | 122 |
{ |
... | ... | |
403 | 405 |
} |
404 | 406 |
else |
405 | 407 |
{ |
406 |
processTopLeverAccess = true; |
|
408 |
//make sure the access is top level |
|
409 |
// this mean current node's parent's parent should be "eml" |
|
410 |
DBSAXNode tmpNode = (DBSAXNode) nodeStack.pop();// pop out parent node |
|
411 |
//peek out grandParentNode |
|
412 |
DBSAXNode grandParentNode = (DBSAXNode)nodeStack.peek(); |
|
413 |
// put parent node back |
|
414 |
nodeStack.push(tmpNode); |
|
415 |
String grandParentTag = grandParentNode.getTagName(); |
|
416 |
if (grandParentTag.equals(EML)) |
|
417 |
{ |
|
418 |
processTopLeverAccess = true; |
|
419 |
} |
|
420 |
else |
|
421 |
{ |
|
422 |
// process other access embedded into resource level module |
|
423 |
processOtherAccess = true; |
|
424 |
} |
|
407 | 425 |
|
408 | 426 |
} |
409 | 427 |
// create access object |
... | ... | |
642 | 660 |
describesId.add(data); |
643 | 661 |
} |
644 | 662 |
else if (currentTag.equals(REFERENCES) && |
645 |
(processTopLeverAccess||processAdditionalAccess)) |
|
663 |
(processTopLeverAccess || |
|
664 |
processAdditionalAccess || processOtherAccess)) |
|
646 | 665 |
{ |
647 | 666 |
// get reference |
648 | 667 |
data = (textBuffer.toString()).trim(); |
... | ... | |
829 | 848 |
// reset flag |
830 | 849 |
processAdditionalAccess =false; |
831 | 850 |
processTopLeverAccess =false; |
851 |
processOtherAccess = false; |
|
832 | 852 |
} |
833 | 853 |
else if (currentTag.equals(ADDITIONALMETADATA)) |
834 | 854 |
{ |
... | ... | |
1001 | 1021 |
//write top leve access rule |
1002 | 1022 |
writeTopLevelAccessRuleToDB(); |
1003 | 1023 |
//write additional access rule |
1004 |
writeAddtionalAccessRuleToDB(); |
|
1024 |
//writeAddtionalAccessRuleToDB();
|
|
1005 | 1025 |
}//writeAccessRuleToDB |
1006 | 1026 |
|
1007 | 1027 |
/* The method to write top level access rule into db. */ |
Also available in: Unified diff
Get rid off to pasre additional access module.