   FUNCTION readFile(pUserId NUMBER, pProjectID NUMBER, pFileName VARCHAR2) RETURN userTypes.anyCursor IS
     curResource userTypes.anyCursor;
     recFile userTypes.fileRecord;
-    curOnlineProject userTypes.anyCursor;
-    recOnlineProject cms_projects%ROWTYPE;
-  BEGIN
-    recOnlineProject := opencmsProject.onlineProject(pProjectId);
+    vOnlineProject NUMBER := opencmsconstants.C_PROJECT_ONLINE_ID;
+  BEGIN
     -- first read the file
-    curResource := readFileNoAccess(pUserId, pProjectId, recOnlineProject.project_id, pFileName);
+    curResource := readFileNoAccess(pUserId, pProjectId, vOnlineProject, pFileName);
     FETCH curResource INTO recFile;
     CLOSE curResource;
     -- check the access for the existing file

-------------------------------------------------------------------------
    FUNCTION getParentId(pProjectID NUMBER, pResourceId NUMBER) RETURN NUMBER IS
      vParentId NUMBER;
      vOnlineProject NUMBER := opencmsProject.onlineProject(pProjectId).project_id;
    BEGIN
      IF pProjectId = vOnlineProject THEN
        select decode(parent_id, -1, NULL, parent_id) into vParentId

    vFileName VARCHAR2(100) := '';
    curNewResource userTypes.anyCursor;
    recNewResource userTypes.fileRecord;
    vOnlineProjectId NUMBER := opencmsconstants.C_PROJECT_ONLINE_ID;
  BEGIN
	-- read the source-file, to check readaccess
	curFileHeader := readFileHeader(pUserId, pProjectId, pSource);
	FETCH curFileHeader INTO recFileHeader;
