Itop export csv of functional CIs with wget / link - wget

I want to export all the Functional CIs from a Specific Person. In the web-interface I can just click the wrench-icon and click export to csv, but when I try to do this with a link, it gets a bit more complicated. basically I'm trying to download this View:
or in text:
"FunctionalCI->Typ","FunctionalCI->Name","ID (Primärer Schlüssel)","Voller Name (Friendly Name)","Kontakt","Kontakt->Name","Kontakt->Voller Name (Friendly Name)","Kontakt->Typ","Kontakt->Obsolet","Kontakt->Organisation","Kontakt->Organisation","Kontakt->Email"
"Peripheriegerät","USBKI08018",3747,"3090 795",795,"Sample","Ex Sample","Person",Nein,6,"oragnisation","ex.sample#email.com"
"PC","FUJIQ58003",3395,"3837 795",795,"Sample","Ex Sample","Person",Nein,6,"oragnisation","ex.sample#email.com"
"Peripheriegerät","M056-1907",3432,"3898 795",795,"Sample","Ex Sample","Person",Nein,6,"oragnisation","ex.sample#email.com"
"Peripheriegerät","YUBIKEY013",3632,"3990 795",795,"Sample","Ex Sample","Person",Nein,6,"oragnisation","ex.sample#email.com"
"Peripheriegerät","MSDOCK102",4900,"4555 795",795,"Sample","Ex Sample","Person",Nein,6,"oragnisation","ex.sample#email.com"
"PC","MSSURL348",4895,"4663 795",795,"Sample","Ex Sample","Person",Nein,6,"oragnisation","ex.sample#email.com"
"Peripheriegerät","HEADSET431",6072,"5764 795",795,"Sample","Ex Sample","Person",Nein,6,"oragnisation","ex.sample#email.com"
I have tried multiple OQL's, but I can't get the user to link with its CIs. This is what I have tried:
https://itop.tirvers.at/itop/webservices/export-v2.php?expression=SELECT Person WHERE Person.friendlyname LIKE 'Ex Sample%'&fields=friendlyname, name, status, id&format=csv
This link actually works, but it only gives me more information about the person, which is not what I need. The next thing I tried was:
https://itop.tirvers.at/itop/webservices/export-v2.php?expression=SELECT FunctionalCI WHERE FunctionalCI.name LIKE 'FUJIQ58003%'&fields=id&format=csv
which also works, but, again, only yields more information about the FunctionalCI, which is not what I need.
With a bit of tinkering I got all the classes of the Server:
AsyncTask, AsyncSendEmail, DBProperty, CMDBChange, CMDBChangeOp, CMDBChangeOpCreate,
CMDBChangeOpDelete, CMDBChangeOpSetAttribute, CMDBChangeOpSetAttributeScalar,
CMDBChangeOpSetAttributeTagSet, CMDBChangeOpSetAttributeURL, CMDBChangeOpSetAttributeBlob,
CMDBChangeOpSetAttributeOneWayPassword, CMDBChangeOpSetAttributeEncrypted,
CMDBChangeOpSetAttributeText, CMDBChangeOpSetAttributeLongText, CMDBChangeOpSetAttributeHTML,
CMDBChangeOpSetAttributeCaseLog, CMDBChangeOpPlugin, CMDBChangeOpSetAttributeLinks,
CMDBChangeOpSetAttributeLinksAddRemove, CMDBChangeOpSetAttributeLinksTune,
CMDBChangeOpSetAttributeCustomFields, AuditCategory, AuditRule, Query, QueryOQL,
ModuleInstallation, ExtensionInstallation,
UserDashboard, Shortcut, ShortcutOQL, appUserPreferences, User, UserInternal, Event,
EventNotification, EventNotificationEmail, EventIssue, EventWebService, EventRestService,
EventLoginUsage,
EventOnObject, Action, ActionNotification, ActionEmail, Trigger, TriggerOnObject,
TriggerOnPortalUpdate, TriggerOnStateChange, TriggerOnStateEnter, TriggerOnStateLeave,
TriggerOnObjectCreate,
TriggerOnObjectDelete, TriggerOnObjectUpdate, lnkTriggerAction, TriggerOnThresholdReached,
BulkExportResult, iTopOwnershipToken, TagSetFieldData, SynchroDataSource, SynchroAttribute,
SynchroAttExtKey,
SynchroAttLinkSet, SynchroLog, SynchroReplica, BackgroundTask, InlineImage, KeyValueStore,
UserExternal, UserLDAP, UserLocal, EmailReplica, TriggerOnMailUpdate, MailInboxBase,
Attachment,
CMDBChangeOpAttachmentAdded, CMDBChangeOpAttachmentRemoved, Organization, Location, Contact,
Person, Team, Document, DocumentFile, DocumentNote, DocumentWeb, FunctionalCI, PhysicalDevice,
ConnectableCI, DatacenterDevice, NetworkDevice, Server, ApplicationSolution, BusinessProcess,
SoftwareInstance, Middleware, DBServer, WebServer, PCSoftware, OtherSoftware,
MiddlewareInstance,
DatabaseSchema, WebApplication, Software, Patch, OSPatch, SoftwarePatch, Licence, OSLicence,
SoftwareLicence, lnkDocumentToLicence, Typology, OSVersion, OSFamily, DocumentType,
ContactType,
Brand, Model, NetworkDeviceType, IOSVersion, lnkDocumentToPatch,
lnkSoftwareInstanceToSoftwarePatch, lnkFunctionalCIToOSPatch, lnkDocumentToSoftware,
lnkContactToFunctionalCI,
lnkDocumentToFunctionalCI, Subnet, VLAN, lnkSubnetToVLAN, NetworkInterface, IPInterface,
PhysicalInterface, lnkPhysicalInterfaceToVLAN, lnkConnectableCIToNetworkDevice,
lnkApplicationSolutionToFunctionalCI, lnkApplicationSolutionToBusinessProcess, l
InkPersonToTeam, Group, lnkGroupToCI, Rack, Enclosure, PowerConnection, PowerSource, PDU, PC,
Printer,
TelephonyCI, Phone, MobilePhone, IPPhone, Tablet, Peripheral, MailInboxStandard,
StorageSystem, SANSwitch, TapeLibrary, NAS, FiberChannelInterface, Tape, NASFileSystem,
LogicalVolume,
lnkServerToVolume, lnkSanToDatacenterDevice, Ticket, lnkContactToTicket,
lnkFunctionalCIToTicket, WorkOrder, VirtualDevice, VirtualHost, Hypervisor, Farm,
VirtualMachine, LogicalInterface,
AbstractResource, ResourceAdminMenu, ResourceRunQueriesMenu, ResourceSystemMenu,
lnkVirtualDeviceToVolume, Change, RoutineChange, ApprovedChange, NormalChange,
EmergencyChange, Incident,
KnownError, lnkErrorToFunctionalCI, lnkDocumentToError, FAQ, TagSetFieldDataFor_FAQ__domains,
FAQCategory, Problem, UserRequest, ContractType, Contract, CustomerContract, ProviderContract,
lnkContactToContract, lnkContractToDocument, lnkFunctionalCIToProviderContract, ServiceFamily,
Service, lnkDocumentToService, lnkContactToService, ServiceSubcategory, SLA, SLT, lnkSLAToSLT,
lnkCustomerContractToService, lnkProviderContractToService, lnkFunctionalCIToService,
DeliveryModel, lnkDeliveryModelToContact, CoverageWindowInterval, Holiday, HolidayCalendar,
CoverageWindow, URP_Profiles, URP_UserProfile, URP_UserOrg
as well as the Person filter codes:
finalclass, friendlyname, obsolescence_flag, name, status, org_id, org_id_friendlyname,
org_id_obsolescence_flag, org_name, email, phone, notify, function, first_name, employee_number,
mobile_phone, location_id, location_id_friendlyname, location_id_obsolescence_flag,
location_name, manager_id, manager_id_friendlyname, manager_id_obsolescence_flag,
manager_name, obsolescence_date, id
and the FunctionalCI filter codes:
finalclass, friendlyname, obsolescence_flag, obsolescence_date, name, description, org_id, org_id_friendlyname, org_id_obsolescence_flag, organization_name, business_criticity, move2production, id
And this is the Web-view of a Person:
I don't know if this information is helpful, but it's all I've got.
The downloaded information (csv) would then be processed with python and exported to pdf.
I'm new to Itop-OQL and everything I know about it is from this page: https://www.itophub.io/wiki/page?id=2_4_0%3Aoql%3Aexample. I'm sorry if I made some stupid mistakes or the solution to this problem is super simple!

