 -- for the project with project_id = pProjectId or for online-projekt
 --------------------------------------------------------------------------------------------------------------
   FUNCTION readFileHeader(pUserId NUMBER, pProjectID NUMBER, pFileName VARCHAR2) RETURN userTypes.anyCursor IS
-    curOnlineProject userTypes.anyCursor;
-    vOnlineProject NUMBER;
+    vOnlineProject NUMBER := opencmsconstants.C_PROJECT_ONLINE_ID;
     curResource userTypes.anyCursor;
     recFile cms_resources%ROWTYPE;
   BEGIN
-    vOnlineProject := opencmsProject.onlineProject(pProjectId).project_id;
     -- is pFileName a folder? => readFolder
     IF substr(pFileName, -1) = '/' THEN
       curResource := readFolder(pUserId, pProjectId, pFileName);

	IF recFolder.resource_id IS NOT NULL THEN
	  IF opencmsAccess.accessCreate(pUserId, pProjectId, recFolder.resource_id) = 1 THEN
	    -- write-access was granted - copy the file and the metainfos
	    curFile := readFile(pUserId, pProjectId, recOnlineProject.project_id, pSource);
        FETCH curFile INTO recFile;
        CLOSE curFile;
        IF recFile.resource_id IS NOT NULL THEN
          createFile(pProjectId, recOnlineProject.project_id, recFile, pUserId, recFolder.resource_id, vFolderName||vFileName, 'TRUE', curNewResource);
          FETCH curNewResource INTO recNewResource;
          CLOSE curNewResource;
	      -- copy the metainfos
	      lockResource(pUserId, pProjectId, recOnlineProject.project_id, recNewResource.resource_name, 'TRUE');
	      opencmsProperty.writeProperties(pUserId, pProjectId, recNewResource.resource_id, recNewResource.resource_type,
	                                      opencmsProperty.readAllProperties(pUserId, pProjectId, recFile.resource_name));
        ELSE

  PROCEDURE writeFileHeader(pProjectID IN NUMBER, pResource IN cms_resources%ROWTYPE, pChange IN VARCHAR2) IS
    vState NUMBER := pResource.state;
    vNewFileId NUMBER := pResource.file_id;
    vOnlineProject NUMBER := opencmsconstants.C_PROJECT_ONLINE_ID;
    vTableName VARCHAR2(20);
  BEGIN
    IF pProjectId = vOnlineProject THEN
      vTableName := 'CMS_ONLINE_RESOURCES';
    ELSE
