Познакомьтесь с пентестом веб-приложений на практике в нашем новом бесплатном курсе
Release 8.5.3FP6 + Linux 3.10.0-229.el7.x86_64 #1 SMP Thu Jan 29Версия то какая?
есть код копирования доков с юнидами (сохранение) из бд1->бд2 ...вручную скопировали документы
%REM
*--------------------------------------------
Function CopyNDC2DB
Description: copy NDC with same UNID
return UNID array
%END REM
Function CopyNDC2DB(NDC As NotesDocumentCollection, db As NotesDatabase)
Dim routineName As String
routineName="CopyNDC2DB"
On Error GoTo ErrH
'your code here
Dim v, doc As NotesDocument
v=Split("","")
Set doc=NDC.Getfirstdocument()
Do While Not doc Is Nothing
Dim tmp As NotesDocument
'check destination db for doc unid
Set tmp=GetDocumentByUNIDSilent(db, doc.Universalid)
Dim isNew As Boolean, bCopied As Boolean
isNew=False:bCopied=False
'если док не копировали
If tmp Is Nothing Then
Set tmp=db.Createdocument()
isNew=True
tmp.Universalid=doc.Universalid
End If
'если док новый или изменился с момента копирования
'Print {orig/copy:} doc.Lastmodified "/" tmp.Lastmodified
Dim dt As New NotesDateTime({}), dt1 As New NotesDateTime({})
dt.Lslocaltime=doc.Lastmodified
dt1.Lslocaltime=tmp.Lastmodified
'doc is newer to tmp
If isNew Or (dt.Timedifference(dt1)>0) Then
Call doc.Copyallitems(tmp, True)
Call tmp.Save(True,False)
bCopied=True
End If
If bCopied Then
If IsEmpty(v) Then
v(0)=doc.Universalid
Else
v=ArrayAppend(v,doc.Universalid)
End If
End If
Set doc=NDC.Getnextdocument(doc)
Loop
CopyNDC2DB=v
Quit:
Exit Function
ErrH:
Error Err, RaiseError
Resume Quit
End Function
Public Function A_MoveCollections (db As NotesDatabase,cl As NotesDocumentCollection) As NotesDocumentCollection
Dim dstdoc As NotesDocument : Dim etxt$
Dim srcdoc As NotesDocument
GoTo begin
errors:
If Not dstdoc Is Nothing Then etxt=" cl.count:" & cl.Count & "Error srcUID:" & srcdoc.Universalid & " dstUID:" & dstdoc.Universalid & " db:" & db.Filepath & " server:" & db.Server & f
Error Err, Error & "," & etxt & " |" & NAME_LIB & GetThreadInfo(1)& " " & Erl
Exit Function
begin:On Error GoTo errors
Set A_MoveCollections=db.CreateDocumentCollection
Set srcdoc=cl.Getfirstdocument()
While Not srcdoc Is Nothing
If srcdoc.Isvalid And Not srcdoc.Isdeleted And Not srcdoc.Hasitem("$Conflict") Then
Set dstdoc=mh.GetDocumentByUID(db,srcdoc.Universalid)
If Not dstdoc Is Nothing Then Call dstdoc.Removepermanently(True)
Set dstdoc=db.Createdocument()
dstdoc.Universalid=srcdoc.Universalid
Call srcdoc.Copyallitems(dstdoc,True)
Call dstdoc.Save(True,False)
Call A_MoveCollections.Adddocument(dstdoc)
End If
Set srcdoc=cl.Getnextdocument(srcdoc)
Wend
End Function
Наверное, луче не remove doc\creat doc\ copyallitems... , а удалить все айтемы из этого дока и записать все новыеSet dstdoc=mh.GetDocumentByUID(db,srcdoc.Universalid)
If Not dstdoc Is Nothing Then Call dstdoc.Removepermanently(True)
для снятия "ограничений" есть вариант записи в текстовой файл и зипование его, соответ. классами...массив штука ограниченная....
%REM
*********************************************
Class AgentBase
Description: launch agent base for local or onServer
%END REM
Class AgentBase As ErrorHandler
Private agent As NotesAgent
Private ses As NotesSession
Private db As NotesDatabase
Private logger As Logger
Private targetDB As NotesDatabase
Private NDCFile As NDCFile
Sub New(targetDb As NotesDatabase)
Dim routineName As String
routineName="New"
On Error GoTo ErrH
'your code here
Set me.targetDB=targetDB
Set ses=New NotesSession
Set db=ses.Currentdatabase
Set agent=ses.Currentagent
Set NDCfile=New NDCFile
If ses.Isonserver Then
Call Me.InitializeOnServer()
Else
Call Me.Initialize()
End If
Quit:
Exit Sub
ErrH:
Error Err, RaiseError
Resume Quit
End Sub
Sub Initialize()
On Error GoTo ErrH
Print {Running...}
Dim NDC As NotesDocumentCollection
Dim doc As NotesDocument, path As String
Dim lst List As String
'************ UI part
Dim wks As New NotesUIWorkspace
Dim uiview As NotesUIView
Set uiview=wks.Currentview
Set NDC=uiview.Documents
'check doc for contains unid list
Set doc=NDC.Getfirstdocument()
path=DetachDocFiles(doc,UNIDS_FILE_WILCARD, lst)
If Len(path)>0 Then Set NDC=NDCfile.Collection(path):Set doc=NDC.Getfirstdocument()
Dim txt As String
Set logger=New Logger({log})
Set logger=Process(NDC, me.targetDB, logger)
'Call logger.ShowLog()
Quit:
Exit Sub
ErrH:
Dim s As String
s=RaiseError
If Not logger Is Nothing Then logger.PrintMsg({!!!Errors:} &s):logger.Save
Error Err, s
End Sub
%REM
*--------------------------------------------
Sub InitializeOnServer
Description: Comments for Sub
%END REM
Sub InitializeOnServer
Dim routineName As String
routineName="InitializeOnServer"
On Error GoTo ErrH
'your code here
Dim NDC As NotesDocumentCollection
Dim doc As NotesDocument, path As String
Dim lst List As String
Set me.logger=New Logger({log})
'************ backend
If Len(agent.Parameterdocid)>0 Then
Set doc=me.db.Getdocumentbyid(agent.Parameterdocid)
If me.targetDB Is Nothing Then Set me.targetDB=GetDBbyRID(me.db.Server,GetDBRID(doc,{body}))
path=DetachDocFiles(doc,{*}, lst)
'reassign new instance, remove body (and files) from doc
Set me.logger.Document=doc
If Len(path)>0 And path Like {*.zip} Then
Dim fName
fName=me.NDCfile.Decompress(path)
Kill path
'gather packet document collection
path=fName(UBound(fName)) &me.NDCFile.FSSEP &fName(0)
Set NDC=me.NDCFile.Collection(path)
Kill path
me.logger.PrintMsg({file:} & path)
Else
me.logger.PrintMsg({*Attach is absent})
End If
Else
me.logger.PrintMsg({*without paramdoc})
End If
'process
Set me.logger=Me.Process(NDC, me.targetDB, logger)
Call me.logger.Save()
Quit:
Exit Sub
ErrH:
Dim s As String
s=RaiseError
If Not logger Is Nothing Then logger.PrintMsg({!!!Errors:} &s):logger.Save
Error Err, s
End Sub
%REM
*--------------------------------------------
Function Process
Description: collection could be NDC, NVN, NEC
%END REM
Function Process(collection As variant, db As NotesDatabase, logger As Logger) As Logger
Dim routineName As String
routineName="Process"
On Error GoTo ErrH
'your code here
Set Process=logger
Quit:
Exit Function
ErrH:
Error Err, RaiseError
Resume Quit
End Function
End Class
Ну как бы да, элегантнее, только вот иногда приНаверное, луче не remove doc\creat doc\ copyallitems... , а удалить все айтемы из этого дока и записать все новые
я уж давно с классик фронтом не работаю - только с бэком + web front)для снятия "ограничений" есть вариант записи в текстовой файл и зипование его, соответ. классами...
Всем привет!
Столкнулся вот с каким приколом. FTSearch по базе не находит всех документов.
Строка поиска, например, такая:
Хотя документ существует. Закономерностей не выявленоКод:([Form]="Person") & (("*конєв*") or ("*конєв") or ("конєв*") or ("конєв"))
У меня было что-то подобное вроде https://codeby.net/threads/ftsearch-period-dekabr.53035/Проблему решили, кардинально: создали пустую базу, накатили дизайн проблемной, вручную скопировали документы - поиск заработал.
Видимо внутренняя таблица NSF была повреждена.
рекомендую еще перечитать сообщение за 2010 год... там много еще разных вопросовЗвёздочка в кавычках - это просто звёздочка, а не символ шаблона
Обучение наступательной кибербезопасности в игровой форме. Начать игру!