Context
Functional CIs of a Person are represented as an "indirect linkedset" in iTop, which means that there is an intermediate class in between to store the relation and any data that it would contain (eg. the "role" in the Person / Team link).
The class corresponding to this specific link is named lnkContactToFunctionalCI, you can find it in the "Datamodel viewer" (here is what it looks like on the online demo, use admin/admin credentials) which is in the "Administration" menu. It displays all classes linked to a specific class.
Solution
You should try with an OQL query like SELECT lnkContactToFunctionalCI WHERE contact_id_friendlyname LIKE 'Ex Sample%'

Related

Customise frappe query report

I've been trying to make a query_report on frappe.
but it doesn't return the data on the browser.
the console says 'Unable to handle success response'
console.trace() Each data element must implement a unique 'id' property
this is my sql syntax
SELECT
`tabPayment Entry`.`name` AS `id`,
`tabFees`.`student` AS `student id::100`,
`tabFees`.`student_name` AS `name::200`,
`tabFees`.`posting_date` AS `tgl bayar::200`,
`tabFees`.`due_date` AS `bulan inv::200`,
`tabFees`.`outstanding_amount` AS `blm bayar::200`,
`tabFees`.`paid_amount` AS `terbayar::200`,
`tabFees`.`grand_total` AS `total::200`,
`tabFees`.`status` AS `status::200`,
`tabPayment Entry`.`mode_of_payment` AS `mode::200`
FROM
(tabFees
LEFT JOIN `tabPayment Entry` ON (`tabFees`.`student` = `tabPayment Entry`.`party`))
WHERE
`tabFees`.`status` = %(status)s AND
`tabFees`.`due_date` BETWEEN %(from_date)s AND %(to_date)s
this is the screenshot of the
console report
that sql syntax is working perfectly on the sql preview software.
Please if you have some answer i will appreciate it....

