Пример #1
0
/*
 * ============================================================================
 * Parse directory and filename from full export file specification.
 * Enter:  ctl      Export control data.
 *         fileSpec File spec.
 * ============================================================================
 */
void exporthtml_parse_filespec( ExportHtmlCtl *ctl, gchar *fileSpec ) {
	gchar *t;

	ctl->fileHtml =
		mgu_replace_string( ctl->fileHtml, g_basename( fileSpec ) );
	t = g_dirname( fileSpec );
	ctl->dirOutput = mgu_replace_string( ctl->dirOutput, t );
	g_free( t );
	ctl->path = mgu_replace_string( ctl->path, fileSpec );
}
Пример #2
0
/**
 * Specify nick name for person object.
 * \param person Person object.
 * \param value name.
 */
void addritem_person_set_nick_name( ItemPerson *person, const gchar *value ) {
	if (!value || g_utf8_validate(value, -1, NULL))
		person->nickName = mgu_replace_string( person->nickName, value );
	else {
		gchar *out = conv_codeset_strdup(value, 
				conv_get_locale_charset_str_no_utf8(),
				CS_INTERNAL);
		if (out)
			person->nickName = mgu_replace_string( person->nickName, out );
		g_free(out);
	}
}
Пример #3
0
/**
 * Specify common name for person object.
 * \param person Person object.
 * \param value name.
 */
void addritem_person_set_common_name( ItemPerson *person, const gchar *value ) {
	if (!value || g_utf8_validate(value, -1, NULL))
		ADDRITEM_NAME(person) = mgu_replace_string( ADDRITEM_NAME(person), value );
	else {
		gchar *out = conv_codeset_strdup(value, 
				conv_get_locale_charset_str_no_utf8(),
				CS_INTERNAL);
		if (out)
			ADDRITEM_NAME(person) = mgu_replace_string( ADDRITEM_NAME(person), out );
		g_free(out);
	}
}
Пример #4
0
/*
 * Build full export file specification.
 * Enter:  ctl  Export control data.
 */
static void exporthtml_build_filespec( ExportHtmlCtl *ctl ) {
	gchar *fileSpec;

	fileSpec = g_strconcat(
		ctl->dirOutput, G_DIR_SEPARATOR_S, ctl->fileHtml, NULL );
	ctl->path = mgu_replace_string( ctl->path, fileSpec );
	g_free( fileSpec );
}
Пример #5
0
/**
 * Specify search value to be used.
 * \param qry Query object.
 * \param value 
 */
void ldapqry_set_search_value( LdapQuery *qry, const gchar *value ) {
	cm_return_if_fail( qry != NULL );
	ADDRQUERY_SEARCHVALUE(qry) = mgu_replace_string( ADDRQUERY_SEARCHVALUE(qry), value );
	if (ADDRQUERY_SEARCHVALUE(qry) == NULL)
		return;
	g_strstrip( ADDRQUERY_SEARCHVALUE(qry) );
	debug_print("search value: %s\n", ADDRQUERY_SEARCHVALUE(qry));
}
Пример #6
0
/**
 * Set user name for field record.
 * \param rec   LDIF field object.
 * \param value User name to set. Note that reserved fields cannot be
 *              named.
 */
void ldif_field_set_name( Ldif_FieldRec *rec, const gchar *value ) {
	cm_return_if_fail( rec != NULL );

	if( ! rec->reserved ) {
		rec->userName = mgu_replace_string( rec->userName, value );
		g_strstrip( rec->userName );
	}
}
Пример #7
0
/**
 * Specify hostname to be used.
 * \param ctl   Control object to process.
 * \param value Host name.
 */
void ldapctl_set_host( LdapControl* ctl, const gchar *value ) {
	ctl->hostName = mgu_replace_string( ctl->hostName, value );

	if ( ctl->hostName == NULL )
		return;

	g_strstrip( ctl->hostName );
	debug_print("setting hostname: %s\n", ctl->hostName);
}
Пример #8
0
/**
 * Specify bind DN to be used.
 * \param ctl  Control object to process.
 * \param value Bind DN.
 */
void ldapctl_set_bind_dn( LdapControl* ctl, const gchar *value ) {
	ctl->bindDN = mgu_replace_string( ctl->bindDN, value );

	if ( ctl->bindDN == NULL )
		return;

	g_strstrip( ctl->bindDN );
	debug_print("setting bindDN: %s\n", ctl->bindDN);
}
Пример #9
0
/*
 * Set default values.
 * Enter: ctl Export control data.
 */
