This commit is contained in:
hyatt%netscape.com 1998-07-23 17:36:59 +00:00
Родитель f4d0393c3d
Коммит e4d8d4f6bd
30 изменённых файлов: 2682 добавлений и 456 удалений

Просмотреть файл

@ -21,6 +21,6 @@
MODULE = rdf
DEPTH = ../../..
EXPORTS = rdf.h htrdf.h vocab.h
EXPORTS = rdf.h htrdf.h vocab.h jsec2rdf.h
include $(DEPTH)/config/rules.mk

Просмотреть файл

@ -1,7 +0,0 @@
#
# This is a list of local files which get copied to the mozilla:dist directory
#
rdf.h
vocab.h
htrdf.h

Просмотреть файл

@ -94,11 +94,10 @@ typedef uint32 HT_Error;
struct _HT_NotificationStruct;
typedef void (*HT_NotificationProc)(struct _HT_NotificationStruct*,
HT_Resource node, HT_Event whatHappened);
HT_Resource node, HT_Event whatHappened, void *param, uint32 tokenType);
typedef struct _HT_NotificationStruct {
HT_NotificationProc notifyProc;
void* data;
HT_NotificationProc notifyProc;
void *data;
} HT_NotificationStruct;
@ -127,6 +126,16 @@ typedef HT_NotificationStruct* HT_Notification;
#define HT_EVENT_WORKSPACE_EDIT 0x00004000UL
#define HT_EVENT_VIEW_HTML_ADD 0x00008000UL
#define HT_EVENT_VIEW_HTML_REMOVE 0x00010000UL
#define HT_EVENT_NODE_ENABLE 0x00020000UL
#define HT_EVENT_NODE_DISABLE 0x00040000UL
#define HT_EVENT_NODE_SCROLLTO 0x00080000UL
#define HT_EVENT_COLUMN_ADD 0x00100000UL
#define HT_EVENT_COLUMN_DELETE 0x00200000UL
#define HT_EVENT_COLUMN_SIZETO 0x00400000UL
#define HT_EVENT_COLUMN_REORDER 0x00800000UL
#define HT_EVENT_COLUMN_SHOW 0x01000000UL
#define HT_EVENT_COLUMN_HIDE 0x02000000UL
#define HT_EVENT_NO_NOTIFICATION_MASK 0x00000000UL
#define HT_EVENT_DEFAULT_NOTIFICATION_MASK 0xFFFFFFFFUL
@ -135,7 +144,10 @@ typedef HT_NotificationStruct* HT_Notification;
/* View/Pane Creation / Destruction / Management */
/*-----------------------------------------------------------------------*/
PR_PUBLIC_API(HT_Pane) HT_PaneFromResource(RDF_Resource r, HT_Notification n, PRBool autoFlush);
PR_PUBLIC_API(HT_Pane) HT_PaneFromResource(RDF_Resource r, HT_Notification n, PRBool autoFlush, PRBool autoOpen, PRBool useColumns);
PR_PUBLIC_API(HT_Pane) HT_PaneFromURL(char* url, HT_Notification n, PRBool autoFlush, int32 param_count,
char** param_names, char** param_values);
/* NewQuickFilePane
* Creates a pane consisting of one view. This view has the RDF resource
@ -144,6 +156,12 @@ PR_PUBLIC_API(HT_Pane) HT_PaneFromResource(RDF_Resource r, HT_Notification n, PR
PR_PUBLIC_API(HT_Pane) HT_NewQuickFilePane (HT_Notification notify);
/* NewToolbarPane
* Added by Dave
* Create a pane consisting of multiple views. Each view corresponds to a single toolbar.
*/
PR_PUBLIC_API(HT_Pane) HT_NewToolbarPane (HT_Notification notify);
/* NewPersonalToolbarPane
* Creates a pane consisting of one view. This view has the RDF resource
* corresponding to the Personal Toolbar folder as its root.
@ -251,8 +269,8 @@ PR_PUBLIC_API(HT_Resource) HT_GetParent (HT_Resource node);
* HT_NodeDisplayString (XXX needs work)
* obtain the name of a node
*/
PR_PUBLIC_API(HT_Error) HT_NodeDisplayString (HT_Resource node, char *buffer, int bufferLen);
PR_PUBLIC_API(HT_Error) HT_ViewDisplayString (HT_View view, char *buffer, int bufferLen);
PR_PUBLIC_API(HT_Error) HT_NodeDisplayString (HT_Resource node, char *buffer, int bufferLen); /* obsolete! */
PR_PUBLIC_API(HT_Error) HT_ViewDisplayString (HT_View view, char *buffer, int bufferLen); /* obsolete! */
PR_PUBLIC_API(PRBool) HT_GetNodeData (HT_Resource node, void *token,
uint32 tokenType, void **data);
@ -271,6 +289,7 @@ PR_PUBLIC_API(char *) HT_GetWorkspaceLargeIconURL (HT_View view);
PR_PUBLIC_API(char *) HT_GetWorkspaceSmallIconURL (HT_View view);
PR_PUBLIC_API(char *) HT_GetNodeLargeIconURL (HT_Resource r);
PR_PUBLIC_API(char *) HT_GetNodeSmallIconURL (HT_Resource r);
PR_PUBLIC_API(char *) HT_GetIconURL(HT_Resource r, PRBool isLargeIcon, PRBool isWorkspace, int buttonState);
PR_PUBLIC_API(char *) HT_GetLargeIconURL (HT_Resource r); /* obsolete! */
PR_PUBLIC_API(char *) HT_GetSmallIconURL (HT_Resource r); /* obsolete! */
@ -295,7 +314,19 @@ PR_PUBLIC_API(void) HT_SetColumnOrder(HT_View view, void *srcColToken,
PRBool afterDestFlag);
PR_PUBLIC_API(void) HT_SetSortColumn(HT_View view, void *token,
uint32 tokenType, PRBool descendingFlag);
PR_PUBLIC_API(void) HT_SetColumnWidth(HT_View view, void *token,
uint32 tokenType, uint32 width);
PR_PUBLIC_API(uint32) HT_GetColumnWidth(HT_View view, void *token, uint32 tokenType);
PR_PUBLIC_API(void) HT_SetColumnVisibility(HT_View view, void *token, uint32 tokenType, PRBool isHiddenFlag);
PR_PUBLIC_API(PRBool) HT_GetColumnVisibility(HT_View view, void *token, uint32 tokenType);
PR_PUBLIC_API(void) HT_ShowColumn(HT_View view, void *token, uint32 tokenType);
PR_PUBLIC_API(void) HT_HideColumn(HT_View view, void *token, uint32 tokenType);
PR_PUBLIC_API(PRBool) HT_ContainerSupportsNaturalOrderSort(HT_Resource container);
PR_PUBLIC_API(void) HT_SetColumnFEData(HT_View view, void *token, void *data);
PR_PUBLIC_API(void *) HT_GetColumnFEData (HT_View view, void *token);
PR_PUBLIC_API(void) HT_SetTopVisibleNodeIndex(HT_View view, uint32 topNodeIndex);
PR_PUBLIC_API(uint32) HT_GetTopVisibleNodeIndex(HT_View view);
/*
@ -351,13 +382,19 @@ PR_PUBLIC_API(RDF_Resource) HT_GetRDFResource (HT_Resource node);
* Access the node's name and URL
*/
PR_PUBLIC_API(char*) HT_GetNodeURL(HT_Resource node);
PR_PUBLIC_API(char*) HT_GetNodeName(HT_Resource node);
PR_PUBLIC_API(char *) HT_GetNodeURL(HT_Resource node);
PR_PUBLIC_API(char *) HT_GetNodeName(HT_Resource node);
/*-----------------------------------------------------------------------*/
/* Accessor and Mutators */
/*-----------------------------------------------------------------------*/
/*
* HT_IsURLBar
* determine whether node is a URL bar
*/
PR_PUBLIC_API(PRBool) HT_IsURLBar (HT_Resource node);
/*
* HT_IsSeparator
* determine whether node is a separator
@ -398,6 +435,10 @@ PR_PUBLIC_API(HT_Error) HT_SetSelectionRange (HT_Resource node1, HT_Resource nod
PR_PUBLIC_API(HT_Resource) HT_GetNextSelection(HT_View view, HT_Resource startingNode);
PR_PUBLIC_API(void) HT_ToggleSelection(HT_Resource node);
PR_PUBLIC_API(PRBool) HT_IsEnabled (HT_Resource node);
PR_PUBLIC_API(HT_Error) HT_GetEnabledState (HT_Resource node, PRBool *enabledState);
PR_PUBLIC_API(HT_Error) HT_SetEnabledState(HT_Resource node, PRBool isEnabled);
PR_PUBLIC_API(PRBool) HT_Launch(HT_Resource node, MWContext *context);
PR_PUBLIC_API(PRBool) HT_LaunchURL(HT_Pane pane, char *url, MWContext *context);
@ -419,6 +460,8 @@ PR_PUBLIC_API(HT_Resource) HT_GetNextItem (HT_Cursor cursor) ;
PR_PUBLIC_API(PRBool) HT_IsContainerOpen (HT_Resource node);
PR_PUBLIC_API(HT_Error) HT_GetOpenState (HT_Resource containerNode, PRBool *openState);
PR_PUBLIC_API(HT_Error) HT_SetOpenState (HT_Resource containerNode, PRBool isOpen);
PR_PUBLIC_API(HT_Error) HT_SetAutoFlushOpenState (HT_Resource containerNode, PRBool isOpen);
/*
* HT_ItemHasForwardSibling / HT_ItemHasBackwardSibling
@ -449,6 +492,7 @@ typedef uint8 HT_DropAction;
#define UPLOAD_RDF 2
#define COPY_MOVE_LINK 3
#define UPLOAD_LFS 4
#define DROP_ABORTED 5
PR_PUBLIC_API(HT_DropAction) HT_CanDropHTROn(HT_Resource dropTarget, HT_Resource obj);
PR_PUBLIC_API(HT_DropAction) HT_CanDropURLOn(HT_Resource dropTarget, char* url);
@ -490,7 +534,9 @@ PR_PUBLIC_API(char *) HT_HTMLPaneHeight(HT_View htView);
PR_PUBLIC_API(void) HT_AddSitemapFor(HT_Pane htPane, char *pUrl, char *pSitemapUrl, char* name);
PR_PUBLIC_API(void) HT_AddRelatedLinksFor(HT_Pane htPane, char *pUrl);
PR_PUBLIC_API(void) HT_ExitPage(HT_Pane htPane, char *pUrl);
PR_PUBLIC_API(void) RDF_AddCookieResource(char* name, char* path, char* host, char* expires) ;
PR_PUBLIC_API(void)
RDF_AddCookieResource(char* name, char* path, char* host, char* expires, char* value,
PRBool isDomain, PRBool secure) ;
NSPR_END_EXTERN_C

Просмотреть файл

@ -0,0 +1,72 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef _JSEC_2_RDF_H_
#define _JSEC_2_RDF_H_
#include "rdf.h"
typedef int16 JSec_Error;
#define JSec_OK ((JSec_Error)0x0000)
#define JSec_NullObject ((JSec_Error)0x0001)
typedef RDF_Resource JSec_Principal;
typedef RDF_Resource JSec_PrincipalUse;
typedef RDF_Resource JSec_Target;
NSPR_BEGIN_EXTERN_C
JSec_Error RDFJSec_InitPrivilegeDB(); /* just use gNCDB */
JSec_Error RDFJSec_SavePrivilegeDB();
JSec_Error RDFJSec_ClosePrivilegeDB();
RDF_Cursor RDFJSec_ListAllPrincipals();
JSec_Principal RDFJSec_NextPrincipal(RDF_Cursor c);
JSec_Error RDFJSec_ReleaseCursor(RDF_Cursor c);
JSec_Principal RDFJSec_NewPrincipal(char* principalID);
JSec_Error RDFJSec_AddPrincipal(JSec_Principal pr);
JSec_Error RDFJSec_DeletePrincipal(JSec_Principal pr);
char* RDFJSec_PrincipalID(JSec_Principal pr);
void * RDFJSec_AttributeOfPrincipal(JSec_Principal pr, char* attributeType);
JSec_Error RDFJSec_SetPrincipalAttribute(JSec_Principal pr, char* attributeType, void* attValue);
RDF_Cursor RDFJSec_ListAllPrincipalUses(JSec_Principal pr);
JSec_PrincipalUse RDFJSec_NextPrincipalUse(RDF_Cursor c);
JSec_PrincipalUse RDFJSec_NewPrincipalUse(JSec_Principal pr, JSec_Target tr, char* priv);
JSec_Error RDFJSec_AddPrincipalUse(JSec_Principal pr, JSec_PrincipalUse prUse);
JSec_Error RDFJSec_DeletePrincipalUse (JSec_Principal pr, JSec_PrincipalUse prUse);
JSec_Error RDFJSec_AddPrincipalUsePrivilege (JSec_PrincipalUse prUse, char* priv);
JSec_Error RDFJSec_DeletePrincipalUsePrivilege (JSec_PrincipalUse prUse, char* priv);
char* RDFJSec_PrivilegeOfPrincipalUse (JSec_PrincipalUse p);
JSec_Error RDFJSec_AddTargetToPrincipalUse(JSec_PrincipalUse prUse, JSec_Target tr);
JSec_Error RDFJSec_DeleteTargetToPrincipalUse(JSec_PrincipalUse prUse, JSec_Target tr);
JSec_Target RDFJSec_TargetOfPrincipalUse (JSec_PrincipalUse p);
JSec_Target RDFJSec_NewTarget(char* targetName, JSec_Principal pr);
char* RDFJSec_GetTargetName(JSec_Target tr);
char* RDFJSec_AttributeOfTarget(JSec_Target tr, char* attributeType);
JSec_Error RDFJSec_SetTargetAttribute(JSec_Target tr, char* attributeType, char* attValue);
NSPR_END_EXTERN_C
#endif /* _JSEC_2_RDF_H_ */