How do I send an email via mime-mail-ses which has a proper "from" name?

The SES data type has the sesFrom field. Everywhere on the Internet I see that I should write something like "\"My Name\" <mymail#gmail.com>" in order to display My Name in the "from" field. But when I put this into the sesFrom field I get
Not sent due to SESException {seStatus = Status {statusCode = 400, statusMessage = "Bad Request"}, seCode = "InvalidParameterValue", seMessage = "Missing '<'", seRequestId = "acf8bb7d-0440-11e8-94c8-45570c829243"}
I checked sources and all seems to be fine there. How do I set the sesFrom field, so a name is displayed?
OK, got it. Instead of writing "\"My Name\" <mymail#gmail.com>" :: Address and relying on OverloadedStrings one should write
Address (Just "Ny Name") "mymail#gmail.com"
I'd say the library should parse "\"My Name\" <mymail#gmail.com>" into that address, but whatever.

Eye-fi card need key that I believe is a MD5 hash

I am stuck with some Eyefi cards, because manufacturer decide to disable it by stopping registration server.
I need an Uploadkey for each card in order to use them. I can get the MAC address of the card, and I believe the hash are generated using these address (may be only right side of the address) plus a salt. Here are some correct uploadkey and Mac addesses, can anybody help me to find out how can we generate the uploadkey using the MAC address.
00-18-56-26-fb-9a f7714f1c6375e329c49704cc2b228610
00-18-56-27-04-91 3599db80740e842be3e51b1a68c50800
00-18-56-60-35-32 c6172ad74fd9f3d089114190e7415bf6
00-18-56-23-89-08 24976afddd2bd6c9ba84024e122313f1
00-18-56-65-48-89 b884d91ed551e9debcaa30cbbed454cf
00-18-56-41-cd-45 7d0c4807cdfb93759b38e468fb6f7796
00-18-56-2b-90-f9 7c207b004d7776b266d7896a42323a81
00-18-56-65-44-28 d721236649997f7d326c3b00fb3c6f2f
00-18-56-65-44-3b 48c8cb73afdf13ada7f636ac618ed1c6
00-18-56-66-a8-71 7989ad884bfd0456f65b5c56655e56a2
00-18-56-66-a8-ac ba01f5c3a49c5309c7655d3bf8b9dc22
00-18-56-66-ac-ca 8ee95d7e6f703fd1bc850e057f471973
00-18-56-66-ac-ac 816c40bdb86a88a79c72a88cc95ed251
00-18-56-66-a0-f9 1cfa78d59161a0ef2068a33cf29a83a9
00-18-56-65-48-c8 f26d16bb221bfb2953cdfc65cc0491a3
00-18-56-66-a1-ee 4e1803543ac47884ebb1437a966f89e2
00-18-56-66-a2-22 386b8a3c6a37828df4b6fccbe8ace943
00-18-56-66-a8-b2 0eae0b55245f2698f28ac496c3c3dbaa
00-18-56-66-ac-9e f36a098fe506be172fb6b067ef00352d
00-18-56-65-51-e7 29c555c9c4b413ea539f51f3a82f263e
00-18-56-48-9a-cd c448958ec576198fdb478febca71c53e
00-18-56-65-48-ef b07cfd70d1890749ff877e44644e5971
00-18-56-26-fe-24 9f73c96e263b14a608802317004c6b98
00-18-56-49-90-6a 364624a58431a5bd65fec56e10003559
00-18-56-60-86-e0 b831e3985a08d4ae1b17548e35036843
00-18-56-64-be-d1 9d5de14ff7d31ecc62b17e0adc3d58fa
00-18-56-64-b7-ac 9fa650cff40dfde43fbf5cac83d8cd8b
00-18-56-66-ab-01 b7f6f3d1280a0e9fe4ecb839a1c5d452
00-18-56-64-b8-43 69e5395dc84e529f50dbb61fbea19868
00-18-56-67-89-c1 f78b834bf125bd1011eea973737655d6
00-18-56-67-89-b2 636a94f10b111f3ecb2d86e483d3d188
00-18-56-67-88-f1 cffa4cf562dffae5bff6033bb431b2f7
00-18-56-67-89-8b 325878ed10fba08597b303913d0ad452
00-18-56-67-89-95 212a84620afa9468c0ad738256c70087
00-18-56-67-8b-94 a43af4eadb8dd895ec9218459edb2ced
00-18-56-67-89-2e e58890a80900371d1b354492885ddefb
00-18-56-67-89-70 b21c36f15331ec798fc91be09df99fe7
00-18-56-67-89-b8 fbf58645bf029b265732df898b7fa5a6
00-18-56-67-89-bd 069a55499764fdae6ff0594938e8e67b
00-18-56-67-89-3f 5923768b6296380369737e26e41f8a56
00-18-56-67-89-b5 c8e06cca653a899c58b936c5b67c4f6a
00-18-56-67-89-52 aac3ab4f10bbb2532e01f58cabce2099
00-18-56-67-89-20 62c6f2d4366fca2b0bbec0d89f2609c1
00-18-56-67-89-5b 78480c27f40b440b261e6539b9722ac0
00-18-56-67-8c-18 393f524169417b63f3d2bd78a4ffe1a8
00-18-56-27-04-69 5310953393797ce8c51939cd73916ebb
00-18-56-2b-90-f9 7c207b004d7776b266d7896a42323a81
00-18-56-2a-8e-c9 8413138729754199101c695391a22129
00-18-56-41-5f-1d 2d1c710c6c7b7dfd4d4ed151d9b25d60
00-18-56-67-89-33 d4258a40554dbd14c206e581ed18af5c
00-18-56-66-aa-90 ce5feb6b1721d1d561daa470fcf516cd
00-18-56-26-97-49 0a7f3af18d21a39c9a40d1afc9685172
00-18-56-2b-fa-41 374583671b464330650ca006882b6320
00-18-56-67-89-95 212a84620afa9468c0ad738256c70087
00-18-56-2c-14-29 7c0ca21f1e0cf05a21185deecbd8a1ba
There are many of us needed this key in order to use the card we paid for...
Referencnce https://www.os3.nl/_media/2013-2014/courses/ot/connor_stavros.pdf