static void exporthtml_default_values( ExportHtmlCtl *ctl ) {
	gchar *str;

	str = g_strconcat(
		get_home_dir(), G_DIR_SEPARATOR_S,
		DFL_DIR_CLAWS_OUT, NULL );

	ctl->dirOutput = mgu_replace_string( ctl->dirOutput, str );
	g_free( str );

	ctl->fileHtml =
		mgu_replace_string( ctl->fileHtml, DFL_FILE_CLAWS_OUT );
	ctl->encoding = NULL;
	ctl->stylesheet = EXPORT_HTML_ID_DEFAULT;
	ctl->nameFormat = EXPORT_HTML_FIRST_LAST;
	ctl->banding = TRUE;
	ctl->linkEMail = TRUE;
	ctl->showAttribs = TRUE;
	ctl->retVal = MGU_SUCCESS;
}
Пример #10
0
/**
 * Specify full file specification of LDIF file.
 * \param ldifFile LDIF import control object.
 * \param value    Value of access flag.
 */
void ldif_set_file( LdifFile *ldifFile, const gchar *value ) {
	cm_return_if_fail( ldifFile != NULL );

	if( ldifFile->path ) {
		if( strcmp( ldifFile->path, value ) != 0 )
			ldifFile->dirtyFlag = TRUE;
	}
	else {
		ldifFile->dirtyFlag = TRUE;
	}
	ldifFile->path = mgu_replace_string( ldifFile->path, value );
	g_strstrip( ldifFile->path );
	ldifFile->importCount = 0;
}
Пример #11
0
/*
 * ============================================================================
 * Load settings from XML properties file.
 * Enter: ctl  Export control data.
 * ============================================================================
 */
void exporthtml_load_settings( ExportHtmlCtl *ctl ) {
	XmlProperty *props;
	gint rc;
	gchar buf[256];

	*buf = '\0';
	props = xmlprops_create();
	xmlprops_set_path( props, ctl->settingsFile );
	rc = xmlprops_load_file( props );
	if( rc == 0 ) {
		/* Read settings */
		xmlprops_get_property_s( props, EXMLPROP_DIRECTORY, buf );
		ctl->dirOutput = mgu_replace_string( ctl->dirOutput, buf );

		xmlprops_get_property_s( props, EXMLPROP_FILE, buf );
		ctl->fileHtml = mgu_replace_string( ctl->fileHtml, buf );

		ctl->stylesheet =
			xmlprops_get_property_i( props, EXMLPROP_STYLESHEET );
		ctl->nameFormat =
			xmlprops_get_property_i( props, EXMLPROP_FMT_NAME );
		ctl->banding =
			xmlprops_get_property_b( props, EXMLPROP_BANDING );
		ctl->linkEMail =
			xmlprops_get_property_b( props, EXMLPROP_FMT_EMAIL );
		ctl->showAttribs =
			xmlprops_get_property_b( props, EXMLPROP_FMT_ATTRIB );
	}
	else {
		/* Set default values */
		exporthtml_default_values( ctl );
	}
	exporthtml_build_filespec( ctl );
	/* exporthtml_print( ctl, stdout ); */

	xmlprops_free( props );
}
Пример #12
0
void exporthtml_set_path( ExportHtmlCtl *ctl, const gchar *value ) {
	g_return_if_fail( ctl != NULL );
	ctl->path = mgu_replace_string( ctl->path, value );
	g_strstrip( ctl->path );
}
Пример #13
0
void exporthtml_set_file_html( ExportHtmlCtl *ctl, const gchar *value ) {
	g_return_if_fail( ctl != NULL );
	ctl->fileHtml = mgu_replace_string( ctl->fileHtml, value );
	g_strstrip( ctl->fileHtml );
}
Пример #14
0
/**
 * Specify address for email.
 * \param email E-Mail item.
 * \param value Address.
 */
void addritem_email_set_address( ItemEMail *email, const gchar *value ) {
	email->address = mgu_replace_string( email->address, value );
}
Пример #15
0
/*
 * Specify path to folder where files are created.
 * Enter: ctl   Export control data.
 *        value Full directory path.
 */
void exporthtml_set_output_dir( ExportHtmlCtl *ctl, const gchar *value ) {
	g_return_if_fail( ctl != NULL );
	ctl->dirOutput = mgu_replace_string( ctl->dirOutput, value );
	g_strstrip( ctl->dirOutput );
}
Пример #16
0
/**
 * Specify ID for person object.
 * \param person Person object.
 * \param value ID.
 */
