CCTI XML 문서 보기: 두 판 사이의 차이

Classics Wiki
편집 요약 없음
편집 요약 없음
 
(같은 사용자의 중간 판 3개는 보이지 않습니다)
2번째 줄: 2번째 줄:
<head>
<head>
     <meta charset="UTF-8">
     <meta charset="UTF-8">
     <title>ID 및 프로젝트 리다이렉트</title>
     <title>ID 리다이렉트</title>
     <style>
     <style>
         body { font-family: sans-serif; padding: 20px; line-height: 1.6; }
         body { font-family: sans-serif; padding: 20px; }
         .container { display: flex; flex-direction: column; gap: 10px; max-width: 300px; }
         .container { display: flex; flex-direction: column; gap: 10px; max-width: 350px; }
        .input-group { display: flex; flex-direction: column; gap: 5px; }
         input { padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
        label { font-size: 0.9em; font-weight: bold; color: #555; }
         button { padding: 10px; cursor: pointer; background-color: #28a745; color: white; border: none; border-radius: 4px; font-weight: bold; }
         input { padding: 10px; border: 1px solid #ccc; border-radius: 4px; }
        button:hover { background-color: #218838; }
         button {  
         label { font-size: 14px; color: #666; margin-bottom: -5px; }
            padding: 10px;  
            cursor: pointer;  
            background-color: #007bff;  
            color: white;  
            border: none;  
            border-radius: 4px;  
            font-weight: bold;
            margin-top: 10px;
        }
         button:hover { background-color: #0056b3; }
     </style>
     </style>
</head>
</head>
<body>
<body>


     <h2>데이터 조회</h2>
     <h2>텍스트 유닛의 XML 문서 보기</h2>
     <p>프로젝트와 ID를 입력하고 이동하기 버튼을 누르세요.</p>
      
 
     <div class="container">
     <div class="container">
         <div class="input-group">
         <label>Project 입력</label>
            <label for="projectInput">프로젝트 (Project)</label>
        <input type="text" id="projectInput" placeholder="예: s2601056">
            <input type="text" id="projectInput" placeholder="프로젝트를 입력하세요">
          
         </div>
         <label>텍스트 유닛 ID 입력</label>
 
        <input type="text" id="userId" placeholder="예: 논어-01-01"  
         <div class="input-group">
              onkeypress="if(event.keyCode==13) redirectToUrl()">
            <label for="userId">아이디 (ID)</label>
          
            <input type="text" id="userId" placeholder="ID를 입력하세요"  
         <button onclick="redirectToUrl()">조회하기</button>
                  onkeypress="if(event.keyCode==13) redirectToUrl()">
         </div>
 
         <button onclick="redirectToUrl()">이동하기</button>
     </div>
     </div>


     <script>
     <script>
         function redirectToUrl() {
         function redirectToUrl() {
            // 각 입력창의 값을 가져옵니다.
             const project = document.getElementById('projectInput').value.trim();
             const projectValue = document.getElementById('projectInput').value.trim();
             const id = document.getElementById('userId').value.trim();
             const idValue = document.getElementById('userId').value.trim();


            // 유효성 검사 (두 값 모두 입력되어야 함)
             if (!project || !id) {
             if (projectValue === "" || idValue === "") {
                 alert("프로젝트와 ID를 모두 입력해주세요.");
                 alert("프로젝트와 ID를 모두 입력해주세요.");
                 return;
                 return;
             }
             }


             // 요청하신 URL 구조에 맞게 매개변수 설정
             // 1. 기본 URL 설정
             const baseUrl = "https://kstoryhub.visualasia.com/aistory/ccti_retrieve";
             const baseUrl = "https://kstoryhub.visualasia.com/aistory/ccti_retrieve";
            const server = "kstorydata.visualasia.com";
            const db = "aiclassics2601";
           
            // 최종 URL 생성
            const targetUrl = `${baseUrl}?server=${server}&db=${db}&project=${encodeURIComponent(projectValue)}&id=${encodeURIComponent(idValue)}`;


             // 리다이렉트 실행
             // 2. 파라미터 구성 (객체 형태)
             window.location.href = targetUrl;
            // 브라우저가 & 기호를 자동으로 적절하게 처리하도록 합니다.
             const params = new URLSearchParams({
                server: "kstorydata.visualasia.com",
                db: "aiclassics2601",
                project: project,
                id: id
            });
 
            // 3. 최종 URL 생성 (toString()을 쓰면 & 기호가 깨지지 않고 연결됩니다)
            const finalUrl = baseUrl + "?" + params.toString();
 
            // 확인을 위해 콘솔에 출력 (F12 누르면 볼 수 있습니다)
            console.log("이동 URL:", finalUrl);
 
            // 이동
            window.open(finalUrl, '_blank');
         }
         }
     </script>
     </script>

2026년 4월 27일 (월) 00:42 기준 최신판

ID 리다이렉트

텍스트 유닛의 XML 문서 보기