What is the proper way to use a findBy’Field’ method?

I am trying to compare an email address inputed from a form to what is already in the database and I figure the best way to do so is with using a findByEmail method.
I expected that to find the email address for a specific entry in the table but instead it returns the whole entry (first name, last name, and more…).
How do I only find the email address of the entry in the table?
I know I can use a foreach to iterate through the entry but I think that kinda defeats the purpose of using a findByEmail function.
Here’s what I’ve tried so far:
$formEmail = $form->get('email')->getData();
$personEmail = $em->getRepository('UserBundle:User')->findByEmail($formEmail); //Should just find the email address of a person in the database.
var_dump($personsEmail); //returns the whole row associated with the email address (first name, last name…..)
var_dump(if($formEmail == $personEmail));die; //returns false when it should be true because it finds the whole row instead of the email address
If you fetched the entity successfully by email then the email must match.
$formEmail = $form->get('email')->getData();
$person = $em->getRepository('UserBundle:User')->findOneByEmail($formEmail);
if ($person instanceof User) {
// you found a user by email, so the email therefore must match ...
}
Note, use findOneBy not findBy, then you will fetch the object directly instead of in a collection.
Alternatively if you must fetch just the email address for comparison.
$email = $em->createQueryBuilder()
->select('u.email')
->from('UserBundle:User', 'u')
->where('u.email = :email')
->setParameter('email', $formEmail)
->getQuery()
->getSingleScalarResult()
;
Note though that you could just use $person->getEmail() in my first example for the same result.