void addritem_person_set_id( ItemPerson *person, const gchar *value ) {
	ADDRITEM_ID(person) = mgu_replace_string( ADDRITEM_ID(person), value );
}
Пример #17
0
/*
 * Specify path to folder that will be harvested.
 * Entry: harvester Harvester object.
 *        value     Full directory path.
 */
void addrharvest_set_path( AddressHarvester* harvester, const gchar *value ) {
	g_return_if_fail( harvester != NULL );
	harvester->path = mgu_replace_string( harvester->path, value );
	g_strstrip( harvester->path );
}
Пример #18
0
/**
 * Specify alias for email.
 * \param email E-Mail item.
 * \param value Alias.
 */
void addritem_email_set_alias( ItemEMail *email, const gchar *value ) {
	ADDRITEM_NAME(email) = mgu_replace_string( ADDRITEM_NAME(email), value );
}
Пример #19
0
/*
* Properties...
*/
void jpilot_set_name( JPilotFile* pilotFile, const gchar *value ) {
	g_return_if_fail( pilotFile != NULL );
	pilotFile->name = mgu_replace_string( pilotFile->name, value );
}
Пример #20
0
/**
 * Specify name to be used for group.
 * \param group Group object.
 * \param value Name of group.
 */
void addritem_group_set_name( ItemGroup *group, const gchar *value ) {
	ADDRITEM_NAME(group) = mgu_replace_string( ADDRITEM_NAME(group), value );
}
Пример #21
0
/**
 * Specify remarks to be used for group.
 * \param group Group object.
 * \param value Remarks for group.
 */
void addritem_group_set_remarks( ItemGroup *group, const gchar *value ) {
	group->remarks = mgu_replace_string( group->remarks, value );
}
Пример #22
0
/**
 * Specify remarks for email.
 * \param email E-Mail item.
 * \param value Remarks.
 */
void addritem_email_set_remarks( ItemEMail *email, const gchar *value ) {
	email->remarks = mgu_replace_string( email->remarks, value );
}
Пример #23
0
/**
 * Specify common name for person object.
 * \param person Person object.
 * \param value name.
 */
void addritem_person_set_common_name( ItemPerson *person, const gchar *value ) {
	ADDRITEM_NAME(person) = mgu_replace_string( ADDRITEM_NAME(person), value );
}
Пример #24
0
/**
 * Specify nick name for person object.
 * \param person Person object.
 * \param value name.
 */
void addritem_person_set_nick_name( ItemPerson *person, const gchar *value ) {
	person->nickName = mgu_replace_string( person->nickName, value );
}
Пример #25
0
void exporthtml_set_encoding( ExportHtmlCtl *ctl, const gchar *value ) {
	g_return_if_fail( ctl != NULL );
	ctl->encoding = mgu_replace_string( ctl->encoding, value );
	g_strstrip( ctl->encoding );
}
Пример #26
0
/**
 * Specify name to be used for folder.
 * \param folder Folder.
 * \param value  Name.
 */
void addritem_folder_set_name( ItemFolder *folder, const gchar *value ) {
	ADDRITEM_NAME(folder) = mgu_replace_string( ADDRITEM_NAME(folder), value );
}
Пример #27
0
void jpilot_set_file( JPilotFile* pilotFile, const gchar *value ) {
	g_return_if_fail( pilotFile != NULL );
	addrcache_refresh( pilotFile->addressCache );
	pilotFile->readMetadata = FALSE;
	pilotFile->path = mgu_replace_string( pilotFile->path, value );
}
Пример #28
0
/**
 * Specify remarks to be used for folder.
 * \param folder Folder.
 * \param value  Remarks.
 */
void addritem_folder_set_remarks( ItemFolder *folder, const gchar *value ) {
	folder->remarks = mgu_replace_string( folder->remarks, value );
}
Пример #29
0
/**
 * Specify external ID for person object.
 * \param person Person object.
 * \param value ID.
 */
void addritem_person_set_external_id( ItemPerson *person, const gchar *value ) {
	person->externalID = mgu_replace_string( person->externalID, value );
}
Пример #30
0
/**
 * Specify value for attribute.
 * \param item Attribute object.
 * \param value Value.
 */
void addritem_attrib_set_value( UserAttribute *item, const gchar *value ) {
	g_return_if_fail( item != NULL );
	item->value = mgu_replace_string( item->value, value );
}