/** * Create a document * @param object $p path_parts * @return integer. The document_id */ public function touch($p) { static $check_document = array(); // only touch it once. if ($check_document[$p > real_full_path]) { return $check_document[$p > real_full_path]; } /* $bt = debug_backtrace(); echo "<b>db::{$bt[0]['function']} Called from file: {$bt[0]['file']} line: {$bt[0]['line']}</b><br/>"; unset($bt); */ /* * @uses Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVSTRING * @uses Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVLONGTEXT * @uses Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVINT * @uses Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVFLOAT * @uses Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVDATE * @uses Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVMATRIKKEL * @uses Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVADDRESS * @uses Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVPAIR * @uses Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVBOOLEAN * @uses Bra5EnumBraArkivAttributeType::VALUE_UNKNOWN */ /* - * @param boolean $_bFDoubleSided - * @param boolean $_bFSeparateKeySheet - * @param boolean $_classified - * @param int $_priority * @param int $_productionLineID * @param int $_docSplitTypeID * @param Bra5StructArrayOfAttribute $_attributes * @param string $_iD * @param string $_bFDocKey * @param string $_bFNoSheets * @param string $_bBRegTime * @param string $_name * @param string $_className * @param string $_baseClassName */ $document = new Bra5StructDocument(); $document->setBFDoubleSided(false); $document->setBFSeparateKeySheet(false); $document->setClassified(false); $document->setPriority(0); $document->setProductionLineID(1); // $document->setDocSplitTypeID(0); // $document->setID(''); // $document->setBFDocKey(''); // $document->setBFNoSheets(''); $document->setBBRegTime(date('Y-m-d')); // $document->setName(''); $document->setClassName("Byggesak"); $document->setBaseClassName("Eiendomsarkiver"); $attributter = array(); $att0 = new Bra5StructAttribute(); $att0->setUsesLookupValues(false); $att0->setAttribType(Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVADDRESS); $att0->setName("Adresse"); // $att0->setValue(new Bra5StructArrayOfAnyType()); $_gate = 'Lønborglien'; $_nummer = 285; $_bokstav = NULL; $att0->setValue(new Bra5StructArrayOfAnyType(new Bra5StructAddress($_gate, $_nummer, $_bokstav))); $attributter[] = $att0; $att1 = new Bra5StructAttribute(); $att1->setUsesLookupValues(true); $att1->setAttribType(Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVSTRING); $att1->setName("Sakstype"); // $att1->setValue(new Bra5StructArrayOfAnyType(100)); $att1->setValue(array('100')); $attributter[] = $att1; $att2 = new Bra5StructAttribute(); $att2->setUsesLookupValues(false); $att2->setAttribType(Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVSTRING); $att2->setName("ASTA_Signatur"); $att2->setValue(new Bra5StructArrayOfAnyType("BBA/A-0430/H/Ha/L1002")); $attributter[] = $att2; $att3 = new Bra5StructAttribute(); $att3->setUsesLookupValues(false); $att3->setAttribType(Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVMATRIKKEL); $att3->setName("Eiendom"); $_gNr = 164; $_bNr = 1401; $_fNr = 0; $_sNr = 0; $att3->setValue(new Bra5StructArrayOfAnyType(new Bra5StructMatrikkel($_gNr, $_bNr, $_fNr, $_sNr))); $attributter[] = $att3; $att4 = new Bra5StructAttribute(); $att4->setUsesLookupValues(false); $att4->setAttribType(Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVSTRING); $att4->setName("Byggnr"); // $att4->setValue(new Bra5StructArrayOfAnyType(array('139276655'))); // $att4->setValue(new Bra5StructArrayOfAnyType(new Bra5StructArrayOfString('139276655'))); // $att4->setValue(new Bra5StructArrayOfAnyType(new Bra5StructArrayOfString(array('139276655')))); // $att4->setValue(array('139276655')); $att4->setValue('139276655'); // $att4->setValue(new Bra5StructArrayOfString('139276655')); $attributter[] = $att4; $att5 = new Bra5StructAttribute(); $att5->setUsesLookupValues(false); $att5->setAttribType(Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVSTRING); $att5->setName("Saksnr"); $att5->setValue(array(1)); $attributter[] = $att5; /* $att6 = new Bra5StructAttribute(); $att6->setUsesLookupValues(false); $att6->setAttribType(Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVDATE); $att6->setName("Saksdato"); $att6->setValue(array(date('Y-m-d'))); $attributter[] = $att6; $att7 = new Bra5StructAttribute(); $att7->setUsesLookupValues(false); $att7->setAttribType(Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVDATE); $att7->setName("Dokumentdato"); $att7->setValue(array(date('Y-m-d'))); $attributter[] = $att7; */ $att8 = new Bra5StructAttribute(); $att8->setUsesLookupValues(true); $att8->setAttribType(Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVSTRING); $att8->setName("Tiltakstype"); $att8->setValue(array('BOL3')); $attributter[] = $att8; $att9 = new Bra5StructAttribute(); $att9->setUsesLookupValues(true); $att9->setAttribType(Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVSTRING); $att9->setName("Tiltaksart"); $att9->setValue(array('10')); $attributter[] = $att9; $att10 = new Bra5StructAttribute(); $att10->setUsesLookupValues(true); $att10->setAttribType(Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVSTRING); $att10->setName("Dokumentstatus"); $att10->setValue(array('Gjeldende')); $attributter[] = $att10; $att11 = new Bra5StructAttribute(); $att11->setUsesLookupValues(true); $att11->setAttribType(Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVSTRING); $att11->setName("Dokumentkategori"); $att11->setValue(array('Søknad')); $attributter[] = $att11; $att12 = new Bra5StructAttribute(); $att12->setUsesLookupValues(true); $att12->setAttribType(Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVSTRING); $att12->setName("Merknad"); $att12->setValue(array('')); $attributter[] = $att12; /* $att13 = new Bra5StructAttribute(); $att13->setUsesLookupValues(true); $att13->setAttribType(Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVINT); $att13->setName("BrukerID"); $att13->setValue(array(13)); $attributter[] = $att13; */ $att14 = new Bra5StructAttribute(); $att14->setUsesLookupValues(true); $att14->setAttribType(Bra5EnumBraArkivAttributeType::VALUE_BRAARKIVSTRING); $att14->setName("Gradering"); $att14->setValue(array('')); $attributter[] = $att14; $document->setAttributes($attributter); $bra5ServiceCreate = new Bra5ServiceCreate(); $bra5ServiceCreateDocument = new Bra5StructCreateDocument($_assignDocKey = false, $this->secKey, $document); // _debug_array($bra5ServiceCreateDocument); // die(); if ($bra5ServiceCreate->createDocument($bra5ServiceCreateDocument)) { // _debug_array($bra5ServiceCreate->getResult()); } else { _debug_array($bra5ServiceCreate->getLastError()); } $document_id = $bra5ServiceCreate->getResult()->getCreateDocumentResult()->getcreateDocumentResult()->ID; $check_document[$p > real_full_path] = $document_id; // _debug_array($document_id); //die(); return $document_id; }
print_r($bra5ServiceSearch->getResult()); } else { print_r($bra5ServiceSearch->getLastError()); } // sample call for Bra5ServiceSearch::searchAndGetDocuments() if ($bra5ServiceSearch->searchAndGetDocuments(new Bra5StructSearchAndGetDocuments())) { print_r($bra5ServiceSearch->getResult()); } else { print_r($bra5ServiceSearch->getLastError()); } /******************************* * Example for Bra5ServiceCreate */ $bra5ServiceCreate = new Bra5ServiceCreate(); // sample call for Bra5ServiceCreate::createDocument() if ($bra5ServiceCreate->createDocument(new Bra5StructCreateDocument())) { print_r($bra5ServiceCreate->getResult()); } else { print_r($bra5ServiceCreate->getLastError()); } /******************************* * Example for Bra5ServiceUpdate */ $bra5ServiceUpdate = new Bra5ServiceUpdate(); // sample call for Bra5ServiceUpdate::updateDocument() if ($bra5ServiceUpdate->updateDocument(new Bra5StructUpdateDocument())) { print_r($bra5ServiceUpdate->getResult()); } else { print_r($bra5ServiceUpdate->getLastError()); } // sample call for Bra5ServiceUpdate::updateAttribute()