How to insert a record from a Form with Dialog confirm?

I insert with a Form records in MyTableNewRecord.
In my insert Table method iI insered this code:
dialog dialog;
DialogText dialogText ;
DialogButton dialogButton;
DialogField dialogField;
dialog = new Dialog("Dialog user");
dialogText =
dialog.addText("Text dialog.");
dialogText = dialog.addText("Click OK to continue");
dialog.run();
super();
For to insert, I use a Form.
In MyForm I used a SysListPanelRelationTableCallback for to insert data.
This SysListPanel I created looklike:
sysListPanel = SysListPanelRelationTableCallback::newForm(element,
element.controlId(formControlStr(SysUserGroupInfo, Users)),
"#SYS25440", "#SYS57282", #ImageUser,
tablenum(MyTableRecord),
fieldnum(MyTableNewRecord, UserId),
fieldnum(MyTableNewRecord, AdministratorUse),
tablenum(TableFromRecords),
fieldnum(TableFromRecords, Id),
[fieldnum(TableFromRecords, Id),
fieldnum(TableFromRecords, Name)]
, 0, '' ,
"","");
When I put the User from right site to lest site(and add in MyTableNewRecords ),
the DialogBox run, but, when I clicked OK(dialogBox DefaultButton), I give an error, looklike:
"Few or too ttsbegin/ttscommit . Current level TTS is 1"
I can insert a records if I only clicked on Escape (X).
How I can insert records after DialogBox?
I tried to insert ttsbegin; ttscommti; maybe I'm wrong to put them, because it gives me the same error.
I have to use another override method, but I tried with validateWritre and not even open the Dialog (test in Debug and does not pass through the method).
Or, It's possible to insert a confirm befor to add a record with ListPanel?
I nedd to have a confirm and , after I have to add a record in a Table (MyTableNewRecord).
Thanks for yours time,
enjoy!
you should not write code that allows user interaction(ie a dialog) during a transaction
https://msdn.microsoft.com/en-us/library/aa609617.aspx