Просмотреть файл

@ -19,7 +19,7 @@
MODULE = rdf
DEPTH = ..\..\..
EXPORTS = rdf.h htrdf.h vocab.h
EXPORTS = rdf.h htrdf.h vocab.h jsec2rdf.h
include <$(DEPTH)/config/rules.mak>

Просмотреть файл

@ -63,6 +63,7 @@ typedef struct _RDF_NCVocabStruct {
RDF_Resource RDF_History;
RDF_Resource RDF_HistoryBySite;
RDF_Resource RDF_HistoryByDate;
RDF_Resource RDF_HistoryMostVisited;
RDF_Resource RDF_bookmarkAddDate;
RDF_Resource RDF_PersonalToolbarFolderCategory;
RDF_Resource RDF_Column;
@ -70,8 +71,14 @@ typedef struct _RDF_NCVocabStruct {
RDF_Resource RDF_ColumnWidth;
RDF_Resource RDF_ColumnIconURL;
RDF_Resource RDF_ColumnDataType;
RDF_Resource RDF_smallIcon;
RDF_Resource RDF_largeIcon;
RDF_Resource RDF_smallIcon; /* Small normal icon. */
RDF_Resource RDF_smallRolloverIcon; /* The small icon to display on rollover. */
RDF_Resource RDF_smallPressedIcon; /* The small icon to display on a press. */
RDF_Resource RDF_smallDisabledIcon; /* The icon to display when disabled. */
RDF_Resource RDF_largeIcon; /* Large normal icon. */
RDF_Resource RDF_largeRolloverIcon; /* Large rollover icon. */
RDF_Resource RDF_largePressedIcon; /* Large pressed icon. */
RDF_Resource RDF_largeDisabledIcon; /* Large disabled icon. */
RDF_Resource RDF_Guide;
RDF_Resource RDF_HTMLURL;
RDF_Resource RDF_HTMLHeight;
@ -82,6 +89,7 @@ typedef struct _RDF_NCVocabStruct {
RDF_Resource RDF_Password;
RDF_Resource RDF_SBProviders;
RDF_Resource RDF_WorkspacePos;
RDF_Resource RDF_ItemPos;
RDF_Resource RDF_Locks;
RDF_Resource RDF_AddLock;
RDF_Resource RDF_DeleteLock;
@ -93,6 +101,8 @@ typedef struct _RDF_NCVocabStruct {
RDF_Resource RDF_DefaultSelectedView;
RDF_Resource RDF_AutoOpen;
RDF_Resource RDF_resultType;
RDF_Resource RDF_methodType;
RDF_Resource RDF_prompt;
RDF_Resource RDF_HTMLType;
RDF_Resource RDF_URLShortcut;
RDF_Resource RDF_Cookies;
@ -100,20 +110,25 @@ typedef struct _RDF_NCVocabStruct {
RDF_Resource RDF_Receipts;
#endif
RDF_Resource RDF_Toolbar;
RDF_Resource RDF_JSec;
RDF_Resource RDF_JSecPrincipal;
RDF_Resource RDF_JSecTarget;
RDF_Resource RDF_JSecAccess;
/* Commands */
RDF_Resource RDF_Command;
RDF_Resource RDF_Command_Launch;
RDF_Resource RDF_Command_Refresh;
RDF_Resource RDF_Command_Reveal;
RDF_Resource RDF_Command_Atalk_FlatHierarchy;
RDF_Resource RDF_Command_Atalk_Hierarchy;
/* NavCenter appearance styles */
RDF_Resource treeFGColor;
RDF_Resource treeBGColor;
RDF_Resource treeBGURL;
RDF_Resource viewFGColor;
RDF_Resource viewBGColor;
RDF_Resource viewBGURL;
RDF_Resource showTreeConnections;
RDF_Resource treeConnectionFGColor;
RDF_Resource treeOpenTriggerIconURL;
@ -136,6 +151,28 @@ typedef struct _RDF_NCVocabStruct {
RDF_Resource selectedColumnHeaderBGColor;
RDF_Resource showColumnHilite;
RDF_Resource triggerPlacement;
/* Toolbar Appearance Styles */
RDF_Resource toolbarBitmapPosition; /* Bitmap's position ("side"/"top") */
/* Cookie Stuff */
RDF_Resource cookieDomain;
RDF_Resource cookieValue;
RDF_Resource cookieHost;
RDF_Resource cookiePath;
RDF_Resource cookieSecure;
RDF_Resource cookieExpires;
RDF_Resource toolbarButtonsFixedSize; /* Whether or not the buttons must be the same size ("yes"/"no") */
RDF_Resource buttonTooltipText; /* The tooltip text for a button. */
RDF_Resource buttonStatusbarText; /* The status bar text for a button. */
RDF_Resource viewRolloverColor; /* What to display when an item is rolled over in a view.*/
RDF_Resource viewPressedColor; /* What to display when an item is pressed in a view. */
RDF_Resource viewDisabledColor; /* Color to use when item is disabled in a view. */
RDF_Resource urlBar; /* Whether or not the button is a URL bar. */
RDF_Resource urlBarWidth; /* The width of the URL bar. */
RDF_Resource pos;
} RDF_NCVocabStruct;
typedef RDF_NCVocabStruct* RDF_NCVocab;
@ -143,6 +180,7 @@ typedef RDF_NCVocabStruct* RDF_NCVocab;
typedef struct _RDF_WDVocabStruct {
RDF_Resource RDF_URL;
RDF_Resource RDF_description;
RDF_Resource RDF_keyword;
RDF_Resource RDF_Container;
RDF_Resource RDF_firstVisitDate;
RDF_Resource RDF_lastVisitDate;

Просмотреть файл

@ -39,6 +39,7 @@ CSRCS = \
ldap2rdf.c \
glue.c \
rdfht.c \
jsec2rdf.c \
$(NULL)
ifndef RDF_STANDALONE

Просмотреть файл

@ -225,10 +225,10 @@ checkServerLookup (MPPParamBlock *nbp)
strcat(afpUrl, escapedURL);
/* strcat(afpUrl, ":AFPServer@"); */
strcat(afpUrl, ":");
strcat(afpUrl, ((char *)nbp->NBP.userData) + strlen("at://"));
if ((ourNBPData = (ourNBPUserDataPtr)nbp->NBP.userData) != NULL)
{
strcat(afpUrl, ourNBPData->parentID + strlen("at://"));
if ((parent = RDF_GetResource(NULL, (char *)(ourNBPData->parentID), PR_TRUE)) != NULL)
{
if ((r = RDF_GetResource(NULL, afpUrl, PR_TRUE)) != NULL)

Просмотреть файл

@ -83,7 +83,9 @@ ColumnsGetSlotValue(RDFT rdf, RDF_Resource u, RDF_Resource s, RDF_ValueType type
val = (void *)HT_COLUMN_STRING;
}
else if (u == gWebData->RDF_size ||
u == gWebData->RDF_numAccesses)
u == gWebData->RDF_numAccesses ||
u == gNavCenter->cookieDomain ||
u == gNavCenter->cookieSecure)
{
val = (void *)HT_COLUMN_INT;
}
@ -145,13 +147,17 @@ ColumnsNextValue (RDFT rdf, RDF_Cursor c)
case 2: arc = gWebData->RDF_URL; break;
case 3: arc = gWebData->RDF_description; break;
case 4: arc = gNavCenter->RDF_bookmarkAddDate; break;
case 5: arc = gWebData->RDF_lastVisitDate; break;
case 6: arc = gWebData->RDF_lastModifiedDate; break;
case 4: arc = gWebData->RDF_keyword; break;
case 5: arc = gNavCenter->RDF_bookmarkAddDate; break;
case 6: arc = gWebData->RDF_lastVisitDate; break;
case 7: arc = gWebData->RDF_lastModifiedDate; break;
case 8: arc = gNavCenter->pos; break;
}
} while ((c->count <= 6) && (arc == NULL));
break;
case HISTORY_RT:
switch(c->count)
{
@ -164,6 +170,20 @@ ColumnsNextValue (RDFT rdf, RDF_Cursor c)
}
break;
case COOKIE_RT:
switch(c->count)
{
case 0: arc = gCoreVocab->RDF_name; break;
case 1: arc = gNavCenter->cookieHost; break;
case 2: arc = gNavCenter->cookiePath; break;
case 3: arc = gNavCenter->cookieValue; break;
case 4: arc = gNavCenter->cookieExpires; break;
case 5: arc = gNavCenter->cookieDomain; break;
case 6: arc = gNavCenter->cookieSecure; break;
}
break;
case FTP_RT:
case ES_RT:
switch(c->count)
@ -211,6 +231,7 @@ ColumnsNextValue (RDFT rdf, RDF_Cursor c)
case 1: arc = gNavCenter->RDF_URLShortcut; break;
case 2: arc = gWebData->RDF_URL; break;
case 3: arc = gWebData->RDF_description; break;
case 4: arc = gWebData->RDF_keyword; break;
}
break;

Просмотреть файл

@ -30,6 +30,35 @@
/* external string references in allxpstr */
extern int RDF_UNABLETODELETEFILE, RDF_UNABLETODELETEFOLDER;
#define IMPORT_LIST_SIZE 8
/* XXX localization */
char *importList[IMPORT_LIST_SIZE] = {"Favorites", "NC:Bookmarks", "Recent", "NC:Bookmarks",
"Start Menu", "NC:Bookmarks", "Desktop", "NC:LocalFiles"};
void
importForProfile (char *dir, const char *uname)
{
int32 n = 0;
char* pn = getMem(100 + strlen(dir));
char* name = getMem(100 + strlen(uname));
RDF_Resource item;
RDF_Resource parent;
while (n < IMPORT_LIST_SIZE) {
sprintf(pn, "%s%s/", dir, importList[n++]);
item = RDF_GetResource(NULL, pn, 1);
parent = RDF_GetResource(NULL, importList[n++], 1);
sprintf(name, "%s IE %s", uname, importList[n-2]);
remoteStoreAdd(gRemoteStore, item, gCoreVocab->RDF_name, copyString(name),
RDF_STRING_TYPE, 1);
remoteStoreAdd(gRemoteStore, item, gCoreVocab->RDF_parent, parent, RDF_RESOURCE_TYPE, 1);
}
freeMem(pn);
freeMem(name);
}
void
@ -38,27 +67,20 @@ GuessIEBookmarks (void)
#ifdef XP_WIN
RDF_Resource bmk = RDF_GetResource(NULL, "NC:Bookmarks", true);
PRDir* ProfilesDir = OpenDir("file:///c|/winnt/profiles/");
if (!ProfilesDir) {
RDF_Resource bmkdir = RDF_GetResource(NULL,"file:///c|/windows/favorites/", 1);
remoteStoreAdd(gRemoteStore, bmkdir, gCoreVocab->RDF_parent, bmk, RDF_RESOURCE_TYPE, 1);
if (!ProfilesDir) {
/* XXX localization */
importForProfile("file:///c|/windows/", "Your");
} else {
int32 n = PR_SKIP_BOTH;
PRDirEntry *de;
while (de = PR_ReadDir(ProfilesDir, n++)) {
char* pn = getMem(400);
sprintf(pn, "file:///c|/winnt/profiles/%s/favorites/", de->name);
if (strcmp(de->name, "Administrator") && strcmp(de->name, "Default User") &&
strcmp(de->name, "All Users")) {
RDF_Resource bmkdir = RDF_GetResource(NULL,pn, 1);
char* name = getMem(300);
/* XXX localization ! */
sprintf(name, "%s's imported Favorites", de->name);
remoteStoreAdd(gRemoteStore, bmkdir, gCoreVocab->RDF_name, copyString(name),
RDF_STRING_TYPE, 1);
remoteStoreAdd(gRemoteStore, bmkdir, gCoreVocab->RDF_parent, bmk, RDF_RESOURCE_TYPE, 1);
freeMem(name);
char* dir = getMem(100 + strlen(de->name));
sprintf(dir, "file:///c|/winnt/profiles/%s/", de->name);
importForProfile(dir, de->name);
freeMem(dir);
}
freeMem(pn);
}
PR_CloseDir(ProfilesDir);
}
@ -146,7 +168,7 @@ getVolume(int16 volNum, PRBool afpVols)
driveType = GetDriveType(str);
if (driveType != DRIVE_UNKNOWN && driveType != DRIVE_NO_ROOT_DIR)
{
url = PR_smprintf("file:///%c:/", volNum + 'A');
url = PR_smprintf("file:///%c|/", volNum + 'A');
}
#endif
@ -183,7 +205,7 @@ MakeLFSStore (char* url)
if ((ntr = (RDFT)getMem(sizeof(struct RDF_TranslatorStruct))) != NULL)
{
ntr->assert = NULL;
ntr->assert = fsAssert;
ntr->unassert = fsUnassert;
ntr->getSlotValue = fsGetSlotValue;
ntr->getSlotValues = fsGetSlotValues;
@ -197,6 +219,166 @@ MakeLFSStore (char* url)
PRBool
fsAssert (RDFT rdf, RDF_Resource u, RDF_Resource s, void* v,
RDF_ValueType type, PRBool tv)
{
PRBool retVal = PR_FALSE;
#ifdef XP_MAC
AEAddressDesc finderAddr = { typeNull, NULL };
AEDescList selection = { typeNull, NULL };
AppleEvent theEvent = { typeNull, NULL }, theReply = { typeNull, NULL };
FSSpec fss;
OSErr err;
ProcessSerialNumber finderPSN = { 0, kNoProcess };
char *errorMsg;
#endif
if ((startsWith("file://", resourceID(u))) && (s == gNavCenter->RDF_Command))
{
#ifdef XP_MAC
if (((RDF_Resource)v) == gNavCenter->RDF_Command_Reveal)
{
/* reveal item in Finder */
retVal = PR_TRUE;
if ((err = nativeMacPathname(resourceID(u), &fss)) != noErr) {}
else if ((err = getPSNbyTypeSig(&finderPSN, 'FNDR', 'MACS')) != noErr) {}
else if ((err = AECreateDesc(typeProcessSerialNumber, &finderPSN,
sizeof(ProcessSerialNumber), &finderAddr)) != noErr) {}
else if ((err = AECreateAppleEvent(kAEFinderEvents /* kAEFinderSuite */,
kAERevealSelection, &finderAddr, kAutoGenerateReturnID,
kAnyTransactionID, &theEvent)) != noErr) {}
else if ((err = AECreateList (NULL, 0, false, &selection)) != noErr) {}
else if ((err = AEPutPtr (&selection, 0, typeFSS, &fss, sizeof(FSSpec))) != noErr) {}
else if ((err = AEPutParamDesc (&theEvent, keySelection, &selection)) != noErr) {}
else err = AESend (&theEvent, &theReply, kAENoReply, kAENormalPriority,
kAEDefaultTimeout, NULL, NULL);
if (err == noErr)
{
SetFrontProcess(&finderPSN);
}
else
{
if ((errorMsg = PR_smprintf("Error %d", (int)err)) != NULL)
{
FE_Alert(NULL, errorMsg);
XP_FREE(errorMsg);
}
}
if (finderAddr.dataHandle != NULL) AEDisposeDesc(&finderAddr);
if (selection.dataHandle != NULL) AEDisposeDesc (&selection);
if (theEvent.dataHandle != NULL) AEDisposeDesc(&theEvent);
if (theReply.dataHandle != NULL) AEDisposeDesc(&theReply);
}
#endif
}
return(retVal);
}
#ifdef XP_MAC
OSErr
nativeMacPathname(char *fileURL, FSSpec *fss)
{
OSErr err = paramErr;
char *macURL = NULL, *token, *url, *escapedURL, *temp, *pascalStr;
XP_ASSERT(fileURL != NULL);
if (fileURL == NULL) return(NULL);
if (!startsWith("file:///", fileURL)) return(NULL);
if (!(url = copyString(fileURL + strlen("file:///")))) return(NULL);
token = strtok(url, "/");
while (token != NULL)
{
*token;
if ((escapedURL = unescapeURL(token)) == NULL)
{
if (macURL != NULL)
{
freeMem(macURL);
macURL = NULL;
}
break;
}
if (macURL == NULL)
{
macURL = escapedURL;
}
else
{
temp = append2Strings(macURL, ":");
freeMem(macURL);
if (temp == NULL)
{
macURL = NULL;
break;
}
macURL = append2Strings(temp, escapedURL);
freeMem(temp);
if (macURL == NULL)
{
break;
}
freeMem(escapedURL);
}
token = strtok(NULL, "/");
}
if (endsWith("/", fileURL))
{
temp = append2Strings(macURL, ":");
freeMem(macURL);
macURL = temp;
}
freeMem(url);
if (macURL != NULL)
{
if ((pascalStr = getMem(strlen(macURL) + 3)) != NULL)
{
pascalStr[0] = strlen(macURL);
strcpy(&pascalStr[1], macURL);
err = FSMakeFSSpec(0, 0L, (void *)pascalStr, fss);
freeMem(pascalStr);
}
freeMem(macURL);
}
return(err);
}
OSErr
getPSNbyTypeSig(ProcessSerialNumber *thePSN, OSType pType, OSType pSignature)
{
OSErr err;
ProcessInfoRec pInfo;
thePSN->highLongOfPSN=0L;
thePSN->lowLongOfPSN=kNoProcess;
while (!(err=GetNextProcess(thePSN)))
{
if ((thePSN->highLongOfPSN==0L) && (thePSN->lowLongOfPSN==kNoProcess))
{
err=procNotFound;
break;
}
pInfo.processInfoLength=sizeof(ProcessInfoRec);
pInfo.processName=NULL;
pInfo.processLocation=NULL;
pInfo.processAppSpec=NULL;
if ((err=GetProcessInformation(thePSN,&pInfo)) != noErr) break;
if ((pInfo.processType==pType) && (pInfo.processSignature==pSignature)) break;
}
return(err);
}
#endif
PRBool
fsRemoveFile(char *filePathname, PRBool justCheckWriteAccess)
{
@ -425,6 +607,11 @@ fsGetSlotValue (RDFT rdf, RDF_Resource u, RDF_Resource s, RDF_ValueType type, PR
int32 creationTime, modifyTime;
struct tm *time;
#ifdef XP_MAC
FInfo fndrInfo;
FSSpec fss;
#endif
if (!startsWith("file://", resourceID(u))) return(NULL);
if ((s == gCoreVocab->RDF_name) && (type == RDF_STRING_TYPE) && (tv))
@ -464,11 +651,39 @@ fsGetSlotValue (RDFT rdf, RDF_Resource u, RDF_Resource s, RDF_ValueType type, PR
switch(fn.type)
{
case PR_FILE_FILE:
retVal = (void *)copyString(XP_GetString(RDF_FILE_DESC_STR));
#ifdef XP_MAC
if (!nativeMacPathname(pathname, &fss))
{
if (!FSpGetFInfo(&fss, &fndrInfo))
{
if (fndrInfo.fdFlags & kIsAlias)
{
/* XXX localization */
retVal = copyString("Alias");
}
}
}
#endif
if (retVal == NULL)
{
retVal = (void *)copyString(XP_GetString(RDF_FILE_DESC_STR));
}
break;
case PR_FILE_DIRECTORY:
retVal = (void *)copyString(XP_GetString(RDF_DIRECTORY_DESC_STR));
#ifdef XP_MAC
if (!nativeMacPathname(pathname, &fss))
{
if ((fss.parID == 0) || (fss.parID == 1))
{
retVal = copyString(XP_GetString(RDF_VOLUME_DESC_STR));
}
}
#endif
if (retVal == NULL)
{
retVal = (void *)copyString(XP_GetString(RDF_DIRECTORY_DESC_STR));
}
break;
}
}
@ -556,15 +771,26 @@ fsGetSlotValue (RDFT rdf, RDF_Resource u, RDF_Resource s, RDF_ValueType type, PR
PRBool
fileDirectoryp(RDF_Resource u)
{
PRFileInfo info;
PRBool retVal = PR_FALSE;
PRDir *d;
PRStatus err;
char *pathname, *url;
if (startsWith("file:", resourceID(u)))
{
if ((d = OpenDir(resourceID(u))) != NULL)
if ((pathname = resourceID(u)) != NULL)
{
PR_CloseDir(d);
retVal = PR_TRUE;
if ((url = unescapeURL(&pathname[FS_URL_OFFSET])) != NULL)
{
if ((err=PR_GetFileInfo(url, &info)) == PR_SUCCESS)
{
if (info.type == PR_FILE_DIRECTORY)
{
retVal = PR_TRUE;
}
}
XP_FREE(url);
}
}
}
return(retVal);
@ -620,6 +846,48 @@ fsGetSlotValues (RDFT rdf, RDF_Resource u, RDF_Resource s,
PRBool
isFileVisible(char *fileURL)
{
PRBool retVal = PR_TRUE;
#ifdef XP_MAC
FInfo fndrInfo;
FSSpec fss;
OSErr err;
#endif
#ifdef XP_WIN
char *p;
#endif
#ifdef XP_MAC
if (!(err=nativeMacPathname(fileURL, &fss)))
{
if (!(err = FSpGetFInfo(&fss, &fndrInfo)))
{
if (fndrInfo.fdFlags & kIsInvisible)
{
retVal = PR_FALSE;
}
}
}
#endif
#ifdef XP_WIN
if ((p = strrchr(fileURL, '/')) != NULL)
{
++p;
if ((!strcmp(p, ".")) || (!strcmp(p, "..")))
{
retVal = PR_FALSE;
}
}
#endif
return(retVal);
}
void *
fsNextValue (RDFT rdf, RDF_Cursor c)
{
@ -685,13 +953,11 @@ fsNextValue (RDFT rdf, RDF_Cursor c)
}
freeMem(encoded);
}
#ifdef XP_WIN
if ((!strcmp(url, ".")) || (!strcmp(url, "..")))
if (isFileVisible(url) == PR_FALSE)
{
XP_FREE(url);
url = NULL;
}
#endif
if (url != NULL)
{
retVal = (void *)CreateFSUnit(url, isDirectoryFlag);

Просмотреть файл

@ -30,6 +30,8 @@
#include <Appletalk.h>
#include <Devices.h>
#include <Files.h>
#include <FinderRegistry.h>
#include <Processes.h>
#endif
@ -55,10 +57,17 @@ extern int RDF_VOLUME_DESC_STR, RDF_DIRECTORY_DESC_STR, RDF_FILE_DESC_STR;
XP_BEGIN_PROTOS
#ifdef XP_MAC
OSErr nativeMacPathname(char *fileURL, FSSpec *fss);
OSErr getPSNbyTypeSig(ProcessSerialNumber *thePSN, OSType pType, OSType pSignature);
#endif
void importForProfile (char *dir, const char *uname);
void GuessIEBookmarks(void);
char * getVolume(int16 volNum, PRBool afpVols);
PRDir * OpenDir(char *name);
RDFT MakeLFSStore (char* url);
PRBool fsAssert (RDFT rdf, RDF_Resource u, RDF_Resource s, void* v, RDF_ValueType type, PRBool tv);
PRBool fsRemoveFile(char *filePathname, PRBool justCheckWriteAccess);
PRBool fsRemoveDir(char *filePathname, PRBool justCheckWriteAccess);
PRBool fsUnassert (RDFT mcf, RDF_Resource u, RDF_Resource s, void* v, RDF_ValueType type);
@ -67,6 +76,7 @@ void * fsGetSlotValue (RDFT rdf, RDF_Resource u, RDF_Resource s, RDF_ValueType
PRBool fileDirectoryp(RDF_Resource u);
RDF_Cursor fsGetSlotValues (RDFT rdf, RDF_Resource u, RDF_Resource s, RDF_ValueType type, PRBool inversep, PRBool tv);
void * fsNextValue (RDFT rdf, RDF_Cursor c);
PRBool isFileVisible(char *fileURL);
RDF_Error fsDisposeCursor (RDFT rdf, RDF_Cursor c);
RDF_Resource CreateFSUnit (char* nname, PRBool isDirectoryFlag);

Просмотреть файл

@ -38,6 +38,7 @@
/* external routines */
extern MWContext *FE_GetRDFContext(void);
extern char *gDefaultNavcntr;
/* globals */
@ -76,6 +77,10 @@ void
rdf_abort(NET_StreamClass *stream, int status)
{
RDFFile f = (RDFFile)stream->data_object;
if (strcmp(f->url, gNavCntrUrl) == 0) {
parseNextRDFXMLBlob(stream, gDefaultNavcntr, strlen(gDefaultNavcntr));
}
if (f) {
f->locked = false;
gcRDFFile (f);
@ -86,6 +91,8 @@ rdf_abort(NET_StreamClass *stream, int status)
}
}
#ifdef MOZILLA_CLIENT
#ifdef XP_MAC
@ -171,7 +178,7 @@ rdf_GetUrlExitFunc (URL_Struct *urls, int status, MWContext *cx)
}
/*
int
rdfRetrievalType (RDFFile f)
{
@ -200,26 +207,27 @@ rdfRetrievalType (RDFFile f)
return(type);
}
*/
int
rdf_GetURL (MWContext *cx, int method, Net_GetUrlExitFunc *exit_routine, RDFFile rdfFile)
{
URL_Struct *urls;
URL_Struct *urls = NULL;
char* url = rdfFile->url;
if (cx == NULL) return 0;
urls = NET_CreateURLStruct(rdfFile->url, (NET_ReloadMethod)rdfRetrievalType(rdfFile));
if (strcmp(url, gNavCntrUrl) == 0) {
urls = NET_CreateURLStruct(url, NET_CACHE_ONLY_RELOAD);
if (NET_IsURLInDiskCache(urls) || NET_IsURLInMemCache(urls)) {
} else {
NET_FreeURLStruct(urls);
urls = NULL;
}
}
if (!urls)
urls = NET_CreateURLStruct(url, NET_NORMAL_RELOAD);
if (urls == NULL) return 0;
/* urls->use_local_copy = rdfFile->localp;*/
urls->fe_data = rdfFile;
if (method) urls->method = method;
/*
if (rdfFile->localp) {
NET_GetURLQuick(urls, FO_CACHE_AND_RDF, cx, rdf_GetUrlExitFunc);
} else {
NET_GetURLQuick(urls, FO_CACHE_AND_RDF, cx, rdf_GetUrlExitFunc);
}
*/
NET_GetURL(urls, FO_CACHE_AND_RDF, cx, rdf_GetUrlExitFunc);
return 1;
}

Просмотреть файл

@ -25,6 +25,7 @@
#include "hist2rdf.h"
#include "remstore.h"
static PRBool histInFlatFilep = 0;
/* extern declarations */
void GH_DeleteHistoryItem (char * url);
@ -46,7 +47,7 @@ PLHashTable *hostHash = 0;
RDFT grdf = NULL;
RDFT gHistoryStore = 0;
PRBool ByDateOpened = 0;
PRBool historyInitialized = 0;
char *prefixList[] = {
@ -77,9 +78,6 @@ collateHistory (RDFT r, RDF_Resource u, PRBool byDateFlag)
DB_HASH, &hash);
grdf = r;
if (db != NULL) {
if (!byDateFlag) {
hostHash = PL_NewHashTable(500, idenHash, PL_CompareValues, PL_CompareValues, null, null);
} else ByDateOpened = 1;
while (0 == (*db->seq)(db, &key, &data, (firstOne ? R_NEXT : R_FIRST))) {
char* title = ((char*)data.data + 16); /* title */
char* url = (char*)key.data; /* url */
@ -113,6 +111,7 @@ collateOneHist (RDFT r, RDF_Resource u, char* url, char* title, time_t lastAcces
struct tm *time;
RDF_Resource hostUnit, urlUnit;
char* existingName = NULL;
uint32 oldNumAccess = 0;
if (startsWith("404", title)) return;
urlUnit = HistCreate(url, 1);
existingName = nlocalStoreGetSlotValue(gLocalStore, urlUnit, gCoreVocab->RDF_name, RDF_STRING_TYPE, 0, 1);
@ -156,9 +155,14 @@ collateOneHist (RDFT r, RDF_Resource u, char* url, char* title, time_t lastAcces
remoteStoreAdd(gRemoteStore, urlUnit, gWebData->RDF_firstVisitDate,
(void *)copyString(buffer), RDF_STRING_TYPE, 1);
}
/* oldNumAccess = remoteStoreGetSlotValue(gHistoryStore, urlUnit, gWebData->RDF_numAccesses,
RDF_INT_TYPE, 0, 1);
if (oldNumAccess) remoteStoreRemove(gHistoryStore, urlUnit, gWebData->RDF_numAccesses, oldNumAccess,
RDF_INT_TYPE);
if (numAccesses==0) ++numAccesses;
remoteStoreAdd(gHistoryStore, urlUnit, gWebData->RDF_numAccesses,
(void *)numAccesses, RDF_INT_TYPE, 1);
(void *)numAccesses, RDF_INT_TYPE, 1); */
if (numAccesses > 5) histAddParent(urlUnit, gNavCenter->RDF_HistoryMostVisited);
}
@ -365,6 +369,23 @@ hostUnitOfDate (RDFT r, RDF_Resource u, time_t lastAccessDate)
return (node);
}
void saveHistory () {
char* escapedPath = unescapeURL(gGlobalHistoryURL);
char* path = WH_FilePlatformName(convertFileURLToNSPRCopaceticPath(escapedPath));
PRFileDesc* file = PR_Open(path, PR_WRONLY | PR_CREATE_FILE, 00200);
char* hist;
if (file != NULL) {
hist = RDF_SerializeRDFStore(gHistoryStore) ;
if (hist != NULL) {
PR_Write(file, hist, strlen(hist));
}
}
freeMem(path);
freeMem(escapedPath);
PR_Close(file);
}
static int saveCount = 0;
PR_PUBLIC_API(void)
updateNewHistItem (DBT *key, DBT *data)
@ -372,7 +393,7 @@ updateNewHistItem (DBT *key, DBT *data)
time_t last,first,numaccess;
int32 flg = (int32)*((char*)data->data + 3*sizeof(int32));
if (!displayHistoryItem((char*)key->data)) return;
if (grdf != NULL) {
if (historyInitialized && (gHistoryStore != NULL)) {
HIST_COPY_INT32(&last, (time_t *)((char *)data->data));
HIST_COPY_INT32(&first, (time_t *)((char *)data->data + sizeof(int32)));
HIST_COPY_INT32(&numaccess, (time_t *)((char *)data->data + 2*sizeof(int32)));
@ -385,6 +406,11 @@ updateNewHistItem (DBT *key, DBT *data)
(char*)key->data, /* url */
((char*)data->data + 4*sizeof(int32)), /* title */
last, first, numaccess, 1);
saveCount++;
if (saveCount > 5) {
if (histInFlatFilep) saveHistory();
saveCount = 0;
}
}
}
@ -558,17 +584,24 @@ historyUnassert (RDFT hst, RDF_Resource u, RDF_Resource s, void* v,
void
HistPossiblyAccessFile (RDFT rdf, RDF_Resource u, RDF_Resource s, PRBool inversep)
{
if ((s == gCoreVocab->RDF_parent) && inversep && (rdf == gHistoryStore) &&
((u == gNavCenter->RDF_HistoryByDate) || (u == gNavCenter->RDF_HistoryBySite))) {
collateHistory(rdf, u, (u == gNavCenter->RDF_HistoryByDate));
}
if (histInFlatFilep) {
readRDFFile(gGlobalHistoryURL, NULL, 0, gHistoryStore);
} else {
collateHistory(rdf, u, (u == gNavCenter->RDF_HistoryByDate));
}
} else if ((s == gCoreVocab->RDF_parent) && inversep && (rdf == gHistoryStore) &&
(u == gNavCenter->RDF_HistoryMostVisited)) {
collateHistory(rdf, gNavCenter->RDF_HistoryBySite, 0);
}
historyInitialized = 1;
}
RDFT
MakeHistoryStore (char* url)
{
@ -585,11 +618,10 @@ MakeHistoryStore (char* url)
ntr->disposeCursor = remoteStoreDisposeCursor;
ntr->possiblyAccessFile = HistPossiblyAccessFile;
gHistoryStore = ntr;
histInFlatFilep = endsWith(".rdf", gGlobalHistoryURL);
ntr->url = copyString(url);
/* collateHistory(ntr, gNavCenter->RDF_History, 1);
remoteStoreAdd(ntr, sep, gCoreVocab->RDF_parent, gNavCenter->RDF_History, RDF_RESOURCE_TYPE, 1);
bySite = 1;
collateHistory(ntr, gNavCenter->RDF_History, 0); */
hostHash = PL_NewHashTable(500, idenHash, PL_CompareValues, PL_CompareValues, null, null);
ByDateOpened = 1;
return ntr;
} else return gHistoryStore;
} else return NULL;

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -32,6 +32,7 @@
#include "xpassert.h"
#include "nspr.h"
#include "prefapi.h"
#include "fe_proto.h"
#ifdef XP_MAC
#include "stdlib.h"
@ -54,8 +55,8 @@
#define RDF_RELATED_LINKS 2
#define FROM_PAGE 1
#define GUESS_FROM_PREVIOUS_PAGE 2
#define HTDEL remoteStoreRemove
#define HTDEL remoteStoreRemove
/* external string references in allxpstr */
@ -115,6 +116,7 @@ typedef struct _HT_PaneStruct {
SBProvider smartBrowsingProviders;
PRBool dirty;
PRBool personaltoolbar;
PRBool toolbar;
PRBool bookmarkmenu;
PRBool special;
char *windowURL;
@ -128,6 +130,8 @@ typedef struct HT_ColumnStruct {
uint32 width;
uint32 tokenType;
void *token;
void *feData;
PRBool isHiddenFlag;
} HT_ColumnStruct, *HT_Column;
typedef struct _HT_ViewStruct {
@ -140,31 +144,34 @@ typedef struct _HT_ViewStruct {
struct _HT_ResourceStruct ***itemList;
uint32 itemListSize;
uint32 itemListCount;
uint32 topNodeIndex;
uint32 selectedNodeHint;
uint32 sortTokenType;
void *sortToken;
PRBool descendingFlag;
PRBool refreshingItemListp;
PRBool inited;
RDF_Resource treeRel;
RDF_Resource treeRel;
} HT_ViewStruct;
typedef struct _HT_ValueStruct {
struct _HT_ValueStruct *next;
uint32 tokenType;
void *token;
RDF_Resource token;
void *data;
} HT_ValueStruct, *HT_Value;
#define HT_CONTAINER_FLAG 0x0001
#define HT_OPEN_FLAG 0x0002
#define HT_HIDDEN_FLAG 0x0004
#define HT_SELECTED_FLAG 0x0008
#define HT_VOLATILE_URL_FLAG 0x0010
#define HT_FREEICON_URL_FLAG 0x0020
#define HT_PASSWORDOK_FLAG 0x0040
#define HT_INITED_FLAG 0x0080
#define HT_DIRTY_FLAG 0x0100
#define HT_AUTOFLUSH_OPEN_FLAG 0x0004
#define HT_HIDDEN_FLAG 0x0008
#define HT_SELECTED_FLAG 0x0010
#define HT_VOLATILE_URL_FLAG 0x0020
#define HT_FREEICON_URL_FLAG 0x0040
#define HT_PASSWORDOK_FLAG 0x0080
#define HT_INITED_FLAG 0x0100
#define HT_DIRTY_FLAG 0x0200
#define HT_ENABLED_FLAG 0x0400
typedef struct _HT_ResourceStruct {
struct _HT_ResourceStruct *nextItem;
@ -173,7 +180,7 @@ typedef struct _HT_ResourceStruct {
RDF_Resource node;
void *feData;
char *dataSource;
char *url[2];
char *url[8];
HT_Value values;
HT_Resource child;
HT_Resource *children; /* used by sorting */
@ -231,6 +238,7 @@ typedef struct _HT_URLSiteMapAssoc {
RDF_Resource sitemap;
char* name;
char* sitemapUrl;
RDFT db;
struct _HT_URLSiteMapAssoc *next;
} HT_URLSiteMapAssoc;
@ -257,7 +265,10 @@ void sortNodes(HT_View view, HT_Resource parent, HT_Resource *children, uint3
uint32 refreshItemList1(HT_View view, HT_Resource node);
void refreshItemList (HT_Resource node, HT_Event whatHappened);
void refreshPanes();
HT_Pane paneFromResource(RDF_Resource resource, HT_Notification notify, PRBool autoFlushFlag, PRBool autoOpenFlag);
PRBool initToolbars (HT_Pane pane);
HT_Pane paneFromResource(RDF db, RDF_Resource resource, HT_Notification notify, PRBool autoFlushFlag, PRBool autoOpenFlag, PRBool useColumns);
void htMetaTagURLExitFunc (URL_Struct *urls, int status, MWContext *cx);
void htLookInCacheForMetaTags(char *url);
void htSetBookmarkAddDateToNow(RDF_Resource r);
RDF newHTPaneDB();
RDF HTRDF_GetDB();
@ -280,6 +291,7 @@ void removeHTFromHash (HT_Pane pane, HT_Resource item);
void deleteHTSubtree (HT_Resource subtree);
void deleteContainerItem (HT_Resource container, RDF_Resource item);
uint32 fillContainer (HT_Resource node);
void sendColumnNotification (HT_View view, void *token, uint32 tokenType, HT_Event whatHappened);
PRBool htIsMenuCmdEnabled(HT_Pane pane, HT_MenuCmd menuCmd, PRBool isWorkspaceFlag, PRBool isBackgroundFlag);
void freeMenuCommandList();
void exportCallbackWrite(PRFileDesc *fp, char *str);
@ -289,7 +301,8 @@ void htCopyReference(RDF_Resource original, RDF_Resource newParent, PRBool em
PRBool htVerifyUniqueToken(HT_Resource node, void *token, uint32 tokenType, char *data);
PRBool ht_isURLReal(HT_Resource node);
char * buildInternalIconURL(HT_Resource node, PRBool *volatileURLFlag, PRBool largeIconFlag, PRBool workspaceFlag);
char * getIconURL( HT_Resource node, PRBool largeIconFlag, PRBool workspaceFlag);
char * getIconURL( HT_Resource node, PRBool largeIconFlag, PRBool workspaceFlag, int state);
PRBool htIsPropertyInMoreOptions(RDF_Resource r);
void addHtmlElement(HT_Resource node, RDF_Resource token, uint32 tokenType);
void freeHtmlElementList();
_htmlElementPtr findHtmlElement(void *token);
@ -298,16 +311,20 @@ char * constructHTMLTagData(char *dynStr, int strID, char *data);
char * constructHTML(char *dynStr, HT_Resource node, void *token, uint32 tokenType);
char * constructHTMLPermission(char *dynStr, HT_Resource node, RDF_Resource token, char *permText);
PRBool htIsOpLocked(HT_Resource node, RDF_Resource token);
static PRBool rdfFindDialogHandler(XPDialogState *dlgstate, char **argv, int argc, unsigned int button);
PRBool rdfFindDialogHandler(XPDialogState *dlgstate, char **argv, int argc, unsigned int button);
char * constructBasicHTML(char *dynStr, int strID, char *data1, char *data2);
void setHiddenState (HT_Resource node);
void htSetFindResourceName(RDF db, RDF_Resource r);
void htOpenTo(HT_View view, RDF_Resource u, PRBool selectView);
PRBool mutableContainerp (RDF_Resource node);
void possiblyCleanUpTitle (char* title);
PRBool htRemoveChild(HT_Resource parent, HT_Resource child, PRBool moveToTrash);
void ht_SetPassword(HT_Resource node, char *password);
PRBool ht_hasPassword(HT_Resource node);
PRBool ht_checkPassword(HT_Resource node, PRBool alwaysCheck);
HT_DropAction htLaunchSmartNode(HT_Resource dropTarget, char *fullURL);
HT_DropAction dropOnSmartNode(HT_Resource dropTarget, HT_Resource dropObject, PRBool justAction);
HT_DropAction dropOnSmartURL(HT_Resource dropTarget, char *objTitle, PRBool justAction);
HT_DropAction dropOn (HT_Resource dropTarget, HT_Resource dropObject, PRBool justAction);
void Win32FileCopyMove(HT_Resource dropTarget, HT_Resource dropObject);
HT_DropAction copyMoveRDFLink (HT_Resource dropTarget, HT_Resource dropObject);
@ -323,7 +340,7 @@ HT_DropAction copyRDFLinkURLAt (HT_Resource dropx, char* objURL, char *objTitl
HT_DropAction uploadLFSURL (HT_Resource dropTarget, char* objURL);
HT_DropAction uploadRDFFileURL (HT_Resource dropTarget, char* objURL);
HT_DropAction esfsCopyMoveContentURL (HT_Resource dropTarget, char* objURL);
void HTADD(HT_Pane pane, RDF_Resource u, RDF_Resource s, void* v);
RDFT HTADD(HT_Pane pane, RDF_Resource u, RDF_Resource s, void* v);
HT_URLSiteMapAssoc * makeNewSMP (HT_Pane htPane, char* pUrl, char* sitemapurl);
void RetainOldSitemaps (HT_Pane htPane, char *pUrl);
void populateSBProviders (HT_Pane htPane);

391
modules/rdf/src/jsec2rdf.c Normal file
Просмотреть файл

@ -0,0 +1,391 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "jsec2rdf.h"
#include "fs2rdf.h"
#include "utils.h"
#include "nlcstore.h"
#include "vocabint.h"
NSPR_BEGIN_EXTERN_C
extern RDF gNCDB;
RDF gJSecDB = NULL;
JSec_Error
RDFJSec_InitPrivilegeDB()
{
if (gJSecDB == 0) {
gJSecDB = gNCDB;
}
return JSec_OK;
}
JSec_Error
RDFJSec_SavePrivilegeDB()
{
return JSec_OK;
}
JSec_Error
RDFJSec_ClosePrivilegeDB()
{
return JSec_OK;
}
#define JSEC_PRINCIPAL_URL "jsecprin:"
char *
RDFJSec_GetPrincipalURLString(char *principalID)
{
size_t size = strlen(principalID);
char* url = getMem(size+strlen(JSEC_PRINCIPAL_URL)+1);
if (url == NULL) {
return NULL;
}
sprintf(url, "%s%s", JSEC_PRINCIPAL_URL, principalID);
strcpy(url, principalID);
return url;
}
RDF_Cursor
RDFJSec_ListAllPrincipals()
{
RDF_Cursor c = RDF_GetSources(gJSecDB, gNavCenter->RDF_JSec, gNavCenter->RDF_JSecPrincipal, RDF_RESOURCE_TYPE, TRUE);
return(c);
}
JSec_Principal
RDFJSec_NextPrincipal(RDF_Cursor c)
{
if (c != NULL) {
return RDF_NextValue(c);
}
return NULL;
}
RDF_Error
RDFJSec_ReleaseCursor(RDF_Cursor c)
{
RDF_Error err;
if (c != NULL) {
err = RDF_DisposeCursor(c);
}
return (err);
}
JSec_Principal
RDFJSec_NewPrincipal(char* principalID)
{
RDF_Resource principalUnit;
char *url = RDFJSec_GetPrincipalURLString(principalID);
if (url == NULL) {
return NULL;
}
principalUnit = RDF_GetResource(NULL, url, FALSE);
if (!principalUnit) {
principalUnit = RDF_GetResource(NULL, url, TRUE);
}
freeMem(url);
return (JSec_Principal)principalUnit;
}
JSec_Error
RDFJSec_AddPrincipal(JSec_Principal pr)
{
if (pr == NULL) {
return JSec_NullObject;
}
if (RDF_HasAssertion(gJSecDB, pr, gNavCenter->RDF_JSecPrincipal, gNavCenter->RDF_JSec,
RDF_RESOURCE_TYPE, PR_FALSE)) {
return JSec_OK;
}
setContainerp(pr, PR_TRUE);
setResourceType(pr, JSEC_RT);
RDF_Assert(gJSecDB, pr, gNavCenter->RDF_JSecPrincipal, gNavCenter->RDF_JSec, RDF_RESOURCE_TYPE);
return JSec_OK;
}
JSec_Error
RDFJSec_DeletePrincipal(JSec_Principal pr)
{
RDF_Cursor c;
if (pr == NULL) {
return JSec_NullObject;
}
/* Before deleting the principal, delete all the PrincipalUses for this principal.
*/
c = RDFJSec_ListAllPrincipalUses(pr);
if (c != NULL) {
JSec_PrincipalUse prUse;
while ((prUse = RDFJSec_NextPrincipalUse(c)) != NULL) {
RDFJSec_DeletePrincipalUse(pr, prUse);
}
}
RDF_Unassert(gJSecDB, pr, gNavCenter->RDF_JSecPrincipal, gNavCenter->RDF_JSec, RDF_RESOURCE_TYPE);
return JSec_OK;
}
char *
RDFJSec_PrincipalID(JSec_Principal pr)
{
char *url = resourceID(pr);
char *ans = getMem(strlen(url)+1);
int n;
if (ans == NULL) {
return NULL;
}
n = charSearch(':', url);
if (n == -1) {
strcpy(ans, url);
} else {
strcpy(ans, url+n+1);
}
return ans;
}
void *
RDFJSec_AttributeOfPrincipal(JSec_Principal pr, char* attributeType)
{
RDF_Resource attributeResource = RDF_GetResource(NULL, attributeType, TRUE);
void *attValue;
RDF_Cursor c = NULL;
c = RDF_GetTargets(gJSecDB, pr, attributeResource, RDF_STRING_TYPE, TRUE);
if (c == NULL) {
return NULL;
}
attValue = RDF_NextValue(c);
RDF_DisposeCursor(c);
return attValue;
}
JSec_Error
RDFJSec_SetPrincipalAttribute(JSec_Principal pr, char* attributeType, void* attValue)
{
RDF_Resource attributeResource = RDF_GetResource(NULL, attributeType, TRUE);
RDF_Assert(gJSecDB, pr, attributeResource, attValue, RDF_STRING_TYPE);
return JSec_OK;
}
RDF_Cursor
RDFJSec_ListAllPrincipalUses(JSec_Principal pr)
{
RDF_Cursor c = NULL;
c = RDF_GetSources(gJSecDB, (RDF_Resource)pr, gCoreVocab->RDF_parent, RDF_RESOURCE_TYPE, true);
return(c);
}
JSec_PrincipalUse
RDFJSec_NextPrincipalUse(RDF_Cursor c)
{
if (c != NULL) {
return RDF_NextValue(c);
}
return NULL;
}
JSec_PrincipalUse
RDFJSec_NewPrincipalUse(JSec_Principal pr, JSec_Target tr, char* priv)
{
RDF_Resource principalUseUnit;
char *targetID = resourceID(tr);
char *principalID = resourceID(pr);
char *principalUseID = getMem(strlen(principalID) + strlen(targetID) + 2);
if (principalUseID == NULL) {
return NULL;
}
sprintf(principalUseID, "%s!%s", principalID, targetID);
principalUseUnit = RDF_GetResource(NULL, principalUseID, FALSE);
if (!principalUseUnit) {
principalUseUnit = RDF_GetResource(NULL, principalUseID, TRUE);
RDFJSec_AddTargetToPrincipalUse(principalUseUnit, tr);
RDFJSec_AddPrincipalUsePrivilege(principalUseUnit, priv);
}
return principalUseUnit;
}
JSec_Error
RDFJSec_AddPrincipalUse(JSec_Principal pr, JSec_PrincipalUse prUse)
{
if ((pr == NULL) || (prUse == NULL)) {
return JSec_NullObject;
}
setContainerp(prUse, PR_TRUE);
setResourceType(prUse, JSEC_RT);
RDF_Assert(gJSecDB, prUse, gCoreVocab->RDF_parent, pr, RDF_RESOURCE_TYPE);
return JSec_OK;
}
JSec_Error
RDFJSec_DeletePrincipalUse (JSec_Principal pr, JSec_PrincipalUse prUse)
{
JSec_Target tr;
char *priv;
if ((pr == NULL) || (prUse == NULL)) {
return JSec_NullObject;
}
/* Before deleting the principal, delete all the PrincipalUses for this principal.
*/
tr = RDFJSec_TargetOfPrincipalUse(prUse);
RDFJSec_DeleteTargetToPrincipalUse(prUse, tr);
priv = RDFJSec_PrivilegeOfPrincipalUse(prUse);
RDFJSec_DeletePrincipalUsePrivilege(prUse, priv);
RDF_Unassert(gJSecDB, prUse, gCoreVocab->RDF_parent, pr, RDF_RESOURCE_TYPE);
return JSec_OK;
}
const char *
RDFJSec_PrincipalUseID(JSec_PrincipalUse prUse)
{
return resourceID(prUse);
}
JSec_Error
RDFJSec_AddPrincipalUsePrivilege (JSec_PrincipalUse prUse, char* priv)
{
char *oldPriv;
if ((prUse == NULL) || (priv == NULL)) {
return JSec_NullObject;
}
/* Each PrincipalUse can only have one Privilege. Thus delete the old privilege*/
oldPriv = RDFJSec_PrivilegeOfPrincipalUse(prUse);
RDFJSec_DeletePrincipalUsePrivilege(prUse, oldPriv);
RDF_Assert(gJSecDB, prUse, gNavCenter->RDF_JSecAccess, priv, RDF_STRING_TYPE);
return JSec_OK;
}
JSec_Error
RDFJSec_DeletePrincipalUsePrivilege (JSec_PrincipalUse prUse, char* priv)
{
if ((prUse == NULL) || (priv == NULL)) {
return JSec_NullObject;
}
RDF_Unassert(gJSecDB, prUse, gNavCenter->RDF_JSecAccess, priv, RDF_STRING_TYPE);
return JSec_OK;
}
char *
RDFJSec_PrivilegeOfPrincipalUse (JSec_PrincipalUse prUse)
{
RDF_Cursor c = NULL;
char *privilege;
c = RDF_GetTargets(gJSecDB, (RDF_Resource)prUse, gNavCenter->RDF_JSecAccess, RDF_STRING_TYPE, TRUE);
if (c == NULL) {
return NULL;
}
privilege = RDF_NextValue(c);
RDF_DisposeCursor(c);
return privilege;
}
JSec_Error
RDFJSec_AddTargetToPrincipalUse(JSec_PrincipalUse prUse, JSec_Target tr)
{
JSec_Target oldTarget;
if ((prUse == NULL) || (tr == NULL)) {
return JSec_NullObject;
}
/* Each PrincipalUse can only have one Target. Thus delete the old target */
oldTarget = RDFJSec_TargetOfPrincipalUse(prUse);
RDFJSec_DeleteTargetToPrincipalUse(prUse, oldTarget);
RDF_Assert(gJSecDB, prUse, gNavCenter->RDF_JSecTarget, tr, RDF_RESOURCE_TYPE);
return JSec_OK;
}
JSec_Error
RDFJSec_DeleteTargetToPrincipalUse(JSec_PrincipalUse prUse, JSec_Target tr)
{
if ((prUse == NULL) || (tr == NULL)) {
return JSec_NullObject;
}
RDF_Unassert(gJSecDB, prUse, gNavCenter->RDF_JSecTarget, tr, RDF_RESOURCE_TYPE);
return JSec_OK;
}
JSec_Target
RDFJSec_TargetOfPrincipalUse (JSec_PrincipalUse prUse)
{
RDF_Cursor c = NULL;
JSec_Target tr;
if (prUse == NULL) {
return NULL;
}
c = RDF_GetTargets(gJSecDB, (RDF_Resource)prUse, gNavCenter->RDF_JSecTarget, RDF_RESOURCE_TYPE, true);
if (c == NULL) {
return NULL;
}
tr = RDF_NextValue(c);
RDF_DisposeCursor(c);
return tr;
}
JSec_Target
RDFJSec_NewTarget(char* targetName, JSec_Principal pr)
{
RDF_Resource tr;
RDF_Resource prResource;
char *principalID = RDFJSec_PrincipalID(pr);
char *targetID = getMem(strlen(targetName) + strlen(principalID) + 2);
if (targetID == NULL) {
return NULL;
}
sprintf(targetID, "%s!%s", targetName, principalID);
tr = RDF_GetResource(NULL, targetID, FALSE);
if (!tr) {
tr = RDF_GetResource(NULL, targetID, TRUE);
if (tr == NULL) {
return NULL;
}
RDFJSec_SetTargetAttribute(tr, "targetName", targetName);
RDF_Assert(gJSecDB, tr, gNavCenter->RDF_JSecPrincipal, pr, RDF_RESOURCE_TYPE);
}
return tr;
}
char *
RDFJSec_GetTargetName(JSec_Target tr)
{
return RDFJSec_AttributeOfTarget(tr, "targetName");
}
char *
RDFJSec_AttributeOfTarget(JSec_Target tr, char* attributeType)
{
RDF_Resource attributeResource = RDF_GetResource(NULL, attributeType, TRUE);
char *attValue;
RDF_Cursor c = NULL;
c = RDF_GetTargets(gJSecDB, tr, attributeResource, RDF_STRING_TYPE, TRUE);
if (c == NULL) {
return NULL;
}
attValue = RDF_NextValue(c);
RDF_DisposeCursor(c);
return attValue;
}
JSec_Error
RDFJSec_SetTargetAttribute(JSec_Target tr, char* attributeType, char* attValue)
{
RDF_Resource attributeResource = RDF_GetResource(NULL, attributeType, TRUE);
RDF_Assert(gJSecDB, tr, attributeResource, attValue, RDF_STRING_TYPE);
return JSec_OK;
}
NSPR_END_EXTERN_C

Просмотреть файл

@ -57,6 +57,7 @@ C_OBJS=.\$(OBJDIR)\vocab.obj \
.\$(OBJDIR)\bmk2mcf.obj \
.\$(OBJDIR)\glue.obj \
.\$(OBJDIR)\rdfht.obj \
.\$(OBJDIR)\jsec2rdf.obj \
$(NULL)

Просмотреть файл

@ -42,6 +42,7 @@ RDFL gAllDBs = 0;
RDFT
getTranslator (char* url)
{
@ -83,11 +84,23 @@ getTranslator (char* url)
ans = MakeFindStore(url);
}
#endif
else if (startsWith("http://", url)) {
ans = MakeFileDB(url);
} else {
ans = NULL;
}
#ifdef MOZILLA_CLIENT
#ifdef DEBUG
{
char* traceLine = getMem(500);
sprintf(traceLine, "\nCreated %s \n", url);
FE_Trace(traceLine);
freeMem(traceLine);
}
#endif
#endif
if (ans) PL_HashTableAdd(dataSourceHash, ans->url, ans);
return ans;
}
@ -97,8 +110,8 @@ getTranslator (char* url)
PR_PUBLIC_API(RDF)
RDF_GetDB (const char** dataSources)
{
uint16 n = 0;
uint16 m = 0;
int32 n = 0;
int32 m = 0;
char* next ;
RDF r = (RDF) getMem(sizeof(struct RDF_DBStruct)) ;
RDFL nrl = (RDFL)getMem(sizeof(struct RDF_ListStruct));
@ -180,13 +193,16 @@ RDF_ReleaseDataSource(RDF rdf, RDFT dataSource)
RDFT next;
while ((next = rdf->translators[n++]) != NULL) {
if (next != dataSource) {
*(temp + m) = (RDFT) next;
*(temp + m++) = (RDFT) next;
}
}
memset(rdf->translators, '\0', sizeof(RDFT) * rdf->numTranslators);
memcpy(rdf->translators, temp, sizeof(RDFT) * (rdf->numTranslators -1));
rdf->numTranslators--;
deleteFromRDFList(dataSource->rdf, rdf);
dataSource->rdf = deleteFromRDFList(dataSource->rdf, rdf);
if ((dataSource->rdf == NULL) && (dataSource->destroy != NULL)) {
(*dataSource->destroy)(dataSource);
}
return 0;
}
@ -233,10 +249,14 @@ RDF_ReleaseDB(RDF rdf)
if (rdf != NULL) {
uint16 n = 0;
uint16 size = rdf->numTranslators;
while (n < size) {
RDFL rlx = (*((RDFT*)rdf->translators + n))->rdf;
(*((RDFT*)rdf->translators + n))->rdf = deleteFromRDFList(rlx, rdf);
callExitRoutine(n, rdf);
while (n < size) {
RDFT rdft = (*((RDFT*)rdf->translators + n));
RDFL rlx ;
if (rdft) {
rlx = rdft->rdf;
rdft->rdf = deleteFromRDFList(rlx, rdf);
if (rdft->rdf == NULL) callExitRoutine(n, rdf);
}
n++;
}
gAllDBs = deleteFromRDFList(gAllDBs, rdf);
@ -410,7 +430,7 @@ iscontainerp (RDF_Resource u)
}
#ifdef MOZILLA_CLIENT
else if (startsWith("file:", id)) {
return fileDirectoryp(u);
return (endsWith("/", id) || fileDirectoryp(u));
} else if (startsWith("ftp:", id) && (endsWith("/", id))) {
return 1;
} else if (startsWith("cache:container", id)) {
@ -433,7 +453,7 @@ resourceTypeFromID (char* id)
return RDF_RT;
} else if (endsWith(".mco", id)) {
return RDF_RT;
} else if (startsWith("file:", id) || (startsWith("NC:LocalFiles", id))) {
} else if (startsWith("file:", id)) {
return LFS_RT;
} else if (startsWith("nes:", id)) {
return ES_RT;
@ -977,9 +997,10 @@ RDF_DeleteNotifiable (RDF_Notification ns)
rdf->notifs = pr->next;
} else {
for (not = rdf->notifs; (not != NULL) ; not = not->next) {
if (ns == not) {
pr->next = not->next;
return 0;
if (ns == not)
{
pr->next = not->next;
break;
}
pr = not;
}
@ -1089,10 +1110,12 @@ void
sendNotifications2 (RDFT r, RDF_EventType opType, RDF_Resource u, RDF_Resource s, void* v, RDF_ValueType type, PRBool tv)
{
RDFL rl = r->rdf;
if ((opType == RDF_ASSERT_NOTIFY) &&
(nlocalStoreHasAssertion(gLocalStore, u, s, v, type, !tv))) {
return;
}
while (rl) {
sendNotifications(rl->rdf, opType, u, s, v, type, tv, r->url);
rl = rl->next;

Просмотреть файл

@ -66,6 +66,9 @@ PRBool containerIDp(char* id);
char * makeNewID ();
PRBool iscontainerp (RDF_Resource u);
RDF_BT resourceTypeFromID (char* id);
RDF_Resource specialUrlResource (char* id);
RDF_Resource NewRDFResource (char* id);
RDF_Resource QuickGetResource (char* id);
RDF_Cursor getSlotValues (RDF rdf, RDF_Resource u, RDF_Resource s, RDF_ValueType type, PRBool inversep, PRBool tv);
void disposeResourceInt (RDF rdf, RDF_Resource u);
void possiblyGCResource (RDF_Resource u);

Просмотреть файл

@ -225,7 +225,6 @@ getFirstToken (char* line, char* nextToken, int16* l)
}
void
addSlotValue (RDFFile f, RDF_Resource u, RDF_Resource s, void* v,
RDF_ValueType type, PRBool tv)
@ -259,8 +258,6 @@ addSlotValue (RDFFile f, RDF_Resource u, RDF_Resource s, void* v,
#endif
}
void
assignSlot (RDF_Resource u, char* slot, char* value, RDFFile f)
{

Просмотреть файл

@ -419,7 +419,8 @@ nlocalStoreNextValue (RDFT rdf, RDF_Cursor c)
if ((c->tv == tvOfAs(nas)) && (c->type == valueTypeOfAs(nas))) {
if (c->type == RDF_RESOURCE_TYPE) {
RDF_Resource nu = RDF_GetResource(NULL, dataOfDBMAs(nas), 1);
if (nu && startsWith("http", resourceID(nu)) && strstr(resourceID(nu), ".rdf")) {
if (nu && startsWith("http:", resourceID(nu)) && strstr(resourceID(nu), ".rdf")) {
RDFL rl = rdf->rdf;
char* dburl = getBaseURL(resourceID(nu));
while (rl) {
@ -891,6 +892,8 @@ MakeLocalStore (char* url)
ntr->arcLabelsOut = nlcStoreArcsOut;
ntr->pdata = db;
DBM_OpenDBMStore(db, (startsWith(url, "rdf:localStore") ? "NavCen" : &url[4]));
nlocalStoreAssert(ntr, gNavCenter->RDF_BookmarkFolderCategory, gCoreVocab->RDF_name,
copyString("Bookmarks"), RDF_STRING_TYPE, 1);
return ntr;
}
else return NULL;

Просмотреть файл

@ -57,12 +57,12 @@ XP_BEGIN_PROTOS
#endif
#define null NULL
#define nullp(x) (((void*)x) == ((void*)0))
#define LookupResource(x) ((RDF_Resource)PL_HashTableLookup(resourceHash, x));
#define noRDFErr 0
#define noMoreValuesErr 1
#define MAX_ATTRIBUTES 10
#define MAX_ATTRIBUTES 64
#define RDF_RT 0
#define LFS_RT 1
@ -78,9 +78,7 @@ XP_BEGIN_PROTOS
#define ATALK_RT 12
#define ATALKVIRTUAL_RT 13
#define COOKIE_RT 14
#ifdef TRANSACTION_RECEIPTS
#define RECEIPT_RT 15
#endif
#define JSEC_RT 15
#define CHECK_VAR(var, return_value) {if (var == NULL) {XP_ASSERT(var); return return_value;}}
@ -185,11 +183,14 @@ struct RDF_TranslatorStruct {
arcLabelsInProc arcLabelsIn;
arcLabelsInProc arcLabelsOut;
accessFileProc possiblyAccessFile;
RDFL dependents;
RDFL dependentOn;
};
extern PLHashTable* resourceHash;
extern PLHashTable* dataSourceHash;
extern char* gNavCntrUrl;
struct RDF_DBStruct {
int16 numTranslators;
int16 translatorArraySize;
@ -400,6 +401,10 @@ RDFT MakeCookieStore (char* url);
char* advertURLOfContainer (RDF r, RDF_Resource u) ;
RDFT RDFTNamed (RDF rdf, char* name) ;
char* RDF_SerializeRDFStore (RDFT store) ;
char * unescapeURL(char *inURL);
extern RDF_WDVocab gWebData;

Просмотреть файл

@ -40,7 +40,7 @@ extern RDF gNCDB ;
extern char *gGlobalHistoryURL;
static PRBool sRDFInitedB = PR_FALSE;
char* gNavCntrUrl;
char * gNavCenterDataSources[15] =
@ -117,11 +117,12 @@ RDF_Init(RDF_InitParams params)
#ifdef MOZILLA_CLIENT
PREF_SetDefaultCharPref("browser.NavCenter", "http://rdf.netscape.com/rdf/navcntr.rdf");
PREF_CopyCharPref("browser.NavCenter", &navCenterURL);
gNavCntrUrl = copyString(navCenterURL);
if (!strchr(navCenterURL, ':')) {
navCenterURL = makeDBURL(navCenterURL);
}
*(gNavCenterDataSources + 1) = copyString(navCenterURL);
gNCDB = newNavCenterDB();
gNCDB = newNavCenterDB();
freeMem(navCenterURL);
HT_Startup();

Просмотреть файл

@ -26,23 +26,56 @@
#include "mcf.h"
#include "mcff2mcf.h"
#define wsCharp(c) ((c == '\r') || (c == '\t') || (c == ' ') || (c == '\n'))
char
decodeEntityRef (char* string, int32* stringIndexPtr, int32 len)
{
if (startsWith("lt;", string)) {
*stringIndexPtr = *stringIndexPtr + 3;
return '<';
} else if (startsWith("gt;", string)) {
*stringIndexPtr = *stringIndexPtr + 3;
return '>';
} else if (startsWith("amp;", string)) {
*stringIndexPtr = *stringIndexPtr + 4;
return '&';
} else return -1;
}
char *
copyStringIgnoreWhiteSpace(char* string)
{
char* buf = (char*)malloc(strlen(string) + 1);
char* token = strtok(string, " \t\n\r");
int32 len = strlen(string);
char* buf = (char*)getMem(len + 1);
PRBool inWhiteSpace = 1;
int32 buffIndex = 0;
int32 stringIndex = 0;
char* p = buf;
while(token)
{
strcpy(p, token);
p += strlen(token);
token = strtok(NULL, " \t\n\r");
if(token)
strcpy(p++, " ");
while (stringIndex < len) {
char nextChar = *(string + stringIndex);
PRBool wsp = wsCharp(nextChar);
if (!wsp) {
if (nextChar == '&') {
*(buf + buffIndex++) = decodeEntityRef(&string[stringIndex+1],
&stringIndex, len-stringIndex);
} else {
*(buf + buffIndex++) = nextChar;
}
inWhiteSpace = 0;
} else if (!inWhiteSpace) {
*(buf + buffIndex++) = ' ';
inWhiteSpace = 1;
} else {
inWhiteSpace = 1;
}
stringIndex++;
}
return buf;
}
@ -180,7 +213,7 @@ addElementProps (char** attlist, char* elementName, RDFFile f, RDF_Resource obj)
char* attName = attlist[count++];
char* attValue = attlist[count++];
if ((attName == NULL) || (attValue == NULL)) break;
if (!tagEquals(f, attName, "href") && !tagEquals(f, attName, "rdf:href")
if (!tagEquals(f, attName, "href") && !tagEquals(f, attName, "rdf:href") && !tagEquals(f, attName, "RDF:href")
&& !tagEquals(f, attName, "id")) {
addSlotValue(f, obj, ResourceFromElementName(f, attName), copyStringIgnoreWhiteSpace(attValue),
RDF_STRING_TYPE, 1);

Просмотреть файл

@ -39,6 +39,7 @@
XP_BEGIN_PROTOS
char decodeEntityRef (char* string, int32* stringIndexPtr, int32 len);
char * copyStringIgnoreWhiteSpace(char* string);
char * getHref(char** attlist);
int parseNextRDFXMLBlob (NET_StreamClass *stream, char* blob, int32 size);

Просмотреть файл

@ -28,7 +28,7 @@
#include "pm2rdf.h"
#include "rdf-int.h"
#include "bmk2mcf.h"
#include "plstr.h"
/* globals */
@ -286,7 +286,7 @@ RDFFilePossiblyAccessFile (RDFT rdf, RDF_Resource u, RDF_Resource s, PRBool inve
(startsWith(rdf->url, resourceID(u))) &&
(s == gCoreVocab->RDF_parent) && (containerp(u))) {
RDFFile newFile = readRDFFile( resourceID(u), u, false, rdf);
readRDFFile( resourceID(u), u, false, rdf);
/* if(newFile) newFile->lastReadTime = PR_Now(); */
}
}
@ -376,7 +376,7 @@ remoteStoreArcLabelsIn (RDFT mcf, RDF_Resource u)
if (u->rarg2) {
RDF_Cursor c = (RDF_Cursor)getMem(sizeof(struct RDF_CursorStruct));
c->u = u;
c->type = RDF_ARC_LABELS_IN_QUERY;
c->queryType = RDF_ARC_LABELS_IN_QUERY;
c->pdata = u->rarg2;
return c;
} else return NULL;
@ -390,8 +390,8 @@ remoteStoreArcLabelsOut (RDFT mcf, RDF_Resource u)
if (u->rarg1) {
RDF_Cursor c = (RDF_Cursor)getMem(sizeof(struct RDF_CursorStruct));
c->u = u;
c->type = RDF_ARC_LABELS_OUT_QUERY;
c->pdata = u->rarg2;
c->queryType = RDF_ARC_LABELS_OUT_QUERY;
c->pdata = u->rarg1;
return c;
} else return NULL;
}
@ -490,10 +490,48 @@ leastRecentlyUsedRDFFile (RDF mcf)
void
gcRDFFileInt (RDFFile f)
{
int32 n = 0;
while (n < f->assertionCount) {
Assertion as = *(f->assertionList + n);
remoteStoreRemove(f->db, as->u, as->s, as->value, as->type);
freeAssertion(as);
*(f->assertionList + n) = NULL;
n++;
}
n = 0;
while (n < f->resourceCount) {
RDF_Resource u = *(f->resourceList + n);
possiblyGCResource(u);
n++;
}
freeMem(f->assertionList);
freeMem(f->resourceList);
}
RDF_Error
DeleteRemStore (RDFT db)
{
RDFFile f = (RDFFile) db->pdata;
RDFFile next;
while (f) {
next = f->next;
gcRDFFileInt(f);
f = next;
}
freeMem(db);
return 0;
}
void
gcRDFFile (RDFFile f)
{
int16 n = 0;
RDFFile f1 = (RDFFile) f->db->pdata;
if (f->locked) return;
@ -511,22 +549,7 @@ gcRDFFile (RDFFile f)
f1 = f1->next;
}
}
while (n < f->assertionCount) {
Assertion as = *(f->assertionList + n);
remoteStoreRemove(f->db, as->u, as->s, as->value, as->type);
freeAssertion(as);
*(f->assertionList + n) = NULL;
n++;
}
n = 0;
while (n < f->resourceCount) {
RDF_Resource u = *(f->resourceList + n);
possiblyGCResource(u);
n++;
}
freeMem(f->assertionList);
freeMem(f->resourceList);
gcRDFFileInt(f);
}
@ -554,19 +577,20 @@ readRDFFile (char* url, RDF_Resource top, PRBool localp, RDFT db)
return NULL;
} else {
RDFFile newFile = makeRDFFile(url, top, localp);
#if defined(DEBUG) && defined(MOZILLA_CLIENT) && defined(XP_WIN)
char* traceLine = getMem(500);
sprintf(traceLine, "\nAccessing %s (%s)\n", url, db->url);
FE_Trace(traceLine);
freeMem(traceLine);
#endif
if (db->pdata) {
newFile->next = (RDFFile) db->pdata;
db->pdata = newFile;
} else {
db->pdata = (RDFFile) newFile;
}
#ifdef DEBUG_guha
{
char* traceLine = getMem(500);
sprintf(traceLine, "Accessing %s", url);
FE_Trace(traceLine);
freeMem(traceLine);
}
#endif
newFile->assert = remoteAssert3;
if (top) {
if (resourceType(top) == RDF_RT) {
@ -641,6 +665,7 @@ NewRemoteStore (char* url)
ntr->nextValue = remoteStoreNextValue;
ntr->disposeCursor = remoteStoreDisposeCursor;
ntr->url = copyString(url);
ntr->destroy = DeleteRemStore;
ntr->arcLabelsIn = remoteStoreArcLabelsIn;
ntr->arcLabelsOut = remoteStoreArcLabelsOut;
}
@ -658,3 +683,82 @@ MakeSCookDB (char* url)
return ntr;
} else return NULL;
}
struct RDFTOutStruct {
char* buffer;
int32 bufferSize;
int32 bufferPos;
char* temp;
RDFT store;
};
typedef struct RDFTOutStruct* RDFTOut;
void addToRDFTOut (RDFTOut out) {
int32 len = strlen(out->temp);
if (len + out->bufferPos < out->bufferSize) {
PL_strcat(out->buffer, out->temp);
out->bufferPos = out->bufferPos + len;
memset(out->temp, '\0', 1000);
} else {
PR_Realloc(out->buffer, out->bufferSize + 20000);
out->bufferSize = out->bufferSize + 20000;
addToRDFTOut (out);
}
}
PRIntn
RDFSerializerEnumerator (PLHashEntry *he, PRIntn i, void *arg)
{
RDF_Resource u = (RDF_Resource)he->value;
RDFTOut out = (RDFTOut) arg;
Assertion as = u->rarg1;
PRBool somethingOutp = 0;
while (as) {
if (as->db == out->store) {
if (!somethingOutp) {
somethingOutp = 1;
sprintf(out->temp, "<RDF:Description href=\"%s\">\n", resourceID(as->u));
addToRDFTOut(out);
}
if (as->type == RDF_RESOURCE_TYPE) {
sprintf(out->temp, " <%s href=\"%s\"/>\n", resourceID(as->s),
resourceID((RDF_Resource)as->value));
} else if (as->type == RDF_INT_TYPE) {
sprintf(out->temp, " <%s dt=\"int\">%i</%s>\n", resourceID(as->s),
(int)as->value, resourceID(as->s));
} else {
sprintf(out->temp, " <%s>%s</%s>\n", resourceID(as->s),
(char*)as->value, resourceID(as->s));
}
addToRDFTOut(out);
}
as = as->next;
}
if (somethingOutp) {
sprintf(out->temp, "</RDF:Description>\n\n");
addToRDFTOut(out);
}
return HT_ENUMERATE_NEXT;
}
char*
RDF_SerializeRDFStore (RDFT store) {
RDFTOut out = getMem(sizeof(struct RDFTOutStruct));
char* ans = out->buffer = getMem(20000);
out->bufferSize = 20000;
out->temp = getMem(1000);
out->store = store;
sprintf(out->temp, "<RDF:RDF>\n\n");
addToRDFTOut(out);
PL_HashTableEnumerateEntries(resourceHash, RDFSerializerEnumerator, out);
sprintf(out->temp, "</RDF:RDF>\n\n");
addToRDFTOut(out);
freeMem(out->temp);
freeMem(out);
return ans;
}

Просмотреть файл

@ -59,6 +59,8 @@ void * arcLabelsOutNextValue (RDFT mcf, RDF_Cursor c);
void * arcLabelsInNextValue (RDFT mcf, RDF_Cursor c);
void * remoteStoreNextValue (RDFT mcf, RDF_Cursor c);
RDF_Error remoteStoreDisposeCursor (RDFT mcf, RDF_Cursor c);
void gcRDFFileInt (RDFFile f);
RDF_Error DeleteRemStore (RDFT db);
void gcRDFFile (RDFFile f);
void RDFFilePossiblyAccessFile (RDFT rdf, RDF_Resource u, RDF_Resource s, PRBool inversep);
void possiblyRefreshRDFFiles ();

Просмотреть файл

@ -321,7 +321,7 @@ urlEquals (const char* url1, const char* url2)
PRBool
isSeparator (RDF_Resource r)
{
return (startsWith("separator", resourceID(r))) ;
return (startsWith("separator", resourceID(r)) || startsWith("nc:separator", resourceID(r))) ;
}
@ -402,6 +402,38 @@ resourceID(RDF_Resource r)
return r->url;
}
char* opTypeToString (RDF_EventType opType) {
switch (opType) {
case RDF_ASSERT_NOTIFY :
return "Assert";
case RDF_INSERT_NOTIFY :
return "Insert";
case RDF_DELETE_NOTIFY :
return "Unassert";
}
return "Unknown Op";
}
void traceNotify (char* event, RDF_Resource u, RDF_Resource s, void* v, RDF_ValueType type) {
#ifdef DEBUG_guha1
char* traceLine = getMem(1000);
if (type == RDF_INT_TYPE) {
sprintf(traceLine, "%s %s(%s, %i)\n",
event, resourceID(s), resourceID(u), (int) v);
} else if (type == RDF_STRING_TYPE){
sprintf(traceLine, "%s %s(%s, \"%s\")\n",
event, resourceID(s), resourceID(u), (char*) v);
} else if (type == RDF_RESOURCE_TYPE) {
sprintf(traceLine, "%s %s(%s, %s)\n",
event, resourceID(s), resourceID(u), resourceID((RDF_Resource)v));
} else {
sprintf(traceLine, "%s <gubbish>\n", event);
}
FE_Trace(traceLine);
freeMem(traceLine);
#endif
}
char *
@ -489,11 +521,12 @@ RDFUtil_SetQuickFileFolder(RDF_Resource container)
}
RDF_Resource gPTFolder = NULL;
PR_PUBLIC_API(RDF_Resource)
RDFUtil_GetPTFolder()
{
return RDFUtil_GetFirstInstance(gNavCenter->RDF_PersonalToolbarFolderCategory, "PersonalToolbar");
if (gPTFolder) return gPTFolder;
return (gPTFolder = RDFUtil_GetFirstInstance(gNavCenter->RDF_PersonalToolbarFolderCategory, "PersonalToolbar"));
}
@ -548,7 +581,8 @@ NET_InitRDFCookieResources (void) ;
PR_PUBLIC_API(void)
RDF_AddCookieResource(char* name, char* path, char* host, char* expires) {
RDF_AddCookieResource(char* name, char* path, char* host, char* expires, char* value,
PRBool isDomain, PRBool secure) {
char* url = getMem(strlen(name) + strlen(host) + strlen(path) + 10);
RDF_Resource ru;
RDF_Resource hostUnit = RDF_GetResource(NULL, host, 0);
@ -562,6 +596,13 @@ RDF_AddCookieResource(char* name, char* path, char* host, char* expires) {
sprintf(url, "cookie:%s!%s!%s", host, path, name);
ru = RDF_GetResource(NULL, url, 1);
setResourceType(ru, COOKIE_RT);
remoteStoreAdd(gCookieStore, ru, gCoreVocab->RDF_name, name, RDF_STRING_TYPE, 1);
remoteStoreAdd(gCookieStore, ru, gNavCenter->cookieDomain, (void *)((isDomain) ? 1:0), RDF_INT_TYPE, 1);
remoteStoreAdd(gCookieStore, ru, gNavCenter->cookieValue, value, RDF_STRING_TYPE, 1);
remoteStoreAdd(gCookieStore, ru, gNavCenter->cookieHost, host, RDF_STRING_TYPE, 1);
remoteStoreAdd(gCookieStore, ru, gNavCenter->cookiePath, path, RDF_STRING_TYPE, 1);
remoteStoreAdd(gCookieStore, ru, gNavCenter->cookieSecure, (void *)((secure) ? 1:0), RDF_INT_TYPE, 1);
remoteStoreAdd(gCookieStore, ru, gNavCenter->cookieExpires, expires, RDF_STRING_TYPE, 1);
remoteStoreAdd(gCookieStore, ru, gCoreVocab->RDF_parent, hostUnit, RDF_RESOURCE_TYPE, 1);
}
@ -736,7 +777,7 @@ MakeCookieStore (char* url)
ntr->nextValue = CookieGetNextValue;
ntr->disposeCursor = CookieDisposeCursor;
gCookieStore = ntr;
/* NET_InitRDFCookieResources ( ) ; */
/* NET_InitRDFCookieResources ( ) ; */
return ntr;
} else return gCookieStore;
} else return NULL;

Просмотреть файл

@ -68,6 +68,11 @@ uint8 resourceType (RDF_Resource r);
void setResourceType (RDF_Resource r, uint8 val);
char * resourceID(RDF_Resource r);
char * makeResourceName (RDF_Resource node);
char* opTypeToString (RDF_EventType opType) ;
void traceNotify (char* event, RDF_Resource u, RDF_Resource s, void* v, RDF_ValueType type) ;
void AddCookieResource(char* name, char* path, char* host, char* expires);
void RDF_ReadCookies(char * filename);
PRBool CookieUnassert (RDFT r, RDF_Resource u, RDF_Resource s, void* v, RDF_ValueType type);

Просмотреть файл

@ -27,19 +27,24 @@
/* globals */
#ifdef XP_MAC
#ifdef XP_MAC
#pragma export on
#endif
RDF_WDVocab gWebData = NULL;
RDF_NCVocab gNavCenter = NULL;
RDF_CoreVocab gCoreVocab = NULL;
#ifdef XP_MAC
#ifdef XP_MAC
#pragma export off
#endif
size_t gCoreVocabSize = 0;
RDF_Resource* gAllVocab;
/* externs */
extern char* gLocalStoreURL;
extern char* profileDirURL;
@ -130,11 +135,14 @@ createNavCenterVocab () {
gNavCenter->RDF_History = createContainer("NC:History");
gNavCenter->RDF_HistoryBySite = createContainer("NC:HistoryBySite");
gNavCenter->RDF_HistoryByDate = createContainer("NC:HistoryByDate");
gNavCenter->RDF_HistoryMostVisited = createContainer("NC:HistoryMostVisited");
setResourceType(gNavCenter->RDF_History, HISTORY_RT);
setResourceType(gNavCenter->RDF_HistoryBySite, HISTORY_RT);
setResourceType(gNavCenter->RDF_HistoryByDate, HISTORY_RT);
setResourceType(gNavCenter->RDF_HistoryMostVisited, HISTORY_RT);
gNavCenter->RDF_bookmarkAddDate = newResource("bookmarkAddDate", RDF_ADDED_ON_STR);
gNavCenter->RDF_PersonalToolbarFolderCategory = RDF_GetResource(gCoreDB, "PersonalToolbarCat", true);
gNavCenter->RDF_PersonalToolbarFolderCategory =
RDF_GetResource(gCoreDB, "PersonalToolbarCat", true);
gNavCenter->RDF_Column = RDF_GetResource(gCoreDB, "Column", true);
gNavCenter->RDF_ColumnResource = RDF_GetResource(gCoreDB, "ColumnResource", true);
gNavCenter->RDF_ColumnWidth = RDF_GetResource(gCoreDB, "ColumnWidth", true);
@ -144,7 +152,8 @@ createNavCenterVocab () {
gNavCenter->RDF_largeIcon = newResource("largeIcon", RDF_LARGE_ICON_URL_STR);
gNavCenter->RDF_HTMLURL = newResource("htmlURL", RDF_HTML_URL_STR);
gNavCenter->RDF_HTMLHeight = newResource("htmlHeight", RDF_HTML_HEIGHT_STR);
gNavCenter->RDF_LocalFiles = RDF_GetResource(gCoreDB, "NC:LocalFiles", true);
gNavCenter->RDF_LocalFiles = createContainer("NC:LocalFiles");
/* setResourceType(gNavCenter->RDF_LocalFiles, LFS_RT); */
gNavCenter->RDF_FTP = createContainer("NC:FTP");
gNavCenter->RDF_FTP = newResource("NC:FTP", RDF_FTP_NAME_STR);
gNavCenter->RDF_Appletalk = createContainer("NC:Appletalk");
@ -155,6 +164,7 @@ createNavCenterVocab () {
gNavCenter->RDF_Password = RDF_GetResource(gCoreDB, "password", true);
gNavCenter->RDF_SBProviders = RDF_GetResource(gCoreDB, "NC:SmartBrowsingProviders", true);
gNavCenter->RDF_WorkspacePos = RDF_GetResource(gCoreDB, "workspacePos", true);
gNavCenter->RDF_ItemPos = RDF_GetResource(gCoreDB, "pos", true);
gNavCenter->RDF_Locks = RDF_GetResource(gCoreDB, "locks", true);
gNavCenter->RDF_AddLock = RDF_GetResource(gCoreDB, "addLock", true);
gNavCenter->RDF_DeleteLock = RDF_GetResource(gCoreDB, "deleteLock", true);
@ -166,27 +176,34 @@ createNavCenterVocab () {
gNavCenter->RDF_DefaultSelectedView = RDF_GetResource(gCoreDB, "selectedView", true);
gNavCenter->RDF_AutoOpen = RDF_GetResource(gCoreDB, "autoOpen", true);
gNavCenter->RDF_resultType = RDF_GetResource (gCoreDB, "resultType", true);
gNavCenter->RDF_methodType = RDF_GetResource (gCoreDB, "methodType", true);
gNavCenter->RDF_prompt = RDF_GetResource (gCoreDB, "prompt", true);
gNavCenter->RDF_HTMLType = RDF_GetResource (gCoreDB, "HTMLPage", true);
gNavCenter->RDF_URLShortcut = RDF_GetResource(gCoreDB, "URLShortcut", true);
gNavCenter->RDF_Cookies = createContainer("NC:Cookies");
#ifdef TRANSACTION_RECEIPTS
gNavCenter->RDF_Receipts = createContainer("NC:Receipts");
#endif
setResourceType(gNavCenter->RDF_Cookies, COOKIE_RT);
gNavCenter->RDF_Toolbar = createContainer("NC:Toolbar");
gNavCenter->RDF_JSec = createContainer("NC:Jsec");
gNavCenter->RDF_JSecPrincipal = RDF_GetResource(gCoreDB, "JsecPrincipal", true);
gNavCenter->RDF_JSecTarget = RDF_GetResource(gCoreDB, "JsecTarget", true);
gNavCenter->RDF_JSecAccess = RDF_GetResource(gCoreDB, "JsecAccess", true);
/* Commands */
gNavCenter->RDF_Command = RDF_GetResource (gCoreDB, "Command", true);
gNavCenter->RDF_Command_Launch = RDF_GetResource(gCoreDB, "Command:Launch", true);
gNavCenter->RDF_Command_Refresh = RDF_GetResource(gCoreDB, "Command:Refresh", true);
gNavCenter->RDF_Command_Reveal = RDF_GetResource(gCoreDB, "Command:Reveal", true);
gNavCenter->RDF_Command_Atalk_FlatHierarchy = RDF_GetResource(gCoreDB, "Command:at:View Zone List", true);
gNavCenter->RDF_Command_Atalk_Hierarchy = RDF_GetResource(gCoreDB, "Command:at:View Zone Hierarchy", true);
/* NavCenter appearance styles */
gNavCenter->treeFGColor = newResource("treeFGColor", RDF_FOREGROUND_COLOR_STR);
gNavCenter->treeBGColor = newResource("treeBGColor", RDF_BACKGROUND_COLOR_STR);
gNavCenter->treeBGURL = newResource("treeBGURL", RDF_BACKGROUND_IMAGE_STR);
gNavCenter->viewFGColor = newResource("viewFGColor", RDF_FOREGROUND_COLOR_STR);
gNavCenter->viewBGColor = newResource("viewBGColor", RDF_BACKGROUND_COLOR_STR);
gNavCenter->viewBGURL = newResource("viewBGURL", RDF_BACKGROUND_IMAGE_STR);
gNavCenter->showTreeConnections = newResource("showTreeConnections", RDF_SHOW_TREE_CONNECTIONS_STR);
gNavCenter->treeConnectionFGColor = newResource("treeConnectionFGColor", RDF_CONNECTION_FG_COLOR_STR);
gNavCenter->treeOpenTriggerIconURL = newResource("treeOpenTriggerIconURL", RDF_OPEN_TRIGGER_IMAGE_STR);
@ -209,6 +226,35 @@ createNavCenterVocab () {
gNavCenter->selectedColumnHeaderBGColor = newResource("selectedColumnHeaderBGColor", RDF_SELECTED_HEADER_BG_COLOR_STR);
gNavCenter->showColumnHilite = newResource("showColumnHilite", RDF_SHOW_COLUMN_HILITING_STR);
gNavCenter->triggerPlacement = newResource("triggerPlacement", RDF_TRIGGER_PLACEMENT_STR);
/* Toolbars */
/* Toolbar Appearance Styles */
gNavCenter->toolbarBitmapPosition = newResource("toolbarBitmapPosition", 0 /* XXX "Toolbar Bitmap Position" */ );
gNavCenter->toolbarButtonsFixedSize = newResource("toolbarButtonsFixedSize", 0 /* XXX "Toolbar Bitmap Position" */ );
gNavCenter->RDF_smallDisabledIcon = newResource("smallDisabledIcon", 0 /* XXX */);
gNavCenter->RDF_largeDisabledIcon = newResource("largeDisabledIcon", 0 /* XXX */);
gNavCenter->RDF_smallRolloverIcon = newResource("smallRolloverIcon", 0 /* XXX */);
gNavCenter->RDF_largeRolloverIcon = newResource("largeRolloverIcon", 0 /* XXX */);
gNavCenter->RDF_smallPressedIcon = newResource("smallPressedIcon", 0 /* XXX */);
gNavCenter->RDF_largePressedIcon = newResource("largePressedIcon", 0 /* XXX */);
gNavCenter->buttonTooltipText = newResource("buttonTooltipText", 0 /* XXX */);
gNavCenter->buttonStatusbarText = newResource("buttonStatusbarText", 0 /* XXX */);
gNavCenter->urlBar = newResource("urlBar", 0 /* XXX */);
gNavCenter->urlBarWidth = newResource("urlBarWidth", 0 /* XXX */);
gNavCenter->pos = newResource("pos", 0 /* XXX */);
gNavCenter->viewRolloverColor = newResource("viewRolloverColor", 0 /* XXX */);
gNavCenter->viewPressedColor = newResource("viewPressedColor", 0 /* XXX */);
gNavCenter->viewDisabledColor = newResource("viewDisabledColor", 0 /* XXX */);
/* Cookies */
gNavCenter->cookieDomain = newResource("cookieDomain", 0 /* XXX */);
gNavCenter->cookieValue = newResource("cookieValue", 0 /* XXX */);
gNavCenter->cookieHost = newResource("cookieHost", 0 /* XXX */);
gNavCenter->cookiePath = newResource("cookiePath", 0 /* XXX */);
gNavCenter->cookieSecure = newResource("cookieSecure", 0 /* XXX */);
gNavCenter->cookieExpires = newResource("cookieExpiration", 0 /* XXX */);
#endif /* MOZILLA_CLIENT */
}
@ -221,6 +267,7 @@ createWebDataVocab ()
#ifdef MOZILLA_CLIENT
gWebData->RDF_URL = newResource("URL", RDF_URL_STR);
gWebData->RDF_description = newResource("description", RDF_DESCRIPTION_STR);
gWebData->RDF_keyword = newResource("keyword", 0 /* XXX */);
gWebData->RDF_Container = RDF_GetResource (gCoreDB, "Container", true);
gWebData->RDF_firstVisitDate = newResource("firstVisitDate", RDF_FIRST_VISIT_STR);
gWebData->RDF_lastVisitDate = newResource("lastVisitDate", RDF_LAST_VISIT_STR);
@ -273,9 +320,9 @@ getResourceDefaultName(RDF_Resource node)
else if (node == gWebData->RDF_creationDate) strID = RDF_CREATED_ON_STR;
else if (node == gWebData->RDF_lastModifiedDate) strID = RDF_LAST_MOD_STR;
else if (node == gWebData->RDF_size) strID = RDF_SIZE_STR;
else if (node == gNavCenter->treeFGColor) strID = RDF_FOREGROUND_COLOR_STR;
else if (node == gNavCenter->treeBGColor) strID = RDF_BACKGROUND_COLOR_STR;
else if (node == gNavCenter->treeBGURL) strID = RDF_BACKGROUND_IMAGE_STR;
else if (node == gNavCenter->viewFGColor) strID = RDF_FOREGROUND_COLOR_STR;
else if (node == gNavCenter->viewBGColor) strID = RDF_BACKGROUND_COLOR_STR;
else if (node == gNavCenter->viewBGURL) strID = RDF_BACKGROUND_IMAGE_STR;
else if (node == gNavCenter->showTreeConnections) strID = RDF_SHOW_TREE_CONNECTIONS_STR;
else if (node == gNavCenter->treeConnectionFGColor) strID = RDF_CONNECTION_FG_COLOR_STR;
else if (node == gNavCenter->treeOpenTriggerIconURL) strID = RDF_OPEN_TRIGGER_IMAGE_STR;
@ -306,3 +353,5 @@ getResourceDefaultName(RDF_Resource node)
#endif /* MOZILLA_CLIENT */
return(defaultName);
}
char *gDefaultNavcntr = "<RDF:RDF> <Topic id=\"NC:Toolbar\"> <child> <Topic id=\"NC:CommandToolBar\" name=\"Command Toolbar\" toolbarBitmapPosition=\"top\" toolbarButtonsFixedSize=\"yes\"> <child href=\"command:back\" name=\"Back\"/> <child buttonTooltipText=\"Reload this page from the server\" buttonStatusbarText=\"Reload the current page\" href=\"command:reload\" name=\"Reload\"/> <child href=\"command:forward\" name=\"Forward\"/> <child name=\"separator0\" href=\"nc:separator0\"/> <child href=\"command:urlbar\" name=\"Go: \" buttonStatusBarText=\"Location/Search Bar\" buttonTooltipText=\"Location/Search Bar\" urlBar=\"Yes\" urlBarWidth=\"*\"/> <child name=\"separator2\" href=\"nc:separator2\"/> <child> <Topic id=\"NC:Bookmarks\" name=\"Bookmarks\"> <child> <Topic id=\"NC:NavInternals\" name=\"Navigator Internals\"> <child href=\"NC:SmartBrowsingProviders\" name=\"SmartBrowsing Providers\"/> <child href=\"NC:Toolbar\" name=\"Toolbars\"/> <child href=\"NC:Receipts\" name=\"Receipts\"/> </Topic> </child> </Topic> </child> <child> <Topic id=\"NC:History\" largeIcon=\"icon/large:workspace,history\" name=\"History\" > <child href=\"NC:HistoryMostVisited\" name=\"Most Frequented Pages\"/> <child href=\"NC:HistoryBySite\" name=\"History By Site\"/> <child href=\"NC:HistoryByDate\" name=\"History By Date\"/> </Topic> </child> </Topic> </child> <child id=\"NC:PersonalToolbar\" > </Topic> </RDF:RDF> ";